Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6
  • Loading branch information
Linus Torvalds committed Jan 5, 2006
2 parents f61ea1b + ac67c62 commit d779188
Show file tree
Hide file tree
Showing 67 changed files with 11,404 additions and 2,390 deletions.
72 changes: 72 additions & 0 deletions Documentation/networking/gianfar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
The Gianfar Ethernet Driver
Sysfs File description

Author: Andy Fleming <[email protected]>
Updated: 2005-07-28

SYSFS

Several of the features of the gianfar driver are controlled
through sysfs files. These are:

bd_stash:
To stash RX Buffer Descriptors in the L2, echo 'on' or '1' to
bd_stash, echo 'off' or '0' to disable

rx_stash_len:
To stash the first n bytes of the packet in L2, echo the number
of bytes to buf_stash_len. echo 0 to disable.

WARNING: You could really screw these up if you set them too low or high!
fifo_threshold:
To change the number of bytes the controller needs in the
fifo before it starts transmission, echo the number of bytes to
fifo_thresh. Range should be 0-511.

fifo_starve:
When the FIFO has less than this many bytes during a transmit, it
enters starve mode, and increases the priority of TX memory
transactions. To change, echo the number of bytes to
fifo_starve. Range should be 0-511.

fifo_starve_off:
Once in starve mode, the FIFO remains there until it has this
many bytes. To change, echo the number of bytes to
fifo_starve_off. Range should be 0-511.

CHECKSUM OFFLOADING

The eTSEC controller (first included in parts from late 2005 like
the 8548) has the ability to perform TCP, UDP, and IP checksums
in hardware. The Linux kernel only offloads the TCP and UDP
checksums (and always performs the pseudo header checksums), so
the driver only supports checksumming for TCP/IP and UDP/IP
packets. Use ethtool to enable or disable this feature for RX
and TX.

VLAN

In order to use VLAN, please consult Linux documentation on
configuring VLANs. The gianfar driver supports hardware insertion and
extraction of VLAN headers, but not filtering. Filtering will be
done by the kernel.

MULTICASTING

The gianfar driver supports using the group hash table on the
TSEC (and the extended hash table on the eTSEC) for multicast
filtering. On the eTSEC, the exact-match MAC registers are used
before the hash tables. See Linux documentation on how to join
multicast groups.

PADDING

The gianfar driver supports padding received frames with 2 bytes
to align the IP header to a 16-byte boundary, when supported by
hardware.

ETHTOOL

The gianfar driver supports the use of ethtool for many
configuration options. You must run ethtool only on currently
open interfaces. See ethtool documentation for details.
86 changes: 32 additions & 54 deletions drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,16 +586,16 @@ struct rtl8139_private {
dma_addr_t tx_bufs_dma;
signed char phys[4]; /* MII device addresses. */
char twistie, twist_row, twist_col; /* Twister tune state. */
unsigned int default_port:4; /* Last dev->if_port value. */
unsigned int default_port : 4; /* Last dev->if_port value. */
unsigned int have_thread : 1;
spinlock_t lock;
spinlock_t rx_lock;
chip_t chipset;
pid_t thr_pid;
wait_queue_head_t thr_wait;
struct completion thr_exited;
u32 rx_config;
struct rtl_extra_stats xstats;
int time_to_die;

struct work_struct thread;

struct mii_if_info mii;
unsigned int regs_len;
unsigned long fifo_copy_timeout;
Expand All @@ -620,7 +620,7 @@ static int rtl8139_open (struct net_device *dev);
static int mdio_read (struct net_device *dev, int phy_id, int location);
static void mdio_write (struct net_device *dev, int phy_id, int location,
int val);
static void rtl8139_start_thread(struct net_device *dev);
static void rtl8139_start_thread(struct rtl8139_private *tp);
static void rtl8139_tx_timeout (struct net_device *dev);
static void rtl8139_init_ring (struct net_device *dev);
static int rtl8139_start_xmit (struct sk_buff *skb,
Expand All @@ -637,6 +637,7 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
static void rtl8139_set_rx_mode (struct net_device *dev);
static void __set_rx_mode (struct net_device *dev);
static void rtl8139_hw_start (struct net_device *dev);
static void rtl8139_thread (void *_data);
static struct ethtool_ops rtl8139_ethtool_ops;

/* write MMIO register, with flush */
Expand Down Expand Up @@ -1007,8 +1008,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
(debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1));
spin_lock_init (&tp->lock);
spin_lock_init (&tp->rx_lock);
init_waitqueue_head (&tp->thr_wait);
init_completion (&tp->thr_exited);
INIT_WORK(&tp->thread, rtl8139_thread, dev);
tp->mii.dev = dev;
tp->mii.mdio_read = mdio_read;
tp->mii.mdio_write = mdio_write;
Expand Down Expand Up @@ -1345,7 +1345,7 @@ static int rtl8139_open (struct net_device *dev)
dev->irq, RTL_R8 (MediaStatus),
tp->mii.full_duplex ? "full" : "half");

rtl8139_start_thread(dev);
rtl8139_start_thread(tp);

return 0;
}
Expand Down Expand Up @@ -1594,55 +1594,43 @@ static inline void rtl8139_thread_iter (struct net_device *dev,
RTL_R8 (Config1));
}

