diff options
Diffstat (limited to 'drivers/net')
67 files changed, 888 insertions, 716 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index fe7b5ec09708..3a0b20afec7b 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2635,7 +2635,7 @@ config NIU | |||
2635 | 2635 | ||
2636 | config PASEMI_MAC | 2636 | config PASEMI_MAC |
2637 | tristate "PA Semi 1/10Gbit MAC" | 2637 | tristate "PA Semi 1/10Gbit MAC" |
2638 | depends on PPC64 && PCI | 2638 | depends on PPC_PASEMI && PCI |
2639 | select PHYLIB | 2639 | select PHYLIB |
2640 | select INET_LRO | 2640 | select INET_LRO |
2641 | help | 2641 | help |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index ea2a2b548e3c..25f1337cd02c 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -2082,6 +2082,11 @@ static int __devinit b44_get_invariants(struct b44 *bp) | |||
2082 | addr = sdev->bus->sprom.et0mac; | 2082 | addr = sdev->bus->sprom.et0mac; |
2083 | bp->phy_addr = sdev->bus->sprom.et0phyaddr; | 2083 | bp->phy_addr = sdev->bus->sprom.et0phyaddr; |
2084 | } | 2084 | } |
2085 | /* Some ROMs have buggy PHY addresses with the high | ||
2086 | * bits set (sign extension?). Truncate them to a | ||
2087 | * valid PHY address. */ | ||
2088 | bp->phy_addr &= 0x1F; | ||
2089 | |||
2085 | memcpy(bp->dev->dev_addr, addr, 6); | 2090 | memcpy(bp->dev->dev_addr, addr, 6); |
2086 | 2091 | ||
2087 | if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ | 2092 | if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index c993a32b3f50..26b2dd5016cd 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -575,7 +575,6 @@ adjust_head: | |||
575 | static int bf537mac_hard_start_xmit(struct sk_buff *skb, | 575 | static int bf537mac_hard_start_xmit(struct sk_buff *skb, |
576 | struct net_device *dev) | 576 | struct net_device *dev) |
577 | { | 577 | { |
578 | struct bf537mac_local *lp = netdev_priv(dev); | ||
579 | unsigned int data; | 578 | unsigned int data; |
580 | 579 | ||
581 | current_tx_ptr->skb = skb; | 580 | current_tx_ptr->skb = skb; |
@@ -634,7 +633,6 @@ out: | |||
634 | static void bf537mac_rx(struct net_device *dev) | 633 | static void bf537mac_rx(struct net_device *dev) |
635 | { | 634 | { |
636 | struct sk_buff *skb, *new_skb; | 635 | struct sk_buff *skb, *new_skb; |
637 | struct bf537mac_local *lp = netdev_priv(dev); | ||
638 | unsigned short len; | 636 | unsigned short len; |
639 | 637 | ||
640 | /* allocate a new skb for next time receive */ | 638 | /* allocate a new skb for next time receive */ |
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c index de32b3fba322..7bdb5af35951 100644 --- a/drivers/net/bnx2x.c +++ b/drivers/net/bnx2x.c | |||
@@ -63,8 +63,8 @@ | |||
63 | #include "bnx2x.h" | 63 | #include "bnx2x.h" |
64 | #include "bnx2x_init.h" | 64 | #include "bnx2x_init.h" |
65 | 65 | ||
66 | #define DRV_MODULE_VERSION "1.42.3" | 66 | #define DRV_MODULE_VERSION "1.42.4" |
67 | #define DRV_MODULE_RELDATE "2008/3/9" | 67 | #define DRV_MODULE_RELDATE "2008/4/9" |
68 | #define BNX2X_BC_VER 0x040200 | 68 | #define BNX2X_BC_VER 0x040200 |
69 | 69 | ||
70 | /* Time in jiffies before concluding the transmitter is hung. */ | 70 | /* Time in jiffies before concluding the transmitter is hung. */ |
@@ -6153,7 +6153,7 @@ static int bnx2x_function_init(struct bnx2x *bp, int mode) | |||
6153 | func, mode); | 6153 | func, mode); |
6154 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, | 6154 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, |
6155 | 0xffffffff); | 6155 | 0xffffffff); |
6156 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, | 6156 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, |
6157 | 0xfffc); | 6157 | 0xfffc); |
6158 | bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END); | 6158 | bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END); |
6159 | 6159 | ||
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index cb3c6faa7888..d16e0e1d2b30 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -310,7 +310,7 @@ static inline int __check_agg_selection_timer(struct port *port) | |||
310 | */ | 310 | */ |
311 | static inline void __get_rx_machine_lock(struct port *port) | 311 | static inline void __get_rx_machine_lock(struct port *port) |
312 | { | 312 | { |
313 | spin_lock(&(SLAVE_AD_INFO(port->slave).rx_machine_lock)); | 313 | spin_lock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock)); |
314 | } | 314 | } |
315 | 315 | ||
316 | /** | 316 | /** |
@@ -320,7 +320,7 @@ static inline void __get_rx_machine_lock(struct port *port) | |||
320 | */ | 320 | */ |
321 | static inline void __release_rx_machine_lock(struct port *port) | 321 | static inline void __release_rx_machine_lock(struct port *port) |
322 | { | 322 | { |
323 | spin_unlock(&(SLAVE_AD_INFO(port->slave).rx_machine_lock)); | 323 | spin_unlock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock)); |
324 | } | 324 | } |
325 | 325 | ||
326 | /** | 326 | /** |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index b57bc9467dbe..3f58c3d0b710 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -678,12 +678,8 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
678 | } | 678 | } |
679 | 679 | ||
680 | if (!list_empty(&bond->vlan_list)) { | 680 | if (!list_empty(&bond->vlan_list)) { |
681 | unsigned short vlan_id; | 681 | if (!vlan_get_tag(skb, &client_info->vlan_id)) |
682 | int res = vlan_get_tag(skb, &vlan_id); | ||
683 | if (!res) { | ||
684 | client_info->tag = 1; | 682 | client_info->tag = 1; |
685 | client_info->vlan_id = vlan_id; | ||
686 | } | ||
687 | } | 683 | } |
688 | 684 | ||
689 | if (!client_info->assigned) { | 685 | if (!client_info->assigned) { |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 0942d82f7cbf..0f0675319e9c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -383,7 +383,7 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
383 | */ | 383 | */ |
384 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev) | 384 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev) |
385 | { | 385 | { |
386 | unsigned short vlan_id; | 386 | unsigned short uninitialized_var(vlan_id); |
387 | 387 | ||
388 | if (!list_empty(&bond->vlan_list) && | 388 | if (!list_empty(&bond->vlan_list) && |
389 | !(slave_dev->features & NETIF_F_HW_VLAN_TX) && | 389 | !(slave_dev->features & NETIF_F_HW_VLAN_TX) && |
@@ -4528,8 +4528,7 @@ static void bond_free_all(void) | |||
4528 | netif_tx_unlock_bh(bond_dev); | 4528 | netif_tx_unlock_bh(bond_dev); |
4529 | /* Release the bonded slaves */ | 4529 | /* Release the bonded slaves */ |
4530 | bond_release_all(bond_dev); | 4530 | bond_release_all(bond_dev); |
4531 | bond_deinit(bond_dev); | 4531 | bond_destroy(bond); |
4532 | unregister_netdevice(bond_dev); | ||
4533 | } | 4532 | } |
4534 | 4533 | ||
4535 | #ifdef CONFIG_PROC_FS | 4534 | #ifdef CONFIG_PROC_FS |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 90a1f31e8e63..979c2d05ff9c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -341,6 +341,7 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
341 | 341 | ||
342 | if (command[0] == '-') { | 342 | if (command[0] == '-') { |
343 | dev = NULL; | 343 | dev = NULL; |
344 | original_mtu = 0; | ||
344 | bond_for_each_slave(bond, slave, i) | 345 | bond_for_each_slave(bond, slave, i) |
345 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { | 346 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { |
346 | dev = slave->dev; | 347 | dev = slave->dev; |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 67ccad69d445..a3c74e20aa53 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #include "bond_3ad.h" | 22 | #include "bond_3ad.h" |
23 | #include "bond_alb.h" | 23 | #include "bond_alb.h" |
24 | 24 | ||
25 | #define DRV_VERSION "3.2.4" | 25 | #define DRV_VERSION "3.2.5" |
26 | #define DRV_RELDATE "January 28, 2008" | 26 | #define DRV_RELDATE "March 21, 2008" |
27 | #define DRV_NAME "bonding" | 27 | #define DRV_NAME "bonding" |
28 | #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" | 28 | #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" |
29 | 29 | ||
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index db586870c5f4..98a6bbd11d4c 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -557,9 +557,9 @@ static void t3_free_qset(struct adapter *adapter, struct sge_qset *q) | |||
557 | 557 | ||
558 | for (i = 0; i < SGE_RXQ_PER_SET; ++i) | 558 | for (i = 0; i < SGE_RXQ_PER_SET; ++i) |
559 | if (q->fl[i].desc) { | 559 | if (q->fl[i].desc) { |
560 | spin_lock(&adapter->sge.reg_lock); | 560 | spin_lock_irq(&adapter->sge.reg_lock); |
561 | t3_sge_disable_fl(adapter, q->fl[i].cntxt_id); | 561 | t3_sge_disable_fl(adapter, q->fl[i].cntxt_id); |
562 | spin_unlock(&adapter->sge.reg_lock); | 562 | spin_unlock_irq(&adapter->sge.reg_lock); |
563 | free_rx_bufs(pdev, &q->fl[i]); | 563 | free_rx_bufs(pdev, &q->fl[i]); |
564 | kfree(q->fl[i].sdesc); | 564 | kfree(q->fl[i].sdesc); |
565 | dma_free_coherent(&pdev->dev, | 565 | dma_free_coherent(&pdev->dev, |
@@ -570,9 +570,9 @@ static void t3_free_qset(struct adapter *adapter, struct sge_qset *q) | |||
570 | 570 | ||
571 | for (i = 0; i < SGE_TXQ_PER_SET; ++i) | 571 | for (i = 0; i < SGE_TXQ_PER_SET; ++i) |
572 | if (q->txq[i].desc) { | 572 | if (q->txq[i].desc) { |
573 | spin_lock(&adapter->sge.reg_lock); | 573 | spin_lock_irq(&adapter->sge.reg_lock); |
574 | t3_sge_enable_ecntxt(adapter, q->txq[i].cntxt_id, 0); | 574 | t3_sge_enable_ecntxt(adapter, q->txq[i].cntxt_id, 0); |
575 | spin_unlock(&adapter->sge.reg_lock); | 575 | spin_unlock_irq(&adapter->sge.reg_lock); |
576 | if (q->txq[i].sdesc) { | 576 | if (q->txq[i].sdesc) { |
577 | free_tx_desc(adapter, &q->txq[i], | 577 | free_tx_desc(adapter, &q->txq[i], |
578 | q->txq[i].in_use); | 578 | q->txq[i].in_use); |
@@ -586,9 +586,9 @@ static void t3_free_qset(struct adapter *adapter, struct sge_qset *q) | |||
586 | } | 586 | } |
587 | 587 | ||
588 | if (q->rspq.desc) { | 588 | if (q->rspq.desc) { |
589 | spin_lock(&adapter->sge.reg_lock); | 589 | spin_lock_irq(&adapter->sge.reg_lock); |
590 | t3_sge_disable_rspcntxt(adapter, q->rspq.cntxt_id); | 590 | t3_sge_disable_rspcntxt(adapter, q->rspq.cntxt_id); |
591 | spin_unlock(&adapter->sge.reg_lock); | 591 | spin_unlock_irq(&adapter->sge.reg_lock); |
592 | dma_free_coherent(&pdev->dev, | 592 | dma_free_coherent(&pdev->dev, |
593 | q->rspq.size * sizeof(struct rsp_desc), | 593 | q->rspq.size * sizeof(struct rsp_desc), |
594 | q->rspq.desc, q->rspq.phys_addr); | 594 | q->rspq.desc, q->rspq.phys_addr); |
@@ -2667,7 +2667,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | |||
2667 | (16 * 1024) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) : | 2667 | (16 * 1024) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) : |
2668 | MAX_FRAME_SIZE + 2 + sizeof(struct cpl_rx_pkt); | 2668 | MAX_FRAME_SIZE + 2 + sizeof(struct cpl_rx_pkt); |
2669 | 2669 | ||
2670 | spin_lock(&adapter->sge.reg_lock); | 2670 | spin_lock_irq(&adapter->sge.reg_lock); |
2671 | 2671 | ||
2672 | /* FL threshold comparison uses < */ | 2672 | /* FL threshold comparison uses < */ |
2673 | ret = t3_sge_init_rspcntxt(adapter, q->rspq.cntxt_id, irq_vec_idx, | 2673 | ret = t3_sge_init_rspcntxt(adapter, q->rspq.cntxt_id, irq_vec_idx, |
@@ -2711,7 +2711,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | |||
2711 | goto err_unlock; | 2711 | goto err_unlock; |
2712 | } | 2712 | } |
2713 | 2713 | ||
2714 | spin_unlock(&adapter->sge.reg_lock); | 2714 | spin_unlock_irq(&adapter->sge.reg_lock); |
2715 | 2715 | ||
2716 | q->adap = adapter; | 2716 | q->adap = adapter; |
2717 | q->netdev = dev; | 2717 | q->netdev = dev; |
@@ -2728,7 +2728,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | |||
2728 | return 0; | 2728 | return 0; |
2729 | 2729 | ||
2730 | err_unlock: | 2730 | err_unlock: |
2731 | spin_unlock(&adapter->sge.reg_lock); | 2731 | spin_unlock_irq(&adapter->sge.reg_lock); |
2732 | err: | 2732 | err: |
2733 | t3_free_qset(adapter, q); | 2733 | t3_free_qset(adapter, q); |
2734 | return ret; | 2734 | return ret; |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 1fe305ca2cf0..d63cc93f055d 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -798,8 +798,6 @@ dm9000_init_dm9000(struct net_device *dev) | |||
798 | /* Set address filter table */ | 798 | /* Set address filter table */ |
799 | dm9000_hash_table(dev); | 799 | dm9000_hash_table(dev); |
800 | 800 | ||
801 | /* Activate DM9000 */ | ||
802 | iow(db, DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN); | ||
803 | /* Enable TX/RX interrupt mask */ | 801 | /* Enable TX/RX interrupt mask */ |
804 | iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM); | 802 | iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM); |
805 | 803 | ||
@@ -970,7 +968,7 @@ dm9000_interrupt(int irq, void *dev_id) | |||
970 | struct dm9000_rxhdr { | 968 | struct dm9000_rxhdr { |
971 | u8 RxPktReady; | 969 | u8 RxPktReady; |
972 | u8 RxStatus; | 970 | u8 RxStatus; |
973 | u16 RxLen; | 971 | __le16 RxLen; |
974 | } __attribute__((__packed__)); | 972 | } __attribute__((__packed__)); |
975 | 973 | ||
976 | /* | 974 | /* |
@@ -1197,6 +1195,7 @@ dm9000_hash_table(struct net_device *dev) | |||
1197 | int i, oft; | 1195 | int i, oft; |
1198 | u32 hash_val; | 1196 | u32 hash_val; |
1199 | u16 hash_table[4]; | 1197 | u16 hash_table[4]; |
1198 | u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN; | ||
1200 | unsigned long flags; | 1199 | unsigned long flags; |
1201 | 1200 | ||
1202 | dm9000_dbg(db, 1, "entering %s\n", __func__); | 1201 | dm9000_dbg(db, 1, "entering %s\n", __func__); |
@@ -1213,6 +1212,12 @@ dm9000_hash_table(struct net_device *dev) | |||
1213 | /* broadcast address */ | 1212 | /* broadcast address */ |
1214 | hash_table[3] = 0x8000; | 1213 | hash_table[3] = 0x8000; |
1215 | 1214 | ||
1215 | if (dev->flags & IFF_PROMISC) | ||
1216 | rcr |= RCR_PRMSC; | ||
1217 | |||
1218 | if (dev->flags & IFF_ALLMULTI) | ||
1219 | rcr |= RCR_ALL; | ||
1220 | |||
1216 | /* the multicast address in Hash Table : 64 bits */ | 1221 | /* the multicast address in Hash Table : 64 bits */ |
1217 | for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) { | 1222 | for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) { |
1218 | hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f; | 1223 | hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f; |
@@ -1225,6 +1230,7 @@ dm9000_hash_table(struct net_device *dev) | |||
1225 | iow(db, oft++, hash_table[i] >> 8); | 1230 | iow(db, oft++, hash_table[i] >> 8); |
1226 | } | 1231 | } |
1227 | 1232 | ||
1233 | iow(db, DM9000_RCR, rcr); | ||
1228 | spin_unlock_irqrestore(&db->lock, flags); | 1234 | spin_unlock_irqrestore(&db->lock, flags); |
1229 | } | 1235 | } |
1230 | 1236 | ||
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index cdf3090a1885..2d139ec79777 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -960,7 +960,7 @@ static void e100_get_defaults(struct nic *nic) | |||
960 | 960 | ||
961 | /* Template for a freshly allocated RFD */ | 961 | /* Template for a freshly allocated RFD */ |
962 | nic->blank_rfd.command = 0; | 962 | nic->blank_rfd.command = 0; |
963 | nic->blank_rfd.rbd = 0xFFFFFFFF; | 963 | nic->blank_rfd.rbd = cpu_to_le32(0xFFFFFFFF); |
964 | nic->blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN); | 964 | nic->blank_rfd.size = cpu_to_le16(VLAN_ETH_FRAME_LEN); |
965 | 965 | ||
966 | /* MII setup */ | 966 | /* MII setup */ |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 7c4ead35cfa2..93b7fb246960 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0087" | 43 | #define DRV_VERSION "EHEA_0089" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 21af674b764e..07c742dd3f09 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -3108,7 +3108,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3108 | dev->vlan_rx_add_vid = ehea_vlan_rx_add_vid; | 3108 | dev->vlan_rx_add_vid = ehea_vlan_rx_add_vid; |
3109 | dev->vlan_rx_kill_vid = ehea_vlan_rx_kill_vid; | 3109 | dev->vlan_rx_kill_vid = ehea_vlan_rx_kill_vid; |
3110 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO | 3110 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO |
3111 | | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | NETIF_F_HW_VLAN_TX | 3111 | | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX |
3112 | | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER | 3112 | | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER |
3113 | | NETIF_F_LLTX; | 3113 | | NETIF_F_LLTX; |
3114 | dev->tx_timeout = &ehea_tx_watchdog; | 3114 | dev->tx_timeout = &ehea_tx_watchdog; |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index 58b71e60204e..fe59c27c09e3 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -1057,6 +1057,7 @@ static int mpc52xx_fec_of_resume(struct of_device *op) | |||
1057 | #endif | 1057 | #endif |
1058 | 1058 | ||
1059 | static struct of_device_id mpc52xx_fec_match[] = { | 1059 | static struct of_device_id mpc52xx_fec_match[] = { |
1060 | { .type = "network", .compatible = "fsl,mpc5200b-fec", }, | ||
1060 | { .type = "network", .compatible = "fsl,mpc5200-fec", }, | 1061 | { .type = "network", .compatible = "fsl,mpc5200-fec", }, |
1061 | { .type = "network", .compatible = "mpc5200-fec", }, | 1062 | { .type = "network", .compatible = "mpc5200-fec", }, |
1062 | { } | 1063 | { } |
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c index 6a3ac4ea97e9..1d0cd1dd955e 100644 --- a/drivers/net/fec_mpc52xx_phy.c +++ b/drivers/net/fec_mpc52xx_phy.c | |||
@@ -179,6 +179,7 @@ static int mpc52xx_fec_mdio_remove(struct of_device *of) | |||
179 | 179 | ||
180 | static struct of_device_id mpc52xx_fec_mdio_match[] = { | 180 | static struct of_device_id mpc52xx_fec_mdio_match[] = { |
181 | { .compatible = "fsl,mpc5200b-mdio", }, | 181 | { .compatible = "fsl,mpc5200b-mdio", }, |
182 | { .compatible = "fsl,mpc5200-mdio", }, | ||
182 | { .compatible = "mpc5200b-fec-phy", }, | 183 | { .compatible = "mpc5200b-fec-phy", }, |
183 | {} | 184 | {} |
184 | }; | 185 | }; |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 6f7e3fde9e7c..419f533006ab 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1854,6 +1854,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1854 | struct ring_desc* start_tx; | 1854 | struct ring_desc* start_tx; |
1855 | struct ring_desc* prev_tx; | 1855 | struct ring_desc* prev_tx; |
1856 | struct nv_skb_map* prev_tx_ctx; | 1856 | struct nv_skb_map* prev_tx_ctx; |
1857 | unsigned long flags; | ||
1857 | 1858 | ||
1858 | /* add fragments to entries count */ | 1859 | /* add fragments to entries count */ |
1859 | for (i = 0; i < fragments; i++) { | 1860 | for (i = 0; i < fragments; i++) { |
@@ -1863,10 +1864,10 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1863 | 1864 | ||
1864 | empty_slots = nv_get_empty_tx_slots(np); | 1865 | empty_slots = nv_get_empty_tx_slots(np); |
1865 | if (unlikely(empty_slots <= entries)) { | 1866 | if (unlikely(empty_slots <= entries)) { |
1866 | spin_lock_irq(&np->lock); | 1867 | spin_lock_irqsave(&np->lock, flags); |
1867 | netif_stop_queue(dev); | 1868 | netif_stop_queue(dev); |
1868 | np->tx_stop = 1; | 1869 | np->tx_stop = 1; |
1869 | spin_unlock_irq(&np->lock); | 1870 | spin_unlock_irqrestore(&np->lock, flags); |
1870 | return NETDEV_TX_BUSY; | 1871 | return NETDEV_TX_BUSY; |
1871 | } | 1872 | } |
1872 | 1873 | ||
@@ -1929,13 +1930,13 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1929 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? | 1930 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? |
1930 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; | 1931 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; |
1931 | 1932 | ||
1932 | spin_lock_irq(&np->lock); | 1933 | spin_lock_irqsave(&np->lock, flags); |
1933 | 1934 | ||
1934 | /* set tx flags */ | 1935 | /* set tx flags */ |
1935 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); | 1936 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); |
1936 | np->put_tx.orig = put_tx; | 1937 | np->put_tx.orig = put_tx; |
1937 | 1938 | ||
1938 | spin_unlock_irq(&np->lock); | 1939 | spin_unlock_irqrestore(&np->lock, flags); |
1939 | 1940 | ||
1940 | dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", | 1941 | dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", |
1941 | dev->name, entries, tx_flags_extra); | 1942 | dev->name, entries, tx_flags_extra); |
@@ -1971,6 +1972,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
1971 | struct ring_desc_ex* prev_tx; | 1972 | struct ring_desc_ex* prev_tx; |
1972 | struct nv_skb_map* prev_tx_ctx; | 1973 | struct nv_skb_map* prev_tx_ctx; |
1973 | struct nv_skb_map* start_tx_ctx; | 1974 | struct nv_skb_map* start_tx_ctx; |
1975 | unsigned long flags; | ||
1974 | 1976 | ||
1975 | /* add fragments to entries count */ | 1977 | /* add fragments to entries count */ |
1976 | for (i = 0; i < fragments; i++) { | 1978 | for (i = 0; i < fragments; i++) { |
@@ -1980,10 +1982,10 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
1980 | 1982 | ||
1981 | empty_slots = nv_get_empty_tx_slots(np); | 1983 | empty_slots = nv_get_empty_tx_slots(np); |
1982 | if (unlikely(empty_slots <= entries)) { | 1984 | if (unlikely(empty_slots <= entries)) { |
1983 | spin_lock_irq(&np->lock); | 1985 | spin_lock_irqsave(&np->lock, flags); |
1984 | netif_stop_queue(dev); | 1986 | netif_stop_queue(dev); |
1985 | np->tx_stop = 1; | 1987 | np->tx_stop = 1; |
1986 | spin_unlock_irq(&np->lock); | 1988 | spin_unlock_irqrestore(&np->lock, flags); |
1987 | return NETDEV_TX_BUSY; | 1989 | return NETDEV_TX_BUSY; |
1988 | } | 1990 | } |
1989 | 1991 | ||
@@ -2059,7 +2061,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2059 | start_tx->txvlan = 0; | 2061 | start_tx->txvlan = 0; |
2060 | } | 2062 | } |
2061 | 2063 | ||
2062 | spin_lock_irq(&np->lock); | 2064 | spin_lock_irqsave(&np->lock, flags); |
2063 | 2065 | ||
2064 | if (np->tx_limit) { | 2066 | if (np->tx_limit) { |
2065 | /* Limit the number of outstanding tx. Setup all fragments, but | 2067 | /* Limit the number of outstanding tx. Setup all fragments, but |
@@ -2085,7 +2087,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2085 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); | 2087 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); |
2086 | np->put_tx.ex = put_tx; | 2088 | np->put_tx.ex = put_tx; |
2087 | 2089 | ||
2088 | spin_unlock_irq(&np->lock); | 2090 | spin_unlock_irqrestore(&np->lock, flags); |
2089 | 2091 | ||
2090 | dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", | 2092 | dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", |
2091 | dev->name, entries, tx_flags_extra); | 2093 | dev->name, entries, tx_flags_extra); |
@@ -2110,9 +2112,8 @@ static inline void nv_tx_flip_ownership(struct net_device *dev) | |||
2110 | 2112 | ||
2111 | np->tx_pkts_in_progress--; | 2113 | np->tx_pkts_in_progress--; |
2112 | if (np->tx_change_owner) { | 2114 | if (np->tx_change_owner) { |
2113 | __le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen); | 2115 | np->tx_change_owner->first_tx_desc->flaglen |= |
2114 | flaglen |= NV_TX2_VALID; | 2116 | cpu_to_le32(NV_TX2_VALID); |
2115 | np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen); | ||
2116 | np->tx_pkts_in_progress++; | 2117 | np->tx_pkts_in_progress++; |
2117 | 2118 | ||
2118 | np->tx_change_owner = np->tx_change_owner->next_tx_ctx; | 2119 | np->tx_change_owner = np->tx_change_owner->next_tx_ctx; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 0789802d59ed..378a23963495 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1242,8 +1242,8 @@ static int emac_close(struct net_device *ndev) | |||
1242 | static inline u16 emac_tx_csum(struct emac_instance *dev, | 1242 | static inline u16 emac_tx_csum(struct emac_instance *dev, |
1243 | struct sk_buff *skb) | 1243 | struct sk_buff *skb) |
1244 | { | 1244 | { |
1245 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH && | 1245 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH) && |
1246 | skb->ip_summed == CHECKSUM_PARTIAL)) { | 1246 | (skb->ip_summed == CHECKSUM_PARTIAL)) { |
1247 | ++dev->stats.tx_packets_csum; | 1247 | ++dev->stats.tx_packets_csum; |
1248 | return EMAC_TX_CTRL_TAH_CSUM; | 1248 | return EMAC_TX_CTRL_TAH_CSUM; |
1249 | } | 1249 | } |
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h index 6604d96bd567..76ea846663db 100644 --- a/drivers/net/igb/e1000_82575.h +++ b/drivers/net/igb/e1000_82575.h | |||
@@ -61,28 +61,28 @@ | |||
61 | /* Receive Descriptor - Advanced */ | 61 | /* Receive Descriptor - Advanced */ |
62 | union e1000_adv_rx_desc { | 62 | union e1000_adv_rx_desc { |
63 | struct { | 63 | struct { |
64 | u64 pkt_addr; /* Packet buffer address */ | 64 | __le64 pkt_addr; /* Packet buffer address */ |
65 | u64 hdr_addr; /* Header buffer address */ | 65 | __le64 hdr_addr; /* Header buffer address */ |
66 | } read; | 66 | } read; |
67 | struct { | 67 | struct { |
68 | struct { | 68 | struct { |
69 | struct { | 69 | struct { |
70 | u16 pkt_info; /* RSS type, Packet type */ | 70 | __le16 pkt_info; /* RSS type, Packet type */ |
71 | u16 hdr_info; /* Split Header, | 71 | __le16 hdr_info; /* Split Header, |
72 | * header buffer length */ | 72 | * header buffer length */ |
73 | } lo_dword; | 73 | } lo_dword; |
74 | union { | 74 | union { |
75 | u32 rss; /* RSS Hash */ | 75 | __le32 rss; /* RSS Hash */ |
76 | struct { | 76 | struct { |
77 | u16 ip_id; /* IP id */ | 77 | __le16 ip_id; /* IP id */ |
78 | u16 csum; /* Packet Checksum */ | 78 | __le16 csum; /* Packet Checksum */ |
79 | } csum_ip; | 79 | } csum_ip; |
80 | } hi_dword; | 80 | } hi_dword; |
81 | } lower; | 81 | } lower; |
82 | struct { | 82 | struct { |
83 | u32 status_error; /* ext status/error */ | 83 | __le32 status_error; /* ext status/error */ |
84 | u16 length; /* Packet length */ | 84 | __le16 length; /* Packet length */ |
85 | u16 vlan; /* VLAN tag */ | 85 | __le16 vlan; /* VLAN tag */ |
86 | } upper; | 86 | } upper; |
87 | } wb; /* writeback */ | 87 | } wb; /* writeback */ |
88 | }; | 88 | }; |
@@ -97,14 +97,14 @@ union e1000_adv_rx_desc { | |||
97 | /* Transmit Descriptor - Advanced */ | 97 | /* Transmit Descriptor - Advanced */ |
98 | union e1000_adv_tx_desc { | 98 | union e1000_adv_tx_desc { |
99 | struct { | 99 | struct { |
100 | u64 buffer_addr; /* Address of descriptor's data buf */ | 100 | __le64 buffer_addr; /* Address of descriptor's data buf */ |
101 | u32 cmd_type_len; | 101 | __le32 cmd_type_len; |
102 | u32 olinfo_status; | 102 | __le32 olinfo_status; |
103 | } read; | 103 | } read; |
104 | struct { | 104 | struct { |
105 | u64 rsvd; /* Reserved */ | 105 | __le64 rsvd; /* Reserved */ |
106 | u32 nxtseq_seed; | 106 | __le32 nxtseq_seed; |
107 | u32 status; | 107 | __le32 status; |
108 | } wb; | 108 | } wb; |
109 | }; | 109 | }; |
110 | 110 | ||
@@ -119,10 +119,10 @@ union e1000_adv_tx_desc { | |||
119 | 119 | ||
120 | /* Context descriptors */ | 120 | /* Context descriptors */ |
121 | struct e1000_adv_tx_context_desc { | 121 | struct e1000_adv_tx_context_desc { |
122 | u32 vlan_macip_lens; | 122 | __le32 vlan_macip_lens; |
123 | u32 seqnum_seed; | 123 | __le32 seqnum_seed; |
124 | u32 type_tucmd_mlhl; | 124 | __le32 type_tucmd_mlhl; |
125 | u32 mss_l4len_idx; | 125 | __le32 mss_l4len_idx; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | #define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ | 128 | #define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ |
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h index 161fb68764af..7b2c70a3b8cc 100644 --- a/drivers/net/igb/e1000_hw.h +++ b/drivers/net/igb/e1000_hw.h | |||
@@ -143,35 +143,35 @@ enum e1000_fc_type { | |||
143 | 143 | ||
144 | /* Receive Descriptor */ | 144 | /* Receive Descriptor */ |
145 | struct e1000_rx_desc { | 145 | struct e1000_rx_desc { |
146 | u64 buffer_addr; /* Address of the descriptor's data buffer */ | 146 | __le64 buffer_addr; /* Address of the descriptor's data buffer */ |
147 | u16 length; /* Length of data DMAed into data buffer */ | 147 | __le16 length; /* Length of data DMAed into data buffer */ |
148 | u16 csum; /* Packet checksum */ | 148 | __le16 csum; /* Packet checksum */ |
149 | u8 status; /* Descriptor status */ | 149 | u8 status; /* Descriptor status */ |
150 | u8 errors; /* Descriptor Errors */ | 150 | u8 errors; /* Descriptor Errors */ |
151 | u16 special; | 151 | __le16 special; |
152 | }; | 152 | }; |
153 | 153 | ||
154 | /* Receive Descriptor - Extended */ | 154 | /* Receive Descriptor - Extended */ |
155 | union e1000_rx_desc_extended { | 155 | union e1000_rx_desc_extended { |
156 | struct { | 156 | struct { |
157 | u64 buffer_addr; | 157 | __le64 buffer_addr; |
158 | u64 reserved; | 158 | __le64 reserved; |
159 | } read; | 159 | } read; |
160 | struct { | 160 | struct { |
161 | struct { | 161 | struct { |
162 | u32 mrq; /* Multiple Rx Queues */ | 162 | __le32 mrq; /* Multiple Rx Queues */ |
163 | union { | 163 | union { |
164 | u32 rss; /* RSS Hash */ | 164 | __le32 rss; /* RSS Hash */ |
165 | struct { | 165 | struct { |
166 | u16 ip_id; /* IP id */ | 166 | __le16 ip_id; /* IP id */ |
167 | u16 csum; /* Packet Checksum */ | 167 | __le16 csum; /* Packet Checksum */ |
168 | } csum_ip; | 168 | } csum_ip; |
169 | } hi_dword; | 169 | } hi_dword; |
170 | } lower; | 170 | } lower; |
171 | struct { | 171 | struct { |
172 | u32 status_error; /* ext status/error */ | 172 | __le32 status_error; /* ext status/error */ |
173 | u16 length; | 173 | __le16 length; |
174 | u16 vlan; /* VLAN tag */ | 174 | __le16 vlan; /* VLAN tag */ |
175 | } upper; | 175 | } upper; |
176 | } wb; /* writeback */ | 176 | } wb; /* writeback */ |
177 | }; | 177 | }; |
@@ -181,49 +181,49 @@ union e1000_rx_desc_extended { | |||
181 | union e1000_rx_desc_packet_split { | 181 | union e1000_rx_desc_packet_split { |
182 | struct { | 182 | struct { |
183 | /* one buffer for protocol header(s), three data buffers */ | 183 | /* one buffer for protocol header(s), three data buffers */ |
184 | u64 buffer_addr[MAX_PS_BUFFERS]; | 184 | __le64 buffer_addr[MAX_PS_BUFFERS]; |
185 | } read; | 185 | } read; |
186 | struct { | 186 | struct { |
187 | struct { | 187 | struct { |
188 | u32 mrq; /* Multiple Rx Queues */ | 188 | __le32 mrq; /* Multiple Rx Queues */ |
189 | union { | 189 | union { |
190 | u32 rss; /* RSS Hash */ | 190 | __le32 rss; /* RSS Hash */ |
191 | struct { | 191 | struct { |
192 | u16 ip_id; /* IP id */ | 192 | __le16 ip_id; /* IP id */ |
193 | u16 csum; /* Packet Checksum */ | 193 | __le16 csum; /* Packet Checksum */ |
194 | } csum_ip; | 194 | } csum_ip; |
195 | } hi_dword; | 195 | } hi_dword; |
196 | } lower; | 196 | } lower; |
197 | struct { | 197 | struct { |
198 | u32 status_error; /* ext status/error */ | 198 | __le32 status_error; /* ext status/error */ |
199 | u16 length0; /* length of buffer 0 */ | 199 | __le16 length0; /* length of buffer 0 */ |
200 | u16 vlan; /* VLAN tag */ | 200 | __le16 vlan; /* VLAN tag */ |
201 | } middle; | 201 | } middle; |
202 | struct { | 202 | struct { |
203 | u16 header_status; | 203 | __le16 header_status; |
204 | u16 length[3]; /* length of buffers 1-3 */ | 204 | __le16 length[3]; /* length of buffers 1-3 */ |
205 | } upper; | 205 | } upper; |
206 | u64 reserved; | 206 | __le64 reserved; |
207 | } wb; /* writeback */ | 207 | } wb; /* writeback */ |
208 | }; | 208 | }; |
209 | 209 | ||
210 | /* Transmit Descriptor */ | 210 | /* Transmit Descriptor */ |
211 | struct e1000_tx_desc { | 211 | struct e1000_tx_desc { |
212 | u64 buffer_addr; /* Address of the descriptor's data buffer */ | 212 | __le64 buffer_addr; /* Address of the descriptor's data buffer */ |
213 | union { | 213 | union { |
214 | u32 data; | 214 | __le32 data; |
215 | struct { | 215 | struct { |
216 | u16 length; /* Data buffer length */ | 216 | __le16 length; /* Data buffer length */ |
217 | u8 cso; /* Checksum offset */ | 217 | u8 cso; /* Checksum offset */ |
218 | u8 cmd; /* Descriptor control */ | 218 | u8 cmd; /* Descriptor control */ |
219 | } flags; | 219 | } flags; |
220 | } lower; | 220 | } lower; |
221 | union { | 221 | union { |
222 | u32 data; | 222 | __le32 data; |
223 | struct { | 223 | struct { |
224 | u8 status; /* Descriptor status */ | 224 | u8 status; /* Descriptor status */ |
225 | u8 css; /* Checksum start */ | 225 | u8 css; /* Checksum start */ |
226 | u16 special; | 226 | __le16 special; |
227 | } fields; | 227 | } fields; |
228 | } upper; | 228 | } upper; |
229 | }; | 229 | }; |
@@ -231,49 +231,49 @@ struct e1000_tx_desc { | |||
231 | /* Offload Context Descriptor */ | 231 | /* Offload Context Descriptor */ |
232 | struct e1000_context_desc { | 232 | struct e1000_context_desc { |
233 | union { | 233 | union { |
234 | u32 ip_config; | 234 | __le32 ip_config; |
235 | struct { | 235 | struct { |
236 | u8 ipcss; /* IP checksum start */ | 236 | u8 ipcss; /* IP checksum start */ |
237 | u8 ipcso; /* IP checksum offset */ | 237 | u8 ipcso; /* IP checksum offset */ |
238 | u16 ipcse; /* IP checksum end */ | 238 | __le16 ipcse; /* IP checksum end */ |
239 | } ip_fields; | 239 | } ip_fields; |
240 | } lower_setup; | 240 | } lower_setup; |
241 | union { | 241 | union { |
242 | u32 tcp_config; | 242 | __le32 tcp_config; |
243 | struct { | 243 | struct { |
244 | u8 tucss; /* TCP checksum start */ | 244 | u8 tucss; /* TCP checksum start */ |
245 | u8 tucso; /* TCP checksum offset */ | 245 | u8 tucso; /* TCP checksum offset */ |
246 | u16 tucse; /* TCP checksum end */ | 246 | __le16 tucse; /* TCP checksum end */ |
247 | } tcp_fields; | 247 | } tcp_fields; |
248 | } upper_setup; | 248 | } upper_setup; |
249 | u32 cmd_and_length; | 249 | __le32 cmd_and_length; |
250 | union { | 250 | union { |
251 | u32 data; | 251 | __le32 data; |
252 | struct { | 252 | struct { |
253 | u8 status; /* Descriptor status */ | 253 | u8 status; /* Descriptor status */ |
254 | u8 hdr_len; /* Header length */ | 254 | u8 hdr_len; /* Header length */ |
255 | u16 mss; /* Maximum segment size */ | 255 | __le16 mss; /* Maximum segment size */ |
256 | } fields; | 256 | } fields; |
257 | } tcp_seg_setup; | 257 | } tcp_seg_setup; |
258 | }; | 258 | }; |
259 | 259 | ||
260 | /* Offload data descriptor */ | 260 | /* Offload data descriptor */ |
261 | struct e1000_data_desc { | 261 | struct e1000_data_desc { |
262 | u64 buffer_addr; /* Address of the descriptor's buffer address */ | 262 | __le64 buffer_addr; /* Address of the descriptor's buffer address */ |
263 | union { | 263 | union { |
264 | u32 data; | 264 | __le32 data; |
265 | struct { | 265 | struct { |
266 | u16 length; /* Data buffer length */ | 266 | __le16 length; /* Data buffer length */ |
267 | u8 typ_len_ext; | 267 | u8 typ_len_ext; |
268 | u8 cmd; | 268 | u8 cmd; |
269 | } flags; | 269 | } flags; |
270 | } lower; | 270 | } lower; |
271 | union { | 271 | union { |
272 | u32 data; | 272 | __le32 data; |
273 | struct { | 273 | struct { |
274 | u8 status; /* Descriptor status */ | 274 | u8 status; /* Descriptor status */ |
275 | u8 popts; /* Packet Options */ | 275 | u8 popts; /* Packet Options */ |
276 | u16 special; | 276 | __le16 special; |
277 | } fields; | 277 | } fields; |
278 | } upper; | 278 | } upper; |
279 | }; | 279 | }; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 928ce8287e69..aaee02e9e3f0 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -3254,6 +3254,13 @@ quit_polling: | |||
3254 | 3254 | ||
3255 | return 1; | 3255 | return 1; |
3256 | } | 3256 | } |
3257 | |||
3258 | static inline u32 get_head(struct igb_ring *tx_ring) | ||
3259 | { | ||
3260 | void *end = (struct e1000_tx_desc *)tx_ring->desc + tx_ring->count; | ||
3261 | return le32_to_cpu(*(volatile __le32 *)end); | ||
3262 | } | ||
3263 | |||
3257 | /** | 3264 | /** |
3258 | * igb_clean_tx_irq - Reclaim resources after transmit completes | 3265 | * igb_clean_tx_irq - Reclaim resources after transmit completes |
3259 | * @adapter: board private structure | 3266 | * @adapter: board private structure |
@@ -3275,9 +3282,7 @@ static bool igb_clean_tx_irq(struct igb_adapter *adapter, | |||
3275 | unsigned int total_bytes = 0, total_packets = 0; | 3282 | unsigned int total_bytes = 0, total_packets = 0; |
3276 | 3283 | ||
3277 | rmb(); | 3284 | rmb(); |
3278 | head = *(volatile u32 *)((struct e1000_tx_desc *)tx_ring->desc | 3285 | head = get_head(tx_ring); |
3279 | + tx_ring->count); | ||
3280 | head = le32_to_cpu(head); | ||
3281 | i = tx_ring->next_to_clean; | 3286 | i = tx_ring->next_to_clean; |
3282 | while (1) { | 3287 | while (1) { |
3283 | while (i != head) { | 3288 | while (i != head) { |
@@ -3312,9 +3317,7 @@ static bool igb_clean_tx_irq(struct igb_adapter *adapter, | |||
3312 | } | 3317 | } |
3313 | oldhead = head; | 3318 | oldhead = head; |
3314 | rmb(); | 3319 | rmb(); |
3315 | head = *(volatile u32 *)((struct e1000_tx_desc *)tx_ring->desc | 3320 | head = get_head(tx_ring); |
3316 | + tx_ring->count); | ||
3317 | head = le32_to_cpu(head); | ||
3318 | if (head == oldhead) | 3321 | if (head == oldhead) |
3319 | goto done_cleaning; | 3322 | goto done_cleaning; |
3320 | } /* while (1) */ | 3323 | } /* while (1) */ |
@@ -3388,7 +3391,7 @@ done_cleaning: | |||
3388 | * @vlan: descriptor vlan field as written by hardware (no le/be conversion) | 3391 | * @vlan: descriptor vlan field as written by hardware (no le/be conversion) |
3389 | * @skb: pointer to sk_buff to be indicated to stack | 3392 | * @skb: pointer to sk_buff to be indicated to stack |
3390 | **/ | 3393 | **/ |
3391 | static void igb_receive_skb(struct igb_adapter *adapter, u8 status, u16 vlan, | 3394 | static void igb_receive_skb(struct igb_adapter *adapter, u8 status, __le16 vlan, |
3392 | struct sk_buff *skb) | 3395 | struct sk_buff *skb) |
3393 | { | 3396 | { |
3394 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) | 3397 | if (adapter->vlgrp && (status & E1000_RXD_STAT_VP)) |
@@ -3452,8 +3455,8 @@ static bool igb_clean_rx_irq_adv(struct igb_adapter *adapter, | |||
3452 | * that case, it fills the header buffer and spills the rest | 3455 | * that case, it fills the header buffer and spills the rest |
3453 | * into the page. | 3456 | * into the page. |
3454 | */ | 3457 | */ |
3455 | hlen = le16_to_cpu((rx_desc->wb.lower.lo_dword.hdr_info & | 3458 | hlen = (le16_to_cpu(rx_desc->wb.lower.lo_dword.hdr_info) & |
3456 | E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT); | 3459 | E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT; |
3457 | if (hlen > adapter->rx_ps_hdr_size) | 3460 | if (hlen > adapter->rx_ps_hdr_size) |
3458 | hlen = adapter->rx_ps_hdr_size; | 3461 | hlen = adapter->rx_ps_hdr_size; |
3459 | 3462 | ||
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 269e6f805f47..6738b4d097fe 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -2088,14 +2088,12 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter) | |||
2088 | struct ixgb_buffer *buffer_info; | 2088 | struct ixgb_buffer *buffer_info; |
2089 | struct sk_buff *skb; | 2089 | struct sk_buff *skb; |
2090 | unsigned int i; | 2090 | unsigned int i; |
2091 | int num_group_tail_writes; | ||
2092 | long cleancount; | 2091 | long cleancount; |
2093 | 2092 | ||
2094 | i = rx_ring->next_to_use; | 2093 | i = rx_ring->next_to_use; |
2095 | buffer_info = &rx_ring->buffer_info[i]; | 2094 | buffer_info = &rx_ring->buffer_info[i]; |
2096 | cleancount = IXGB_DESC_UNUSED(rx_ring); | 2095 | cleancount = IXGB_DESC_UNUSED(rx_ring); |
2097 | 2096 | ||
2098 | num_group_tail_writes = IXGB_RX_BUFFER_WRITE; | ||
2099 | 2097 | ||
2100 | /* leave three descriptors unused */ | 2098 | /* leave three descriptors unused */ |
2101 | while(--cleancount > 2) { | 2099 | while(--cleancount > 2) { |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 2bc5eaae141f..7f20a03623a0 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -85,7 +85,7 @@ | |||
85 | (sizeof(struct netxen_cmd_buffer) * adapter->max_tx_desc_count) | 85 | (sizeof(struct netxen_cmd_buffer) * adapter->max_tx_desc_count) |
86 | #define RCV_BUFFSIZE \ | 86 | #define RCV_BUFFSIZE \ |
87 | (sizeof(struct netxen_rx_buffer) * rcv_desc->max_rx_desc_count) | 87 | (sizeof(struct netxen_rx_buffer) * rcv_desc->max_rx_desc_count) |
88 | #define find_diff_among(a,b,range) ((a)<=(b)?((b)-(a)):((b)+(range)-(a))) | 88 | #define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a))) |
89 | 89 | ||
90 | #define NETXEN_NETDEV_STATUS 0x1 | 90 | #define NETXEN_NETDEV_STATUS 0x1 |
91 | #define NETXEN_RCV_PRODUCER_OFFSET 0 | 91 | #define NETXEN_RCV_PRODUCER_OFFSET 0 |
@@ -204,7 +204,7 @@ enum { | |||
204 | ? RCV_DESC_LRO : \ | 204 | ? RCV_DESC_LRO : \ |
205 | (RCV_DESC_NORMAL))) | 205 | (RCV_DESC_NORMAL))) |
206 | 206 | ||
207 | #define MAX_CMD_DESCRIPTORS 1024 | 207 | #define MAX_CMD_DESCRIPTORS 4096 |
208 | #define MAX_RCV_DESCRIPTORS 16384 | 208 | #define MAX_RCV_DESCRIPTORS 16384 |
209 | #define MAX_CMD_DESCRIPTORS_HOST (MAX_CMD_DESCRIPTORS / 4) | 209 | #define MAX_CMD_DESCRIPTORS_HOST (MAX_CMD_DESCRIPTORS / 4) |
210 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) | 210 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) |
@@ -818,15 +818,8 @@ struct netxen_adapter_stats { | |||
818 | u64 badskblen; | 818 | u64 badskblen; |
819 | u64 nocmddescriptor; | 819 | u64 nocmddescriptor; |
820 | u64 polled; | 820 | u64 polled; |
821 | u64 uphappy; | 821 | u64 rxdropped; |
822 | u64 updropped; | ||
823 | u64 uplcong; | ||
824 | u64 uphcong; | ||
825 | u64 upmcong; | ||
826 | u64 updunno; | ||
827 | u64 skbfreed; | ||
828 | u64 txdropped; | 822 | u64 txdropped; |
829 | u64 txnullskb; | ||
830 | u64 csummed; | 823 | u64 csummed; |
831 | u64 no_rcv; | 824 | u64 no_rcv; |
832 | u64 rxbytes; | 825 | u64 rxbytes; |
@@ -842,7 +835,6 @@ struct netxen_rcv_desc_ctx { | |||
842 | u32 flags; | 835 | u32 flags; |
843 | u32 producer; | 836 | u32 producer; |
844 | u32 rcv_pending; /* Num of bufs posted in phantom */ | 837 | u32 rcv_pending; /* Num of bufs posted in phantom */ |
845 | u32 rcv_free; /* Num of bufs in free list */ | ||
846 | dma_addr_t phys_addr; | 838 | dma_addr_t phys_addr; |
847 | struct pci_dev *phys_pdev; | 839 | struct pci_dev *phys_pdev; |
848 | struct rcv_desc *desc_head; /* address of rx ring in Phantom */ | 840 | struct rcv_desc *desc_head; /* address of rx ring in Phantom */ |
@@ -889,8 +881,6 @@ struct netxen_adapter { | |||
889 | int mtu; | 881 | int mtu; |
890 | int portnum; | 882 | int portnum; |
891 | 883 | ||
892 | spinlock_t tx_lock; | ||
893 | spinlock_t lock; | ||
894 | struct work_struct watchdog_task; | 884 | struct work_struct watchdog_task; |
895 | struct timer_list watchdog_timer; | 885 | struct timer_list watchdog_timer; |
896 | struct work_struct tx_timeout_task; | 886 | struct work_struct tx_timeout_task; |
@@ -899,16 +889,12 @@ struct netxen_adapter { | |||
899 | 889 | ||
900 | u32 cmd_producer; | 890 | u32 cmd_producer; |
901 | __le32 *cmd_consumer; | 891 | __le32 *cmd_consumer; |
902 | |||
903 | u32 last_cmd_consumer; | 892 | u32 last_cmd_consumer; |
893 | |||
904 | u32 max_tx_desc_count; | 894 | u32 max_tx_desc_count; |
905 | u32 max_rx_desc_count; | 895 | u32 max_rx_desc_count; |
906 | u32 max_jumbo_rx_desc_count; | 896 | u32 max_jumbo_rx_desc_count; |
907 | u32 max_lro_rx_desc_count; | 897 | u32 max_lro_rx_desc_count; |
908 | /* Num of instances active on cmd buffer ring */ | ||
909 | u32 proc_cmd_buf_counter; | ||
910 | |||
911 | u32 num_threads, total_threads; /*Use to keep track of xmit threads */ | ||
912 | 898 | ||
913 | u32 flags; | 899 | u32 flags; |
914 | u32 irq; | 900 | u32 irq; |
@@ -942,6 +928,7 @@ struct netxen_adapter { | |||
942 | struct pci_dev *ctx_desc_pdev; | 928 | struct pci_dev *ctx_desc_pdev; |
943 | dma_addr_t ctx_desc_phys_addr; | 929 | dma_addr_t ctx_desc_phys_addr; |
944 | int intr_scheme; | 930 | int intr_scheme; |
931 | int msi_mode; | ||
945 | int (*enable_phy_interrupts) (struct netxen_adapter *); | 932 | int (*enable_phy_interrupts) (struct netxen_adapter *); |
946 | int (*disable_phy_interrupts) (struct netxen_adapter *); | 933 | int (*disable_phy_interrupts) (struct netxen_adapter *); |
947 | void (*handle_phy_intr) (struct netxen_adapter *); | 934 | void (*handle_phy_intr) (struct netxen_adapter *); |
@@ -1075,12 +1062,10 @@ void netxen_tso_check(struct netxen_adapter *adapter, | |||
1075 | struct cmd_desc_type0 *desc, struct sk_buff *skb); | 1062 | struct cmd_desc_type0 *desc, struct sk_buff *skb); |
1076 | int netxen_nic_hw_resources(struct netxen_adapter *adapter); | 1063 | int netxen_nic_hw_resources(struct netxen_adapter *adapter); |
1077 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); | 1064 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); |
1078 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); | ||
1079 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); | ||
1080 | void netxen_watchdog_task(struct work_struct *work); | 1065 | void netxen_watchdog_task(struct work_struct *work); |
1081 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1066 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
1082 | u32 ringid); | 1067 | u32 ringid); |
1083 | int netxen_process_cmd_ring(unsigned long data); | 1068 | int netxen_process_cmd_ring(struct netxen_adapter *adapter); |
1084 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1069 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1085 | void netxen_nic_set_multi(struct net_device *netdev); | 1070 | void netxen_nic_set_multi(struct net_device *netdev); |
1086 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); | 1071 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 7a876f4b8db2..6e98d830eefb 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -64,15 +64,7 @@ static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { | |||
64 | {"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)}, | 64 | {"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)}, |
65 | {"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)}, | 65 | {"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)}, |
66 | {"polled", NETXEN_NIC_STAT(stats.polled)}, | 66 | {"polled", NETXEN_NIC_STAT(stats.polled)}, |
67 | {"uphappy", NETXEN_NIC_STAT(stats.uphappy)}, | ||
68 | {"updropped", NETXEN_NIC_STAT(stats.updropped)}, | ||
69 | {"uplcong", NETXEN_NIC_STAT(stats.uplcong)}, | ||
70 | {"uphcong", NETXEN_NIC_STAT(stats.uphcong)}, | ||
71 | {"upmcong", NETXEN_NIC_STAT(stats.upmcong)}, | ||
72 | {"updunno", NETXEN_NIC_STAT(stats.updunno)}, | ||
73 | {"skb_freed", NETXEN_NIC_STAT(stats.skbfreed)}, | ||
74 | {"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)}, | 67 | {"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)}, |
75 | {"tx_null_skb", NETXEN_NIC_STAT(stats.txnullskb)}, | ||
76 | {"csummed", NETXEN_NIC_STAT(stats.csummed)}, | 68 | {"csummed", NETXEN_NIC_STAT(stats.csummed)}, |
77 | {"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)}, | 69 | {"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)}, |
78 | {"rx_bytes", NETXEN_NIC_STAT(stats.rxbytes)}, | 70 | {"rx_bytes", NETXEN_NIC_STAT(stats.rxbytes)}, |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index d72f8f8fcb50..160f605e58db 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -456,6 +456,12 @@ enum { | |||
456 | #define ISR_INT_MASK_SLOW (NETXEN_PCIX_PS_REG(PCIX_INT_MASK)) | 456 | #define ISR_INT_MASK_SLOW (NETXEN_PCIX_PS_REG(PCIX_INT_MASK)) |
457 | #define ISR_INT_TARGET_STATUS (NETXEN_PCIX_PS_REG(PCIX_TARGET_STATUS)) | 457 | #define ISR_INT_TARGET_STATUS (NETXEN_PCIX_PS_REG(PCIX_TARGET_STATUS)) |
458 | #define ISR_INT_TARGET_MASK (NETXEN_PCIX_PS_REG(PCIX_TARGET_MASK)) | 458 | #define ISR_INT_TARGET_MASK (NETXEN_PCIX_PS_REG(PCIX_TARGET_MASK)) |
459 | #define ISR_INT_TARGET_STATUS_F1 (NETXEN_PCIX_PS_REG(PCIX_TARGET_STATUS_F1)) | ||
460 | #define ISR_INT_TARGET_MASK_F1 (NETXEN_PCIX_PS_REG(PCIX_TARGET_MASK_F1)) | ||
461 | #define ISR_INT_TARGET_STATUS_F2 (NETXEN_PCIX_PS_REG(PCIX_TARGET_STATUS_F2)) | ||
462 | #define ISR_INT_TARGET_MASK_F2 (NETXEN_PCIX_PS_REG(PCIX_TARGET_MASK_F2)) | ||
463 | #define ISR_INT_TARGET_STATUS_F3 (NETXEN_PCIX_PS_REG(PCIX_TARGET_STATUS_F3)) | ||
464 | #define ISR_INT_TARGET_MASK_F3 (NETXEN_PCIX_PS_REG(PCIX_TARGET_MASK_F3)) | ||
459 | 465 | ||
460 | #define NETXEN_PCI_MAPSIZE 128 | 466 | #define NETXEN_PCI_MAPSIZE 128 |
461 | #define NETXEN_PCI_DDR_NET (0x00000000UL) | 467 | #define NETXEN_PCI_DDR_NET (0x00000000UL) |
@@ -662,6 +668,12 @@ enum { | |||
662 | 668 | ||
663 | #define PCIX_TARGET_STATUS (0x10118) | 669 | #define PCIX_TARGET_STATUS (0x10118) |
664 | #define PCIX_TARGET_MASK (0x10128) | 670 | #define PCIX_TARGET_MASK (0x10128) |
671 | #define PCIX_TARGET_STATUS_F1 (0x10160) | ||
672 | #define PCIX_TARGET_MASK_F1 (0x10170) | ||
673 | #define PCIX_TARGET_STATUS_F2 (0x10164) | ||
674 | #define PCIX_TARGET_MASK_F2 (0x10174) | ||
675 | #define PCIX_TARGET_STATUS_F3 (0x10168) | ||
676 | #define PCIX_TARGET_MASK_F3 (0x10178) | ||
665 | 677 | ||
666 | #define PCIX_MSI_F0 (0x13000) | 678 | #define PCIX_MSI_F0 (0x13000) |
667 | #define PCIX_MSI_F1 (0x13004) | 679 | #define PCIX_MSI_F1 (0x13004) |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 01355701bf8e..05748ca6f216 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -398,6 +398,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
398 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); | 398 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); |
399 | printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name, | 399 | printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name, |
400 | adapter->intr_scheme); | 400 | adapter->intr_scheme); |
401 | adapter->msi_mode = readl( | ||
402 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW)); | ||
401 | DPRINTK(INFO, "Receive Peg ready too. starting stuff\n"); | 403 | DPRINTK(INFO, "Receive Peg ready too. starting stuff\n"); |
402 | 404 | ||
403 | addr = netxen_alloc(adapter->ahw.pdev, | 405 | addr = netxen_alloc(adapter->ahw.pdev, |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 9e38bcb3fba9..45fa33e0cb90 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -145,6 +145,8 @@ int netxen_init_firmware(struct netxen_adapter *adapter) | |||
145 | /* Window 1 call */ | 145 | /* Window 1 call */ |
146 | writel(INTR_SCHEME_PERPORT, | 146 | writel(INTR_SCHEME_PERPORT, |
147 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_HOST)); | 147 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_HOST)); |
148 | writel(MSI_MODE_MULTIFUNC, | ||
149 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_HOST)); | ||
148 | writel(MPORT_MULTI_FUNCTION_MODE, | 150 | writel(MPORT_MULTI_FUNCTION_MODE, |
149 | NETXEN_CRB_NORMALIZE(adapter, CRB_MPORT_MODE)); | 151 | NETXEN_CRB_NORMALIZE(adapter, CRB_MPORT_MODE)); |
150 | writel(PHAN_INITIALIZE_ACK, | 152 | writel(PHAN_INITIALIZE_ACK, |
@@ -183,7 +185,6 @@ void netxen_initialize_adapter_sw(struct netxen_adapter *adapter) | |||
183 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { | 185 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { |
184 | struct netxen_rx_buffer *rx_buf; | 186 | struct netxen_rx_buffer *rx_buf; |
185 | rcv_desc = &adapter->recv_ctx[ctxid].rcv_desc[ring]; | 187 | rcv_desc = &adapter->recv_ctx[ctxid].rcv_desc[ring]; |
186 | rcv_desc->rcv_free = rcv_desc->max_rx_desc_count; | ||
187 | rcv_desc->begin_alloc = 0; | 188 | rcv_desc->begin_alloc = 0; |
188 | rx_buf = rcv_desc->rx_buf_arr; | 189 | rx_buf = rcv_desc->rx_buf_arr; |
189 | num_rx_bufs = rcv_desc->max_rx_desc_count; | 190 | num_rx_bufs = rcv_desc->max_rx_desc_count; |
@@ -974,28 +975,6 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val) | |||
974 | return 0; | 975 | return 0; |
975 | } | 976 | } |
976 | 977 | ||
977 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter) | ||
978 | { | ||
979 | int ctx; | ||
980 | |||
981 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | ||
982 | struct netxen_recv_context *recv_ctx = | ||
983 | &(adapter->recv_ctx[ctx]); | ||
984 | u32 consumer; | ||
985 | struct status_desc *desc_head; | ||
986 | struct status_desc *desc; | ||
987 | |||
988 | consumer = recv_ctx->status_rx_consumer; | ||
989 | desc_head = recv_ctx->rcv_status_desc_head; | ||
990 | desc = &desc_head[consumer]; | ||
991 | |||
992 | if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST) | ||
993 | return 1; | ||
994 | } | ||
995 | |||
996 | return 0; | ||
997 | } | ||
998 | |||
999 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) | 978 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) |
1000 | { | 979 | { |
1001 | struct net_device *netdev = adapter->netdev; | 980 | struct net_device *netdev = adapter->netdev; |
@@ -1038,7 +1017,6 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter) | |||
1038 | 1017 | ||
1039 | void netxen_watchdog_task(struct work_struct *work) | 1018 | void netxen_watchdog_task(struct work_struct *work) |
1040 | { | 1019 | { |
1041 | struct net_device *netdev; | ||
1042 | struct netxen_adapter *adapter = | 1020 | struct netxen_adapter *adapter = |
1043 | container_of(work, struct netxen_adapter, watchdog_task); | 1021 | container_of(work, struct netxen_adapter, watchdog_task); |
1044 | 1022 | ||
@@ -1048,20 +1026,6 @@ void netxen_watchdog_task(struct work_struct *work) | |||
1048 | if (adapter->handle_phy_intr) | 1026 | if (adapter->handle_phy_intr) |
1049 | adapter->handle_phy_intr(adapter); | 1027 | adapter->handle_phy_intr(adapter); |
1050 | 1028 | ||
1051 | netdev = adapter->netdev; | ||
1052 | if ((netif_running(netdev)) && !netif_carrier_ok(netdev) && | ||
1053 | netxen_nic_link_ok(adapter) ) { | ||
1054 | printk(KERN_INFO "%s %s (port %d), Link is up\n", | ||
1055 | netxen_nic_driver_name, netdev->name, adapter->portnum); | ||
1056 | netif_carrier_on(netdev); | ||
1057 | netif_wake_queue(netdev); | ||
1058 | } else if(!(netif_running(netdev)) && netif_carrier_ok(netdev)) { | ||
1059 | printk(KERN_ERR "%s %s Link is Down\n", | ||
1060 | netxen_nic_driver_name, netdev->name); | ||
1061 | netif_carrier_off(netdev); | ||
1062 | netif_stop_queue(netdev); | ||
1063 | } | ||
1064 | |||
1065 | mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ); | 1029 | mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ); |
1066 | } | 1030 | } |
1067 | 1031 | ||
@@ -1125,7 +1089,7 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1125 | skb = (struct sk_buff *)buffer->skb; | 1089 | skb = (struct sk_buff *)buffer->skb; |
1126 | 1090 | ||
1127 | if (likely(adapter->rx_csum && | 1091 | if (likely(adapter->rx_csum && |
1128 | netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) { | 1092 | netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) { |
1129 | adapter->stats.csummed++; | 1093 | adapter->stats.csummed++; |
1130 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1094 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1131 | } else | 1095 | } else |
@@ -1142,40 +1106,8 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1142 | skb->protocol = eth_type_trans(skb, netdev); | 1106 | skb->protocol = eth_type_trans(skb, netdev); |
1143 | 1107 | ||
1144 | ret = netif_receive_skb(skb); | 1108 | ret = netif_receive_skb(skb); |
1145 | |||
1146 | /* | ||
1147 | * RH: Do we need these stats on a regular basis. Can we get it from | ||
1148 | * Linux stats. | ||
1149 | */ | ||
1150 | switch (ret) { | ||
1151 | case NET_RX_SUCCESS: | ||
1152 | adapter->stats.uphappy++; | ||
1153 | break; | ||
1154 | |||
1155 | case NET_RX_CN_LOW: | ||
1156 | adapter->stats.uplcong++; | ||
1157 | break; | ||
1158 | |||
1159 | case NET_RX_CN_MOD: | ||
1160 | adapter->stats.upmcong++; | ||
1161 | break; | ||
1162 | |||
1163 | case NET_RX_CN_HIGH: | ||
1164 | adapter->stats.uphcong++; | ||
1165 | break; | ||
1166 | |||
1167 | case NET_RX_DROP: | ||
1168 | adapter->stats.updropped++; | ||
1169 | break; | ||
1170 | |||
1171 | default: | ||
1172 | adapter->stats.updunno++; | ||
1173 | break; | ||
1174 | } | ||
1175 | |||
1176 | netdev->last_rx = jiffies; | 1109 | netdev->last_rx = jiffies; |
1177 | 1110 | ||
1178 | rcv_desc->rcv_free++; | ||
1179 | rcv_desc->rcv_pending--; | 1111 | rcv_desc->rcv_pending--; |
1180 | 1112 | ||
1181 | /* | 1113 | /* |
@@ -1200,13 +1132,6 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1200 | u32 producer = 0; | 1132 | u32 producer = 0; |
1201 | int count = 0, ring; | 1133 | int count = 0, ring; |
1202 | 1134 | ||
1203 | DPRINTK(INFO, "procesing receive\n"); | ||
1204 | /* | ||
1205 | * we assume in this case that there is only one port and that is | ||
1206 | * port #1...changes need to be done in firmware to indicate port | ||
1207 | * number as part of the descriptor. This way we will be able to get | ||
1208 | * the netdev which is associated with that device. | ||
1209 | */ | ||
1210 | while (count < max) { | 1135 | while (count < max) { |
1211 | desc = &desc_head[consumer]; | 1136 | desc = &desc_head[consumer]; |
1212 | if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) { | 1137 | if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) { |
@@ -1219,11 +1144,8 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1219 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); | 1144 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); |
1220 | count++; | 1145 | count++; |
1221 | } | 1146 | } |
1222 | if (count) { | 1147 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) |
1223 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { | 1148 | netxen_post_rx_buffers_nodb(adapter, ctxid, ring); |
1224 | netxen_post_rx_buffers_nodb(adapter, ctxid, ring); | ||
1225 | } | ||
1226 | } | ||
1227 | 1149 | ||
1228 | /* update the consumer index in phantom */ | 1150 | /* update the consumer index in phantom */ |
1229 | if (count) { | 1151 | if (count) { |
@@ -1233,108 +1155,60 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1233 | /* Window = 1 */ | 1155 | /* Window = 1 */ |
1234 | writel(consumer, | 1156 | writel(consumer, |
1235 | NETXEN_CRB_NORMALIZE(adapter, | 1157 | NETXEN_CRB_NORMALIZE(adapter, |
1236 | recv_crb_registers[adapter->portnum]. | 1158 | recv_crb_registers[adapter->portnum]. |
1237 | crb_rcv_status_consumer)); | 1159 | crb_rcv_status_consumer)); |
1238 | wmb(); | ||
1239 | } | 1160 | } |
1240 | 1161 | ||
1241 | return count; | 1162 | return count; |
1242 | } | 1163 | } |
1243 | 1164 | ||
1244 | /* Process Command status ring */ | 1165 | /* Process Command status ring */ |
1245 | int netxen_process_cmd_ring(unsigned long data) | 1166 | int netxen_process_cmd_ring(struct netxen_adapter *adapter) |
1246 | { | 1167 | { |
1247 | u32 last_consumer; | 1168 | u32 last_consumer, consumer; |
1248 | u32 consumer; | 1169 | int count = 0, i; |
1249 | struct netxen_adapter *adapter = (struct netxen_adapter *)data; | ||
1250 | int count1 = 0; | ||
1251 | int count2 = 0; | ||
1252 | struct netxen_cmd_buffer *buffer; | 1170 | struct netxen_cmd_buffer *buffer; |
1253 | struct pci_dev *pdev; | 1171 | struct pci_dev *pdev = adapter->pdev; |
1172 | struct net_device *netdev = adapter->netdev; | ||
1254 | struct netxen_skb_frag *frag; | 1173 | struct netxen_skb_frag *frag; |
1255 | u32 i; | 1174 | int done = 0; |
1256 | int done; | ||
1257 | 1175 | ||
1258 | spin_lock(&adapter->tx_lock); | ||
1259 | last_consumer = adapter->last_cmd_consumer; | 1176 | last_consumer = adapter->last_cmd_consumer; |
1260 | DPRINTK(INFO, "procesing xmit complete\n"); | ||
1261 | /* we assume in this case that there is only one port and that is | ||
1262 | * port #1...changes need to be done in firmware to indicate port | ||
1263 | * number as part of the descriptor. This way we will be able to get | ||
1264 | * the netdev which is associated with that device. | ||
1265 | */ | ||
1266 | |||
1267 | consumer = le32_to_cpu(*(adapter->cmd_consumer)); | 1177 | consumer = le32_to_cpu(*(adapter->cmd_consumer)); |
1268 | if (last_consumer == consumer) { /* Ring is empty */ | ||
1269 | DPRINTK(INFO, "last_consumer %d == consumer %d\n", | ||
1270 | last_consumer, consumer); | ||
1271 | spin_unlock(&adapter->tx_lock); | ||
1272 | return 1; | ||
1273 | } | ||
1274 | |||
1275 | adapter->proc_cmd_buf_counter++; | ||
1276 | /* | ||
1277 | * Not needed - does not seem to be used anywhere. | ||
1278 | * adapter->cmd_consumer = consumer; | ||
1279 | */ | ||
1280 | spin_unlock(&adapter->tx_lock); | ||
1281 | 1178 | ||
1282 | while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { | 1179 | while (last_consumer != consumer) { |
1283 | buffer = &adapter->cmd_buf_arr[last_consumer]; | 1180 | buffer = &adapter->cmd_buf_arr[last_consumer]; |
1284 | pdev = adapter->pdev; | ||
1285 | if (buffer->skb) { | 1181 | if (buffer->skb) { |
1286 | frag = &buffer->frag_array[0]; | 1182 | frag = &buffer->frag_array[0]; |
1287 | pci_unmap_single(pdev, frag->dma, frag->length, | 1183 | pci_unmap_single(pdev, frag->dma, frag->length, |
1288 | PCI_DMA_TODEVICE); | 1184 | PCI_DMA_TODEVICE); |
1289 | frag->dma = 0ULL; | 1185 | frag->dma = 0ULL; |
1290 | for (i = 1; i < buffer->frag_count; i++) { | 1186 | for (i = 1; i < buffer->frag_count; i++) { |
1291 | DPRINTK(INFO, "getting fragment no %d\n", i); | ||
1292 | frag++; /* Get the next frag */ | 1187 | frag++; /* Get the next frag */ |
1293 | pci_unmap_page(pdev, frag->dma, frag->length, | 1188 | pci_unmap_page(pdev, frag->dma, frag->length, |
1294 | PCI_DMA_TODEVICE); | 1189 | PCI_DMA_TODEVICE); |
1295 | frag->dma = 0ULL; | 1190 | frag->dma = 0ULL; |
1296 | } | 1191 | } |
1297 | 1192 | ||
1298 | adapter->stats.skbfreed++; | 1193 | adapter->stats.xmitfinished++; |
1299 | dev_kfree_skb_any(buffer->skb); | 1194 | dev_kfree_skb_any(buffer->skb); |
1300 | buffer->skb = NULL; | 1195 | buffer->skb = NULL; |
1301 | } else if (adapter->proc_cmd_buf_counter == 1) { | ||
1302 | adapter->stats.txnullskb++; | ||
1303 | } | ||
1304 | if (unlikely(netif_queue_stopped(adapter->netdev) | ||
1305 | && netif_carrier_ok(adapter->netdev)) | ||
1306 | && ((jiffies - adapter->netdev->trans_start) > | ||
1307 | adapter->netdev->watchdog_timeo)) { | ||
1308 | SCHEDULE_WORK(&adapter->tx_timeout_task); | ||
1309 | } | 1196 | } |
1310 | 1197 | ||
1311 | last_consumer = get_next_index(last_consumer, | 1198 | last_consumer = get_next_index(last_consumer, |
1312 | adapter->max_tx_desc_count); | 1199 | adapter->max_tx_desc_count); |
1313 | count1++; | 1200 | if (++count >= MAX_STATUS_HANDLE) |
1201 | break; | ||
1314 | } | 1202 | } |
1315 | 1203 | ||
1316 | count2 = 0; | 1204 | if (count) { |
1317 | spin_lock(&adapter->tx_lock); | ||
1318 | if ((--adapter->proc_cmd_buf_counter) == 0) { | ||
1319 | adapter->last_cmd_consumer = last_consumer; | 1205 | adapter->last_cmd_consumer = last_consumer; |
1320 | while ((adapter->last_cmd_consumer != consumer) | 1206 | smp_mb(); |
1321 | && (count2 < MAX_STATUS_HANDLE)) { | 1207 | if (netif_queue_stopped(netdev) && netif_running(netdev)) { |
1322 | buffer = | 1208 | netif_tx_lock(netdev); |
1323 | &adapter->cmd_buf_arr[adapter->last_cmd_consumer]; | 1209 | netif_wake_queue(netdev); |
1324 | count2++; | 1210 | smp_mb(); |
1325 | if (buffer->skb) | 1211 | netif_tx_unlock(netdev); |
1326 | break; | ||
1327 | else | ||
1328 | adapter->last_cmd_consumer = | ||
1329 | get_next_index(adapter->last_cmd_consumer, | ||
1330 | adapter->max_tx_desc_count); | ||
1331 | } | ||
1332 | } | ||
1333 | if (count1 || count2) { | ||
1334 | if (netif_queue_stopped(adapter->netdev) | ||
1335 | && (adapter->flags & NETXEN_NETDEV_STATUS)) { | ||
1336 | netif_wake_queue(adapter->netdev); | ||
1337 | adapter->flags &= ~NETXEN_NETDEV_STATUS; | ||
1338 | } | 1212 | } |
1339 | } | 1213 | } |
1340 | /* | 1214 | /* |
@@ -1350,16 +1224,9 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1350 | * There is still a possible race condition and the host could miss an | 1224 | * There is still a possible race condition and the host could miss an |
1351 | * interrupt. The card has to take care of this. | 1225 | * interrupt. The card has to take care of this. |
1352 | */ | 1226 | */ |
1353 | if (adapter->last_cmd_consumer == consumer && | 1227 | consumer = le32_to_cpu(*(adapter->cmd_consumer)); |
1354 | (((adapter->cmd_producer + 1) % | 1228 | done = (last_consumer == consumer); |
1355 | adapter->max_tx_desc_count) == adapter->last_cmd_consumer)) { | ||
1356 | consumer = le32_to_cpu(*(adapter->cmd_consumer)); | ||
1357 | } | ||
1358 | done = (adapter->last_cmd_consumer == consumer); | ||
1359 | 1229 | ||
1360 | spin_unlock(&adapter->tx_lock); | ||
1361 | DPRINTK(INFO, "last consumer is %d in %s\n", last_consumer, | ||
1362 | __FUNCTION__); | ||
1363 | return (done); | 1230 | return (done); |
1364 | } | 1231 | } |
1365 | 1232 | ||
@@ -1433,8 +1300,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1433 | rcv_desc->begin_alloc = index; | 1300 | rcv_desc->begin_alloc = index; |
1434 | rcv_desc->rcv_pending += count; | 1301 | rcv_desc->rcv_pending += count; |
1435 | rcv_desc->producer = producer; | 1302 | rcv_desc->producer = producer; |
1436 | if (rcv_desc->rcv_free >= 32) { | ||
1437 | rcv_desc->rcv_free = 0; | ||
1438 | /* Window = 1 */ | 1303 | /* Window = 1 */ |
1439 | writel((producer - 1) & | 1304 | writel((producer - 1) & |
1440 | (rcv_desc->max_rx_desc_count - 1), | 1305 | (rcv_desc->max_rx_desc_count - 1), |
@@ -1458,8 +1323,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1458 | writel(msg, | 1323 | writel(msg, |
1459 | DB_NORMALIZE(adapter, | 1324 | DB_NORMALIZE(adapter, |
1460 | NETXEN_RCV_PRODUCER_OFFSET)); | 1325 | NETXEN_RCV_PRODUCER_OFFSET)); |
1461 | wmb(); | ||
1462 | } | ||
1463 | } | 1326 | } |
1464 | } | 1327 | } |
1465 | 1328 | ||
@@ -1523,8 +1386,6 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1523 | rcv_desc->begin_alloc = index; | 1386 | rcv_desc->begin_alloc = index; |
1524 | rcv_desc->rcv_pending += count; | 1387 | rcv_desc->rcv_pending += count; |
1525 | rcv_desc->producer = producer; | 1388 | rcv_desc->producer = producer; |
1526 | if (rcv_desc->rcv_free >= 32) { | ||
1527 | rcv_desc->rcv_free = 0; | ||
1528 | /* Window = 1 */ | 1389 | /* Window = 1 */ |
1529 | writel((producer - 1) & | 1390 | writel((producer - 1) & |
1530 | (rcv_desc->max_rx_desc_count - 1), | 1391 | (rcv_desc->max_rx_desc_count - 1), |
@@ -1534,21 +1395,9 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1534 | rcv_desc_crb[ringid]. | 1395 | rcv_desc_crb[ringid]. |
1535 | crb_rcv_producer_offset)); | 1396 | crb_rcv_producer_offset)); |
1536 | wmb(); | 1397 | wmb(); |
1537 | } | ||
1538 | } | 1398 | } |
1539 | } | 1399 | } |
1540 | 1400 | ||
1541 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter) | ||
1542 | { | ||
1543 | if (find_diff_among(adapter->last_cmd_consumer, | ||
1544 | adapter->cmd_producer, | ||
1545 | adapter->max_tx_desc_count) > 0) | ||
1546 | return 1; | ||
1547 | |||
1548 | return 0; | ||
1549 | } | ||
1550 | |||
1551 | |||
1552 | void netxen_nic_clear_stats(struct netxen_adapter *adapter) | 1401 | void netxen_nic_clear_stats(struct netxen_adapter *adapter) |
1553 | { | 1402 | { |
1554 | memset(&adapter->stats, 0, sizeof(adapter->stats)); | 1403 | memset(&adapter->stats, 0, sizeof(adapter->stats)); |
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index 48a404aa66ce..c81313b717bd 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -59,7 +59,7 @@ struct net_device_stats *netxen_nic_get_stats(struct net_device *netdev) | |||
59 | /* packet transmit problems */ | 59 | /* packet transmit problems */ |
60 | stats->tx_errors = adapter->stats.nocmddescriptor; | 60 | stats->tx_errors = adapter->stats.nocmddescriptor; |
61 | /* no space in linux buffers */ | 61 | /* no space in linux buffers */ |
62 | stats->rx_dropped = adapter->stats.updropped; | 62 | stats->rx_dropped = adapter->stats.rxdropped; |
63 | /* no space available in linux */ | 63 | /* no space available in linux */ |
64 | stats->tx_dropped = adapter->stats.txdropped; | 64 | stats->tx_dropped = adapter->stats.txdropped; |
65 | 65 | ||
@@ -193,14 +193,14 @@ int netxen_nic_link_ok(struct netxen_adapter *adapter) | |||
193 | void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) | 193 | void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) |
194 | { | 194 | { |
195 | struct net_device *netdev = adapter->netdev; | 195 | struct net_device *netdev = adapter->netdev; |
196 | u32 val, val1; | 196 | u32 val; |
197 | 197 | ||
198 | /* WINDOW = 1 */ | 198 | /* WINDOW = 1 */ |
199 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); | 199 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); |
200 | val >>= (physical_port[adapter->portnum] * 8); | 200 | val >>= (physical_port[adapter->portnum] * 8); |
201 | val1 = val & 0xff; | 201 | val &= 0xff; |
202 | 202 | ||
203 | if (adapter->ahw.xg_linkup == 1 && val1 != XG_LINK_UP) { | 203 | if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) { |
204 | printk(KERN_INFO "%s: %s NIC Link is down\n", | 204 | printk(KERN_INFO "%s: %s NIC Link is down\n", |
205 | netxen_nic_driver_name, netdev->name); | 205 | netxen_nic_driver_name, netdev->name); |
206 | adapter->ahw.xg_linkup = 0; | 206 | adapter->ahw.xg_linkup = 0; |
@@ -208,16 +208,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) | |||
208 | netif_carrier_off(netdev); | 208 | netif_carrier_off(netdev); |
209 | netif_stop_queue(netdev); | 209 | netif_stop_queue(netdev); |
210 | } | 210 | } |
211 | /* read twice to clear sticky bits */ | 211 | } else if (adapter->ahw.xg_linkup == 0 && val == XG_LINK_UP) { |
212 | /* WINDOW = 0 */ | ||
213 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_STATUS, &val1); | ||
214 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_STATUS, &val1); | ||
215 | |||
216 | if ((val & 0xffb) != 0xffb) { | ||
217 | printk(KERN_INFO "%s ISR: Sync/Align BAD: 0x%08x\n", | ||
218 | netxen_nic_driver_name, val1); | ||
219 | } | ||
220 | } else if (adapter->ahw.xg_linkup == 0 && val1 == XG_LINK_UP) { | ||
221 | printk(KERN_INFO "%s: %s NIC Link is up\n", | 212 | printk(KERN_INFO "%s: %s NIC Link is up\n", |
222 | netxen_nic_driver_name, netdev->name); | 213 | netxen_nic_driver_name, netdev->name); |
223 | adapter->ahw.xg_linkup = 1; | 214 | adapter->ahw.xg_linkup = 1; |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 9737eae5ef11..a8fb439a4d03 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -63,12 +63,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); | |||
63 | static void netxen_tx_timeout(struct net_device *netdev); | 63 | static void netxen_tx_timeout(struct net_device *netdev); |
64 | static void netxen_tx_timeout_task(struct work_struct *work); | 64 | static void netxen_tx_timeout_task(struct work_struct *work); |
65 | static void netxen_watchdog(unsigned long); | 65 | static void netxen_watchdog(unsigned long); |
66 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); | ||
67 | static int netxen_nic_poll(struct napi_struct *napi, int budget); | 66 | static int netxen_nic_poll(struct napi_struct *napi, int budget); |
68 | #ifdef CONFIG_NET_POLL_CONTROLLER | 67 | #ifdef CONFIG_NET_POLL_CONTROLLER |
69 | static void netxen_nic_poll_controller(struct net_device *netdev); | 68 | static void netxen_nic_poll_controller(struct net_device *netdev); |
70 | #endif | 69 | #endif |
71 | static irqreturn_t netxen_intr(int irq, void *data); | 70 | static irqreturn_t netxen_intr(int irq, void *data); |
71 | static irqreturn_t netxen_msi_intr(int irq, void *data); | ||
72 | 72 | ||
73 | int physical_port[] = {0, 1, 2, 3}; | 73 | int physical_port[] = {0, 1, 2, 3}; |
74 | 74 | ||
@@ -149,33 +149,30 @@ static void netxen_nic_update_cmd_consumer(struct netxen_adapter *adapter, | |||
149 | 149 | ||
150 | #define ADAPTER_LIST_SIZE 12 | 150 | #define ADAPTER_LIST_SIZE 12 |
151 | 151 | ||
152 | static uint32_t msi_tgt_status[4] = { | ||
153 | ISR_INT_TARGET_STATUS, ISR_INT_TARGET_STATUS_F1, | ||
154 | ISR_INT_TARGET_STATUS_F2, ISR_INT_TARGET_STATUS_F3 | ||
155 | }; | ||
156 | |||
157 | static uint32_t sw_int_mask[4] = { | ||
158 | CRB_SW_INT_MASK_0, CRB_SW_INT_MASK_1, | ||
159 | CRB_SW_INT_MASK_2, CRB_SW_INT_MASK_3 | ||
160 | }; | ||
161 | |||
152 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) | 162 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) |
153 | { | 163 | { |
154 | uint32_t mask = 0x7ff; | 164 | u32 mask = 0x7ff; |
155 | int retries = 32; | 165 | int retries = 32; |
166 | int port = adapter->portnum; | ||
167 | int pci_fn = adapter->ahw.pci_func; | ||
156 | 168 | ||
157 | DPRINTK(1, INFO, "Entered ISR Disable \n"); | 169 | if (adapter->msi_mode != MSI_MODE_MULTIFUNC) |
158 | 170 | writel(0x0, NETXEN_CRB_NORMALIZE(adapter, sw_int_mask[port])); | |
159 | switch (adapter->portnum) { | ||
160 | case 0: | ||
161 | writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0)); | ||
162 | break; | ||
163 | case 1: | ||
164 | writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1)); | ||
165 | break; | ||
166 | case 2: | ||
167 | writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2)); | ||
168 | break; | ||
169 | case 3: | ||
170 | writel(0x0, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3)); | ||
171 | break; | ||
172 | } | ||
173 | 171 | ||
174 | if (adapter->intr_scheme != -1 && | 172 | if (adapter->intr_scheme != -1 && |
175 | adapter->intr_scheme != INTR_SCHEME_PERPORT) | 173 | adapter->intr_scheme != INTR_SCHEME_PERPORT) |
176 | writel(mask,PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); | 174 | writel(mask,PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); |
177 | 175 | ||
178 | /* Window = 0 or 1 */ | ||
179 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 176 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { |
180 | do { | 177 | do { |
181 | writel(0xffffffff, | 178 | writel(0xffffffff, |
@@ -190,14 +187,18 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter) | |||
190 | printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n", | 187 | printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n", |
191 | netxen_nic_driver_name); | 188 | netxen_nic_driver_name); |
192 | } | 189 | } |
190 | } else { | ||
191 | if (adapter->msi_mode == MSI_MODE_MULTIFUNC) { | ||
192 | writel(0xffffffff, PCI_OFFSET_SECOND_RANGE(adapter, | ||
193 | msi_tgt_status[pci_fn])); | ||
194 | } | ||
193 | } | 195 | } |
194 | |||
195 | DPRINTK(1, INFO, "Done with Disable Int\n"); | ||
196 | } | 196 | } |
197 | 197 | ||
198 | static void netxen_nic_enable_int(struct netxen_adapter *adapter) | 198 | static void netxen_nic_enable_int(struct netxen_adapter *adapter) |
199 | { | 199 | { |
200 | u32 mask; | 200 | u32 mask; |
201 | int port = adapter->portnum; | ||
201 | 202 | ||
202 | DPRINTK(1, INFO, "Entered ISR Enable \n"); | 203 | DPRINTK(1, INFO, "Entered ISR Enable \n"); |
203 | 204 | ||
@@ -218,20 +219,7 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
218 | writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); | 219 | writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); |
219 | } | 220 | } |
220 | 221 | ||
221 | switch (adapter->portnum) { | 222 | writel(0x1, NETXEN_CRB_NORMALIZE(adapter, sw_int_mask[port])); |
222 | case 0: | ||
223 | writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_0)); | ||
224 | break; | ||
225 | case 1: | ||
226 | writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_1)); | ||
227 | break; | ||
228 | case 2: | ||
229 | writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_2)); | ||
230 | break; | ||
231 | case 3: | ||
232 | writel(0x1, NETXEN_CRB_NORMALIZE(adapter, CRB_SW_INT_MASK_3)); | ||
233 | break; | ||
234 | } | ||
235 | 223 | ||
236 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 224 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { |
237 | mask = 0xbff; | 225 | mask = 0xbff; |
@@ -328,7 +316,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
328 | 316 | ||
329 | adapter->ahw.pdev = pdev; | 317 | adapter->ahw.pdev = pdev; |
330 | adapter->ahw.pci_func = pci_func_id; | 318 | adapter->ahw.pci_func = pci_func_id; |
331 | spin_lock_init(&adapter->tx_lock); | ||
332 | 319 | ||
333 | /* remap phys address */ | 320 | /* remap phys address */ |
334 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ | 321 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ |
@@ -401,6 +388,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
401 | 388 | ||
402 | /* this will be read from FW later */ | 389 | /* this will be read from FW later */ |
403 | adapter->intr_scheme = -1; | 390 | adapter->intr_scheme = -1; |
391 | adapter->msi_mode = -1; | ||
404 | 392 | ||
405 | /* This will be reset for mezz cards */ | 393 | /* This will be reset for mezz cards */ |
406 | adapter->portnum = pci_func_id; | 394 | adapter->portnum = pci_func_id; |
@@ -415,7 +403,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
415 | netdev->set_mac_address = netxen_nic_set_mac; | 403 | netdev->set_mac_address = netxen_nic_set_mac; |
416 | netdev->change_mtu = netxen_nic_change_mtu; | 404 | netdev->change_mtu = netxen_nic_change_mtu; |
417 | netdev->tx_timeout = netxen_tx_timeout; | 405 | netdev->tx_timeout = netxen_tx_timeout; |
418 | netdev->watchdog_timeo = HZ; | 406 | netdev->watchdog_timeo = 2*HZ; |
419 | 407 | ||
420 | netxen_nic_change_mtu(netdev, netdev->mtu); | 408 | netxen_nic_change_mtu(netdev, netdev->mtu); |
421 | 409 | ||
@@ -543,7 +531,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
543 | adapter->watchdog_timer.data = (unsigned long)adapter; | 531 | adapter->watchdog_timer.data = (unsigned long)adapter; |
544 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); | 532 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); |
545 | adapter->ahw.pdev = pdev; | 533 | adapter->ahw.pdev = pdev; |
546 | adapter->proc_cmd_buf_counter = 0; | ||
547 | adapter->ahw.revision_id = pdev->revision; | 534 | adapter->ahw.revision_id = pdev->revision; |
548 | 535 | ||
549 | /* make sure Window == 1 */ | 536 | /* make sure Window == 1 */ |
@@ -833,6 +820,8 @@ static int netxen_nic_open(struct net_device *netdev) | |||
833 | struct netxen_adapter *adapter = (struct netxen_adapter *)netdev->priv; | 820 | struct netxen_adapter *adapter = (struct netxen_adapter *)netdev->priv; |
834 | int err = 0; | 821 | int err = 0; |
835 | int ctx, ring; | 822 | int ctx, ring; |
823 | irq_handler_t handler; | ||
824 | unsigned long flags = IRQF_SAMPLE_RANDOM; | ||
836 | 825 | ||
837 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { | 826 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { |
838 | err = netxen_init_firmware(adapter); | 827 | err = netxen_init_firmware(adapter); |
@@ -856,9 +845,14 @@ static int netxen_nic_open(struct net_device *netdev) | |||
856 | netxen_post_rx_buffers(adapter, ctx, ring); | 845 | netxen_post_rx_buffers(adapter, ctx, ring); |
857 | } | 846 | } |
858 | adapter->irq = adapter->ahw.pdev->irq; | 847 | adapter->irq = adapter->ahw.pdev->irq; |
859 | err = request_irq(adapter->ahw.pdev->irq, netxen_intr, | 848 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) |
860 | IRQF_SHARED|IRQF_SAMPLE_RANDOM, netdev->name, | 849 | handler = netxen_msi_intr; |
861 | adapter); | 850 | else { |
851 | flags |= IRQF_SHARED; | ||
852 | handler = netxen_intr; | ||
853 | } | ||
854 | err = request_irq(adapter->irq, handler, | ||
855 | flags, netdev->name, adapter); | ||
862 | if (err) { | 856 | if (err) { |
863 | printk(KERN_ERR "request_irq failed with: %d\n", err); | 857 | printk(KERN_ERR "request_irq failed with: %d\n", err); |
864 | netxen_free_hw_resources(adapter); | 858 | netxen_free_hw_resources(adapter); |
@@ -867,21 +861,12 @@ static int netxen_nic_open(struct net_device *netdev) | |||
867 | 861 | ||
868 | adapter->is_up = NETXEN_ADAPTER_UP_MAGIC; | 862 | adapter->is_up = NETXEN_ADAPTER_UP_MAGIC; |
869 | } | 863 | } |
870 | if (!adapter->driver_mismatch) | ||
871 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
872 | |||
873 | napi_enable(&adapter->napi); | ||
874 | |||
875 | netxen_nic_enable_int(adapter); | ||
876 | |||
877 | /* Done here again so that even if phantom sw overwrote it, | 864 | /* Done here again so that even if phantom sw overwrote it, |
878 | * we set it */ | 865 | * we set it */ |
879 | if (adapter->init_port | 866 | if (adapter->init_port |
880 | && adapter->init_port(adapter, adapter->portnum) != 0) { | 867 | && adapter->init_port(adapter, adapter->portnum) != 0) { |
881 | del_timer_sync(&adapter->watchdog_timer); | ||
882 | printk(KERN_ERR "%s: Failed to initialize port %d\n", | 868 | printk(KERN_ERR "%s: Failed to initialize port %d\n", |
883 | netxen_nic_driver_name, adapter->portnum); | 869 | netxen_nic_driver_name, adapter->portnum); |
884 | napi_disable(&adapter->napi); | ||
885 | return -EIO; | 870 | return -EIO; |
886 | } | 871 | } |
887 | if (adapter->macaddr_set) | 872 | if (adapter->macaddr_set) |
@@ -894,6 +879,12 @@ static int netxen_nic_open(struct net_device *netdev) | |||
894 | adapter->set_mtu(adapter, netdev->mtu); | 879 | adapter->set_mtu(adapter, netdev->mtu); |
895 | 880 | ||
896 | if (!adapter->driver_mismatch) | 881 | if (!adapter->driver_mismatch) |
882 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
883 | |||
884 | napi_enable(&adapter->napi); | ||
885 | netxen_nic_enable_int(adapter); | ||
886 | |||
887 | if (!adapter->driver_mismatch) | ||
897 | netif_start_queue(netdev); | 888 | netif_start_queue(netdev); |
898 | 889 | ||
899 | return 0; | 890 | return 0; |
@@ -958,41 +949,17 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
958 | struct netxen_skb_frag *buffrag; | 949 | struct netxen_skb_frag *buffrag; |
959 | unsigned int i; | 950 | unsigned int i; |
960 | 951 | ||
961 | u32 producer = 0; | 952 | u32 producer, consumer; |
962 | u32 saved_producer = 0; | 953 | u32 saved_producer = 0; |
963 | struct cmd_desc_type0 *hwdesc; | 954 | struct cmd_desc_type0 *hwdesc; |
964 | int k; | 955 | int k; |
965 | struct netxen_cmd_buffer *pbuf = NULL; | 956 | struct netxen_cmd_buffer *pbuf = NULL; |
966 | static int dropped_packet = 0; | ||
967 | int frag_count; | 957 | int frag_count; |
968 | u32 local_producer = 0; | ||
969 | u32 max_tx_desc_count = 0; | ||
970 | u32 last_cmd_consumer = 0; | ||
971 | int no_of_desc; | 958 | int no_of_desc; |
959 | u32 num_txd = adapter->max_tx_desc_count; | ||
972 | 960 | ||
973 | adapter->stats.xmitcalled++; | ||
974 | frag_count = skb_shinfo(skb)->nr_frags + 1; | 961 | frag_count = skb_shinfo(skb)->nr_frags + 1; |
975 | 962 | ||
976 | if (unlikely(skb->len <= 0)) { | ||
977 | dev_kfree_skb_any(skb); | ||
978 | adapter->stats.badskblen++; | ||
979 | return NETDEV_TX_OK; | ||
980 | } | ||
981 | |||
982 | if (frag_count > MAX_BUFFERS_PER_CMD) { | ||
983 | printk("%s: %s netxen_nic_xmit_frame: frag_count (%d) " | ||
984 | "too large, can handle only %d frags\n", | ||
985 | netxen_nic_driver_name, netdev->name, | ||
986 | frag_count, MAX_BUFFERS_PER_CMD); | ||
987 | adapter->stats.txdropped++; | ||
988 | if ((++dropped_packet & 0xff) == 0xff) | ||
989 | printk("%s: %s droppped packets = %d\n", | ||
990 | netxen_nic_driver_name, netdev->name, | ||
991 | dropped_packet); | ||
992 | |||
993 | return NETDEV_TX_OK; | ||
994 | } | ||
995 | |||
996 | /* There 4 fragments per descriptor */ | 963 | /* There 4 fragments per descriptor */ |
997 | no_of_desc = (frag_count + 3) >> 2; | 964 | no_of_desc = (frag_count + 3) >> 2; |
998 | if (netdev->features & NETIF_F_TSO) { | 965 | if (netdev->features & NETIF_F_TSO) { |
@@ -1007,27 +974,16 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1007 | } | 974 | } |
1008 | } | 975 | } |
1009 | 976 | ||
1010 | spin_lock_bh(&adapter->tx_lock); | 977 | producer = adapter->cmd_producer; |
1011 | if (adapter->total_threads >= MAX_XMIT_PRODUCERS) { | 978 | smp_mb(); |
1012 | goto out_requeue; | 979 | consumer = adapter->last_cmd_consumer; |
1013 | } | 980 | if ((no_of_desc+2) > find_diff_among(producer, consumer, num_txd)) { |
1014 | local_producer = adapter->cmd_producer; | 981 | netif_stop_queue(netdev); |
1015 | k = adapter->cmd_producer; | 982 | smp_mb(); |
1016 | max_tx_desc_count = adapter->max_tx_desc_count; | 983 | return NETDEV_TX_BUSY; |
1017 | last_cmd_consumer = adapter->last_cmd_consumer; | ||
1018 | if ((k + no_of_desc) >= | ||
1019 | ((last_cmd_consumer <= k) ? last_cmd_consumer + max_tx_desc_count : | ||
1020 | last_cmd_consumer)) { | ||
1021 | goto out_requeue; | ||
1022 | } | 984 | } |
1023 | k = get_index_range(k, max_tx_desc_count, no_of_desc); | ||
1024 | adapter->cmd_producer = k; | ||
1025 | adapter->total_threads++; | ||
1026 | adapter->num_threads++; | ||
1027 | 985 | ||
1028 | spin_unlock_bh(&adapter->tx_lock); | ||
1029 | /* Copy the descriptors into the hardware */ | 986 | /* Copy the descriptors into the hardware */ |
1030 | producer = local_producer; | ||
1031 | saved_producer = producer; | 987 | saved_producer = producer; |
1032 | hwdesc = &hw->cmd_desc_head[producer]; | 988 | hwdesc = &hw->cmd_desc_head[producer]; |
1033 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); | 989 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); |
@@ -1067,8 +1023,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1067 | /* move to next desc. if there is a need */ | 1023 | /* move to next desc. if there is a need */ |
1068 | if ((i & 0x3) == 0) { | 1024 | if ((i & 0x3) == 0) { |
1069 | k = 0; | 1025 | k = 0; |
1070 | producer = get_next_index(producer, | 1026 | producer = get_next_index(producer, num_txd); |
1071 | adapter->max_tx_desc_count); | ||
1072 | hwdesc = &hw->cmd_desc_head[producer]; | 1027 | hwdesc = &hw->cmd_desc_head[producer]; |
1073 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); | 1028 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); |
1074 | pbuf = &adapter->cmd_buf_arr[producer]; | 1029 | pbuf = &adapter->cmd_buf_arr[producer]; |
@@ -1086,7 +1041,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1086 | buffrag->dma = temp_dma; | 1041 | buffrag->dma = temp_dma; |
1087 | buffrag->length = temp_len; | 1042 | buffrag->length = temp_len; |
1088 | 1043 | ||
1089 | DPRINTK(INFO, "for loop. i=%d k=%d\n", i, k); | ||
1090 | switch (k) { | 1044 | switch (k) { |
1091 | case 0: | 1045 | case 0: |
1092 | hwdesc->buffer1_length = cpu_to_le16(temp_len); | 1046 | hwdesc->buffer1_length = cpu_to_le16(temp_len); |
@@ -1107,7 +1061,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1107 | } | 1061 | } |
1108 | frag++; | 1062 | frag++; |
1109 | } | 1063 | } |
1110 | producer = get_next_index(producer, adapter->max_tx_desc_count); | 1064 | producer = get_next_index(producer, num_txd); |
1111 | 1065 | ||
1112 | /* might change opcode to TX_TCP_LSO */ | 1066 | /* might change opcode to TX_TCP_LSO */ |
1113 | netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb); | 1067 | netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb); |
@@ -1134,7 +1088,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1134 | /* copy the first 64 bytes */ | 1088 | /* copy the first 64 bytes */ |
1135 | memcpy(((void *)hwdesc) + 2, | 1089 | memcpy(((void *)hwdesc) + 2, |
1136 | (void *)(skb->data), first_hdr_len); | 1090 | (void *)(skb->data), first_hdr_len); |
1137 | producer = get_next_index(producer, max_tx_desc_count); | 1091 | producer = get_next_index(producer, num_txd); |
1138 | 1092 | ||
1139 | if (more_hdr) { | 1093 | if (more_hdr) { |
1140 | hwdesc = &hw->cmd_desc_head[producer]; | 1094 | hwdesc = &hw->cmd_desc_head[producer]; |
@@ -1147,35 +1101,19 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1147 | hwdesc, | 1101 | hwdesc, |
1148 | (hdr_len - | 1102 | (hdr_len - |
1149 | first_hdr_len)); | 1103 | first_hdr_len)); |
1150 | producer = get_next_index(producer, max_tx_desc_count); | 1104 | producer = get_next_index(producer, num_txd); |
1151 | } | 1105 | } |
1152 | } | 1106 | } |
1153 | 1107 | ||
1154 | spin_lock_bh(&adapter->tx_lock); | 1108 | adapter->cmd_producer = producer; |
1155 | adapter->stats.txbytes += skb->len; | 1109 | adapter->stats.txbytes += skb->len; |
1156 | 1110 | ||
1157 | /* Code to update the adapter considering how many producer threads | 1111 | netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer); |
1158 | are currently working */ | ||
1159 | if ((--adapter->num_threads) == 0) { | ||
1160 | /* This is the last thread */ | ||
1161 | u32 crb_producer = adapter->cmd_producer; | ||
1162 | netxen_nic_update_cmd_producer(adapter, crb_producer); | ||
1163 | wmb(); | ||
1164 | adapter->total_threads = 0; | ||
1165 | } | ||
1166 | 1112 | ||
1167 | adapter->stats.xmitfinished++; | 1113 | adapter->stats.xmitcalled++; |
1168 | netdev->trans_start = jiffies; | 1114 | netdev->trans_start = jiffies; |
1169 | 1115 | ||
1170 | spin_unlock_bh(&adapter->tx_lock); | ||
1171 | return NETDEV_TX_OK; | 1116 | return NETDEV_TX_OK; |
1172 | |||
1173 | out_requeue: | ||
1174 | netif_stop_queue(netdev); | ||
1175 | adapter->flags |= NETXEN_NETDEV_STATUS; | ||
1176 | |||
1177 | spin_unlock_bh(&adapter->tx_lock); | ||
1178 | return NETDEV_TX_BUSY; | ||
1179 | } | 1117 | } |
1180 | 1118 | ||
1181 | static void netxen_watchdog(unsigned long v) | 1119 | static void netxen_watchdog(unsigned long v) |
@@ -1200,87 +1138,60 @@ static void netxen_tx_timeout_task(struct work_struct *work) | |||
1200 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", | 1138 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", |
1201 | netxen_nic_driver_name, adapter->netdev->name); | 1139 | netxen_nic_driver_name, adapter->netdev->name); |
1202 | 1140 | ||
1203 | netxen_nic_close(adapter->netdev); | 1141 | netxen_nic_disable_int(adapter); |
1204 | netxen_nic_open(adapter->netdev); | 1142 | napi_disable(&adapter->napi); |
1143 | |||
1205 | adapter->netdev->trans_start = jiffies; | 1144 | adapter->netdev->trans_start = jiffies; |
1145 | |||
1146 | napi_enable(&adapter->napi); | ||
1147 | netxen_nic_enable_int(adapter); | ||
1206 | netif_wake_queue(adapter->netdev); | 1148 | netif_wake_queue(adapter->netdev); |
1207 | } | 1149 | } |
1208 | 1150 | ||
1209 | static int | 1151 | static inline void |
1210 | netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) | 1152 | netxen_handle_int(struct netxen_adapter *adapter) |
1211 | { | 1153 | { |
1212 | u32 ret = 0; | ||
1213 | |||
1214 | DPRINTK(INFO, "Entered handle ISR\n"); | ||
1215 | adapter->stats.ints++; | ||
1216 | |||
1217 | netxen_nic_disable_int(adapter); | 1154 | netxen_nic_disable_int(adapter); |
1218 | 1155 | napi_schedule(&adapter->napi); | |
1219 | if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { | ||
1220 | if (netif_rx_schedule_prep(netdev, &adapter->napi)) { | ||
1221 | /* | ||
1222 | * Interrupts are already disabled. | ||
1223 | */ | ||
1224 | __netif_rx_schedule(netdev, &adapter->napi); | ||
1225 | } else { | ||
1226 | static unsigned int intcount = 0; | ||
1227 | if ((++intcount & 0xfff) == 0xfff) | ||
1228 | DPRINTK(KERN_ERR | ||
1229 | "%s: %s interrupt %d while in poll\n", | ||
1230 | netxen_nic_driver_name, netdev->name, | ||
1231 | intcount); | ||
1232 | } | ||
1233 | ret = 1; | ||
1234 | } | ||
1235 | |||
1236 | if (ret == 0) { | ||
1237 | netxen_nic_enable_int(adapter); | ||
1238 | } | ||
1239 | |||
1240 | return ret; | ||
1241 | } | 1156 | } |
1242 | 1157 | ||
1243 | /* | ||
1244 | * netxen_intr - Interrupt Handler | ||
1245 | * @irq: interrupt number | ||
1246 | * data points to adapter stucture (which may be handling more than 1 port | ||
1247 | */ | ||
1248 | irqreturn_t netxen_intr(int irq, void *data) | 1158 | irqreturn_t netxen_intr(int irq, void *data) |
1249 | { | 1159 | { |
1250 | struct netxen_adapter *adapter = data; | 1160 | struct netxen_adapter *adapter = data; |
1251 | struct net_device *netdev = adapter->netdev; | ||
1252 | u32 our_int = 0; | 1161 | u32 our_int = 0; |
1253 | 1162 | ||
1254 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 1163 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); |
1255 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | 1164 | /* not our interrupt */ |
1256 | /* not our interrupt */ | 1165 | if ((our_int & (0x80 << adapter->portnum)) == 0) |
1257 | if ((our_int & (0x80 << adapter->portnum)) == 0) | 1166 | return IRQ_NONE; |
1258 | return IRQ_NONE; | ||
1259 | } | ||
1260 | 1167 | ||
1261 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | 1168 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { |
1262 | /* claim interrupt */ | 1169 | /* claim interrupt */ |
1263 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 1170 | writel(our_int & ~((u32)(0x80 << adapter->portnum)), |
1264 | writel(our_int & ~((u32)(0x80 << adapter->portnum)), | ||
1265 | NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | 1171 | NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); |
1266 | } | ||
1267 | } | 1172 | } |
1268 | 1173 | ||
1269 | if (netif_running(netdev)) | 1174 | netxen_handle_int(adapter); |
1270 | netxen_handle_int(adapter, netdev); | ||
1271 | 1175 | ||
1272 | return IRQ_HANDLED; | 1176 | return IRQ_HANDLED; |
1273 | } | 1177 | } |
1274 | 1178 | ||
1179 | irqreturn_t netxen_msi_intr(int irq, void *data) | ||
1180 | { | ||
1181 | struct netxen_adapter *adapter = data; | ||
1182 | |||
1183 | netxen_handle_int(adapter); | ||
1184 | return IRQ_HANDLED; | ||
1185 | } | ||
1186 | |||
1275 | static int netxen_nic_poll(struct napi_struct *napi, int budget) | 1187 | static int netxen_nic_poll(struct napi_struct *napi, int budget) |
1276 | { | 1188 | { |
1277 | struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi); | 1189 | struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi); |
1278 | struct net_device *netdev = adapter->netdev; | 1190 | int tx_complete; |
1279 | int done = 1; | ||
1280 | int ctx; | 1191 | int ctx; |
1281 | int work_done; | 1192 | int work_done; |
1282 | 1193 | ||
1283 | DPRINTK(INFO, "polling for %d descriptors\n", *budget); | 1194 | tx_complete = netxen_process_cmd_ring(adapter); |
1284 | 1195 | ||
1285 | work_done = 0; | 1196 | work_done = 0; |
1286 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 1197 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { |
@@ -1300,16 +1211,8 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget) | |||
1300 | budget / MAX_RCV_CTX); | 1211 | budget / MAX_RCV_CTX); |
1301 | } | 1212 | } |
1302 | 1213 | ||
1303 | if (work_done >= budget) | 1214 | if ((work_done < budget) && tx_complete) { |
1304 | done = 0; | 1215 | netif_rx_complete(adapter->netdev, &adapter->napi); |
1305 | |||
1306 | if (netxen_process_cmd_ring((unsigned long)adapter) == 0) | ||
1307 | done = 0; | ||
1308 | |||
1309 | DPRINTK(INFO, "new work_done: %d work_to_do: %d\n", | ||
1310 | work_done, work_to_do); | ||
1311 | if (done) { | ||
1312 | netif_rx_complete(netdev, napi); | ||
1313 | netxen_nic_enable_int(adapter); | 1216 | netxen_nic_enable_int(adapter); |
1314 | } | 1217 | } |
1315 | 1218 | ||
diff --git a/drivers/net/netxen/netxen_nic_phan_reg.h b/drivers/net/netxen/netxen_nic_phan_reg.h index ffa3b7215ce8..a566b50f36f5 100644 --- a/drivers/net/netxen/netxen_nic_phan_reg.h +++ b/drivers/net/netxen/netxen_nic_phan_reg.h | |||
@@ -126,8 +126,11 @@ | |||
126 | */ | 126 | */ |
127 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) | 127 | #define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) |
128 | #define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc) | 128 | #define CRB_NIC_CAPABILITIES_FW NETXEN_NIC_REG(0x1dc) |
129 | #define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) | ||
130 | #define CRB_NIC_MSI_MODE_FW NETXEN_NIC_REG(0x274) | ||
129 | 131 | ||
130 | #define INTR_SCHEME_PERPORT 0x1 | 132 | #define INTR_SCHEME_PERPORT 0x1 |
133 | #define MSI_MODE_MULTIFUNC 0x1 | ||
131 | 134 | ||
132 | /* used for ethtool tests */ | 135 | /* used for ethtool tests */ |
133 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) | 136 | #define CRB_SCRATCHPAD_TEST NETXEN_NIC_REG(0x280) |
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index f0574073a2a3..32a8503a7acd 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
@@ -58,9 +58,25 @@ | |||
58 | #define MII_M1111_RX_DELAY 0x80 | 58 | #define MII_M1111_RX_DELAY 0x80 |
59 | #define MII_M1111_TX_DELAY 0x2 | 59 | #define MII_M1111_TX_DELAY 0x2 |
60 | #define MII_M1111_PHY_EXT_SR 0x1b | 60 | #define MII_M1111_PHY_EXT_SR 0x1b |
61 | #define MII_M1111_HWCFG_MODE_MASK 0xf | 61 | |
62 | #define MII_M1111_HWCFG_MODE_RGMII 0xb | 62 | #define MII_M1111_HWCFG_MODE_MASK 0xf |
63 | #define MII_M1111_HWCFG_MODE_COPPER_RGMII 0xb | ||
64 | #define MII_M1111_HWCFG_MODE_FIBER_RGMII 0x3 | ||
63 | #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4 | 65 | #define MII_M1111_HWCFG_MODE_SGMII_NO_CLK 0x4 |
66 | #define MII_M1111_HWCFG_FIBER_COPPER_AUTO 0x8000 | ||
67 | #define MII_M1111_HWCFG_FIBER_COPPER_RES 0x2000 | ||
68 | |||
69 | #define MII_M1111_COPPER 0 | ||
70 | #define MII_M1111_FIBER 1 | ||
71 | |||
72 | #define MII_M1011_PHY_STATUS 0x11 | ||
73 | #define MII_M1011_PHY_STATUS_1000 0x8000 | ||
74 | #define MII_M1011_PHY_STATUS_100 0x4000 | ||
75 | #define MII_M1011_PHY_STATUS_SPD_MASK 0xc000 | ||
76 | #define MII_M1011_PHY_STATUS_FULLDUPLEX 0x2000 | ||
77 | #define MII_M1011_PHY_STATUS_RESOLVED 0x0800 | ||
78 | #define MII_M1011_PHY_STATUS_LINK 0x0400 | ||
79 | |||
64 | 80 | ||
65 | MODULE_DESCRIPTION("Marvell PHY driver"); | 81 | MODULE_DESCRIPTION("Marvell PHY driver"); |
66 | MODULE_AUTHOR("Andy Fleming"); | 82 | MODULE_AUTHOR("Andy Fleming"); |
@@ -141,12 +157,22 @@ static int marvell_config_aneg(struct phy_device *phydev) | |||
141 | static int m88e1111_config_init(struct phy_device *phydev) | 157 | static int m88e1111_config_init(struct phy_device *phydev) |
142 | { | 158 | { |
143 | int err; | 159 | int err; |
160 | int temp; | ||
161 | int mode; | ||
162 | |||
163 | /* Enable Fiber/Copper auto selection */ | ||
164 | temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); | ||
165 | temp |= MII_M1111_HWCFG_FIBER_COPPER_AUTO; | ||
166 | phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); | ||
167 | |||
168 | temp = phy_read(phydev, MII_BMCR); | ||
169 | temp |= BMCR_RESET; | ||
170 | phy_write(phydev, MII_BMCR, temp); | ||
144 | 171 | ||
145 | if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || | 172 | if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || |
146 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) || | 173 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) || |
147 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) || | 174 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) || |
148 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) { | 175 | (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) { |
149 | int temp; | ||
150 | 176 | ||
151 | temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); | 177 | temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); |
152 | if (temp < 0) | 178 | if (temp < 0) |
@@ -171,7 +197,13 @@ static int m88e1111_config_init(struct phy_device *phydev) | |||
171 | return temp; | 197 | return temp; |
172 | 198 | ||
173 | temp &= ~(MII_M1111_HWCFG_MODE_MASK); | 199 | temp &= ~(MII_M1111_HWCFG_MODE_MASK); |
174 | temp |= MII_M1111_HWCFG_MODE_RGMII; | 200 | |
201 | mode = phy_read(phydev, MII_M1111_PHY_EXT_CR); | ||
202 | |||
203 | if (mode & MII_M1111_HWCFG_FIBER_COPPER_RES) | ||
204 | temp |= MII_M1111_HWCFG_MODE_FIBER_RGMII; | ||
205 | else | ||
206 | temp |= MII_M1111_HWCFG_MODE_COPPER_RGMII; | ||
175 | 207 | ||
176 | err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); | 208 | err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); |
177 | if (err < 0) | 209 | if (err < 0) |
@@ -179,8 +211,6 @@ static int m88e1111_config_init(struct phy_device *phydev) | |||
179 | } | 211 | } |
180 | 212 | ||
181 | if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { | 213 | if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { |
182 | int temp; | ||
183 | |||
184 | temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); | 214 | temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); |
185 | if (temp < 0) | 215 | if (temp < 0) |
186 | return temp; | 216 | return temp; |
@@ -262,6 +292,93 @@ static int m88e1145_config_init(struct phy_device *phydev) | |||
262 | return 0; | 292 | return 0; |
263 | } | 293 | } |
264 | 294 | ||
295 | /* marvell_read_status | ||
296 | * | ||
297 | * Generic status code does not detect Fiber correctly! | ||
298 | * Description: | ||
299 | * Check the link, then figure out the current state | ||
300 | * by comparing what we advertise with what the link partner | ||
301 | * advertises. Start by checking the gigabit possibilities, | ||
302 | * then move on to 10/100. | ||
303 | */ | ||
304 | static int marvell_read_status(struct phy_device *phydev) | ||
305 | { | ||
306 | int adv; | ||
307 | int err; | ||
308 | int lpa; | ||
309 | int status = 0; | ||
310 | |||
311 | /* Update the link, but return if there | ||
312 | * was an error */ | ||
313 | err = genphy_update_link(phydev); | ||
314 | if (err) | ||
315 | return err; | ||
316 | |||
317 | if (AUTONEG_ENABLE == phydev->autoneg) { | ||
318 | status = phy_read(phydev, MII_M1011_PHY_STATUS); | ||
319 | if (status < 0) | ||
320 | return status; | ||
321 | |||
322 | lpa = phy_read(phydev, MII_LPA); | ||
323 | if (lpa < 0) | ||
324 | return lpa; | ||
325 | |||
326 | adv = phy_read(phydev, MII_ADVERTISE); | ||
327 | if (adv < 0) | ||
328 | return adv; | ||
329 | |||
330 | lpa &= adv; | ||
331 | |||
332 | if (status & MII_M1011_PHY_STATUS_FULLDUPLEX) | ||
333 | phydev->duplex = DUPLEX_FULL; | ||
334 | else | ||
335 | phydev->duplex = DUPLEX_HALF; | ||
336 | |||
337 | status = status & MII_M1011_PHY_STATUS_SPD_MASK; | ||
338 | phydev->pause = phydev->asym_pause = 0; | ||
339 | |||
340 | switch (status) { | ||
341 | case MII_M1011_PHY_STATUS_1000: | ||
342 | phydev->speed = SPEED_1000; | ||
343 | break; | ||
344 | |||
345 | case MII_M1011_PHY_STATUS_100: | ||
346 | phydev->speed = SPEED_100; | ||
347 | break; | ||
348 | |||
349 | default: | ||
350 | phydev->speed = SPEED_10; | ||
351 | break; | ||
352 | } | ||
353 | |||
354 | if (phydev->duplex == DUPLEX_FULL) { | ||
355 | phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0; | ||
356 | phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0; | ||
357 | } | ||
358 | } else { | ||
359 | int bmcr = phy_read(phydev, MII_BMCR); | ||
360 | |||
361 | if (bmcr < 0) | ||
362 | return bmcr; | ||
363 | |||
364 | if (bmcr & BMCR_FULLDPLX) | ||
365 | phydev->duplex = DUPLEX_FULL; | ||
366 | else | ||
367 | phydev->duplex = DUPLEX_HALF; | ||
368 | |||
369 | if (bmcr & BMCR_SPEED1000) | ||
370 | phydev->speed = SPEED_1000; | ||
371 | else if (bmcr & BMCR_SPEED100) | ||
372 | phydev->speed = SPEED_100; | ||
373 | else | ||
374 | phydev->speed = SPEED_10; | ||
375 | |||
376 | phydev->pause = phydev->asym_pause = 0; | ||
377 | } | ||
378 | |||
379 | return 0; | ||
380 | } | ||
381 | |||
265 | static struct phy_driver marvell_drivers[] = { | 382 | static struct phy_driver marvell_drivers[] = { |
266 | { | 383 | { |
267 | .phy_id = 0x01410c60, | 384 | .phy_id = 0x01410c60, |
@@ -296,7 +413,7 @@ static struct phy_driver marvell_drivers[] = { | |||
296 | .flags = PHY_HAS_INTERRUPT, | 413 | .flags = PHY_HAS_INTERRUPT, |
297 | .config_init = &m88e1111_config_init, | 414 | .config_init = &m88e1111_config_init, |
298 | .config_aneg = &marvell_config_aneg, | 415 | .config_aneg = &marvell_config_aneg, |
299 | .read_status = &genphy_read_status, | 416 | .read_status = &marvell_read_status, |
300 | .ack_interrupt = &marvell_ack_interrupt, | 417 | .ack_interrupt = &marvell_ack_interrupt, |
301 | .config_intr = &marvell_config_intr, | 418 | .config_intr = &marvell_config_intr, |
302 | .driver = { .owner = THIS_MODULE }, | 419 | .driver = { .owner = THIS_MODULE }, |
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index fee3d7b1feba..1e965427b0e9 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -903,17 +903,18 @@ plip_interrupt(void *dev_id) | |||
903 | struct net_local *nl; | 903 | struct net_local *nl; |
904 | struct plip_local *rcv; | 904 | struct plip_local *rcv; |
905 | unsigned char c0; | 905 | unsigned char c0; |
906 | unsigned long flags; | ||
906 | 907 | ||
907 | nl = netdev_priv(dev); | 908 | nl = netdev_priv(dev); |
908 | rcv = &nl->rcv_data; | 909 | rcv = &nl->rcv_data; |
909 | 910 | ||
910 | spin_lock_irq (&nl->lock); | 911 | spin_lock_irqsave (&nl->lock, flags); |
911 | 912 | ||
912 | c0 = read_status(dev); | 913 | c0 = read_status(dev); |
913 | if ((c0 & 0xf8) != 0xc0) { | 914 | if ((c0 & 0xf8) != 0xc0) { |
914 | if ((dev->irq != -1) && (net_debug > 1)) | 915 | if ((dev->irq != -1) && (net_debug > 1)) |
915 | printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); | 916 | printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); |
916 | spin_unlock_irq (&nl->lock); | 917 | spin_unlock_irqrestore (&nl->lock, flags); |
917 | return; | 918 | return; |
918 | } | 919 | } |
919 | 920 | ||
@@ -942,7 +943,7 @@ plip_interrupt(void *dev_id) | |||
942 | break; | 943 | break; |
943 | } | 944 | } |
944 | 945 | ||
945 | spin_unlock_irq(&nl->lock); | 946 | spin_unlock_irqrestore(&nl->lock, flags); |
946 | } | 947 | } |
947 | 948 | ||
948 | static int | 949 | static int |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index c72787adeba3..c082cf0b1ac6 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -84,7 +84,7 @@ | |||
84 | #include "s2io.h" | 84 | #include "s2io.h" |
85 | #include "s2io-regs.h" | 85 | #include "s2io-regs.h" |
86 | 86 | ||
87 | #define DRV_VERSION "2.0.26.15-2" | 87 | #define DRV_VERSION "2.0.26.20" |
88 | 88 | ||
89 | /* S2io Driver name & version. */ | 89 | /* S2io Driver name & version. */ |
90 | static char s2io_driver_name[] = "Neterion"; | 90 | static char s2io_driver_name[] = "Neterion"; |
@@ -4172,6 +4172,9 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4172 | dev->trans_start = jiffies; | 4172 | dev->trans_start = jiffies; |
4173 | spin_unlock_irqrestore(&fifo->tx_lock, flags); | 4173 | spin_unlock_irqrestore(&fifo->tx_lock, flags); |
4174 | 4174 | ||
4175 | if (sp->config.intr_type == MSI_X) | ||
4176 | tx_intr_handler(fifo); | ||
4177 | |||
4175 | return 0; | 4178 | return 0; |
4176 | pci_map_failed: | 4179 | pci_map_failed: |
4177 | stats->pci_map_fail_cnt++; | 4180 | stats->pci_map_fail_cnt++; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 186eb8ebfda6..2e26dced13a1 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3199,12 +3199,14 @@ static int skge_poll(struct napi_struct *napi, int to_do) | |||
3199 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START); | 3199 | skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR), CSR_START); |
3200 | 3200 | ||
3201 | if (work_done < to_do) { | 3201 | if (work_done < to_do) { |
3202 | spin_lock_irq(&hw->hw_lock); | 3202 | unsigned long flags; |
3203 | |||
3204 | spin_lock_irqsave(&hw->hw_lock, flags); | ||
3203 | __netif_rx_complete(dev, napi); | 3205 | __netif_rx_complete(dev, napi); |
3204 | hw->intr_mask |= napimask[skge->port]; | 3206 | hw->intr_mask |= napimask[skge->port]; |
3205 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 3207 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
3206 | skge_read32(hw, B0_IMSK); | 3208 | skge_read32(hw, B0_IMSK); |
3207 | spin_unlock_irq(&hw->hw_lock); | 3209 | spin_unlock_irqrestore(&hw->hw_lock, flags); |
3208 | } | 3210 | } |
3209 | 3211 | ||
3210 | return work_done; | 3212 | return work_done; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 54c662690f65..853bce0ac478 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4329,10 +4329,14 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4329 | if (!hw) | 4329 | if (!hw) |
4330 | return 0; | 4330 | return 0; |
4331 | 4331 | ||
4332 | del_timer_sync(&hw->watchdog_timer); | ||
4333 | cancel_work_sync(&hw->restart_work); | ||
4334 | |||
4332 | for (i = 0; i < hw->ports; i++) { | 4335 | for (i = 0; i < hw->ports; i++) { |
4333 | struct net_device *dev = hw->dev[i]; | 4336 | struct net_device *dev = hw->dev[i]; |
4334 | struct sky2_port *sky2 = netdev_priv(dev); | 4337 | struct sky2_port *sky2 = netdev_priv(dev); |
4335 | 4338 | ||
4339 | netif_device_detach(dev); | ||
4336 | if (netif_running(dev)) | 4340 | if (netif_running(dev)) |
4337 | sky2_down(dev); | 4341 | sky2_down(dev); |
4338 | 4342 | ||
@@ -4383,6 +4387,8 @@ static int sky2_resume(struct pci_dev *pdev) | |||
4383 | 4387 | ||
4384 | for (i = 0; i < hw->ports; i++) { | 4388 | for (i = 0; i < hw->ports; i++) { |
4385 | struct net_device *dev = hw->dev[i]; | 4389 | struct net_device *dev = hw->dev[i]; |
4390 | |||
4391 | netif_device_attach(dev); | ||
4386 | if (netif_running(dev)) { | 4392 | if (netif_running(dev)) { |
4387 | err = sky2_up(dev); | 4393 | err = sky2_up(dev); |
4388 | if (err) { | 4394 | if (err) { |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index c49214feae91..7b7b1717b0d1 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1472,13 +1472,12 @@ static int __netdev_rx(struct net_device *dev, int *quota) | |||
1472 | #ifndef final_version /* Remove after testing. */ | 1472 | #ifndef final_version /* Remove after testing. */ |
1473 | /* You will want this info for the initial debug. */ | 1473 | /* You will want this info for the initial debug. */ |
1474 | if (debug > 5) { | 1474 | if (debug > 5) { |
1475 | DECLARE_MAC_BUF(mac); | 1475 | printk(KERN_DEBUG " Rx data " MAC_FMT " " MAC_FMT |
1476 | DECLARE_MAC_BUF(mac2); | ||
1477 | |||
1478 | printk(KERN_DEBUG " Rx data %s %s" | ||
1479 | " %2.2x%2.2x.\n", | 1476 | " %2.2x%2.2x.\n", |
1480 | print_mac(mac, &skb->data[0]), | 1477 | skb->data[0], skb->data[1], skb->data[2], |
1481 | print_mac(mac2, &skb->data[6]), | 1478 | skb->data[3], skb->data[4], skb->data[5], |
1479 | skb->data[6], skb->data[7], skb->data[8], | ||
1480 | skb->data[9], skb->data[10], skb->data[11], | ||
1482 | skb->data[12], skb->data[13]); | 1481 | skb->data[12], skb->data[13]); |
1483 | } | 1482 | } |
1484 | #endif | 1483 | #endif |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index f9ef8bd8b11e..d4655b2d1f3f 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -64,8 +64,8 @@ | |||
64 | 64 | ||
65 | #define DRV_MODULE_NAME "tg3" | 65 | #define DRV_MODULE_NAME "tg3" |
66 | #define PFX DRV_MODULE_NAME ": " | 66 | #define PFX DRV_MODULE_NAME ": " |
67 | #define DRV_MODULE_VERSION "3.88" | 67 | #define DRV_MODULE_VERSION "3.89" |
68 | #define DRV_MODULE_RELDATE "March 20, 2008" | 68 | #define DRV_MODULE_RELDATE "April 03, 2008" |
69 | 69 | ||
70 | #define TG3_DEF_MAC_MODE 0 | 70 | #define TG3_DEF_MAC_MODE 0 |
71 | #define TG3_DEF_RX_MODE 0 | 71 | #define TG3_DEF_RX_MODE 0 |
@@ -804,6 +804,12 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val) | |||
804 | return ret; | 804 | return ret; |
805 | } | 805 | } |
806 | 806 | ||
807 | static void tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val) | ||
808 | { | ||
809 | tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg); | ||
810 | tg3_writephy(tp, MII_TG3_DSP_RW_PORT, val); | ||
811 | } | ||
812 | |||
807 | static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable) | 813 | static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable) |
808 | { | 814 | { |
809 | u32 phy; | 815 | u32 phy; |
@@ -886,6 +892,49 @@ static int tg3_bmcr_reset(struct tg3 *tp) | |||
886 | return 0; | 892 | return 0; |
887 | } | 893 | } |
888 | 894 | ||
895 | static void tg3_phy_apply_otp(struct tg3 *tp) | ||
896 | { | ||
897 | u32 otp, phy; | ||
898 | |||
899 | if (!tp->phy_otp) | ||
900 | return; | ||
901 | |||
902 | otp = tp->phy_otp; | ||
903 | |||
904 | /* Enable SM_DSP clock and tx 6dB coding. */ | ||
905 | phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL | | ||
906 | MII_TG3_AUXCTL_ACTL_SMDSP_ENA | | ||
907 | MII_TG3_AUXCTL_ACTL_TX_6DB; | ||
908 | tg3_writephy(tp, MII_TG3_AUX_CTRL, phy); | ||
909 | |||
910 | phy = ((otp & TG3_OTP_AGCTGT_MASK) >> TG3_OTP_AGCTGT_SHIFT); | ||
911 | phy |= MII_TG3_DSP_TAP1_AGCTGT_DFLT; | ||
912 | tg3_phydsp_write(tp, MII_TG3_DSP_TAP1, phy); | ||
913 | |||
914 | phy = ((otp & TG3_OTP_HPFFLTR_MASK) >> TG3_OTP_HPFFLTR_SHIFT) | | ||
915 | ((otp & TG3_OTP_HPFOVER_MASK) >> TG3_OTP_HPFOVER_SHIFT); | ||
916 | tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH0, phy); | ||
917 | |||
918 | phy = ((otp & TG3_OTP_LPFDIS_MASK) >> TG3_OTP_LPFDIS_SHIFT); | ||
919 | phy |= MII_TG3_DSP_AADJ1CH3_ADCCKADJ; | ||
920 | tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH3, phy); | ||
921 | |||
922 | phy = ((otp & TG3_OTP_VDAC_MASK) >> TG3_OTP_VDAC_SHIFT); | ||
923 | tg3_phydsp_write(tp, MII_TG3_DSP_EXP75, phy); | ||
924 | |||
925 | phy = ((otp & TG3_OTP_10BTAMP_MASK) >> TG3_OTP_10BTAMP_SHIFT); | ||
926 | tg3_phydsp_write(tp, MII_TG3_DSP_EXP96, phy); | ||
927 | |||
928 | phy = ((otp & TG3_OTP_ROFF_MASK) >> TG3_OTP_ROFF_SHIFT) | | ||
929 | ((otp & TG3_OTP_RCOFF_MASK) >> TG3_OTP_RCOFF_SHIFT); | ||
930 | tg3_phydsp_write(tp, MII_TG3_DSP_EXP97, phy); | ||
931 | |||
932 | /* Turn off SM_DSP clock. */ | ||
933 | phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL | | ||
934 | MII_TG3_AUXCTL_ACTL_TX_6DB; | ||
935 | tg3_writephy(tp, MII_TG3_AUX_CTRL, phy); | ||
936 | } | ||
937 | |||
889 | static int tg3_wait_macro_done(struct tg3 *tp) | 938 | static int tg3_wait_macro_done(struct tg3 *tp) |
890 | { | 939 | { |
891 | int limit = 100; | 940 | int limit = 100; |
@@ -1073,6 +1122,7 @@ static void tg3_link_report(struct tg3 *); | |||
1073 | */ | 1122 | */ |
1074 | static int tg3_phy_reset(struct tg3 *tp) | 1123 | static int tg3_phy_reset(struct tg3 *tp) |
1075 | { | 1124 | { |
1125 | u32 cpmuctrl; | ||
1076 | u32 phy_status; | 1126 | u32 phy_status; |
1077 | int err; | 1127 | int err; |
1078 | 1128 | ||
@@ -1102,10 +1152,28 @@ static int tg3_phy_reset(struct tg3 *tp) | |||
1102 | goto out; | 1152 | goto out; |
1103 | } | 1153 | } |
1104 | 1154 | ||
1155 | cpmuctrl = 0; | ||
1156 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | ||
1157 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) { | ||
1158 | cpmuctrl = tr32(TG3_CPMU_CTRL); | ||
1159 | if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY) | ||
1160 | tw32(TG3_CPMU_CTRL, | ||
1161 | cpmuctrl & ~CPMU_CTRL_GPHY_10MB_RXONLY); | ||
1162 | } | ||
1163 | |||
1105 | err = tg3_bmcr_reset(tp); | 1164 | err = tg3_bmcr_reset(tp); |
1106 | if (err) | 1165 | if (err) |
1107 | return err; | 1166 | return err; |
1108 | 1167 | ||
1168 | if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY) { | ||
1169 | u32 phy; | ||
1170 | |||
1171 | phy = MII_TG3_DSP_EXP8_AEDW | MII_TG3_DSP_EXP8_REJ2MHz; | ||
1172 | tg3_phydsp_write(tp, MII_TG3_DSP_EXP8, phy); | ||
1173 | |||
1174 | tw32(TG3_CPMU_CTRL, cpmuctrl); | ||
1175 | } | ||
1176 | |||
1109 | if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { | 1177 | if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { |
1110 | u32 val; | 1178 | u32 val; |
1111 | 1179 | ||
@@ -1124,6 +1192,8 @@ static int tg3_phy_reset(struct tg3 *tp) | |||
1124 | MII_TG3_MISC_SHDW_APD_WKTM_84MS); | 1192 | MII_TG3_MISC_SHDW_APD_WKTM_84MS); |
1125 | } | 1193 | } |
1126 | 1194 | ||
1195 | tg3_phy_apply_otp(tp); | ||
1196 | |||
1127 | out: | 1197 | out: |
1128 | if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) { | 1198 | if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) { |
1129 | tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); | 1199 | tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); |
@@ -9464,7 +9534,8 @@ static int tg3_test_loopback(struct tg3 *tp) | |||
9464 | if (err) | 9534 | if (err) |
9465 | return TG3_LOOPBACK_FAILED; | 9535 | return TG3_LOOPBACK_FAILED; |
9466 | 9536 | ||
9467 | if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { | 9537 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
9538 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { | ||
9468 | int i; | 9539 | int i; |
9469 | u32 status; | 9540 | u32 status; |
9470 | 9541 | ||
@@ -9481,17 +9552,23 @@ static int tg3_test_loopback(struct tg3 *tp) | |||
9481 | if (status != CPMU_MUTEX_GNT_DRIVER) | 9552 | if (status != CPMU_MUTEX_GNT_DRIVER) |
9482 | return TG3_LOOPBACK_FAILED; | 9553 | return TG3_LOOPBACK_FAILED; |
9483 | 9554 | ||
9484 | /* Turn off power management based on link speed. */ | 9555 | /* Turn off link-based power management. */ |
9485 | cpmuctrl = tr32(TG3_CPMU_CTRL); | 9556 | cpmuctrl = tr32(TG3_CPMU_CTRL); |
9486 | tw32(TG3_CPMU_CTRL, | 9557 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
9487 | cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE | | 9558 | GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5761_AX) |
9488 | CPMU_CTRL_LINK_AWARE_MODE)); | 9559 | tw32(TG3_CPMU_CTRL, |
9560 | cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE | | ||
9561 | CPMU_CTRL_LINK_AWARE_MODE)); | ||
9562 | else | ||
9563 | tw32(TG3_CPMU_CTRL, | ||
9564 | cpmuctrl & ~CPMU_CTRL_LINK_AWARE_MODE); | ||
9489 | } | 9565 | } |
9490 | 9566 | ||
9491 | if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) | 9567 | if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) |
9492 | err |= TG3_MAC_LOOPBACK_FAILED; | 9568 | err |= TG3_MAC_LOOPBACK_FAILED; |
9493 | 9569 | ||
9494 | if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { | 9570 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
9571 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { | ||
9495 | tw32(TG3_CPMU_CTRL, cpmuctrl); | 9572 | tw32(TG3_CPMU_CTRL, cpmuctrl); |
9496 | 9573 | ||
9497 | /* Release the mutex */ | 9574 | /* Release the mutex */ |
@@ -10724,9 +10801,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
10724 | tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) | 10801 | tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) |
10725 | tp->led_ctrl = LED_CTRL_MODE_PHY_2; | 10802 | tp->led_ctrl = LED_CTRL_MODE_PHY_2; |
10726 | 10803 | ||
10727 | if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 || | 10804 | if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX) |
10728 | tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) | 10805 | tp->led_ctrl = LED_CTRL_MODE_PHY_1; |
10729 | tp->led_ctrl = LED_CTRL_MODE_MAC; | ||
10730 | 10806 | ||
10731 | if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) { | 10807 | if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) { |
10732 | tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT; | 10808 | tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT; |
@@ -10773,6 +10849,55 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
10773 | } | 10849 | } |
10774 | } | 10850 | } |
10775 | 10851 | ||
10852 | static int __devinit tg3_issue_otp_command(struct tg3 *tp, u32 cmd) | ||
10853 | { | ||
10854 | int i; | ||
10855 | u32 val; | ||
10856 | |||
10857 | tw32(OTP_CTRL, cmd | OTP_CTRL_OTP_CMD_START); | ||
10858 | tw32(OTP_CTRL, cmd); | ||
10859 | |||
10860 | /* Wait for up to 1 ms for command to execute. */ | ||
10861 | for (i = 0; i < 100; i++) { | ||
10862 | val = tr32(OTP_STATUS); | ||
10863 | if (val & OTP_STATUS_CMD_DONE) | ||
10864 | break; | ||
10865 | udelay(10); | ||
10866 | } | ||
10867 | |||
10868 | return (val & OTP_STATUS_CMD_DONE) ? 0 : -EBUSY; | ||
10869 | } | ||
10870 | |||
10871 | /* Read the gphy configuration from the OTP region of the chip. The gphy | ||
10872 | * configuration is a 32-bit value that straddles the alignment boundary. | ||
10873 | * We do two 32-bit reads and then shift and merge the results. | ||
10874 | */ | ||
10875 | static u32 __devinit tg3_read_otp_phycfg(struct tg3 *tp) | ||
10876 | { | ||
10877 | u32 bhalf_otp, thalf_otp; | ||
10878 | |||
10879 | tw32(OTP_MODE, OTP_MODE_OTP_THRU_GRC); | ||
10880 | |||
10881 | if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_INIT)) | ||
10882 | return 0; | ||
10883 | |||
10884 | tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC1); | ||
10885 | |||
10886 | if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ)) | ||
10887 | return 0; | ||
10888 | |||
10889 | thalf_otp = tr32(OTP_READ_DATA); | ||
10890 | |||
10891 | tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC2); | ||
10892 | |||
10893 | if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ)) | ||
10894 | return 0; | ||
10895 | |||
10896 | bhalf_otp = tr32(OTP_READ_DATA); | ||
10897 | |||
10898 | return ((thalf_otp & 0x0000ffff) << 16) | (bhalf_otp >> 16); | ||
10899 | } | ||
10900 | |||
10776 | static int __devinit tg3_phy_probe(struct tg3 *tp) | 10901 | static int __devinit tg3_phy_probe(struct tg3 *tp) |
10777 | { | 10902 | { |
10778 | u32 hw_phy_id_1, hw_phy_id_2; | 10903 | u32 hw_phy_id_1, hw_phy_id_2; |
@@ -11586,6 +11711,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
11586 | tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; | 11711 | tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; |
11587 | } | 11712 | } |
11588 | 11713 | ||
11714 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | ||
11715 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) { | ||
11716 | tp->phy_otp = tg3_read_otp_phycfg(tp); | ||
11717 | if (tp->phy_otp == 0) | ||
11718 | tp->phy_otp = TG3_OTP_DEFAULT; | ||
11719 | } | ||
11720 | |||
11589 | tp->coalesce_mode = 0; | 11721 | tp->coalesce_mode = 0; |
11590 | if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && | 11722 | if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && |
11591 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) | 11723 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 3938eb35ce8c..c1075a73d66c 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -138,6 +138,8 @@ | |||
138 | #define CHIPREV_5704_BX 0x21 | 138 | #define CHIPREV_5704_BX 0x21 |
139 | #define CHIPREV_5750_AX 0x40 | 139 | #define CHIPREV_5750_AX 0x40 |
140 | #define CHIPREV_5750_BX 0x41 | 140 | #define CHIPREV_5750_BX 0x41 |
141 | #define CHIPREV_5784_AX 0x57840 | ||
142 | #define CHIPREV_5761_AX 0x57610 | ||
141 | #define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) | 143 | #define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) |
142 | #define METAL_REV_A0 0x00 | 144 | #define METAL_REV_A0 0x00 |
143 | #define METAL_REV_A1 0x01 | 145 | #define METAL_REV_A1 0x01 |
@@ -866,6 +868,7 @@ | |||
866 | #define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 | 868 | #define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 |
867 | #define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 | 869 | #define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 |
868 | #define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 | 870 | #define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 |
871 | #define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000 | ||
869 | #define TG3_CPMU_LSPD_10MB_CLK 0x00003604 | 872 | #define TG3_CPMU_LSPD_10MB_CLK 0x00003604 |
870 | #define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 | 873 | #define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 |
871 | #define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 | 874 | #define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 |
@@ -1559,7 +1562,24 @@ | |||
1559 | /* 0x702c unused */ | 1562 | /* 0x702c unused */ |
1560 | 1563 | ||
1561 | #define NVRAM_ADDR_LOCKOUT 0x00007030 | 1564 | #define NVRAM_ADDR_LOCKOUT 0x00007030 |
1562 | /* 0x7034 --> 0x7c00 unused */ | 1565 | /* 0x7034 --> 0x7500 unused */ |
1566 | |||
1567 | #define OTP_MODE 0x00007500 | ||
1568 | #define OTP_MODE_OTP_THRU_GRC 0x00000001 | ||
1569 | #define OTP_CTRL 0x00007504 | ||
1570 | #define OTP_CTRL_OTP_PROG_ENABLE 0x00200000 | ||
1571 | #define OTP_CTRL_OTP_CMD_READ 0x00000000 | ||
1572 | #define OTP_CTRL_OTP_CMD_INIT 0x00000008 | ||
1573 | #define OTP_CTRL_OTP_CMD_START 0x00000001 | ||
1574 | #define OTP_STATUS 0x00007508 | ||
1575 | #define OTP_STATUS_CMD_DONE 0x00000001 | ||
1576 | #define OTP_ADDRESS 0x0000750c | ||
1577 | #define OTP_ADDRESS_MAGIC1 0x000000a0 | ||
1578 | #define OTP_ADDRESS_MAGIC2 0x00000080 | ||
1579 | /* 0x7510 unused */ | ||
1580 | |||
1581 | #define OTP_READ_DATA 0x00007514 | ||
1582 | /* 0x7518 --> 0x7c04 unused */ | ||
1563 | 1583 | ||
1564 | #define PCIE_TRANSACTION_CFG 0x00007c04 | 1584 | #define PCIE_TRANSACTION_CFG 0x00007c04 |
1565 | #define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 | 1585 | #define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 |
@@ -1568,6 +1588,28 @@ | |||
1568 | #define PCIE_PWR_MGMT_THRESH 0x00007d28 | 1588 | #define PCIE_PWR_MGMT_THRESH 0x00007d28 |
1569 | #define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 | 1589 | #define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 |
1570 | 1590 | ||
1591 | |||
1592 | /* OTP bit definitions */ | ||
1593 | #define TG3_OTP_AGCTGT_MASK 0x000000e0 | ||
1594 | #define TG3_OTP_AGCTGT_SHIFT 1 | ||
1595 | #define TG3_OTP_HPFFLTR_MASK 0x00000300 | ||
1596 | #define TG3_OTP_HPFFLTR_SHIFT 1 | ||
1597 | #define TG3_OTP_HPFOVER_MASK 0x00000400 | ||
1598 | #define TG3_OTP_HPFOVER_SHIFT 1 | ||
1599 | #define TG3_OTP_LPFDIS_MASK 0x00000800 | ||
1600 | #define TG3_OTP_LPFDIS_SHIFT 11 | ||
1601 | #define TG3_OTP_VDAC_MASK 0xff000000 | ||
1602 | #define TG3_OTP_VDAC_SHIFT 24 | ||
1603 | #define TG3_OTP_10BTAMP_MASK 0x0000f000 | ||
1604 | #define TG3_OTP_10BTAMP_SHIFT 8 | ||
1605 | #define TG3_OTP_ROFF_MASK 0x00e00000 | ||
1606 | #define TG3_OTP_ROFF_SHIFT 11 | ||
1607 | #define TG3_OTP_RCOFF_MASK 0x001c0000 | ||
1608 | #define TG3_OTP_RCOFF_SHIFT 16 | ||
1609 | |||
1610 | #define TG3_OTP_DEFAULT 0x286c1640 | ||
1611 | |||
1612 | |||
1571 | #define TG3_EEPROM_MAGIC 0x669955aa | 1613 | #define TG3_EEPROM_MAGIC 0x669955aa |
1572 | #define TG3_EEPROM_MAGIC_FW 0xa5000000 | 1614 | #define TG3_EEPROM_MAGIC_FW 0xa5000000 |
1573 | #define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 | 1615 | #define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 |
@@ -1705,15 +1747,31 @@ | |||
1705 | 1747 | ||
1706 | #define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ | 1748 | #define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ |
1707 | 1749 | ||
1708 | #define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ | ||
1709 | #define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ | 1750 | #define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ |
1751 | #define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ | ||
1752 | |||
1753 | #define MII_TG3_DSP_TAP1 0x0001 | ||
1754 | #define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007 | ||
1755 | #define MII_TG3_DSP_AADJ1CH0 0x001f | ||
1756 | #define MII_TG3_DSP_AADJ1CH3 0x601f | ||
1757 | #define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002 | ||
1758 | #define MII_TG3_DSP_EXP8 0x0708 | ||
1759 | #define MII_TG3_DSP_EXP8_REJ2MHz 0x0001 | ||
1760 | #define MII_TG3_DSP_EXP8_AEDW 0x0200 | ||
1761 | #define MII_TG3_DSP_EXP75 0x0f75 | ||
1762 | #define MII_TG3_DSP_EXP96 0x0f96 | ||
1763 | #define MII_TG3_DSP_EXP97 0x0f97 | ||
1710 | 1764 | ||
1711 | #define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ | 1765 | #define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ |
1712 | 1766 | ||
1713 | #define MII_TG3_AUXCTL_MISC_WREN 0x8000 | 1767 | #define MII_TG3_AUXCTL_MISC_WREN 0x8000 |
1714 | #define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 | 1768 | #define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 |
1715 | #define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 | 1769 | #define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 |
1716 | #define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 | 1770 | #define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 |
1771 | |||
1772 | #define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800 | ||
1773 | #define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400 | ||
1774 | #define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000 | ||
1717 | 1775 | ||
1718 | #define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ | 1776 | #define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ |
1719 | #define MII_TG3_AUX_STAT_LPASS 0x0004 | 1777 | #define MII_TG3_AUX_STAT_LPASS 0x0004 |
@@ -1743,6 +1801,20 @@ | |||
1743 | #define MII_TG3_INT_DUPLEXCHG 0x0008 | 1801 | #define MII_TG3_INT_DUPLEXCHG 0x0008 |
1744 | #define MII_TG3_INT_ANEG_PAGE_RX 0x0400 | 1802 | #define MII_TG3_INT_ANEG_PAGE_RX 0x0400 |
1745 | 1803 | ||
1804 | #define MII_TG3_MISC_SHDW 0x1c | ||
1805 | #define MII_TG3_MISC_SHDW_WREN 0x8000 | ||
1806 | #define MII_TG3_MISC_SHDW_SCR5_SEL 0x1400 | ||
1807 | #define MII_TG3_MISC_SHDW_APD_SEL 0x2800 | ||
1808 | |||
1809 | #define MII_TG3_MISC_SHDW_SCR5_C125OE 0x0001 | ||
1810 | #define MII_TG3_MISC_SHDW_SCR5_DLLAPD 0x0002 | ||
1811 | #define MII_TG3_MISC_SHDW_SCR5_SDTL 0x0004 | ||
1812 | #define MII_TG3_MISC_SHDW_SCR5_DLPTLM 0x0008 | ||
1813 | #define MII_TG3_MISC_SHDW_SCR5_LPED 0x0010 | ||
1814 | |||
1815 | #define MII_TG3_MISC_SHDW_APD_WKTM_84MS 0x0001 | ||
1816 | #define MII_TG3_MISC_SHDW_APD_ENABLE 0x0020 | ||
1817 | |||
1746 | #define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ | 1818 | #define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ |
1747 | #define MII_TG3_EPHY_SHADOW_EN 0x80 | 1819 | #define MII_TG3_EPHY_SHADOW_EN 0x80 |
1748 | 1820 | ||
@@ -2473,6 +2545,7 @@ struct tg3 { | |||
2473 | #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ | 2545 | #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ |
2474 | 2546 | ||
2475 | u32 led_ctrl; | 2547 | u32 led_ctrl; |
2548 | u32 phy_otp; | ||
2476 | u16 pci_cmd; | 2549 | u16 pci_cmd; |
2477 | 2550 | ||
2478 | char board_part_number[24]; | 2551 | char board_part_number[24]; |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 433c994ea9d8..0ab51a0f35fc 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -117,7 +117,7 @@ | |||
117 | * Official releases will only have an a.b.c version number format. | 117 | * Official releases will only have an a.b.c version number format. |
118 | */ | 118 | */ |
119 | 119 | ||
120 | static char version[] __devinitdata = | 120 | static char version[] = |
121 | "Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ; | 121 | "Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ; |
122 | 122 | ||
123 | static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", | 123 | static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", |
@@ -290,7 +290,7 @@ op_disable_dev: | |||
290 | return i; | 290 | return i; |
291 | } | 291 | } |
292 | 292 | ||
293 | static int __devinit olympic_init(struct net_device *dev) | 293 | static int olympic_init(struct net_device *dev) |
294 | { | 294 | { |
295 | struct olympic_private *olympic_priv; | 295 | struct olympic_private *olympic_priv; |
296 | u8 __iomem *olympic_mmio, *init_srb,*adapter_addr; | 296 | u8 __iomem *olympic_mmio, *init_srb,*adapter_addr; |
@@ -434,7 +434,7 @@ static int __devinit olympic_init(struct net_device *dev) | |||
434 | 434 | ||
435 | } | 435 | } |
436 | 436 | ||
437 | static int __devinit olympic_open(struct net_device *dev) | 437 | static int olympic_open(struct net_device *dev) |
438 | { | 438 | { |
439 | struct olympic_private *olympic_priv=netdev_priv(dev); | 439 | struct olympic_private *olympic_priv=netdev_priv(dev); |
440 | u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb; | 440 | u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb; |
@@ -1438,13 +1438,18 @@ static void olympic_arb_cmd(struct net_device *dev) | |||
1438 | 1438 | ||
1439 | if (olympic_priv->olympic_network_monitor) { | 1439 | if (olympic_priv->olympic_network_monitor) { |
1440 | struct trh_hdr *mac_hdr; | 1440 | struct trh_hdr *mac_hdr; |
1441 | DECLARE_MAC_BUF(mac); | ||
1442 | printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); | 1441 | printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); |
1443 | mac_hdr = tr_hdr(mac_frame); | 1442 | mac_hdr = tr_hdr(mac_frame); |
1444 | printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %s\n", | 1443 | printk(KERN_WARNING "%s: MAC Frame Dest. Addr: " |
1445 | dev->name, print_mac(mac, mac_hdr->daddr)); | 1444 | MAC_FMT " \n", dev->name, |
1446 | printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %s\n", | 1445 | mac_hdr->daddr[0], mac_hdr->daddr[1], |
1447 | dev->name, print_mac(mac, mac_hdr->saddr)); | 1446 | mac_hdr->daddr[2], mac_hdr->daddr[3], |
1447 | mac_hdr->daddr[4], mac_hdr->daddr[5]); | ||
1448 | printk(KERN_WARNING "%s: MAC Frame Srce. Addr: " | ||
1449 | MAC_FMT " \n", dev->name, | ||
1450 | mac_hdr->saddr[0], mac_hdr->saddr[1], | ||
1451 | mac_hdr->saddr[2], mac_hdr->saddr[3], | ||
1452 | mac_hdr->saddr[4], mac_hdr->saddr[5]); | ||
1448 | } | 1453 | } |
1449 | netif_rx(mac_frame); | 1454 | netif_rx(mac_frame); |
1450 | dev->last_rx = jiffies; | 1455 | dev->last_rx = jiffies; |
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 8909050b8ea7..5f1c5072b96f 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c | |||
@@ -3413,7 +3413,7 @@ static int smctr_make_tx_status_code(struct net_device *dev, | |||
3413 | tsv->svi = TRANSMIT_STATUS_CODE; | 3413 | tsv->svi = TRANSMIT_STATUS_CODE; |
3414 | tsv->svl = S_TRANSMIT_STATUS_CODE; | 3414 | tsv->svl = S_TRANSMIT_STATUS_CODE; |
3415 | 3415 | ||
3416 | tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR); | 3416 | tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) | IBM_PASS_SOURCE_ADDR); |
3417 | 3417 | ||
3418 | /* Stripped frame status of Transmitted Frame */ | 3418 | /* Stripped frame status of Transmitted Frame */ |
3419 | tsv->svv[1] = tx_fstatus & 0xff; | 3419 | tsv->svv[1] = tx_fstatus & 0xff; |
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 206918bad539..da2206f6021d 100644 --- a/drivers/net/tulip/eeprom.c +++ b/drivers/net/tulip/eeprom.c | |||
@@ -343,6 +343,12 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l | |||
343 | void __iomem *ee_addr = tp->base_addr + CSR9; | 343 | void __iomem *ee_addr = tp->base_addr + CSR9; |
344 | int read_cmd = location | (EE_READ_CMD << addr_len); | 344 | int read_cmd = location | (EE_READ_CMD << addr_len); |
345 | 345 | ||
346 | /* If location is past the end of what we can address, don't | ||
347 | * read some other location (ie truncate). Just return zero. | ||
348 | */ | ||
349 | if (location > (1 << addr_len) - 1) | ||
350 | return 0; | ||
351 | |||
346 | iowrite32(EE_ENB & ~EE_CS, ee_addr); | 352 | iowrite32(EE_ENB & ~EE_CS, ee_addr); |
347 | iowrite32(EE_ENB, ee_addr); | 353 | iowrite32(EE_ENB, ee_addr); |
348 | 354 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index ed600bf56e78..82f404b76d81 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1437,6 +1437,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1437 | EEPROM. | 1437 | EEPROM. |
1438 | */ | 1438 | */ |
1439 | ee_data = tp->eeprom; | 1439 | ee_data = tp->eeprom; |
1440 | memset(ee_data, 0, sizeof(tp->eeprom)); | ||
1440 | sum = 0; | 1441 | sum = 0; |
1441 | if (chip_idx == LC82C168) { | 1442 | if (chip_idx == LC82C168) { |
1442 | for (i = 0; i < 3; i++) { | 1443 | for (i = 0; i < 3; i++) { |
@@ -1458,8 +1459,12 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1458 | /* A serial EEPROM interface, we read now and sort it out later. */ | 1459 | /* A serial EEPROM interface, we read now and sort it out later. */ |
1459 | int sa_offset = 0; | 1460 | int sa_offset = 0; |
1460 | int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6; | 1461 | int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6; |
1462 | int ee_max_addr = ((1 << ee_addr_size) - 1) * sizeof(u16); | ||
1461 | 1463 | ||
1462 | for (i = 0; i < sizeof(tp->eeprom); i+=2) { | 1464 | if (ee_max_addr > sizeof(tp->eeprom)) |
1465 | ee_max_addr = sizeof(tp->eeprom); | ||
1466 | |||
1467 | for (i = 0; i < ee_max_addr ; i += sizeof(u16)) { | ||
1463 | u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size); | 1468 | u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size); |
1464 | ee_data[i] = data & 0xff; | 1469 | ee_data[i] = data & 0xff; |
1465 | ee_data[i + 1] = data >> 8; | 1470 | ee_data[i + 1] = data >> 8; |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index a12c9c41b217..0604f3faf043 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -129,7 +129,7 @@ config USB_USBNET | |||
129 | 129 | ||
130 | config USB_NET_AX8817X | 130 | config USB_NET_AX8817X |
131 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" | 131 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" |
132 | depends on USB_USBNET && NET_ETHERNET | 132 | depends on USB_USBNET |
133 | select CRC32 | 133 | select CRC32 |
134 | default y | 134 | default y |
135 | help | 135 | help |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 4b131a6c6b70..01660f68943a 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -341,7 +341,7 @@ static void dm9601_set_multicast(struct net_device *net) | |||
341 | /* We use the 20 byte dev->data for our 8 byte filter buffer | 341 | /* We use the 20 byte dev->data for our 8 byte filter buffer |
342 | * to avoid allocating memory that is tricky to free later */ | 342 | * to avoid allocating memory that is tricky to free later */ |
343 | u8 *hashes = (u8 *) & dev->data; | 343 | u8 *hashes = (u8 *) & dev->data; |
344 | u8 rx_ctl = 0x01; | 344 | u8 rx_ctl = 0x31; |
345 | 345 | ||
346 | memset(hashes, 0x00, DM_MCAST_SIZE); | 346 | memset(hashes, 0x00, DM_MCAST_SIZE); |
347 | hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */ | 347 | hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */ |
@@ -354,7 +354,7 @@ static void dm9601_set_multicast(struct net_device *net) | |||
354 | struct dev_mc_list *mc_list = net->mc_list; | 354 | struct dev_mc_list *mc_list = net->mc_list; |
355 | int i; | 355 | int i; |
356 | 356 | ||
357 | for (i = 0; i < net->mc_count; i++) { | 357 | for (i = 0; i < net->mc_count; i++, mc_list = mc_list->next) { |
358 | u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; | 358 | u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; |
359 | hashes[crc >> 3] |= 1 << (crc & 0x7); | 359 | hashes[crc >> 3] |= 1 << (crc & 0x7); |
360 | } | 360 | } |
@@ -562,6 +562,10 @@ static const struct usb_device_id products[] = { | |||
562 | USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */ | 562 | USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */ |
563 | .driver_info = (unsigned long)&dm9601_info, | 563 | .driver_info = (unsigned long)&dm9601_info, |
564 | }, | 564 | }, |
565 | { | ||
566 | USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */ | ||
567 | .driver_info = (unsigned long)&dm9601_info, | ||
568 | }, | ||
565 | {}, // END | 569 | {}, // END |
566 | }; | 570 | }; |
567 | 571 | ||
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index d1ed68a11e70..b588c890ea70 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -1128,12 +1128,8 @@ pegasus_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
1128 | { | 1128 | { |
1129 | pegasus_t *pegasus; | 1129 | pegasus_t *pegasus; |
1130 | 1130 | ||
1131 | if (in_atomic()) | ||
1132 | return 0; | ||
1133 | |||
1134 | pegasus = netdev_priv(dev); | 1131 | pegasus = netdev_priv(dev); |
1135 | mii_ethtool_gset(&pegasus->mii, ecmd); | 1132 | mii_ethtool_gset(&pegasus->mii, ecmd); |
1136 | |||
1137 | return 0; | 1133 | return 0; |
1138 | } | 1134 | } |
1139 | 1135 | ||
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 727547a28992..369c731114b3 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -283,7 +283,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
283 | struct rndis_set_c *set_c; | 283 | struct rndis_set_c *set_c; |
284 | struct rndis_halt *halt; | 284 | struct rndis_halt *halt; |
285 | } u; | 285 | } u; |
286 | u32 tmp, *phym; | 286 | u32 tmp, phym_unspec, *phym; |
287 | int reply_len; | 287 | int reply_len; |
288 | unsigned char *bp; | 288 | unsigned char *bp; |
289 | 289 | ||
@@ -363,12 +363,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
363 | goto halt_fail_and_release; | 363 | goto halt_fail_and_release; |
364 | 364 | ||
365 | /* Check physical medium */ | 365 | /* Check physical medium */ |
366 | phym = NULL; | ||
366 | reply_len = sizeof *phym; | 367 | reply_len = sizeof *phym; |
367 | retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM, | 368 | retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM, |
368 | 0, (void **) &phym, &reply_len); | 369 | 0, (void **) &phym, &reply_len); |
369 | if (retval != 0) | 370 | if (retval != 0 || !phym) { |
370 | /* OID is optional so don't fail here. */ | 371 | /* OID is optional so don't fail here. */ |
371 | *phym = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED; | 372 | phym_unspec = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED; |
373 | phym = &phym_unspec; | ||
374 | } | ||
372 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && | 375 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && |
373 | *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { | 376 | *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { |
374 | if (netif_msg_probe(dev)) | 377 | if (netif_msg_probe(dev)) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b58472cf76f8..555b70c8b863 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -234,11 +234,12 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
234 | struct scatterlist sg[1+MAX_SKB_FRAGS]; | 234 | struct scatterlist sg[1+MAX_SKB_FRAGS]; |
235 | struct virtio_net_hdr *hdr; | 235 | struct virtio_net_hdr *hdr; |
236 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; | 236 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; |
237 | DECLARE_MAC_BUF(mac); | ||
238 | 237 | ||
239 | sg_init_table(sg, 1+MAX_SKB_FRAGS); | 238 | sg_init_table(sg, 1+MAX_SKB_FRAGS); |
240 | 239 | ||
241 | pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); | 240 | pr_debug("%s: xmit %p " MAC_FMT "\n", dev->name, skb, |
241 | dest[0], dest[1], dest[2], | ||
242 | dest[3], dest[4], dest[5]); | ||
242 | 243 | ||
243 | /* Encode metadata header at front. */ | 244 | /* Encode metadata header at front. */ |
244 | hdr = skb_vnet_hdr(skb); | 245 | hdr = skb_vnet_hdr(skb); |
@@ -284,7 +285,6 @@ again: | |||
284 | /* Activate callback for using skbs: if this returns false it | 285 | /* Activate callback for using skbs: if this returns false it |
285 | * means some were used in the meantime. */ | 286 | * means some were used in the meantime. */ |
286 | if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) { | 287 | if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) { |
287 | printk("Unlikely: restart svq race\n"); | ||
288 | vi->svq->vq_ops->disable_cb(vi->svq); | 288 | vi->svq->vq_ops->disable_cb(vi->svq); |
289 | netif_start_queue(dev); | 289 | netif_start_queue(dev); |
290 | goto again; | 290 | goto again; |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index fb37b8095231..824df3b5ea49 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -58,7 +58,7 @@ struct lapbethdev { | |||
58 | struct net_device_stats stats; /* some statistics */ | 58 | struct net_device_stats stats; /* some statistics */ |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct list_head lapbeth_devices = LIST_HEAD_INIT(lapbeth_devices); | 61 | static LIST_HEAD(lapbeth_devices); |
62 | 62 | ||
63 | /* ------------------------------------------------------------------------ */ | 63 | /* ------------------------------------------------------------------------ */ |
64 | 64 | ||
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c index c6e70dbc5de8..2ab1d59870f4 100644 --- a/drivers/net/wireless/arlan-proc.c +++ b/drivers/net/wireless/arlan-proc.c | |||
@@ -1202,13 +1202,6 @@ static ctl_table arlan_table[MAX_ARLANS + 1] = | |||
1202 | { .ctl_name = 0 } | 1202 | { .ctl_name = 0 } |
1203 | }; | 1203 | }; |
1204 | #endif | 1204 | #endif |
1205 | #else | ||
1206 | |||
1207 | static ctl_table arlan_table[MAX_ARLANS + 1] = | ||
1208 | { | ||
1209 | { .ctl_name = 0 } | ||
1210 | }; | ||
1211 | #endif | ||
1212 | 1205 | ||
1213 | 1206 | ||
1214 | // static int mmtu = 1234; | 1207 | // static int mmtu = 1234; |
@@ -1233,7 +1226,6 @@ static ctl_table arlan_root_table[] = | |||
1233 | //}; | 1226 | //}; |
1234 | 1227 | ||
1235 | 1228 | ||
1236 | #ifdef CONFIG_PROC_FS | ||
1237 | static struct ctl_table_header *arlan_device_sysctl_header; | 1229 | static struct ctl_table_header *arlan_device_sysctl_header; |
1238 | 1230 | ||
1239 | int __init init_arlan_proc(void) | 1231 | int __init init_arlan_proc(void) |
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index e38ed0fe72e9..7fca2ebc747f 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
@@ -618,6 +618,7 @@ void b43_debugfs_remove_device(struct b43_wldev *dev) | |||
618 | kfree(e); | 618 | kfree(e); |
619 | } | 619 | } |
620 | 620 | ||
621 | /* Called with IRQs disabled. */ | ||
621 | void b43_debugfs_log_txstat(struct b43_wldev *dev, | 622 | void b43_debugfs_log_txstat(struct b43_wldev *dev, |
622 | const struct b43_txstatus *status) | 623 | const struct b43_txstatus *status) |
623 | { | 624 | { |
@@ -629,8 +630,7 @@ void b43_debugfs_log_txstat(struct b43_wldev *dev, | |||
629 | if (!e) | 630 | if (!e) |
630 | return; | 631 | return; |
631 | log = &e->txstatlog; | 632 | log = &e->txstatlog; |
632 | B43_WARN_ON(!irqs_disabled()); | 633 | spin_lock(&log->lock); /* IRQs are already disabled. */ |
633 | spin_lock(&log->lock); | ||
634 | i = log->end + 1; | 634 | i = log->end + 1; |
635 | if (i == B43_NR_LOGGED_TXSTATUS) | 635 | if (i == B43_NR_LOGGED_TXSTATUS) |
636 | i = 0; | 636 | i = 0; |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 3dfb28a34be9..948eb1fe916b 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -560,7 +560,7 @@ static int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, | |||
560 | /* Check if a DMA mapping address is invalid. */ | 560 | /* Check if a DMA mapping address is invalid. */ |
561 | static bool b43_dma_mapping_error(struct b43_dmaring *ring, | 561 | static bool b43_dma_mapping_error(struct b43_dmaring *ring, |
562 | dma_addr_t addr, | 562 | dma_addr_t addr, |
563 | size_t buffersize) | 563 | size_t buffersize, bool dma_to_device) |
564 | { | 564 | { |
565 | if (unlikely(dma_mapping_error(addr))) | 565 | if (unlikely(dma_mapping_error(addr))) |
566 | return 1; | 566 | return 1; |
@@ -568,11 +568,11 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring, | |||
568 | switch (ring->type) { | 568 | switch (ring->type) { |
569 | case B43_DMA_30BIT: | 569 | case B43_DMA_30BIT: |
570 | if ((u64)addr + buffersize > (1ULL << 30)) | 570 | if ((u64)addr + buffersize > (1ULL << 30)) |
571 | return 1; | 571 | goto address_error; |
572 | break; | 572 | break; |
573 | case B43_DMA_32BIT: | 573 | case B43_DMA_32BIT: |
574 | if ((u64)addr + buffersize > (1ULL << 32)) | 574 | if ((u64)addr + buffersize > (1ULL << 32)) |
575 | return 1; | 575 | goto address_error; |
576 | break; | 576 | break; |
577 | case B43_DMA_64BIT: | 577 | case B43_DMA_64BIT: |
578 | /* Currently we can't have addresses beyond | 578 | /* Currently we can't have addresses beyond |
@@ -582,6 +582,12 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring, | |||
582 | 582 | ||
583 | /* The address is OK. */ | 583 | /* The address is OK. */ |
584 | return 0; | 584 | return 0; |
585 | |||
586 | address_error: | ||
587 | /* We can't support this address. Unmap it again. */ | ||
588 | unmap_descbuffer(ring, addr, buffersize, dma_to_device); | ||
589 | |||
590 | return 1; | ||
585 | } | 591 | } |
586 | 592 | ||
587 | static int setup_rx_descbuffer(struct b43_dmaring *ring, | 593 | static int setup_rx_descbuffer(struct b43_dmaring *ring, |
@@ -599,7 +605,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
599 | if (unlikely(!skb)) | 605 | if (unlikely(!skb)) |
600 | return -ENOMEM; | 606 | return -ENOMEM; |
601 | dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0); | 607 | dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0); |
602 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) { | 608 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { |
603 | /* ugh. try to realloc in zone_dma */ | 609 | /* ugh. try to realloc in zone_dma */ |
604 | gfp_flags |= GFP_DMA; | 610 | gfp_flags |= GFP_DMA; |
605 | 611 | ||
@@ -612,7 +618,8 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
612 | ring->rx_buffersize, 0); | 618 | ring->rx_buffersize, 0); |
613 | } | 619 | } |
614 | 620 | ||
615 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize)) { | 621 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { |
622 | b43err(ring->dev->wl, "RX DMA buffer allocation failed\n"); | ||
616 | dev_kfree_skb_any(skb); | 623 | dev_kfree_skb_any(skb); |
617 | return -EIO; | 624 | return -EIO; |
618 | } | 625 | } |
@@ -852,7 +859,8 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
852 | b43_txhdr_size(dev), | 859 | b43_txhdr_size(dev), |
853 | DMA_TO_DEVICE); | 860 | DMA_TO_DEVICE); |
854 | 861 | ||
855 | if (b43_dma_mapping_error(ring, dma_test, b43_txhdr_size(dev))) { | 862 | if (b43_dma_mapping_error(ring, dma_test, |
863 | b43_txhdr_size(dev), 1)) { | ||
856 | /* ugh realloc */ | 864 | /* ugh realloc */ |
857 | kfree(ring->txhdr_cache); | 865 | kfree(ring->txhdr_cache); |
858 | ring->txhdr_cache = kcalloc(nr_slots, | 866 | ring->txhdr_cache = kcalloc(nr_slots, |
@@ -867,8 +875,12 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
867 | DMA_TO_DEVICE); | 875 | DMA_TO_DEVICE); |
868 | 876 | ||
869 | if (b43_dma_mapping_error(ring, dma_test, | 877 | if (b43_dma_mapping_error(ring, dma_test, |
870 | b43_txhdr_size(dev))) | 878 | b43_txhdr_size(dev), 1)) { |
879 | |||
880 | b43err(dev->wl, | ||
881 | "TXHDR DMA allocation failed\n"); | ||
871 | goto err_kfree_txhdr_cache; | 882 | goto err_kfree_txhdr_cache; |
883 | } | ||
872 | } | 884 | } |
873 | 885 | ||
874 | dma_unmap_single(dev->dev->dev, | 886 | dma_unmap_single(dev->dev->dev, |
@@ -1189,7 +1201,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1189 | 1201 | ||
1190 | meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header, | 1202 | meta_hdr->dmaaddr = map_descbuffer(ring, (unsigned char *)header, |
1191 | hdrsize, 1); | 1203 | hdrsize, 1); |
1192 | if (b43_dma_mapping_error(ring, meta_hdr->dmaaddr, hdrsize)) { | 1204 | if (b43_dma_mapping_error(ring, meta_hdr->dmaaddr, hdrsize, 1)) { |
1193 | ring->current_slot = old_top_slot; | 1205 | ring->current_slot = old_top_slot; |
1194 | ring->used_slots = old_used_slots; | 1206 | ring->used_slots = old_used_slots; |
1195 | return -EIO; | 1207 | return -EIO; |
@@ -1208,7 +1220,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1208 | 1220 | ||
1209 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1221 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1210 | /* create a bounce buffer in zone_dma on mapping failure. */ | 1222 | /* create a bounce buffer in zone_dma on mapping failure. */ |
1211 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len)) { | 1223 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
1212 | bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); | 1224 | bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); |
1213 | if (!bounce_skb) { | 1225 | if (!bounce_skb) { |
1214 | ring->current_slot = old_top_slot; | 1226 | ring->current_slot = old_top_slot; |
@@ -1222,7 +1234,7 @@ static int dma_tx_fragment(struct b43_dmaring *ring, | |||
1222 | skb = bounce_skb; | 1234 | skb = bounce_skb; |
1223 | meta->skb = skb; | 1235 | meta->skb = skb; |
1224 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1236 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1225 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len)) { | 1237 | if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
1226 | ring->current_slot = old_top_slot; | 1238 | ring->current_slot = old_top_slot; |
1227 | ring->used_slots = old_used_slots; | 1239 | ring->used_slots = old_used_slots; |
1228 | err = -EIO; | 1240 | err = -EIO; |
@@ -1337,6 +1349,7 @@ out_unlock: | |||
1337 | return err; | 1349 | return err; |
1338 | } | 1350 | } |
1339 | 1351 | ||
1352 | /* Called with IRQs disabled. */ | ||
1340 | void b43_dma_handle_txstatus(struct b43_wldev *dev, | 1353 | void b43_dma_handle_txstatus(struct b43_wldev *dev, |
1341 | const struct b43_txstatus *status) | 1354 | const struct b43_txstatus *status) |
1342 | { | 1355 | { |
@@ -1349,8 +1362,8 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, | |||
1349 | ring = parse_cookie(dev, status->cookie, &slot); | 1362 | ring = parse_cookie(dev, status->cookie, &slot); |
1350 | if (unlikely(!ring)) | 1363 | if (unlikely(!ring)) |
1351 | return; | 1364 | return; |
1352 | B43_WARN_ON(!irqs_disabled()); | 1365 | |
1353 | spin_lock(&ring->lock); | 1366 | spin_lock(&ring->lock); /* IRQs are already disabled. */ |
1354 | 1367 | ||
1355 | B43_WARN_ON(!ring->tx); | 1368 | B43_WARN_ON(!ring->tx); |
1356 | ops = ring->ops; | 1369 | ops = ring->ops; |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 51dfce16178a..c73a75b24cd6 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2049,7 +2049,6 @@ void b43_mac_enable(struct b43_wldev *dev) | |||
2049 | { | 2049 | { |
2050 | dev->mac_suspended--; | 2050 | dev->mac_suspended--; |
2051 | B43_WARN_ON(dev->mac_suspended < 0); | 2051 | B43_WARN_ON(dev->mac_suspended < 0); |
2052 | B43_WARN_ON(irqs_disabled()); | ||
2053 | if (dev->mac_suspended == 0) { | 2052 | if (dev->mac_suspended == 0) { |
2054 | b43_write32(dev, B43_MMIO_MACCTL, | 2053 | b43_write32(dev, B43_MMIO_MACCTL, |
2055 | b43_read32(dev, B43_MMIO_MACCTL) | 2054 | b43_read32(dev, B43_MMIO_MACCTL) |
@@ -2075,7 +2074,6 @@ void b43_mac_suspend(struct b43_wldev *dev) | |||
2075 | u32 tmp; | 2074 | u32 tmp; |
2076 | 2075 | ||
2077 | might_sleep(); | 2076 | might_sleep(); |
2078 | B43_WARN_ON(irqs_disabled()); | ||
2079 | B43_WARN_ON(dev->mac_suspended < 0); | 2077 | B43_WARN_ON(dev->mac_suspended < 0); |
2080 | 2078 | ||
2081 | if (dev->mac_suspended == 0) { | 2079 | if (dev->mac_suspended == 0) { |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index b79a6bd5396d..371e4a119511 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -91,6 +91,8 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
91 | 91 | ||
92 | dev->conf.ConfigBase = parse.config.base; | 92 | dev->conf.ConfigBase = parse.config.base; |
93 | dev->conf.Present = parse.config.rmask[0]; | 93 | dev->conf.Present = parse.config.rmask[0]; |
94 | dev->conf.Attributes = CONF_ENABLE_IRQ; | ||
95 | dev->conf.IntType = INT_MEMORY_AND_IO; | ||
94 | 96 | ||
95 | dev->io.BasePort2 = 0; | 97 | dev->io.BasePort2 = 0; |
96 | dev->io.NumPorts2 = 0; | 98 | dev->io.NumPorts2 = 0; |
@@ -112,8 +114,8 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
112 | if (res != CS_SUCCESS) | 114 | if (res != CS_SUCCESS) |
113 | goto err_disable; | 115 | goto err_disable; |
114 | 116 | ||
115 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; | 117 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
116 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; | 118 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID; |
117 | dev->irq.Handler = NULL; /* The handler is registered later. */ | 119 | dev->irq.Handler = NULL; /* The handler is registered later. */ |
118 | dev->irq.Instance = NULL; | 120 | dev->irq.Instance = NULL; |
119 | res = pcmcia_request_irq(dev, &dev->irq); | 121 | res = pcmcia_request_irq(dev, &dev->irq); |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 49978bdb4324..4fd73809602e 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -635,7 +635,6 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, | |||
635 | { | 635 | { |
636 | struct ieee80211_hdr_4addr *hdr; | 636 | struct ieee80211_hdr_4addr *hdr; |
637 | int res, hdrlen; | 637 | int res, hdrlen; |
638 | DECLARE_MAC_BUF(mac); | ||
639 | 638 | ||
640 | if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) | 639 | if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) |
641 | return 0; | 640 | return 0; |
@@ -647,8 +646,10 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, | |||
647 | strcmp(crypt->ops->name, "TKIP") == 0) { | 646 | strcmp(crypt->ops->name, "TKIP") == 0) { |
648 | if (net_ratelimit()) { | 647 | if (net_ratelimit()) { |
649 | printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " | 648 | printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " |
650 | "received packet from %s\n", | 649 | "received packet from " MAC_FMT "\n", |
651 | local->dev->name, print_mac(mac, hdr->addr2)); | 650 | local->dev->name, |
651 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
652 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
652 | } | 653 | } |
653 | return -1; | 654 | return -1; |
654 | } | 655 | } |
@@ -657,9 +658,12 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, | |||
657 | res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); | 658 | res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); |
658 | atomic_dec(&crypt->refcnt); | 659 | atomic_dec(&crypt->refcnt); |
659 | if (res < 0) { | 660 | if (res < 0) { |
660 | printk(KERN_DEBUG "%s: decryption failed (SA=%s" | 661 | printk(KERN_DEBUG "%s: decryption failed (SA=" MAC_FMT |
661 | ") res=%d\n", | 662 | ") res=%d\n", |
662 | local->dev->name, print_mac(mac, hdr->addr2), res); | 663 | local->dev->name, |
664 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
665 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
666 | res); | ||
663 | local->comm_tallies.rx_discards_wep_undecryptable++; | 667 | local->comm_tallies.rx_discards_wep_undecryptable++; |
664 | return -1; | 668 | return -1; |
665 | } | 669 | } |
@@ -721,7 +725,6 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
721 | struct ieee80211_crypt_data *crypt = NULL; | 725 | struct ieee80211_crypt_data *crypt = NULL; |
722 | void *sta = NULL; | 726 | void *sta = NULL; |
723 | int keyidx = 0; | 727 | int keyidx = 0; |
724 | DECLARE_MAC_BUF(mac); | ||
725 | 728 | ||
726 | iface = netdev_priv(dev); | 729 | iface = netdev_priv(dev); |
727 | local = iface->local; | 730 | local = iface->local; |
@@ -798,8 +801,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
798 | * frames silently instead of filling system log with | 801 | * frames silently instead of filling system log with |
799 | * these reports. */ | 802 | * these reports. */ |
800 | printk(KERN_DEBUG "%s: WEP decryption failed (not set)" | 803 | printk(KERN_DEBUG "%s: WEP decryption failed (not set)" |
801 | " (SA=%s)\n", | 804 | " (SA=" MAC_FMT ")\n", |
802 | local->dev->name, print_mac(mac, hdr->addr2)); | 805 | local->dev->name, |
806 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
807 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
803 | #endif | 808 | #endif |
804 | local->comm_tallies.rx_discards_wep_undecryptable++; | 809 | local->comm_tallies.rx_discards_wep_undecryptable++; |
805 | goto rx_dropped; | 810 | goto rx_dropped; |
@@ -813,8 +818,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
813 | (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) | 818 | (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) |
814 | { | 819 | { |
815 | printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " | 820 | printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " |
816 | "from %s\n", dev->name, | 821 | "from " MAC_FMT "\n", dev->name, |
817 | print_mac(mac, hdr->addr2)); | 822 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
823 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
818 | /* TODO: could inform hostapd about this so that it | 824 | /* TODO: could inform hostapd about this so that it |
819 | * could send auth failure report */ | 825 | * could send auth failure report */ |
820 | goto rx_dropped; | 826 | goto rx_dropped; |
@@ -982,8 +988,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
982 | "unencrypted EAPOL frame\n", local->dev->name); | 988 | "unencrypted EAPOL frame\n", local->dev->name); |
983 | } else { | 989 | } else { |
984 | printk(KERN_DEBUG "%s: encryption configured, but RX " | 990 | printk(KERN_DEBUG "%s: encryption configured, but RX " |
985 | "frame not encrypted (SA=%s)\n", | 991 | "frame not encrypted (SA=" MAC_FMT ")\n", |
986 | local->dev->name, print_mac(mac, hdr->addr2)); | 992 | local->dev->name, |
993 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
994 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
987 | goto rx_dropped; | 995 | goto rx_dropped; |
988 | } | 996 | } |
989 | } | 997 | } |
@@ -992,9 +1000,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
992 | !hostap_is_eapol_frame(local, skb)) { | 1000 | !hostap_is_eapol_frame(local, skb)) { |
993 | if (net_ratelimit()) { | 1001 | if (net_ratelimit()) { |
994 | printk(KERN_DEBUG "%s: dropped unencrypted RX data " | 1002 | printk(KERN_DEBUG "%s: dropped unencrypted RX data " |
995 | "frame from %s" | 1003 | "frame from " MAC_FMT " (drop_unencrypted=1)\n", |
996 | " (drop_unencrypted=1)\n", | 1004 | dev->name, |
997 | dev->name, print_mac(mac, hdr->addr2)); | 1005 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1006 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
998 | } | 1007 | } |
999 | goto rx_dropped; | 1008 | goto rx_dropped; |
1000 | } | 1009 | } |
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index e7afc3ec3e6d..921c984416f8 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -314,7 +314,6 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, | |||
314 | struct ieee80211_hdr_4addr *hdr; | 314 | struct ieee80211_hdr_4addr *hdr; |
315 | u16 fc; | 315 | u16 fc; |
316 | int prefix_len, postfix_len, hdr_len, res; | 316 | int prefix_len, postfix_len, hdr_len, res; |
317 | DECLARE_MAC_BUF(mac); | ||
318 | 317 | ||
319 | iface = netdev_priv(skb->dev); | 318 | iface = netdev_priv(skb->dev); |
320 | local = iface->local; | 319 | local = iface->local; |
@@ -329,8 +328,10 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, | |||
329 | hdr = (struct ieee80211_hdr_4addr *) skb->data; | 328 | hdr = (struct ieee80211_hdr_4addr *) skb->data; |
330 | if (net_ratelimit()) { | 329 | if (net_ratelimit()) { |
331 | printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " | 330 | printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " |
332 | "TX packet to %s\n", | 331 | "TX packet to " MAC_FMT "\n", |
333 | local->dev->name, print_mac(mac, hdr->addr1)); | 332 | local->dev->name, |
333 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
334 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
334 | } | 335 | } |
335 | kfree_skb(skb); | 336 | kfree_skb(skb); |
336 | return NULL; | 337 | return NULL; |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index ad040a3bb8a7..0acd9589c48c 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -632,7 +632,6 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) | |||
632 | __le16 *pos; | 632 | __le16 *pos; |
633 | struct sta_info *sta = NULL; | 633 | struct sta_info *sta = NULL; |
634 | char *txt = NULL; | 634 | char *txt = NULL; |
635 | DECLARE_MAC_BUF(mac); | ||
636 | 635 | ||
637 | if (ap->local->hostapd) { | 636 | if (ap->local->hostapd) { |
638 | dev_kfree_skb(skb); | 637 | dev_kfree_skb(skb); |
@@ -684,10 +683,12 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) | |||
684 | if (sta) | 683 | if (sta) |
685 | atomic_dec(&sta->users); | 684 | atomic_dec(&sta->users); |
686 | if (txt) { | 685 | if (txt) { |
687 | PDEBUG(DEBUG_AP, "%s: %s auth_cb - alg=%d " | 686 | PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth_cb - alg=%d " |
688 | "trans#=%d status=%d - %s\n", | 687 | "trans#=%d status=%d - %s\n", |
689 | dev->name, print_mac(mac, hdr->addr1), auth_alg, | 688 | dev->name, |
690 | auth_transaction, status, txt); | 689 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], |
690 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], | ||
691 | auth_alg, auth_transaction, status, txt); | ||
691 | } | 692 | } |
692 | dev_kfree_skb(skb); | 693 | dev_kfree_skb(skb); |
693 | } | 694 | } |
@@ -703,7 +704,6 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) | |||
703 | __le16 *pos; | 704 | __le16 *pos; |
704 | struct sta_info *sta = NULL; | 705 | struct sta_info *sta = NULL; |
705 | char *txt = NULL; | 706 | char *txt = NULL; |
706 | DECLARE_MAC_BUF(mac); | ||
707 | 707 | ||
708 | if (ap->local->hostapd) { | 708 | if (ap->local->hostapd) { |
709 | dev_kfree_skb(skb); | 709 | dev_kfree_skb(skb); |
@@ -754,8 +754,11 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) | |||
754 | if (sta) | 754 | if (sta) |
755 | atomic_dec(&sta->users); | 755 | atomic_dec(&sta->users); |
756 | if (txt) { | 756 | if (txt) { |
757 | PDEBUG(DEBUG_AP, "%s: %s assoc_cb - %s\n", | 757 | PDEBUG(DEBUG_AP, "%s: " MAC_FMT " assoc_cb - %s\n", |
758 | dev->name, print_mac(mac, hdr->addr1), txt); | 758 | dev->name, |
759 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
760 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], | ||
761 | txt); | ||
759 | } | 762 | } |
760 | dev_kfree_skb(skb); | 763 | dev_kfree_skb(skb); |
761 | } | 764 | } |
@@ -767,7 +770,6 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data) | |||
767 | struct ap_data *ap = data; | 770 | struct ap_data *ap = data; |
768 | struct ieee80211_hdr_4addr *hdr; | 771 | struct ieee80211_hdr_4addr *hdr; |
769 | struct sta_info *sta; | 772 | struct sta_info *sta; |
770 | DECLARE_MAC_BUF(mac); | ||
771 | 773 | ||
772 | if (skb->len < 24) | 774 | if (skb->len < 24) |
773 | goto fail; | 775 | goto fail; |
@@ -779,9 +781,11 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data) | |||
779 | sta->flags &= ~WLAN_STA_PENDING_POLL; | 781 | sta->flags &= ~WLAN_STA_PENDING_POLL; |
780 | spin_unlock(&ap->sta_table_lock); | 782 | spin_unlock(&ap->sta_table_lock); |
781 | } else { | 783 | } else { |
782 | PDEBUG(DEBUG_AP, "%s: STA %s" | 784 | PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT |
783 | " did not ACK activity poll frame\n", | 785 | " did not ACK activity poll frame\n", |
784 | ap->local->dev->name, print_mac(mac, hdr->addr1)); | 786 | ap->local->dev->name, |
787 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
788 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
785 | } | 789 | } |
786 | 790 | ||
787 | fail: | 791 | fail: |
@@ -1306,7 +1310,6 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1306 | struct sta_info *sta = NULL; | 1310 | struct sta_info *sta = NULL; |
1307 | struct ieee80211_crypt_data *crypt; | 1311 | struct ieee80211_crypt_data *crypt; |
1308 | char *txt = ""; | 1312 | char *txt = ""; |
1309 | DECLARE_MAC_BUF(mac); | ||
1310 | 1313 | ||
1311 | len = skb->len - IEEE80211_MGMT_HDR_LEN; | 1314 | len = skb->len - IEEE80211_MGMT_HDR_LEN; |
1312 | 1315 | ||
@@ -1315,8 +1318,9 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1315 | 1318 | ||
1316 | if (len < 6) { | 1319 | if (len < 6) { |
1317 | PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " | 1320 | PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " |
1318 | "(len=%d) from %s\n", dev->name, len, | 1321 | "(len=%d) from " MAC_FMT "\n", dev->name, len, |
1319 | print_mac(mac, hdr->addr2)); | 1322 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1323 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
1320 | return; | 1324 | return; |
1321 | } | 1325 | } |
1322 | 1326 | ||
@@ -1381,8 +1385,10 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1381 | if (time_after(jiffies, sta->u.ap.last_beacon + | 1385 | if (time_after(jiffies, sta->u.ap.last_beacon + |
1382 | (10 * sta->listen_interval * HZ) / 1024)) { | 1386 | (10 * sta->listen_interval * HZ) / 1024)) { |
1383 | PDEBUG(DEBUG_AP, "%s: no beacons received for a while," | 1387 | PDEBUG(DEBUG_AP, "%s: no beacons received for a while," |
1384 | " assuming AP %s is now STA\n", | 1388 | " assuming AP " MAC_FMT " is now STA\n", |
1385 | dev->name, print_mac(mac, sta->addr)); | 1389 | dev->name, |
1390 | sta->addr[0], sta->addr[1], sta->addr[2], | ||
1391 | sta->addr[3], sta->addr[4], sta->addr[5]); | ||
1386 | sta->ap = 0; | 1392 | sta->ap = 0; |
1387 | sta->flags = 0; | 1393 | sta->flags = 0; |
1388 | sta->u.sta.challenge = NULL; | 1394 | sta->u.sta.challenge = NULL; |
@@ -1497,10 +1503,13 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1497 | } | 1503 | } |
1498 | 1504 | ||
1499 | if (resp) { | 1505 | if (resp) { |
1500 | PDEBUG(DEBUG_AP, "%s: %s auth (alg=%d " | 1506 | PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth (alg=%d " |
1501 | "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", | 1507 | "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", |
1502 | dev->name, print_mac(mac, hdr->addr2), auth_alg, | 1508 | dev->name, |
1503 | auth_transaction, status_code, len, fc, resp, txt); | 1509 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1510 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1511 | auth_alg, auth_transaction, status_code, len, | ||
1512 | fc, resp, txt); | ||
1504 | } | 1513 | } |
1505 | } | 1514 | } |
1506 | 1515 | ||
@@ -1519,14 +1528,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1519 | int send_deauth = 0; | 1528 | int send_deauth = 0; |
1520 | char *txt = ""; | 1529 | char *txt = ""; |
1521 | u8 prev_ap[ETH_ALEN]; | 1530 | u8 prev_ap[ETH_ALEN]; |
1522 | DECLARE_MAC_BUF(mac); | ||
1523 | 1531 | ||
1524 | left = len = skb->len - IEEE80211_MGMT_HDR_LEN; | 1532 | left = len = skb->len - IEEE80211_MGMT_HDR_LEN; |
1525 | 1533 | ||
1526 | if (len < (reassoc ? 10 : 4)) { | 1534 | if (len < (reassoc ? 10 : 4)) { |
1527 | PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " | 1535 | PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " |
1528 | "(len=%d, reassoc=%d) from %s\n", | 1536 | "(len=%d, reassoc=%d) from " MAC_FMT "\n", |
1529 | dev->name, len, reassoc, print_mac(mac, hdr->addr2)); | 1537 | dev->name, len, reassoc, |
1538 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
1539 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]); | ||
1530 | return; | 1540 | return; |
1531 | } | 1541 | } |
1532 | 1542 | ||
@@ -1603,9 +1613,12 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1603 | } | 1613 | } |
1604 | 1614 | ||
1605 | if (left > 0) { | 1615 | if (left > 0) { |
1606 | PDEBUG(DEBUG_AP, "%s: assoc from %s" | 1616 | PDEBUG(DEBUG_AP, "%s: assoc from " MAC_FMT |
1607 | " with extra data (%d bytes) [", | 1617 | " with extra data (%d bytes) [", |
1608 | dev->name, print_mac(mac, hdr->addr2), left); | 1618 | dev->name, |
1619 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
1620 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1621 | left); | ||
1609 | while (left > 0) { | 1622 | while (left > 0) { |
1610 | PDEBUG2(DEBUG_AP, "<%02x>", *u); | 1623 | PDEBUG2(DEBUG_AP, "<%02x>", *u); |
1611 | u++; left--; | 1624 | u++; left--; |
@@ -1704,10 +1717,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1704 | } | 1717 | } |
1705 | 1718 | ||
1706 | #if 0 | 1719 | #if 0 |
1707 | PDEBUG(DEBUG_AP, "%s: %s %sassoc (len=%d " | 1720 | PDEBUG(DEBUG_AP, "%s: " MAC_FMT" %sassoc (len=%d " |
1708 | "prev_ap=%s) => %d(%d) (%s)\n", | 1721 | "prev_ap=" MAC_FMT") => %d(%d) (%s)\n", |
1709 | dev->name, print_mac(mac, hdr->addr2), reassoc ? "re" : "", len, | 1722 | dev->name, |
1710 | print_mac(mac, prev_ap), resp, send_deauth, txt); | 1723 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1724 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1725 | reassoc ? "re" : "", len, | ||
1726 | prev_ap[0], prev_ap[1], prev_ap[2], | ||
1727 | prev_ap[3], prev_ap[4], prev_ap[5], | ||
1728 | resp, send_deauth, txt); | ||
1711 | #endif | 1729 | #endif |
1712 | } | 1730 | } |
1713 | 1731 | ||
@@ -1735,9 +1753,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb, | |||
1735 | pos = (__le16 *) body; | 1753 | pos = (__le16 *) body; |
1736 | reason_code = le16_to_cpu(*pos); | 1754 | reason_code = le16_to_cpu(*pos); |
1737 | 1755 | ||
1738 | PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " | 1756 | PDEBUG(DEBUG_AP, "%s: deauthentication: " MAC_FMT " len=%d, " |
1739 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, | 1757 | "reason_code=%d\n", dev->name, |
1740 | reason_code); | 1758 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1759 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1760 | len, reason_code); | ||
1741 | 1761 | ||
1742 | spin_lock_bh(&local->ap->sta_table_lock); | 1762 | spin_lock_bh(&local->ap->sta_table_lock); |
1743 | sta = ap_get_sta(local->ap, hdr->addr2); | 1763 | sta = ap_get_sta(local->ap, hdr->addr2); |
@@ -1748,9 +1768,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb, | |||
1748 | } | 1768 | } |
1749 | spin_unlock_bh(&local->ap->sta_table_lock); | 1769 | spin_unlock_bh(&local->ap->sta_table_lock); |
1750 | if (sta == NULL) { | 1770 | if (sta == NULL) { |
1751 | printk("%s: deauthentication from %s, " | 1771 | printk("%s: deauthentication from " MAC_FMT ", " |
1752 | "reason_code=%d, but STA not authenticated\n", dev->name, | 1772 | "reason_code=%d, but STA not authenticated\n", dev->name, |
1753 | print_mac(mac, hdr->addr2), reason_code); | 1773 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1774 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1775 | reason_code); | ||
1754 | } | 1776 | } |
1755 | } | 1777 | } |
1756 | 1778 | ||
@@ -1766,7 +1788,6 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, | |||
1766 | u16 reason_code; | 1788 | u16 reason_code; |
1767 | __le16 *pos; | 1789 | __le16 *pos; |
1768 | struct sta_info *sta = NULL; | 1790 | struct sta_info *sta = NULL; |
1769 | DECLARE_MAC_BUF(mac); | ||
1770 | 1791 | ||
1771 | len = skb->len - IEEE80211_MGMT_HDR_LEN; | 1792 | len = skb->len - IEEE80211_MGMT_HDR_LEN; |
1772 | 1793 | ||
@@ -1778,9 +1799,11 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, | |||
1778 | pos = (__le16 *) body; | 1799 | pos = (__le16 *) body; |
1779 | reason_code = le16_to_cpu(*pos); | 1800 | reason_code = le16_to_cpu(*pos); |
1780 | 1801 | ||
1781 | PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " | 1802 | PDEBUG(DEBUG_AP, "%s: disassociation: " MAC_FMT " len=%d, " |
1782 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, | 1803 | "reason_code=%d\n", dev->name, |
1783 | reason_code); | 1804 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], |
1805 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1806 | len, reason_code); | ||
1784 | 1807 | ||
1785 | spin_lock_bh(&local->ap->sta_table_lock); | 1808 | spin_lock_bh(&local->ap->sta_table_lock); |
1786 | sta = ap_get_sta(local->ap, hdr->addr2); | 1809 | sta = ap_get_sta(local->ap, hdr->addr2); |
@@ -1791,9 +1814,12 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, | |||
1791 | } | 1814 | } |
1792 | spin_unlock_bh(&local->ap->sta_table_lock); | 1815 | spin_unlock_bh(&local->ap->sta_table_lock); |
1793 | if (sta == NULL) { | 1816 | if (sta == NULL) { |
1794 | printk("%s: disassociation from %s, " | 1817 | printk("%s: disassociation from " MAC_FMT ", " |
1795 | "reason_code=%d, but STA not authenticated\n", | 1818 | "reason_code=%d, but STA not authenticated\n", |
1796 | dev->name, print_mac(mac, hdr->addr2), reason_code); | 1819 | dev->name, |
1820 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
1821 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1822 | reason_code); | ||
1797 | } | 1823 | } |
1798 | } | 1824 | } |
1799 | 1825 | ||
@@ -1882,16 +1908,20 @@ static void handle_pspoll(local_info_t *local, | |||
1882 | struct sta_info *sta; | 1908 | struct sta_info *sta; |
1883 | u16 aid; | 1909 | u16 aid; |
1884 | struct sk_buff *skb; | 1910 | struct sk_buff *skb; |
1885 | DECLARE_MAC_BUF(mac); | ||
1886 | 1911 | ||
1887 | PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%s" | 1912 | PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MAC_FMT |
1888 | ", TA=%s PWRMGT=%d\n", | 1913 | ", TA=" MAC_FMT " PWRMGT=%d\n", |
1889 | print_mac(mac, hdr->addr1), print_mac(mac, hdr->addr2), | 1914 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], |
1915 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], | ||
1916 | hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], | ||
1917 | hdr->addr2[3], hdr->addr2[4], hdr->addr2[5], | ||
1890 | !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); | 1918 | !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); |
1891 | 1919 | ||
1892 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { | 1920 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { |
1893 | PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=%s" | 1921 | PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MAC_FMT |
1894 | " not own MAC\n", print_mac(mac, hdr->addr1)); | 1922 | " not own MAC\n", |
1923 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
1924 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
1895 | return; | 1925 | return; |
1896 | } | 1926 | } |
1897 | 1927 | ||
@@ -1969,7 +1999,6 @@ static void handle_wds_oper_queue(struct work_struct *work) | |||
1969 | wds_oper_queue); | 1999 | wds_oper_queue); |
1970 | local_info_t *local = ap->local; | 2000 | local_info_t *local = ap->local; |
1971 | struct wds_oper_data *entry, *prev; | 2001 | struct wds_oper_data *entry, *prev; |
1972 | DECLARE_MAC_BUF(mac); | ||
1973 | 2002 | ||
1974 | spin_lock_bh(&local->lock); | 2003 | spin_lock_bh(&local->lock); |
1975 | entry = local->ap->wds_oper_entries; | 2004 | entry = local->ap->wds_oper_entries; |
@@ -1978,10 +2007,11 @@ static void handle_wds_oper_queue(struct work_struct *work) | |||
1978 | 2007 | ||
1979 | while (entry) { | 2008 | while (entry) { |
1980 | PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " | 2009 | PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " |
1981 | "to AP %s\n", | 2010 | "to AP " MAC_FMT "\n", |
1982 | local->dev->name, | 2011 | local->dev->name, |
1983 | entry->type == WDS_ADD ? "adding" : "removing", | 2012 | entry->type == WDS_ADD ? "adding" : "removing", |
1984 | print_mac(mac, entry->addr)); | 2013 | entry->addr[0], entry->addr[1], entry->addr[2], |
2014 | entry->addr[3], entry->addr[4], entry->addr[5]); | ||
1985 | if (entry->type == WDS_ADD) | 2015 | if (entry->type == WDS_ADD) |
1986 | prism2_wds_add(local, entry->addr, 0); | 2016 | prism2_wds_add(local, entry->addr, 0); |
1987 | else if (entry->type == WDS_DEL) | 2017 | else if (entry->type == WDS_DEL) |
@@ -2158,7 +2188,6 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb, | |||
2158 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ | 2188 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ |
2159 | u16 fc, type, stype; | 2189 | u16 fc, type, stype; |
2160 | struct ieee80211_hdr_4addr *hdr; | 2190 | struct ieee80211_hdr_4addr *hdr; |
2161 | DECLARE_MAC_BUF(mac); | ||
2162 | 2191 | ||
2163 | /* FIX: should give skb->len to handler functions and check that the | 2192 | /* FIX: should give skb->len to handler functions and check that the |
2164 | * buffer is long enough */ | 2193 | * buffer is long enough */ |
@@ -2187,8 +2216,9 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb, | |||
2187 | 2216 | ||
2188 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { | 2217 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { |
2189 | PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" | 2218 | PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" |
2190 | "%s not own MAC\n", | 2219 | MAC_FMT " not own MAC\n", |
2191 | print_mac(mac, hdr->addr1)); | 2220 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], |
2221 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
2192 | goto done; | 2222 | goto done; |
2193 | } | 2223 | } |
2194 | 2224 | ||
@@ -2224,14 +2254,18 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb, | |||
2224 | } | 2254 | } |
2225 | 2255 | ||
2226 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { | 2256 | if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { |
2227 | PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%s" | 2257 | PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MAC_FMT |
2228 | " not own MAC\n", print_mac(mac, hdr->addr1)); | 2258 | " not own MAC\n", |
2259 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
2260 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
2229 | goto done; | 2261 | goto done; |
2230 | } | 2262 | } |
2231 | 2263 | ||
2232 | if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { | 2264 | if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { |
2233 | PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%s" | 2265 | PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MAC_FMT |
2234 | " not own MAC\n", print_mac(mac, hdr->addr3)); | 2266 | " not own MAC\n", |
2267 | hdr->addr3[0], hdr->addr3[1], hdr->addr3[2], | ||
2268 | hdr->addr3[3], hdr->addr3[4], hdr->addr3[5]); | ||
2235 | goto done; | 2269 | goto done; |
2236 | } | 2270 | } |
2237 | 2271 | ||
@@ -2312,7 +2346,6 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta) | |||
2312 | struct sk_buff *skb; | 2346 | struct sk_buff *skb; |
2313 | struct ieee80211_hdr_4addr *hdr; | 2347 | struct ieee80211_hdr_4addr *hdr; |
2314 | struct hostap_80211_rx_status rx_stats; | 2348 | struct hostap_80211_rx_status rx_stats; |
2315 | DECLARE_MAC_BUF(mac); | ||
2316 | 2349 | ||
2317 | if (skb_queue_empty(&sta->tx_buf)) | 2350 | if (skb_queue_empty(&sta->tx_buf)) |
2318 | return; | 2351 | return; |
@@ -2334,7 +2367,9 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta) | |||
2334 | hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); | 2367 | hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); |
2335 | 2368 | ||
2336 | PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " | 2369 | PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " |
2337 | "%s\n", local->dev->name, print_mac(mac, sta->addr)); | 2370 | MAC_FMT "\n", local->dev->name, |
2371 | sta->addr[0], sta->addr[1], sta->addr[2], | ||
2372 | sta->addr[3], sta->addr[4], sta->addr[5]); | ||
2338 | 2373 | ||
2339 | skb->dev = local->dev; | 2374 | skb->dev = local->dev; |
2340 | 2375 | ||
@@ -2661,7 +2696,6 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev) | |||
2661 | int ret = sta->tx_rate; | 2696 | int ret = sta->tx_rate; |
2662 | struct hostap_interface *iface; | 2697 | struct hostap_interface *iface; |
2663 | local_info_t *local; | 2698 | local_info_t *local; |
2664 | DECLARE_MAC_BUF(mac); | ||
2665 | 2699 | ||
2666 | iface = netdev_priv(dev); | 2700 | iface = netdev_priv(dev); |
2667 | local = iface->local; | 2701 | local = iface->local; |
@@ -2689,9 +2723,12 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev) | |||
2689 | case 3: sta->tx_rate = 110; break; | 2723 | case 3: sta->tx_rate = 110; break; |
2690 | default: sta->tx_rate = 0; break; | 2724 | default: sta->tx_rate = 0; break; |
2691 | } | 2725 | } |
2692 | PDEBUG(DEBUG_AP, "%s: STA %s" | 2726 | PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT |
2693 | " TX rate raised to %d\n", | 2727 | " TX rate raised to %d\n", |
2694 | dev->name, print_mac(mac, sta->addr), sta->tx_rate); | 2728 | dev->name, |
2729 | sta->addr[0], sta->addr[1], sta->addr[2], | ||
2730 | sta->addr[3], sta->addr[4], sta->addr[5], | ||
2731 | sta->tx_rate); | ||
2695 | } | 2732 | } |
2696 | sta->tx_since_last_failure = 0; | 2733 | sta->tx_since_last_failure = 0; |
2697 | } | 2734 | } |
@@ -2709,7 +2746,6 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx) | |||
2709 | int set_tim, ret; | 2746 | int set_tim, ret; |
2710 | struct ieee80211_hdr_4addr *hdr; | 2747 | struct ieee80211_hdr_4addr *hdr; |
2711 | struct hostap_skb_tx_data *meta; | 2748 | struct hostap_skb_tx_data *meta; |
2712 | DECLARE_MAC_BUF(mac); | ||
2713 | 2749 | ||
2714 | meta = (struct hostap_skb_tx_data *) skb->cb; | 2750 | meta = (struct hostap_skb_tx_data *) skb->cb; |
2715 | ret = AP_TX_CONTINUE; | 2751 | ret = AP_TX_CONTINUE; |
@@ -2745,8 +2781,9 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx) | |||
2745 | * print out any errors here. */ | 2781 | * print out any errors here. */ |
2746 | if (net_ratelimit()) { | 2782 | if (net_ratelimit()) { |
2747 | printk(KERN_DEBUG "AP: drop packet to non-associated " | 2783 | printk(KERN_DEBUG "AP: drop packet to non-associated " |
2748 | "STA %s\n", | 2784 | "STA " MAC_FMT "\n", |
2749 | print_mac(mac, hdr->addr1)); | 2785 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], |
2786 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]); | ||
2750 | } | 2787 | } |
2751 | #endif | 2788 | #endif |
2752 | local->ap->tx_drop_nonassoc++; | 2789 | local->ap->tx_drop_nonassoc++; |
@@ -2784,9 +2821,11 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx) | |||
2784 | } | 2821 | } |
2785 | 2822 | ||
2786 | if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { | 2823 | if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { |
2787 | PDEBUG(DEBUG_PS, "%s: No more space in STA (%s" | 2824 | PDEBUG(DEBUG_PS, "%s: No more space in STA (" MAC_FMT |
2788 | ")'s PS mode buffer\n", | 2825 | ")'s PS mode buffer\n", |
2789 | local->dev->name, print_mac(mac, sta->addr)); | 2826 | local->dev->name, |
2827 | sta->addr[0], sta->addr[1], sta->addr[2], | ||
2828 | sta->addr[3], sta->addr[4], sta->addr[5]); | ||
2790 | /* Make sure that TIM is set for the station (it might not be | 2829 | /* Make sure that TIM is set for the station (it might not be |
2791 | * after AP wlan hw reset). */ | 2830 | * after AP wlan hw reset). */ |
2792 | /* FIX: should fix hw reset to restore bits based on STA | 2831 | /* FIX: should fix hw reset to restore bits based on STA |
@@ -2850,7 +2889,6 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb) | |||
2850 | struct sta_info *sta; | 2889 | struct sta_info *sta; |
2851 | struct ieee80211_hdr_4addr *hdr; | 2890 | struct ieee80211_hdr_4addr *hdr; |
2852 | struct hostap_skb_tx_data *meta; | 2891 | struct hostap_skb_tx_data *meta; |
2853 | DECLARE_MAC_BUF(mac); | ||
2854 | 2892 | ||
2855 | hdr = (struct ieee80211_hdr_4addr *) skb->data; | 2893 | hdr = (struct ieee80211_hdr_4addr *) skb->data; |
2856 | meta = (struct hostap_skb_tx_data *) skb->cb; | 2894 | meta = (struct hostap_skb_tx_data *) skb->cb; |
@@ -2859,9 +2897,12 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb) | |||
2859 | sta = ap_get_sta(local->ap, hdr->addr1); | 2897 | sta = ap_get_sta(local->ap, hdr->addr1); |
2860 | if (!sta) { | 2898 | if (!sta) { |
2861 | spin_unlock(&local->ap->sta_table_lock); | 2899 | spin_unlock(&local->ap->sta_table_lock); |
2862 | PDEBUG(DEBUG_AP, "%s: Could not find STA %s" | 2900 | PDEBUG(DEBUG_AP, "%s: Could not find STA " MAC_FMT |
2863 | " for this TX error (@%lu)\n", | 2901 | " for this TX error (@%lu)\n", |
2864 | local->dev->name, print_mac(mac, hdr->addr1), jiffies); | 2902 | local->dev->name, |
2903 | hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], | ||
2904 | hdr->addr1[3], hdr->addr1[4], hdr->addr1[5], | ||
2905 | jiffies); | ||
2865 | return; | 2906 | return; |
2866 | } | 2907 | } |
2867 | 2908 | ||
@@ -2888,9 +2929,11 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb) | |||
2888 | case 3: sta->tx_rate = 110; break; | 2929 | case 3: sta->tx_rate = 110; break; |
2889 | default: sta->tx_rate = 0; break; | 2930 | default: sta->tx_rate = 0; break; |
2890 | } | 2931 | } |
2891 | PDEBUG(DEBUG_AP, "%s: STA %s" | 2932 | PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT |
2892 | " TX rate lowered to %d\n", | 2933 | " TX rate lowered to %d\n", |
2893 | local->dev->name, print_mac(mac, sta->addr), | 2934 | local->dev->name, |
2935 | sta->addr[0], sta->addr[1], sta->addr[2], | ||
2936 | sta->addr[3], sta->addr[4], sta->addr[5], | ||
2894 | sta->tx_rate); | 2937 | sta->tx_rate); |
2895 | } | 2938 | } |
2896 | sta->tx_consecutive_exc = 0; | 2939 | sta->tx_consecutive_exc = 0; |
@@ -2956,7 +2999,6 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, | |||
2956 | struct sta_info *sta; | 2999 | struct sta_info *sta; |
2957 | u16 fc, type, stype; | 3000 | u16 fc, type, stype; |
2958 | struct ieee80211_hdr_4addr *hdr; | 3001 | struct ieee80211_hdr_4addr *hdr; |
2959 | DECLARE_MAC_BUF(mac); | ||
2960 | 3002 | ||
2961 | if (local->ap == NULL) | 3003 | if (local->ap == NULL) |
2962 | return AP_RX_CONTINUE; | 3004 | return AP_RX_CONTINUE; |
@@ -2988,9 +3030,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, | |||
2988 | } else { | 3030 | } else { |
2989 | printk(KERN_DEBUG "%s: dropped received packet" | 3031 | printk(KERN_DEBUG "%s: dropped received packet" |
2990 | " from non-associated STA " | 3032 | " from non-associated STA " |
2991 | "%s" | 3033 | MAC_FMT |
2992 | " (type=0x%02x, subtype=0x%02x)\n", | 3034 | " (type=0x%02x, subtype=0x%02x)\n", |
2993 | dev->name, print_mac(mac, hdr->addr2), | 3035 | dev->name, |
3036 | hdr->addr2[0], hdr->addr2[1], | ||
3037 | hdr->addr2[2], hdr->addr2[3], | ||
3038 | hdr->addr2[4], hdr->addr2[5], | ||
2994 | type >> 2, stype >> 4); | 3039 | type >> 2, stype >> 4); |
2995 | hostap_rx(dev, skb, rx_stats); | 3040 | hostap_rx(dev, skb, rx_stats); |
2996 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ | 3041 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ |
@@ -3025,8 +3070,11 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, | |||
3025 | * being associated. */ | 3070 | * being associated. */ |
3026 | printk(KERN_DEBUG "%s: rejected received nullfunc " | 3071 | printk(KERN_DEBUG "%s: rejected received nullfunc " |
3027 | "frame without ToDS from not associated STA " | 3072 | "frame without ToDS from not associated STA " |
3028 | "%s\n", | 3073 | MAC_FMT "\n", |
3029 | dev->name, print_mac(mac, hdr->addr2)); | 3074 | dev->name, |
3075 | hdr->addr2[0], hdr->addr2[1], | ||
3076 | hdr->addr2[2], hdr->addr2[3], | ||
3077 | hdr->addr2[4], hdr->addr2[5]); | ||
3030 | hostap_rx(dev, skb, rx_stats); | 3078 | hostap_rx(dev, skb, rx_stats); |
3031 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ | 3079 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ |
3032 | } | 3080 | } |
@@ -3043,9 +3091,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, | |||
3043 | * If BSSID is own, report the dropping of this frame. */ | 3091 | * If BSSID is own, report the dropping of this frame. */ |
3044 | if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { | 3092 | if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { |
3045 | printk(KERN_DEBUG "%s: dropped received packet from " | 3093 | printk(KERN_DEBUG "%s: dropped received packet from " |
3046 | "%s with no ToDS flag " | 3094 | MAC_FMT " with no ToDS flag " |
3047 | "(type=0x%02x, subtype=0x%02x)\n", dev->name, | 3095 | "(type=0x%02x, subtype=0x%02x)\n", dev->name, |
3048 | print_mac(mac, hdr->addr2), type >> 2, stype >> 4); | 3096 | hdr->addr2[0], hdr->addr2[1], |
3097 | hdr->addr2[2], hdr->addr2[3], | ||
3098 | hdr->addr2[4], hdr->addr2[5], | ||
3099 | type >> 2, stype >> 4); | ||
3049 | hostap_dump_rx_80211(dev->name, skb, rx_stats); | 3100 | hostap_dump_rx_80211(dev->name, skb, rx_stats); |
3050 | } | 3101 | } |
3051 | ret = AP_RX_DROP; | 3102 | ret = AP_RX_DROP; |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index a56d9fc6354f..98d6ff69d375 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -10192,7 +10192,6 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, | |||
10192 | u8 id, hdr_len, unicast; | 10192 | u8 id, hdr_len, unicast; |
10193 | u16 remaining_bytes; | 10193 | u16 remaining_bytes; |
10194 | int fc; | 10194 | int fc; |
10195 | DECLARE_MAC_BUF(mac); | ||
10196 | 10195 | ||
10197 | hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); | 10196 | hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); |
10198 | switch (priv->ieee->iw_mode) { | 10197 | switch (priv->ieee->iw_mode) { |
@@ -10203,8 +10202,10 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, | |||
10203 | id = ipw_add_station(priv, hdr->addr1); | 10202 | id = ipw_add_station(priv, hdr->addr1); |
10204 | if (id == IPW_INVALID_STATION) { | 10203 | if (id == IPW_INVALID_STATION) { |
10205 | IPW_WARNING("Attempt to send data to " | 10204 | IPW_WARNING("Attempt to send data to " |
10206 | "invalid cell: %s\n", | 10205 | "invalid cell: " MAC_FMT "\n", |
10207 | print_mac(mac, hdr->addr1)); | 10206 | hdr->addr1[0], hdr->addr1[1], |
10207 | hdr->addr1[2], hdr->addr1[3], | ||
10208 | hdr->addr1[4], hdr->addr1[5]); | ||
10208 | goto drop; | 10209 | goto drop; |
10209 | } | 10210 | } |
10210 | } | 10211 | } |
@@ -11576,6 +11577,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv) | |||
11576 | priv->prom_priv->priv = priv; | 11577 | priv->prom_priv->priv = priv; |
11577 | 11578 | ||
11578 | strcpy(priv->prom_net_dev->name, "rtap%d"); | 11579 | strcpy(priv->prom_net_dev->name, "rtap%d"); |
11580 | memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN); | ||
11579 | 11581 | ||
11580 | priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; | 11582 | priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; |
11581 | priv->prom_net_dev->open = ipw_prom_open; | 11583 | priv->prom_net_dev->open = ipw_prom_open; |
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index d1af938b9aa6..b54ff712e703 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig | |||
@@ -20,7 +20,7 @@ config IWL4965 | |||
20 | runs. | 20 | runs. |
21 | 21 | ||
22 | If you want to compile the driver as a module ( = code which can be | 22 | If you want to compile the driver as a module ( = code which can be |
23 | inserted in and remvoed from the running kernel whenever you want), | 23 | inserted in and removed from the running kernel whenever you want), |
24 | say M here and read <file:Documentation/kbuild/modules.txt>. The | 24 | say M here and read <file:Documentation/kbuild/modules.txt>. The |
25 | module will be called iwl4965.ko. | 25 | module will be called iwl4965.ko. |
26 | 26 | ||
@@ -35,7 +35,6 @@ config IWL4965_HT | |||
35 | bool "Enable 802.11n HT features in iwl4965 driver" | 35 | bool "Enable 802.11n HT features in iwl4965 driver" |
36 | depends on EXPERIMENTAL | 36 | depends on EXPERIMENTAL |
37 | depends on IWL4965 && IWL4965_QOS | 37 | depends on IWL4965 && IWL4965_QOS |
38 | depends on n | ||
39 | ---help--- | 38 | ---help--- |
40 | This option enables IEEE 802.11n High Throughput features | 39 | This option enables IEEE 802.11n High Throughput features |
41 | for the iwl4965 driver. | 40 | for the iwl4965 driver. |
@@ -101,7 +100,7 @@ config IWL3945 | |||
101 | runs. | 100 | runs. |
102 | 101 | ||
103 | If you want to compile the driver as a module ( = code which can be | 102 | If you want to compile the driver as a module ( = code which can be |
104 | inserted in and remvoed from the running kernel whenever you want), | 103 | inserted in and removed from the running kernel whenever you want), |
105 | say M here and read <file:Documentation/kbuild/modules.txt>. The | 104 | say M here and read <file:Documentation/kbuild/modules.txt>. The |
106 | module will be called iwl3945.ko. | 105 | module will be called iwl3945.ko. |
107 | 106 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index d727de8b96fe..65767570be68 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -4589,7 +4589,7 @@ static u8 iwl4965_is_fat_tx_allowed(struct iwl4965_priv *priv, | |||
4589 | 4589 | ||
4590 | if (sta_ht_inf) { | 4590 | if (sta_ht_inf) { |
4591 | if ((!sta_ht_inf->ht_supported) || | 4591 | if ((!sta_ht_inf->ht_supported) || |
4592 | (!sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH)) | 4592 | (!(sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH))) |
4593 | return 0; | 4593 | return 0; |
4594 | } | 4594 | } |
4595 | 4595 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 40b71bc2c4a4..cbaeaf186494 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6206,11 +6206,11 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
6206 | 6206 | ||
6207 | /* At this point, the NIC is initialized and operational */ | 6207 | /* At this point, the NIC is initialized and operational */ |
6208 | priv->notif_missed_beacons = 0; | 6208 | priv->notif_missed_beacons = 0; |
6209 | set_bit(STATUS_READY, &priv->status); | ||
6210 | 6209 | ||
6211 | iwl3945_reg_txpower_periodic(priv); | 6210 | iwl3945_reg_txpower_periodic(priv); |
6212 | 6211 | ||
6213 | IWL_DEBUG_INFO("ALIVE processing complete.\n"); | 6212 | IWL_DEBUG_INFO("ALIVE processing complete.\n"); |
6213 | set_bit(STATUS_READY, &priv->status); | ||
6214 | wake_up_interruptible(&priv->wait_command_queue); | 6214 | wake_up_interruptible(&priv->wait_command_queue); |
6215 | 6215 | ||
6216 | if (priv->error_recovering) | 6216 | if (priv->error_recovering) |
@@ -8706,7 +8706,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
8706 | return err; | 8706 | return err; |
8707 | } | 8707 | } |
8708 | 8708 | ||
8709 | static void iwl3945_pci_remove(struct pci_dev *pdev) | 8709 | static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) |
8710 | { | 8710 | { |
8711 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); | 8711 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); |
8712 | struct list_head *p, *q; | 8712 | struct list_head *p, *q; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index a23d4798653b..60ec29eab85a 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -6628,11 +6628,11 @@ static void iwl4965_alive_start(struct iwl4965_priv *priv) | |||
6628 | 6628 | ||
6629 | /* At this point, the NIC is initialized and operational */ | 6629 | /* At this point, the NIC is initialized and operational */ |
6630 | priv->notif_missed_beacons = 0; | 6630 | priv->notif_missed_beacons = 0; |
6631 | set_bit(STATUS_READY, &priv->status); | ||
6632 | 6631 | ||
6633 | iwl4965_rf_kill_ct_config(priv); | 6632 | iwl4965_rf_kill_ct_config(priv); |
6634 | 6633 | ||
6635 | IWL_DEBUG_INFO("ALIVE processing complete.\n"); | 6634 | IWL_DEBUG_INFO("ALIVE processing complete.\n"); |
6635 | set_bit(STATUS_READY, &priv->status); | ||
6636 | wake_up_interruptible(&priv->wait_command_queue); | 6636 | wake_up_interruptible(&priv->wait_command_queue); |
6637 | 6637 | ||
6638 | if (priv->error_recovering) | 6638 | if (priv->error_recovering) |
@@ -9282,7 +9282,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
9282 | return err; | 9282 | return err; |
9283 | } | 9283 | } |
9284 | 9284 | ||
9285 | static void iwl4965_pci_remove(struct pci_dev *pdev) | 9285 | static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) |
9286 | { | 9286 | { |
9287 | struct iwl4965_priv *priv = pci_get_drvdata(pdev); | 9287 | struct iwl4965_priv *priv = pci_get_drvdata(pdev); |
9288 | struct list_head *p, *q; | 9288 | struct list_head *p, *q; |
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 87e145ffe8f1..6a24ed6067e0 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -541,7 +541,7 @@ void lbs_association_worker(struct work_struct *work) | |||
541 | } | 541 | } |
542 | 542 | ||
543 | if (find_any_ssid) { | 543 | if (find_any_ssid) { |
544 | u8 new_mode; | 544 | u8 new_mode = assoc_req->mode; |
545 | 545 | ||
546 | ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, | 546 | ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, |
547 | &assoc_req->ssid_len, assoc_req->mode, &new_mode); | 547 | &assoc_req->ssid_len, assoc_req->mode, &new_mode); |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 5a9cadb97503..038c66a98f15 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -677,9 +677,7 @@ sbi_get_int_status_exit: | |||
677 | 677 | ||
678 | /* Card has a command result for us */ | 678 | /* Card has a command result for us */ |
679 | if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) { | 679 | if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) { |
680 | spin_lock(&priv->driver_lock); | ||
681 | ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len); | 680 | ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len); |
682 | spin_unlock(&priv->driver_lock); | ||
683 | if (ret < 0) | 681 | if (ret < 0) |
684 | lbs_pr_err("could not receive cmd from card\n"); | 682 | lbs_pr_err("could not receive cmd from card\n"); |
685 | } | 683 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index bd305f7f3efd..e873a39fcce3 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1393,11 +1393,20 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state) | |||
1393 | 1393 | ||
1394 | exit: | 1394 | exit: |
1395 | /* | 1395 | /* |
1396 | * Set device mode to sleep for power management. | 1396 | * Set device mode to sleep for power management, |
1397 | * on some hardware this call seems to consistently fail. | ||
1398 | * From the specifications it is hard to tell why it fails, | ||
1399 | * and if this is a "bad thing". | ||
1400 | * Overall it is safe to just ignore the failure and | ||
1401 | * continue suspending. The only downside is that the | ||
1402 | * device will not be in optimal power save mode, but with | ||
1403 | * the radio and the other components already disabled the | ||
1404 | * device is as good as disabled. | ||
1397 | */ | 1405 | */ |
1398 | retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); | 1406 | retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); |
1399 | if (retval) | 1407 | if (retval) |
1400 | return retval; | 1408 | WARNING(rt2x00dev, "Device failed to enter sleep state, " |
1409 | "continue suspending.\n"); | ||
1401 | 1410 | ||
1402 | return 0; | 1411 | return 0; |
1403 | } | 1412 | } |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 93ea212fedd5..ad2e7d53b3da 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2399,10 +2399,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2399 | * beacon frame. | 2399 | * beacon frame. |
2400 | */ | 2400 | */ |
2401 | if (skb_headroom(skb) < TXD_DESC_SIZE) { | 2401 | if (skb_headroom(skb) < TXD_DESC_SIZE) { |
2402 | if (pskb_expand_head(skb, TXD_DESC_SIZE, 0, GFP_ATOMIC)) { | 2402 | if (pskb_expand_head(skb, TXD_DESC_SIZE, 0, GFP_ATOMIC)) |
2403 | dev_kfree_skb(skb); | ||
2404 | return -ENOMEM; | 2403 | return -ENOMEM; |
2405 | } | ||
2406 | } | 2404 | } |
2407 | 2405 | ||
2408 | /* | 2406 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 8103d41a1543..3909cf42f472 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2095,6 +2095,8 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2095 | { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, | 2095 | { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, |
2096 | /* Conceptronic */ | 2096 | /* Conceptronic */ |
2097 | { USB_DEVICE(0x14b2, 0x3c22), USB_DEVICE_DATA(&rt73usb_ops) }, | 2097 | { USB_DEVICE(0x14b2, 0x3c22), USB_DEVICE_DATA(&rt73usb_ops) }, |
2098 | /* Corega */ | ||
2099 | { USB_DEVICE(0x07aa, 0x002e), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2098 | /* D-Link */ | 2100 | /* D-Link */ |
2099 | { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, | 2101 | { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, |
2100 | { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, | 2102 | { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, |
diff --git a/drivers/net/wireless/wavelan_cs.h b/drivers/net/wireless/wavelan_cs.h index fabc63ee153c..2e4bfe4147c6 100644 --- a/drivers/net/wireless/wavelan_cs.h +++ b/drivers/net/wireless/wavelan_cs.h | |||
@@ -309,7 +309,7 @@ struct mmw_t | |||
309 | #define MMW_EXT_ANT_INTERNAL 0x00 /* Internal antenna */ | 309 | #define MMW_EXT_ANT_INTERNAL 0x00 /* Internal antenna */ |
310 | #define MMW_EXT_ANT_EXTERNAL 0x03 /* External antenna */ | 310 | #define MMW_EXT_ANT_EXTERNAL 0x03 /* External antenna */ |
311 | #define MMW_EXT_ANT_IQ_TEST 0x1C /* IQ test pattern (set to 0) */ | 311 | #define MMW_EXT_ANT_IQ_TEST 0x1C /* IQ test pattern (set to 0) */ |
312 | }; | 312 | } __attribute__((packed)); |
313 | 313 | ||
314 | /* Size for structure checking (if padding is correct) */ | 314 | /* Size for structure checking (if padding is correct) */ |
315 | #define MMW_SIZE 37 | 315 | #define MMW_SIZE 37 |