net driver fixes
Subsystems (6)
PATCH 1/1 net driver fixes
Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-linus
to receive the following updates:
arch/mips/momentum/jaguar_atx/platform.c | 8 +- arch/mips/momentum/ocelot_3/platform.c | 8 +- arch/mips/momentum/ocelot_c/platform.c | 4 + arch/powerpc/platforms/chrp/pegasos_eth.c | 2 + arch/ppc/syslib/mv64x60.c | 12 ++- drivers/net/3c59x.c | 8 +- drivers/net/bonding/bond_main.c | 86 +++++-------- drivers/net/mv643xx_eth.c | 53 ++++---- drivers/net/natsemi.c | 24 +++- drivers/net/pcnet32.c | 4 +- drivers/net/sis900.c | 10 +- drivers/net/tulip/de2104x.c | 6 +- drivers/net/tulip/dmfe.c | 204 +++++++++++++++++++--------- drivers/net/ucc_geth.c | 17 ++- include/linux/igmp.h | 2 + include/linux/mv643xx.h | 1 + net/ipv4/igmp.c | 23 ++++ 17 files changed, 302 insertions(+), 170 deletions(-)
Andrew Morton (2):
revert "drivers/net/tulip/dmfe: support basic carrier detection" sis900 warning fixes
Dale Farnsworth (1):
mv643xx_eth: Place explicit port number in mv643xx_eth_platform_data
Dmitriy Monakhov (1):
3c59x: Handle pci_enable_device() failure while resuming
Don Fry (1):
pcnet32: Fix PCnet32 performance bug on non-coherent architecutres
Jay Vosburgh (3):
bonding: fix double dev_add_pack
bonding: only receive ARPs for us
bonding: Improve IGMP join processing
Li Yang (2):
ucc_geth: Fix BD processing
ucc_geth: returns NETDEV_TX_BUSY when BD ring is full
Maxim Levitsky (3):
dmfe: trivial/spelling fixes
dmfe: fix two bugs
dmfe: Fix link detection
Prarit Bhargava (1):
__devinit & __devexit cleanups for de2104x driver
Sergei Shtylyov (1):
natsemi: netpoll fixes
arch/mips/momentum/jaguar_atx/platform.c +7 -1
@@ -48,6 +48,8 @@ static struct resource mv64x60_eth0_resources[] = { };static struct mv643xx_eth_platform_data eth0_pd = { + .port_number =0 , + .tx_sram_addr =MV_SRAM_BASE_ETH0 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
@@ -77,6 +79,8 @@ static struct resource mv64x60_eth1_resources[] = { };static struct mv643xx_eth_platform_data eth1_pd = { + .port_number =1 , + .tx_sram_addr =MV_SRAM_BASE_ETH1 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
@@ -105,7 +109,9 @@ static struct resource mv64x60_eth2_resources[] = { }, }; -static struct mv643xx_eth_platform_data eth2_pd; +static struct mv643xx_eth_platform_data eth2_pd = { + .port_number =2 , +};static struct platform_device eth2_device = { .name =MV643XX_ETH_NAME ,
arch/mips/momentum/ocelot_3/platform.c +7 -1
@@ -48,6 +48,8 @@ static struct resource mv64x60_eth0_resources[] = { };static struct mv643xx_eth_platform_data eth0_pd = { + .port_number =0 , + .tx_sram_addr =MV_SRAM_BASE_ETH0 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
@@ -77,6 +79,8 @@ static struct resource mv64x60_eth1_resources[] = { };static struct mv643xx_eth_platform_data eth1_pd = { + .port_number =1 , + .tx_sram_addr =MV_SRAM_BASE_ETH1 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
@@ -105,7 +109,9 @@ static struct resource mv64x60_eth2_resources[] = { }, }; -static struct mv643xx_eth_platform_data eth2_pd; +static struct mv643xx_eth_platform_data eth2_pd = { + .port_number =2 , +};static struct platform_device eth2_device = { .name =MV643XX_ETH_NAME ,
arch/mips/momentum/ocelot_c/platform.c +4 -0
@@ -47,6 +47,8 @@ static struct resource mv64x60_eth0_resources[] = { };static struct mv643xx_eth_platform_data eth0_pd = { + .port_number =0 , + .tx_sram_addr =MV_SRAM_BASE_ETH0 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
@@ -76,6 +78,8 @@ static struct resource mv64x60_eth1_resources[] = { };static struct mv643xx_eth_platform_data eth1_pd = { + .port_number =1 , + .tx_sram_addr =MV_SRAM_BASE_ETH1 , .tx_sram_size =MV_SRAM_TXRING_SIZE , .tx_queue_size =MV_SRAM_TXRING_SIZE /16 ,
arch/powerpc/platforms/chrp/pegasos_eth.c +2 -0
@@ -58,6 +58,7 @@ static struct resource mv643xx_eth0_resources[] = {static struct mv643xx_eth_platform_data eth0_pd = { + .port_number =0 , .tx_sram_addr =PEGASOS2_SRAM_BASE_ETH0 , .tx_sram_size =PEGASOS2_SRAM_TXRING_SIZE , .tx_queue_size =PEGASOS2_SRAM_TXRING_SIZE /16 ,
@@ -87,6 +88,7 @@ static struct resource mv643xx_eth1_resources[] = { };static struct mv643xx_eth_platform_data eth1_pd = { + .port_number =1 , .tx_sram_addr =PEGASOS2_SRAM_BASE_ETH1 , .tx_sram_size =PEGASOS2_SRAM_TXRING_SIZE , .tx_queue_size =PEGASOS2_SRAM_TXRING_SIZE /16 ,
arch/ppc/syslib/mv64x60.c +9 -3
@@ -339,7 +339,9 @@ static struct resource mv64x60_eth0_resources[] = { }, }; -static struct mv643xx_eth_platform_data eth0_pd; +static struct mv643xx_eth_platform_data eth0_pd = { + .port_number =0 , +};static struct platform_device eth0_device = { .name =MV643XX_ETH_NAME ,
@@ -362,7 +364,9 @@ static struct resource mv64x60_eth1_resources[] = { }, }; -static struct mv643xx_eth_platform_data eth1_pd; +static struct mv643xx_eth_platform_data eth1_pd = { + .port_number =1 , +};static struct platform_device eth1_device = { .name =MV643XX_ETH_NAME ,
@@ -385,7 +389,9 @@ static struct resource mv64x60_eth2_resources[] = { }, }; -static struct mv643xx_eth_platform_data eth2_pd; +static struct mv643xx_eth_platform_data eth2_pd = { + .port_number =2 , +};static struct platform_device eth2_device = { .name =MV643XX_ETH_NAME ,
drivers/net/3c59x.c +7 -1
@@ -822,11 +822,17 @@ static int vortex_resume(struct pci_dev *pdev) {struct net_device *dev =pci_get_drvdata (pdev);struct vortex_private *vp =netdev_priv (dev); +int err;if (dev && vp) {pci_set_power_state (pdev,PCI_D0 );pci_restore_state (pdev); -pci_enable_device (pdev); + err =pci_enable_device (pdev); +if (err) { +printk (KERN_WARNING "%s: Could not enable device \n" , + dev->name); +return err; + }pci_set_master (pdev);if (request_irq (dev->irq, vp->full_bus_master_rx ? &boomerang_interrupt : &vortex_interrupt,IRQF_SHARED , dev->name, dev)) {
drivers/net/bonding/bond_main.c +33 -53
135 lines not on this page · raw message
drivers/net/mv643xx_eth.c +29 -24
89 lines not on this page · raw message
drivers/net/natsemi.c +19 -5
@@ -2024,6 +2024,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)struct netdev_private *np =netdev_priv (dev);void __iomem * ioaddr =ns_ioaddr (dev);unsigned entry; +unsigned long flags;/* Note: Ordering is important here, set the field with the "ownership" bit last, and only then increment cur_tx. */
@@ -2037,7 +2038,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) np->tx_ring[entry].addr =cpu_to_le32 (np->tx_dma[entry]); -spin_lock_irq (&np->lock); +spin_lock_irqsave (&np->lock, flags);if (!np->hands_off) { np->tx_ring[entry].cmd_status =cpu_to_le32 (DescOwn | skb->len);
@@ -2056,7 +2057,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)dev_kfree_skb_irq (skb); np->stats.tx_dropped++; } -spin_unlock_irq (&np->lock); +spin_unlock_irqrestore (&np->lock, flags); dev->trans_start = jiffies;
@@ -2222,6 +2223,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) pkt_len = (desc_status & DescSizeMask) -4 ;if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){if (desc_status & DescMore) { +unsigned long flags; +if (netif_msg_rx_err (np))printk (KERN_WARNING "%s: Oversized(?) Ethernet "
@@ -2236,12 +2239,12 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)* reset procedure documented in * AN-1287. */ -spin_lock_irq (&np->lock); +spin_lock_irqsave (&np->lock, flags);reset_rx (dev);reinit_rx (dev);writel (np->ring_dma, ioaddr + RxRingPtr);check_link (dev); -spin_unlock_irq (&np->lock); +spin_unlock_irqrestore (&np->lock, flags);/* We'll enable RX on exit from this * function. */
@@ -2396,8 +2399,19 @@ static struct net_device_stats *get_stats(struct net_device *dev)#ifdef CONFIG_NET_POLL_CONTROLLER static void natsemi_poll_controller (struct net_device *dev) { +struct netdev_private *np =netdev_priv (dev); +disable_irq (dev->irq); -intr_handler (dev->irq, dev); + +/* +* A real interrupt might have already reached us at this point +* but NAPI might still haven't called us back. As the interrupt +* status register is cleared by reading, we should prevent an +* interrupt loss in this case... +*/ +if (!np->intr_status) +intr_handler (dev->irq, dev); +enable_irq (dev->irq); }#endif
drivers/net/pcnet32.c +2 -2
@@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev,skb_put (skb, pkt_len);/* Make room */ pci_dma_sync_single_for_cpu (lp->pci_dev, lp->rx_dma_addr[entry], -PKT_BUF_SZ -2 , + pkt_len,PCI_DMA_FROMDEVICE );eth_copy_and_sum (skb, (unsigned char *)(lp->rx_skbuff[entry]->data), pkt_len,0 );pci_dma_sync_single_for_device (lp->pci_dev, lp->rx_dma_addr[entry], -PKT_BUF_SZ -2 , + pkt_len,PCI_DMA_FROMDEVICE ); } lp->stats.rx_bytes += skb->len;
drivers/net/sis900.c +5 -5
@@ -968,10 +968,10 @@ static void mdio_write(struct net_device *net_dev, int phy_id, int location,static u16 sis900_reset_phy (struct net_device *net_dev,int phy_addr) { -int i =0 ; +int i;u16 status; -while (i++ <2 ) +for (i =0 ; i <2 ; i++) status =mdio_read (net_dev, phy_addr,MII_STATUS );mdio_write ( net_dev, phy_addr,MII_CONTROL ,MII_CNTL_RESET );
@@ -1430,7 +1430,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)int i =0 ;u32 status; -while (i++ <2 ) +for (i =0 ; i <2 ; i++) status =mdio_read (net_dev, phy_addr,MII_STATUS );if (!(status &MII_STAT_LINK )){
@@ -1466,9 +1466,9 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplexint phy_addr = sis_priv->cur_phy;u32 status;u16 autoadv, autorec; -int i =0 ; +int i; -while (i++ <2 ) +for (i =0 ; i <2 ; i++) status =mdio_read (net_dev, phy_addr,MII_STATUS );if (!(status &MII_STAT_LINK ))
drivers/net/tulip/de2104x.c +3 -3
@@ -1685,7 +1685,7 @@ static const struct ethtool_ops de_ethtool_ops = { .get_regs = de_get_regs, }; -static void __init de21040_get_mac_address (struct de_private *de) +static void __devinit de21040_get_mac_address (struct de_private *de) {unsigned i;
@@ -1703,7 +1703,7 @@ static void __init de21040_get_mac_address (struct de_private *de) } } -static void __init de21040_get_media_info (struct de_private *de) +static void __devinit de21040_get_media_info (struct de_private *de) {unsigned int i;
@@ -1765,7 +1765,7 @@ static unsigned __devinit tulip_read_eeprom(void __iomem *regs, int location, inreturn retval; } -static void __init de21041_get_srom_info (struct de_private *de) +static void __devinit de21041_get_srom_info (struct de_private *de) {unsigned i, sa_offset =0 , ofs;u8 ee_data[DE_EEPROM_SIZE +6 ] = {};
drivers/net/tulip/dmfe.c +138 -66
444 lines not on this page · raw message
drivers/net/ucc_geth.c +11 -6
@@ -3598,17 +3598,20 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)/* Move to next BD in the ring */ if (!(bd_status &T_W )) - ugeth->txBd[txQ] = bd +sizeof (struct qe_bd ); + bd +=sizeof (struct qe_bd );else - ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ]; + bd = ugeth->p_tx_bd_ring[txQ];/* If the next BD still needs to be cleaned up, then the bds are full. We need to tell the kernel to stop sending us stuff. */ if (bd == ugeth->confBd[txQ]) {if (!netif_queue_stopped (dev))netif_stop_queue (dev); +return NETDEV_TX_BUSY ; } + ugeth->txBd[txQ] = bd; +if (ugeth->p_scheduler) { ugeth->cpucount[txQ]++;/* Indicate to QE that there are more Tx bds ready for
@@ -3620,7 +3623,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)spin_unlock_irq (&ugeth->lock); -return 0 ; +return NETDEV_TX_OK ; }static int ucc_geth_rx (struct ucc_geth_private *ugeth,u8 rxQ,int rx_work_limit)
@@ -3722,7 +3725,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)/* Handle the transmitted buffer and release */ /* the BD to be used with the current frame */ -if ((bd = ugeth->txBd[txQ]) && (netif_queue_stopped (dev) ==0 )) +if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped (dev) ==0 ))break ; ugeth->stats.tx_packets++;
@@ -3741,10 +3744,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)/* Advance the confirmation BD pointer */ if (!(bd_status &T_W )) - ugeth->confBd[txQ] +=sizeof (struct qe_bd ); + bd +=sizeof (struct qe_bd );else - ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ]; + bd = ugeth->p_tx_bd_ring[txQ]; + bd_status =in_be32 ((u32 *)bd); } + ugeth->confBd[txQ] = bd;return 0 ; }
include/linux/igmp.h +2 -0
@@ -218,5 +218,7 @@ extern void ip_mc_up(struct in_device *);extern void ip_mc_down (struct in_device *);extern void ip_mc_dec_group (struct in_device *in_dev,__be32 addr);extern void ip_mc_inc_group (struct in_device *in_dev,__be32 addr); +extern void ip_mc_rejoin_group (struct ip_mc_list *im); +#endif #endif
include/linux/mv643xx.h +1 -0
@@ -1288,6 +1288,7 @@ struct mv64xxx_i2c_pdata {#define MV643XX_ETH_NAME "mv643xx_eth"struct mv643xx_eth_platform_data { +int port_number;u16 force_phy_addr;/* force override if phy_addr == 0 */ u16 phy_addr;
net/ipv4/igmp.c +23 -0
@@ -1251,6 +1251,28 @@ out: }/* +* Resend IGMP JOIN report; used for bonding. +*/ +void ip_mc_rejoin_group (struct ip_mc_list *im) +{ +struct in_device *in_dev = im->interface; + +#ifdef CONFIG_IP_MULTICAST +if (im->multiaddr ==IGMP_ALL_HOSTS ) +return ; + +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) { +igmp_mod_timer (im, IGMP_Initial_Report_Delay); +return ; + } +/* else, v3 */ + im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv : + IGMP_Unsolicited_Report_Count; +igmp_ifc_event (in_dev); +#endif +} + +/* * A socket has left a multicast group on device dev */
@@ -2596,3 +2618,4 @@ int __init igmp_mc_proc_init(void)EXPORT_SYMBOL (ip_mc_dec_group);EXPORT_SYMBOL (ip_mc_inc_group);EXPORT_SYMBOL (ip_mc_join_group); +EXPORT_SYMBOL (ip_mc_rejoin_group);
Quoted 2 lines · Jeff Garzik
Jay Vosburgh (3):
bonding: Improve IGMP join processing
ip_mc_rejoin_group: Kill warning about unused variable `in_dev' when CONFIG_IP_MULTICAST is not set.
net/ipv4/igmp.c +1 -1
@@ -1255,9 +1255,9 @@ out:*/ void ip_mc_rejoin_group (struct ip_mc_list *im) { +#ifdef CONFIG_IP_MULTICAST struct in_device *in_dev = im->interface; -#ifdef CONFIG_IP_MULTICAST if (im->multiaddr ==IGMP_ALL_HOSTS )return ;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
From: Geert Uytterhoeven <[email protected]>
Date: Mon, 12 Mar 2007 11:02:43 +0100 (CET)
Quoted 8 lines · Jeff Garzik
Quoted 2 lines
Jay Vosburgh (3):
bonding: Improve IGMP join processing
ip_mc_rejoin_group: Kill warning about unused variable `in_dev' whenCONFIG_IP_MULTICASTis not set.Signed-off-by Geert Uytterhoeven <[email protected]>
Applied, thanks Geert.