diff options
Diffstat (limited to 'drivers/net')
43 files changed, 320 insertions, 191 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 98517a373473..e3bad8247fd1 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -992,6 +992,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
992 | * features | 992 | * features |
993 | */ | 993 | */ |
994 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; | 994 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; |
995 | dev->vlan_features = dev->features; | ||
995 | 996 | ||
996 | dev->irq = pdev->irq; | 997 | dev->irq = pdev->irq; |
997 | 998 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 19f04a34783a..93359fab240e 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -3416,7 +3416,8 @@ config NETCONSOLE | |||
3416 | 3416 | ||
3417 | config NETCONSOLE_DYNAMIC | 3417 | config NETCONSOLE_DYNAMIC |
3418 | bool "Dynamic reconfiguration of logging targets" | 3418 | bool "Dynamic reconfiguration of logging targets" |
3419 | depends on NETCONSOLE && SYSFS && CONFIGFS_FS | 3419 | depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \ |
3420 | !(NETCONSOLE=y && CONFIGFS_FS=m) | ||
3420 | help | 3421 | help |
3421 | This option enables the ability to dynamically reconfigure target | 3422 | This option enables the ability to dynamically reconfigure target |
3422 | parameters (interface, IP addresses, port numbers, MAC addresses) | 3423 | parameters (interface, IP addresses, port numbers, MAC addresses) |
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index 7d25a97d33f6..44e219c910da 100644 --- a/drivers/net/bna/bnad.c +++ b/drivers/net/bna/bnad.c | |||
@@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad, | |||
1111 | struct bna_intr_info *intr_info) | 1111 | struct bna_intr_info *intr_info) |
1112 | { | 1112 | { |
1113 | int err = 0; | 1113 | int err = 0; |
1114 | unsigned long flags; | 1114 | unsigned long irq_flags = 0, flags; |
1115 | u32 irq; | 1115 | u32 irq; |
1116 | irq_handler_t irq_handler; | 1116 | irq_handler_t irq_handler; |
1117 | 1117 | ||
@@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad, | |||
1125 | if (bnad->cfg_flags & BNAD_CF_MSIX) { | 1125 | if (bnad->cfg_flags & BNAD_CF_MSIX) { |
1126 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; | 1126 | irq_handler = (irq_handler_t)bnad_msix_mbox_handler; |
1127 | irq = bnad->msix_table[bnad->msix_num - 1].vector; | 1127 | irq = bnad->msix_table[bnad->msix_num - 1].vector; |
1128 | flags = 0; | ||
1129 | intr_info->intr_type = BNA_INTR_T_MSIX; | 1128 | intr_info->intr_type = BNA_INTR_T_MSIX; |
1130 | intr_info->idl[0].vector = bnad->msix_num - 1; | 1129 | intr_info->idl[0].vector = bnad->msix_num - 1; |
1131 | } else { | 1130 | } else { |
1132 | irq_handler = (irq_handler_t)bnad_isr; | 1131 | irq_handler = (irq_handler_t)bnad_isr; |
1133 | irq = bnad->pcidev->irq; | 1132 | irq = bnad->pcidev->irq; |
1134 | flags = IRQF_SHARED; | 1133 | irq_flags = IRQF_SHARED; |
1135 | intr_info->intr_type = BNA_INTR_T_INTX; | 1134 | intr_info->intr_type = BNA_INTR_T_INTX; |
1136 | /* intr_info->idl.vector = 0 ? */ | 1135 | /* intr_info->idl.vector = 0 ? */ |
1137 | } | 1136 | } |
1138 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 1137 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
1139 | 1138 | flags = irq_flags; | |
1140 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); | 1139 | sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME); |
1141 | 1140 | ||
1142 | /* | 1141 | /* |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 4b70311a11ef..74be989f51c5 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/zlib.h> | 49 | #include <linux/zlib.h> |
50 | #include <linux/io.h> | 50 | #include <linux/io.h> |
51 | #include <linux/stringify.h> | 51 | #include <linux/stringify.h> |
52 | #include <linux/vmalloc.h> | ||
52 | 53 | ||
53 | #define BNX2X_MAIN | 54 | #define BNX2X_MAIN |
54 | #include "bnx2x.h" | 55 | #include "bnx2x.h" |
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp) | |||
4537 | if (bp->strm == NULL) | 4538 | if (bp->strm == NULL) |
4538 | goto gunzip_nomem2; | 4539 | goto gunzip_nomem2; |
4539 | 4540 | ||
4540 | bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(), | 4541 | bp->strm->workspace = vmalloc(zlib_inflate_workspacesize()); |
4541 | GFP_KERNEL); | ||
4542 | if (bp->strm->workspace == NULL) | 4542 | if (bp->strm->workspace == NULL) |
4543 | goto gunzip_nomem3; | 4543 | goto gunzip_nomem3; |
4544 | 4544 | ||
@@ -4562,7 +4562,7 @@ gunzip_nomem1: | |||
4562 | static void bnx2x_gunzip_end(struct bnx2x *bp) | 4562 | static void bnx2x_gunzip_end(struct bnx2x *bp) |
4563 | { | 4563 | { |
4564 | if (bp->strm) { | 4564 | if (bp->strm) { |
4565 | kfree(bp->strm->workspace); | 4565 | vfree(bp->strm->workspace); |
4566 | kfree(bp->strm); | 4566 | kfree(bp->strm); |
4567 | bp->strm = NULL; | 4567 | bp->strm = NULL; |
4568 | } | 4568 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index eafe44a528ac..63c22b0bb5ad 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1428,9 +1428,9 @@ out: | |||
1428 | return features; | 1428 | return features; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | #define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \ | 1431 | #define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \ |
1432 | NETIF_F_SOFT_FEATURES | \ | 1432 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ |
1433 | NETIF_F_LRO) | 1433 | NETIF_F_HIGHDMA | NETIF_F_LRO) |
1434 | 1434 | ||
1435 | static void bond_compute_features(struct bonding *bond) | 1435 | static void bond_compute_features(struct bonding *bond) |
1436 | { | 1436 | { |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 1d699e3df547..754df5ef1729 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -36,7 +36,7 @@ config CAN_SLCAN | |||
36 | config CAN_DEV | 36 | config CAN_DEV |
37 | tristate "Platform CAN drivers with Netlink support" | 37 | tristate "Platform CAN drivers with Netlink support" |
38 | depends on CAN | 38 | depends on CAN |
39 | default Y | 39 | default y |
40 | ---help--- | 40 | ---help--- |
41 | Enables the common framework for platform CAN drivers with Netlink | 41 | Enables the common framework for platform CAN drivers with Netlink |
42 | support. This is the standard library for CAN drivers. | 42 | support. This is the standard library for CAN drivers. |
@@ -45,7 +45,7 @@ config CAN_DEV | |||
45 | config CAN_CALC_BITTIMING | 45 | config CAN_CALC_BITTIMING |
46 | bool "CAN bit-timing calculation" | 46 | bool "CAN bit-timing calculation" |
47 | depends on CAN_DEV | 47 | depends on CAN_DEV |
48 | default Y | 48 | default y |
49 | ---help--- | 49 | ---help--- |
50 | If enabled, CAN bit-timing parameters will be calculated for the | 50 | If enabled, CAN bit-timing parameters will be calculated for the |
51 | bit-rate specified via Netlink argument "bitrate" when the device | 51 | bit-rate specified via Netlink argument "bitrate" when the device |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 3f562ba2f0c9..76bf5892b962 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, | |||
2026 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 2026 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
2027 | } else | 2027 | } else |
2028 | skb_checksum_none_assert(skb); | 2028 | skb_checksum_none_assert(skb); |
2029 | skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); | 2029 | skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); |
2030 | 2030 | ||
2031 | if (unlikely(p->vlan_valid)) { | 2031 | if (unlikely(p->vlan_valid)) { |
2032 | struct vlan_group *grp = pi->vlan_grp; | 2032 | struct vlan_group *grp = pi->vlan_grp; |
@@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs, | |||
2145 | if (!complete) | 2145 | if (!complete) |
2146 | return; | 2146 | return; |
2147 | 2147 | ||
2148 | skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); | 2148 | skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]); |
2149 | 2149 | ||
2150 | if (unlikely(cpl->vlan_valid)) { | 2150 | if (unlikely(cpl->vlan_valid)) { |
2151 | struct vlan_group *grp = pi->vlan_grp; | 2151 | struct vlan_group *grp = pi->vlan_grp; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 2dfcc8047847..dfa55f94ba7f 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev) | |||
2289 | return 0; | 2289 | return 0; |
2290 | } | 2290 | } |
2291 | 2291 | ||
2292 | /* Check if rx parser should be activated */ | ||
2293 | void gfar_check_rx_parser_mode(struct gfar_private *priv) | ||
2294 | { | ||
2295 | struct gfar __iomem *regs; | ||
2296 | u32 tempval; | ||
2297 | |||
2298 | regs = priv->gfargrp[0].regs; | ||
2299 | |||
2300 | tempval = gfar_read(®s->rctrl); | ||
2301 | /* If parse is no longer required, then disable parser */ | ||
2302 | if (tempval & RCTRL_REQ_PARSER) | ||
2303 | tempval |= RCTRL_PRSDEP_INIT; | ||
2304 | else | ||
2305 | tempval &= ~RCTRL_PRSDEP_INIT; | ||
2306 | gfar_write(®s->rctrl, tempval); | ||
2307 | } | ||
2308 | |||
2292 | 2309 | ||
2293 | /* Enables and disables VLAN insertion/extraction */ | 2310 | /* Enables and disables VLAN insertion/extraction */ |
2294 | static void gfar_vlan_rx_register(struct net_device *dev, | 2311 | static void gfar_vlan_rx_register(struct net_device *dev, |
@@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev, | |||
2325 | /* Disable VLAN tag extraction */ | 2342 | /* Disable VLAN tag extraction */ |
2326 | tempval = gfar_read(®s->rctrl); | 2343 | tempval = gfar_read(®s->rctrl); |
2327 | tempval &= ~RCTRL_VLEX; | 2344 | tempval &= ~RCTRL_VLEX; |
2328 | /* If parse is no longer required, then disable parser */ | ||
2329 | if (tempval & RCTRL_REQ_PARSER) | ||
2330 | tempval |= RCTRL_PRSDEP_INIT; | ||
2331 | else | ||
2332 | tempval &= ~RCTRL_PRSDEP_INIT; | ||
2333 | gfar_write(®s->rctrl, tempval); | 2345 | gfar_write(®s->rctrl, tempval); |
2346 | |||
2347 | gfar_check_rx_parser_mode(priv); | ||
2334 | } | 2348 | } |
2335 | 2349 | ||
2336 | gfar_change_mtu(dev, dev->mtu); | 2350 | gfar_change_mtu(dev, dev->mtu); |
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index ba36dc7a3435..440e69d8beff 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -274,7 +274,7 @@ extern const char gfar_driver_version[]; | |||
274 | #define RCTRL_PROM 0x00000008 | 274 | #define RCTRL_PROM 0x00000008 |
275 | #define RCTRL_EMEN 0x00000002 | 275 | #define RCTRL_EMEN 0x00000002 |
276 | #define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ | 276 | #define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ |
277 | RCTRL_TUCSEN) | 277 | RCTRL_TUCSEN | RCTRL_FILREN) |
278 | #define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ | 278 | #define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ |
279 | RCTRL_PRSDEP_INIT) | 279 | RCTRL_PRSDEP_INIT) |
280 | #define RCTRL_EXTHASH (RCTRL_GHTX) | 280 | #define RCTRL_EXTHASH (RCTRL_GHTX) |
@@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv, | |||
1156 | unsigned long tx_mask, unsigned long rx_mask); | 1156 | unsigned long tx_mask, unsigned long rx_mask); |
1157 | void gfar_init_sysfs(struct net_device *dev); | 1157 | void gfar_init_sysfs(struct net_device *dev); |
1158 | int gfar_set_features(struct net_device *dev, u32 features); | 1158 | int gfar_set_features(struct net_device *dev, u32 features); |
1159 | extern void gfar_check_rx_parser_mode(struct gfar_private *priv); | ||
1159 | 1160 | ||
1160 | extern const struct ethtool_ops gfar_ethtool_ops; | 1161 | extern const struct ethtool_ops gfar_ethtool_ops; |
1161 | 1162 | ||
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index f181304a7ab6..672f096fe090 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1015,11 +1015,10 @@ static int greth_set_mac_add(struct net_device *dev, void *p) | |||
1015 | return -EINVAL; | 1015 | return -EINVAL; |
1016 | 1016 | ||
1017 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | 1017 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); |
1018 | GRETH_REGSAVE(regs->esa_msb, dev->dev_addr[0] << 8 | dev->dev_addr[1]); | ||
1019 | GRETH_REGSAVE(regs->esa_lsb, dev->dev_addr[2] << 24 | dev->dev_addr[3] << 16 | | ||
1020 | dev->dev_addr[4] << 8 | dev->dev_addr[5]); | ||
1018 | 1021 | ||
1019 | GRETH_REGSAVE(regs->esa_msb, addr->sa_data[0] << 8 | addr->sa_data[1]); | ||
1020 | GRETH_REGSAVE(regs->esa_lsb, | ||
1021 | addr->sa_data[2] << 24 | addr-> | ||
1022 | sa_data[3] << 16 | addr->sa_data[4] << 8 | addr->sa_data[5]); | ||
1023 | return 0; | 1022 | return 0; |
1024 | } | 1023 | } |
1025 | 1024 | ||
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 3e5d0b6b6516..0d283781bc5e 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -692,10 +692,10 @@ static void sixpack_close(struct tty_struct *tty) | |||
692 | { | 692 | { |
693 | struct sixpack *sp; | 693 | struct sixpack *sp; |
694 | 694 | ||
695 | write_lock(&disc_data_lock); | 695 | write_lock_bh(&disc_data_lock); |
696 | sp = tty->disc_data; | 696 | sp = tty->disc_data; |
697 | tty->disc_data = NULL; | 697 | tty->disc_data = NULL; |
698 | write_unlock(&disc_data_lock); | 698 | write_unlock_bh(&disc_data_lock); |
699 | if (!sp) | 699 | if (!sp) |
700 | return; | 700 | return; |
701 | 701 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 4c628393c8b1..bc02968cee16 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -813,10 +813,10 @@ static void mkiss_close(struct tty_struct *tty) | |||
813 | { | 813 | { |
814 | struct mkiss *ax; | 814 | struct mkiss *ax; |
815 | 815 | ||
816 | write_lock(&disc_data_lock); | 816 | write_lock_bh(&disc_data_lock); |
817 | ax = tty->disc_data; | 817 | ax = tty->disc_data; |
818 | tty->disc_data = NULL; | 818 | tty->disc_data = NULL; |
819 | write_unlock(&disc_data_lock); | 819 | write_unlock_bh(&disc_data_lock); |
820 | 820 | ||
821 | if (!ax) | 821 | if (!ax) |
822 | return; | 822 | return; |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index b78be088c4ad..60f46bc2bf64 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -140,7 +140,7 @@ MODULE_LICENSE("GPL"); | |||
140 | module_param(mtu, int, 0); | 140 | module_param(mtu, int, 0); |
141 | module_param(debug, int, 0); | 141 | module_param(debug, int, 0); |
142 | module_param(rx_copybreak, int, 0); | 142 | module_param(rx_copybreak, int, 0); |
143 | module_param(dspcfg_workaround, int, 1); | 143 | module_param(dspcfg_workaround, int, 0); |
144 | module_param_array(options, int, NULL, 0); | 144 | module_param_array(options, int, NULL, 0); |
145 | module_param_array(full_duplex, int, NULL, 0); | 145 | module_param_array(full_duplex, int, NULL, 0); |
146 | MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)"); | 146 | MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)"); |
@@ -2028,8 +2028,8 @@ static void drain_rx(struct net_device *dev) | |||
2028 | np->rx_ring[i].cmd_status = 0; | 2028 | np->rx_ring[i].cmd_status = 0; |
2029 | np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ | 2029 | np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ |
2030 | if (np->rx_skbuff[i]) { | 2030 | if (np->rx_skbuff[i]) { |
2031 | pci_unmap_single(np->pci_dev, | 2031 | pci_unmap_single(np->pci_dev, np->rx_dma[i], |
2032 | np->rx_dma[i], buflen, | 2032 | buflen + NATSEMI_PADDING, |
2033 | PCI_DMA_FROMDEVICE); | 2033 | PCI_DMA_FROMDEVICE); |
2034 | dev_kfree_skb(np->rx_skbuff[i]); | 2034 | dev_kfree_skb(np->rx_skbuff[i]); |
2035 | } | 2035 | } |
@@ -2360,7 +2360,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
2360 | PCI_DMA_FROMDEVICE); | 2360 | PCI_DMA_FROMDEVICE); |
2361 | } else { | 2361 | } else { |
2362 | pci_unmap_single(np->pci_dev, np->rx_dma[entry], | 2362 | pci_unmap_single(np->pci_dev, np->rx_dma[entry], |
2363 | buflen, PCI_DMA_FROMDEVICE); | 2363 | buflen + NATSEMI_PADDING, |
2364 | PCI_DMA_FROMDEVICE); | ||
2364 | skb_put(skb = np->rx_skbuff[entry], pkt_len); | 2365 | skb_put(skb = np->rx_skbuff[entry], pkt_len); |
2365 | np->rx_skbuff[entry] = NULL; | 2366 | np->rx_skbuff[entry] = NULL; |
2366 | } | 2367 | } |
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 31e9407a0739..1dbdf82a6dfd 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg) | |||
305 | 305 | ||
306 | if (state) { | 306 | if (state) { |
307 | zlib_inflateEnd(&state->strm); | 307 | zlib_inflateEnd(&state->strm); |
308 | kfree(state->strm.workspace); | 308 | vfree(state->strm.workspace); |
309 | kfree(state); | 309 | kfree(state); |
310 | } | 310 | } |
311 | } | 311 | } |
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) | |||
345 | 345 | ||
346 | state->w_size = w_size; | 346 | state->w_size = w_size; |
347 | state->strm.next_out = NULL; | 347 | state->strm.next_out = NULL; |
348 | state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), | 348 | state->strm.workspace = vmalloc(zlib_inflate_workspacesize()); |
349 | GFP_KERNEL|__GFP_REPEAT); | ||
350 | if (state->strm.workspace == NULL) | 349 | if (state->strm.workspace == NULL) |
351 | goto out_free; | 350 | goto out_free; |
352 | 351 | ||
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 718879b35b7d..bc9a4bb31980 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -348,8 +348,9 @@ static int pppoe_device_event(struct notifier_block *this, | |||
348 | 348 | ||
349 | /* Only look at sockets that are using this specific device. */ | 349 | /* Only look at sockets that are using this specific device. */ |
350 | switch (event) { | 350 | switch (event) { |
351 | case NETDEV_CHANGEADDR: | ||
351 | case NETDEV_CHANGEMTU: | 352 | case NETDEV_CHANGEMTU: |
352 | /* A change in mtu is a bad thing, requiring | 353 | /* A change in mtu or address is a bad thing, requiring |
353 | * LCP re-negotiation. | 354 | * LCP re-negotiation. |
354 | */ | 355 | */ |
355 | 356 | ||
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index d32850715f5c..ca306fd5f588 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | #define DRV_NAME "qlge" | 17 | #define DRV_NAME "qlge" |
18 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " | 18 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " |
19 | #define DRV_VERSION "v1.00.00.27.00.00-01" | 19 | #define DRV_VERSION "v1.00.00.29.00.00-01" |
20 | 20 | ||
21 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ | 21 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ |
22 | 22 | ||
@@ -1996,6 +1996,7 @@ enum { | |||
1996 | QL_LB_LINK_UP = 10, | 1996 | QL_LB_LINK_UP = 10, |
1997 | QL_FRC_COREDUMP = 11, | 1997 | QL_FRC_COREDUMP = 11, |
1998 | QL_EEH_FATAL = 12, | 1998 | QL_EEH_FATAL = 12, |
1999 | QL_ASIC_RECOVERY = 14, /* We are in ascic recovery. */ | ||
1999 | }; | 2000 | }; |
2000 | 2001 | ||
2001 | /* link_status bit definitions */ | 2002 | /* link_status bit definitions */ |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 930ae45457bb..6b4ff970972b 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -2152,6 +2152,10 @@ void ql_queue_asic_error(struct ql_adapter *qdev) | |||
2152 | * thread | 2152 | * thread |
2153 | */ | 2153 | */ |
2154 | clear_bit(QL_ADAPTER_UP, &qdev->flags); | 2154 | clear_bit(QL_ADAPTER_UP, &qdev->flags); |
2155 | /* Set asic recovery bit to indicate reset process that we are | ||
2156 | * in fatal error recovery process rather than normal close | ||
2157 | */ | ||
2158 | set_bit(QL_ASIC_RECOVERY, &qdev->flags); | ||
2155 | queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0); | 2159 | queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0); |
2156 | } | 2160 | } |
2157 | 2161 | ||
@@ -2166,23 +2170,20 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev, | |||
2166 | return; | 2170 | return; |
2167 | 2171 | ||
2168 | case CAM_LOOKUP_ERR_EVENT: | 2172 | case CAM_LOOKUP_ERR_EVENT: |
2169 | netif_err(qdev, link, qdev->ndev, | 2173 | netdev_err(qdev->ndev, "Multiple CAM hits lookup occurred.\n"); |
2170 | "Multiple CAM hits lookup occurred.\n"); | 2174 | netdev_err(qdev->ndev, "This event shouldn't occur.\n"); |
2171 | netif_err(qdev, drv, qdev->ndev, | ||
2172 | "This event shouldn't occur.\n"); | ||
2173 | ql_queue_asic_error(qdev); | 2175 | ql_queue_asic_error(qdev); |
2174 | return; | 2176 | return; |
2175 | 2177 | ||
2176 | case SOFT_ECC_ERROR_EVENT: | 2178 | case SOFT_ECC_ERROR_EVENT: |
2177 | netif_err(qdev, rx_err, qdev->ndev, | 2179 | netdev_err(qdev->ndev, "Soft ECC error detected.\n"); |
2178 | "Soft ECC error detected.\n"); | ||
2179 | ql_queue_asic_error(qdev); | 2180 | ql_queue_asic_error(qdev); |
2180 | break; | 2181 | break; |
2181 | 2182 | ||
2182 | case PCI_ERR_ANON_BUF_RD: | 2183 | case PCI_ERR_ANON_BUF_RD: |
2183 | netif_err(qdev, rx_err, qdev->ndev, | 2184 | netdev_err(qdev->ndev, "PCI error occurred when reading " |
2184 | "PCI error occurred when reading anonymous buffers from rx_ring %d.\n", | 2185 | "anonymous buffers from rx_ring %d.\n", |
2185 | ib_ae_rsp->q_id); | 2186 | ib_ae_rsp->q_id); |
2186 | ql_queue_asic_error(qdev); | 2187 | ql_queue_asic_error(qdev); |
2187 | break; | 2188 | break; |
2188 | 2189 | ||
@@ -2437,11 +2438,10 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
2437 | */ | 2438 | */ |
2438 | if (var & STS_FE) { | 2439 | if (var & STS_FE) { |
2439 | ql_queue_asic_error(qdev); | 2440 | ql_queue_asic_error(qdev); |
2440 | netif_err(qdev, intr, qdev->ndev, | 2441 | netdev_err(qdev->ndev, "Got fatal error, STS = %x.\n", var); |
2441 | "Got fatal error, STS = %x.\n", var); | ||
2442 | var = ql_read32(qdev, ERR_STS); | 2442 | var = ql_read32(qdev, ERR_STS); |
2443 | netif_err(qdev, intr, qdev->ndev, | 2443 | netdev_err(qdev->ndev, "Resetting chip. " |
2444 | "Resetting chip. Error Status Register = 0x%x\n", var); | 2444 | "Error Status Register = 0x%x\n", var); |
2445 | return IRQ_HANDLED; | 2445 | return IRQ_HANDLED; |
2446 | } | 2446 | } |
2447 | 2447 | ||
@@ -3818,11 +3818,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev) | |||
3818 | end_jiffies = jiffies + | 3818 | end_jiffies = jiffies + |
3819 | max((unsigned long)1, usecs_to_jiffies(30)); | 3819 | max((unsigned long)1, usecs_to_jiffies(30)); |
3820 | 3820 | ||
3821 | /* Stop management traffic. */ | 3821 | /* Check if bit is set then skip the mailbox command and |
3822 | ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); | 3822 | * clear the bit, else we are in normal reset process. |
3823 | */ | ||
3824 | if (!test_bit(QL_ASIC_RECOVERY, &qdev->flags)) { | ||
3825 | /* Stop management traffic. */ | ||
3826 | ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); | ||
3823 | 3827 | ||
3824 | /* Wait for the NIC and MGMNT FIFOs to empty. */ | 3828 | /* Wait for the NIC and MGMNT FIFOs to empty. */ |
3825 | ql_wait_fifo_empty(qdev); | 3829 | ql_wait_fifo_empty(qdev); |
3830 | } else | ||
3831 | clear_bit(QL_ASIC_RECOVERY, &qdev->flags); | ||
3826 | 3832 | ||
3827 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); | 3833 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); |
3828 | 3834 | ||
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 200a363c3bf5..0ffec4608441 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) | |||
677 | if (status & RX_FIFO_FULL) | 677 | if (status & RX_FIFO_FULL) |
678 | dev->stats.rx_fifo_errors++; | 678 | dev->stats.rx_fifo_errors++; |
679 | 679 | ||
680 | /* Mask off RX interrupt */ | 680 | if (likely(napi_schedule_prep(&lp->napi))) { |
681 | misr &= ~RX_INTS; | 681 | /* Mask off RX interrupt */ |
682 | napi_schedule(&lp->napi); | 682 | misr &= ~RX_INTS; |
683 | __napi_schedule(&lp->napi); | ||
684 | } | ||
683 | } | 685 | } |
684 | 686 | ||
685 | /* TX interrupt request */ | 687 | /* TX interrupt request */ |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 05d81780d1fd..5990621fb5cd 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd) | |||
742 | msleep(2); | 742 | msleep(2); |
743 | for (i = 0; i < 5; i++) { | 743 | for (i = 0; i < 5; i++) { |
744 | udelay(100); | 744 | udelay(100); |
745 | if (!(RTL_R32(ERIDR) & ERIAR_FLAG)) | 745 | if (!(RTL_R32(ERIAR) & ERIAR_FLAG)) |
746 | break; | 746 | break; |
747 | } | 747 | } |
748 | 748 | ||
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 77c5092a6a40..5d3436d47edd 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
@@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev) | |||
378 | 378 | ||
379 | static void rionet_remove(struct rio_dev *rdev) | 379 | static void rionet_remove(struct rio_dev *rdev) |
380 | { | 380 | { |
381 | struct net_device *ndev = NULL; | 381 | struct net_device *ndev = rio_get_drvdata(rdev); |
382 | struct rionet_peer *peer, *tmp; | 382 | struct rionet_peer *peer, *tmp; |
383 | 383 | ||
384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? |
@@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = { | |||
433 | .ndo_set_mac_address = eth_mac_addr, | 433 | .ndo_set_mac_address = eth_mac_addr, |
434 | }; | 434 | }; |
435 | 435 | ||
436 | static int rionet_setup_netdev(struct rio_mport *mport) | 436 | static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev) |
437 | { | 437 | { |
438 | int rc = 0; | 438 | int rc = 0; |
439 | struct net_device *ndev = NULL; | ||
440 | struct rionet_private *rnet; | 439 | struct rionet_private *rnet; |
441 | u16 device_id; | 440 | u16 device_id; |
442 | 441 | ||
443 | /* Allocate our net_device structure */ | ||
444 | ndev = alloc_etherdev(sizeof(struct rionet_private)); | ||
445 | if (ndev == NULL) { | ||
446 | printk(KERN_INFO "%s: could not allocate ethernet device.\n", | ||
447 | DRV_NAME); | ||
448 | rc = -ENOMEM; | ||
449 | goto out; | ||
450 | } | ||
451 | |||
452 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, | 442 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, |
453 | mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); | 443 | mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); |
454 | if (!rionet_active) { | 444 | if (!rionet_active) { |
@@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
504 | int rc = -ENODEV; | 494 | int rc = -ENODEV; |
505 | u32 lpef, lsrc_ops, ldst_ops; | 495 | u32 lpef, lsrc_ops, ldst_ops; |
506 | struct rionet_peer *peer; | 496 | struct rionet_peer *peer; |
497 | struct net_device *ndev = NULL; | ||
507 | 498 | ||
508 | /* If local device is not rionet capable, give up quickly */ | 499 | /* If local device is not rionet capable, give up quickly */ |
509 | if (!rionet_capable) | 500 | if (!rionet_capable) |
510 | goto out; | 501 | goto out; |
511 | 502 | ||
503 | /* Allocate our net_device structure */ | ||
504 | ndev = alloc_etherdev(sizeof(struct rionet_private)); | ||
505 | if (ndev == NULL) { | ||
506 | printk(KERN_INFO "%s: could not allocate ethernet device.\n", | ||
507 | DRV_NAME); | ||
508 | rc = -ENOMEM; | ||
509 | goto out; | ||
510 | } | ||
511 | |||
512 | /* | 512 | /* |
513 | * First time through, make sure local device is rionet | 513 | * First time through, make sure local device is rionet |
514 | * capable, setup netdev, and set flags so this is skipped | 514 | * capable, setup netdev, and set flags so this is skipped |
@@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
529 | goto out; | 529 | goto out; |
530 | } | 530 | } |
531 | 531 | ||
532 | rc = rionet_setup_netdev(rdev->net->hport); | 532 | rc = rionet_setup_netdev(rdev->net->hport, ndev); |
533 | rionet_check = 1; | 533 | rionet_check = 1; |
534 | } | 534 | } |
535 | 535 | ||
@@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id) | |||
546 | list_add_tail(&peer->node, &rionet_peers); | 546 | list_add_tail(&peer->node, &rionet_peers); |
547 | } | 547 | } |
548 | 548 | ||
549 | rio_set_drvdata(rdev, ndev); | ||
550 | |||
549 | out: | 551 | out: |
550 | return rc; | 552 | return rc; |
551 | } | 553 | } |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 8a72a979ee71..1f3f7b4dd638 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -140,6 +140,8 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
140 | .tpauser = 1, | 140 | .tpauser = 1, |
141 | .hw_swap = 1, | 141 | .hw_swap = 1, |
142 | .no_ade = 1, | 142 | .no_ade = 1, |
143 | .rpadir = 1, | ||
144 | .rpadir_value = 2 << 16, | ||
143 | }; | 145 | }; |
144 | 146 | ||
145 | #define SH_GIGA_ETH_BASE 0xfee00000 | 147 | #define SH_GIGA_ETH_BASE 0xfee00000 |
@@ -1184,8 +1186,8 @@ static void sh_eth_adjust_link(struct net_device *ndev) | |||
1184 | mdp->cd->set_rate(ndev); | 1186 | mdp->cd->set_rate(ndev); |
1185 | } | 1187 | } |
1186 | if (mdp->link == PHY_DOWN) { | 1188 | if (mdp->link == PHY_DOWN) { |
1187 | sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_TXF) | 1189 | sh_eth_write(ndev, |
1188 | | ECMR_DM, ECMR); | 1190 | (sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR); |
1189 | new_state = 1; | 1191 | new_state = 1; |
1190 | mdp->link = phydev->link; | 1192 | mdp->link = phydev->link; |
1191 | } | 1193 | } |
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 8ec1a9a0bb9a..2f110fb30daa 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -182,11 +182,11 @@ static int sl_alloc_bufs(struct slip *sl, int mtu) | |||
182 | #ifdef SL_INCLUDE_CSLIP | 182 | #ifdef SL_INCLUDE_CSLIP |
183 | cbuff = xchg(&sl->cbuff, cbuff); | 183 | cbuff = xchg(&sl->cbuff, cbuff); |
184 | slcomp = xchg(&sl->slcomp, slcomp); | 184 | slcomp = xchg(&sl->slcomp, slcomp); |
185 | #endif | ||
185 | #ifdef CONFIG_SLIP_MODE_SLIP6 | 186 | #ifdef CONFIG_SLIP_MODE_SLIP6 |
186 | sl->xdata = 0; | 187 | sl->xdata = 0; |
187 | sl->xbits = 0; | 188 | sl->xbits = 0; |
188 | #endif | 189 | #endif |
189 | #endif | ||
190 | spin_unlock_bh(&sl->lock); | 190 | spin_unlock_bh(&sl->lock); |
191 | err = 0; | 191 | err = 0; |
192 | 192 | ||
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 468512731966..9a21ca3873fc 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -879,7 +879,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db) | |||
879 | txptr = db->tx_remove_ptr; | 879 | txptr = db->tx_remove_ptr; |
880 | while(db->tx_packet_cnt) { | 880 | while(db->tx_packet_cnt) { |
881 | tdes0 = le32_to_cpu(txptr->tdes0); | 881 | tdes0 = le32_to_cpu(txptr->tdes0); |
882 | pr_debug("tdes0=%x\n", tdes0); | ||
883 | if (tdes0 & 0x80000000) | 882 | if (tdes0 & 0x80000000) |
884 | break; | 883 | break; |
885 | 884 | ||
@@ -889,7 +888,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db) | |||
889 | 888 | ||
890 | /* Transmit statistic counter */ | 889 | /* Transmit statistic counter */ |
891 | if ( tdes0 != 0x7fffffff ) { | 890 | if ( tdes0 != 0x7fffffff ) { |
892 | pr_debug("tdes0=%x\n", tdes0); | ||
893 | dev->stats.collisions += (tdes0 >> 3) & 0xf; | 891 | dev->stats.collisions += (tdes0 >> 3) & 0xf; |
894 | dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff; | 892 | dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff; |
895 | if (tdes0 & TDES0_ERR_MASK) { | 893 | if (tdes0 & TDES0_ERR_MASK) { |
@@ -986,7 +984,6 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) | |||
986 | /* error summary bit check */ | 984 | /* error summary bit check */ |
987 | if (rdes0 & 0x8000) { | 985 | if (rdes0 & 0x8000) { |
988 | /* This is a error packet */ | 986 | /* This is a error packet */ |
989 | pr_debug("rdes0: %x\n", rdes0); | ||
990 | dev->stats.rx_errors++; | 987 | dev->stats.rx_errors++; |
991 | if (rdes0 & 1) | 988 | if (rdes0 & 1) |
992 | dev->stats.rx_fifo_errors++; | 989 | dev->stats.rx_fifo_errors++; |
@@ -1638,7 +1635,6 @@ static u8 dmfe_sense_speed(struct dmfe_board_info * db) | |||
1638 | else /* DM9102/DM9102A */ | 1635 | else /* DM9102/DM9102A */ |
1639 | phy_mode = phy_read(db->ioaddr, | 1636 | phy_mode = phy_read(db->ioaddr, |
1640 | db->phy_addr, 17, db->chip_id) & 0xf000; | 1637 | db->phy_addr, 17, db->chip_id) & 0xf000; |
1641 | pr_debug("Phy_mode %x\n", phy_mode); | ||
1642 | switch (phy_mode) { | 1638 | switch (phy_mode) { |
1643 | case 0x1000: db->op_mode = DMFE_10MHF; break; | 1639 | case 0x1000: db->op_mode = DMFE_10MHF; break; |
1644 | case 0x2000: db->op_mode = DMFE_10MFD; break; | 1640 | case 0x2000: db->op_mode = DMFE_10MFD; break; |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 387ca43f26f4..304fe78ff60e 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -2421,10 +2421,8 @@ static void hso_free_net_device(struct hso_device *hso_dev) | |||
2421 | 2421 | ||
2422 | remove_net_device(hso_net->parent); | 2422 | remove_net_device(hso_net->parent); |
2423 | 2423 | ||
2424 | if (hso_net->net) { | 2424 | if (hso_net->net) |
2425 | unregister_netdev(hso_net->net); | 2425 | unregister_netdev(hso_net->net); |
2426 | free_netdev(hso_net->net); | ||
2427 | } | ||
2428 | 2426 | ||
2429 | /* start freeing */ | 2427 | /* start freeing */ |
2430 | for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { | 2428 | for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { |
@@ -2436,6 +2434,9 @@ static void hso_free_net_device(struct hso_device *hso_dev) | |||
2436 | kfree(hso_net->mux_bulk_tx_buf); | 2434 | kfree(hso_net->mux_bulk_tx_buf); |
2437 | hso_net->mux_bulk_tx_buf = NULL; | 2435 | hso_net->mux_bulk_tx_buf = NULL; |
2438 | 2436 | ||
2437 | if (hso_net->net) | ||
2438 | free_netdev(hso_net->net); | ||
2439 | |||
2439 | kfree(hso_dev); | 2440 | kfree(hso_dev); |
2440 | } | 2441 | } |
2441 | 2442 | ||
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c index d965fb1e013e..a9b6c63d54e4 100644 --- a/drivers/net/usb/kalmia.c +++ b/drivers/net/usb/kalmia.c | |||
@@ -100,34 +100,42 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len, | |||
100 | static int | 100 | static int |
101 | kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr) | 101 | kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr) |
102 | { | 102 | { |
103 | char init_msg_1[] = | 103 | const static char init_msg_1[] = |
104 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, | 104 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, |
105 | 0x00, 0x00 }; | 105 | 0x00, 0x00 }; |
106 | char init_msg_2[] = | 106 | const static char init_msg_2[] = |
107 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, | 107 | { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, |
108 | 0x00, 0x00 }; | 108 | 0x00, 0x00 }; |
109 | char receive_buf[28]; | 109 | const static int buflen = 28; |
110 | char *usb_buf; | ||
110 | int status; | 111 | int status; |
111 | 112 | ||
112 | status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1) | 113 | usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL); |
113 | / sizeof(init_msg_1[0]), receive_buf, 24); | 114 | if (!usb_buf) |
115 | return -ENOMEM; | ||
116 | |||
117 | memcpy(usb_buf, init_msg_1, 12); | ||
118 | status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1) | ||
119 | / sizeof(init_msg_1[0]), usb_buf, 24); | ||
114 | if (status != 0) | 120 | if (status != 0) |
115 | return status; | 121 | return status; |
116 | 122 | ||
117 | status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2) | 123 | memcpy(usb_buf, init_msg_2, 12); |
118 | / sizeof(init_msg_2[0]), receive_buf, 28); | 124 | status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2) |
125 | / sizeof(init_msg_2[0]), usb_buf, 28); | ||
119 | if (status != 0) | 126 | if (status != 0) |
120 | return status; | 127 | return status; |
121 | 128 | ||
122 | memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN); | 129 | memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN); |
123 | 130 | ||
131 | kfree(usb_buf); | ||
124 | return status; | 132 | return status; |
125 | } | 133 | } |
126 | 134 | ||
127 | static int | 135 | static int |
128 | kalmia_bind(struct usbnet *dev, struct usb_interface *intf) | 136 | kalmia_bind(struct usbnet *dev, struct usb_interface *intf) |
129 | { | 137 | { |
130 | u8 status; | 138 | int status; |
131 | u8 ethernet_addr[ETH_ALEN]; | 139 | u8 ethernet_addr[ETH_ALEN]; |
132 | 140 | ||
133 | /* Don't bind to AT command interface */ | 141 | /* Don't bind to AT command interface */ |
@@ -190,7 +198,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
190 | dev_kfree_skb_any(skb); | 198 | dev_kfree_skb_any(skb); |
191 | skb = skb2; | 199 | skb = skb2; |
192 | 200 | ||
193 | done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH); | 201 | done: |
202 | header_start = skb_push(skb, KALMIA_HEADER_LENGTH); | ||
194 | ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12]; | 203 | ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12]; |
195 | ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13]; | 204 | ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13]; |
196 | 205 | ||
@@ -201,9 +210,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
201 | header_start[0] = 0x57; | 210 | header_start[0] = 0x57; |
202 | header_start[1] = 0x44; | 211 | header_start[1] = 0x44; |
203 | content_len = skb->len - KALMIA_HEADER_LENGTH; | 212 | content_len = skb->len - KALMIA_HEADER_LENGTH; |
204 | header_start[2] = (content_len & 0xff); /* low byte */ | ||
205 | header_start[3] = (content_len >> 8); /* high byte */ | ||
206 | 213 | ||
214 | put_unaligned_le16(content_len, &header_start[2]); | ||
207 | header_start[4] = ether_type_1; | 215 | header_start[4] = ether_type_1; |
208 | header_start[5] = ether_type_2; | 216 | header_start[5] = ether_type_2; |
209 | 217 | ||
@@ -231,13 +239,13 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
231 | * Our task here is to strip off framing, leaving skb with one | 239 | * Our task here is to strip off framing, leaving skb with one |
232 | * data frame for the usbnet framework code to process. | 240 | * data frame for the usbnet framework code to process. |
233 | */ | 241 | */ |
234 | const u8 HEADER_END_OF_USB_PACKET[] = | 242 | const static u8 HEADER_END_OF_USB_PACKET[] = |
235 | { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 }; | 243 | { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 }; |
236 | const u8 EXPECTED_UNKNOWN_HEADER_1[] = | 244 | const static u8 EXPECTED_UNKNOWN_HEADER_1[] = |
237 | { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 }; | 245 | { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 }; |
238 | const u8 EXPECTED_UNKNOWN_HEADER_2[] = | 246 | const static u8 EXPECTED_UNKNOWN_HEADER_2[] = |
239 | { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 }; | 247 | { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 }; |
240 | u8 i = 0; | 248 | int i = 0; |
241 | 249 | ||
242 | /* incomplete header? */ | 250 | /* incomplete header? */ |
243 | if (skb->len < KALMIA_HEADER_LENGTH) | 251 | if (skb->len < KALMIA_HEADER_LENGTH) |
@@ -285,7 +293,7 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
285 | 293 | ||
286 | /* subtract start header and end header */ | 294 | /* subtract start header and end header */ |
287 | usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH); | 295 | usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH); |
288 | ether_packet_length = header_start[2] + (header_start[3] << 8); | 296 | ether_packet_length = get_unaligned_le16(&header_start[2]); |
289 | skb_pull(skb, KALMIA_HEADER_LENGTH); | 297 | skb_pull(skb, KALMIA_HEADER_LENGTH); |
290 | 298 | ||
291 | /* Some small packets misses end marker */ | 299 | /* Some small packets misses end marker */ |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index 241756e0e86f..1a2234c20514 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -331,17 +331,7 @@ static const struct usb_device_id products [] = { | |||
331 | ZAURUS_MASTER_INTERFACE, | 331 | ZAURUS_MASTER_INTERFACE, |
332 | .driver_info = ZAURUS_PXA_INFO, | 332 | .driver_info = ZAURUS_PXA_INFO, |
333 | }, | 333 | }, |
334 | |||
335 | |||
336 | /* At least some of the newest PXA units have very different lies about | ||
337 | * their standards support: they claim to be cell phones offering | ||
338 | * direct access to their radios! (No, they don't conform to CDC MDLM.) | ||
339 | */ | ||
340 | { | 334 | { |
341 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, | ||
342 | USB_CDC_PROTO_NONE), | ||
343 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
344 | }, { | ||
345 | /* Motorola MOTOMAGX phones */ | 335 | /* Motorola MOTOMAGX phones */ |
346 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, | 336 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, |
347 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 337 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index fa6e2ac7475a..67402350d0df 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -575,7 +575,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
575 | struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx]; | 575 | struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx]; |
576 | u32 val; | 576 | u32 val; |
577 | 577 | ||
578 | while (num_allocated < num_to_alloc) { | 578 | while (num_allocated <= num_to_alloc) { |
579 | struct vmxnet3_rx_buf_info *rbi; | 579 | struct vmxnet3_rx_buf_info *rbi; |
580 | union Vmxnet3_GenericDesc *gd; | 580 | union Vmxnet3_GenericDesc *gd; |
581 | 581 | ||
@@ -621,9 +621,15 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
621 | 621 | ||
622 | BUG_ON(rbi->dma_addr == 0); | 622 | BUG_ON(rbi->dma_addr == 0); |
623 | gd->rxd.addr = cpu_to_le64(rbi->dma_addr); | 623 | gd->rxd.addr = cpu_to_le64(rbi->dma_addr); |
624 | gd->dword[2] = cpu_to_le32((ring->gen << VMXNET3_RXD_GEN_SHIFT) | 624 | gd->dword[2] = cpu_to_le32((!ring->gen << VMXNET3_RXD_GEN_SHIFT) |
625 | | val | rbi->len); | 625 | | val | rbi->len); |
626 | 626 | ||
627 | /* Fill the last buffer but dont mark it ready, or else the | ||
628 | * device will think that the queue is full */ | ||
629 | if (num_allocated == num_to_alloc) | ||
630 | break; | ||
631 | |||
632 | gd->dword[2] |= cpu_to_le32(ring->gen << VMXNET3_RXD_GEN_SHIFT); | ||
627 | num_allocated++; | 633 | num_allocated++; |
628 | vmxnet3_cmd_ring_adv_next2fill(ring); | 634 | vmxnet3_cmd_ring_adv_next2fill(ring); |
629 | } | 635 | } |
@@ -1140,6 +1146,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1140 | VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2 | 1146 | VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2 |
1141 | }; | 1147 | }; |
1142 | u32 num_rxd = 0; | 1148 | u32 num_rxd = 0; |
1149 | bool skip_page_frags = false; | ||
1143 | struct Vmxnet3_RxCompDesc *rcd; | 1150 | struct Vmxnet3_RxCompDesc *rcd; |
1144 | struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; | 1151 | struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; |
1145 | #ifdef __BIG_ENDIAN_BITFIELD | 1152 | #ifdef __BIG_ENDIAN_BITFIELD |
@@ -1150,11 +1157,12 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1150 | &rxComp); | 1157 | &rxComp); |
1151 | while (rcd->gen == rq->comp_ring.gen) { | 1158 | while (rcd->gen == rq->comp_ring.gen) { |
1152 | struct vmxnet3_rx_buf_info *rbi; | 1159 | struct vmxnet3_rx_buf_info *rbi; |
1153 | struct sk_buff *skb; | 1160 | struct sk_buff *skb, *new_skb = NULL; |
1161 | struct page *new_page = NULL; | ||
1154 | int num_to_alloc; | 1162 | int num_to_alloc; |
1155 | struct Vmxnet3_RxDesc *rxd; | 1163 | struct Vmxnet3_RxDesc *rxd; |
1156 | u32 idx, ring_idx; | 1164 | u32 idx, ring_idx; |
1157 | 1165 | struct vmxnet3_cmd_ring *ring = NULL; | |
1158 | if (num_rxd >= quota) { | 1166 | if (num_rxd >= quota) { |
1159 | /* we may stop even before we see the EOP desc of | 1167 | /* we may stop even before we see the EOP desc of |
1160 | * the current pkt | 1168 | * the current pkt |
@@ -1165,6 +1173,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1165 | BUG_ON(rcd->rqID != rq->qid && rcd->rqID != rq->qid2); | 1173 | BUG_ON(rcd->rqID != rq->qid && rcd->rqID != rq->qid2); |
1166 | idx = rcd->rxdIdx; | 1174 | idx = rcd->rxdIdx; |
1167 | ring_idx = rcd->rqID < adapter->num_rx_queues ? 0 : 1; | 1175 | ring_idx = rcd->rqID < adapter->num_rx_queues ? 0 : 1; |
1176 | ring = rq->rx_ring + ring_idx; | ||
1168 | vmxnet3_getRxDesc(rxd, &rq->rx_ring[ring_idx].base[idx].rxd, | 1177 | vmxnet3_getRxDesc(rxd, &rq->rx_ring[ring_idx].base[idx].rxd, |
1169 | &rxCmdDesc); | 1178 | &rxCmdDesc); |
1170 | rbi = rq->buf_info[ring_idx] + idx; | 1179 | rbi = rq->buf_info[ring_idx] + idx; |
@@ -1193,37 +1202,80 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1193 | goto rcd_done; | 1202 | goto rcd_done; |
1194 | } | 1203 | } |
1195 | 1204 | ||
1205 | skip_page_frags = false; | ||
1196 | ctx->skb = rbi->skb; | 1206 | ctx->skb = rbi->skb; |
1197 | rbi->skb = NULL; | 1207 | new_skb = dev_alloc_skb(rbi->len + NET_IP_ALIGN); |
1208 | if (new_skb == NULL) { | ||
1209 | /* Skb allocation failed, do not handover this | ||
1210 | * skb to stack. Reuse it. Drop the existing pkt | ||
1211 | */ | ||
1212 | rq->stats.rx_buf_alloc_failure++; | ||
1213 | ctx->skb = NULL; | ||
1214 | rq->stats.drop_total++; | ||
1215 | skip_page_frags = true; | ||
1216 | goto rcd_done; | ||
1217 | } | ||
1198 | 1218 | ||
1199 | pci_unmap_single(adapter->pdev, rbi->dma_addr, rbi->len, | 1219 | pci_unmap_single(adapter->pdev, rbi->dma_addr, rbi->len, |
1200 | PCI_DMA_FROMDEVICE); | 1220 | PCI_DMA_FROMDEVICE); |
1201 | 1221 | ||
1202 | skb_put(ctx->skb, rcd->len); | 1222 | skb_put(ctx->skb, rcd->len); |
1223 | |||
1224 | /* Immediate refill */ | ||
1225 | new_skb->dev = adapter->netdev; | ||
1226 | skb_reserve(new_skb, NET_IP_ALIGN); | ||
1227 | rbi->skb = new_skb; | ||
1228 | rbi->dma_addr = pci_map_single(adapter->pdev, | ||
1229 | rbi->skb->data, rbi->len, | ||
1230 | PCI_DMA_FROMDEVICE); | ||
1231 | rxd->addr = cpu_to_le64(rbi->dma_addr); | ||
1232 | rxd->len = rbi->len; | ||
1233 | |||
1203 | } else { | 1234 | } else { |
1204 | BUG_ON(ctx->skb == NULL); | 1235 | BUG_ON(ctx->skb == NULL && !skip_page_frags); |
1236 | |||
1205 | /* non SOP buffer must be type 1 in most cases */ | 1237 | /* non SOP buffer must be type 1 in most cases */ |
1206 | if (rbi->buf_type == VMXNET3_RX_BUF_PAGE) { | 1238 | BUG_ON(rbi->buf_type != VMXNET3_RX_BUF_PAGE); |
1207 | BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY); | 1239 | BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY); |
1208 | 1240 | ||
1209 | if (rcd->len) { | 1241 | /* If an sop buffer was dropped, skip all |
1210 | pci_unmap_page(adapter->pdev, | 1242 | * following non-sop fragments. They will be reused. |
1211 | rbi->dma_addr, rbi->len, | 1243 | */ |
1212 | PCI_DMA_FROMDEVICE); | 1244 | if (skip_page_frags) |
1245 | goto rcd_done; | ||
1213 | 1246 | ||
1214 | vmxnet3_append_frag(ctx->skb, rcd, rbi); | 1247 | new_page = alloc_page(GFP_ATOMIC); |
1215 | rbi->page = NULL; | 1248 | if (unlikely(new_page == NULL)) { |
1216 | } | 1249 | /* Replacement page frag could not be allocated. |
1217 | } else { | 1250 | * Reuse this page. Drop the pkt and free the |
1218 | /* | 1251 | * skb which contained this page as a frag. Skip |
1219 | * The only time a non-SOP buffer is type 0 is | 1252 | * processing all the following non-sop frags. |
1220 | * when it's EOP and error flag is raised, which | ||
1221 | * has already been handled. | ||
1222 | */ | 1253 | */ |
1223 | BUG_ON(true); | 1254 | rq->stats.rx_buf_alloc_failure++; |
1255 | dev_kfree_skb(ctx->skb); | ||
1256 | ctx->skb = NULL; | ||
1257 | skip_page_frags = true; | ||
1258 | goto rcd_done; | ||
1259 | } | ||
1260 | |||
1261 | if (rcd->len) { | ||
1262 | pci_unmap_page(adapter->pdev, | ||
1263 | rbi->dma_addr, rbi->len, | ||
1264 | PCI_DMA_FROMDEVICE); | ||
1265 | |||
1266 | vmxnet3_append_frag(ctx->skb, rcd, rbi); | ||
1224 | } | 1267 | } |
1268 | |||
1269 | /* Immediate refill */ | ||
1270 | rbi->page = new_page; | ||
1271 | rbi->dma_addr = pci_map_page(adapter->pdev, rbi->page, | ||
1272 | 0, PAGE_SIZE, | ||
1273 | PCI_DMA_FROMDEVICE); | ||
1274 | rxd->addr = cpu_to_le64(rbi->dma_addr); | ||
1275 | rxd->len = rbi->len; | ||
1225 | } | 1276 | } |
1226 | 1277 | ||
1278 | |||
1227 | skb = ctx->skb; | 1279 | skb = ctx->skb; |
1228 | if (rcd->eop) { | 1280 | if (rcd->eop) { |
1229 | skb->len += skb->data_len; | 1281 | skb->len += skb->data_len; |
@@ -1244,26 +1296,27 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1244 | } | 1296 | } |
1245 | 1297 | ||
1246 | rcd_done: | 1298 | rcd_done: |
1247 | /* device may skip some rx descs */ | 1299 | /* device may have skipped some rx descs */ |
1248 | rq->rx_ring[ring_idx].next2comp = idx; | 1300 | ring->next2comp = idx; |
1249 | VMXNET3_INC_RING_IDX_ONLY(rq->rx_ring[ring_idx].next2comp, | 1301 | num_to_alloc = vmxnet3_cmd_ring_desc_avail(ring); |
1250 | rq->rx_ring[ring_idx].size); | 1302 | ring = rq->rx_ring + ring_idx; |
1251 | 1303 | while (num_to_alloc) { | |
1252 | /* refill rx buffers frequently to avoid starving the h/w */ | 1304 | vmxnet3_getRxDesc(rxd, &ring->base[ring->next2fill].rxd, |
1253 | num_to_alloc = vmxnet3_cmd_ring_desc_avail(rq->rx_ring + | 1305 | &rxCmdDesc); |
1254 | ring_idx); | 1306 | BUG_ON(!rxd->addr); |
1255 | if (unlikely(num_to_alloc > VMXNET3_RX_ALLOC_THRESHOLD(rq, | 1307 | |
1256 | ring_idx, adapter))) { | 1308 | /* Recv desc is ready to be used by the device */ |
1257 | vmxnet3_rq_alloc_rx_buf(rq, ring_idx, num_to_alloc, | 1309 | rxd->gen = ring->gen; |
1258 | adapter); | 1310 | vmxnet3_cmd_ring_adv_next2fill(ring); |
1259 | 1311 | num_to_alloc--; | |
1260 | /* if needed, update the register */ | 1312 | } |
1261 | if (unlikely(rq->shared->updateRxProd)) { | 1313 | |
1262 | VMXNET3_WRITE_BAR0_REG(adapter, | 1314 | /* if needed, update the register */ |
1263 | rxprod_reg[ring_idx] + rq->qid * 8, | 1315 | if (unlikely(rq->shared->updateRxProd)) { |
1264 | rq->rx_ring[ring_idx].next2fill); | 1316 | VMXNET3_WRITE_BAR0_REG(adapter, |
1265 | rq->uncommitted[ring_idx] = 0; | 1317 | rxprod_reg[ring_idx] + rq->qid * 8, |
1266 | } | 1318 | ring->next2fill); |
1319 | rq->uncommitted[ring_idx] = 0; | ||
1267 | } | 1320 | } |
1268 | 1321 | ||
1269 | vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring); | 1322 | vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring); |
@@ -2894,6 +2947,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
2894 | else | 2947 | else |
2895 | #endif | 2948 | #endif |
2896 | num_rx_queues = 1; | 2949 | num_rx_queues = 1; |
2950 | num_rx_queues = rounddown_pow_of_two(num_rx_queues); | ||
2897 | 2951 | ||
2898 | if (enable_mq) | 2952 | if (enable_mq) |
2899 | num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES, | 2953 | num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES, |
@@ -2901,6 +2955,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, | |||
2901 | else | 2955 | else |
2902 | num_tx_queues = 1; | 2956 | num_tx_queues = 1; |
2903 | 2957 | ||
2958 | num_tx_queues = rounddown_pow_of_two(num_tx_queues); | ||
2904 | netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter), | 2959 | netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter), |
2905 | max(num_tx_queues, num_rx_queues)); | 2960 | max(num_tx_queues, num_rx_queues)); |
2906 | printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n", | 2961 | printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n", |
@@ -3085,6 +3140,7 @@ vmxnet3_remove_device(struct pci_dev *pdev) | |||
3085 | else | 3140 | else |
3086 | #endif | 3141 | #endif |
3087 | num_rx_queues = 1; | 3142 | num_rx_queues = 1; |
3143 | num_rx_queues = rounddown_pow_of_two(num_rx_queues); | ||
3088 | 3144 | ||
3089 | cancel_work_sync(&adapter->work); | 3145 | cancel_work_sync(&adapter->work); |
3090 | 3146 | ||
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index f50d36fdf405..e08d75e3f170 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h +++ b/drivers/net/vmxnet3/vmxnet3_int.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/if_vlan.h> | 55 | #include <linux/if_vlan.h> |
56 | #include <linux/if_arp.h> | 56 | #include <linux/if_arp.h> |
57 | #include <linux/inetdevice.h> | 57 | #include <linux/inetdevice.h> |
58 | #include <linux/log2.h> | ||
58 | 59 | ||
59 | #include "vmxnet3_defs.h" | 60 | #include "vmxnet3_defs.h" |
60 | 61 | ||
@@ -68,10 +69,10 @@ | |||
68 | /* | 69 | /* |
69 | * Version numbers | 70 | * Version numbers |
70 | */ | 71 | */ |
71 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.9.0-k" | 72 | #define VMXNET3_DRIVER_VERSION_STRING "1.1.18.0-k" |
72 | 73 | ||
73 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ | 74 | /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ |
74 | #define VMXNET3_DRIVER_VERSION_NUM 0x01010900 | 75 | #define VMXNET3_DRIVER_VERSION_NUM 0x01011200 |
75 | 76 | ||
76 | #if defined(CONFIG_PCI_MSI) | 77 | #if defined(CONFIG_PCI_MSI) |
77 | /* RSS only makes sense if MSI-X is supported. */ | 78 | /* RSS only makes sense if MSI-X is supported. */ |
diff --git a/drivers/net/wireless/ath/ath5k/desc.c b/drivers/net/wireless/ath/ath5k/desc.c index 62172d585723..f82383b3ed30 100644 --- a/drivers/net/wireless/ath/ath5k/desc.c +++ b/drivers/net/wireless/ath/ath5k/desc.c | |||
@@ -107,10 +107,13 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
107 | case AR5K_PKT_TYPE_BEACON: | 107 | case AR5K_PKT_TYPE_BEACON: |
108 | case AR5K_PKT_TYPE_PROBE_RESP: | 108 | case AR5K_PKT_TYPE_PROBE_RESP: |
109 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_NO_DELAY; | 109 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_NO_DELAY; |
110 | break; | ||
110 | case AR5K_PKT_TYPE_PIFS: | 111 | case AR5K_PKT_TYPE_PIFS: |
111 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_PIFS; | 112 | frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_PIFS; |
113 | break; | ||
112 | default: | 114 | default: |
113 | frame_type = type; | 115 | frame_type = type; |
116 | break; | ||
114 | } | 117 | } |
115 | 118 | ||
116 | tx_ctl->tx_control_0 |= | 119 | tx_ctl->tx_control_0 |= |
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 1fef84f87c78..392771f93759 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c | |||
@@ -691,14 +691,12 @@ ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode) | |||
691 | if (!chinfo[pier].pd_curves) | 691 | if (!chinfo[pier].pd_curves) |
692 | continue; | 692 | continue; |
693 | 693 | ||
694 | for (pdg = 0; pdg < ee->ee_pd_gains[mode]; pdg++) { | 694 | for (pdg = 0; pdg < AR5K_EEPROM_N_PD_CURVES; pdg++) { |
695 | struct ath5k_pdgain_info *pd = | 695 | struct ath5k_pdgain_info *pd = |
696 | &chinfo[pier].pd_curves[pdg]; | 696 | &chinfo[pier].pd_curves[pdg]; |
697 | 697 | ||
698 | if (pd != NULL) { | 698 | kfree(pd->pd_step); |
699 | kfree(pd->pd_step); | 699 | kfree(pd->pd_pwr); |
700 | kfree(pd->pd_pwr); | ||
701 | } | ||
702 | } | 700 | } |
703 | 701 | ||
704 | kfree(chinfo[pier].pd_curves); | 702 | kfree(chinfo[pier].pd_curves); |
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c index 296c316a8341..f2c0c236392f 100644 --- a/drivers/net/wireless/ath/ath5k/pci.c +++ b/drivers/net/wireless/ath/ath5k/pci.c | |||
@@ -297,7 +297,9 @@ ath5k_pci_remove(struct pci_dev *pdev) | |||
297 | #ifdef CONFIG_PM_SLEEP | 297 | #ifdef CONFIG_PM_SLEEP |
298 | static int ath5k_pci_suspend(struct device *dev) | 298 | static int ath5k_pci_suspend(struct device *dev) |
299 | { | 299 | { |
300 | struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev)); | 300 | struct pci_dev *pdev = to_pci_dev(dev); |
301 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | ||
302 | struct ath5k_softc *sc = hw->priv; | ||
301 | 303 | ||
302 | ath5k_led_off(sc); | 304 | ath5k_led_off(sc); |
303 | return 0; | 305 | return 0; |
@@ -306,7 +308,8 @@ static int ath5k_pci_suspend(struct device *dev) | |||
306 | static int ath5k_pci_resume(struct device *dev) | 308 | static int ath5k_pci_resume(struct device *dev) |
307 | { | 309 | { |
308 | struct pci_dev *pdev = to_pci_dev(dev); | 310 | struct pci_dev *pdev = to_pci_dev(dev); |
309 | struct ath5k_softc *sc = pci_get_drvdata(pdev); | 311 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
312 | struct ath5k_softc *sc = hw->priv; | ||
310 | 313 | ||
311 | /* | 314 | /* |
312 | * Suspend/Resume resets the PCI configuration space, so we have to | 315 | * Suspend/Resume resets the PCI configuration space, so we have to |
diff --git a/drivers/net/wireless/ath/ath5k/sysfs.c b/drivers/net/wireless/ath/ath5k/sysfs.c index 929c68cdf8ab..a073cdce1f15 100644 --- a/drivers/net/wireless/ath/ath5k/sysfs.c +++ b/drivers/net/wireless/ath/ath5k/sysfs.c | |||
@@ -10,7 +10,8 @@ static ssize_t ath5k_attr_show_##name(struct device *dev, \ | |||
10 | struct device_attribute *attr, \ | 10 | struct device_attribute *attr, \ |
11 | char *buf) \ | 11 | char *buf) \ |
12 | { \ | 12 | { \ |
13 | struct ath5k_softc *sc = dev_get_drvdata(dev); \ | 13 | struct ieee80211_hw *hw = dev_get_drvdata(dev); \ |
14 | struct ath5k_softc *sc = hw->priv; \ | ||
14 | return snprintf(buf, PAGE_SIZE, "%d\n", get); \ | 15 | return snprintf(buf, PAGE_SIZE, "%d\n", get); \ |
15 | } \ | 16 | } \ |
16 | \ | 17 | \ |
@@ -18,7 +19,8 @@ static ssize_t ath5k_attr_store_##name(struct device *dev, \ | |||
18 | struct device_attribute *attr, \ | 19 | struct device_attribute *attr, \ |
19 | const char *buf, size_t count) \ | 20 | const char *buf, size_t count) \ |
20 | { \ | 21 | { \ |
21 | struct ath5k_softc *sc = dev_get_drvdata(dev); \ | 22 | struct ieee80211_hw *hw = dev_get_drvdata(dev); \ |
23 | struct ath5k_softc *sc = hw->priv; \ | ||
22 | int val; \ | 24 | int val; \ |
23 | \ | 25 | \ |
24 | val = (int)simple_strtoul(buf, NULL, 10); \ | 26 | val = (int)simple_strtoul(buf, NULL, 10); \ |
@@ -33,7 +35,8 @@ static ssize_t ath5k_attr_show_##name(struct device *dev, \ | |||
33 | struct device_attribute *attr, \ | 35 | struct device_attribute *attr, \ |
34 | char *buf) \ | 36 | char *buf) \ |
35 | { \ | 37 | { \ |
36 | struct ath5k_softc *sc = dev_get_drvdata(dev); \ | 38 | struct ieee80211_hw *hw = dev_get_drvdata(dev); \ |
39 | struct ath5k_softc *sc = hw->priv; \ | ||
37 | return snprintf(buf, PAGE_SIZE, "%d\n", get); \ | 40 | return snprintf(buf, PAGE_SIZE, "%d\n", get); \ |
38 | } \ | 41 | } \ |
39 | static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL) | 42 | static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL) |
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index b8cbfc707213..3bad0b2cf9a3 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -278,6 +278,12 @@ static int ath_pci_suspend(struct device *device) | |||
278 | 278 | ||
279 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); | 279 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); |
280 | 280 | ||
281 | /* The device has to be moved to FULLSLEEP forcibly. | ||
282 | * Otherwise the chip never moved to full sleep, | ||
283 | * when no interface is up. | ||
284 | */ | ||
285 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); | ||
286 | |||
281 | return 0; | 287 | return 0; |
282 | } | 288 | } |
283 | 289 | ||
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 3779b8977d47..33443bcaa8d9 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -671,7 +671,8 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
671 | * TODO - this could be improved to be dependent on the rate. | 671 | * TODO - this could be improved to be dependent on the rate. |
672 | * The hardware can keep up at lower rates, but not higher rates | 672 | * The hardware can keep up at lower rates, but not higher rates |
673 | */ | 673 | */ |
674 | if (fi->keyix != ATH9K_TXKEYIX_INVALID) | 674 | if ((fi->keyix != ATH9K_TXKEYIX_INVALID) && |
675 | !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) | ||
675 | ndelim += ATH_AGGR_ENCRYPTDELIM; | 676 | ndelim += ATH_AGGR_ENCRYPTDELIM; |
676 | 677 | ||
677 | /* | 678 | /* |
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index 2fb53d067512..333b69ef2ae2 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c | |||
@@ -112,6 +112,8 @@ static struct usb_device_id carl9170_usb_ids[] = { | |||
112 | { USB_DEVICE(0x04bb, 0x093f) }, | 112 | { USB_DEVICE(0x04bb, 0x093f) }, |
113 | /* NEC WL300NU-G */ | 113 | /* NEC WL300NU-G */ |
114 | { USB_DEVICE(0x0409, 0x0249) }, | 114 | { USB_DEVICE(0x0409, 0x0249) }, |
115 | /* NEC WL300NU-AG */ | ||
116 | { USB_DEVICE(0x0409, 0x02b4) }, | ||
115 | /* AVM FRITZ!WLAN USB Stick N */ | 117 | /* AVM FRITZ!WLAN USB Stick N */ |
116 | { USB_DEVICE(0x057c, 0x8401) }, | 118 | { USB_DEVICE(0x057c, 0x8401) }, |
117 | /* AVM FRITZ!WLAN USB Stick N 2.4 */ | 119 | /* AVM FRITZ!WLAN USB Stick N 2.4 */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 61d4a11f566b..2a88e73bb39c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -55,10 +56,10 @@ | |||
55 | #define IWL100_UCODE_API_MIN 5 | 56 | #define IWL100_UCODE_API_MIN 5 |
56 | 57 | ||
57 | #define IWL1000_FW_PRE "iwlwifi-1000-" | 58 | #define IWL1000_FW_PRE "iwlwifi-1000-" |
58 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode" | 59 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode" |
59 | 60 | ||
60 | #define IWL100_FW_PRE "iwlwifi-100-" | 61 | #define IWL100_FW_PRE "iwlwifi-100-" |
61 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE #api ".ucode" | 62 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | 64 | ||
64 | /* | 65 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 2282279cffc4..3df76f53a41b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -58,13 +59,13 @@ | |||
58 | #define IWL105_UCODE_API_MIN 5 | 59 | #define IWL105_UCODE_API_MIN 5 |
59 | 60 | ||
60 | #define IWL2030_FW_PRE "iwlwifi-2030-" | 61 | #define IWL2030_FW_PRE "iwlwifi-2030-" |
61 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE #api ".ucode" | 62 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | #define IWL2000_FW_PRE "iwlwifi-2000-" | 64 | #define IWL2000_FW_PRE "iwlwifi-2000-" |
64 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE #api ".ucode" | 65 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode" |
65 | 66 | ||
66 | #define IWL105_FW_PRE "iwlwifi-105-" | 67 | #define IWL105_FW_PRE "iwlwifi-105-" |
67 | #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE #api ".ucode" | 68 | #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode" |
68 | 69 | ||
69 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) | 70 | static void iwl2000_set_ct_threshold(struct iwl_priv *priv) |
70 | { | 71 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index f99f9c193352..e816c27db794 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <net/mac80211.h> | 37 | #include <net/mac80211.h> |
38 | #include <linux/etherdevice.h> | 38 | #include <linux/etherdevice.h> |
39 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
40 | #include <linux/stringify.h> | ||
40 | 41 | ||
41 | #include "iwl-eeprom.h" | 42 | #include "iwl-eeprom.h" |
42 | #include "iwl-dev.h" | 43 | #include "iwl-dev.h" |
@@ -57,10 +58,10 @@ | |||
57 | #define IWL5150_UCODE_API_MIN 1 | 58 | #define IWL5150_UCODE_API_MIN 1 |
58 | 59 | ||
59 | #define IWL5000_FW_PRE "iwlwifi-5000-" | 60 | #define IWL5000_FW_PRE "iwlwifi-5000-" |
60 | #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" | 61 | #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode" |
61 | 62 | ||
62 | #define IWL5150_FW_PRE "iwlwifi-5150-" | 63 | #define IWL5150_FW_PRE "iwlwifi-5150-" |
63 | #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" | 64 | #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode" |
64 | 65 | ||
65 | /* NIC configuration for 5000 series */ | 66 | /* NIC configuration for 5000 series */ |
66 | static void iwl5000_nic_config(struct iwl_priv *priv) | 67 | static void iwl5000_nic_config(struct iwl_priv *priv) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index fbe565c816e3..5b150bc70b06 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <net/mac80211.h> | 36 | #include <net/mac80211.h> |
37 | #include <linux/etherdevice.h> | 37 | #include <linux/etherdevice.h> |
38 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
39 | #include <linux/stringify.h> | ||
39 | 40 | ||
40 | #include "iwl-eeprom.h" | 41 | #include "iwl-eeprom.h" |
41 | #include "iwl-dev.h" | 42 | #include "iwl-dev.h" |
@@ -58,16 +59,16 @@ | |||
58 | #define IWL6000G2_UCODE_API_MIN 4 | 59 | #define IWL6000G2_UCODE_API_MIN 4 |
59 | 60 | ||
60 | #define IWL6000_FW_PRE "iwlwifi-6000-" | 61 | #define IWL6000_FW_PRE "iwlwifi-6000-" |
61 | #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" | 62 | #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode" |
62 | 63 | ||
63 | #define IWL6050_FW_PRE "iwlwifi-6050-" | 64 | #define IWL6050_FW_PRE "iwlwifi-6050-" |
64 | #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" | 65 | #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode" |
65 | 66 | ||
66 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" | 67 | #define IWL6005_FW_PRE "iwlwifi-6000g2a-" |
67 | #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode" | 68 | #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode" |
68 | 69 | ||
69 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" | 70 | #define IWL6030_FW_PRE "iwlwifi-6000g2b-" |
70 | #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode" | 71 | #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode" |
71 | 72 | ||
72 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) | 73 | static void iwl6000_set_ct_threshold(struct iwl_priv *priv) |
73 | { | 74 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 213c80c6a668..45cc51c9c93e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1763,6 +1763,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1763 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 1763 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); |
1764 | struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | 1764 | struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; |
1765 | struct iwl_rxon_context *tmp; | 1765 | struct iwl_rxon_context *tmp; |
1766 | enum nl80211_iftype newviftype = newtype; | ||
1766 | u32 interface_modes; | 1767 | u32 interface_modes; |
1767 | int err; | 1768 | int err; |
1768 | 1769 | ||
@@ -1818,7 +1819,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1818 | 1819 | ||
1819 | /* success */ | 1820 | /* success */ |
1820 | iwl_teardown_interface(priv, vif, true); | 1821 | iwl_teardown_interface(priv, vif, true); |
1821 | vif->type = newtype; | 1822 | vif->type = newviftype; |
1822 | vif->p2p = newp2p; | 1823 | vif->p2p = newp2p; |
1823 | err = iwl_setup_interface(priv, ctx); | 1824 | err = iwl_setup_interface(priv, ctx); |
1824 | WARN_ON(err); | 1825 | WARN_ON(err); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 686e176b5ebd..137dba95b1ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -126,7 +126,7 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, | 128 | static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, |
129 | struct iwl_tfd *tfd) | 129 | struct iwl_tfd *tfd, int dma_dir) |
130 | { | 130 | { |
131 | struct pci_dev *dev = priv->pci_dev; | 131 | struct pci_dev *dev = priv->pci_dev; |
132 | int i; | 132 | int i; |
@@ -151,7 +151,7 @@ static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, | |||
151 | /* Unmap chunks, if any. */ | 151 | /* Unmap chunks, if any. */ |
152 | for (i = 1; i < num_tbs; i++) | 152 | for (i = 1; i < num_tbs; i++) |
153 | pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i), | 153 | pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i), |
154 | iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE); | 154 | iwl_tfd_tb_get_len(tfd, i), dma_dir); |
155 | } | 155 | } |
156 | 156 | ||
157 | /** | 157 | /** |
@@ -167,7 +167,8 @@ void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq) | |||
167 | struct iwl_tfd *tfd_tmp = txq->tfds; | 167 | struct iwl_tfd *tfd_tmp = txq->tfds; |
168 | int index = txq->q.read_ptr; | 168 | int index = txq->q.read_ptr; |
169 | 169 | ||
170 | iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index]); | 170 | iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index], |
171 | PCI_DMA_TODEVICE); | ||
171 | 172 | ||
172 | /* free SKB */ | 173 | /* free SKB */ |
173 | if (txq->txb) { | 174 | if (txq->txb) { |
@@ -310,9 +311,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv) | |||
310 | i = get_cmd_index(q, q->read_ptr); | 311 | i = get_cmd_index(q, q->read_ptr); |
311 | 312 | ||
312 | if (txq->meta[i].flags & CMD_MAPPED) { | 313 | if (txq->meta[i].flags & CMD_MAPPED) { |
313 | pci_unmap_single(priv->pci_dev, | 314 | iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i], |
314 | dma_unmap_addr(&txq->meta[i], mapping), | ||
315 | dma_unmap_len(&txq->meta[i], len), | ||
316 | PCI_DMA_BIDIRECTIONAL); | 315 | PCI_DMA_BIDIRECTIONAL); |
317 | txq->meta[i].flags = 0; | 316 | txq->meta[i].flags = 0; |
318 | } | 317 | } |
@@ -535,12 +534,7 @@ out_free_arrays: | |||
535 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, | 534 | void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq, |
536 | int slots_num, u32 txq_id) | 535 | int slots_num, u32 txq_id) |
537 | { | 536 | { |
538 | int actual_slots = slots_num; | 537 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * slots_num); |
539 | |||
540 | if (txq_id == priv->cmd_queue) | ||
541 | actual_slots++; | ||
542 | |||
543 | memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots); | ||
544 | 538 | ||
545 | txq->need_update = 0; | 539 | txq->need_update = 0; |
546 | 540 | ||
@@ -700,10 +694,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
700 | if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) | 694 | if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) |
701 | continue; | 695 | continue; |
702 | phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i], | 696 | phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i], |
703 | cmd->len[i], PCI_DMA_TODEVICE); | 697 | cmd->len[i], PCI_DMA_BIDIRECTIONAL); |
704 | if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) { | 698 | if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) { |
705 | iwlagn_unmap_tfd(priv, out_meta, | 699 | iwlagn_unmap_tfd(priv, out_meta, |
706 | &txq->tfds[q->write_ptr]); | 700 | &txq->tfds[q->write_ptr], |
701 | PCI_DMA_BIDIRECTIONAL); | ||
707 | idx = -ENOMEM; | 702 | idx = -ENOMEM; |
708 | goto out; | 703 | goto out; |
709 | } | 704 | } |
@@ -807,7 +802,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
807 | cmd = txq->cmd[cmd_index]; | 802 | cmd = txq->cmd[cmd_index]; |
808 | meta = &txq->meta[cmd_index]; | 803 | meta = &txq->meta[cmd_index]; |
809 | 804 | ||
810 | iwlagn_unmap_tfd(priv, meta, &txq->tfds[index]); | 805 | iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], PCI_DMA_BIDIRECTIONAL); |
811 | 806 | ||
812 | /* Input error checking is done when commands are added to queue. */ | 807 | /* Input error checking is done when commands are added to queue. */ |
813 | if (meta->flags & CMD_WANT_SKB) { | 808 | if (meta->flags & CMD_WANT_SKB) { |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 9f8ccae93317..254b64ba4bf6 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1624,6 +1624,16 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1624 | pci_read_config_byte(pdev, 0x8, &revisionid); | 1624 | pci_read_config_byte(pdev, 0x8, &revisionid); |
1625 | pci_read_config_word(pdev, 0x3C, &irqline); | 1625 | pci_read_config_word(pdev, 0x3C, &irqline); |
1626 | 1626 | ||
1627 | /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses | ||
1628 | * r8192e_pci, and RTL8192SE, which uses this driver. If the | ||
1629 | * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then | ||
1630 | * the correct driver is r8192e_pci, thus this routine should | ||
1631 | * return false. | ||
1632 | */ | ||
1633 | if (deviceid == RTL_PCI_8192SE_DID && | ||
1634 | revisionid == RTL_PCI_REVISION_ID_8192PCIE) | ||
1635 | return false; | ||
1636 | |||
1627 | if (deviceid == RTL_PCI_8192_DID || | 1637 | if (deviceid == RTL_PCI_8192_DID || |
1628 | deviceid == RTL_PCI_0044_DID || | 1638 | deviceid == RTL_PCI_0044_DID || |
1629 | deviceid == RTL_PCI_0047_DID || | 1639 | deviceid == RTL_PCI_0047_DID || |
@@ -1856,7 +1866,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1856 | pci_write_config_byte(pdev, 0x04, 0x07); | 1866 | pci_write_config_byte(pdev, 0x04, 0x07); |
1857 | 1867 | ||
1858 | /* find adapter */ | 1868 | /* find adapter */ |
1859 | _rtl_pci_find_adapter(pdev, hw); | 1869 | if (!_rtl_pci_find_adapter(pdev, hw)) |
1870 | goto fail3; | ||
1860 | 1871 | ||
1861 | /* Init IO handler */ | 1872 | /* Init IO handler */ |
1862 | _rtl_pci_io_handler_init(&pdev->dev, hw); | 1873 | _rtl_pci_io_handler_init(&pdev->dev, hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index bee7c1480f63..942f7a3969a7 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); | |||
53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | 53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
54 | { | 54 | { |
55 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 55 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
56 | const struct firmware *firmware; | ||
57 | int err; | ||
56 | 58 | ||
57 | rtlpriv->dm.dm_initialgain_enable = 1; | 59 | rtlpriv->dm.dm_initialgain_enable = 1; |
58 | rtlpriv->dm.dm_flag = 0; | 60 | rtlpriv->dm.dm_flag = 0; |
@@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | |||
64 | ("Can't alloc buffer for fw.\n")); | 66 | ("Can't alloc buffer for fw.\n")); |
65 | return 1; | 67 | return 1; |
66 | } | 68 | } |
69 | /* request fw */ | ||
70 | err = request_firmware(&firmware, rtlpriv->cfg->fw_name, | ||
71 | rtlpriv->io.dev); | ||
72 | if (err) { | ||
73 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
74 | ("Failed to request firmware!\n")); | ||
75 | return 1; | ||
76 | } | ||
77 | if (firmware->size > 0x4000) { | ||
78 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
79 | ("Firmware is too big!\n")); | ||
80 | release_firmware(firmware); | ||
81 | return 1; | ||
82 | } | ||
83 | memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); | ||
84 | rtlpriv->rtlhal.fwsize = firmware->size; | ||
85 | release_firmware(firmware); | ||
86 | |||
67 | return 0; | 87 | return 0; |
68 | } | 88 | } |
69 | 89 | ||
@@ -278,6 +298,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { | |||
278 | {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ | 298 | {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ |
279 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ | 299 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ |
280 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ | 300 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ |
301 | {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ | ||
281 | {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ | 302 | {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ |
282 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ | 303 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ |
283 | /* HP - Lite-On ,8188CUS Slim Combo */ | 304 | /* HP - Lite-On ,8188CUS Slim Combo */ |