static int rtl8139_thread (void *data)
static void rtl8139_thread (void *_data)
{
struct net_device *dev = data;
struct net_device *dev = _data;
struct rtl8139_private *tp = netdev_priv(dev);
unsigned long timeout;

daemonize("%s", dev->name);
allow_signal(SIGTERM);

while (1) {
timeout = next_tick;
do {
timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
/* make swsusp happy with our thread */
try_to_freeze();
} while (!signal_pending (current) && (timeout > 0));

if (signal_pending (current)) {
flush_signals(current);
}
unsigned long thr_delay;

if (tp->time_to_die)
break;

if (rtnl_lock_interruptible ())
break;
if (rtnl_shlock_nowait() == 0) {
rtl8139_thread_iter (dev, tp, tp->mmio_addr);
rtnl_unlock ();

thr_delay = next_tick;
} else {
/* unlikely race. mitigate with fast poll. */
thr_delay = HZ / 2;
}

complete_and_exit (&tp->thr_exited, 0);
schedule_delayed_work(&tp->thread, thr_delay);
}

static void rtl8139_start_thread(struct net_device *dev)
static void rtl8139_start_thread(struct rtl8139_private *tp)
{
struct rtl8139_private *tp = netdev_priv(dev);

tp->thr_pid = -1;
tp->twistie = 0;
tp->time_to_die = 0;
if (tp->chipset == CH_8139_K)
tp->twistie = 1;
else if (tp->drv_flags & HAS_LNK_CHNG)
return;

tp->thr_pid = kernel_thread(rtl8139_thread, dev, CLONE_FS|CLONE_FILES);
if (tp->thr_pid < 0) {
printk (KERN_WARNING "%s: unable to start kernel thread\n",
dev->name);
tp->have_thread = 1;

schedule_delayed_work(&tp->thread, next_tick);
}

static void rtl8139_stop_thread(struct rtl8139_private *tp)
{
if (tp->have_thread) {
cancel_rearming_delayed_work(&tp->thread);
tp->have_thread = 0;
}
}

Expand Down Expand Up @@ -2224,22 +2212,12 @@ static int rtl8139_close (struct net_device *dev)
{
struct rtl8139_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
int ret = 0;
unsigned long flags;

netif_stop_queue (dev);

if (tp->thr_pid >= 0) {
tp->time_to_die = 1;
wmb();
ret = kill_proc (tp->thr_pid, SIGTERM, 1);
if (ret) {
printk (KERN_ERR "%s: unable to signal thread\n", dev->name);
return ret;
}
wait_for_completion (&tp->thr_exited);
}

rtl8139_stop_thread(tp);

if (netif_msg_ifdown(tp))
printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n",
dev->name, RTL_R16 (IntrStatus));
Expand Down
17 changes: 15 additions & 2 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,8 @@ config E1000_NAPI

If in doubt, say N.

source "drivers/net/ixp2000/Kconfig"

config MYRI_SBUS
tristate "MyriCOM Gigabit Ethernet support"
depends on SBUS
Expand Down Expand Up @@ -2008,7 +2010,18 @@ config SKGE

It does not support the link failover and network management
features that "portable" vendor supplied sk98lin driver does.



config SKY2
tristate "SysKonnect Yukon2 support (EXPERIMENTAL)"
depends on PCI && EXPERIMENTAL
select CRC32
---help---
This driver support the Marvell Yukon 2 Gigabit Ethernet adapter.

To compile this driver as a module, choose M here: the module
will be called sky2. This is recommended.

config SK98LIN
tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support"
depends on PCI
Expand Down Expand Up @@ -2120,7 +2133,7 @@ config BNX2

config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
depends on PCI && PPC_BPA
depends on PCI && PPC_CELL
help
This driver supports the Gigabit Ethernet chips present on the
Cell Processor-Based Blades from IBM.
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ obj-$(CONFIG_CHELSIO_T1) += chelsio/
obj-$(CONFIG_BONDING) += bonding/
obj-$(CONFIG_GIANFAR) += gianfar_driver.o

gianfar_driver-objs := gianfar.o gianfar_ethtool.o gianfar_mii.o
gianfar_driver-objs := gianfar.o \
gianfar_ethtool.o \
gianfar_mii.o \
gianfar_sysfs.o

#
# link order important here
Expand Down Expand Up @@ -59,6 +62,7 @@ spidernet-y += spider_net.o spider_net_ethtool.o sungem_phy.o
obj-$(CONFIG_SPIDER_NET) += spidernet.o
obj-$(CONFIG_TC35815) += tc35815.o
obj-$(CONFIG_SKGE) += skge.o
obj-$(CONFIG_SKY2) += sky2.o
obj-$(CONFIG_SK98LIN) += sk98lin/
obj-$(CONFIG_SKFP) += skfp/
obj-$(CONFIG_VIA_RHINE) += via-rhine.o
Expand Down Expand Up @@ -202,6 +206,7 @@ obj-$(CONFIG_NET_TULIP) += tulip/
obj-$(CONFIG_HAMRADIO) += hamradio/
obj-$(CONFIG_IRDA) += irda/
obj-$(CONFIG_ETRAX_ETHERNET) += cris/
obj-$(CONFIG_ENP2611_MSF_NET) += ixp2000/

obj-$(CONFIG_NETCONSOLE) += netconsole.o

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

obj-$(CONFIG_BONDING) += bonding.o

bonding-objs := bond_main.o bond_3ad.o bond_alb.o
bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o

Loading

0 comments on commit d779188

Please sign in to comment.