2.4.x net driver updates
Subsystems (2)
PATCH 1/1 2.4.x net driver updates
Marcelo, please do a
bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.4
This will update the following files:
drivers/net/3c527.c | 7 drivers/net/8139cp.c | 331 ++++++++++++++++------------------------ drivers/net/8139too.c | 70 ++++---- drivers/net/eth16i.c | 3 drivers/net/fmv18x.c | 3 drivers/net/pcmcia/3c574_cs.c | 9 - drivers/net/pcmcia/axnet_cs.c | 3 drivers/net/pcmcia/pcnet_cs.c | 3 drivers/net/pcmcia/xirc2ps_cs.c | 9 - drivers/net/seeq8005.c | 4 drivers/net/yellowfin.c | 4 11 files changed, 199 insertions(+), 247 deletions(-)
through these ChangeSets:
<[email protected]> (03/08/31 1.1114)
[netdrvr] fix skb_padto bugs introduced when skb_padto was introduced
It seems that skb_padto security fixes in 2.4 and 2.5 trying to fix "CAN-2003-0001:Multiple ethernet NID device drivers do not pad frames with null bytes", do not put the skb_padto blocks in proper places in the 3c527, eth16i, fmv18x, seeq8005, yellowfin device drivers.
In case a driver calls skb_padto(), it is possible
that the space available in the original skb buffer tailroom is less than the space to pad. In this case, in short, the skb_padto() will create a new skb buffer, copy data from the original skb buffer to a new skb buffer, free the original buffer, and finally return the new buffer.
If this happens to the aforementioned device drivers, they come to point to wrong data. And, for 3c527 and yellowfin, the drivers can unexpectedly double free the original skb buffers since they still point to the original skb buffers. The attached patch against 2.4.23pre1 fixes these issues.
<[email protected]> (03/08/31 1.1113)
[netdrvr 8139too] remove useless board names
The only thing that differentiated most of the entries in the board_info[] table and the board_t type was the vendor branding string for the board. This table is a pain to maintain, so we prefer to simply use "RTL8129" or "RTL8139".
<[email protected]> (03/08/31 1.1112)
[netdrvr 8139too] fix and pci ids needed for SH platform
a.k.a. Sega Broadband Adapter.
<[email protected]> (03/08/31 1.1111)
[netdrvr pcmcia] support SIOC[GS]MII{PHY,REG} ioctls
Updated drivers; 3c574_cs, axnet_cs, pcnet_cs, xirc2ps_cs
Thanks to Komuro for pointing this out.
<[email protected]> (03/08/31 1.1110)
[netdrvr 8139too] make features more persistent; fix PCI DAC mode
* only set PCIDAC (64-bit PCI) bit in hardware if sizeof(dma_addr_t) > 32. Need a better test for whether 64-bit mode is _really_ needed.
* cache chip command register in private struct. this allows the setting of rx-vlan, rx-csum, and other features to be persistent across the entire lifetime of the net device.
* remove dead private struct members frag_skb, dropping_frag, and pci_using_dac.
<[email protected]> (03/08/31 1.1109)
[netdrvr 8139cp] stats improvements and fixes
* make sure rx_frags is still accounted
* query RxMissed register, and clear, upon each get-stats func call
<[email protected]> (03/08/30 1.1108)
[netdrvr 8139cp] bump version
<[email protected]> (03/08/30 1.1107)
[netdrvr 8139cp] fix NAPI bug; remove board_type distinction, not needed
<[email protected]> (03/08/30 1.1106)
[netdrvr 8139cp] small cleanups
* remove netif_queue_stopped test, netif_wake_queue already does that
* move vlan stuff to top of file
* remove __dev markers
* update todo list at top of file
* remove pci_set_dma_mask argument casts; ULL suffixes preferred.
<[email protected]> (03/08/30 1.1105)
[netdrvr 8139cp] remove mentions of RTL8169 (now handled by "r8169")
<[email protected]> (03/08/30 1.1104)
[netdrvr 8139cp] update todo list in header
<[email protected]> (03/08/30 1.1103)
[netdrvr 8139cp] support NAPI on RX path; Ditch RX frag handling.
NAPI is turned on unconditionally for the RX path. The hardware supports interrupt mitigation, so that should be investigated too.
RX fragment handling removed. We simply ensure that we alloc buffers large enough to hold incoming packets. Any stray RX frags that occur (shouldn't be any) will be dropped.
<[email protected]> (03/08/30 1.1102)
[netdrvr 8139cp] build TX checksumming code, but default OFF
(previously it was ifdef'd)
Also, bump version to 1.0.
drivers/net/3c527.c +4 -3
@@ -1083,15 +1083,16 @@/* NP is the buffer we will be loading */ np=lp->tx_ring[lp->tx_ring_head].p; -/* We will need this to flush the buffer out */ - lp->tx_ring[lp->tx_ring_head].skb=skb; -if (skb->len <ETH_ZLEN ) { skb =skb_padto (skb,ETH_ZLEN );if (skb ==NULL ) goto out; } + +/* We will need this to flush the buffer out */ + lp->tx_ring[lp->tx_ring_head].skb=skb; + np->length = (skb->len <ETH_ZLEN ) ?ETH_ZLEN : skb->len; np->data =virt_to_bus (skb->data);
drivers/net/8139cp.c +126 -189
613 lines not on this page · raw message
drivers/net/8139too.c +35 -37
120 lines not on this page · raw message
drivers/net/eth16i.c +2 -1
@@ -1057,7 +1057,7 @@int ioaddr = dev->base_addr;int status =0 ;ushort length = skb->len; -unsigned char *buf = skb->data; +unsigned char *buf;unsigned long flags;if (length <ETH_ZLEN )
@@ -1067,6 +1067,7 @@return 0 ; length =ETH_ZLEN ; } + buf = skb->data;netif_stop_queue (dev);
drivers/net/fmv18x.c +2 -1
@@ -370,7 +370,7 @@struct net_local *lp = dev->priv;int ioaddr = dev->base_addr;short length = skb->len; -unsigned char *buf = skb->data; +unsigned char *buf;unsigned long flags;/* Block a transmit from overlapping. */
@@ -389,6 +389,7 @@return 0 ; length =ETH_ZLEN ; } + buf = skb->data;if (net_debug >4 ) printk("%s: Transmitting a packet of length %lu.\n", dev->name,
drivers/net/pcmcia/3c574_cs.c +6 -3
@@ -1216,9 +1216,11 @@ data[0], data[1], data[2], data[3]);switch (cmd) { -case SIOCDEVPRIVATE :/* Get the address of the PHY in use. */ +case SIOCGMIIPHY :/* Get the address of the PHY in use. */ +case SIOCDEVPRIVATE : data[0 ] = phy; -case SIOCDEVPRIVATE +1 :/* Read the specified MII register. */ +case SIOCGMIIREG :/* Read the specified MII register. */ +case SIOCDEVPRIVATE +1 : {int saved_window;unsigned long flags;
@@ -1232,7 +1234,8 @@restore_flags (flags);return 0 ; } -case SIOCDEVPRIVATE +2 :/* Write the specified MII register */ +case SIOCSMIIREG :/* Write the specified MII register */ +case SIOCDEVPRIVATE +2 : {int saved_window;unsigned long flags;
drivers/net/pcmcia/axnet_cs.c +3 -0
@@ -843,11 +843,14 @@u16 *data = (u16 *)&rq->ifr_data;ioaddr_t mii_addr = dev->base_addr +AXNET_MII_EEP ;switch (cmd) { +case SIOCGMIIPHY :case SIOCDEVPRIVATE : data[0 ] = info->phy_id; +case SIOCGMIIREG :/* Read MII PHY register. */ case SIOCDEVPRIVATE +1 : data[3 ] =mdio_read (mii_addr, data[0 ], data[1 ] &0x1f );return 0 ; +case SIOCSMIIREG :/* Write MII PHY register. */ case SIOCDEVPRIVATE +2 :if (!capable (CAP_NET_ADMIN ))return -EPERM ;
drivers/net/pcmcia/pcnet_cs.c +3 -0
@@ -1236,11 +1236,14 @@u16 *data = (u16 *)&rq->ifr_data;ioaddr_t mii_addr = dev->base_addr +DLINK_GPIO ;switch (cmd) { +case SIOCGMIIPHY :case SIOCDEVPRIVATE : data[0 ] = info->phy_id; +case SIOCGMIIREG :/* Read MII PHY register. */ case SIOCDEVPRIVATE +1 : data[3 ] =mdio_read (mii_addr, data[0 ], data[1 ] &0x1f );return 0 ; +case SIOCSMIIREG :/* Write MII PHY register. */ case SIOCDEVPRIVATE +2 :if (!capable (CAP_NET_ADMIN ))return -EPERM ;
drivers/net/pcmcia/xirc2ps_cs.c +6 -3
@@ -1749,13 +1749,16 @@return -EOPNOTSUPP ;switch (cmd) { -case SIOCDEVPRIVATE :/* Get the address of the PHY in use. */ +case SIOCGMIIPHY :/* Get the address of the PHY in use. */ +case SIOCDEVPRIVATE : data[0 ] =0 ;/* we have only this address */ /* fall trough */ -case SIOCDEVPRIVATE +1 :/* Read the specified MII register. */ +case SIOCGMIIREG :/* Read the specified MII register. */ +case SIOCDEVPRIVATE +1 : data[3 ] =mii_rd (ioaddr, data[0 ] &0x1f , data[1 ] &0x1f );break ; -case SIOCDEVPRIVATE +2 :/* Write the specified MII register */ +case SIOCSMIIREG :/* Write the specified MII register */ +case SIOCDEVPRIVATE +2 :if (!capable (CAP_NET_ADMIN ))return -EPERM ;mii_wr (ioaddr, data[0 ] &0x1f , data[1 ] &0x1f , data[2 ],16 );
drivers/net/seeq8005.c +3 -1
@@ -379,7 +379,7 @@ {struct net_local *lp = (struct net_local *)dev->priv;short length = skb->len; -unsigned char *buf = skb->data; +unsigned char *buf;if (length <ETH_ZLEN ) {
@@ -388,6 +388,8 @@return 0 ; length =ETH_ZLEN ; } + buf = skb->data; +/* Block a timer-based transmit from overlapping */ netif_stop_queue (dev);
drivers/net/yellowfin.c +2 -2
@@ -867,8 +867,6 @@/* Calculate the next Tx descriptor entry. */ entry = yp->cur_tx %TX_RING_SIZE ; - yp->tx_skbuff[entry] = skb; -if (gx_fix) {/* Note: only works for paddable protocols e.g. IP. */ int cacheline_end = ((unsigned long )skb->data + skb->len) %32 ;/* Fix GX chipset errata. */
@@ -885,6 +883,8 @@return 0 ; } } + yp->tx_skbuff[entry] = skb; +#ifdef NO_TXSTATS yp->tx_ring[entry].addr =cpu_to_le32 (pci_map_single (yp->pci_dev, skb->data, len,PCI_DMA_TODEVICE ));