diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-27 20:38:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-27 20:38:07 -0400 |
| commit | b09331e530777963ed65ce2fdf074b7b077768c7 (patch) | |
| tree | 0354e5a7bb8ec3a7ae647b5ce71516f6a4979b05 /drivers/net | |
| parent | 4c246edd2550304df5b766cc841584b2bb058843 (diff) | |
| parent | d97240552cd98c4b07322f30f66fd9c3ba4171de (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (55 commits)
sctp: fix random memory dereference with SCTP_HMAC_IDENT option.
sctp: correct bounds check in sctp_setsockopt_auth_key
wan: Missing capability checks in sbni_ioctl()
e100, fix iomap read
qeth: preallocated header account offset
qeth: l2 write unicast list to hardware
qeth: use -EOPNOTSUPP instead of -ENOTSUPP.
ibm_newemac: Don't call dev_mc_add() before device is registered
net: don't grab a mutex within a timer context in gianfar
forcedeth: fix checksum flag
net/usb/mcs7830: add set_mac_address
net/usb/mcs7830: new device IDs
[netdrvr] smc91x: fix resource removal (null ptr deref)
ibmveth: fix bad UDP checksums
[netdrvr] hso: dev_kfree_skb crash fix
[netdrvr] hso: icon 322 detection fix
atl1: disable TSO by default
atl1e: multistatement if missing braces
igb: remove 82576 quad adapter
drivers/net/skfp/ess.c: fix compile warnings
...
Diffstat (limited to 'drivers/net')
28 files changed, 199 insertions, 103 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index a5c141cecd4e..4a11296a9514 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -822,14 +822,14 @@ config ULTRA32 | |||
| 822 | will be called smc-ultra32. | 822 | will be called smc-ultra32. |
| 823 | 823 | ||
| 824 | config BFIN_MAC | 824 | config BFIN_MAC |
| 825 | tristate "Blackfin 527/536/537 on-chip mac support" | 825 | tristate "Blackfin on-chip MAC support" |
| 826 | depends on NET_ETHERNET && (BF527 || BF537 || BF536) | 826 | depends on NET_ETHERNET && (BF526 || BF527 || BF536 || BF537) |
| 827 | select CRC32 | 827 | select CRC32 |
| 828 | select MII | 828 | select MII |
| 829 | select PHYLIB | 829 | select PHYLIB |
| 830 | select BFIN_MAC_USE_L1 if DMA_UNCACHED_NONE | 830 | select BFIN_MAC_USE_L1 if DMA_UNCACHED_NONE |
| 831 | help | 831 | help |
| 832 | This is the driver for blackfin on-chip mac device. Say Y if you want it | 832 | This is the driver for Blackfin on-chip mac device. Say Y if you want it |
| 833 | compiled into the kernel. This driver is also available as a module | 833 | compiled into the kernel. This driver is also available as a module |
| 834 | ( = code which can be inserted in and removed from the running kernel | 834 | ( = code which can be inserted in and removed from the running kernel |
| 835 | whenever you want). The module will be called bfin_mac. | 835 | whenever you want). The module will be called bfin_mac. |
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c index 82d7be1655d3..7685b995ff9b 100644 --- a/drivers/net/atl1e/atl1e_main.c +++ b/drivers/net/atl1e/atl1e_main.c | |||
| @@ -2232,10 +2232,11 @@ static int atl1e_resume(struct pci_dev *pdev) | |||
| 2232 | 2232 | ||
| 2233 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); | 2233 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); |
| 2234 | 2234 | ||
| 2235 | if (netif_running(netdev)) | 2235 | if (netif_running(netdev)) { |
| 2236 | err = atl1e_request_irq(adapter); | 2236 | err = atl1e_request_irq(adapter); |
| 2237 | if (err) | 2237 | if (err) |
| 2238 | return err; | 2238 | return err; |
| 2239 | } | ||
| 2239 | 2240 | ||
| 2240 | atl1e_reset_hw(&adapter->hw); | 2241 | atl1e_reset_hw(&adapter->hw); |
| 2241 | 2242 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index e6a7bb79d4df..e23ce77712f1 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
| @@ -3022,7 +3022,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
| 3022 | netdev->features = NETIF_F_HW_CSUM; | 3022 | netdev->features = NETIF_F_HW_CSUM; |
| 3023 | netdev->features |= NETIF_F_SG; | 3023 | netdev->features |= NETIF_F_SG; |
| 3024 | netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); | 3024 | netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); |
| 3025 | netdev->features |= NETIF_F_TSO; | ||
| 3026 | netdev->features |= NETIF_F_LLTX; | 3025 | netdev->features |= NETIF_F_LLTX; |
| 3027 | 3026 | ||
| 3028 | /* | 3027 | /* |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 19d32a227be1..453115acaad2 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
| @@ -1838,7 +1838,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
| 1838 | if ((le16_to_cpu(rfd->command) & cb_el) && | 1838 | if ((le16_to_cpu(rfd->command) & cb_el) && |
| 1839 | (RU_RUNNING == nic->ru_running)) | 1839 | (RU_RUNNING == nic->ru_running)) |
| 1840 | 1840 | ||
| 1841 | if (readb(&nic->csr->scb.status) & rus_no_res) | 1841 | if (ioread8(&nic->csr->scb.status) & rus_no_res) |
| 1842 | nic->ru_running = RU_SUSPENDED; | 1842 | nic->ru_running = RU_SUSPENDED; |
| 1843 | return -ENODATA; | 1843 | return -ENODATA; |
| 1844 | } | 1844 | } |
| @@ -1861,7 +1861,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
| 1861 | if ((le16_to_cpu(rfd->command) & cb_el) && | 1861 | if ((le16_to_cpu(rfd->command) & cb_el) && |
| 1862 | (RU_RUNNING == nic->ru_running)) { | 1862 | (RU_RUNNING == nic->ru_running)) { |
| 1863 | 1863 | ||
| 1864 | if (readb(&nic->csr->scb.status) & rus_no_res) | 1864 | if (ioread8(&nic->csr->scb.status) & rus_no_res) |
| 1865 | nic->ru_running = RU_SUSPENDED; | 1865 | nic->ru_running = RU_SUSPENDED; |
| 1866 | } | 1866 | } |
| 1867 | 1867 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 053971e5fc94..331b86b01fa9 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
| @@ -5522,7 +5522,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
| 5522 | if (id->driver_data & DEV_HAS_CHECKSUM) { | 5522 | if (id->driver_data & DEV_HAS_CHECKSUM) { |
| 5523 | np->rx_csum = 1; | 5523 | np->rx_csum = 1; |
| 5524 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; | 5524 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; |
| 5525 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; | 5525 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
| 5526 | dev->features |= NETIF_F_TSO; | 5526 | dev->features |= NETIF_F_TSO; |
| 5527 | } | 5527 | } |
| 5528 | 5528 | ||
| @@ -5835,7 +5835,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
| 5835 | 5835 | ||
| 5836 | dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n", | 5836 | dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n", |
| 5837 | dev->features & NETIF_F_HIGHDMA ? "highdma " : "", | 5837 | dev->features & NETIF_F_HIGHDMA ? "highdma " : "", |
| 5838 | dev->features & (NETIF_F_HW_CSUM | NETIF_F_SG) ? | 5838 | dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ? |
| 5839 | "csum " : "", | 5839 | "csum " : "", |
| 5840 | dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ? | 5840 | dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ? |
| 5841 | "vlan " : "", | 5841 | "vlan " : "", |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 9a51ec8293cc..9d461825bf4c 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
| @@ -792,6 +792,10 @@ static int fs_enet_open(struct net_device *dev) | |||
| 792 | int r; | 792 | int r; |
| 793 | int err; | 793 | int err; |
| 794 | 794 | ||
| 795 | /* to initialize the fep->cur_rx,... */ | ||
| 796 | /* not doing this, will cause a crash in fs_enet_rx_napi */ | ||
| 797 | fs_init_bds(fep->ndev); | ||
| 798 | |||
| 795 | if (fep->fpi->use_napi) | 799 | if (fep->fpi->use_napi) |
| 796 | napi_enable(&fep->napi); | 800 | napi_enable(&fep->napi); |
| 797 | 801 | ||
| @@ -1167,6 +1171,10 @@ static struct of_device_id fs_enet_match[] = { | |||
| 1167 | .compatible = "fsl,cpm1-scc-enet", | 1171 | .compatible = "fsl,cpm1-scc-enet", |
| 1168 | .data = (void *)&fs_scc_ops, | 1172 | .data = (void *)&fs_scc_ops, |
| 1169 | }, | 1173 | }, |
| 1174 | { | ||
| 1175 | .compatible = "fsl,cpm2-scc-enet", | ||
| 1176 | .data = (void *)&fs_scc_ops, | ||
| 1177 | }, | ||
| 1170 | #endif | 1178 | #endif |
| 1171 | #ifdef CONFIG_FS_ENET_HAS_FCC | 1179 | #ifdef CONFIG_FS_ENET_HAS_FCC |
| 1172 | { | 1180 | { |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 029b3c7ef29c..22f50dd8b277 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | #include "fs_enet.h" | 47 | #include "fs_enet.h" |
| 48 | 48 | ||
| 49 | /*************************************************/ | 49 | /*************************************************/ |
| 50 | |||
| 51 | #if defined(CONFIG_CPM1) | 50 | #if defined(CONFIG_CPM1) |
| 52 | /* for a 8xx __raw_xxx's are sufficient */ | 51 | /* for a 8xx __raw_xxx's are sufficient */ |
| 53 | #define __fs_out32(addr, x) __raw_writel(x, addr) | 52 | #define __fs_out32(addr, x) __raw_writel(x, addr) |
| @@ -62,6 +61,8 @@ | |||
| 62 | #define __fs_out16(addr, x) out_be16(addr, x) | 61 | #define __fs_out16(addr, x) out_be16(addr, x) |
| 63 | #define __fs_in32(addr) in_be32(addr) | 62 | #define __fs_in32(addr) in_be32(addr) |
| 64 | #define __fs_in16(addr) in_be16(addr) | 63 | #define __fs_in16(addr) in_be16(addr) |
| 64 | #define __fs_out8(addr, x) out_8(addr, x) | ||
| 65 | #define __fs_in8(addr) in_8(addr) | ||
| 65 | #endif | 66 | #endif |
| 66 | 67 | ||
| 67 | /* write, read, set bits, clear bits */ | 68 | /* write, read, set bits, clear bits */ |
| @@ -262,8 +263,13 @@ static void restart(struct net_device *dev) | |||
| 262 | 263 | ||
| 263 | /* Initialize function code registers for big-endian. | 264 | /* Initialize function code registers for big-endian. |
| 264 | */ | 265 | */ |
| 266 | #ifndef CONFIG_NOT_COHERENT_CACHE | ||
| 267 | W8(ep, sen_genscc.scc_rfcr, SCC_EB | SCC_GBL); | ||
| 268 | W8(ep, sen_genscc.scc_tfcr, SCC_EB | SCC_GBL); | ||
| 269 | #else | ||
| 265 | W8(ep, sen_genscc.scc_rfcr, SCC_EB); | 270 | W8(ep, sen_genscc.scc_rfcr, SCC_EB); |
| 266 | W8(ep, sen_genscc.scc_tfcr, SCC_EB); | 271 | W8(ep, sen_genscc.scc_tfcr, SCC_EB); |
| 272 | #endif | ||
| 267 | 273 | ||
| 268 | /* Set maximum bytes per receive buffer. | 274 | /* Set maximum bytes per receive buffer. |
| 269 | * This appears to be an Ethernet frame size, not the buffer | 275 | * This appears to be an Ethernet frame size, not the buffer |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 999d69168277..4320a983a588 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
| @@ -105,6 +105,7 @@ const char gfar_driver_version[] = "1.3"; | |||
| 105 | 105 | ||
| 106 | static int gfar_enet_open(struct net_device *dev); | 106 | static int gfar_enet_open(struct net_device *dev); |
| 107 | static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev); | 107 | static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev); |
| 108 | static void gfar_reset_task(struct work_struct *work); | ||
| 108 | static void gfar_timeout(struct net_device *dev); | 109 | static void gfar_timeout(struct net_device *dev); |
| 109 | static int gfar_close(struct net_device *dev); | 110 | static int gfar_close(struct net_device *dev); |
| 110 | struct sk_buff *gfar_new_skb(struct net_device *dev); | 111 | struct sk_buff *gfar_new_skb(struct net_device *dev); |
| @@ -209,6 +210,7 @@ static int gfar_probe(struct platform_device *pdev) | |||
| 209 | spin_lock_init(&priv->txlock); | 210 | spin_lock_init(&priv->txlock); |
| 210 | spin_lock_init(&priv->rxlock); | 211 | spin_lock_init(&priv->rxlock); |
| 211 | spin_lock_init(&priv->bflock); | 212 | spin_lock_init(&priv->bflock); |
| 213 | INIT_WORK(&priv->reset_task, gfar_reset_task); | ||
| 212 | 214 | ||
| 213 | platform_set_drvdata(pdev, dev); | 215 | platform_set_drvdata(pdev, dev); |
| 214 | 216 | ||
| @@ -1212,6 +1214,7 @@ static int gfar_close(struct net_device *dev) | |||
| 1212 | 1214 | ||
| 1213 | napi_disable(&priv->napi); | 1215 | napi_disable(&priv->napi); |
| 1214 | 1216 | ||
| 1217 | cancel_work_sync(&priv->reset_task); | ||
| 1215 | stop_gfar(dev); | 1218 | stop_gfar(dev); |
| 1216 | 1219 | ||
| 1217 | /* Disconnect from the PHY */ | 1220 | /* Disconnect from the PHY */ |
| @@ -1326,13 +1329,16 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu) | |||
| 1326 | return 0; | 1329 | return 0; |
| 1327 | } | 1330 | } |
| 1328 | 1331 | ||
| 1329 | /* gfar_timeout gets called when a packet has not been | 1332 | /* gfar_reset_task gets scheduled when a packet has not been |
| 1330 | * transmitted after a set amount of time. | 1333 | * transmitted after a set amount of time. |
| 1331 | * For now, assume that clearing out all the structures, and | 1334 | * For now, assume that clearing out all the structures, and |
| 1332 | * starting over will fix the problem. */ | 1335 | * starting over will fix the problem. |
| 1333 | static void gfar_timeout(struct net_device *dev) | 1336 | */ |
| 1337 | static void gfar_reset_task(struct work_struct *work) | ||
| 1334 | { | 1338 | { |
| 1335 | dev->stats.tx_errors++; | 1339 | struct gfar_private *priv = container_of(work, struct gfar_private, |
| 1340 | reset_task); | ||
| 1341 | struct net_device *dev = priv->dev; | ||
| 1336 | 1342 | ||
| 1337 | if (dev->flags & IFF_UP) { | 1343 | if (dev->flags & IFF_UP) { |
| 1338 | stop_gfar(dev); | 1344 | stop_gfar(dev); |
| @@ -1342,6 +1348,14 @@ static void gfar_timeout(struct net_device *dev) | |||
| 1342 | netif_tx_schedule_all(dev); | 1348 | netif_tx_schedule_all(dev); |
| 1343 | } | 1349 | } |
| 1344 | 1350 | ||
| 1351 | static void gfar_timeout(struct net_device *dev) | ||
| 1352 | { | ||
| 1353 | struct gfar_private *priv = netdev_priv(dev); | ||
| 1354 | |||
| 1355 | dev->stats.tx_errors++; | ||
| 1356 | schedule_work(&priv->reset_task); | ||
| 1357 | } | ||
| 1358 | |||
| 1345 | /* Interrupt Handler for Transmit complete */ | 1359 | /* Interrupt Handler for Transmit complete */ |
| 1346 | static int gfar_clean_tx_ring(struct net_device *dev) | 1360 | static int gfar_clean_tx_ring(struct net_device *dev) |
| 1347 | { | 1361 | { |
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index d59df98bd636..f46e9b63af13 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
| @@ -756,6 +756,7 @@ struct gfar_private { | |||
| 756 | 756 | ||
| 757 | uint32_t msg_enable; | 757 | uint32_t msg_enable; |
| 758 | 758 | ||
| 759 | struct work_struct reset_task; | ||
| 759 | /* Network Statistics */ | 760 | /* Network Statistics */ |
| 760 | struct gfar_extra_stats extra_stats; | 761 | struct gfar_extra_stats extra_stats; |
| 761 | }; | 762 | }; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 2e720f26ca83..ccd9d9058f6d 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
| @@ -663,9 +663,6 @@ static int emac_configure(struct emac_instance *dev) | |||
| 663 | if (emac_phy_gpcs(dev->phy.mode)) | 663 | if (emac_phy_gpcs(dev->phy.mode)) |
| 664 | emac_mii_reset_phy(&dev->phy); | 664 | emac_mii_reset_phy(&dev->phy); |
| 665 | 665 | ||
| 666 | /* Required for Pause packet support in EMAC */ | ||
| 667 | dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1); | ||
| 668 | |||
| 669 | return 0; | 666 | return 0; |
| 670 | } | 667 | } |
| 671 | 668 | ||
| @@ -1150,6 +1147,9 @@ static int emac_open(struct net_device *ndev) | |||
| 1150 | } else | 1147 | } else |
| 1151 | netif_carrier_on(dev->ndev); | 1148 | netif_carrier_on(dev->ndev); |
| 1152 | 1149 | ||
| 1150 | /* Required for Pause packet support in EMAC */ | ||
| 1151 | dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1); | ||
| 1152 | |||
| 1153 | emac_configure(dev); | 1153 | emac_configure(dev); |
| 1154 | mal_poll_add(dev->mal, &dev->commac); | 1154 | mal_poll_add(dev->mal, &dev->commac); |
| 1155 | mal_enable_tx_channel(dev->mal, dev->mal_tx_chan); | 1155 | mal_enable_tx_channel(dev->mal, dev->mal_tx_chan); |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index a03fe1fb61ca..c2d57f836088 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
| @@ -904,8 +904,6 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
| 904 | unsigned long data_dma_addr; | 904 | unsigned long data_dma_addr; |
| 905 | 905 | ||
| 906 | desc.fields.flags_len = IBMVETH_BUF_VALID | skb->len; | 906 | desc.fields.flags_len = IBMVETH_BUF_VALID | skb->len; |
| 907 | data_dma_addr = dma_map_single(&adapter->vdev->dev, skb->data, | ||
| 908 | skb->len, DMA_TO_DEVICE); | ||
| 909 | 907 | ||
| 910 | if (skb->ip_summed == CHECKSUM_PARTIAL && | 908 | if (skb->ip_summed == CHECKSUM_PARTIAL && |
| 911 | ip_hdr(skb)->protocol != IPPROTO_TCP && skb_checksum_help(skb)) { | 909 | ip_hdr(skb)->protocol != IPPROTO_TCP && skb_checksum_help(skb)) { |
| @@ -924,6 +922,8 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
| 924 | buf[1] = 0; | 922 | buf[1] = 0; |
| 925 | } | 923 | } |
| 926 | 924 | ||
| 925 | data_dma_addr = dma_map_single(&adapter->vdev->dev, skb->data, | ||
| 926 | skb->len, DMA_TO_DEVICE); | ||
| 927 | if (dma_mapping_error(&adapter->vdev->dev, data_dma_addr)) { | 927 | if (dma_mapping_error(&adapter->vdev->dev, data_dma_addr)) { |
| 928 | if (!firmware_has_feature(FW_FEATURE_CMO)) | 928 | if (!firmware_has_feature(FW_FEATURE_CMO)) |
| 929 | ibmveth_error_printk("tx: unable to map xmit buffer\n"); | 929 | ibmveth_error_printk("tx: unable to map xmit buffer\n"); |
| @@ -932,6 +932,7 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
| 932 | desc.fields.address = adapter->bounce_buffer_dma; | 932 | desc.fields.address = adapter->bounce_buffer_dma; |
| 933 | tx_map_failed++; | 933 | tx_map_failed++; |
| 934 | used_bounce = 1; | 934 | used_bounce = 1; |
| 935 | wmb(); | ||
| 935 | } else | 936 | } else |
| 936 | desc.fields.address = data_dma_addr; | 937 | desc.fields.address = data_dma_addr; |
| 937 | 938 | ||
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index bb823acc7443..f5e2e7235fcb 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
| @@ -87,7 +87,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
| 87 | case E1000_DEV_ID_82576: | 87 | case E1000_DEV_ID_82576: |
| 88 | case E1000_DEV_ID_82576_FIBER: | 88 | case E1000_DEV_ID_82576_FIBER: |
| 89 | case E1000_DEV_ID_82576_SERDES: | 89 | case E1000_DEV_ID_82576_SERDES: |
| 90 | case E1000_DEV_ID_82576_QUAD_COPPER: | ||
| 91 | mac->type = e1000_82576; | 90 | mac->type = e1000_82576; |
| 92 | break; | 91 | break; |
| 93 | default: | 92 | default: |
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h index a65ccc3095c3..99504a600a80 100644 --- a/drivers/net/igb/e1000_hw.h +++ b/drivers/net/igb/e1000_hw.h | |||
| @@ -41,7 +41,6 @@ struct e1000_hw; | |||
| 41 | #define E1000_DEV_ID_82576 0x10C9 | 41 | #define E1000_DEV_ID_82576 0x10C9 |
| 42 | #define E1000_DEV_ID_82576_FIBER 0x10E6 | 42 | #define E1000_DEV_ID_82576_FIBER 0x10E6 |
| 43 | #define E1000_DEV_ID_82576_SERDES 0x10E7 | 43 | #define E1000_DEV_ID_82576_SERDES 0x10E7 |
| 44 | #define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8 | ||
| 45 | #define E1000_DEV_ID_82575EB_COPPER 0x10A7 | 44 | #define E1000_DEV_ID_82575EB_COPPER 0x10A7 |
| 46 | #define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9 | 45 | #define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9 |
| 47 | #define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6 | 46 | #define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6 |
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 11aee1309951..58906c984be9 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
| @@ -373,13 +373,17 @@ static void igb_get_regs(struct net_device *netdev, | |||
| 373 | regs_buff[12] = rd32(E1000_EECD); | 373 | regs_buff[12] = rd32(E1000_EECD); |
| 374 | 374 | ||
| 375 | /* Interrupt */ | 375 | /* Interrupt */ |
| 376 | regs_buff[13] = rd32(E1000_EICR); | 376 | /* Reading EICS for EICR because they read the |
| 377 | * same but EICS does not clear on read */ | ||
| 378 | regs_buff[13] = rd32(E1000_EICS); | ||
| 377 | regs_buff[14] = rd32(E1000_EICS); | 379 | regs_buff[14] = rd32(E1000_EICS); |
| 378 | regs_buff[15] = rd32(E1000_EIMS); | 380 | regs_buff[15] = rd32(E1000_EIMS); |
| 379 | regs_buff[16] = rd32(E1000_EIMC); | 381 | regs_buff[16] = rd32(E1000_EIMC); |
| 380 | regs_buff[17] = rd32(E1000_EIAC); | 382 | regs_buff[17] = rd32(E1000_EIAC); |
| 381 | regs_buff[18] = rd32(E1000_EIAM); | 383 | regs_buff[18] = rd32(E1000_EIAM); |
| 382 | regs_buff[19] = rd32(E1000_ICR); | 384 | /* Reading ICS for ICR because they read the |
| 385 | * same but ICS does not clear on read */ | ||
| 386 | regs_buff[19] = rd32(E1000_ICS); | ||
| 383 | regs_buff[20] = rd32(E1000_ICS); | 387 | regs_buff[20] = rd32(E1000_ICS); |
| 384 | regs_buff[21] = rd32(E1000_IMS); | 388 | regs_buff[21] = rd32(E1000_IMS); |
| 385 | regs_buff[22] = rd32(E1000_IMC); | 389 | regs_buff[22] = rd32(E1000_IMC); |
| @@ -1746,15 +1750,6 @@ static int igb_wol_exclusion(struct igb_adapter *adapter, | |||
| 1746 | /* return success for non excluded adapter ports */ | 1750 | /* return success for non excluded adapter ports */ |
| 1747 | retval = 0; | 1751 | retval = 0; |
| 1748 | break; | 1752 | break; |
| 1749 | case E1000_DEV_ID_82576_QUAD_COPPER: | ||
| 1750 | /* quad port adapters only support WoL on port A */ | ||
| 1751 | if (!(adapter->flags & IGB_FLAG_QUAD_PORT_A)) { | ||
| 1752 | wol->supported = 0; | ||
| 1753 | break; | ||
| 1754 | } | ||
| 1755 | /* return success for non excluded adapter ports */ | ||
| 1756 | retval = 0; | ||
| 1757 | break; | ||
| 1758 | default: | 1753 | default: |
| 1759 | /* dual port cards only support WoL on port A from now on | 1754 | /* dual port cards only support WoL on port A from now on |
| 1760 | * unless it was enabled in the eeprom for port B | 1755 | * unless it was enabled in the eeprom for port B |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 8f66e15ec8d6..634c4c9d87be 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
| @@ -61,7 +61,6 @@ static struct pci_device_id igb_pci_tbl[] = { | |||
| 61 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 }, | 61 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 }, |
| 62 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 }, | 62 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 }, |
| 63 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 }, | 63 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 }, |
| 64 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 }, | ||
| 65 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 }, | 64 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 }, |
| 66 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 }, | 65 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 }, |
| 67 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), board_82575 }, | 66 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), board_82575 }, |
| @@ -521,7 +520,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter) | |||
| 521 | adapter->msix_entries, | 520 | adapter->msix_entries, |
| 522 | numvecs); | 521 | numvecs); |
| 523 | if (err == 0) | 522 | if (err == 0) |
| 524 | return; | 523 | goto out; |
| 525 | 524 | ||
| 526 | igb_reset_interrupt_capability(adapter); | 525 | igb_reset_interrupt_capability(adapter); |
| 527 | 526 | ||
| @@ -531,7 +530,7 @@ msi_only: | |||
| 531 | adapter->num_tx_queues = 1; | 530 | adapter->num_tx_queues = 1; |
| 532 | if (!pci_enable_msi(adapter->pdev)) | 531 | if (!pci_enable_msi(adapter->pdev)) |
| 533 | adapter->flags |= IGB_FLAG_HAS_MSI; | 532 | adapter->flags |= IGB_FLAG_HAS_MSI; |
| 534 | 533 | out: | |
| 535 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ | 534 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ |
| 536 | adapter->netdev->real_num_tx_queues = adapter->num_tx_queues; | 535 | adapter->netdev->real_num_tx_queues = adapter->num_tx_queues; |
| 537 | return; | 536 | return; |
| @@ -1217,16 +1216,6 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
| 1217 | if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1) | 1216 | if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1) |
| 1218 | adapter->eeprom_wol = 0; | 1217 | adapter->eeprom_wol = 0; |
| 1219 | break; | 1218 | break; |
| 1220 | case E1000_DEV_ID_82576_QUAD_COPPER: | ||
| 1221 | /* if quad port adapter, disable WoL on all but port A */ | ||
| 1222 | if (global_quad_port_a != 0) | ||
| 1223 | adapter->eeprom_wol = 0; | ||
| 1224 | else | ||
| 1225 | adapter->flags |= IGB_FLAG_QUAD_PORT_A; | ||
| 1226 | /* Reset for multiple quad port adapters */ | ||
| 1227 | if (++global_quad_port_a == 4) | ||
| 1228 | global_quad_port_a = 0; | ||
| 1229 | break; | ||
| 1230 | } | 1219 | } |
| 1231 | 1220 | ||
| 1232 | /* initialize the wol settings based on the eeprom settings */ | 1221 | /* initialize the wol settings based on the eeprom settings */ |
| @@ -2290,7 +2279,9 @@ static void igb_watchdog_task(struct work_struct *work) | |||
| 2290 | struct igb_ring *tx_ring = adapter->tx_ring; | 2279 | struct igb_ring *tx_ring = adapter->tx_ring; |
| 2291 | struct e1000_mac_info *mac = &adapter->hw.mac; | 2280 | struct e1000_mac_info *mac = &adapter->hw.mac; |
| 2292 | u32 link; | 2281 | u32 link; |
| 2282 | u32 eics = 0; | ||
| 2293 | s32 ret_val; | 2283 | s32 ret_val; |
| 2284 | int i; | ||
| 2294 | 2285 | ||
| 2295 | if ((netif_carrier_ok(netdev)) && | 2286 | if ((netif_carrier_ok(netdev)) && |
| 2296 | (rd32(E1000_STATUS) & E1000_STATUS_LU)) | 2287 | (rd32(E1000_STATUS) & E1000_STATUS_LU)) |
| @@ -2392,7 +2383,13 @@ link_up: | |||
| 2392 | } | 2383 | } |
| 2393 | 2384 | ||
| 2394 | /* Cause software interrupt to ensure rx ring is cleaned */ | 2385 | /* Cause software interrupt to ensure rx ring is cleaned */ |
| 2395 | wr32(E1000_ICS, E1000_ICS_RXDMT0); | 2386 | if (adapter->msix_entries) { |
| 2387 | for (i = 0; i < adapter->num_rx_queues; i++) | ||
| 2388 | eics |= adapter->rx_ring[i].eims_value; | ||
| 2389 | wr32(E1000_EICS, eics); | ||
| 2390 | } else { | ||
| 2391 | wr32(E1000_ICS, E1000_ICS_RXDMT0); | ||
| 2392 | } | ||
| 2396 | 2393 | ||
| 2397 | /* Force detection of hung controller every watchdog period */ | 2394 | /* Force detection of hung controller every watchdog period */ |
| 2398 | tx_ring->detect_tx_hung = true; | 2395 | tx_ring->detect_tx_hung = true; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 34bca16d48a6..53f41b649f03 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -1636,16 +1636,17 @@ static void ixgbe_set_multi(struct net_device *netdev) | |||
| 1636 | struct ixgbe_hw *hw = &adapter->hw; | 1636 | struct ixgbe_hw *hw = &adapter->hw; |
| 1637 | struct dev_mc_list *mc_ptr; | 1637 | struct dev_mc_list *mc_ptr; |
| 1638 | u8 *mta_list; | 1638 | u8 *mta_list; |
| 1639 | u32 fctrl; | 1639 | u32 fctrl, vlnctrl; |
| 1640 | int i; | 1640 | int i; |
| 1641 | 1641 | ||
| 1642 | /* Check for Promiscuous and All Multicast modes */ | 1642 | /* Check for Promiscuous and All Multicast modes */ |
| 1643 | 1643 | ||
| 1644 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 1644 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
| 1645 | vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); | ||
| 1645 | 1646 | ||
| 1646 | if (netdev->flags & IFF_PROMISC) { | 1647 | if (netdev->flags & IFF_PROMISC) { |
| 1647 | fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); | 1648 | fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); |
| 1648 | fctrl &= ~IXGBE_VLNCTRL_VFE; | 1649 | vlnctrl &= ~IXGBE_VLNCTRL_VFE; |
| 1649 | } else { | 1650 | } else { |
| 1650 | if (netdev->flags & IFF_ALLMULTI) { | 1651 | if (netdev->flags & IFF_ALLMULTI) { |
| 1651 | fctrl |= IXGBE_FCTRL_MPE; | 1652 | fctrl |= IXGBE_FCTRL_MPE; |
| @@ -1653,10 +1654,11 @@ static void ixgbe_set_multi(struct net_device *netdev) | |||
| 1653 | } else { | 1654 | } else { |
| 1654 | fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); | 1655 | fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); |
| 1655 | } | 1656 | } |
| 1656 | fctrl |= IXGBE_VLNCTRL_VFE; | 1657 | vlnctrl |= IXGBE_VLNCTRL_VFE; |
| 1657 | } | 1658 | } |
| 1658 | 1659 | ||
| 1659 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); | 1660 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); |
| 1661 | IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); | ||
| 1660 | 1662 | ||
| 1661 | if (netdev->mc_count) { | 1663 | if (netdev->mc_count) { |
| 1662 | mta_list = kcalloc(netdev->mc_count, ETH_ALEN, GFP_ATOMIC); | 1664 | mta_list = kcalloc(netdev->mc_count, ETH_ALEN, GFP_ATOMIC); |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 46819af3b062..0a18b9e96da1 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | #include <asm/system.h> | 55 | #include <asm/system.h> |
| 56 | 56 | ||
| 57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; | 57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; |
| 58 | static char mv643xx_eth_driver_version[] = "1.2"; | 58 | static char mv643xx_eth_driver_version[] = "1.3"; |
| 59 | 59 | ||
| 60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX | 60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX |
| 61 | #define MV643XX_ETH_NAPI | 61 | #define MV643XX_ETH_NAPI |
| @@ -474,11 +474,19 @@ static void rxq_refill(struct rx_queue *rxq) | |||
| 474 | /* | 474 | /* |
| 475 | * Reserve 2+14 bytes for an ethernet header (the | 475 | * Reserve 2+14 bytes for an ethernet header (the |
| 476 | * hardware automatically prepends 2 bytes of dummy | 476 | * hardware automatically prepends 2 bytes of dummy |
| 477 | * data to each received packet), 4 bytes for a VLAN | 477 | * data to each received packet), 16 bytes for up to |
| 478 | * header, and 4 bytes for the trailing FCS -- 24 | 478 | * four VLAN tags, and 4 bytes for the trailing FCS |
| 479 | * bytes total. | 479 | * -- 36 bytes total. |
| 480 | */ | 480 | */ |
| 481 | skb_size = mp->dev->mtu + 24; | 481 | skb_size = mp->dev->mtu + 36; |
| 482 | |||
| 483 | /* | ||
| 484 | * Make sure that the skb size is a multiple of 8 | ||
| 485 | * bytes, as the lower three bits of the receive | ||
| 486 | * descriptor's buffer size field are ignored by | ||
| 487 | * the hardware. | ||
| 488 | */ | ||
| 489 | skb_size = (skb_size + 7) & ~7; | ||
| 482 | 490 | ||
| 483 | skb = dev_alloc_skb(skb_size + dma_get_cache_alignment() - 1); | 491 | skb = dev_alloc_skb(skb_size + dma_get_cache_alignment() - 1); |
| 484 | if (skb == NULL) | 492 | if (skb == NULL) |
| @@ -509,10 +517,8 @@ static void rxq_refill(struct rx_queue *rxq) | |||
| 509 | skb_reserve(skb, 2); | 517 | skb_reserve(skb, 2); |
| 510 | } | 518 | } |
| 511 | 519 | ||
| 512 | if (rxq->rx_desc_count != rxq->rx_ring_size) { | 520 | if (rxq->rx_desc_count != rxq->rx_ring_size) |
| 513 | rxq->rx_oom.expires = jiffies + (HZ / 10); | 521 | mod_timer(&rxq->rx_oom, jiffies + (HZ / 10)); |
| 514 | add_timer(&rxq->rx_oom); | ||
| 515 | } | ||
| 516 | 522 | ||
| 517 | spin_unlock_irqrestore(&mp->lock, flags); | 523 | spin_unlock_irqrestore(&mp->lock, flags); |
| 518 | } | 524 | } |
| @@ -529,7 +535,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
| 529 | int rx; | 535 | int rx; |
| 530 | 536 | ||
| 531 | rx = 0; | 537 | rx = 0; |
| 532 | while (rx < budget) { | 538 | while (rx < budget && rxq->rx_desc_count) { |
| 533 | struct rx_desc *rx_desc; | 539 | struct rx_desc *rx_desc; |
| 534 | unsigned int cmd_sts; | 540 | unsigned int cmd_sts; |
| 535 | struct sk_buff *skb; | 541 | struct sk_buff *skb; |
| @@ -554,7 +560,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
| 554 | spin_unlock_irqrestore(&mp->lock, flags); | 560 | spin_unlock_irqrestore(&mp->lock, flags); |
| 555 | 561 | ||
| 556 | dma_unmap_single(NULL, rx_desc->buf_ptr + 2, | 562 | dma_unmap_single(NULL, rx_desc->buf_ptr + 2, |
| 557 | mp->dev->mtu + 24, DMA_FROM_DEVICE); | 563 | rx_desc->buf_size, DMA_FROM_DEVICE); |
| 558 | rxq->rx_desc_count--; | 564 | rxq->rx_desc_count--; |
| 559 | rx++; | 565 | rx++; |
| 560 | 566 | ||
| @@ -636,9 +642,9 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
| 636 | txq_reclaim(mp->txq + i, 0); | 642 | txq_reclaim(mp->txq + i, 0); |
| 637 | 643 | ||
| 638 | if (netif_carrier_ok(mp->dev)) { | 644 | if (netif_carrier_ok(mp->dev)) { |
| 639 | spin_lock(&mp->lock); | 645 | spin_lock_irq(&mp->lock); |
| 640 | __txq_maybe_wake(mp->txq + mp->txq_primary); | 646 | __txq_maybe_wake(mp->txq + mp->txq_primary); |
| 641 | spin_unlock(&mp->lock); | 647 | spin_unlock_irq(&mp->lock); |
| 642 | } | 648 | } |
| 643 | } | 649 | } |
| 644 | #endif | 650 | #endif |
| @@ -650,8 +656,6 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
| 650 | 656 | ||
| 651 | if (rx < budget) { | 657 | if (rx < budget) { |
| 652 | netif_rx_complete(mp->dev, napi); | 658 | netif_rx_complete(mp->dev, napi); |
| 653 | wrl(mp, INT_CAUSE(mp->port_num), 0); | ||
| 654 | wrl(mp, INT_CAUSE_EXT(mp->port_num), 0); | ||
| 655 | wrl(mp, INT_MASK(mp->port_num), INT_TX_END | INT_RX | INT_EXT); | 659 | wrl(mp, INT_MASK(mp->port_num), INT_TX_END | INT_RX | INT_EXT); |
| 656 | } | 660 | } |
| 657 | 661 | ||
| @@ -1796,6 +1800,7 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
| 1796 | */ | 1800 | */ |
| 1797 | #ifdef MV643XX_ETH_NAPI | 1801 | #ifdef MV643XX_ETH_NAPI |
| 1798 | if (int_cause & INT_RX) { | 1802 | if (int_cause & INT_RX) { |
| 1803 | wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_RX)); | ||
| 1799 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); | 1804 | wrl(mp, INT_MASK(mp->port_num), 0x00000000); |
| 1800 | rdl(mp, INT_MASK(mp->port_num)); | 1805 | rdl(mp, INT_MASK(mp->port_num)); |
| 1801 | 1806 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 54cd89cb0838..d6524db321af 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
| @@ -75,7 +75,7 @@ | |||
| 75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
| 76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
| 77 | 77 | ||
| 78 | #define MYRI10GE_VERSION_STR "1.3.99-1.347" | 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.358" |
| 79 | 79 | ||
| 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
| 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index a3e3895e5032..0f6f9747d255 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -2792,7 +2792,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
| 2792 | pkt_size, PCI_DMA_FROMDEVICE); | 2792 | pkt_size, PCI_DMA_FROMDEVICE); |
| 2793 | rtl8169_mark_to_asic(desc, tp->rx_buf_sz); | 2793 | rtl8169_mark_to_asic(desc, tp->rx_buf_sz); |
| 2794 | } else { | 2794 | } else { |
| 2795 | pci_unmap_single(pdev, addr, pkt_size, | 2795 | pci_unmap_single(pdev, addr, tp->rx_buf_sz, |
| 2796 | PCI_DMA_FROMDEVICE); | 2796 | PCI_DMA_FROMDEVICE); |
| 2797 | tp->Rx_skbuff[entry] = NULL; | 2797 | tp->Rx_skbuff[entry] = NULL; |
| 2798 | } | 2798 | } |
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c index 889f98724610..a85efcfd9d0e 100644 --- a/drivers/net/skfp/ess.c +++ b/drivers/net/skfp/ess.c | |||
| @@ -510,7 +510,7 @@ static void ess_send_response(struct s_smc *smc, struct smt_header *sm, | |||
| 510 | chg->path.para.p_type = SMT_P320B ; | 510 | chg->path.para.p_type = SMT_P320B ; |
| 511 | chg->path.para.p_len = sizeof(struct smt_p_320b) - PARA_LEN ; | 511 | chg->path.para.p_len = sizeof(struct smt_p_320b) - PARA_LEN ; |
| 512 | chg->path.mib_index = SBAPATHINDEX ; | 512 | chg->path.mib_index = SBAPATHINDEX ; |
| 513 | chg->path.path_pad = (u_short)NULL ; | 513 | chg->path.path_pad = 0; |
| 514 | chg->path.path_index = PRIMARY_RING ; | 514 | chg->path.path_index = PRIMARY_RING ; |
| 515 | 515 | ||
| 516 | /* set P320F */ | 516 | /* set P320F */ |
| @@ -606,7 +606,7 @@ static void ess_send_alc_req(struct s_smc *smc) | |||
| 606 | req->path.para.p_type = SMT_P320B ; | 606 | req->path.para.p_type = SMT_P320B ; |
| 607 | req->path.para.p_len = sizeof(struct smt_p_320b) - PARA_LEN ; | 607 | req->path.para.p_len = sizeof(struct smt_p_320b) - PARA_LEN ; |
| 608 | req->path.mib_index = SBAPATHINDEX ; | 608 | req->path.mib_index = SBAPATHINDEX ; |
| 609 | req->path.path_pad = (u_short)NULL ; | 609 | req->path.path_pad = 0; |
| 610 | req->path.path_index = PRIMARY_RING ; | 610 | req->path.path_index = PRIMARY_RING ; |
| 611 | 611 | ||
| 612 | /* set P0017 */ | 612 | /* set P0017 */ |
| @@ -636,7 +636,7 @@ static void ess_send_alc_req(struct s_smc *smc) | |||
| 636 | /* set P19 */ | 636 | /* set P19 */ |
| 637 | req->a_addr.para.p_type = SMT_P0019 ; | 637 | req->a_addr.para.p_type = SMT_P0019 ; |
| 638 | req->a_addr.para.p_len = sizeof(struct smt_p_0019) - PARA_LEN ; | 638 | req->a_addr.para.p_len = sizeof(struct smt_p_0019) - PARA_LEN ; |
| 639 | req->a_addr.sba_pad = (u_short)NULL ; | 639 | req->a_addr.sba_pad = 0; |
| 640 | req->a_addr.alloc_addr = null_addr ; | 640 | req->a_addr.alloc_addr = null_addr ; |
| 641 | 641 | ||
| 642 | /* set P1A */ | 642 | /* set P1A */ |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 2040965d7724..24768c10cadb 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
| @@ -2255,7 +2255,7 @@ static int smc_drv_remove(struct platform_device *pdev) | |||
| 2255 | 2255 | ||
| 2256 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs"); | 2256 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs"); |
| 2257 | if (!res) | 2257 | if (!res) |
| 2258 | platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2258 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 2259 | release_mem_region(res->start, SMC_IO_EXTENT); | 2259 | release_mem_region(res->start, SMC_IO_EXTENT); |
| 2260 | 2260 | ||
| 2261 | free_netdev(ndev); | 2261 | free_netdev(ndev); |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1b7cac77159e..6e42b5a8c22b 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -397,7 +397,7 @@ static const struct usb_device_id hso_ids[] = { | |||
| 397 | {default_port_device(0x0af0, 0xc031)}, /* Icon-Edge */ | 397 | {default_port_device(0x0af0, 0xc031)}, /* Icon-Edge */ |
| 398 | {icon321_port_device(0x0af0, 0xd013)}, /* Module HSxPA */ | 398 | {icon321_port_device(0x0af0, 0xd013)}, /* Module HSxPA */ |
| 399 | {icon321_port_device(0x0af0, 0xd031)}, /* Icon-321 */ | 399 | {icon321_port_device(0x0af0, 0xd031)}, /* Icon-321 */ |
| 400 | {default_port_device(0x0af0, 0xd033)}, /* Icon-322 */ | 400 | {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */ |
| 401 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ | 401 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ |
| 402 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ | 402 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ |
| 403 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ | 403 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ |
| @@ -2613,6 +2613,7 @@ static int hso_resume(struct usb_interface *iface) | |||
| 2613 | "Transmitting lingering data\n"); | 2613 | "Transmitting lingering data\n"); |
| 2614 | hso_net_start_xmit(hso_net->skb_tx_buf, | 2614 | hso_net_start_xmit(hso_net->skb_tx_buf, |
| 2615 | hso_net->net); | 2615 | hso_net->net); |
| 2616 | hso_net->skb_tx_buf = NULL; | ||
| 2616 | } | 2617 | } |
| 2617 | result = hso_start_net_device(network_table[i]); | 2618 | result = hso_start_net_device(network_table[i]); |
| 2618 | if (result) | 2619 | if (result) |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index c3d119f997f5..ca9d00c1194e 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
| @@ -46,6 +46,10 @@ | |||
| 46 | 46 | ||
| 47 | #define MCS7830_VENDOR_ID 0x9710 | 47 | #define MCS7830_VENDOR_ID 0x9710 |
| 48 | #define MCS7830_PRODUCT_ID 0x7830 | 48 | #define MCS7830_PRODUCT_ID 0x7830 |
| 49 | #define MCS7730_PRODUCT_ID 0x7730 | ||
| 50 | |||
| 51 | #define SITECOM_VENDOR_ID 0x0DF6 | ||
| 52 | #define LN_030_PRODUCT_ID 0x0021 | ||
| 49 | 53 | ||
| 50 | #define MCS7830_MII_ADVERTISE (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \ | 54 | #define MCS7830_MII_ADVERTISE (ADVERTISE_PAUSE_CAP | ADVERTISE_100FULL | \ |
| 51 | ADVERTISE_100HALF | ADVERTISE_10FULL | \ | 55 | ADVERTISE_100HALF | ADVERTISE_10FULL | \ |
| @@ -442,6 +446,29 @@ static struct ethtool_ops mcs7830_ethtool_ops = { | |||
| 442 | .nway_reset = usbnet_nway_reset, | 446 | .nway_reset = usbnet_nway_reset, |
| 443 | }; | 447 | }; |
| 444 | 448 | ||
| 449 | static int mcs7830_set_mac_address(struct net_device *netdev, void *p) | ||
| 450 | { | ||
| 451 | int ret; | ||
| 452 | struct usbnet *dev = netdev_priv(netdev); | ||
| 453 | struct sockaddr *addr = p; | ||
| 454 | |||
| 455 | if (netif_running(netdev)) | ||
| 456 | return -EBUSY; | ||
| 457 | |||
| 458 | if (!is_valid_ether_addr(addr->sa_data)) | ||
| 459 | return -EINVAL; | ||
| 460 | |||
| 461 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | ||
| 462 | |||
| 463 | ret = mcs7830_set_reg(dev, HIF_REG_ETHERNET_ADDR, ETH_ALEN, | ||
| 464 | netdev->dev_addr); | ||
| 465 | |||
| 466 | if (ret < 0) | ||
| 467 | return ret; | ||
| 468 | |||
| 469 | return 0; | ||
| 470 | } | ||
| 471 | |||
| 445 | static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) | 472 | static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) |
| 446 | { | 473 | { |
| 447 | struct net_device *net = dev->net; | 474 | struct net_device *net = dev->net; |
| @@ -455,6 +482,7 @@ static int mcs7830_bind(struct usbnet *dev, struct usb_interface *udev) | |||
| 455 | net->ethtool_ops = &mcs7830_ethtool_ops; | 482 | net->ethtool_ops = &mcs7830_ethtool_ops; |
| 456 | net->set_multicast_list = mcs7830_set_multicast; | 483 | net->set_multicast_list = mcs7830_set_multicast; |
| 457 | mcs7830_set_multicast(net); | 484 | mcs7830_set_multicast(net); |
| 485 | net->set_mac_address = mcs7830_set_mac_address; | ||
| 458 | 486 | ||
| 459 | /* reserve space for the status byte on rx */ | 487 | /* reserve space for the status byte on rx */ |
| 460 | dev->rx_urb_size = ETH_FRAME_LEN + 1; | 488 | dev->rx_urb_size = ETH_FRAME_LEN + 1; |
| @@ -491,7 +519,16 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
| 491 | } | 519 | } |
| 492 | 520 | ||
| 493 | static const struct driver_info moschip_info = { | 521 | static const struct driver_info moschip_info = { |
| 494 | .description = "MOSCHIP 7830 usb-NET adapter", | 522 | .description = "MOSCHIP 7830/7730 usb-NET adapter", |
| 523 | .bind = mcs7830_bind, | ||
| 524 | .rx_fixup = mcs7830_rx_fixup, | ||
| 525 | .flags = FLAG_ETHER, | ||
| 526 | .in = 1, | ||
| 527 | .out = 2, | ||
| 528 | }; | ||
| 529 | |||
| 530 | static const struct driver_info sitecom_info = { | ||
| 531 | .description = "Sitecom LN-30 usb-NET adapter", | ||
| 495 | .bind = mcs7830_bind, | 532 | .bind = mcs7830_bind, |
| 496 | .rx_fixup = mcs7830_rx_fixup, | 533 | .rx_fixup = mcs7830_rx_fixup, |
| 497 | .flags = FLAG_ETHER, | 534 | .flags = FLAG_ETHER, |
| @@ -504,6 +541,14 @@ static const struct usb_device_id products[] = { | |||
| 504 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), | 541 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), |
| 505 | .driver_info = (unsigned long) &moschip_info, | 542 | .driver_info = (unsigned long) &moschip_info, |
| 506 | }, | 543 | }, |
| 544 | { | ||
| 545 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7730_PRODUCT_ID), | ||
| 546 | .driver_info = (unsigned long) &moschip_info, | ||
| 547 | }, | ||
| 548 | { | ||
| 549 | USB_DEVICE(SITECOM_VENDOR_ID, LN_030_PRODUCT_ID), | ||
| 550 | .driver_info = (unsigned long) &sitecom_info, | ||
| 551 | }, | ||
| 507 | {}, | 552 | {}, |
| 508 | }; | 553 | }; |
| 509 | MODULE_DEVICE_TABLE(usb, products); | 554 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index e59255a155a9..6596cd0742b9 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
| @@ -1317,7 +1317,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
| 1317 | break; | 1317 | break; |
| 1318 | 1318 | ||
| 1319 | case SIOCDEVRESINSTATS : | 1319 | case SIOCDEVRESINSTATS : |
| 1320 | if( current->euid != 0 ) /* root only */ | 1320 | if (!capable(CAP_NET_ADMIN)) |
| 1321 | return -EPERM; | 1321 | return -EPERM; |
| 1322 | memset( &nl->in_stats, 0, sizeof(struct sbni_in_stats) ); | 1322 | memset( &nl->in_stats, 0, sizeof(struct sbni_in_stats) ); |
| 1323 | break; | 1323 | break; |
| @@ -1334,7 +1334,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
| 1334 | break; | 1334 | break; |
| 1335 | 1335 | ||
| 1336 | case SIOCDEVSHWSTATE : | 1336 | case SIOCDEVSHWSTATE : |
| 1337 | if( current->euid != 0 ) /* root only */ | 1337 | if (!capable(CAP_NET_ADMIN)) |
| 1338 | return -EPERM; | 1338 | return -EPERM; |
| 1339 | 1339 | ||
| 1340 | spin_lock( &nl->lock ); | 1340 | spin_lock( &nl->lock ); |
| @@ -1355,7 +1355,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
| 1355 | #ifdef CONFIG_SBNI_MULTILINE | 1355 | #ifdef CONFIG_SBNI_MULTILINE |
| 1356 | 1356 | ||
| 1357 | case SIOCDEVENSLAVE : | 1357 | case SIOCDEVENSLAVE : |
| 1358 | if( current->euid != 0 ) /* root only */ | 1358 | if (!capable(CAP_NET_ADMIN)) |
| 1359 | return -EPERM; | 1359 | return -EPERM; |
| 1360 | 1360 | ||
| 1361 | if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name )) | 1361 | if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name )) |
| @@ -1370,7 +1370,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
| 1370 | return enslave( dev, slave_dev ); | 1370 | return enslave( dev, slave_dev ); |
| 1371 | 1371 | ||
| 1372 | case SIOCDEVEMANSIPATE : | 1372 | case SIOCDEVEMANSIPATE : |
| 1373 | if( current->euid != 0 ) /* root only */ | 1373 | if (!capable(CAP_NET_ADMIN)) |
| 1374 | return -EPERM; | 1374 | return -EPERM; |
| 1375 | 1375 | ||
| 1376 | return emancipate( dev ); | 1376 | return emancipate( dev ); |
diff --git a/drivers/net/wd.c b/drivers/net/wd.c index 6f9aa1643743..fa14255282af 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c | |||
| @@ -337,7 +337,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr) | |||
| 337 | #ifdef CONFIG_NET_POLL_CONTROLLER | 337 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 338 | dev->poll_controller = ei_poll; | 338 | dev->poll_controller = ei_poll; |
| 339 | #endif | 339 | #endif |
| 340 | NS8390p_init(dev, 0); | 340 | NS8390_init(dev, 0); |
| 341 | 341 | ||
| 342 | #if 1 | 342 | #if 1 |
| 343 | /* Enable interrupt generation on softconfig cards -- M.U */ | 343 | /* Enable interrupt generation on softconfig cards -- M.U */ |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index b20a45aa8680..0676c6d84383 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
| @@ -251,7 +251,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc, | |||
| 251 | return; | 251 | return; |
| 252 | pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, | 252 | pci_unmap_single(sc->pdev, bf->skbaddr, bf->skb->len, |
| 253 | PCI_DMA_TODEVICE); | 253 | PCI_DMA_TODEVICE); |
| 254 | dev_kfree_skb(bf->skb); | 254 | dev_kfree_skb_any(bf->skb); |
| 255 | bf->skb = NULL; | 255 | bf->skb = NULL; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| @@ -466,6 +466,7 @@ ath5k_pci_probe(struct pci_dev *pdev, | |||
| 466 | mutex_init(&sc->lock); | 466 | mutex_init(&sc->lock); |
| 467 | spin_lock_init(&sc->rxbuflock); | 467 | spin_lock_init(&sc->rxbuflock); |
| 468 | spin_lock_init(&sc->txbuflock); | 468 | spin_lock_init(&sc->txbuflock); |
| 469 | spin_lock_init(&sc->block); | ||
| 469 | 470 | ||
| 470 | /* Set private data */ | 471 | /* Set private data */ |
| 471 | pci_set_drvdata(pdev, hw); | 472 | pci_set_drvdata(pdev, hw); |
| @@ -2179,8 +2180,11 @@ ath5k_beacon_config(struct ath5k_softc *sc) | |||
| 2179 | 2180 | ||
| 2180 | sc->imask |= AR5K_INT_SWBA; | 2181 | sc->imask |= AR5K_INT_SWBA; |
| 2181 | 2182 | ||
| 2182 | if (ath5k_hw_hasveol(ah)) | 2183 | if (ath5k_hw_hasveol(ah)) { |
| 2184 | spin_lock(&sc->block); | ||
| 2183 | ath5k_beacon_send(sc); | 2185 | ath5k_beacon_send(sc); |
| 2186 | spin_unlock(&sc->block); | ||
| 2187 | } | ||
| 2184 | } | 2188 | } |
| 2185 | /* TODO else AP */ | 2189 | /* TODO else AP */ |
| 2186 | 2190 | ||
| @@ -2403,7 +2407,9 @@ ath5k_intr(int irq, void *dev_id) | |||
| 2403 | TSF_TO_TU(tsf), | 2407 | TSF_TO_TU(tsf), |
| 2404 | (unsigned long long) tsf); | 2408 | (unsigned long long) tsf); |
| 2405 | } else { | 2409 | } else { |
| 2410 | spin_lock(&sc->block); | ||
| 2406 | ath5k_beacon_send(sc); | 2411 | ath5k_beacon_send(sc); |
| 2412 | spin_unlock(&sc->block); | ||
| 2407 | } | 2413 | } |
| 2408 | } | 2414 | } |
| 2409 | if (status & AR5K_INT_RXEOL) { | 2415 | if (status & AR5K_INT_RXEOL) { |
| @@ -2745,6 +2751,11 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
| 2745 | ret = -EOPNOTSUPP; | 2751 | ret = -EOPNOTSUPP; |
| 2746 | goto end; | 2752 | goto end; |
| 2747 | } | 2753 | } |
| 2754 | |||
| 2755 | /* Set to a reasonable value. Note that this will | ||
| 2756 | * be set to mac80211's value at ath5k_config(). */ | ||
| 2757 | sc->bintval = 1000; | ||
| 2758 | |||
| 2748 | ret = 0; | 2759 | ret = 0; |
| 2749 | end: | 2760 | end: |
| 2750 | mutex_unlock(&sc->lock); | 2761 | mutex_unlock(&sc->lock); |
| @@ -2789,9 +2800,6 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 2789 | struct ath5k_hw *ah = sc->ah; | 2800 | struct ath5k_hw *ah = sc->ah; |
| 2790 | int ret; | 2801 | int ret; |
| 2791 | 2802 | ||
| 2792 | /* Set to a reasonable value. Note that this will | ||
| 2793 | * be set to mac80211's value at ath5k_config(). */ | ||
| 2794 | sc->bintval = 1000; | ||
| 2795 | mutex_lock(&sc->lock); | 2803 | mutex_lock(&sc->lock); |
| 2796 | if (sc->vif != vif) { | 2804 | if (sc->vif != vif) { |
| 2797 | ret = -EIO; | 2805 | ret = -EIO; |
| @@ -3050,6 +3058,7 @@ static int | |||
| 3050 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | 3058 | ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) |
| 3051 | { | 3059 | { |
| 3052 | struct ath5k_softc *sc = hw->priv; | 3060 | struct ath5k_softc *sc = hw->priv; |
| 3061 | unsigned long flags; | ||
| 3053 | int ret; | 3062 | int ret; |
| 3054 | 3063 | ||
| 3055 | ath5k_debug_dump_skb(sc, skb, "BC ", 1); | 3064 | ath5k_debug_dump_skb(sc, skb, "BC ", 1); |
| @@ -3059,12 +3068,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 3059 | goto end; | 3068 | goto end; |
| 3060 | } | 3069 | } |
| 3061 | 3070 | ||
| 3071 | spin_lock_irqsave(&sc->block, flags); | ||
| 3062 | ath5k_txbuf_free(sc, sc->bbuf); | 3072 | ath5k_txbuf_free(sc, sc->bbuf); |
| 3063 | sc->bbuf->skb = skb; | 3073 | sc->bbuf->skb = skb; |
| 3064 | ret = ath5k_beacon_setup(sc, sc->bbuf); | 3074 | ret = ath5k_beacon_setup(sc, sc->bbuf); |
| 3065 | if (ret) | 3075 | if (ret) |
| 3066 | sc->bbuf->skb = NULL; | 3076 | sc->bbuf->skb = NULL; |
| 3067 | else { | 3077 | spin_unlock_irqrestore(&sc->block, flags); |
| 3078 | if (!ret) { | ||
| 3068 | ath5k_beacon_config(sc); | 3079 | ath5k_beacon_config(sc); |
| 3069 | mmiowb(); | 3080 | mmiowb(); |
| 3070 | } | 3081 | } |
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index d7e03e6b8271..7ec2f377d5c7 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
| @@ -172,6 +172,7 @@ struct ath5k_softc { | |||
| 172 | struct tasklet_struct txtq; /* tx intr tasklet */ | 172 | struct tasklet_struct txtq; /* tx intr tasklet */ |
| 173 | struct ath5k_led tx_led; /* tx led */ | 173 | struct ath5k_led tx_led; /* tx led */ |
| 174 | 174 | ||
| 175 | spinlock_t block; /* protects beacon */ | ||
| 175 | struct ath5k_buf *bbuf; /* beacon buffer */ | 176 | struct ath5k_buf *bbuf; /* beacon buffer */ |
| 176 | unsigned int bhalq, /* SW q for outgoing beacons */ | 177 | unsigned int bhalq, /* SW q for outgoing beacons */ |
| 177 | bmisscount, /* missed beacon transmits */ | 178 | bmisscount, /* missed beacon transmits */ |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index bd35bb0a1480..bd65c485098c 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
| @@ -1304,7 +1304,7 @@ EXPORT_SYMBOL(atmel_open); | |||
| 1304 | int atmel_open(struct net_device *dev) | 1304 | int atmel_open(struct net_device *dev) |
| 1305 | { | 1305 | { |
| 1306 | struct atmel_private *priv = netdev_priv(dev); | 1306 | struct atmel_private *priv = netdev_priv(dev); |
| 1307 | int i, channel; | 1307 | int i, channel, err; |
| 1308 | 1308 | ||
| 1309 | /* any scheduled timer is no longer needed and might screw things up.. */ | 1309 | /* any scheduled timer is no longer needed and might screw things up.. */ |
| 1310 | del_timer_sync(&priv->management_timer); | 1310 | del_timer_sync(&priv->management_timer); |
| @@ -1328,8 +1328,9 @@ int atmel_open(struct net_device *dev) | |||
| 1328 | priv->site_survey_state = SITE_SURVEY_IDLE; | 1328 | priv->site_survey_state = SITE_SURVEY_IDLE; |
| 1329 | priv->station_is_associated = 0; | 1329 | priv->station_is_associated = 0; |
| 1330 | 1330 | ||
| 1331 | if (!reset_atmel_card(dev)) | 1331 | err = reset_atmel_card(dev); |
| 1332 | return -EAGAIN; | 1332 | if (err) |
| 1333 | return err; | ||
| 1333 | 1334 | ||
| 1334 | if (priv->config_reg_domain) { | 1335 | if (priv->config_reg_domain) { |
| 1335 | priv->reg_domain = priv->config_reg_domain; | 1336 | priv->reg_domain = priv->config_reg_domain; |
| @@ -3061,12 +3062,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) | |||
| 3061 | } | 3062 | } |
| 3062 | 3063 | ||
| 3063 | if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { | 3064 | if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { |
| 3064 | /* Do opensystem first, then try sharedkey */ | 3065 | /* Flip back and forth between WEP auth modes until the max |
| 3066 | * authentication tries has been exceeded. | ||
| 3067 | */ | ||
| 3065 | if (system == WLAN_AUTH_OPEN) { | 3068 | if (system == WLAN_AUTH_OPEN) { |
| 3066 | priv->CurrentAuthentTransactionSeqNum = 0x001; | 3069 | priv->CurrentAuthentTransactionSeqNum = 0x001; |
| 3067 | priv->exclude_unencrypted = 1; | 3070 | priv->exclude_unencrypted = 1; |
| 3068 | send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); | 3071 | send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0); |
| 3069 | return; | 3072 | return; |
| 3073 | } else if ( system == WLAN_AUTH_SHARED_KEY | ||
| 3074 | && priv->wep_is_on) { | ||
| 3075 | priv->CurrentAuthentTransactionSeqNum = 0x001; | ||
| 3076 | priv->exclude_unencrypted = 0; | ||
| 3077 | send_authentication_request(priv, WLAN_AUTH_OPEN, NULL, 0); | ||
| 3078 | return; | ||
| 3070 | } else if (priv->connect_to_any_BSS) { | 3079 | } else if (priv->connect_to_any_BSS) { |
| 3071 | int bss_index; | 3080 | int bss_index; |
| 3072 | 3081 | ||
| @@ -3580,12 +3589,12 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
| 3580 | 3589 | ||
| 3581 | if (i == 0) { | 3590 | if (i == 0) { |
| 3582 | printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); | 3591 | printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name); |
| 3583 | return 0; | 3592 | return -EIO; |
| 3584 | } | 3593 | } |
| 3585 | 3594 | ||
| 3586 | if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { | 3595 | if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) { |
| 3587 | printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); | 3596 | printk(KERN_ALERT "%s: card missing.\n", priv->dev->name); |
| 3588 | return 0; | 3597 | return -ENODEV; |
| 3589 | } | 3598 | } |
| 3590 | 3599 | ||
| 3591 | /* now check for completion of MAC initialization through | 3600 | /* now check for completion of MAC initialization through |
| @@ -3609,19 +3618,19 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
| 3609 | if (i == 0) { | 3618 | if (i == 0) { |
| 3610 | printk(KERN_ALERT "%s: MAC failed to initialise.\n", | 3619 | printk(KERN_ALERT "%s: MAC failed to initialise.\n", |
| 3611 | priv->dev->name); | 3620 | priv->dev->name); |
| 3612 | return 0; | 3621 | return -EIO; |
| 3613 | } | 3622 | } |
| 3614 | 3623 | ||
| 3615 | /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ | 3624 | /* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */ |
| 3616 | if ((mr3 & MAC_INIT_COMPLETE) && | 3625 | if ((mr3 & MAC_INIT_COMPLETE) && |
| 3617 | !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { | 3626 | !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) { |
| 3618 | printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name); | 3627 | printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name); |
| 3619 | return 0; | 3628 | return -EIO; |
| 3620 | } | 3629 | } |
| 3621 | if ((mr1 & MAC_INIT_COMPLETE) && | 3630 | if ((mr1 & MAC_INIT_COMPLETE) && |
| 3622 | !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) { | 3631 | !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) { |
| 3623 | printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name); | 3632 | printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name); |
| 3624 | return 0; | 3633 | return -EIO; |
| 3625 | } | 3634 | } |
| 3626 | 3635 | ||
| 3627 | atmel_copy_to_host(priv->dev, (unsigned char *)iface, | 3636 | atmel_copy_to_host(priv->dev, (unsigned char *)iface, |
| @@ -3642,7 +3651,7 @@ static int atmel_wakeup_firmware(struct atmel_private *priv) | |||
| 3642 | iface->func_ctrl = le16_to_cpu(iface->func_ctrl); | 3651 | iface->func_ctrl = le16_to_cpu(iface->func_ctrl); |
| 3643 | iface->mac_status = le16_to_cpu(iface->mac_status); | 3652 | iface->mac_status = le16_to_cpu(iface->mac_status); |
| 3644 | 3653 | ||
| 3645 | return 1; | 3654 | return 0; |
| 3646 | } | 3655 | } |
| 3647 | 3656 | ||
| 3648 | /* determine type of memory and MAC address */ | 3657 | /* determine type of memory and MAC address */ |
| @@ -3693,7 +3702,7 @@ static int probe_atmel_card(struct net_device *dev) | |||
| 3693 | /* Standard firmware in flash, boot it up and ask | 3702 | /* Standard firmware in flash, boot it up and ask |
| 3694 | for the Mac Address */ | 3703 | for the Mac Address */ |
| 3695 | priv->card_type = CARD_TYPE_SPI_FLASH; | 3704 | priv->card_type = CARD_TYPE_SPI_FLASH; |
| 3696 | if (atmel_wakeup_firmware(priv)) { | 3705 | if (atmel_wakeup_firmware(priv) == 0) { |
| 3697 | atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); | 3706 | atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); |
| 3698 | 3707 | ||
| 3699 | /* got address, now squash it again until the network | 3708 | /* got address, now squash it again until the network |
| @@ -3835,6 +3844,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 3835 | struct atmel_private *priv = netdev_priv(dev); | 3844 | struct atmel_private *priv = netdev_priv(dev); |
| 3836 | u8 configuration; | 3845 | u8 configuration; |
| 3837 | int old_state = priv->station_state; | 3846 | int old_state = priv->station_state; |
| 3847 | int err = 0; | ||
| 3838 | 3848 | ||
| 3839 | /* data to add to the firmware names, in priority order | 3849 | /* data to add to the firmware names, in priority order |
| 3840 | this implemenents firmware versioning */ | 3850 | this implemenents firmware versioning */ |
| @@ -3868,11 +3878,12 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 3868 | dev->name); | 3878 | dev->name); |
| 3869 | strcpy(priv->firmware_id, "atmel_at76c502.bin"); | 3879 | strcpy(priv->firmware_id, "atmel_at76c502.bin"); |
| 3870 | } | 3880 | } |
| 3871 | if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) != 0) { | 3881 | err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev); |
| 3882 | if (err != 0) { | ||
| 3872 | printk(KERN_ALERT | 3883 | printk(KERN_ALERT |
| 3873 | "%s: firmware %s is missing, cannot continue.\n", | 3884 | "%s: firmware %s is missing, cannot continue.\n", |
| 3874 | dev->name, priv->firmware_id); | 3885 | dev->name, priv->firmware_id); |
| 3875 | return 0; | 3886 | return err; |
| 3876 | } | 3887 | } |
| 3877 | } else { | 3888 | } else { |
| 3878 | int fw_index = 0; | 3889 | int fw_index = 0; |
| @@ -3901,7 +3912,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 3901 | "%s: firmware %s is missing, cannot start.\n", | 3912 | "%s: firmware %s is missing, cannot start.\n", |
| 3902 | dev->name, priv->firmware_id); | 3913 | dev->name, priv->firmware_id); |
| 3903 | priv->firmware_id[0] = '\0'; | 3914 | priv->firmware_id[0] = '\0'; |
| 3904 | return 0; | 3915 | return -ENOENT; |
| 3905 | } | 3916 | } |
| 3906 | } | 3917 | } |
| 3907 | 3918 | ||
| @@ -3926,8 +3937,9 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 3926 | release_firmware(fw_entry); | 3937 | release_firmware(fw_entry); |
| 3927 | } | 3938 | } |
| 3928 | 3939 | ||
| 3929 | if (!atmel_wakeup_firmware(priv)) | 3940 | err = atmel_wakeup_firmware(priv); |
| 3930 | return 0; | 3941 | if (err != 0) |
| 3942 | return err; | ||
| 3931 | 3943 | ||
| 3932 | /* Check the version and set the correct flag for wpa stuff, | 3944 | /* Check the version and set the correct flag for wpa stuff, |
| 3933 | old and new firmware is incompatible. | 3945 | old and new firmware is incompatible. |
| @@ -3968,10 +3980,9 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 3968 | if (!priv->radio_on_broken) { | 3980 | if (!priv->radio_on_broken) { |
| 3969 | if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == | 3981 | if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) == |
| 3970 | CMD_STATUS_REJECTED_RADIO_OFF) { | 3982 | CMD_STATUS_REJECTED_RADIO_OFF) { |
| 3971 | printk(KERN_INFO | 3983 | printk(KERN_INFO "%s: cannot turn the radio on.\n", |
| 3972 | "%s: cannot turn the radio on. (Hey radio, you're beautiful!)\n", | ||
| 3973 | dev->name); | 3984 | dev->name); |
| 3974 | return 0; | 3985 | return -EIO; |
| 3975 | } | 3986 | } |
| 3976 | } | 3987 | } |
| 3977 | 3988 | ||
| @@ -4006,7 +4017,7 @@ static int reset_atmel_card(struct net_device *dev) | |||
| 4006 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); | 4017 | wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); |
| 4007 | } | 4018 | } |
| 4008 | 4019 | ||
| 4009 | return 1; | 4020 | return 0; |
| 4010 | } | 4021 | } |
| 4011 | 4022 | ||
| 4012 | static void atmel_send_command(struct atmel_private *priv, int command, | 4023 | static void atmel_send_command(struct atmel_private *priv, int command, |
