diff options
Diffstat (limited to 'drivers/net')
150 files changed, 1790 insertions, 1142 deletions
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 25197b698dd6..b8b4c7ba884f 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -89,16 +89,16 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
89 | BUGLVL(D_NORMAL) printk(VERSION); | 89 | BUGLVL(D_NORMAL) printk(VERSION); |
90 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); | 90 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); |
91 | 91 | ||
92 | BUGMSG(D_NORMAL, "Given: node %02Xh, shmem %lXh, irq %d\n", | 92 | BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n", |
93 | dev->dev_addr[0], dev->mem_start, dev->irq); | 93 | dev->dev_addr[0], dev->mem_start, dev->irq); |
94 | 94 | ||
95 | if (dev->mem_start <= 0 || dev->irq <= 0) { | 95 | if (dev->mem_start <= 0 || dev->irq <= 0) { |
96 | BUGMSG(D_NORMAL, "No autoprobe for RIM I; you " | 96 | BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you " |
97 | "must specify the shmem and irq!\n"); | 97 | "must specify the shmem and irq!\n"); |
98 | return -ENODEV; | 98 | return -ENODEV; |
99 | } | 99 | } |
100 | if (dev->dev_addr[0] == 0) { | 100 | if (dev->dev_addr[0] == 0) { |
101 | BUGMSG(D_NORMAL, "You need to specify your card's station " | 101 | BUGLVL(D_NORMAL) printk("You need to specify your card's station " |
102 | "ID!\n"); | 102 | "ID!\n"); |
103 | return -ENODEV; | 103 | return -ENODEV; |
104 | } | 104 | } |
@@ -109,7 +109,7 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
109 | * will be taken. | 109 | * will be taken. |
110 | */ | 110 | */ |
111 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { | 111 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { |
112 | BUGMSG(D_NORMAL, "Card memory already allocated\n"); | 112 | BUGLVL(D_NORMAL) printk("Card memory already allocated\n"); |
113 | return -ENODEV; | 113 | return -ENODEV; |
114 | } | 114 | } |
115 | return arcrimi_found(dev); | 115 | return arcrimi_found(dev); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 0c76186bb9e7..62d2409bb293 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -891,9 +891,15 @@ static void bond_do_fail_over_mac(struct bonding *bond, | |||
891 | 891 | ||
892 | switch (bond->params.fail_over_mac) { | 892 | switch (bond->params.fail_over_mac) { |
893 | case BOND_FOM_ACTIVE: | 893 | case BOND_FOM_ACTIVE: |
894 | if (new_active) | 894 | if (new_active) { |
895 | memcpy(bond->dev->dev_addr, new_active->dev->dev_addr, | 895 | memcpy(bond->dev->dev_addr, new_active->dev->dev_addr, |
896 | new_active->dev->addr_len); | 896 | new_active->dev->addr_len); |
897 | write_unlock_bh(&bond->curr_slave_lock); | ||
898 | read_unlock(&bond->lock); | ||
899 | call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); | ||
900 | read_lock(&bond->lock); | ||
901 | write_lock_bh(&bond->curr_slave_lock); | ||
902 | } | ||
897 | break; | 903 | break; |
898 | case BOND_FOM_FOLLOW: | 904 | case BOND_FOM_FOLLOW: |
899 | /* | 905 | /* |
@@ -2028,6 +2034,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
2028 | write_unlock_bh(&bond->lock); | 2034 | write_unlock_bh(&bond->lock); |
2029 | unblock_netpoll_tx(); | 2035 | unblock_netpoll_tx(); |
2030 | 2036 | ||
2037 | if (bond->slave_cnt == 0) | ||
2038 | call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); | ||
2039 | |||
2031 | bond_compute_features(bond); | 2040 | bond_compute_features(bond); |
2032 | if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && | 2041 | if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && |
2033 | (old_features & NETIF_F_VLAN_CHALLENGED)) | 2042 | (old_features & NETIF_F_VLAN_CHALLENGED)) |
@@ -3001,7 +3010,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
3001 | trans_start + delta_in_ticks)) || | 3010 | trans_start + delta_in_ticks)) || |
3002 | bond->curr_active_slave != slave) { | 3011 | bond->curr_active_slave != slave) { |
3003 | slave->link = BOND_LINK_UP; | 3012 | slave->link = BOND_LINK_UP; |
3004 | bond->current_arp_slave = NULL; | 3013 | if (bond->current_arp_slave) { |
3014 | bond_set_slave_inactive_flags( | ||
3015 | bond->current_arp_slave); | ||
3016 | bond->current_arp_slave = NULL; | ||
3017 | } | ||
3005 | 3018 | ||
3006 | pr_info("%s: link status definitely up for interface %s.\n", | 3019 | pr_info("%s: link status definitely up for interface %s.\n", |
3007 | bond->dev->name, slave->dev->name); | 3020 | bond->dev->name, slave->dev->name); |
@@ -3695,17 +3708,52 @@ static void bond_set_multicast_list(struct net_device *bond_dev) | |||
3695 | read_unlock(&bond->lock); | 3708 | read_unlock(&bond->lock); |
3696 | } | 3709 | } |
3697 | 3710 | ||
3698 | static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms) | 3711 | static int bond_neigh_init(struct neighbour *n) |
3699 | { | 3712 | { |
3700 | struct bonding *bond = netdev_priv(dev); | 3713 | struct bonding *bond = netdev_priv(n->dev); |
3701 | struct slave *slave = bond->first_slave; | 3714 | struct slave *slave = bond->first_slave; |
3715 | const struct net_device_ops *slave_ops; | ||
3716 | struct neigh_parms parms; | ||
3717 | int ret; | ||
3718 | |||
3719 | if (!slave) | ||
3720 | return 0; | ||
3721 | |||
3722 | slave_ops = slave->dev->netdev_ops; | ||
3723 | |||
3724 | if (!slave_ops->ndo_neigh_setup) | ||
3725 | return 0; | ||
3726 | |||
3727 | parms.neigh_setup = NULL; | ||
3728 | parms.neigh_cleanup = NULL; | ||
3729 | ret = slave_ops->ndo_neigh_setup(slave->dev, &parms); | ||
3730 | if (ret) | ||
3731 | return ret; | ||
3732 | |||
3733 | /* | ||
3734 | * Assign slave's neigh_cleanup to neighbour in case cleanup is called | ||
3735 | * after the last slave has been detached. Assumes that all slaves | ||
3736 | * utilize the same neigh_cleanup (true at this writing as only user | ||
3737 | * is ipoib). | ||
3738 | */ | ||
3739 | n->parms->neigh_cleanup = parms.neigh_cleanup; | ||
3740 | |||
3741 | if (!parms.neigh_setup) | ||
3742 | return 0; | ||
3743 | |||
3744 | return parms.neigh_setup(n); | ||
3745 | } | ||
3746 | |||
3747 | /* | ||
3748 | * The bonding ndo_neigh_setup is called at init time beofre any | ||
3749 | * slave exists. So we must declare proxy setup function which will | ||
3750 | * be used at run time to resolve the actual slave neigh param setup. | ||
3751 | */ | ||
3752 | static int bond_neigh_setup(struct net_device *dev, | ||
3753 | struct neigh_parms *parms) | ||
3754 | { | ||
3755 | parms->neigh_setup = bond_neigh_init; | ||
3702 | 3756 | ||
3703 | if (slave) { | ||
3704 | const struct net_device_ops *slave_ops | ||
3705 | = slave->dev->netdev_ops; | ||
3706 | if (slave_ops->ndo_neigh_setup) | ||
3707 | return slave_ops->ndo_neigh_setup(slave->dev, parms); | ||
3708 | } | ||
3709 | return 0; | 3757 | return 0; |
3710 | } | 3758 | } |
3711 | 3759 | ||
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 9a66e2a910ae..9c1c8cd5223f 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c | |||
@@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work) | |||
744 | size_t fifo_occupancy = 0; | 744 | size_t fifo_occupancy = 0; |
745 | 745 | ||
746 | /* Wakeup timeout */ | 746 | /* Wakeup timeout */ |
747 | dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n", | 747 | dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n", |
748 | __func__); | 748 | __func__); |
749 | 749 | ||
750 | /* Check FIFO to check if modem has sent something. */ | 750 | /* Check FIFO to check if modem has sent something. */ |
751 | WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev, | 751 | WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev, |
752 | &fifo_occupancy)); | 752 | &fifo_occupancy)); |
753 | 753 | ||
754 | dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", | 754 | dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", |
755 | __func__, (unsigned) fifo_occupancy); | 755 | __func__, (unsigned) fifo_occupancy); |
756 | 756 | ||
757 | /* Check if we misssed the interrupt. */ | 757 | /* Check if we misssed the interrupt. */ |
@@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev) | |||
1210 | 1210 | ||
1211 | static void cfhsi_shutdown(struct cfhsi *cfhsi) | 1211 | static void cfhsi_shutdown(struct cfhsi *cfhsi) |
1212 | { | 1212 | { |
1213 | u8 *tx_buf, *rx_buf; | 1213 | u8 *tx_buf, *rx_buf, *flip_buf; |
1214 | 1214 | ||
1215 | /* Stop TXing */ | 1215 | /* Stop TXing */ |
1216 | netif_tx_stop_all_queues(cfhsi->ndev); | 1216 | netif_tx_stop_all_queues(cfhsi->ndev); |
@@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) | |||
1234 | /* Store bufferes: will be freed later. */ | 1234 | /* Store bufferes: will be freed later. */ |
1235 | tx_buf = cfhsi->tx_buf; | 1235 | tx_buf = cfhsi->tx_buf; |
1236 | rx_buf = cfhsi->rx_buf; | 1236 | rx_buf = cfhsi->rx_buf; |
1237 | 1237 | flip_buf = cfhsi->rx_flip_buf; | |
1238 | /* Flush transmit queues. */ | 1238 | /* Flush transmit queues. */ |
1239 | cfhsi_abort_tx(cfhsi); | 1239 | cfhsi_abort_tx(cfhsi); |
1240 | 1240 | ||
@@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) | |||
1247 | /* Free buffers. */ | 1247 | /* Free buffers. */ |
1248 | kfree(tx_buf); | 1248 | kfree(tx_buf); |
1249 | kfree(rx_buf); | 1249 | kfree(rx_buf); |
1250 | kfree(flip_buf); | ||
1250 | } | 1251 | } |
1251 | 1252 | ||
1252 | int cfhsi_remove(struct platform_device *pdev) | 1253 | int cfhsi_remove(struct platform_device *pdev) |
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c index 96391c36fa74..b71ce9bf0afb 100644 --- a/drivers/net/caif/caif_spi.c +++ b/drivers/net/caif/caif_spi.c | |||
@@ -127,12 +127,6 @@ static inline void dev_debugfs_rem(struct cfspi *cfspi) | |||
127 | debugfs_remove(cfspi->dbgfs_dir); | 127 | debugfs_remove(cfspi->dbgfs_dir); |
128 | } | 128 | } |
129 | 129 | ||
130 | static int dbgfs_open(struct inode *inode, struct file *file) | ||
131 | { | ||
132 | file->private_data = inode->i_private; | ||
133 | return 0; | ||
134 | } | ||
135 | |||
136 | static ssize_t dbgfs_state(struct file *file, char __user *user_buf, | 130 | static ssize_t dbgfs_state(struct file *file, char __user *user_buf, |
137 | size_t count, loff_t *ppos) | 131 | size_t count, loff_t *ppos) |
138 | { | 132 | { |
@@ -243,13 +237,13 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf, | |||
243 | } | 237 | } |
244 | 238 | ||
245 | static const struct file_operations dbgfs_state_fops = { | 239 | static const struct file_operations dbgfs_state_fops = { |
246 | .open = dbgfs_open, | 240 | .open = simple_open, |
247 | .read = dbgfs_state, | 241 | .read = dbgfs_state, |
248 | .owner = THIS_MODULE | 242 | .owner = THIS_MODULE |
249 | }; | 243 | }; |
250 | 244 | ||
251 | static const struct file_operations dbgfs_frame_fops = { | 245 | static const struct file_operations dbgfs_frame_fops = { |
252 | .open = dbgfs_open, | 246 | .open = simple_open, |
253 | .read = dbgfs_frame, | 247 | .read = dbgfs_frame, |
254 | .owner = THIS_MODULE | 248 | .owner = THIS_MODULE |
255 | }; | 249 | }; |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index 5234586dff15..629c4ba5d49d 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c | |||
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
875 | PCAN_USBPRO_INFO_FW, | 875 | PCAN_USBPRO_INFO_FW, |
876 | &fi, sizeof(fi)); | 876 | &fi, sizeof(fi)); |
877 | if (err) { | 877 | if (err) { |
878 | kfree(usb_if); | ||
878 | dev_err(dev->netdev->dev.parent, | 879 | dev_err(dev->netdev->dev.parent, |
879 | "unable to read %s firmware info (err %d)\n", | 880 | "unable to read %s firmware info (err %d)\n", |
880 | pcan_usb_pro.name, err); | 881 | pcan_usb_pro.name, err); |
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
885 | PCAN_USBPRO_INFO_BL, | 886 | PCAN_USBPRO_INFO_BL, |
886 | &bi, sizeof(bi)); | 887 | &bi, sizeof(bi)); |
887 | if (err) { | 888 | if (err) { |
889 | kfree(usb_if); | ||
888 | dev_err(dev->netdev->dev.parent, | 890 | dev_err(dev->netdev->dev.parent, |
889 | "unable to read %s bootloader info (err %d)\n", | 891 | "unable to read %s bootloader info (err %d)\n", |
890 | pcan_usb_pro.name, err); | 892 | pcan_usb_pro.name, err); |
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index d5c6d92f1ee7..442d91a2747b 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -107,14 +107,14 @@ static int dummy_dev_init(struct net_device *dev) | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | static void dummy_dev_free(struct net_device *dev) | 110 | static void dummy_dev_uninit(struct net_device *dev) |
111 | { | 111 | { |
112 | free_percpu(dev->dstats); | 112 | free_percpu(dev->dstats); |
113 | free_netdev(dev); | ||
114 | } | 113 | } |
115 | 114 | ||
116 | static const struct net_device_ops dummy_netdev_ops = { | 115 | static const struct net_device_ops dummy_netdev_ops = { |
117 | .ndo_init = dummy_dev_init, | 116 | .ndo_init = dummy_dev_init, |
117 | .ndo_uninit = dummy_dev_uninit, | ||
118 | .ndo_start_xmit = dummy_xmit, | 118 | .ndo_start_xmit = dummy_xmit, |
119 | .ndo_validate_addr = eth_validate_addr, | 119 | .ndo_validate_addr = eth_validate_addr, |
120 | .ndo_set_rx_mode = set_multicast_list, | 120 | .ndo_set_rx_mode = set_multicast_list, |
@@ -128,7 +128,7 @@ static void dummy_setup(struct net_device *dev) | |||
128 | 128 | ||
129 | /* Initialize the device structure. */ | 129 | /* Initialize the device structure. */ |
130 | dev->netdev_ops = &dummy_netdev_ops; | 130 | dev->netdev_ops = &dummy_netdev_ops; |
131 | dev->destructor = dummy_dev_free; | 131 | dev->destructor = free_netdev; |
132 | 132 | ||
133 | /* Fill in device structure with ethernet-generic values. */ | 133 | /* Fill in device structure with ethernet-generic values. */ |
134 | dev->tx_queue_len = 0; | 134 | dev->tx_queue_len = 0; |
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index a59cf961a436..f219d38acf58 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -125,6 +125,7 @@ | |||
125 | #include <linux/if.h> | 125 | #include <linux/if.h> |
126 | #include <linux/if_arp.h> | 126 | #include <linux/if_arp.h> |
127 | #include <linux/if_eql.h> | 127 | #include <linux/if_eql.h> |
128 | #include <linux/pkt_sched.h> | ||
128 | 129 | ||
129 | #include <asm/uaccess.h> | 130 | #include <asm/uaccess.h> |
130 | 131 | ||
@@ -143,7 +144,7 @@ static void eql_timer(unsigned long param) | |||
143 | equalizer_t *eql = (equalizer_t *) param; | 144 | equalizer_t *eql = (equalizer_t *) param; |
144 | struct list_head *this, *tmp, *head; | 145 | struct list_head *this, *tmp, *head; |
145 | 146 | ||
146 | spin_lock_bh(&eql->queue.lock); | 147 | spin_lock(&eql->queue.lock); |
147 | head = &eql->queue.all_slaves; | 148 | head = &eql->queue.all_slaves; |
148 | list_for_each_safe(this, tmp, head) { | 149 | list_for_each_safe(this, tmp, head) { |
149 | slave_t *slave = list_entry(this, slave_t, list); | 150 | slave_t *slave = list_entry(this, slave_t, list); |
@@ -157,7 +158,7 @@ static void eql_timer(unsigned long param) | |||
157 | } | 158 | } |
158 | 159 | ||
159 | } | 160 | } |
160 | spin_unlock_bh(&eql->queue.lock); | 161 | spin_unlock(&eql->queue.lock); |
161 | 162 | ||
162 | eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; | 163 | eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; |
163 | add_timer(&eql->timer); | 164 | add_timer(&eql->timer); |
@@ -341,7 +342,7 @@ static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) | |||
341 | struct net_device *slave_dev = slave->dev; | 342 | struct net_device *slave_dev = slave->dev; |
342 | 343 | ||
343 | skb->dev = slave_dev; | 344 | skb->dev = slave_dev; |
344 | skb->priority = 1; | 345 | skb->priority = TC_PRIO_FILLER; |
345 | slave->bytes_queued += skb->len; | 346 | slave->bytes_queued += skb->len; |
346 | dev_queue_xmit(skb); | 347 | dev_queue_xmit(skb); |
347 | dev->stats.tx_packets++; | 348 | dev->stats.tx_packets++; |
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index 40ac41436549..c926857e8205 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.c +++ b/drivers/net/ethernet/atheros/atlx/atl1.c | |||
@@ -2476,7 +2476,7 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
2476 | "pcie phy link down %x\n", status); | 2476 | "pcie phy link down %x\n", status); |
2477 | if (netif_running(adapter->netdev)) { /* reset MAC */ | 2477 | if (netif_running(adapter->netdev)) { /* reset MAC */ |
2478 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 2478 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
2479 | schedule_work(&adapter->pcie_dma_to_rst_task); | 2479 | schedule_work(&adapter->reset_dev_task); |
2480 | return IRQ_HANDLED; | 2480 | return IRQ_HANDLED; |
2481 | } | 2481 | } |
2482 | } | 2482 | } |
@@ -2488,7 +2488,7 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
2488 | "pcie DMA r/w error (status = 0x%x)\n", | 2488 | "pcie DMA r/w error (status = 0x%x)\n", |
2489 | status); | 2489 | status); |
2490 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 2490 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
2491 | schedule_work(&adapter->pcie_dma_to_rst_task); | 2491 | schedule_work(&adapter->reset_dev_task); |
2492 | return IRQ_HANDLED; | 2492 | return IRQ_HANDLED; |
2493 | } | 2493 | } |
2494 | 2494 | ||
@@ -2633,10 +2633,10 @@ static void atl1_down(struct atl1_adapter *adapter) | |||
2633 | atl1_clean_rx_ring(adapter); | 2633 | atl1_clean_rx_ring(adapter); |
2634 | } | 2634 | } |
2635 | 2635 | ||
2636 | static void atl1_tx_timeout_task(struct work_struct *work) | 2636 | static void atl1_reset_dev_task(struct work_struct *work) |
2637 | { | 2637 | { |
2638 | struct atl1_adapter *adapter = | 2638 | struct atl1_adapter *adapter = |
2639 | container_of(work, struct atl1_adapter, tx_timeout_task); | 2639 | container_of(work, struct atl1_adapter, reset_dev_task); |
2640 | struct net_device *netdev = adapter->netdev; | 2640 | struct net_device *netdev = adapter->netdev; |
2641 | 2641 | ||
2642 | netif_device_detach(netdev); | 2642 | netif_device_detach(netdev); |
@@ -3038,12 +3038,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
3038 | (unsigned long)adapter); | 3038 | (unsigned long)adapter); |
3039 | adapter->phy_timer_pending = false; | 3039 | adapter->phy_timer_pending = false; |
3040 | 3040 | ||
3041 | INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task); | 3041 | INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task); |
3042 | 3042 | ||
3043 | INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task); | 3043 | INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task); |
3044 | 3044 | ||
3045 | INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task); | ||
3046 | |||
3047 | err = register_netdev(netdev); | 3045 | err = register_netdev(netdev); |
3048 | if (err) | 3046 | if (err) |
3049 | goto err_common; | 3047 | goto err_common; |
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.h b/drivers/net/ethernet/atheros/atlx/atl1.h index 109d6da8be97..e04bf4d71e46 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.h +++ b/drivers/net/ethernet/atheros/atlx/atl1.h | |||
@@ -758,9 +758,8 @@ struct atl1_adapter { | |||
758 | u16 link_speed; | 758 | u16 link_speed; |
759 | u16 link_duplex; | 759 | u16 link_duplex; |
760 | spinlock_t lock; | 760 | spinlock_t lock; |
761 | struct work_struct tx_timeout_task; | 761 | struct work_struct reset_dev_task; |
762 | struct work_struct link_chg_task; | 762 | struct work_struct link_chg_task; |
763 | struct work_struct pcie_dma_to_rst_task; | ||
764 | 763 | ||
765 | struct timer_list phy_config_timer; | 764 | struct timer_list phy_config_timer; |
766 | bool phy_timer_pending; | 765 | bool phy_timer_pending; |
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c index 3cd8837236dc..c9e9dc57986c 100644 --- a/drivers/net/ethernet/atheros/atlx/atlx.c +++ b/drivers/net/ethernet/atheros/atlx/atlx.c | |||
@@ -194,7 +194,7 @@ static void atlx_tx_timeout(struct net_device *netdev) | |||
194 | { | 194 | { |
195 | struct atlx_adapter *adapter = netdev_priv(netdev); | 195 | struct atlx_adapter *adapter = netdev_priv(netdev); |
196 | /* Do the reset outside of interrupt context */ | 196 | /* Do the reset outside of interrupt context */ |
197 | schedule_work(&adapter->tx_timeout_task); | 197 | schedule_work(&adapter->reset_dev_task); |
198 | } | 198 | } |
199 | 199 | ||
200 | /* | 200 | /* |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index e37161f19250..2c9ee552dffc 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1173,6 +1173,13 @@ enum { | |||
1173 | }; | 1173 | }; |
1174 | 1174 | ||
1175 | 1175 | ||
1176 | struct bnx2x_prev_path_list { | ||
1177 | u8 bus; | ||
1178 | u8 slot; | ||
1179 | u8 path; | ||
1180 | struct list_head list; | ||
1181 | }; | ||
1182 | |||
1176 | struct bnx2x { | 1183 | struct bnx2x { |
1177 | /* Fields used in the tx and intr/napi performance paths | 1184 | /* Fields used in the tx and intr/napi performance paths |
1178 | * are grouped together in the beginning of the structure | 1185 | * are grouped together in the beginning of the structure |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index f1f3ca65667a..4b054812713a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1721,6 +1721,29 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp) | |||
1721 | } while (0) | 1721 | } while (0) |
1722 | #endif | 1722 | #endif |
1723 | 1723 | ||
1724 | bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err) | ||
1725 | { | ||
1726 | /* build FW version dword */ | ||
1727 | u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) + | ||
1728 | (BCM_5710_FW_MINOR_VERSION << 8) + | ||
1729 | (BCM_5710_FW_REVISION_VERSION << 16) + | ||
1730 | (BCM_5710_FW_ENGINEERING_VERSION << 24); | ||
1731 | |||
1732 | /* read loaded FW from chip */ | ||
1733 | u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM); | ||
1734 | |||
1735 | DP(NETIF_MSG_IFUP, "loaded fw %x, my fw %x\n", loaded_fw, my_fw); | ||
1736 | |||
1737 | if (loaded_fw != my_fw) { | ||
1738 | if (is_err) | ||
1739 | BNX2X_ERR("bnx2x with FW %x was already loaded, which mismatches my %x FW. aborting\n", | ||
1740 | loaded_fw, my_fw); | ||
1741 | return false; | ||
1742 | } | ||
1743 | |||
1744 | return true; | ||
1745 | } | ||
1746 | |||
1724 | /* must be called with rtnl_lock */ | 1747 | /* must be called with rtnl_lock */ |
1725 | int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | 1748 | int bnx2x_nic_load(struct bnx2x *bp, int load_mode) |
1726 | { | 1749 | { |
@@ -1815,23 +1838,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
1815 | } | 1838 | } |
1816 | if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP && | 1839 | if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP && |
1817 | load_code != FW_MSG_CODE_DRV_LOAD_COMMON) { | 1840 | load_code != FW_MSG_CODE_DRV_LOAD_COMMON) { |
1818 | /* build FW version dword */ | ||
1819 | u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) + | ||
1820 | (BCM_5710_FW_MINOR_VERSION << 8) + | ||
1821 | (BCM_5710_FW_REVISION_VERSION << 16) + | ||
1822 | (BCM_5710_FW_ENGINEERING_VERSION << 24); | ||
1823 | |||
1824 | /* read loaded FW from chip */ | ||
1825 | u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM); | ||
1826 | |||
1827 | DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x", | ||
1828 | loaded_fw, my_fw); | ||
1829 | |||
1830 | /* abort nic load if version mismatch */ | 1841 | /* abort nic load if version mismatch */ |
1831 | if (my_fw != loaded_fw) { | 1842 | if (!bnx2x_test_firmware_version(bp, true)) { |
1832 | BNX2X_ERR("bnx2x with FW %x already loaded, " | ||
1833 | "which mismatches my %x FW. aborting", | ||
1834 | loaded_fw, my_fw); | ||
1835 | rc = -EBUSY; | 1843 | rc = -EBUSY; |
1836 | LOAD_ERROR_EXIT(bp, load_error2); | 1844 | LOAD_ERROR_EXIT(bp, load_error2); |
1837 | } | 1845 | } |
@@ -1866,7 +1874,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
1866 | * bnx2x_periodic_task(). | 1874 | * bnx2x_periodic_task(). |
1867 | */ | 1875 | */ |
1868 | smp_mb(); | 1876 | smp_mb(); |
1869 | queue_delayed_work(bnx2x_wq, &bp->period_task, 0); | ||
1870 | } else | 1877 | } else |
1871 | bp->port.pmf = 0; | 1878 | bp->port.pmf = 0; |
1872 | 1879 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 8b163388659a..5c27454d2ec2 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -431,6 +431,9 @@ void bnx2x_panic_dump(struct bnx2x *bp); | |||
431 | 431 | ||
432 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl); | 432 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl); |
433 | 433 | ||
434 | /* validate currect fw is loaded */ | ||
435 | bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err); | ||
436 | |||
434 | /* dev_close main block */ | 437 | /* dev_close main block */ |
435 | int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode); | 438 | int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode); |
436 | 439 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h index cd6dfa9eaa3a..b9b263323436 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | |||
@@ -25,31 +25,31 @@ | |||
25 | (IRO[149].base + ((funcId) * IRO[149].m1)) | 25 | (IRO[149].base + ((funcId) * IRO[149].m1)) |
26 | #define CSTORM_IGU_MODE_OFFSET (IRO[157].base) | 26 | #define CSTORM_IGU_MODE_OFFSET (IRO[157].base) |
27 | #define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ | 27 | #define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ |
28 | (IRO[315].base + ((pfId) * IRO[315].m1)) | ||
29 | #define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \ | ||
30 | (IRO[316].base + ((pfId) * IRO[316].m1)) | 28 | (IRO[316].base + ((pfId) * IRO[316].m1)) |
29 | #define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \ | ||
30 | (IRO[317].base + ((pfId) * IRO[317].m1)) | ||
31 | #define CSTORM_ISCSI_EQ_CONS_OFFSET(pfId, iscsiEqId) \ | 31 | #define CSTORM_ISCSI_EQ_CONS_OFFSET(pfId, iscsiEqId) \ |
32 | (IRO[308].base + ((pfId) * IRO[308].m1) + ((iscsiEqId) * IRO[308].m2)) | 32 | (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2)) |
33 | #define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfId, iscsiEqId) \ | 33 | #define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfId, iscsiEqId) \ |
34 | (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2)) | 34 | (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2)) |
35 | #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfId, iscsiEqId) \ | 35 | #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfId, iscsiEqId) \ |
36 | (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2)) | 36 | (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2)) |
37 | #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfId, iscsiEqId) \ | 37 | #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfId, iscsiEqId) \ |
38 | (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2)) | 38 | (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2)) |
39 | #define CSTORM_ISCSI_EQ_PROD_OFFSET(pfId, iscsiEqId) \ | 39 | #define CSTORM_ISCSI_EQ_PROD_OFFSET(pfId, iscsiEqId) \ |
40 | (IRO[307].base + ((pfId) * IRO[307].m1) + ((iscsiEqId) * IRO[307].m2)) | 40 | (IRO[308].base + ((pfId) * IRO[308].m1) + ((iscsiEqId) * IRO[308].m2)) |
41 | #define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfId, iscsiEqId) \ | 41 | #define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfId, iscsiEqId) \ |
42 | (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2)) | 42 | (IRO[314].base + ((pfId) * IRO[314].m1) + ((iscsiEqId) * IRO[314].m2)) |
43 | #define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfId, iscsiEqId) \ | 43 | #define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfId, iscsiEqId) \ |
44 | (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2)) | 44 | (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2)) |
45 | #define CSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ | 45 | #define CSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ |
46 | (IRO[314].base + ((pfId) * IRO[314].m1)) | 46 | (IRO[315].base + ((pfId) * IRO[315].m1)) |
47 | #define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ | 47 | #define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ |
48 | (IRO[306].base + ((pfId) * IRO[306].m1)) | 48 | (IRO[307].base + ((pfId) * IRO[307].m1)) |
49 | #define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ | 49 | #define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ |
50 | (IRO[305].base + ((pfId) * IRO[305].m1)) | 50 | (IRO[306].base + ((pfId) * IRO[306].m1)) |
51 | #define CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ | 51 | #define CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ |
52 | (IRO[304].base + ((pfId) * IRO[304].m1)) | 52 | (IRO[305].base + ((pfId) * IRO[305].m1)) |
53 | #define CSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ | 53 | #define CSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ |
54 | (IRO[151].base + ((funcId) * IRO[151].m1)) | 54 | (IRO[151].base + ((funcId) * IRO[151].m1)) |
55 | #define CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(pfId) \ | 55 | #define CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(pfId) \ |
@@ -96,37 +96,37 @@ | |||
96 | #define TSTORM_FUNC_EN_OFFSET(funcId) \ | 96 | #define TSTORM_FUNC_EN_OFFSET(funcId) \ |
97 | (IRO[103].base + ((funcId) * IRO[103].m1)) | 97 | (IRO[103].base + ((funcId) * IRO[103].m1)) |
98 | #define TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ | 98 | #define TSTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ |
99 | (IRO[271].base + ((pfId) * IRO[271].m1)) | ||
100 | #define TSTORM_ISCSI_L2_ISCSI_OOO_CID_TABLE_OFFSET(pfId) \ | ||
101 | (IRO[272].base + ((pfId) * IRO[272].m1)) | 99 | (IRO[272].base + ((pfId) * IRO[272].m1)) |
102 | #define TSTORM_ISCSI_L2_ISCSI_OOO_CLIENT_ID_TABLE_OFFSET(pfId) \ | 100 | #define TSTORM_ISCSI_L2_ISCSI_OOO_CID_TABLE_OFFSET(pfId) \ |
103 | (IRO[273].base + ((pfId) * IRO[273].m1)) | 101 | (IRO[273].base + ((pfId) * IRO[273].m1)) |
104 | #define TSTORM_ISCSI_L2_ISCSI_OOO_PROD_OFFSET(pfId) \ | 102 | #define TSTORM_ISCSI_L2_ISCSI_OOO_CLIENT_ID_TABLE_OFFSET(pfId) \ |
105 | (IRO[274].base + ((pfId) * IRO[274].m1)) | 103 | (IRO[274].base + ((pfId) * IRO[274].m1)) |
104 | #define TSTORM_ISCSI_L2_ISCSI_OOO_PROD_OFFSET(pfId) \ | ||
105 | (IRO[275].base + ((pfId) * IRO[275].m1)) | ||
106 | #define TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ | 106 | #define TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ |
107 | (IRO[270].base + ((pfId) * IRO[270].m1)) | 107 | (IRO[271].base + ((pfId) * IRO[271].m1)) |
108 | #define TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ | 108 | #define TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ |
109 | (IRO[269].base + ((pfId) * IRO[269].m1)) | 109 | (IRO[270].base + ((pfId) * IRO[270].m1)) |
110 | #define TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ | 110 | #define TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ |
111 | (IRO[268].base + ((pfId) * IRO[268].m1)) | 111 | (IRO[269].base + ((pfId) * IRO[269].m1)) |
112 | #define TSTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \ | 112 | #define TSTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \ |
113 | (IRO[267].base + ((pfId) * IRO[267].m1)) | 113 | (IRO[268].base + ((pfId) * IRO[268].m1)) |
114 | #define TSTORM_ISCSI_TCP_LOCAL_ADV_WND_OFFSET(pfId) \ | 114 | #define TSTORM_ISCSI_TCP_LOCAL_ADV_WND_OFFSET(pfId) \ |
115 | (IRO[276].base + ((pfId) * IRO[276].m1)) | 115 | (IRO[277].base + ((pfId) * IRO[277].m1)) |
116 | #define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ | 116 | #define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ |
117 | (IRO[263].base + ((pfId) * IRO[263].m1)) | ||
118 | #define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfId) \ | ||
119 | (IRO[264].base + ((pfId) * IRO[264].m1)) | 117 | (IRO[264].base + ((pfId) * IRO[264].m1)) |
120 | #define TSTORM_ISCSI_TCP_VARS_MID_LOCAL_MAC_ADDR_OFFSET(pfId) \ | 118 | #define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfId) \ |
121 | (IRO[265].base + ((pfId) * IRO[265].m1)) | 119 | (IRO[265].base + ((pfId) * IRO[265].m1)) |
122 | #define TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfId) \ | 120 | #define TSTORM_ISCSI_TCP_VARS_MID_LOCAL_MAC_ADDR_OFFSET(pfId) \ |
123 | (IRO[266].base + ((pfId) * IRO[266].m1)) | 121 | (IRO[266].base + ((pfId) * IRO[266].m1)) |
122 | #define TSTORM_ISCSI_TCP_VARS_MSB_LOCAL_MAC_ADDR_OFFSET(pfId) \ | ||
123 | (IRO[267].base + ((pfId) * IRO[267].m1)) | ||
124 | #define TSTORM_MAC_FILTER_CONFIG_OFFSET(pfId) \ | 124 | #define TSTORM_MAC_FILTER_CONFIG_OFFSET(pfId) \ |
125 | (IRO[202].base + ((pfId) * IRO[202].m1)) | 125 | (IRO[202].base + ((pfId) * IRO[202].m1)) |
126 | #define TSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ | 126 | #define TSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ |
127 | (IRO[105].base + ((funcId) * IRO[105].m1)) | 127 | (IRO[105].base + ((funcId) * IRO[105].m1)) |
128 | #define TSTORM_TCP_MAX_CWND_OFFSET(pfId) \ | 128 | #define TSTORM_TCP_MAX_CWND_OFFSET(pfId) \ |
129 | (IRO[216].base + ((pfId) * IRO[216].m1)) | 129 | (IRO[217].base + ((pfId) * IRO[217].m1)) |
130 | #define TSTORM_VF_TO_PF_OFFSET(funcId) \ | 130 | #define TSTORM_VF_TO_PF_OFFSET(funcId) \ |
131 | (IRO[104].base + ((funcId) * IRO[104].m1)) | 131 | (IRO[104].base + ((funcId) * IRO[104].m1)) |
132 | #define USTORM_AGG_DATA_OFFSET (IRO[206].base) | 132 | #define USTORM_AGG_DATA_OFFSET (IRO[206].base) |
@@ -140,29 +140,29 @@ | |||
140 | #define USTORM_ETH_PAUSE_ENABLED_OFFSET(portId) \ | 140 | #define USTORM_ETH_PAUSE_ENABLED_OFFSET(portId) \ |
141 | (IRO[183].base + ((portId) * IRO[183].m1)) | 141 | (IRO[183].base + ((portId) * IRO[183].m1)) |
142 | #define USTORM_FCOE_EQ_PROD_OFFSET(pfId) \ | 142 | #define USTORM_FCOE_EQ_PROD_OFFSET(pfId) \ |
143 | (IRO[317].base + ((pfId) * IRO[317].m1)) | 143 | (IRO[318].base + ((pfId) * IRO[318].m1)) |
144 | #define USTORM_FUNC_EN_OFFSET(funcId) \ | 144 | #define USTORM_FUNC_EN_OFFSET(funcId) \ |
145 | (IRO[178].base + ((funcId) * IRO[178].m1)) | 145 | (IRO[178].base + ((funcId) * IRO[178].m1)) |
146 | #define USTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ | 146 | #define USTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \ |
147 | (IRO[281].base + ((pfId) * IRO[281].m1)) | ||
148 | #define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \ | ||
149 | (IRO[282].base + ((pfId) * IRO[282].m1)) | 147 | (IRO[282].base + ((pfId) * IRO[282].m1)) |
148 | #define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \ | ||
149 | (IRO[283].base + ((pfId) * IRO[283].m1)) | ||
150 | #define USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ | 150 | #define USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \ |
151 | (IRO[286].base + ((pfId) * IRO[286].m1)) | 151 | (IRO[287].base + ((pfId) * IRO[287].m1)) |
152 | #define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfId) \ | 152 | #define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfId) \ |
153 | (IRO[283].base + ((pfId) * IRO[283].m1)) | 153 | (IRO[284].base + ((pfId) * IRO[284].m1)) |
154 | #define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ | 154 | #define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ |
155 | (IRO[279].base + ((pfId) * IRO[279].m1)) | 155 | (IRO[280].base + ((pfId) * IRO[280].m1)) |
156 | #define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ | 156 | #define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ |
157 | (IRO[278].base + ((pfId) * IRO[278].m1)) | 157 | (IRO[279].base + ((pfId) * IRO[279].m1)) |
158 | #define USTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ | 158 | #define USTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ |
159 | (IRO[277].base + ((pfId) * IRO[277].m1)) | 159 | (IRO[278].base + ((pfId) * IRO[278].m1)) |
160 | #define USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ | 160 | #define USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ |
161 | (IRO[280].base + ((pfId) * IRO[280].m1)) | 161 | (IRO[281].base + ((pfId) * IRO[281].m1)) |
162 | #define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfId) \ | 162 | #define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfId) \ |
163 | (IRO[284].base + ((pfId) * IRO[284].m1)) | ||
164 | #define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \ | ||
165 | (IRO[285].base + ((pfId) * IRO[285].m1)) | 163 | (IRO[285].base + ((pfId) * IRO[285].m1)) |
164 | #define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \ | ||
165 | (IRO[286].base + ((pfId) * IRO[286].m1)) | ||
166 | #define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(pfId) \ | 166 | #define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(pfId) \ |
167 | (IRO[182].base + ((pfId) * IRO[182].m1)) | 167 | (IRO[182].base + ((pfId) * IRO[182].m1)) |
168 | #define USTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ | 168 | #define USTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ |
@@ -188,39 +188,39 @@ | |||
188 | #define XSTORM_FUNC_EN_OFFSET(funcId) \ | 188 | #define XSTORM_FUNC_EN_OFFSET(funcId) \ |
189 | (IRO[47].base + ((funcId) * IRO[47].m1)) | 189 | (IRO[47].base + ((funcId) * IRO[47].m1)) |
190 | #define XSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ | 190 | #define XSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \ |
191 | (IRO[294].base + ((pfId) * IRO[294].m1)) | 191 | (IRO[295].base + ((pfId) * IRO[295].m1)) |
192 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfId) \ | 192 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfId) \ |
193 | (IRO[297].base + ((pfId) * IRO[297].m1)) | ||
194 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \ | ||
195 | (IRO[298].base + ((pfId) * IRO[298].m1)) | 193 | (IRO[298].base + ((pfId) * IRO[298].m1)) |
196 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \ | 194 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \ |
197 | (IRO[299].base + ((pfId) * IRO[299].m1)) | 195 | (IRO[299].base + ((pfId) * IRO[299].m1)) |
198 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \ | 196 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \ |
199 | (IRO[300].base + ((pfId) * IRO[300].m1)) | 197 | (IRO[300].base + ((pfId) * IRO[300].m1)) |
200 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \ | 198 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \ |
201 | (IRO[301].base + ((pfId) * IRO[301].m1)) | 199 | (IRO[301].base + ((pfId) * IRO[301].m1)) |
202 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \ | 200 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \ |
203 | (IRO[302].base + ((pfId) * IRO[302].m1)) | 201 | (IRO[302].base + ((pfId) * IRO[302].m1)) |
204 | #define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \ | 202 | #define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \ |
205 | (IRO[303].base + ((pfId) * IRO[303].m1)) | 203 | (IRO[303].base + ((pfId) * IRO[303].m1)) |
204 | #define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \ | ||
205 | (IRO[304].base + ((pfId) * IRO[304].m1)) | ||
206 | #define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ | 206 | #define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \ |
207 | (IRO[293].base + ((pfId) * IRO[293].m1)) | 207 | (IRO[294].base + ((pfId) * IRO[294].m1)) |
208 | #define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ | 208 | #define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \ |
209 | (IRO[292].base + ((pfId) * IRO[292].m1)) | 209 | (IRO[293].base + ((pfId) * IRO[293].m1)) |
210 | #define XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ | 210 | #define XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \ |
211 | (IRO[291].base + ((pfId) * IRO[291].m1)) | 211 | (IRO[292].base + ((pfId) * IRO[292].m1)) |
212 | #define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ | 212 | #define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \ |
213 | (IRO[296].base + ((pfId) * IRO[296].m1)) | 213 | (IRO[297].base + ((pfId) * IRO[297].m1)) |
214 | #define XSTORM_ISCSI_SQ_SIZE_OFFSET(pfId) \ | 214 | #define XSTORM_ISCSI_SQ_SIZE_OFFSET(pfId) \ |
215 | (IRO[295].base + ((pfId) * IRO[295].m1)) | 215 | (IRO[296].base + ((pfId) * IRO[296].m1)) |
216 | #define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfId) \ | 216 | #define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfId) \ |
217 | (IRO[290].base + ((pfId) * IRO[290].m1)) | 217 | (IRO[291].base + ((pfId) * IRO[291].m1)) |
218 | #define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ | 218 | #define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \ |
219 | (IRO[289].base + ((pfId) * IRO[289].m1)) | 219 | (IRO[290].base + ((pfId) * IRO[290].m1)) |
220 | #define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfId) \ | 220 | #define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfId) \ |
221 | (IRO[288].base + ((pfId) * IRO[288].m1)) | 221 | (IRO[289].base + ((pfId) * IRO[289].m1)) |
222 | #define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfId) \ | 222 | #define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfId) \ |
223 | (IRO[287].base + ((pfId) * IRO[287].m1)) | 223 | (IRO[288].base + ((pfId) * IRO[288].m1)) |
224 | #define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(pfId) \ | 224 | #define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(pfId) \ |
225 | (IRO[44].base + ((pfId) * IRO[44].m1)) | 225 | (IRO[44].base + ((pfId) * IRO[44].m1)) |
226 | #define XSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ | 226 | #define XSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h index 5d71b7d43237..dbff5915b81a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | |||
@@ -1251,6 +1251,9 @@ struct drv_func_mb { | |||
1251 | 1251 | ||
1252 | #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000 | 1252 | #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000 |
1253 | 1253 | ||
1254 | #define DRV_MSG_CODE_INITIATE_FLR 0x02000000 | ||
1255 | #define REQ_BC_VER_4_INITIATE_FLR 0x00070213 | ||
1256 | |||
1254 | #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000 | 1257 | #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000 |
1255 | #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000 | 1258 | #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000 |
1256 | #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000 | 1259 | #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000 |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index beb4cdbdb6e1..64392ec410a3 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #define ETH_MAX_PACKET_SIZE 1500 | 35 | #define ETH_MAX_PACKET_SIZE 1500 |
36 | #define ETH_MAX_JUMBO_PACKET_SIZE 9600 | 36 | #define ETH_MAX_JUMBO_PACKET_SIZE 9600 |
37 | #define MDIO_ACCESS_TIMEOUT 1000 | 37 | #define MDIO_ACCESS_TIMEOUT 1000 |
38 | #define BMAC_CONTROL_RX_ENABLE 2 | ||
39 | #define WC_LANE_MAX 4 | 38 | #define WC_LANE_MAX 4 |
40 | #define I2C_SWITCH_WIDTH 2 | 39 | #define I2C_SWITCH_WIDTH 2 |
41 | #define I2C_BSC0 0 | 40 | #define I2C_BSC0 0 |
@@ -943,6 +942,12 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, | |||
943 | const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : | 942 | const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : |
944 | DCBX_E3B0_MAX_NUM_COS_PORT0; | 943 | DCBX_E3B0_MAX_NUM_COS_PORT0; |
945 | 944 | ||
945 | if (pri >= max_num_of_cos) { | ||
946 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | ||
947 | "parameter Illegal strict priority\n"); | ||
948 | return -EINVAL; | ||
949 | } | ||
950 | |||
946 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { | 951 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { |
947 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | 952 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " |
948 | "parameter There can't be two COS's with " | 953 | "parameter There can't be two COS's with " |
@@ -950,12 +955,6 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, | |||
950 | return -EINVAL; | 955 | return -EINVAL; |
951 | } | 956 | } |
952 | 957 | ||
953 | if (pri > max_num_of_cos) { | ||
954 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | ||
955 | "parameter Illegal strict priority\n"); | ||
956 | return -EINVAL; | ||
957 | } | ||
958 | |||
959 | sp_pri_to_cos[pri] = cos_entry; | 958 | sp_pri_to_cos[pri] = cos_entry; |
960 | return 0; | 959 | return 0; |
961 | 960 | ||
@@ -1372,7 +1371,14 @@ static void bnx2x_update_pfc_xmac(struct link_params *params, | |||
1372 | pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN | | 1371 | pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN | |
1373 | XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN | | 1372 | XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN | |
1374 | XMAC_PFC_CTRL_HI_REG_RX_PFC_EN | | 1373 | XMAC_PFC_CTRL_HI_REG_RX_PFC_EN | |
1375 | XMAC_PFC_CTRL_HI_REG_TX_PFC_EN; | 1374 | XMAC_PFC_CTRL_HI_REG_TX_PFC_EN | |
1375 | XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON; | ||
1376 | /* Write pause and PFC registers */ | ||
1377 | REG_WR(bp, xmac_base + XMAC_REG_PAUSE_CTRL, pause_val); | ||
1378 | REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL, pfc0_val); | ||
1379 | REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL_HI, pfc1_val); | ||
1380 | pfc1_val &= ~XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON; | ||
1381 | |||
1376 | } | 1382 | } |
1377 | 1383 | ||
1378 | /* Write pause and PFC registers */ | 1384 | /* Write pause and PFC registers */ |
@@ -3649,6 +3655,33 @@ static void bnx2x_ext_phy_update_adv_fc(struct bnx2x_phy *phy, | |||
3649 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) { | 3655 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) { |
3650 | bnx2x_cl22_read(bp, phy, 0x4, &ld_pause); | 3656 | bnx2x_cl22_read(bp, phy, 0x4, &ld_pause); |
3651 | bnx2x_cl22_read(bp, phy, 0x5, &lp_pause); | 3657 | bnx2x_cl22_read(bp, phy, 0x5, &lp_pause); |
3658 | } else if (CHIP_IS_E3(bp) && | ||
3659 | SINGLE_MEDIA_DIRECT(params)) { | ||
3660 | u8 lane = bnx2x_get_warpcore_lane(phy, params); | ||
3661 | u16 gp_status, gp_mask; | ||
3662 | bnx2x_cl45_read(bp, phy, | ||
3663 | MDIO_AN_DEVAD, MDIO_WC_REG_GP2_STATUS_GP_2_4, | ||
3664 | &gp_status); | ||
3665 | gp_mask = (MDIO_WC_REG_GP2_STATUS_GP_2_4_CL73_AN_CMPL | | ||
3666 | MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_LP_AN_CAP) << | ||
3667 | lane; | ||
3668 | if ((gp_status & gp_mask) == gp_mask) { | ||
3669 | bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD, | ||
3670 | MDIO_AN_REG_ADV_PAUSE, &ld_pause); | ||
3671 | bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD, | ||
3672 | MDIO_AN_REG_LP_AUTO_NEG, &lp_pause); | ||
3673 | } else { | ||
3674 | bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD, | ||
3675 | MDIO_AN_REG_CL37_FC_LD, &ld_pause); | ||
3676 | bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD, | ||
3677 | MDIO_AN_REG_CL37_FC_LP, &lp_pause); | ||
3678 | ld_pause = ((ld_pause & | ||
3679 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH) | ||
3680 | << 3); | ||
3681 | lp_pause = ((lp_pause & | ||
3682 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH) | ||
3683 | << 3); | ||
3684 | } | ||
3652 | } else { | 3685 | } else { |
3653 | bnx2x_cl45_read(bp, phy, | 3686 | bnx2x_cl45_read(bp, phy, |
3654 | MDIO_AN_DEVAD, | 3687 | MDIO_AN_DEVAD, |
@@ -3699,7 +3732,23 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
3699 | u16 val16 = 0, lane, bam37 = 0; | 3732 | u16 val16 = 0, lane, bam37 = 0; |
3700 | struct bnx2x *bp = params->bp; | 3733 | struct bnx2x *bp = params->bp; |
3701 | DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n"); | 3734 | DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n"); |
3702 | 3735 | /* Set to default registers that may be overriden by 10G force */ | |
3736 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3737 | MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7); | ||
3738 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, | ||
3739 | MDIO_WC_REG_PAR_DET_10G_CTRL, 0); | ||
3740 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3741 | MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, 0); | ||
3742 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3743 | MDIO_WC_REG_XGXSBLK1_LANECTRL0, 0xff); | ||
3744 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3745 | MDIO_WC_REG_XGXSBLK1_LANECTRL1, 0x5555); | ||
3746 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, | ||
3747 | MDIO_WC_REG_IEEE0BLK_AUTONEGNP, 0x0); | ||
3748 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3749 | MDIO_WC_REG_RX66_CONTROL, 0x7415); | ||
3750 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3751 | MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190); | ||
3703 | /* Disable Autoneg: re-enable it after adv is done. */ | 3752 | /* Disable Autoneg: re-enable it after adv is done. */ |
3704 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, | 3753 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, |
3705 | MDIO_WC_REG_IEEE0BLK_MIICNTL, 0); | 3754 | MDIO_WC_REG_IEEE0BLK_MIICNTL, 0); |
@@ -3945,13 +3994,13 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy, | |||
3945 | 3994 | ||
3946 | } else { | 3995 | } else { |
3947 | misc1_val |= 0x9; | 3996 | misc1_val |= 0x9; |
3948 | tap_val = ((0x12 << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) | | 3997 | tap_val = ((0x0f << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) | |
3949 | (0x2d << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) | | 3998 | (0x2b << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) | |
3950 | (0x00 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET)); | 3999 | (0x02 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET)); |
3951 | tx_driver_val = | 4000 | tx_driver_val = |
3952 | ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) | | 4001 | ((0x03 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) | |
3953 | (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) | | 4002 | (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) | |
3954 | (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)); | 4003 | (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)); |
3955 | } | 4004 | } |
3956 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | 4005 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, |
3957 | MDIO_WC_REG_SERDESDIGITAL_MISC1, misc1_val); | 4006 | MDIO_WC_REG_SERDESDIGITAL_MISC1, misc1_val); |
@@ -4369,7 +4418,7 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, | |||
4369 | switch (serdes_net_if) { | 4418 | switch (serdes_net_if) { |
4370 | case PORT_HW_CFG_NET_SERDES_IF_KR: | 4419 | case PORT_HW_CFG_NET_SERDES_IF_KR: |
4371 | /* Enable KR Auto Neg */ | 4420 | /* Enable KR Auto Neg */ |
4372 | if (params->loopback_mode == LOOPBACK_NONE) | 4421 | if (params->loopback_mode != LOOPBACK_EXT) |
4373 | bnx2x_warpcore_enable_AN_KR(phy, params, vars); | 4422 | bnx2x_warpcore_enable_AN_KR(phy, params, vars); |
4374 | else { | 4423 | else { |
4375 | DP(NETIF_MSG_LINK, "Setting KR 10G-Force\n"); | 4424 | DP(NETIF_MSG_LINK, "Setting KR 10G-Force\n"); |
@@ -6167,12 +6216,14 @@ int bnx2x_set_led(struct link_params *params, | |||
6167 | 6216 | ||
6168 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | 6217 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); |
6169 | if (params->phy[EXT_PHY1].type == | 6218 | if (params->phy[EXT_PHY1].type == |
6170 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) | 6219 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) |
6171 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp & 0xfff1); | 6220 | tmp &= ~(EMAC_LED_1000MB_OVERRIDE | |
6172 | else { | 6221 | EMAC_LED_100MB_OVERRIDE | |
6173 | EMAC_WR(bp, EMAC_REG_EMAC_LED, | 6222 | EMAC_LED_10MB_OVERRIDE); |
6174 | (tmp | EMAC_LED_OVERRIDE)); | 6223 | else |
6175 | } | 6224 | tmp |= EMAC_LED_OVERRIDE; |
6225 | |||
6226 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp); | ||
6176 | break; | 6227 | break; |
6177 | 6228 | ||
6178 | case LED_MODE_OPER: | 6229 | case LED_MODE_OPER: |
@@ -6227,10 +6278,15 @@ int bnx2x_set_led(struct link_params *params, | |||
6227 | hw_led_mode); | 6278 | hw_led_mode); |
6228 | } else if ((params->phy[EXT_PHY1].type == | 6279 | } else if ((params->phy[EXT_PHY1].type == |
6229 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && | 6280 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && |
6230 | (mode != LED_MODE_OPER)) { | 6281 | (mode == LED_MODE_ON)) { |
6231 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0); | 6282 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0); |
6232 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | 6283 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); |
6233 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp | 0x3); | 6284 | EMAC_WR(bp, EMAC_REG_EMAC_LED, tmp | |
6285 | EMAC_LED_OVERRIDE | EMAC_LED_1000MB_OVERRIDE); | ||
6286 | /* Break here; otherwise, it'll disable the | ||
6287 | * intended override. | ||
6288 | */ | ||
6289 | break; | ||
6234 | } else | 6290 | } else |
6235 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, | 6291 | REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, |
6236 | hw_led_mode); | 6292 | hw_led_mode); |
@@ -6245,13 +6301,9 @@ int bnx2x_set_led(struct link_params *params, | |||
6245 | LED_BLINK_RATE_VAL_E1X_E2); | 6301 | LED_BLINK_RATE_VAL_E1X_E2); |
6246 | REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 + | 6302 | REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 + |
6247 | port*4, 1); | 6303 | port*4, 1); |
6248 | if ((params->phy[EXT_PHY1].type != | 6304 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); |
6249 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE) && | 6305 | EMAC_WR(bp, EMAC_REG_EMAC_LED, |
6250 | (mode != LED_MODE_OPER)) { | 6306 | (tmp & (~EMAC_LED_OVERRIDE))); |
6251 | tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED); | ||
6252 | EMAC_WR(bp, EMAC_REG_EMAC_LED, | ||
6253 | (tmp & (~EMAC_LED_OVERRIDE))); | ||
6254 | } | ||
6255 | 6307 | ||
6256 | if (CHIP_IS_E1(bp) && | 6308 | if (CHIP_IS_E1(bp) && |
6257 | ((speed == SPEED_2500) || | 6309 | ((speed == SPEED_2500) || |
@@ -6844,6 +6896,12 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars) | |||
6844 | SINGLE_MEDIA_DIRECT(params)) && | 6896 | SINGLE_MEDIA_DIRECT(params)) && |
6845 | (phy_vars[active_external_phy].fault_detected == 0)); | 6897 | (phy_vars[active_external_phy].fault_detected == 0)); |
6846 | 6898 | ||
6899 | /* Update the PFC configuration in case it was changed */ | ||
6900 | if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED) | ||
6901 | vars->link_status |= LINK_STATUS_PFC_ENABLED; | ||
6902 | else | ||
6903 | vars->link_status &= ~LINK_STATUS_PFC_ENABLED; | ||
6904 | |||
6847 | if (vars->link_up) | 6905 | if (vars->link_up) |
6848 | rc = bnx2x_update_link_up(params, vars, link_10g_plus); | 6906 | rc = bnx2x_update_link_up(params, vars, link_10g_plus); |
6849 | else | 6907 | else |
@@ -8031,7 +8089,9 @@ static int bnx2x_verify_sfp_module(struct bnx2x_phy *phy, | |||
8031 | netdev_err(bp->dev, "Warning: Unqualified SFP+ module detected," | 8089 | netdev_err(bp->dev, "Warning: Unqualified SFP+ module detected," |
8032 | " Port %d from %s part number %s\n", | 8090 | " Port %d from %s part number %s\n", |
8033 | params->port, vendor_name, vendor_pn); | 8091 | params->port, vendor_name, vendor_pn); |
8034 | phy->flags |= FLAGS_SFP_NOT_APPROVED; | 8092 | if ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) != |
8093 | PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG) | ||
8094 | phy->flags |= FLAGS_SFP_NOT_APPROVED; | ||
8035 | return -EINVAL; | 8095 | return -EINVAL; |
8036 | } | 8096 | } |
8037 | 8097 | ||
@@ -9091,6 +9151,12 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy, | |||
9091 | tmp2 &= 0xFFEF; | 9151 | tmp2 &= 0xFFEF; |
9092 | bnx2x_cl45_write(bp, phy, | 9152 | bnx2x_cl45_write(bp, phy, |
9093 | MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_OPT_CFG_REG, tmp2); | 9153 | MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_OPT_CFG_REG, tmp2); |
9154 | bnx2x_cl45_read(bp, phy, | ||
9155 | MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, | ||
9156 | &tmp2); | ||
9157 | bnx2x_cl45_write(bp, phy, | ||
9158 | MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, | ||
9159 | (tmp2 & 0x7fff)); | ||
9094 | } | 9160 | } |
9095 | 9161 | ||
9096 | return 0; | 9162 | return 0; |
@@ -9271,12 +9337,11 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, | |||
9271 | MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXCTRL, | 9337 | MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXCTRL, |
9272 | ((1<<5) | (1<<2))); | 9338 | ((1<<5) | (1<<2))); |
9273 | } | 9339 | } |
9274 | DP(NETIF_MSG_LINK, "Enabling 8727 TX laser if SFP is approved\n"); | 9340 | |
9275 | bnx2x_8727_specific_func(phy, params, ENABLE_TX); | 9341 | if (!(phy->flags & FLAGS_SFP_NOT_APPROVED)) { |
9276 | /* If transmitter is disabled, ignore false link up indication */ | 9342 | DP(NETIF_MSG_LINK, "Enabling 8727 TX laser\n"); |
9277 | bnx2x_cl45_read(bp, phy, | 9343 | bnx2x_sfp_set_transmitter(params, phy, 1); |
9278 | MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER, &val1); | 9344 | } else { |
9279 | if (val1 & (1<<15)) { | ||
9280 | DP(NETIF_MSG_LINK, "Tx is disabled\n"); | 9345 | DP(NETIF_MSG_LINK, "Tx is disabled\n"); |
9281 | return 0; | 9346 | return 0; |
9282 | } | 9347 | } |
@@ -9370,8 +9435,7 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, | |||
9370 | 9435 | ||
9371 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { | 9436 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { |
9372 | bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1); | 9437 | bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1); |
9373 | bnx2x_save_spirom_version(bp, port, | 9438 | bnx2x_save_spirom_version(bp, port, fw_ver1 & 0xfff, |
9374 | ((fw_ver1 & 0xf000)>>5) | (fw_ver1 & 0x7f), | ||
9375 | phy->ver_addr); | 9439 | phy->ver_addr); |
9376 | } else { | 9440 | } else { |
9377 | /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */ | 9441 | /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */ |
@@ -9794,6 +9858,15 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy, | |||
9794 | other_shmem_base_addr)); | 9858 | other_shmem_base_addr)); |
9795 | 9859 | ||
9796 | u32 shmem_base_path[2]; | 9860 | u32 shmem_base_path[2]; |
9861 | |||
9862 | /* Work around for 84833 LED failure inside RESET status */ | ||
9863 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, | ||
9864 | MDIO_AN_REG_8481_LEGACY_MII_CTRL, | ||
9865 | MDIO_AN_REG_8481_MII_CTRL_FORCE_1G); | ||
9866 | bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, | ||
9867 | MDIO_AN_REG_8481_1G_100T_EXT_CTRL, | ||
9868 | MIDO_AN_REG_8481_EXT_CTRL_FORCE_LEDS_OFF); | ||
9869 | |||
9797 | shmem_base_path[0] = params->shmem_base; | 9870 | shmem_base_path[0] = params->shmem_base; |
9798 | shmem_base_path[1] = other_shmem_base_addr; | 9871 | shmem_base_path[1] = other_shmem_base_addr; |
9799 | 9872 | ||
@@ -10104,7 +10177,7 @@ static void bnx2x_848x3_link_reset(struct bnx2x_phy *phy, | |||
10104 | u8 port; | 10177 | u8 port; |
10105 | u16 val16; | 10178 | u16 val16; |
10106 | 10179 | ||
10107 | if (!(CHIP_IS_E1(bp))) | 10180 | if (!(CHIP_IS_E1x(bp))) |
10108 | port = BP_PATH(bp); | 10181 | port = BP_PATH(bp); |
10109 | else | 10182 | else |
10110 | port = params->port; | 10183 | port = params->port; |
@@ -10131,7 +10204,7 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy, | |||
10131 | u16 val; | 10204 | u16 val; |
10132 | u8 port; | 10205 | u8 port; |
10133 | 10206 | ||
10134 | if (!(CHIP_IS_E1(bp))) | 10207 | if (!(CHIP_IS_E1x(bp))) |
10135 | port = BP_PATH(bp); | 10208 | port = BP_PATH(bp); |
10136 | else | 10209 | else |
10137 | port = params->port; | 10210 | port = params->port; |
@@ -12050,6 +12123,9 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars) | |||
12050 | 12123 | ||
12051 | bnx2x_emac_init(params, vars); | 12124 | bnx2x_emac_init(params, vars); |
12052 | 12125 | ||
12126 | if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED) | ||
12127 | vars->link_status |= LINK_STATUS_PFC_ENABLED; | ||
12128 | |||
12053 | if (params->num_phys == 0) { | 12129 | if (params->num_phys == 0) { |
12054 | DP(NETIF_MSG_LINK, "No phy found for initialization !!\n"); | 12130 | DP(NETIF_MSG_LINK, "No phy found for initialization !!\n"); |
12055 | return -EINVAL; | 12131 | return -EINVAL; |
@@ -12129,10 +12205,10 @@ int bnx2x_link_reset(struct link_params *params, struct link_vars *vars, | |||
12129 | * Hold it as vars low | 12205 | * Hold it as vars low |
12130 | */ | 12206 | */ |
12131 | /* clear link led */ | 12207 | /* clear link led */ |
12208 | bnx2x_set_mdio_clk(bp, params->chip_id, port); | ||
12132 | bnx2x_set_led(params, vars, LED_MODE_OFF, 0); | 12209 | bnx2x_set_led(params, vars, LED_MODE_OFF, 0); |
12133 | 12210 | ||
12134 | if (reset_ext_phy) { | 12211 | if (reset_ext_phy) { |
12135 | bnx2x_set_mdio_clk(bp, params->chip_id, port); | ||
12136 | for (phy_index = EXT_PHY1; phy_index < params->num_phys; | 12212 | for (phy_index = EXT_PHY1; phy_index < params->num_phys; |
12137 | phy_index++) { | 12213 | phy_index++) { |
12138 | if (params->phy[phy_index].link_reset) { | 12214 | if (params->phy[phy_index].link_reset) { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h index 7ba557a610da..763535ee4832 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | |||
@@ -89,6 +89,8 @@ | |||
89 | #define PFC_BRB_FULL_LB_XON_THRESHOLD 250 | 89 | #define PFC_BRB_FULL_LB_XON_THRESHOLD 250 |
90 | 90 | ||
91 | #define MAXVAL(a, b) (((a) > (b)) ? (a) : (b)) | 91 | #define MAXVAL(a, b) (((a) > (b)) ? (a) : (b)) |
92 | |||
93 | #define BMAC_CONTROL_RX_ENABLE 2 | ||
92 | /***********************************************************/ | 94 | /***********************************************************/ |
93 | /* Structs */ | 95 | /* Structs */ |
94 | /***********************************************************/ | 96 | /***********************************************************/ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index f7f9aa807264..e077d2508727 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/prefetch.h> | 52 | #include <linux/prefetch.h> |
53 | #include <linux/zlib.h> | 53 | #include <linux/zlib.h> |
54 | #include <linux/io.h> | 54 | #include <linux/io.h> |
55 | #include <linux/semaphore.h> | ||
55 | #include <linux/stringify.h> | 56 | #include <linux/stringify.h> |
56 | #include <linux/vmalloc.h> | 57 | #include <linux/vmalloc.h> |
57 | 58 | ||
@@ -211,6 +212,10 @@ static DEFINE_PCI_DEVICE_TABLE(bnx2x_pci_tbl) = { | |||
211 | 212 | ||
212 | MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl); | 213 | MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl); |
213 | 214 | ||
215 | /* Global resources for unloading a previously loaded device */ | ||
216 | #define BNX2X_PREV_WAIT_NEEDED 1 | ||
217 | static DEFINE_SEMAPHORE(bnx2x_prev_sem); | ||
218 | static LIST_HEAD(bnx2x_prev_list); | ||
214 | /**************************************************************************** | 219 | /**************************************************************************** |
215 | * General service functions | 220 | * General service functions |
216 | ****************************************************************************/ | 221 | ****************************************************************************/ |
@@ -8812,109 +8817,371 @@ static inline void bnx2x_undi_int_disable(struct bnx2x *bp) | |||
8812 | bnx2x_undi_int_disable_e1h(bp); | 8817 | bnx2x_undi_int_disable_e1h(bp); |
8813 | } | 8818 | } |
8814 | 8819 | ||
8815 | static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | 8820 | static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp) |
8816 | { | 8821 | { |
8817 | u32 val; | 8822 | u32 val, base_addr, offset, mask, reset_reg; |
8823 | bool mac_stopped = false; | ||
8824 | u8 port = BP_PORT(bp); | ||
8818 | 8825 | ||
8819 | /* possibly another driver is trying to reset the chip */ | 8826 | reset_reg = REG_RD(bp, MISC_REG_RESET_REG_2); |
8820 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RESET); | ||
8821 | 8827 | ||
8822 | /* check if doorbell queue is reset */ | 8828 | if (!CHIP_IS_E3(bp)) { |
8823 | if (REG_RD(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET) | 8829 | val = REG_RD(bp, NIG_REG_BMAC0_REGS_OUT_EN + port * 4); |
8824 | & MISC_REGISTERS_RESET_REG_1_RST_DORQ) { | 8830 | mask = MISC_REGISTERS_RESET_REG_2_RST_BMAC0 << port; |
8831 | if ((mask & reset_reg) && val) { | ||
8832 | u32 wb_data[2]; | ||
8833 | BNX2X_DEV_INFO("Disable bmac Rx\n"); | ||
8834 | base_addr = BP_PORT(bp) ? NIG_REG_INGRESS_BMAC1_MEM | ||
8835 | : NIG_REG_INGRESS_BMAC0_MEM; | ||
8836 | offset = CHIP_IS_E2(bp) ? BIGMAC2_REGISTER_BMAC_CONTROL | ||
8837 | : BIGMAC_REGISTER_BMAC_CONTROL; | ||
8825 | 8838 | ||
8826 | /* | 8839 | /* |
8827 | * Check if it is the UNDI driver | 8840 | * use rd/wr since we cannot use dmae. This is safe |
8841 | * since MCP won't access the bus due to the request | ||
8842 | * to unload, and no function on the path can be | ||
8843 | * loaded at this time. | ||
8844 | */ | ||
8845 | wb_data[0] = REG_RD(bp, base_addr + offset); | ||
8846 | wb_data[1] = REG_RD(bp, base_addr + offset + 0x4); | ||
8847 | wb_data[0] &= ~BMAC_CONTROL_RX_ENABLE; | ||
8848 | REG_WR(bp, base_addr + offset, wb_data[0]); | ||
8849 | REG_WR(bp, base_addr + offset + 0x4, wb_data[1]); | ||
8850 | |||
8851 | } | ||
8852 | BNX2X_DEV_INFO("Disable emac Rx\n"); | ||
8853 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + BP_PORT(bp)*4, 0); | ||
8854 | |||
8855 | mac_stopped = true; | ||
8856 | } else { | ||
8857 | if (reset_reg & MISC_REGISTERS_RESET_REG_2_XMAC) { | ||
8858 | BNX2X_DEV_INFO("Disable xmac Rx\n"); | ||
8859 | base_addr = BP_PORT(bp) ? GRCBASE_XMAC1 : GRCBASE_XMAC0; | ||
8860 | val = REG_RD(bp, base_addr + XMAC_REG_PFC_CTRL_HI); | ||
8861 | REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI, | ||
8862 | val & ~(1 << 1)); | ||
8863 | REG_WR(bp, base_addr + XMAC_REG_PFC_CTRL_HI, | ||
8864 | val | (1 << 1)); | ||
8865 | REG_WR(bp, base_addr + XMAC_REG_CTRL, 0); | ||
8866 | mac_stopped = true; | ||
8867 | } | ||
8868 | mask = MISC_REGISTERS_RESET_REG_2_UMAC0 << port; | ||
8869 | if (mask & reset_reg) { | ||
8870 | BNX2X_DEV_INFO("Disable umac Rx\n"); | ||
8871 | base_addr = BP_PORT(bp) ? GRCBASE_UMAC1 : GRCBASE_UMAC0; | ||
8872 | REG_WR(bp, base_addr + UMAC_REG_COMMAND_CONFIG, 0); | ||
8873 | mac_stopped = true; | ||
8874 | } | ||
8875 | } | ||
8876 | |||
8877 | if (mac_stopped) | ||
8878 | msleep(20); | ||
8879 | |||
8880 | } | ||
8881 | |||
8882 | #define BNX2X_PREV_UNDI_PROD_ADDR(p) (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4)) | ||
8883 | #define BNX2X_PREV_UNDI_RCQ(val) ((val) & 0xffff) | ||
8884 | #define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff) | ||
8885 | #define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq)) | ||
8886 | |||
8887 | static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port, | ||
8888 | u8 inc) | ||
8889 | { | ||
8890 | u16 rcq, bd; | ||
8891 | u32 tmp_reg = REG_RD(bp, BNX2X_PREV_UNDI_PROD_ADDR(port)); | ||
8892 | |||
8893 | rcq = BNX2X_PREV_UNDI_RCQ(tmp_reg) + inc; | ||
8894 | bd = BNX2X_PREV_UNDI_BD(tmp_reg) + inc; | ||
8895 | |||
8896 | tmp_reg = BNX2X_PREV_UNDI_PROD(rcq, bd); | ||
8897 | REG_WR(bp, BNX2X_PREV_UNDI_PROD_ADDR(port), tmp_reg); | ||
8898 | |||
8899 | BNX2X_DEV_INFO("UNDI producer [%d] rings bd -> 0x%04x, rcq -> 0x%04x\n", | ||
8900 | port, bd, rcq); | ||
8901 | } | ||
8902 | |||
8903 | static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp) | ||
8904 | { | ||
8905 | u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0); | ||
8906 | if (!rc) { | ||
8907 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
8908 | return -EBUSY; | ||
8909 | } | ||
8910 | |||
8911 | return 0; | ||
8912 | } | ||
8913 | |||
8914 | static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp) | ||
8915 | { | ||
8916 | struct bnx2x_prev_path_list *tmp_list; | ||
8917 | int rc = false; | ||
8918 | |||
8919 | if (down_trylock(&bnx2x_prev_sem)) | ||
8920 | return false; | ||
8921 | |||
8922 | list_for_each_entry(tmp_list, &bnx2x_prev_list, list) { | ||
8923 | if (PCI_SLOT(bp->pdev->devfn) == tmp_list->slot && | ||
8924 | bp->pdev->bus->number == tmp_list->bus && | ||
8925 | BP_PATH(bp) == tmp_list->path) { | ||
8926 | rc = true; | ||
8927 | BNX2X_DEV_INFO("Path %d was already cleaned from previous drivers\n", | ||
8928 | BP_PATH(bp)); | ||
8929 | break; | ||
8930 | } | ||
8931 | } | ||
8932 | |||
8933 | up(&bnx2x_prev_sem); | ||
8934 | |||
8935 | return rc; | ||
8936 | } | ||
8937 | |||
8938 | static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp) | ||
8939 | { | ||
8940 | struct bnx2x_prev_path_list *tmp_list; | ||
8941 | int rc; | ||
8942 | |||
8943 | tmp_list = (struct bnx2x_prev_path_list *) | ||
8944 | kmalloc(sizeof(struct bnx2x_prev_path_list), GFP_KERNEL); | ||
8945 | if (!tmp_list) { | ||
8946 | BNX2X_ERR("Failed to allocate 'bnx2x_prev_path_list'\n"); | ||
8947 | return -ENOMEM; | ||
8948 | } | ||
8949 | |||
8950 | tmp_list->bus = bp->pdev->bus->number; | ||
8951 | tmp_list->slot = PCI_SLOT(bp->pdev->devfn); | ||
8952 | tmp_list->path = BP_PATH(bp); | ||
8953 | |||
8954 | rc = down_interruptible(&bnx2x_prev_sem); | ||
8955 | if (rc) { | ||
8956 | BNX2X_ERR("Received %d when tried to take lock\n", rc); | ||
8957 | kfree(tmp_list); | ||
8958 | } else { | ||
8959 | BNX2X_DEV_INFO("Marked path [%d] - finished previous unload\n", | ||
8960 | BP_PATH(bp)); | ||
8961 | list_add(&tmp_list->list, &bnx2x_prev_list); | ||
8962 | up(&bnx2x_prev_sem); | ||
8963 | } | ||
8964 | |||
8965 | return rc; | ||
8966 | } | ||
8967 | |||
8968 | static bool __devinit bnx2x_can_flr(struct bnx2x *bp) | ||
8969 | { | ||
8970 | int pos; | ||
8971 | u32 cap; | ||
8972 | struct pci_dev *dev = bp->pdev; | ||
8973 | |||
8974 | pos = pci_pcie_cap(dev); | ||
8975 | if (!pos) | ||
8976 | return false; | ||
8977 | |||
8978 | pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP, &cap); | ||
8979 | if (!(cap & PCI_EXP_DEVCAP_FLR)) | ||
8980 | return false; | ||
8981 | |||
8982 | return true; | ||
8983 | } | ||
8984 | |||
8985 | static int __devinit bnx2x_do_flr(struct bnx2x *bp) | ||
8986 | { | ||
8987 | int i, pos; | ||
8988 | u16 status; | ||
8989 | struct pci_dev *dev = bp->pdev; | ||
8990 | |||
8991 | /* probe the capability first */ | ||
8992 | if (bnx2x_can_flr(bp)) | ||
8993 | return -ENOTTY; | ||
8994 | |||
8995 | pos = pci_pcie_cap(dev); | ||
8996 | if (!pos) | ||
8997 | return -ENOTTY; | ||
8998 | |||
8999 | /* Wait for Transaction Pending bit clean */ | ||
9000 | for (i = 0; i < 4; i++) { | ||
9001 | if (i) | ||
9002 | msleep((1 << (i - 1)) * 100); | ||
9003 | |||
9004 | pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, &status); | ||
9005 | if (!(status & PCI_EXP_DEVSTA_TRPND)) | ||
9006 | goto clear; | ||
9007 | } | ||
9008 | |||
9009 | dev_err(&dev->dev, | ||
9010 | "transaction is not cleared; proceeding with reset anyway\n"); | ||
9011 | |||
9012 | clear: | ||
9013 | if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) { | ||
9014 | BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n", | ||
9015 | bp->common.bc_ver); | ||
9016 | return -EINVAL; | ||
9017 | } | ||
9018 | |||
9019 | bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0); | ||
9020 | |||
9021 | return 0; | ||
9022 | } | ||
9023 | |||
9024 | static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp) | ||
9025 | { | ||
9026 | int rc; | ||
9027 | |||
9028 | BNX2X_DEV_INFO("Uncommon unload Flow\n"); | ||
9029 | |||
9030 | /* Test if previous unload process was already finished for this path */ | ||
9031 | if (bnx2x_prev_is_path_marked(bp)) | ||
9032 | return bnx2x_prev_mcp_done(bp); | ||
9033 | |||
9034 | /* If function has FLR capabilities, and existing FW version matches | ||
9035 | * the one required, then FLR will be sufficient to clean any residue | ||
9036 | * left by previous driver | ||
9037 | */ | ||
9038 | if (bnx2x_test_firmware_version(bp, false) && bnx2x_can_flr(bp)) | ||
9039 | return bnx2x_do_flr(bp); | ||
9040 | |||
9041 | /* Close the MCP request, return failure*/ | ||
9042 | rc = bnx2x_prev_mcp_done(bp); | ||
9043 | if (!rc) | ||
9044 | rc = BNX2X_PREV_WAIT_NEEDED; | ||
9045 | |||
9046 | return rc; | ||
9047 | } | ||
9048 | |||
9049 | static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) | ||
9050 | { | ||
9051 | u32 reset_reg, tmp_reg = 0, rc; | ||
9052 | /* It is possible a previous function received 'common' answer, | ||
9053 | * but hasn't loaded yet, therefore creating a scenario of | ||
9054 | * multiple functions receiving 'common' on the same path. | ||
9055 | */ | ||
9056 | BNX2X_DEV_INFO("Common unload Flow\n"); | ||
9057 | |||
9058 | if (bnx2x_prev_is_path_marked(bp)) | ||
9059 | return bnx2x_prev_mcp_done(bp); | ||
9060 | |||
9061 | reset_reg = REG_RD(bp, MISC_REG_RESET_REG_1); | ||
9062 | |||
9063 | /* Reset should be performed after BRB is emptied */ | ||
9064 | if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) { | ||
9065 | u32 timer_count = 1000; | ||
9066 | bool prev_undi = false; | ||
9067 | |||
9068 | /* Close the MAC Rx to prevent BRB from filling up */ | ||
9069 | bnx2x_prev_unload_close_mac(bp); | ||
9070 | |||
9071 | /* Check if the UNDI driver was previously loaded | ||
8828 | * UNDI driver initializes CID offset for normal bell to 0x7 | 9072 | * UNDI driver initializes CID offset for normal bell to 0x7 |
8829 | */ | 9073 | */ |
8830 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); | 9074 | reset_reg = REG_RD(bp, MISC_REG_RESET_REG_1); |
8831 | if (val == 0x7) { | 9075 | if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_DORQ) { |
8832 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; | 9076 | tmp_reg = REG_RD(bp, DORQ_REG_NORM_CID_OFST); |
8833 | /* save our pf_num */ | 9077 | if (tmp_reg == 0x7) { |
8834 | int orig_pf_num = bp->pf_num; | 9078 | BNX2X_DEV_INFO("UNDI previously loaded\n"); |
8835 | int port; | 9079 | prev_undi = true; |
8836 | u32 swap_en, swap_val, value; | 9080 | /* clear the UNDI indication */ |
8837 | 9081 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | |
8838 | /* clear the UNDI indication */ | ||
8839 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
8840 | |||
8841 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); | ||
8842 | |||
8843 | /* try unload UNDI on port 0 */ | ||
8844 | bp->pf_num = 0; | ||
8845 | bp->fw_seq = | ||
8846 | (SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) & | ||
8847 | DRV_MSG_SEQ_NUMBER_MASK); | ||
8848 | reset_code = bnx2x_fw_command(bp, reset_code, 0); | ||
8849 | |||
8850 | /* if UNDI is loaded on the other port */ | ||
8851 | if (reset_code != FW_MSG_CODE_DRV_UNLOAD_COMMON) { | ||
8852 | |||
8853 | /* send "DONE" for previous unload */ | ||
8854 | bnx2x_fw_command(bp, | ||
8855 | DRV_MSG_CODE_UNLOAD_DONE, 0); | ||
8856 | |||
8857 | /* unload UNDI on port 1 */ | ||
8858 | bp->pf_num = 1; | ||
8859 | bp->fw_seq = | ||
8860 | (SHMEM_RD(bp, func_mb[bp->pf_num].drv_mb_header) & | ||
8861 | DRV_MSG_SEQ_NUMBER_MASK); | ||
8862 | reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; | ||
8863 | |||
8864 | bnx2x_fw_command(bp, reset_code, 0); | ||
8865 | } | 9082 | } |
9083 | } | ||
9084 | /* wait until BRB is empty */ | ||
9085 | tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS); | ||
9086 | while (timer_count) { | ||
9087 | u32 prev_brb = tmp_reg; | ||
8866 | 9088 | ||
8867 | bnx2x_undi_int_disable(bp); | 9089 | tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS); |
8868 | port = BP_PORT(bp); | 9090 | if (!tmp_reg) |
8869 | 9091 | break; | |
8870 | /* close input traffic and wait for it */ | ||
8871 | /* Do not rcv packets to BRB */ | ||
8872 | REG_WR(bp, (port ? NIG_REG_LLH1_BRB1_DRV_MASK : | ||
8873 | NIG_REG_LLH0_BRB1_DRV_MASK), 0x0); | ||
8874 | /* Do not direct rcv packets that are not for MCP to | ||
8875 | * the BRB */ | ||
8876 | REG_WR(bp, (port ? NIG_REG_LLH1_BRB1_NOT_MCP : | ||
8877 | NIG_REG_LLH0_BRB1_NOT_MCP), 0x0); | ||
8878 | /* clear AEU */ | ||
8879 | REG_WR(bp, (port ? MISC_REG_AEU_MASK_ATTN_FUNC_1 : | ||
8880 | MISC_REG_AEU_MASK_ATTN_FUNC_0), 0); | ||
8881 | msleep(10); | ||
8882 | |||
8883 | /* save NIG port swap info */ | ||
8884 | swap_val = REG_RD(bp, NIG_REG_PORT_SWAP); | ||
8885 | swap_en = REG_RD(bp, NIG_REG_STRAP_OVERRIDE); | ||
8886 | /* reset device */ | ||
8887 | REG_WR(bp, | ||
8888 | GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, | ||
8889 | 0xd3ffffff); | ||
8890 | |||
8891 | value = 0x1400; | ||
8892 | if (CHIP_IS_E3(bp)) { | ||
8893 | value |= MISC_REGISTERS_RESET_REG_2_MSTAT0; | ||
8894 | value |= MISC_REGISTERS_RESET_REG_2_MSTAT1; | ||
8895 | } | ||
8896 | 9092 | ||
8897 | REG_WR(bp, | 9093 | BNX2X_DEV_INFO("BRB still has 0x%08x\n", tmp_reg); |
8898 | GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, | ||
8899 | value); | ||
8900 | 9094 | ||
8901 | /* take the NIG out of reset and restore swap values */ | 9095 | /* reset timer as long as BRB actually gets emptied */ |
8902 | REG_WR(bp, | 9096 | if (prev_brb > tmp_reg) |
8903 | GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, | 9097 | timer_count = 1000; |
8904 | MISC_REGISTERS_RESET_REG_1_RST_NIG); | 9098 | else |
8905 | REG_WR(bp, NIG_REG_PORT_SWAP, swap_val); | 9099 | timer_count--; |
8906 | REG_WR(bp, NIG_REG_STRAP_OVERRIDE, swap_en); | ||
8907 | 9100 | ||
8908 | /* send unload done to the MCP */ | 9101 | /* If UNDI resides in memory, manually increment it */ |
8909 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0); | 9102 | if (prev_undi) |
9103 | bnx2x_prev_unload_undi_inc(bp, BP_PORT(bp), 1); | ||
8910 | 9104 | ||
8911 | /* restore our func and fw_seq */ | 9105 | udelay(10); |
8912 | bp->pf_num = orig_pf_num; | ||
8913 | } | 9106 | } |
9107 | |||
9108 | if (!timer_count) | ||
9109 | BNX2X_ERR("Failed to empty BRB, hope for the best\n"); | ||
9110 | |||
8914 | } | 9111 | } |
8915 | 9112 | ||
8916 | /* now it's safe to release the lock */ | 9113 | /* No packets are in the pipeline, path is ready for reset */ |
8917 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET); | 9114 | bnx2x_reset_common(bp); |
9115 | |||
9116 | rc = bnx2x_prev_mark_path(bp); | ||
9117 | if (rc) { | ||
9118 | bnx2x_prev_mcp_done(bp); | ||
9119 | return rc; | ||
9120 | } | ||
9121 | |||
9122 | return bnx2x_prev_mcp_done(bp); | ||
9123 | } | ||
9124 | |||
9125 | static int __devinit bnx2x_prev_unload(struct bnx2x *bp) | ||
9126 | { | ||
9127 | int time_counter = 10; | ||
9128 | u32 rc, fw, hw_lock_reg, hw_lock_val; | ||
9129 | BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); | ||
9130 | |||
9131 | /* Release previously held locks */ | ||
9132 | hw_lock_reg = (BP_FUNC(bp) <= 5) ? | ||
9133 | (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : | ||
9134 | (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); | ||
9135 | |||
9136 | hw_lock_val = (REG_RD(bp, hw_lock_reg)); | ||
9137 | if (hw_lock_val) { | ||
9138 | if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) { | ||
9139 | BNX2X_DEV_INFO("Release Previously held NVRAM lock\n"); | ||
9140 | REG_WR(bp, MCP_REG_MCPR_NVM_SW_ARB, | ||
9141 | (MCPR_NVM_SW_ARB_ARB_REQ_CLR1 << BP_PORT(bp))); | ||
9142 | } | ||
9143 | |||
9144 | BNX2X_DEV_INFO("Release Previously held hw lock\n"); | ||
9145 | REG_WR(bp, hw_lock_reg, 0xffffffff); | ||
9146 | } else | ||
9147 | BNX2X_DEV_INFO("No need to release hw/nvram locks\n"); | ||
9148 | |||
9149 | if (MCPR_ACCESS_LOCK_LOCK & REG_RD(bp, MCP_REG_MCPR_ACCESS_LOCK)) { | ||
9150 | BNX2X_DEV_INFO("Release previously held alr\n"); | ||
9151 | REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0); | ||
9152 | } | ||
9153 | |||
9154 | |||
9155 | do { | ||
9156 | /* Lock MCP using an unload request */ | ||
9157 | fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0); | ||
9158 | if (!fw) { | ||
9159 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
9160 | rc = -EBUSY; | ||
9161 | break; | ||
9162 | } | ||
9163 | |||
9164 | if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON) { | ||
9165 | rc = bnx2x_prev_unload_common(bp); | ||
9166 | break; | ||
9167 | } | ||
9168 | |||
9169 | /* non-common reply from MCP night require looping */ | ||
9170 | rc = bnx2x_prev_unload_uncommon(bp); | ||
9171 | if (rc != BNX2X_PREV_WAIT_NEEDED) | ||
9172 | break; | ||
9173 | |||
9174 | msleep(20); | ||
9175 | } while (--time_counter); | ||
9176 | |||
9177 | if (!time_counter || rc) { | ||
9178 | BNX2X_ERR("Failed unloading previous driver, aborting\n"); | ||
9179 | rc = -EBUSY; | ||
9180 | } | ||
9181 | |||
9182 | BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc); | ||
9183 | |||
9184 | return rc; | ||
8918 | } | 9185 | } |
8919 | 9186 | ||
8920 | static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | 9187 | static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) |
@@ -10100,8 +10367,16 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
10100 | func = BP_FUNC(bp); | 10367 | func = BP_FUNC(bp); |
10101 | 10368 | ||
10102 | /* need to reset chip if undi was active */ | 10369 | /* need to reset chip if undi was active */ |
10103 | if (!BP_NOMCP(bp)) | 10370 | if (!BP_NOMCP(bp)) { |
10104 | bnx2x_undi_unload(bp); | 10371 | /* init fw_seq */ |
10372 | bp->fw_seq = | ||
10373 | SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) & | ||
10374 | DRV_MSG_SEQ_NUMBER_MASK; | ||
10375 | BNX2X_DEV_INFO("fw_seq 0x%08x\n", bp->fw_seq); | ||
10376 | |||
10377 | bnx2x_prev_unload(bp); | ||
10378 | } | ||
10379 | |||
10105 | 10380 | ||
10106 | if (CHIP_REV_IS_FPGA(bp)) | 10381 | if (CHIP_REV_IS_FPGA(bp)) |
10107 | dev_err(&bp->pdev->dev, "FPGA detected\n"); | 10382 | dev_err(&bp->pdev->dev, "FPGA detected\n"); |
@@ -11431,9 +11706,18 @@ static int __init bnx2x_init(void) | |||
11431 | 11706 | ||
11432 | static void __exit bnx2x_cleanup(void) | 11707 | static void __exit bnx2x_cleanup(void) |
11433 | { | 11708 | { |
11709 | struct list_head *pos, *q; | ||
11434 | pci_unregister_driver(&bnx2x_pci_driver); | 11710 | pci_unregister_driver(&bnx2x_pci_driver); |
11435 | 11711 | ||
11436 | destroy_workqueue(bnx2x_wq); | 11712 | destroy_workqueue(bnx2x_wq); |
11713 | |||
11714 | /* Free globablly allocated resources */ | ||
11715 | list_for_each_safe(pos, q, &bnx2x_prev_list) { | ||
11716 | struct bnx2x_prev_path_list *tmp = | ||
11717 | list_entry(pos, struct bnx2x_prev_path_list, list); | ||
11718 | list_del(pos); | ||
11719 | kfree(tmp); | ||
11720 | } | ||
11437 | } | 11721 | } |
11438 | 11722 | ||
11439 | void bnx2x_notify_link_changed(struct bnx2x *bp) | 11723 | void bnx2x_notify_link_changed(struct bnx2x *bp) |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index fd7fb4581849..c25803b9c0ca 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
@@ -987,6 +987,7 @@ | |||
987 | * clear; 1 = set. Data valid only in addresses 0-4. all the rest are zero. */ | 987 | * clear; 1 = set. Data valid only in addresses 0-4. all the rest are zero. */ |
988 | #define IGU_REG_WRITE_DONE_PENDING 0x130480 | 988 | #define IGU_REG_WRITE_DONE_PENDING 0x130480 |
989 | #define MCP_A_REG_MCPR_SCRATCH 0x3a0000 | 989 | #define MCP_A_REG_MCPR_SCRATCH 0x3a0000 |
990 | #define MCP_REG_MCPR_ACCESS_LOCK 0x8009c | ||
990 | #define MCP_REG_MCPR_CPU_PROGRAM_COUNTER 0x8501c | 991 | #define MCP_REG_MCPR_CPU_PROGRAM_COUNTER 0x8501c |
991 | #define MCP_REG_MCPR_GP_INPUTS 0x800c0 | 992 | #define MCP_REG_MCPR_GP_INPUTS 0x800c0 |
992 | #define MCP_REG_MCPR_GP_OENABLE 0x800c8 | 993 | #define MCP_REG_MCPR_GP_OENABLE 0x800c8 |
@@ -1686,6 +1687,7 @@ | |||
1686 | [10] rst_dbg; [11] rst_misc_core; [12] rst_dbue (UART); [13] | 1687 | [10] rst_dbg; [11] rst_misc_core; [12] rst_dbue (UART); [13] |
1687 | Pci_resetmdio_n; [14] rst_emac0_hard_core; [15] rst_emac1_hard_core; 16] | 1688 | Pci_resetmdio_n; [14] rst_emac0_hard_core; [15] rst_emac1_hard_core; 16] |
1688 | rst_pxp_rq_rd_wr; 31:17] reserved */ | 1689 | rst_pxp_rq_rd_wr; 31:17] reserved */ |
1690 | #define MISC_REG_RESET_REG_1 0xa580 | ||
1689 | #define MISC_REG_RESET_REG_2 0xa590 | 1691 | #define MISC_REG_RESET_REG_2 0xa590 |
1690 | /* [RW 20] 20 bit GRC address where the scratch-pad of the MCP that is | 1692 | /* [RW 20] 20 bit GRC address where the scratch-pad of the MCP that is |
1691 | shared with the driver resides */ | 1693 | shared with the driver resides */ |
@@ -5352,6 +5354,7 @@ | |||
5352 | #define XMAC_CTRL_REG_TX_EN (0x1<<0) | 5354 | #define XMAC_CTRL_REG_TX_EN (0x1<<0) |
5353 | #define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18) | 5355 | #define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18) |
5354 | #define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17) | 5356 | #define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17) |
5357 | #define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1) | ||
5355 | #define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0) | 5358 | #define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0) |
5356 | #define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3) | 5359 | #define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3) |
5357 | #define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4) | 5360 | #define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4) |
@@ -5606,6 +5609,7 @@ | |||
5606 | /* [RC 32] Parity register #0 read clear */ | 5609 | /* [RC 32] Parity register #0 read clear */ |
5607 | #define XSEM_REG_XSEM_PRTY_STS_CLR_0 0x280128 | 5610 | #define XSEM_REG_XSEM_PRTY_STS_CLR_0 0x280128 |
5608 | #define XSEM_REG_XSEM_PRTY_STS_CLR_1 0x280138 | 5611 | #define XSEM_REG_XSEM_PRTY_STS_CLR_1 0x280138 |
5612 | #define MCPR_ACCESS_LOCK_LOCK (1L<<31) | ||
5609 | #define MCPR_NVM_ACCESS_ENABLE_EN (1L<<0) | 5613 | #define MCPR_NVM_ACCESS_ENABLE_EN (1L<<0) |
5610 | #define MCPR_NVM_ACCESS_ENABLE_WR_EN (1L<<1) | 5614 | #define MCPR_NVM_ACCESS_ENABLE_WR_EN (1L<<1) |
5611 | #define MCPR_NVM_ADDR_NVM_ADDR_VALUE (0xffffffL<<0) | 5615 | #define MCPR_NVM_ADDR_NVM_ADDR_VALUE (0xffffffL<<0) |
@@ -5732,6 +5736,7 @@ | |||
5732 | #define MISC_REGISTERS_GPIO_PORT_SHIFT 4 | 5736 | #define MISC_REGISTERS_GPIO_PORT_SHIFT 4 |
5733 | #define MISC_REGISTERS_GPIO_SET_POS 8 | 5737 | #define MISC_REGISTERS_GPIO_SET_POS 8 |
5734 | #define MISC_REGISTERS_RESET_REG_1_CLEAR 0x588 | 5738 | #define MISC_REGISTERS_RESET_REG_1_CLEAR 0x588 |
5739 | #define MISC_REGISTERS_RESET_REG_1_RST_BRB1 (0x1<<0) | ||
5735 | #define MISC_REGISTERS_RESET_REG_1_RST_DORQ (0x1<<19) | 5740 | #define MISC_REGISTERS_RESET_REG_1_RST_DORQ (0x1<<19) |
5736 | #define MISC_REGISTERS_RESET_REG_1_RST_HC (0x1<<29) | 5741 | #define MISC_REGISTERS_RESET_REG_1_RST_HC (0x1<<29) |
5737 | #define MISC_REGISTERS_RESET_REG_1_RST_NIG (0x1<<7) | 5742 | #define MISC_REGISTERS_RESET_REG_1_RST_NIG (0x1<<7) |
@@ -6816,10 +6821,13 @@ Theotherbitsarereservedandshouldbezero*/ | |||
6816 | 6821 | ||
6817 | #define MDIO_AN_REG_8481_10GBASE_T_AN_CTRL 0x0020 | 6822 | #define MDIO_AN_REG_8481_10GBASE_T_AN_CTRL 0x0020 |
6818 | #define MDIO_AN_REG_8481_LEGACY_MII_CTRL 0xffe0 | 6823 | #define MDIO_AN_REG_8481_LEGACY_MII_CTRL 0xffe0 |
6824 | #define MDIO_AN_REG_8481_MII_CTRL_FORCE_1G 0x40 | ||
6819 | #define MDIO_AN_REG_8481_LEGACY_MII_STATUS 0xffe1 | 6825 | #define MDIO_AN_REG_8481_LEGACY_MII_STATUS 0xffe1 |
6820 | #define MDIO_AN_REG_8481_LEGACY_AN_ADV 0xffe4 | 6826 | #define MDIO_AN_REG_8481_LEGACY_AN_ADV 0xffe4 |
6821 | #define MDIO_AN_REG_8481_LEGACY_AN_EXPANSION 0xffe6 | 6827 | #define MDIO_AN_REG_8481_LEGACY_AN_EXPANSION 0xffe6 |
6822 | #define MDIO_AN_REG_8481_1000T_CTRL 0xffe9 | 6828 | #define MDIO_AN_REG_8481_1000T_CTRL 0xffe9 |
6829 | #define MDIO_AN_REG_8481_1G_100T_EXT_CTRL 0xfff0 | ||
6830 | #define MIDO_AN_REG_8481_EXT_CTRL_FORCE_LEDS_OFF 0x0008 | ||
6823 | #define MDIO_AN_REG_8481_EXPANSION_REG_RD_RW 0xfff5 | 6831 | #define MDIO_AN_REG_8481_EXPANSION_REG_RD_RW 0xfff5 |
6824 | #define MDIO_AN_REG_8481_EXPANSION_REG_ACCESS 0xfff7 | 6832 | #define MDIO_AN_REG_8481_EXPANSION_REG_ACCESS 0xfff7 |
6825 | #define MDIO_AN_REG_8481_AUX_CTRL 0xfff8 | 6833 | #define MDIO_AN_REG_8481_AUX_CTRL 0xfff8 |
@@ -6939,6 +6947,10 @@ Theotherbitsarereservedandshouldbezero*/ | |||
6939 | #define MDIO_WC_REG_GP2_STATUS_GP_2_2 0x81d2 | 6947 | #define MDIO_WC_REG_GP2_STATUS_GP_2_2 0x81d2 |
6940 | #define MDIO_WC_REG_GP2_STATUS_GP_2_3 0x81d3 | 6948 | #define MDIO_WC_REG_GP2_STATUS_GP_2_3 0x81d3 |
6941 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4 0x81d4 | 6949 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4 0x81d4 |
6950 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL73_AN_CMPL 0x1000 | ||
6951 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_AN_CMPL 0x0100 | ||
6952 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_LP_AN_CAP 0x0010 | ||
6953 | #define MDIO_WC_REG_GP2_STATUS_GP_2_4_CL37_AN_CAP 0x1 | ||
6942 | #define MDIO_WC_REG_UC_INFO_B0_DEAD_TRAP 0x81EE | 6954 | #define MDIO_WC_REG_UC_INFO_B0_DEAD_TRAP 0x81EE |
6943 | #define MDIO_WC_REG_UC_INFO_B1_VERSION 0x81F0 | 6955 | #define MDIO_WC_REG_UC_INFO_B1_VERSION 0x81F0 |
6944 | #define MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE 0x81F2 | 6956 | #define MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE 0x81F2 |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 3f52fadee3ed..513573321625 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |||
@@ -3847,7 +3847,7 @@ static bool bnx2x_credit_pool_get_entry( | |||
3847 | continue; | 3847 | continue; |
3848 | 3848 | ||
3849 | /* If we've got here we are going to find a free entry */ | 3849 | /* If we've got here we are going to find a free entry */ |
3850 | for (idx = vec * BNX2X_POOL_VEC_SIZE, i = 0; | 3850 | for (idx = vec * BIT_VEC64_ELEM_SZ, i = 0; |
3851 | i < BIT_VEC64_ELEM_SZ; idx++, i++) | 3851 | i < BIT_VEC64_ELEM_SZ; idx++, i++) |
3852 | 3852 | ||
3853 | if (BIT_VEC64_TEST_BIT(o->pool_mirror, idx)) { | 3853 | if (BIT_VEC64_TEST_BIT(o->pool_mirror, idx)) { |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 4e4bb3875868..ceeab8e852ef 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -879,8 +879,13 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) | |||
879 | if (sblk->status & SD_STATUS_LINK_CHG) | 879 | if (sblk->status & SD_STATUS_LINK_CHG) |
880 | work_exists = 1; | 880 | work_exists = 1; |
881 | } | 881 | } |
882 | /* check for RX/TX work to do */ | 882 | |
883 | if (sblk->idx[0].tx_consumer != tnapi->tx_cons || | 883 | /* check for TX work to do */ |
884 | if (sblk->idx[0].tx_consumer != tnapi->tx_cons) | ||
885 | work_exists = 1; | ||
886 | |||
887 | /* check for RX work to do */ | ||
888 | if (tnapi->rx_rcb_prod_idx && | ||
884 | *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) | 889 | *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) |
885 | work_exists = 1; | 890 | work_exists = 1; |
886 | 891 | ||
@@ -2778,7 +2783,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power) | |||
2778 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || | 2783 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || |
2779 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || | 2784 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || |
2780 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && | 2785 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 && |
2781 | (tp->phy_flags & TG3_PHYFLG_MII_SERDES))) | 2786 | (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) || |
2787 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
2788 | !tp->pci_fn)) | ||
2782 | return; | 2789 | return; |
2783 | 2790 | ||
2784 | if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX || | 2791 | if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX || |
@@ -6122,6 +6129,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget) | |||
6122 | return work_done; | 6129 | return work_done; |
6123 | } | 6130 | } |
6124 | 6131 | ||
6132 | if (!tnapi->rx_rcb_prod_idx) | ||
6133 | return work_done; | ||
6134 | |||
6125 | /* run RX thread, within the bounds set by NAPI. | 6135 | /* run RX thread, within the bounds set by NAPI. |
6126 | * All RX "locking" is done by ensuring outside | 6136 | * All RX "locking" is done by ensuring outside |
6127 | * code synchronizes with tg3->napi.poll() | 6137 | * code synchronizes with tg3->napi.poll() |
@@ -7565,6 +7575,12 @@ static int tg3_alloc_consistent(struct tg3 *tp) | |||
7565 | */ | 7575 | */ |
7566 | switch (i) { | 7576 | switch (i) { |
7567 | default: | 7577 | default: |
7578 | if (tg3_flag(tp, ENABLE_RSS)) { | ||
7579 | tnapi->rx_rcb_prod_idx = NULL; | ||
7580 | break; | ||
7581 | } | ||
7582 | /* Fall through */ | ||
7583 | case 1: | ||
7568 | tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; | 7584 | tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; |
7569 | break; | 7585 | break; |
7570 | case 2: | 7586 | case 2: |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 63bfdd10bd6d..abb6ce7c1b7e 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | |||
@@ -1150,6 +1150,48 @@ release_tpsram: | |||
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | /** | 1152 | /** |
1153 | * t3_synchronize_rx - wait for current Rx processing on a port to complete | ||
1154 | * @adap: the adapter | ||
1155 | * @p: the port | ||
1156 | * | ||
1157 | * Ensures that current Rx processing on any of the queues associated with | ||
1158 | * the given port completes before returning. We do this by acquiring and | ||
1159 | * releasing the locks of the response queues associated with the port. | ||
1160 | */ | ||
1161 | static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p) | ||
1162 | { | ||
1163 | int i; | ||
1164 | |||
1165 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { | ||
1166 | struct sge_rspq *q = &adap->sge.qs[i].rspq; | ||
1167 | |||
1168 | spin_lock_irq(&q->lock); | ||
1169 | spin_unlock_irq(&q->lock); | ||
1170 | } | ||
1171 | } | ||
1172 | |||
1173 | static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) | ||
1174 | { | ||
1175 | struct port_info *pi = netdev_priv(dev); | ||
1176 | struct adapter *adapter = pi->adapter; | ||
1177 | |||
1178 | if (adapter->params.rev > 0) { | ||
1179 | t3_set_vlan_accel(adapter, 1 << pi->port_id, | ||
1180 | features & NETIF_F_HW_VLAN_RX); | ||
1181 | } else { | ||
1182 | /* single control for all ports */ | ||
1183 | unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX; | ||
1184 | |||
1185 | for_each_port(adapter, i) | ||
1186 | have_vlans |= | ||
1187 | adapter->port[i]->features & NETIF_F_HW_VLAN_RX; | ||
1188 | |||
1189 | t3_set_vlan_accel(adapter, 1, have_vlans); | ||
1190 | } | ||
1191 | t3_synchronize_rx(adapter, pi); | ||
1192 | } | ||
1193 | |||
1194 | /** | ||
1153 | * cxgb_up - enable the adapter | 1195 | * cxgb_up - enable the adapter |
1154 | * @adapter: adapter being enabled | 1196 | * @adapter: adapter being enabled |
1155 | * | 1197 | * |
@@ -1161,7 +1203,7 @@ release_tpsram: | |||
1161 | */ | 1203 | */ |
1162 | static int cxgb_up(struct adapter *adap) | 1204 | static int cxgb_up(struct adapter *adap) |
1163 | { | 1205 | { |
1164 | int err; | 1206 | int i, err; |
1165 | 1207 | ||
1166 | if (!(adap->flags & FULL_INIT_DONE)) { | 1208 | if (!(adap->flags & FULL_INIT_DONE)) { |
1167 | err = t3_check_fw_version(adap); | 1209 | err = t3_check_fw_version(adap); |
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap) | |||
1198 | if (err) | 1240 | if (err) |
1199 | goto out; | 1241 | goto out; |
1200 | 1242 | ||
1243 | for_each_port(adap, i) | ||
1244 | cxgb_vlan_mode(adap->port[i], adap->port[i]->features); | ||
1245 | |||
1201 | setup_rss(adap); | 1246 | setup_rss(adap); |
1202 | if (!(adap->flags & NAPI_INIT)) | 1247 | if (!(adap->flags & NAPI_INIT)) |
1203 | init_napi(adap); | 1248 | init_napi(adap); |
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p) | |||
2508 | return 0; | 2553 | return 0; |
2509 | } | 2554 | } |
2510 | 2555 | ||
2511 | /** | ||
2512 | * t3_synchronize_rx - wait for current Rx processing on a port to complete | ||
2513 | * @adap: the adapter | ||
2514 | * @p: the port | ||
2515 | * | ||
2516 | * Ensures that current Rx processing on any of the queues associated with | ||
2517 | * the given port completes before returning. We do this by acquiring and | ||
2518 | * releasing the locks of the response queues associated with the port. | ||
2519 | */ | ||
2520 | static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p) | ||
2521 | { | ||
2522 | int i; | ||
2523 | |||
2524 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { | ||
2525 | struct sge_rspq *q = &adap->sge.qs[i].rspq; | ||
2526 | |||
2527 | spin_lock_irq(&q->lock); | ||
2528 | spin_unlock_irq(&q->lock); | ||
2529 | } | ||
2530 | } | ||
2531 | |||
2532 | static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) | ||
2533 | { | ||
2534 | struct port_info *pi = netdev_priv(dev); | ||
2535 | struct adapter *adapter = pi->adapter; | ||
2536 | |||
2537 | if (adapter->params.rev > 0) { | ||
2538 | t3_set_vlan_accel(adapter, 1 << pi->port_id, | ||
2539 | features & NETIF_F_HW_VLAN_RX); | ||
2540 | } else { | ||
2541 | /* single control for all ports */ | ||
2542 | unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX; | ||
2543 | |||
2544 | for_each_port(adapter, i) | ||
2545 | have_vlans |= | ||
2546 | adapter->port[i]->features & NETIF_F_HW_VLAN_RX; | ||
2547 | |||
2548 | t3_set_vlan_accel(adapter, 1, have_vlans); | ||
2549 | } | ||
2550 | t3_synchronize_rx(adapter, pi); | ||
2551 | } | ||
2552 | |||
2553 | static netdev_features_t cxgb_fix_features(struct net_device *dev, | 2556 | static netdev_features_t cxgb_fix_features(struct net_device *dev, |
2554 | netdev_features_t features) | 2557 | netdev_features_t features) |
2555 | { | 2558 | { |
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3353 | err = sysfs_create_group(&adapter->port[0]->dev.kobj, | 3356 | err = sysfs_create_group(&adapter->port[0]->dev.kobj, |
3354 | &cxgb3_attr_group); | 3357 | &cxgb3_attr_group); |
3355 | 3358 | ||
3356 | for_each_port(adapter, i) | ||
3357 | cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features); | ||
3358 | |||
3359 | print_port_info(adapter, ai); | 3359 | print_port_info(adapter, ai); |
3360 | return 0; | 3360 | return 0; |
3361 | 3361 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 05ff076af06d..b126b98065a9 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -2000,13 +2000,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = { | |||
2000 | /* | 2000 | /* |
2001 | * debugfs support | 2001 | * debugfs support |
2002 | */ | 2002 | */ |
2003 | |||
2004 | static int mem_open(struct inode *inode, struct file *file) | ||
2005 | { | ||
2006 | file->private_data = inode->i_private; | ||
2007 | return 0; | ||
2008 | } | ||
2009 | |||
2010 | static ssize_t mem_read(struct file *file, char __user *buf, size_t count, | 2003 | static ssize_t mem_read(struct file *file, char __user *buf, size_t count, |
2011 | loff_t *ppos) | 2004 | loff_t *ppos) |
2012 | { | 2005 | { |
@@ -2050,7 +2043,7 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count, | |||
2050 | 2043 | ||
2051 | static const struct file_operations mem_debugfs_fops = { | 2044 | static const struct file_operations mem_debugfs_fops = { |
2052 | .owner = THIS_MODULE, | 2045 | .owner = THIS_MODULE, |
2053 | .open = mem_open, | 2046 | .open = simple_open, |
2054 | .read = mem_read, | 2047 | .read = mem_read, |
2055 | .llseek = default_llseek, | 2048 | .llseek = default_llseek, |
2056 | }; | 2049 | }; |
diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c index b2dc2c81a147..2e09edb9cdf8 100644 --- a/drivers/net/ethernet/dlink/dl2k.c +++ b/drivers/net/ethernet/dlink/dl2k.c | |||
@@ -1259,55 +1259,21 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1259 | { | 1259 | { |
1260 | int phy_addr; | 1260 | int phy_addr; |
1261 | struct netdev_private *np = netdev_priv(dev); | 1261 | struct netdev_private *np = netdev_priv(dev); |
1262 | struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; | 1262 | struct mii_ioctl_data *miidata = if_mii(rq); |
1263 | |||
1264 | struct netdev_desc *desc; | ||
1265 | int i; | ||
1266 | 1263 | ||
1267 | phy_addr = np->phy_addr; | 1264 | phy_addr = np->phy_addr; |
1268 | switch (cmd) { | 1265 | switch (cmd) { |
1269 | case SIOCDEVPRIVATE: | 1266 | case SIOCGMIIPHY: |
1270 | break; | 1267 | miidata->phy_id = phy_addr; |
1271 | |||
1272 | case SIOCDEVPRIVATE + 1: | ||
1273 | miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num); | ||
1274 | break; | 1268 | break; |
1275 | case SIOCDEVPRIVATE + 2: | 1269 | case SIOCGMIIREG: |
1276 | mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value); | 1270 | miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num); |
1277 | break; | 1271 | break; |
1278 | case SIOCDEVPRIVATE + 3: | 1272 | case SIOCSMIIREG: |
1279 | break; | 1273 | if (!capable(CAP_NET_ADMIN)) |
1280 | case SIOCDEVPRIVATE + 4: | 1274 | return -EPERM; |
1281 | break; | 1275 | mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in); |
1282 | case SIOCDEVPRIVATE + 5: | ||
1283 | netif_stop_queue (dev); | ||
1284 | break; | 1276 | break; |
1285 | case SIOCDEVPRIVATE + 6: | ||
1286 | netif_wake_queue (dev); | ||
1287 | break; | ||
1288 | case SIOCDEVPRIVATE + 7: | ||
1289 | printk | ||
1290 | ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n", | ||
1291 | netif_queue_stopped(dev), np->cur_tx, np->old_tx, np->cur_rx, | ||
1292 | np->old_rx); | ||
1293 | break; | ||
1294 | case SIOCDEVPRIVATE + 8: | ||
1295 | printk("TX ring:\n"); | ||
1296 | for (i = 0; i < TX_RING_SIZE; i++) { | ||
1297 | desc = &np->tx_ring[i]; | ||
1298 | printk | ||
1299 | ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x", | ||
1300 | i, | ||
1301 | (u32) (np->tx_ring_dma + i * sizeof (*desc)), | ||
1302 | (u32)le64_to_cpu(desc->next_desc), | ||
1303 | (u32)le64_to_cpu(desc->status), | ||
1304 | (u32)(le64_to_cpu(desc->fraginfo) >> 32), | ||
1305 | (u32)le64_to_cpu(desc->fraginfo)); | ||
1306 | printk ("\n"); | ||
1307 | } | ||
1308 | printk ("\n"); | ||
1309 | break; | ||
1310 | |||
1311 | default: | 1277 | default: |
1312 | return -EOPNOTSUPP; | 1278 | return -EOPNOTSUPP; |
1313 | } | 1279 | } |
diff --git a/drivers/net/ethernet/dlink/dl2k.h b/drivers/net/ethernet/dlink/dl2k.h index ba0adcafa55a..30c2da3de548 100644 --- a/drivers/net/ethernet/dlink/dl2k.h +++ b/drivers/net/ethernet/dlink/dl2k.h | |||
@@ -365,13 +365,6 @@ struct ioctl_data { | |||
365 | char *data; | 365 | char *data; |
366 | }; | 366 | }; |
367 | 367 | ||
368 | struct mii_data { | ||
369 | __u16 reserved; | ||
370 | __u16 reg_num; | ||
371 | __u16 in_value; | ||
372 | __u16 out_value; | ||
373 | }; | ||
374 | |||
375 | /* The Rx and Tx buffer descriptors. */ | 368 | /* The Rx and Tx buffer descriptors. */ |
376 | struct netdev_desc { | 369 | struct netdev_desc { |
377 | __le64 next_desc; | 370 | __le64 next_desc; |
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index 9eb815941df5..f7f0bf5d037b 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c | |||
@@ -356,13 +356,13 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev) | |||
356 | 356 | ||
357 | if (prop) | 357 | if (prop) |
358 | tbiaddr = *prop; | 358 | tbiaddr = *prop; |
359 | } | ||
360 | 359 | ||
361 | if (tbiaddr == -1) { | 360 | if (tbiaddr == -1) { |
362 | err = -EBUSY; | 361 | err = -EBUSY; |
363 | goto err_free_irqs; | 362 | goto err_free_irqs; |
364 | } else { | 363 | } else { |
365 | out_be32(tbipa, tbiaddr); | 364 | out_be32(tbipa, tbiaddr); |
365 | } | ||
366 | } | 366 | } |
367 | 367 | ||
368 | err = of_mdiobus_register(new_bus, np); | 368 | err = of_mdiobus_register(new_bus, np); |
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 4e3cd2f8debb..9ac14f804851 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c | |||
@@ -116,10 +116,10 @@ static struct ucc_geth_info ugeth_primary_info = { | |||
116 | .maxGroupAddrInHash = 4, | 116 | .maxGroupAddrInHash = 4, |
117 | .maxIndAddrInHash = 4, | 117 | .maxIndAddrInHash = 4, |
118 | .prel = 7, | 118 | .prel = 7, |
119 | .maxFrameLength = 1518, | 119 | .maxFrameLength = 1518+16, /* Add extra bytes for VLANs etc. */ |
120 | .minFrameLength = 64, | 120 | .minFrameLength = 64, |
121 | .maxD1Length = 1520, | 121 | .maxD1Length = 1520+16, /* Add extra bytes for VLANs etc. */ |
122 | .maxD2Length = 1520, | 122 | .maxD2Length = 1520+16, /* Add extra bytes for VLANs etc. */ |
123 | .vlantype = 0x8100, | 123 | .vlantype = 0x8100, |
124 | .ecamptr = ((uint32_t) NULL), | 124 | .ecamptr = ((uint32_t) NULL), |
125 | .eventRegMask = UCCE_OTHER, | 125 | .eventRegMask = UCCE_OTHER, |
@@ -3945,6 +3945,8 @@ static int ucc_geth_probe(struct platform_device* ofdev) | |||
3945 | } | 3945 | } |
3946 | 3946 | ||
3947 | if (max_speed == SPEED_1000) { | 3947 | if (max_speed == SPEED_1000) { |
3948 | unsigned int snums = qe_get_num_of_snums(); | ||
3949 | |||
3948 | /* configure muram FIFOs for gigabit operation */ | 3950 | /* configure muram FIFOs for gigabit operation */ |
3949 | ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; | 3951 | ug_info->uf_info.urfs = UCC_GETH_URFS_GIGA_INIT; |
3950 | ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; | 3952 | ug_info->uf_info.urfet = UCC_GETH_URFET_GIGA_INIT; |
@@ -3954,11 +3956,11 @@ static int ucc_geth_probe(struct platform_device* ofdev) | |||
3954 | ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT; | 3956 | ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT; |
3955 | ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4; | 3957 | ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4; |
3956 | 3958 | ||
3957 | /* If QE's snum number is 46 which means we need to support | 3959 | /* If QE's snum number is 46/76 which means we need to support |
3958 | * 4 UECs at 1000Base-T simultaneously, we need to allocate | 3960 | * 4 UECs at 1000Base-T simultaneously, we need to allocate |
3959 | * more Threads to Rx. | 3961 | * more Threads to Rx. |
3960 | */ | 3962 | */ |
3961 | if (qe_get_num_of_snums() == 46) | 3963 | if ((snums == 76) || (snums == 46)) |
3962 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_6; | 3964 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_6; |
3963 | else | 3965 | else |
3964 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; | 3966 | ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; |
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h index 2e395a2566b8..f71b3e7b12de 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.h +++ b/drivers/net/ethernet/freescale/ucc_geth.h | |||
@@ -877,7 +877,7 @@ struct ucc_geth_hardware_statistics { | |||
877 | 877 | ||
878 | /* Driver definitions */ | 878 | /* Driver definitions */ |
879 | #define TX_BD_RING_LEN 0x10 | 879 | #define TX_BD_RING_LEN 0x10 |
880 | #define RX_BD_RING_LEN 0x10 | 880 | #define RX_BD_RING_LEN 0x20 |
881 | 881 | ||
882 | #define TX_RING_MOD_MASK(size) (size-1) | 882 | #define TX_RING_MOD_MASK(size) (size-1) |
883 | #define RX_RING_MOD_MASK(size) (size-1) | 883 | #define RX_RING_MOD_MASK(size) (size-1) |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 3516e17a399d..c9069a28832b 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void) | |||
290 | 290 | ||
291 | arr[i].adh = adapter->handle; | 291 | arr[i].adh = adapter->handle; |
292 | arr[i].port_id = port->logical_port_id; | 292 | arr[i].port_id = port->logical_port_id; |
293 | arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | | 293 | arr[i].reg_type = EHEA_BCMC_MULTICAST | |
294 | EHEA_BCMC_MULTICAST | | ||
295 | EHEA_BCMC_UNTAGGED; | 294 | EHEA_BCMC_UNTAGGED; |
295 | if (mc_entry->macaddr == 0) | ||
296 | arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL; | ||
296 | arr[i++].macaddr = mc_entry->macaddr; | 297 | arr[i++].macaddr = mc_entry->macaddr; |
297 | 298 | ||
298 | arr[i].adh = adapter->handle; | 299 | arr[i].adh = adapter->handle; |
299 | arr[i].port_id = port->logical_port_id; | 300 | arr[i].port_id = port->logical_port_id; |
300 | arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | | 301 | arr[i].reg_type = EHEA_BCMC_MULTICAST | |
301 | EHEA_BCMC_MULTICAST | | ||
302 | EHEA_BCMC_VLANID_ALL; | 302 | EHEA_BCMC_VLANID_ALL; |
303 | if (mc_entry->macaddr == 0) | ||
304 | arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL; | ||
303 | arr[i++].macaddr = mc_entry->macaddr; | 305 | arr[i++].macaddr = mc_entry->macaddr; |
304 | num_registrations -= 2; | 306 | num_registrations -= 2; |
305 | } | 307 | } |
@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, | |||
1838 | u64 hret; | 1840 | u64 hret; |
1839 | u8 reg_type; | 1841 | u8 reg_type; |
1840 | 1842 | ||
1841 | reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST | 1843 | reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED; |
1842 | | EHEA_BCMC_UNTAGGED; | 1844 | if (mc_mac_addr == 0) |
1845 | reg_type |= EHEA_BCMC_SCOPE_ALL; | ||
1843 | 1846 | ||
1844 | hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, | 1847 | hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, |
1845 | port->logical_port_id, | 1848 | port->logical_port_id, |
@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, | |||
1847 | if (hret) | 1850 | if (hret) |
1848 | goto out; | 1851 | goto out; |
1849 | 1852 | ||
1850 | reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST | 1853 | reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL; |
1851 | | EHEA_BCMC_VLANID_ALL; | 1854 | if (mc_mac_addr == 0) |
1855 | reg_type |= EHEA_BCMC_SCOPE_ALL; | ||
1852 | 1856 | ||
1853 | hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, | 1857 | hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, |
1854 | port->logical_port_id, | 1858 | port->logical_port_id, |
@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) | |||
1898 | netdev_err(dev, | 1902 | netdev_err(dev, |
1899 | "failed enabling IFF_ALLMULTI\n"); | 1903 | "failed enabling IFF_ALLMULTI\n"); |
1900 | } | 1904 | } |
1901 | } else | 1905 | } else { |
1902 | if (!enable) { | 1906 | if (!enable) { |
1903 | /* Disable ALLMULTI */ | 1907 | /* Disable ALLMULTI */ |
1904 | hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC); | 1908 | hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC); |
@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) | |||
1908 | netdev_err(dev, | 1912 | netdev_err(dev, |
1909 | "failed disabling IFF_ALLMULTI\n"); | 1913 | "failed disabling IFF_ALLMULTI\n"); |
1910 | } | 1914 | } |
1915 | } | ||
1911 | } | 1916 | } |
1912 | 1917 | ||
1913 | static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) | 1918 | static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) |
@@ -1941,11 +1946,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1941 | struct netdev_hw_addr *ha; | 1946 | struct netdev_hw_addr *ha; |
1942 | int ret; | 1947 | int ret; |
1943 | 1948 | ||
1944 | if (port->promisc) { | 1949 | ehea_promiscuous(dev, !!(dev->flags & IFF_PROMISC)); |
1945 | ehea_promiscuous(dev, 1); | ||
1946 | return; | ||
1947 | } | ||
1948 | ehea_promiscuous(dev, 0); | ||
1949 | 1950 | ||
1950 | if (dev->flags & IFF_ALLMULTI) { | 1951 | if (dev->flags & IFF_ALLMULTI) { |
1951 | ehea_allmulti(dev, 1); | 1952 | ehea_allmulti(dev, 1); |
@@ -2463,6 +2464,7 @@ static int ehea_down(struct net_device *dev) | |||
2463 | return 0; | 2464 | return 0; |
2464 | 2465 | ||
2465 | ehea_drop_multicast_list(dev); | 2466 | ehea_drop_multicast_list(dev); |
2467 | ehea_allmulti(dev, 0); | ||
2466 | ehea_broadcast_reg_helper(port, H_DEREG_BCMC); | 2468 | ehea_broadcast_reg_helper(port, H_DEREG_BCMC); |
2467 | 2469 | ||
2468 | ehea_free_interrupts(dev); | 2470 | ehea_free_interrupts(dev); |
@@ -3261,6 +3263,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3261 | struct ehea_adapter *adapter; | 3263 | struct ehea_adapter *adapter; |
3262 | const u64 *adapter_handle; | 3264 | const u64 *adapter_handle; |
3263 | int ret; | 3265 | int ret; |
3266 | int i; | ||
3264 | 3267 | ||
3265 | if (!dev || !dev->dev.of_node) { | 3268 | if (!dev || !dev->dev.of_node) { |
3266 | pr_err("Invalid ibmebus device probed\n"); | 3269 | pr_err("Invalid ibmebus device probed\n"); |
@@ -3314,17 +3317,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3314 | tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet, | 3317 | tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet, |
3315 | (unsigned long)adapter); | 3318 | (unsigned long)adapter); |
3316 | 3319 | ||
3317 | ret = ibmebus_request_irq(adapter->neq->attr.ist1, | ||
3318 | ehea_interrupt_neq, IRQF_DISABLED, | ||
3319 | "ehea_neq", adapter); | ||
3320 | if (ret) { | ||
3321 | dev_err(&dev->dev, "requesting NEQ IRQ failed\n"); | ||
3322 | goto out_kill_eq; | ||
3323 | } | ||
3324 | |||
3325 | ret = ehea_create_device_sysfs(dev); | 3320 | ret = ehea_create_device_sysfs(dev); |
3326 | if (ret) | 3321 | if (ret) |
3327 | goto out_free_irq; | 3322 | goto out_kill_eq; |
3328 | 3323 | ||
3329 | ret = ehea_setup_ports(adapter); | 3324 | ret = ehea_setup_ports(adapter); |
3330 | if (ret) { | 3325 | if (ret) { |
@@ -3332,15 +3327,28 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3332 | goto out_rem_dev_sysfs; | 3327 | goto out_rem_dev_sysfs; |
3333 | } | 3328 | } |
3334 | 3329 | ||
3330 | ret = ibmebus_request_irq(adapter->neq->attr.ist1, | ||
3331 | ehea_interrupt_neq, IRQF_DISABLED, | ||
3332 | "ehea_neq", adapter); | ||
3333 | if (ret) { | ||
3334 | dev_err(&dev->dev, "requesting NEQ IRQ failed\n"); | ||
3335 | goto out_shutdown_ports; | ||
3336 | } | ||
3337 | |||
3338 | |||
3335 | ret = 0; | 3339 | ret = 0; |
3336 | goto out; | 3340 | goto out; |
3337 | 3341 | ||
3342 | out_shutdown_ports: | ||
3343 | for (i = 0; i < EHEA_MAX_PORTS; i++) | ||
3344 | if (adapter->port[i]) { | ||
3345 | ehea_shutdown_single_port(adapter->port[i]); | ||
3346 | adapter->port[i] = NULL; | ||
3347 | } | ||
3348 | |||
3338 | out_rem_dev_sysfs: | 3349 | out_rem_dev_sysfs: |
3339 | ehea_remove_device_sysfs(dev); | 3350 | ehea_remove_device_sysfs(dev); |
3340 | 3351 | ||
3341 | out_free_irq: | ||
3342 | ibmebus_free_irq(adapter->neq->attr.ist1, adapter); | ||
3343 | |||
3344 | out_kill_eq: | 3352 | out_kill_eq: |
3345 | ehea_destroy_eq(adapter->neq); | 3353 | ehea_destroy_eq(adapter->neq); |
3346 | 3354 | ||
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h index 52c456ec4d6c..8364815c32ff 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h +++ b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h | |||
@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num, | |||
450 | void *cb_addr); | 450 | void *cb_addr); |
451 | 451 | ||
452 | #define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63) | 452 | #define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63) |
453 | #define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(61, 63) | 453 | #define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(60, 63) |
454 | #define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63) | 454 | #define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63) |
455 | #define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63) | 455 | #define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63) |
456 | 456 | ||
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 0e9aec8f6917..4348b6fd44fa 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -164,6 +164,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, | |||
164 | static bool e1000_vlan_used(struct e1000_adapter *adapter); | 164 | static bool e1000_vlan_used(struct e1000_adapter *adapter); |
165 | static void e1000_vlan_mode(struct net_device *netdev, | 165 | static void e1000_vlan_mode(struct net_device *netdev, |
166 | netdev_features_t features); | 166 | netdev_features_t features); |
167 | static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, | ||
168 | bool filter_on); | ||
167 | static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 169 | static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
168 | static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 170 | static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
169 | static void e1000_restore_vlan(struct e1000_adapter *adapter); | 171 | static void e1000_restore_vlan(struct e1000_adapter *adapter); |
@@ -215,7 +217,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver"); | |||
215 | MODULE_LICENSE("GPL"); | 217 | MODULE_LICENSE("GPL"); |
216 | MODULE_VERSION(DRV_VERSION); | 218 | MODULE_VERSION(DRV_VERSION); |
217 | 219 | ||
218 | static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE; | 220 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) |
221 | static int debug = -1; | ||
219 | module_param(debug, int, 0); | 222 | module_param(debug, int, 0); |
220 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | 223 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); |
221 | 224 | ||
@@ -979,7 +982,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
979 | adapter = netdev_priv(netdev); | 982 | adapter = netdev_priv(netdev); |
980 | adapter->netdev = netdev; | 983 | adapter->netdev = netdev; |
981 | adapter->pdev = pdev; | 984 | adapter->pdev = pdev; |
982 | adapter->msg_enable = (1 << debug) - 1; | 985 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
983 | adapter->bars = bars; | 986 | adapter->bars = bars; |
984 | adapter->need_ioport = need_ioport; | 987 | adapter->need_ioport = need_ioport; |
985 | 988 | ||
@@ -1214,7 +1217,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
1214 | if (err) | 1217 | if (err) |
1215 | goto err_register; | 1218 | goto err_register; |
1216 | 1219 | ||
1217 | e1000_vlan_mode(netdev, netdev->features); | 1220 | e1000_vlan_filter_on_off(adapter, false); |
1218 | 1221 | ||
1219 | /* print bus type/speed/width info */ | 1222 | /* print bus type/speed/width info */ |
1220 | e_info(probe, "(PCI%s:%dMHz:%d-bit) %pM\n", | 1223 | e_info(probe, "(PCI%s:%dMHz:%d-bit) %pM\n", |
@@ -4770,6 +4773,22 @@ static bool e1000_vlan_used(struct e1000_adapter *adapter) | |||
4770 | return false; | 4773 | return false; |
4771 | } | 4774 | } |
4772 | 4775 | ||
4776 | static void __e1000_vlan_mode(struct e1000_adapter *adapter, | ||
4777 | netdev_features_t features) | ||
4778 | { | ||
4779 | struct e1000_hw *hw = &adapter->hw; | ||
4780 | u32 ctrl; | ||
4781 | |||
4782 | ctrl = er32(CTRL); | ||
4783 | if (features & NETIF_F_HW_VLAN_RX) { | ||
4784 | /* enable VLAN tag insert/strip */ | ||
4785 | ctrl |= E1000_CTRL_VME; | ||
4786 | } else { | ||
4787 | /* disable VLAN tag insert/strip */ | ||
4788 | ctrl &= ~E1000_CTRL_VME; | ||
4789 | } | ||
4790 | ew32(CTRL, ctrl); | ||
4791 | } | ||
4773 | static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, | 4792 | static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, |
4774 | bool filter_on) | 4793 | bool filter_on) |
4775 | { | 4794 | { |
@@ -4779,6 +4798,7 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, | |||
4779 | if (!test_bit(__E1000_DOWN, &adapter->flags)) | 4798 | if (!test_bit(__E1000_DOWN, &adapter->flags)) |
4780 | e1000_irq_disable(adapter); | 4799 | e1000_irq_disable(adapter); |
4781 | 4800 | ||
4801 | __e1000_vlan_mode(adapter, adapter->netdev->features); | ||
4782 | if (filter_on) { | 4802 | if (filter_on) { |
4783 | /* enable VLAN receive filtering */ | 4803 | /* enable VLAN receive filtering */ |
4784 | rctl = er32(RCTL); | 4804 | rctl = er32(RCTL); |
@@ -4799,24 +4819,14 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, | |||
4799 | } | 4819 | } |
4800 | 4820 | ||
4801 | static void e1000_vlan_mode(struct net_device *netdev, | 4821 | static void e1000_vlan_mode(struct net_device *netdev, |
4802 | netdev_features_t features) | 4822 | netdev_features_t features) |
4803 | { | 4823 | { |
4804 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4824 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4805 | struct e1000_hw *hw = &adapter->hw; | ||
4806 | u32 ctrl; | ||
4807 | 4825 | ||
4808 | if (!test_bit(__E1000_DOWN, &adapter->flags)) | 4826 | if (!test_bit(__E1000_DOWN, &adapter->flags)) |
4809 | e1000_irq_disable(adapter); | 4827 | e1000_irq_disable(adapter); |
4810 | 4828 | ||
4811 | ctrl = er32(CTRL); | 4829 | __e1000_vlan_mode(adapter, features); |
4812 | if (features & NETIF_F_HW_VLAN_RX) { | ||
4813 | /* enable VLAN tag insert/strip */ | ||
4814 | ctrl |= E1000_CTRL_VME; | ||
4815 | } else { | ||
4816 | /* disable VLAN tag insert/strip */ | ||
4817 | ctrl &= ~E1000_CTRL_VME; | ||
4818 | } | ||
4819 | ew32(CTRL, ctrl); | ||
4820 | 4830 | ||
4821 | if (!test_bit(__E1000_DOWN, &adapter->flags)) | 4831 | if (!test_bit(__E1000_DOWN, &adapter->flags)) |
4822 | e1000_irq_enable(adapter); | 4832 | e1000_irq_enable(adapter); |
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index 86cdd4793992..b83897f76ee3 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h | |||
@@ -161,6 +161,12 @@ struct e1000_info; | |||
161 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ | 161 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ |
162 | #define LINK_TIMEOUT 100 | 162 | #define LINK_TIMEOUT 100 |
163 | 163 | ||
164 | /* | ||
165 | * Count for polling __E1000_RESET condition every 10-20msec. | ||
166 | * Experimentation has shown the reset can take approximately 210msec. | ||
167 | */ | ||
168 | #define E1000_CHECK_RESET_COUNT 25 | ||
169 | |||
164 | #define DEFAULT_RDTR 0 | 170 | #define DEFAULT_RDTR 0 |
165 | #define DEFAULT_RADV 8 | 171 | #define DEFAULT_RADV 8 |
166 | #define BURST_RDTR 0x20 | 172 | #define BURST_RDTR 0x20 |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 64c76443a7aa..b461c24945e3 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -1310,10 +1310,6 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1310 | 1310 | ||
1311 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) | 1311 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) |
1312 | oem_reg |= HV_OEM_BITS_LPLU; | 1312 | oem_reg |= HV_OEM_BITS_LPLU; |
1313 | |||
1314 | /* Set Restart auto-neg to activate the bits */ | ||
1315 | if (!hw->phy.ops.check_reset_block(hw)) | ||
1316 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1317 | } else { | 1313 | } else { |
1318 | if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | | 1314 | if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | |
1319 | E1000_PHY_CTRL_NOND0A_GBE_DISABLE)) | 1315 | E1000_PHY_CTRL_NOND0A_GBE_DISABLE)) |
@@ -1324,6 +1320,11 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1324 | oem_reg |= HV_OEM_BITS_LPLU; | 1320 | oem_reg |= HV_OEM_BITS_LPLU; |
1325 | } | 1321 | } |
1326 | 1322 | ||
1323 | /* Set Restart auto-neg to activate the bits */ | ||
1324 | if ((d0_state || (hw->mac.type != e1000_pchlan)) && | ||
1325 | !hw->phy.ops.check_reset_block(hw)) | ||
1326 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1327 | |||
1327 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); | 1328 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); |
1328 | 1329 | ||
1329 | release: | 1330 | release: |
@@ -3682,7 +3683,11 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) | |||
3682 | 3683 | ||
3683 | if (hw->mac.type >= e1000_pchlan) { | 3684 | if (hw->mac.type >= e1000_pchlan) { |
3684 | e1000_oem_bits_config_ich8lan(hw, false); | 3685 | e1000_oem_bits_config_ich8lan(hw, false); |
3685 | e1000_phy_hw_reset_ich8lan(hw); | 3686 | |
3687 | /* Reset PHY to activate OEM bits on 82577/8 */ | ||
3688 | if (hw->mac.type == e1000_pchlan) | ||
3689 | e1000e_phy_hw_reset_generic(hw); | ||
3690 | |||
3686 | ret_val = hw->phy.ops.acquire(hw); | 3691 | ret_val = hw->phy.ops.acquire(hw); |
3687 | if (ret_val) | 3692 | if (ret_val) |
3688 | return; | 3693 | return; |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 7152eb11b7b9..9520a6ac1f30 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -60,6 +60,11 @@ | |||
60 | char e1000e_driver_name[] = "e1000e"; | 60 | char e1000e_driver_name[] = "e1000e"; |
61 | const char e1000e_driver_version[] = DRV_VERSION; | 61 | const char e1000e_driver_version[] = DRV_VERSION; |
62 | 62 | ||
63 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) | ||
64 | static int debug = -1; | ||
65 | module_param(debug, int, 0); | ||
66 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | ||
67 | |||
63 | static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); | 68 | static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); |
64 | 69 | ||
65 | static const struct e1000_info *e1000_info_tbl[] = { | 70 | static const struct e1000_info *e1000_info_tbl[] = { |
@@ -1054,6 +1059,13 @@ static void e1000_print_hw_hang(struct work_struct *work) | |||
1054 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | 1059 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); |
1055 | /* execute the writes immediately */ | 1060 | /* execute the writes immediately */ |
1056 | e1e_flush(); | 1061 | e1e_flush(); |
1062 | /* | ||
1063 | * Due to rare timing issues, write to TIDV again to ensure | ||
1064 | * the write is successful | ||
1065 | */ | ||
1066 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
1067 | /* execute the writes immediately */ | ||
1068 | e1e_flush(); | ||
1057 | adapter->tx_hang_recheck = true; | 1069 | adapter->tx_hang_recheck = true; |
1058 | return; | 1070 | return; |
1059 | } | 1071 | } |
@@ -3611,6 +3623,16 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter) | |||
3611 | 3623 | ||
3612 | /* execute the writes immediately */ | 3624 | /* execute the writes immediately */ |
3613 | e1e_flush(); | 3625 | e1e_flush(); |
3626 | |||
3627 | /* | ||
3628 | * due to rare timing issues, write to TIDV/RDTR again to ensure the | ||
3629 | * write is successful | ||
3630 | */ | ||
3631 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
3632 | ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); | ||
3633 | |||
3634 | /* execute the writes immediately */ | ||
3635 | e1e_flush(); | ||
3614 | } | 3636 | } |
3615 | 3637 | ||
3616 | static void e1000e_update_stats(struct e1000_adapter *adapter); | 3638 | static void e1000e_update_stats(struct e1000_adapter *adapter); |
@@ -3777,7 +3799,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter) | |||
3777 | /* fire an unusual interrupt on the test handler */ | 3799 | /* fire an unusual interrupt on the test handler */ |
3778 | ew32(ICS, E1000_ICS_RXSEQ); | 3800 | ew32(ICS, E1000_ICS_RXSEQ); |
3779 | e1e_flush(); | 3801 | e1e_flush(); |
3780 | msleep(50); | 3802 | msleep(100); |
3781 | 3803 | ||
3782 | e1000_irq_disable(adapter); | 3804 | e1000_irq_disable(adapter); |
3783 | 3805 | ||
@@ -3963,6 +3985,10 @@ static int e1000_close(struct net_device *netdev) | |||
3963 | { | 3985 | { |
3964 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3986 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3965 | struct pci_dev *pdev = adapter->pdev; | 3987 | struct pci_dev *pdev = adapter->pdev; |
3988 | int count = E1000_CHECK_RESET_COUNT; | ||
3989 | |||
3990 | while (test_bit(__E1000_RESETTING, &adapter->state) && count--) | ||
3991 | usleep_range(10000, 20000); | ||
3966 | 3992 | ||
3967 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); | 3993 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); |
3968 | 3994 | ||
@@ -5467,6 +5493,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, | |||
5467 | netif_device_detach(netdev); | 5493 | netif_device_detach(netdev); |
5468 | 5494 | ||
5469 | if (netif_running(netdev)) { | 5495 | if (netif_running(netdev)) { |
5496 | int count = E1000_CHECK_RESET_COUNT; | ||
5497 | |||
5498 | while (test_bit(__E1000_RESETTING, &adapter->state) && count--) | ||
5499 | usleep_range(10000, 20000); | ||
5500 | |||
5470 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); | 5501 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); |
5471 | e1000e_down(adapter); | 5502 | e1000e_down(adapter); |
5472 | e1000_free_irq(adapter); | 5503 | e1000_free_irq(adapter); |
@@ -6172,7 +6203,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
6172 | adapter->hw.adapter = adapter; | 6203 | adapter->hw.adapter = adapter; |
6173 | adapter->hw.mac.type = ei->mac; | 6204 | adapter->hw.mac.type = ei->mac; |
6174 | adapter->max_hw_frame_size = ei->max_hw_frame_size; | 6205 | adapter->max_hw_frame_size = ei->max_hw_frame_size; |
6175 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; | 6206 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
6176 | 6207 | ||
6177 | mmio_start = pci_resource_start(pdev, 0); | 6208 | mmio_start = pci_resource_start(pdev, 0); |
6178 | mmio_len = pci_resource_len(pdev, 0); | 6209 | mmio_len = pci_resource_len(pdev, 0); |
diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c index ff796e42c3eb..16adeb9418a8 100644 --- a/drivers/net/ethernet/intel/e1000e/param.c +++ b/drivers/net/ethernet/intel/e1000e/param.c | |||
@@ -106,7 +106,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay"); | |||
106 | /* | 106 | /* |
107 | * Interrupt Throttle Rate (interrupts/sec) | 107 | * Interrupt Throttle Rate (interrupts/sec) |
108 | * | 108 | * |
109 | * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative) | 109 | * Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative |
110 | */ | 110 | */ |
111 | E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); | 111 | E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); |
112 | #define DEFAULT_ITR 3 | 112 | #define DEFAULT_ITR 3 |
@@ -344,53 +344,60 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
344 | 344 | ||
345 | if (num_InterruptThrottleRate > bd) { | 345 | if (num_InterruptThrottleRate > bd) { |
346 | adapter->itr = InterruptThrottleRate[bd]; | 346 | adapter->itr = InterruptThrottleRate[bd]; |
347 | switch (adapter->itr) { | 347 | |
348 | case 0: | 348 | /* |
349 | e_info("%s turned off\n", opt.name); | 349 | * Make sure a message is printed for non-special |
350 | break; | 350 | * values. And in case of an invalid option, display |
351 | case 1: | 351 | * warning, use default and got through itr/itr_setting |
352 | e_info("%s set to dynamic mode\n", opt.name); | 352 | * adjustment logic below |
353 | adapter->itr_setting = adapter->itr; | 353 | */ |
354 | adapter->itr = 20000; | 354 | if ((adapter->itr > 4) && |
355 | break; | 355 | e1000_validate_option(&adapter->itr, &opt, adapter)) |
356 | case 3: | 356 | adapter->itr = opt.def; |
357 | e_info("%s set to dynamic conservative mode\n", | ||
358 | opt.name); | ||
359 | adapter->itr_setting = adapter->itr; | ||
360 | adapter->itr = 20000; | ||
361 | break; | ||
362 | case 4: | ||
363 | e_info("%s set to simplified (2000-8000 ints) " | ||
364 | "mode\n", opt.name); | ||
365 | adapter->itr_setting = 4; | ||
366 | break; | ||
367 | default: | ||
368 | /* | ||
369 | * Save the setting, because the dynamic bits | ||
370 | * change itr. | ||
371 | */ | ||
372 | if (e1000_validate_option(&adapter->itr, &opt, | ||
373 | adapter) && | ||
374 | (adapter->itr == 3)) { | ||
375 | /* | ||
376 | * In case of invalid user value, | ||
377 | * default to conservative mode. | ||
378 | */ | ||
379 | adapter->itr_setting = adapter->itr; | ||
380 | adapter->itr = 20000; | ||
381 | } else { | ||
382 | /* | ||
383 | * Clear the lower two bits because | ||
384 | * they are used as control. | ||
385 | */ | ||
386 | adapter->itr_setting = | ||
387 | adapter->itr & ~3; | ||
388 | } | ||
389 | break; | ||
390 | } | ||
391 | } else { | 357 | } else { |
392 | adapter->itr_setting = opt.def; | 358 | /* |
359 | * If no option specified, use default value and go | ||
360 | * through the logic below to adjust itr/itr_setting | ||
361 | */ | ||
362 | adapter->itr = opt.def; | ||
363 | |||
364 | /* | ||
365 | * Make sure a message is printed for non-special | ||
366 | * default values | ||
367 | */ | ||
368 | if (adapter->itr > 40) | ||
369 | e_info("%s set to default %d\n", opt.name, | ||
370 | adapter->itr); | ||
371 | } | ||
372 | |||
373 | adapter->itr_setting = adapter->itr; | ||
374 | switch (adapter->itr) { | ||
375 | case 0: | ||
376 | e_info("%s turned off\n", opt.name); | ||
377 | break; | ||
378 | case 1: | ||
379 | e_info("%s set to dynamic mode\n", opt.name); | ||
380 | adapter->itr = 20000; | ||
381 | break; | ||
382 | case 3: | ||
383 | e_info("%s set to dynamic conservative mode\n", | ||
384 | opt.name); | ||
393 | adapter->itr = 20000; | 385 | adapter->itr = 20000; |
386 | break; | ||
387 | case 4: | ||
388 | e_info("%s set to simplified (2000-8000 ints) mode\n", | ||
389 | opt.name); | ||
390 | break; | ||
391 | default: | ||
392 | /* | ||
393 | * Save the setting, because the dynamic bits | ||
394 | * change itr. | ||
395 | * | ||
396 | * Clear the lower two bits because | ||
397 | * they are used as control. | ||
398 | */ | ||
399 | adapter->itr_setting &= ~3; | ||
400 | break; | ||
394 | } | 401 | } |
395 | } | 402 | } |
396 | { /* Interrupt Mode */ | 403 | { /* Interrupt Mode */ |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index c4902411d749..5ec31598ee47 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -238,6 +238,11 @@ MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver"); | |||
238 | MODULE_LICENSE("GPL"); | 238 | MODULE_LICENSE("GPL"); |
239 | MODULE_VERSION(DRV_VERSION); | 239 | MODULE_VERSION(DRV_VERSION); |
240 | 240 | ||
241 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) | ||
242 | static int debug = -1; | ||
243 | module_param(debug, int, 0); | ||
244 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | ||
245 | |||
241 | struct igb_reg_info { | 246 | struct igb_reg_info { |
242 | u32 ofs; | 247 | u32 ofs; |
243 | char *name; | 248 | char *name; |
@@ -1893,7 +1898,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1893 | adapter->pdev = pdev; | 1898 | adapter->pdev = pdev; |
1894 | hw = &adapter->hw; | 1899 | hw = &adapter->hw; |
1895 | hw->back = adapter; | 1900 | hw->back = adapter; |
1896 | adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE; | 1901 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
1897 | 1902 | ||
1898 | mmio_start = pci_resource_start(pdev, 0); | 1903 | mmio_start = pci_resource_start(pdev, 0); |
1899 | mmio_len = pci_resource_len(pdev, 0); | 1904 | mmio_len = pci_resource_len(pdev, 0); |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 217c143686d2..8ec74b07f940 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -55,6 +55,11 @@ static const char igbvf_driver_string[] = | |||
55 | static const char igbvf_copyright[] = | 55 | static const char igbvf_copyright[] = |
56 | "Copyright (c) 2009 - 2012 Intel Corporation."; | 56 | "Copyright (c) 2009 - 2012 Intel Corporation."; |
57 | 57 | ||
58 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) | ||
59 | static int debug = -1; | ||
60 | module_param(debug, int, 0); | ||
61 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | ||
62 | |||
58 | static int igbvf_poll(struct napi_struct *napi, int budget); | 63 | static int igbvf_poll(struct napi_struct *napi, int budget); |
59 | static void igbvf_reset(struct igbvf_adapter *); | 64 | static void igbvf_reset(struct igbvf_adapter *); |
60 | static void igbvf_set_interrupt_capability(struct igbvf_adapter *); | 65 | static void igbvf_set_interrupt_capability(struct igbvf_adapter *); |
@@ -2649,7 +2654,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, | |||
2649 | adapter->flags = ei->flags; | 2654 | adapter->flags = ei->flags; |
2650 | adapter->hw.back = adapter; | 2655 | adapter->hw.back = adapter; |
2651 | adapter->hw.mac.type = ei->mac; | 2656 | adapter->hw.mac.type = ei->mac; |
2652 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; | 2657 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
2653 | 2658 | ||
2654 | /* PCI config space info */ | 2659 | /* PCI config space info */ |
2655 | 2660 | ||
@@ -2726,14 +2731,14 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, | |||
2726 | netdev->addr_len); | 2731 | netdev->addr_len); |
2727 | } | 2732 | } |
2728 | 2733 | ||
2729 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 2734 | if (!is_valid_ether_addr(netdev->dev_addr)) { |
2730 | dev_err(&pdev->dev, "Invalid MAC Address: %pM\n", | 2735 | dev_err(&pdev->dev, "Invalid MAC Address: %pM\n", |
2731 | netdev->dev_addr); | 2736 | netdev->dev_addr); |
2732 | err = -EIO; | 2737 | err = -EIO; |
2733 | goto err_hw_init; | 2738 | goto err_hw_init; |
2734 | } | 2739 | } |
2735 | 2740 | ||
2736 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); | 2741 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); |
2737 | 2742 | ||
2738 | setup_timer(&adapter->watchdog_timer, &igbvf_watchdog, | 2743 | setup_timer(&adapter->watchdog_timer, &igbvf_watchdog, |
2739 | (unsigned long) adapter); | 2744 | (unsigned long) adapter); |
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index 82aaa792cbf3..5fce363d810a 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c | |||
@@ -134,8 +134,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/10GbE Network Driver"); | |||
134 | MODULE_LICENSE("GPL"); | 134 | MODULE_LICENSE("GPL"); |
135 | MODULE_VERSION(DRV_VERSION); | 135 | MODULE_VERSION(DRV_VERSION); |
136 | 136 | ||
137 | #define DEFAULT_DEBUG_LEVEL_SHIFT 3 | 137 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) |
138 | static int debug = DEFAULT_DEBUG_LEVEL_SHIFT; | 138 | static int debug = -1; |
139 | module_param(debug, int, 0); | 139 | module_param(debug, int, 0); |
140 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | 140 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); |
141 | 141 | ||
@@ -442,7 +442,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
442 | adapter->netdev = netdev; | 442 | adapter->netdev = netdev; |
443 | adapter->pdev = pdev; | 443 | adapter->pdev = pdev; |
444 | adapter->hw.back = adapter; | 444 | adapter->hw.back = adapter; |
445 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT); | 445 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
446 | 446 | ||
447 | adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0); | 447 | adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0); |
448 | if (!adapter->hw.hw_addr) { | 448 | if (!adapter->hw.hw_addr) { |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 80e26ff30ebf..74e192107f9a 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -544,7 +544,7 @@ struct ixgbe_fdir_filter { | |||
544 | u16 action; | 544 | u16 action; |
545 | }; | 545 | }; |
546 | 546 | ||
547 | enum ixbge_state_t { | 547 | enum ixgbe_state_t { |
548 | __IXGBE_TESTING, | 548 | __IXGBE_TESTING, |
549 | __IXGBE_RESETTING, | 549 | __IXGBE_RESETTING, |
550 | __IXGBE_DOWN, | 550 | __IXGBE_DOWN, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index dde65f951400..652e4b09546d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -44,62 +44,94 @@ | |||
44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ | 44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ |
45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ | 45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ |
46 | 46 | ||
47 | int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg, | 47 | int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg, |
48 | struct ixgbe_dcb_config *dst_dcb_cfg, int tc_max) | 48 | struct ixgbe_dcb_config *dcfg, int tc_max) |
49 | { | 49 | { |
50 | struct tc_configuration *src_tc_cfg = NULL; | 50 | struct tc_configuration *src = NULL; |
51 | struct tc_configuration *dst_tc_cfg = NULL; | 51 | struct tc_configuration *dst = NULL; |
52 | int i; | 52 | int i, j; |
53 | int tx = DCB_TX_CONFIG; | ||
54 | int rx = DCB_RX_CONFIG; | ||
55 | int changes = 0; | ||
53 | 56 | ||
54 | if (!src_dcb_cfg || !dst_dcb_cfg) | 57 | if (!scfg || !dcfg) |
55 | return -EINVAL; | 58 | return changes; |
56 | 59 | ||
57 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { | 60 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { |
58 | src_tc_cfg = &src_dcb_cfg->tc_config[i - DCB_PG_ATTR_TC_0]; | 61 | src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; |
59 | dst_tc_cfg = &dst_dcb_cfg->tc_config[i - DCB_PG_ATTR_TC_0]; | 62 | dst = &dcfg->tc_config[i - DCB_PG_ATTR_TC_0]; |
60 | 63 | ||
61 | dst_tc_cfg->path[DCB_TX_CONFIG].prio_type = | 64 | if (dst->path[tx].prio_type != src->path[tx].prio_type) { |
62 | src_tc_cfg->path[DCB_TX_CONFIG].prio_type; | 65 | dst->path[tx].prio_type = src->path[tx].prio_type; |
66 | changes |= BIT_PG_TX; | ||
67 | } | ||
63 | 68 | ||
64 | dst_tc_cfg->path[DCB_TX_CONFIG].bwg_id = | 69 | if (dst->path[tx].bwg_id != src->path[tx].bwg_id) { |
65 | src_tc_cfg->path[DCB_TX_CONFIG].bwg_id; | 70 | dst->path[tx].bwg_id = src->path[tx].bwg_id; |
71 | changes |= BIT_PG_TX; | ||
72 | } | ||
66 | 73 | ||
67 | dst_tc_cfg->path[DCB_TX_CONFIG].bwg_percent = | 74 | if (dst->path[tx].bwg_percent != src->path[tx].bwg_percent) { |
68 | src_tc_cfg->path[DCB_TX_CONFIG].bwg_percent; | 75 | dst->path[tx].bwg_percent = src->path[tx].bwg_percent; |
76 | changes |= BIT_PG_TX; | ||
77 | } | ||
69 | 78 | ||
70 | dst_tc_cfg->path[DCB_TX_CONFIG].up_to_tc_bitmap = | 79 | if (dst->path[tx].up_to_tc_bitmap != |
71 | src_tc_cfg->path[DCB_TX_CONFIG].up_to_tc_bitmap; | 80 | src->path[tx].up_to_tc_bitmap) { |
81 | dst->path[tx].up_to_tc_bitmap = | ||
82 | src->path[tx].up_to_tc_bitmap; | ||
83 | changes |= (BIT_PG_TX | BIT_PFC | BIT_APP_UPCHG); | ||
84 | } | ||
72 | 85 | ||
73 | dst_tc_cfg->path[DCB_RX_CONFIG].prio_type = | 86 | if (dst->path[rx].prio_type != src->path[rx].prio_type) { |
74 | src_tc_cfg->path[DCB_RX_CONFIG].prio_type; | 87 | dst->path[rx].prio_type = src->path[rx].prio_type; |
88 | changes |= BIT_PG_RX; | ||
89 | } | ||
75 | 90 | ||
76 | dst_tc_cfg->path[DCB_RX_CONFIG].bwg_id = | 91 | if (dst->path[rx].bwg_id != src->path[rx].bwg_id) { |
77 | src_tc_cfg->path[DCB_RX_CONFIG].bwg_id; | 92 | dst->path[rx].bwg_id = src->path[rx].bwg_id; |
93 | changes |= BIT_PG_RX; | ||
94 | } | ||
78 | 95 | ||
79 | dst_tc_cfg->path[DCB_RX_CONFIG].bwg_percent = | 96 | if (dst->path[rx].bwg_percent != src->path[rx].bwg_percent) { |
80 | src_tc_cfg->path[DCB_RX_CONFIG].bwg_percent; | 97 | dst->path[rx].bwg_percent = src->path[rx].bwg_percent; |
98 | changes |= BIT_PG_RX; | ||
99 | } | ||
81 | 100 | ||
82 | dst_tc_cfg->path[DCB_RX_CONFIG].up_to_tc_bitmap = | 101 | if (dst->path[rx].up_to_tc_bitmap != |
83 | src_tc_cfg->path[DCB_RX_CONFIG].up_to_tc_bitmap; | 102 | src->path[rx].up_to_tc_bitmap) { |
103 | dst->path[rx].up_to_tc_bitmap = | ||
104 | src->path[rx].up_to_tc_bitmap; | ||
105 | changes |= (BIT_PG_RX | BIT_PFC | BIT_APP_UPCHG); | ||
106 | } | ||
84 | } | 107 | } |
85 | 108 | ||
86 | for (i = DCB_PG_ATTR_BW_ID_0; i < DCB_PG_ATTR_BW_ID_MAX; i++) { | 109 | for (i = DCB_PG_ATTR_BW_ID_0; i < DCB_PG_ATTR_BW_ID_MAX; i++) { |
87 | dst_dcb_cfg->bw_percentage[DCB_TX_CONFIG] | 110 | j = i - DCB_PG_ATTR_BW_ID_0; |
88 | [i-DCB_PG_ATTR_BW_ID_0] = src_dcb_cfg->bw_percentage | 111 | if (dcfg->bw_percentage[tx][j] != scfg->bw_percentage[tx][j]) { |
89 | [DCB_TX_CONFIG][i-DCB_PG_ATTR_BW_ID_0]; | 112 | dcfg->bw_percentage[tx][j] = scfg->bw_percentage[tx][j]; |
90 | dst_dcb_cfg->bw_percentage[DCB_RX_CONFIG] | 113 | changes |= BIT_PG_TX; |
91 | [i-DCB_PG_ATTR_BW_ID_0] = src_dcb_cfg->bw_percentage | 114 | } |
92 | [DCB_RX_CONFIG][i-DCB_PG_ATTR_BW_ID_0]; | 115 | if (dcfg->bw_percentage[rx][j] != scfg->bw_percentage[rx][j]) { |
116 | dcfg->bw_percentage[rx][j] = scfg->bw_percentage[rx][j]; | ||
117 | changes |= BIT_PG_RX; | ||
118 | } | ||
93 | } | 119 | } |
94 | 120 | ||
95 | for (i = DCB_PFC_UP_ATTR_0; i < DCB_PFC_UP_ATTR_MAX; i++) { | 121 | for (i = DCB_PFC_UP_ATTR_0; i < DCB_PFC_UP_ATTR_MAX; i++) { |
96 | dst_dcb_cfg->tc_config[i - DCB_PFC_UP_ATTR_0].dcb_pfc = | 122 | j = i - DCB_PFC_UP_ATTR_0; |
97 | src_dcb_cfg->tc_config[i - DCB_PFC_UP_ATTR_0].dcb_pfc; | 123 | if (dcfg->tc_config[j].dcb_pfc != scfg->tc_config[j].dcb_pfc) { |
124 | dcfg->tc_config[j].dcb_pfc = scfg->tc_config[j].dcb_pfc; | ||
125 | changes |= BIT_PFC; | ||
126 | } | ||
98 | } | 127 | } |
99 | 128 | ||
100 | dst_dcb_cfg->pfc_mode_enable = src_dcb_cfg->pfc_mode_enable; | 129 | if (dcfg->pfc_mode_enable != scfg->pfc_mode_enable) { |
130 | dcfg->pfc_mode_enable = scfg->pfc_mode_enable; | ||
131 | changes |= BIT_PFC; | ||
132 | } | ||
101 | 133 | ||
102 | return 0; | 134 | return changes; |
103 | } | 135 | } |
104 | 136 | ||
105 | static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) | 137 | static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) |
@@ -179,20 +211,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc, | |||
179 | if (up_map != DCB_ATTR_VALUE_UNDEFINED) | 211 | if (up_map != DCB_ATTR_VALUE_UNDEFINED) |
180 | adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap = | 212 | adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap = |
181 | up_map; | 213 | up_map; |
182 | |||
183 | if ((adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type != | ||
184 | adapter->dcb_cfg.tc_config[tc].path[0].prio_type) || | ||
185 | (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_id != | ||
186 | adapter->dcb_cfg.tc_config[tc].path[0].bwg_id) || | ||
187 | (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_percent != | ||
188 | adapter->dcb_cfg.tc_config[tc].path[0].bwg_percent) || | ||
189 | (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap != | ||
190 | adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)) | ||
191 | adapter->dcb_set_bitmap |= BIT_PG_TX; | ||
192 | |||
193 | if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap != | ||
194 | adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap) | ||
195 | adapter->dcb_set_bitmap |= BIT_PFC | BIT_APP_UPCHG; | ||
196 | } | 214 | } |
197 | 215 | ||
198 | static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, | 216 | static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, |
@@ -201,10 +219,6 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, | |||
201 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 219 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
202 | 220 | ||
203 | adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct; | 221 | adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct; |
204 | |||
205 | if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] != | ||
206 | adapter->dcb_cfg.bw_percentage[0][bwg_id]) | ||
207 | adapter->dcb_set_bitmap |= BIT_PG_TX; | ||
208 | } | 222 | } |
209 | 223 | ||
210 | static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc, | 224 | static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc, |
@@ -223,20 +237,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc, | |||
223 | if (up_map != DCB_ATTR_VALUE_UNDEFINED) | 237 | if (up_map != DCB_ATTR_VALUE_UNDEFINED) |
224 | adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap = | 238 | adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap = |
225 | up_map; | 239 | up_map; |
226 | |||
227 | if ((adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type != | ||
228 | adapter->dcb_cfg.tc_config[tc].path[1].prio_type) || | ||
229 | (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_id != | ||
230 | adapter->dcb_cfg.tc_config[tc].path[1].bwg_id) || | ||
231 | (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_percent != | ||
232 | adapter->dcb_cfg.tc_config[tc].path[1].bwg_percent) || | ||
233 | (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap != | ||
234 | adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap)) | ||
235 | adapter->dcb_set_bitmap |= BIT_PG_RX; | ||
236 | |||
237 | if (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap != | ||
238 | adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap) | ||
239 | adapter->dcb_set_bitmap |= BIT_PFC; | ||
240 | } | 240 | } |
241 | 241 | ||
242 | static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id, | 242 | static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id, |
@@ -245,10 +245,6 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id, | |||
245 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 245 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
246 | 246 | ||
247 | adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct; | 247 | adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct; |
248 | |||
249 | if (adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] != | ||
250 | adapter->dcb_cfg.bw_percentage[1][bwg_id]) | ||
251 | adapter->dcb_set_bitmap |= BIT_PG_RX; | ||
252 | } | 248 | } |
253 | 249 | ||
254 | static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc, | 250 | static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc, |
@@ -298,10 +294,8 @@ static void ixgbe_dcbnl_set_pfc_cfg(struct net_device *netdev, int priority, | |||
298 | 294 | ||
299 | adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc = setting; | 295 | adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc = setting; |
300 | if (adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc != | 296 | if (adapter->temp_dcb_cfg.tc_config[priority].dcb_pfc != |
301 | adapter->dcb_cfg.tc_config[priority].dcb_pfc) { | 297 | adapter->dcb_cfg.tc_config[priority].dcb_pfc) |
302 | adapter->dcb_set_bitmap |= BIT_PFC; | ||
303 | adapter->temp_dcb_cfg.pfc_mode_enable = true; | 298 | adapter->temp_dcb_cfg.pfc_mode_enable = true; |
304 | } | ||
305 | } | 299 | } |
306 | 300 | ||
307 | static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority, | 301 | static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority, |
@@ -336,7 +330,8 @@ static void ixgbe_dcbnl_devreset(struct net_device *dev) | |||
336 | static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | 330 | static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) |
337 | { | 331 | { |
338 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 332 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
339 | int ret, i; | 333 | int ret = DCB_NO_HW_CHG; |
334 | int i; | ||
340 | #ifdef IXGBE_FCOE | 335 | #ifdef IXGBE_FCOE |
341 | struct dcb_app app = { | 336 | struct dcb_app app = { |
342 | .selector = DCB_APP_IDTYPE_ETHTYPE, | 337 | .selector = DCB_APP_IDTYPE_ETHTYPE, |
@@ -355,12 +350,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
355 | 350 | ||
356 | /* Fail command if not in CEE mode */ | 351 | /* Fail command if not in CEE mode */ |
357 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) | 352 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) |
358 | return 1; | 353 | return ret; |
359 | 354 | ||
360 | ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, | 355 | adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, |
361 | MAX_TRAFFIC_CLASS); | 356 | &adapter->dcb_cfg, |
362 | if (ret) | 357 | MAX_TRAFFIC_CLASS); |
363 | return DCB_NO_HW_CHG; | 358 | if (!adapter->dcb_set_bitmap) |
359 | return ret; | ||
364 | 360 | ||
365 | if (adapter->dcb_cfg.pfc_mode_enable) { | 361 | if (adapter->dcb_cfg.pfc_mode_enable) { |
366 | switch (adapter->hw.mac.type) { | 362 | switch (adapter->hw.mac.type) { |
@@ -420,6 +416,8 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
420 | 416 | ||
421 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) | 417 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) |
422 | netdev_set_prio_tc_map(netdev, i, prio_tc[i]); | 418 | netdev_set_prio_tc_map(netdev, i, prio_tc[i]); |
419 | |||
420 | ret = DCB_HW_CHG_RST; | ||
423 | } | 421 | } |
424 | 422 | ||
425 | if (adapter->dcb_set_bitmap & BIT_PFC) { | 423 | if (adapter->dcb_set_bitmap & BIT_PFC) { |
@@ -430,7 +428,8 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
430 | DCB_TX_CONFIG, prio_tc); | 428 | DCB_TX_CONFIG, prio_tc); |
431 | ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en); | 429 | ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en); |
432 | ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc_en, prio_tc); | 430 | ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc_en, prio_tc); |
433 | ret = DCB_HW_CHG; | 431 | if (ret != DCB_HW_CHG_RST) |
432 | ret = DCB_HW_CHG; | ||
434 | } | 433 | } |
435 | 434 | ||
436 | if (adapter->dcb_cfg.pfc_mode_enable) | 435 | if (adapter->dcb_cfg.pfc_mode_enable) |
@@ -531,9 +530,6 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state) | |||
531 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 530 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
532 | 531 | ||
533 | adapter->temp_dcb_cfg.pfc_mode_enable = state; | 532 | adapter->temp_dcb_cfg.pfc_mode_enable = state; |
534 | if (adapter->temp_dcb_cfg.pfc_mode_enable != | ||
535 | adapter->dcb_cfg.pfc_mode_enable) | ||
536 | adapter->dcb_set_bitmap |= BIT_PFC; | ||
537 | } | 533 | } |
538 | 534 | ||
539 | /** | 535 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index 77ea4b716535..bc07933d67da 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | |||
@@ -437,6 +437,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, | |||
437 | */ | 437 | */ |
438 | if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && | 438 | if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && |
439 | (fctl & FC_FC_END_SEQ)) { | 439 | (fctl & FC_FC_END_SEQ)) { |
440 | skb_linearize(skb); | ||
440 | crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); | 441 | crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); |
441 | crc->fcoe_eof = FC_EOF_T; | 442 | crc->fcoe_eof = FC_EOF_T; |
442 | } | 443 | } |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c index 027d7a75be39..ed1b47dc0834 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | |||
@@ -622,6 +622,16 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, int v_idx, | |||
622 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | 622 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) |
623 | set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); | 623 | set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); |
624 | 624 | ||
625 | #ifdef IXGBE_FCOE | ||
626 | if (adapter->netdev->features & NETIF_F_FCOE_MTU) { | ||
627 | struct ixgbe_ring_feature *f; | ||
628 | f = &adapter->ring_feature[RING_F_FCOE]; | ||
629 | if ((rxr_idx >= f->mask) && | ||
630 | (rxr_idx < f->mask + f->indices)) | ||
631 | set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); | ||
632 | } | ||
633 | |||
634 | #endif /* IXGBE_FCOE */ | ||
625 | /* apply Rx specific ring traits */ | 635 | /* apply Rx specific ring traits */ |
626 | ring->count = adapter->rx_ring_count; | 636 | ring->count = adapter->rx_ring_count; |
627 | ring->queue_index = rxr_idx; | 637 | ring->queue_index = rxr_idx; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 398fc223cab9..88f6b2e9b72d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -63,8 +63,8 @@ static char ixgbe_default_device_descr[] = | |||
63 | "Intel(R) 10 Gigabit Network Connection"; | 63 | "Intel(R) 10 Gigabit Network Connection"; |
64 | #endif | 64 | #endif |
65 | #define MAJ 3 | 65 | #define MAJ 3 |
66 | #define MIN 6 | 66 | #define MIN 8 |
67 | #define BUILD 7 | 67 | #define BUILD 21 |
68 | #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ | 68 | #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ |
69 | __stringify(BUILD) "-k" | 69 | __stringify(BUILD) "-k" |
70 | const char ixgbe_driver_version[] = DRV_VERSION; | 70 | const char ixgbe_driver_version[] = DRV_VERSION; |
@@ -141,13 +141,16 @@ module_param(allow_unsupported_sfp, uint, 0); | |||
141 | MODULE_PARM_DESC(allow_unsupported_sfp, | 141 | MODULE_PARM_DESC(allow_unsupported_sfp, |
142 | "Allow unsupported and untested SFP+ modules on 82599-based adapters"); | 142 | "Allow unsupported and untested SFP+ modules on 82599-based adapters"); |
143 | 143 | ||
144 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) | ||
145 | static int debug = -1; | ||
146 | module_param(debug, int, 0); | ||
147 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | ||
148 | |||
144 | MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); | 149 | MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); |
145 | MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver"); | 150 | MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver"); |
146 | MODULE_LICENSE("GPL"); | 151 | MODULE_LICENSE("GPL"); |
147 | MODULE_VERSION(DRV_VERSION); | 152 | MODULE_VERSION(DRV_VERSION); |
148 | 153 | ||
149 | #define DEFAULT_DEBUG_LEVEL_SHIFT 3 | ||
150 | |||
151 | static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter) | 154 | static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter) |
152 | { | 155 | { |
153 | if (!test_bit(__IXGBE_DOWN, &adapter->state) && | 156 | if (!test_bit(__IXGBE_DOWN, &adapter->state) && |
@@ -3151,14 +3154,6 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter) | |||
3151 | set_ring_rsc_enabled(rx_ring); | 3154 | set_ring_rsc_enabled(rx_ring); |
3152 | else | 3155 | else |
3153 | clear_ring_rsc_enabled(rx_ring); | 3156 | clear_ring_rsc_enabled(rx_ring); |
3154 | #ifdef IXGBE_FCOE | ||
3155 | if (netdev->features & NETIF_F_FCOE_MTU) { | ||
3156 | struct ixgbe_ring_feature *f; | ||
3157 | f = &adapter->ring_feature[RING_F_FCOE]; | ||
3158 | if ((i >= f->mask) && (i < f->mask + f->indices)) | ||
3159 | set_bit(__IXGBE_RX_FCOE_BUFSZ, &rx_ring->state); | ||
3160 | } | ||
3161 | #endif /* IXGBE_FCOE */ | ||
3162 | } | 3157 | } |
3163 | } | 3158 | } |
3164 | 3159 | ||
@@ -4833,7 +4828,9 @@ static int ixgbe_resume(struct pci_dev *pdev) | |||
4833 | 4828 | ||
4834 | pci_wake_from_d3(pdev, false); | 4829 | pci_wake_from_d3(pdev, false); |
4835 | 4830 | ||
4831 | rtnl_lock(); | ||
4836 | err = ixgbe_init_interrupt_scheme(adapter); | 4832 | err = ixgbe_init_interrupt_scheme(adapter); |
4833 | rtnl_unlock(); | ||
4837 | if (err) { | 4834 | if (err) { |
4838 | e_dev_err("Cannot initialize interrupts for device\n"); | 4835 | e_dev_err("Cannot initialize interrupts for device\n"); |
4839 | return err; | 4836 | return err; |
@@ -4876,10 +4873,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4876 | } | 4873 | } |
4877 | 4874 | ||
4878 | ixgbe_clear_interrupt_scheme(adapter); | 4875 | ixgbe_clear_interrupt_scheme(adapter); |
4879 | #ifdef CONFIG_DCB | ||
4880 | kfree(adapter->ixgbe_ieee_pfc); | ||
4881 | kfree(adapter->ixgbe_ieee_ets); | ||
4882 | #endif | ||
4883 | 4876 | ||
4884 | #ifdef CONFIG_PM | 4877 | #ifdef CONFIG_PM |
4885 | retval = pci_save_state(pdev); | 4878 | retval = pci_save_state(pdev); |
@@ -4890,6 +4883,16 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4890 | if (wufc) { | 4883 | if (wufc) { |
4891 | ixgbe_set_rx_mode(netdev); | 4884 | ixgbe_set_rx_mode(netdev); |
4892 | 4885 | ||
4886 | /* | ||
4887 | * enable the optics for both mult-speed fiber and | ||
4888 | * 82599 SFP+ fiber as we can WoL. | ||
4889 | */ | ||
4890 | if (hw->mac.ops.enable_tx_laser && | ||
4891 | (hw->phy.multispeed_fiber || | ||
4892 | (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber && | ||
4893 | hw->mac.type == ixgbe_mac_82599EB))) | ||
4894 | hw->mac.ops.enable_tx_laser(hw); | ||
4895 | |||
4893 | /* turn on all-multi mode if wake on multicast is enabled */ | 4896 | /* turn on all-multi mode if wake on multicast is enabled */ |
4894 | if (wufc & IXGBE_WUFC_MC) { | 4897 | if (wufc & IXGBE_WUFC_MC) { |
4895 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 4898 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
@@ -6834,7 +6837,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6834 | adapter->pdev = pdev; | 6837 | adapter->pdev = pdev; |
6835 | hw = &adapter->hw; | 6838 | hw = &adapter->hw; |
6836 | hw->back = adapter; | 6839 | hw->back = adapter; |
6837 | adapter->msg_enable = (1 << DEFAULT_DEBUG_LEVEL_SHIFT) - 1; | 6840 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
6838 | 6841 | ||
6839 | hw->hw_addr = ioremap(pci_resource_start(pdev, 0), | 6842 | hw->hw_addr = ioremap(pci_resource_start(pdev, 0), |
6840 | pci_resource_len(pdev, 0)); | 6843 | pci_resource_len(pdev, 0)); |
@@ -7217,6 +7220,11 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) | |||
7217 | 7220 | ||
7218 | ixgbe_release_hw_control(adapter); | 7221 | ixgbe_release_hw_control(adapter); |
7219 | 7222 | ||
7223 | #ifdef CONFIG_DCB | ||
7224 | kfree(adapter->ixgbe_ieee_pfc); | ||
7225 | kfree(adapter->ixgbe_ieee_ets); | ||
7226 | |||
7227 | #endif | ||
7220 | iounmap(adapter->hw.hw_addr); | 7228 | iounmap(adapter->hw.hw_addr); |
7221 | pci_release_selected_regions(pdev, pci_select_bars(pdev, | 7229 | pci_release_selected_regions(pdev, pci_select_bars(pdev, |
7222 | IORESOURCE_MEM)); | 7230 | IORESOURCE_MEM)); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 581c65976bb4..307611ae831d 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -91,7 +91,10 @@ MODULE_DESCRIPTION("Intel(R) 82599 Virtual Function Driver"); | |||
91 | MODULE_LICENSE("GPL"); | 91 | MODULE_LICENSE("GPL"); |
92 | MODULE_VERSION(DRV_VERSION); | 92 | MODULE_VERSION(DRV_VERSION); |
93 | 93 | ||
94 | #define DEFAULT_DEBUG_LEVEL_SHIFT 3 | 94 | #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) |
95 | static int debug = -1; | ||
96 | module_param(debug, int, 0); | ||
97 | MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | ||
95 | 98 | ||
96 | /* forward decls */ | 99 | /* forward decls */ |
97 | static void ixgbevf_set_itr_msix(struct ixgbevf_q_vector *q_vector); | 100 | static void ixgbevf_set_itr_msix(struct ixgbevf_q_vector *q_vector); |
@@ -3367,7 +3370,7 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev, | |||
3367 | adapter->pdev = pdev; | 3370 | adapter->pdev = pdev; |
3368 | hw = &adapter->hw; | 3371 | hw = &adapter->hw; |
3369 | hw->back = adapter; | 3372 | hw->back = adapter; |
3370 | adapter->msg_enable = (1 << DEFAULT_DEBUG_LEVEL_SHIFT) - 1; | 3373 | adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
3371 | 3374 | ||
3372 | /* | 3375 | /* |
3373 | * call save state here in standalone driver because it relies on | 3376 | * call save state here in standalone driver because it relies on |
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 423a1a2a702e..487a6c8bd4ec 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -1767,13 +1767,14 @@ static int sky2_open(struct net_device *dev) | |||
1767 | 1767 | ||
1768 | sky2_hw_up(sky2); | 1768 | sky2_hw_up(sky2); |
1769 | 1769 | ||
1770 | /* Enable interrupts from phy/mac for port */ | ||
1771 | imask = sky2_read32(hw, B0_IMSK); | ||
1772 | |||
1770 | if (hw->chip_id == CHIP_ID_YUKON_OPT || | 1773 | if (hw->chip_id == CHIP_ID_YUKON_OPT || |
1771 | hw->chip_id == CHIP_ID_YUKON_PRM || | 1774 | hw->chip_id == CHIP_ID_YUKON_PRM || |
1772 | hw->chip_id == CHIP_ID_YUKON_OP_2) | 1775 | hw->chip_id == CHIP_ID_YUKON_OP_2) |
1773 | imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */ | 1776 | imask |= Y2_IS_PHY_QLNK; /* enable PHY Quick Link */ |
1774 | 1777 | ||
1775 | /* Enable interrupts from phy/mac for port */ | ||
1776 | imask = sky2_read32(hw, B0_IMSK); | ||
1777 | imask |= portirq_msk[port]; | 1778 | imask |= portirq_msk[port]; |
1778 | sky2_write32(hw, B0_IMSK, imask); | 1779 | sky2_write32(hw, B0_IMSK, imask); |
1779 | sky2_read32(hw, B0_IMSK); | 1780 | sky2_read32(hw, B0_IMSK); |
@@ -2468,6 +2469,17 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
2468 | return err; | 2469 | return err; |
2469 | } | 2470 | } |
2470 | 2471 | ||
2472 | static inline bool needs_copy(const struct rx_ring_info *re, | ||
2473 | unsigned length) | ||
2474 | { | ||
2475 | #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
2476 | /* Some architectures need the IP header to be aligned */ | ||
2477 | if (!IS_ALIGNED(re->data_addr + ETH_HLEN, sizeof(u32))) | ||
2478 | return true; | ||
2479 | #endif | ||
2480 | return length < copybreak; | ||
2481 | } | ||
2482 | |||
2471 | /* For small just reuse existing skb for next receive */ | 2483 | /* For small just reuse existing skb for next receive */ |
2472 | static struct sk_buff *receive_copy(struct sky2_port *sky2, | 2484 | static struct sk_buff *receive_copy(struct sky2_port *sky2, |
2473 | const struct rx_ring_info *re, | 2485 | const struct rx_ring_info *re, |
@@ -2482,8 +2494,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2, | |||
2482 | skb_copy_from_linear_data(re->skb, skb->data, length); | 2494 | skb_copy_from_linear_data(re->skb, skb->data, length); |
2483 | skb->ip_summed = re->skb->ip_summed; | 2495 | skb->ip_summed = re->skb->ip_summed; |
2484 | skb->csum = re->skb->csum; | 2496 | skb->csum = re->skb->csum; |
2497 | skb->rxhash = re->skb->rxhash; | ||
2498 | skb->vlan_tci = re->skb->vlan_tci; | ||
2499 | |||
2485 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, | 2500 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, |
2486 | length, PCI_DMA_FROMDEVICE); | 2501 | length, PCI_DMA_FROMDEVICE); |
2502 | re->skb->vlan_tci = 0; | ||
2503 | re->skb->rxhash = 0; | ||
2487 | re->skb->ip_summed = CHECKSUM_NONE; | 2504 | re->skb->ip_summed = CHECKSUM_NONE; |
2488 | skb_put(skb, length); | 2505 | skb_put(skb, length); |
2489 | } | 2506 | } |
@@ -2568,9 +2585,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2568 | struct sk_buff *skb = NULL; | 2585 | struct sk_buff *skb = NULL; |
2569 | u16 count = (status & GMR_FS_LEN) >> 16; | 2586 | u16 count = (status & GMR_FS_LEN) >> 16; |
2570 | 2587 | ||
2571 | if (status & GMR_FS_VLAN) | ||
2572 | count -= VLAN_HLEN; /* Account for vlan tag */ | ||
2573 | |||
2574 | netif_printk(sky2, rx_status, KERN_DEBUG, dev, | 2588 | netif_printk(sky2, rx_status, KERN_DEBUG, dev, |
2575 | "rx slot %u status 0x%x len %d\n", | 2589 | "rx slot %u status 0x%x len %d\n", |
2576 | sky2->rx_next, status, length); | 2590 | sky2->rx_next, status, length); |
@@ -2578,6 +2592,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2578 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; | 2592 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; |
2579 | prefetch(sky2->rx_ring + sky2->rx_next); | 2593 | prefetch(sky2->rx_ring + sky2->rx_next); |
2580 | 2594 | ||
2595 | if (vlan_tx_tag_present(re->skb)) | ||
2596 | count -= VLAN_HLEN; /* Account for vlan tag */ | ||
2597 | |||
2581 | /* This chip has hardware problems that generates bogus status. | 2598 | /* This chip has hardware problems that generates bogus status. |
2582 | * So do only marginal checking and expect higher level protocols | 2599 | * So do only marginal checking and expect higher level protocols |
2583 | * to handle crap frames. | 2600 | * to handle crap frames. |
@@ -2598,7 +2615,7 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2598 | goto error; | 2615 | goto error; |
2599 | 2616 | ||
2600 | okay: | 2617 | okay: |
2601 | if (length < copybreak) | 2618 | if (needs_copy(re, length)) |
2602 | skb = receive_copy(sky2, re, length); | 2619 | skb = receive_copy(sky2, re, length); |
2603 | else | 2620 | else |
2604 | skb = receive_new(sky2, re, length); | 2621 | skb = receive_new(sky2, re, length); |
@@ -2635,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) | |||
2635 | } | 2652 | } |
2636 | 2653 | ||
2637 | static inline void sky2_skb_rx(const struct sky2_port *sky2, | 2654 | static inline void sky2_skb_rx(const struct sky2_port *sky2, |
2638 | u32 status, struct sk_buff *skb) | 2655 | struct sk_buff *skb) |
2639 | { | 2656 | { |
2640 | if (status & GMR_FS_VLAN) | ||
2641 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag)); | ||
2642 | |||
2643 | if (skb->ip_summed == CHECKSUM_NONE) | 2657 | if (skb->ip_summed == CHECKSUM_NONE) |
2644 | netif_receive_skb(skb); | 2658 | netif_receive_skb(skb); |
2645 | else | 2659 | else |
@@ -2693,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status) | |||
2693 | } | 2707 | } |
2694 | } | 2708 | } |
2695 | 2709 | ||
2710 | static void sky2_rx_tag(struct sky2_port *sky2, u16 length) | ||
2711 | { | ||
2712 | struct sk_buff *skb; | ||
2713 | |||
2714 | skb = sky2->rx_ring[sky2->rx_next].skb; | ||
2715 | __vlan_hwaccel_put_tag(skb, be16_to_cpu(length)); | ||
2716 | } | ||
2717 | |||
2696 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) | 2718 | static void sky2_rx_hash(struct sky2_port *sky2, u32 status) |
2697 | { | 2719 | { |
2698 | struct sk_buff *skb; | 2720 | struct sk_buff *skb; |
@@ -2751,8 +2773,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2751 | } | 2773 | } |
2752 | 2774 | ||
2753 | skb->protocol = eth_type_trans(skb, dev); | 2775 | skb->protocol = eth_type_trans(skb, dev); |
2754 | 2776 | sky2_skb_rx(sky2, skb); | |
2755 | sky2_skb_rx(sky2, status, skb); | ||
2756 | 2777 | ||
2757 | /* Stop after net poll weight */ | 2778 | /* Stop after net poll weight */ |
2758 | if (++work_done >= to_do) | 2779 | if (++work_done >= to_do) |
@@ -2760,11 +2781,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2760 | break; | 2781 | break; |
2761 | 2782 | ||
2762 | case OP_RXVLAN: | 2783 | case OP_RXVLAN: |
2763 | sky2->rx_tag = length; | 2784 | sky2_rx_tag(sky2, length); |
2764 | break; | 2785 | break; |
2765 | 2786 | ||
2766 | case OP_RXCHKSVLAN: | 2787 | case OP_RXCHKSVLAN: |
2767 | sky2->rx_tag = length; | 2788 | sky2_rx_tag(sky2, length); |
2768 | /* fall through */ | 2789 | /* fall through */ |
2769 | case OP_RXCHKS: | 2790 | case OP_RXCHKS: |
2770 | if (likely(dev->features & NETIF_F_RXCSUM)) | 2791 | if (likely(dev->features & NETIF_F_RXCSUM)) |
diff --git a/drivers/net/ethernet/marvell/sky2.h b/drivers/net/ethernet/marvell/sky2.h index ff6f58bf822a..3c896ce80b71 100644 --- a/drivers/net/ethernet/marvell/sky2.h +++ b/drivers/net/ethernet/marvell/sky2.h | |||
@@ -2241,7 +2241,6 @@ struct sky2_port { | |||
2241 | u16 rx_pending; | 2241 | u16 rx_pending; |
2242 | u16 rx_data_size; | 2242 | u16 rx_data_size; |
2243 | u16 rx_nfrags; | 2243 | u16 rx_nfrags; |
2244 | u16 rx_tag; | ||
2245 | 2244 | ||
2246 | struct { | 2245 | struct { |
2247 | unsigned long last; | 2246 | unsigned long last; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 9e2b911a1230..d69fee41f24a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -83,8 +83,9 @@ | |||
83 | 83 | ||
84 | #define MLX4_EN_WATCHDOG_TIMEOUT (15 * HZ) | 84 | #define MLX4_EN_WATCHDOG_TIMEOUT (15 * HZ) |
85 | 85 | ||
86 | #define MLX4_EN_ALLOC_ORDER 2 | 86 | /* Use the maximum between 16384 and a single page */ |
87 | #define MLX4_EN_ALLOC_SIZE (PAGE_SIZE << MLX4_EN_ALLOC_ORDER) | 87 | #define MLX4_EN_ALLOC_SIZE PAGE_ALIGN(16384) |
88 | #define MLX4_EN_ALLOC_ORDER get_order(MLX4_EN_ALLOC_SIZE) | ||
88 | 89 | ||
89 | #define MLX4_EN_MAX_LRO_DESCRIPTORS 32 | 90 | #define MLX4_EN_MAX_LRO_DESCRIPTORS 32 |
90 | 91 | ||
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index c722aa607d07..f8dda009d3c0 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -889,16 +889,17 @@ static int ks8851_net_stop(struct net_device *dev) | |||
889 | netif_stop_queue(dev); | 889 | netif_stop_queue(dev); |
890 | 890 | ||
891 | mutex_lock(&ks->lock); | 891 | mutex_lock(&ks->lock); |
892 | /* turn off the IRQs and ack any outstanding */ | ||
893 | ks8851_wrreg16(ks, KS_IER, 0x0000); | ||
894 | ks8851_wrreg16(ks, KS_ISR, 0xffff); | ||
895 | mutex_unlock(&ks->lock); | ||
892 | 896 | ||
893 | /* stop any outstanding work */ | 897 | /* stop any outstanding work */ |
894 | flush_work(&ks->irq_work); | 898 | flush_work(&ks->irq_work); |
895 | flush_work(&ks->tx_work); | 899 | flush_work(&ks->tx_work); |
896 | flush_work(&ks->rxctrl_work); | 900 | flush_work(&ks->rxctrl_work); |
897 | 901 | ||
898 | /* turn off the IRQs and ack any outstanding */ | 902 | mutex_lock(&ks->lock); |
899 | ks8851_wrreg16(ks, KS_IER, 0x0000); | ||
900 | ks8851_wrreg16(ks, KS_ISR, 0xffff); | ||
901 | |||
902 | /* shutdown RX process */ | 903 | /* shutdown RX process */ |
903 | ks8851_wrreg16(ks, KS_RXCR1, 0x0000); | 904 | ks8851_wrreg16(ks, KS_RXCR1, 0x0000); |
904 | 905 | ||
@@ -907,6 +908,7 @@ static int ks8851_net_stop(struct net_device *dev) | |||
907 | 908 | ||
908 | /* set powermode to soft power down to save power */ | 909 | /* set powermode to soft power down to save power */ |
909 | ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN); | 910 | ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN); |
911 | mutex_unlock(&ks->lock); | ||
910 | 912 | ||
911 | /* ensure any queued tx buffers are dumped */ | 913 | /* ensure any queued tx buffers are dumped */ |
912 | while (!skb_queue_empty(&ks->txq)) { | 914 | while (!skb_queue_empty(&ks->txq)) { |
@@ -918,7 +920,6 @@ static int ks8851_net_stop(struct net_device *dev) | |||
918 | dev_kfree_skb(txb); | 920 | dev_kfree_skb(txb); |
919 | } | 921 | } |
920 | 922 | ||
921 | mutex_unlock(&ks->lock); | ||
922 | return 0; | 923 | return 0; |
923 | } | 924 | } |
924 | 925 | ||
@@ -1418,6 +1419,7 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1418 | struct net_device *ndev; | 1419 | struct net_device *ndev; |
1419 | struct ks8851_net *ks; | 1420 | struct ks8851_net *ks; |
1420 | int ret; | 1421 | int ret; |
1422 | unsigned cider; | ||
1421 | 1423 | ||
1422 | ndev = alloc_etherdev(sizeof(struct ks8851_net)); | 1424 | ndev = alloc_etherdev(sizeof(struct ks8851_net)); |
1423 | if (!ndev) | 1425 | if (!ndev) |
@@ -1484,8 +1486,8 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1484 | ks8851_soft_reset(ks, GRR_GSR); | 1486 | ks8851_soft_reset(ks, GRR_GSR); |
1485 | 1487 | ||
1486 | /* simple check for a valid chip being connected to the bus */ | 1488 | /* simple check for a valid chip being connected to the bus */ |
1487 | 1489 | cider = ks8851_rdreg16(ks, KS_CIDER); | |
1488 | if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { | 1490 | if ((cider & ~CIDER_REV_MASK) != CIDER_ID) { |
1489 | dev_err(&spi->dev, "failed to read device ID\n"); | 1491 | dev_err(&spi->dev, "failed to read device ID\n"); |
1490 | ret = -ENODEV; | 1492 | ret = -ENODEV; |
1491 | goto err_id; | 1493 | goto err_id; |
@@ -1516,15 +1518,14 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1516 | } | 1518 | } |
1517 | 1519 | ||
1518 | netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", | 1520 | netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", |
1519 | CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)), | 1521 | CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq, |
1520 | ndev->dev_addr, ndev->irq, | ||
1521 | ks->rc_ccr & CCR_EEPROM ? "has" : "no"); | 1522 | ks->rc_ccr & CCR_EEPROM ? "has" : "no"); |
1522 | 1523 | ||
1523 | return 0; | 1524 | return 0; |
1524 | 1525 | ||
1525 | 1526 | ||
1526 | err_netdev: | 1527 | err_netdev: |
1527 | free_irq(ndev->irq, ndev); | 1528 | free_irq(ndev->irq, ks); |
1528 | 1529 | ||
1529 | err_id: | 1530 | err_id: |
1530 | err_irq: | 1531 | err_irq: |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index b8104d9f4081..5ffde23ac8fb 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define DRV_NAME "ks8851_mll" | 40 | #define DRV_NAME "ks8851_mll" |
41 | 41 | ||
42 | static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 }; | 42 | static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 }; |
43 | #define MAX_RECV_FRAMES 32 | 43 | #define MAX_RECV_FRAMES 255 |
44 | #define MAX_BUF_SIZE 2048 | 44 | #define MAX_BUF_SIZE 2048 |
45 | #define TX_BUF_SIZE 2000 | 45 | #define TX_BUF_SIZE 2000 |
46 | #define RX_BUF_SIZE 2000 | 46 | #define RX_BUF_SIZE 2000 |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index ef723b185d85..eaf9ff0262a9 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -5675,7 +5675,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr) | |||
5675 | memcpy(hw->override_addr, mac->sa_data, ETH_ALEN); | 5675 | memcpy(hw->override_addr, mac->sa_data, ETH_ALEN); |
5676 | } | 5676 | } |
5677 | 5677 | ||
5678 | memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN); | 5678 | memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN); |
5679 | 5679 | ||
5680 | interrupt = hw_block_intr(hw); | 5680 | interrupt = hw_block_intr(hw); |
5681 | 5681 | ||
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 69444247c20b..6dfc26d85e47 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c | |||
@@ -1441,7 +1441,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) | |||
1441 | } | 1441 | } |
1442 | #endif | 1442 | #endif |
1443 | if (!is_valid_ether_addr(ndev->dev_addr)) | 1443 | if (!is_valid_ether_addr(ndev->dev_addr)) |
1444 | dev_hw_addr_random(ndev, ndev->dev_addr); | 1444 | eth_hw_addr_random(ndev); |
1445 | 1445 | ||
1446 | /* Reset the ethernet controller */ | 1446 | /* Reset the ethernet controller */ |
1447 | __lpc_eth_reset(pldat); | 1447 | __lpc_eth_reset(pldat); |
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index abc79076f867..b3287c0fe279 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -958,6 +958,11 @@ static inline void cp_start_hw (struct cp_private *cp) | |||
958 | cpw8(Cmd, RxOn | TxOn); | 958 | cpw8(Cmd, RxOn | TxOn); |
959 | } | 959 | } |
960 | 960 | ||
961 | static void cp_enable_irq(struct cp_private *cp) | ||
962 | { | ||
963 | cpw16_f(IntrMask, cp_intr_mask); | ||
964 | } | ||
965 | |||
961 | static void cp_init_hw (struct cp_private *cp) | 966 | static void cp_init_hw (struct cp_private *cp) |
962 | { | 967 | { |
963 | struct net_device *dev = cp->dev; | 968 | struct net_device *dev = cp->dev; |
@@ -997,8 +1002,6 @@ static void cp_init_hw (struct cp_private *cp) | |||
997 | 1002 | ||
998 | cpw16(MultiIntr, 0); | 1003 | cpw16(MultiIntr, 0); |
999 | 1004 | ||
1000 | cpw16_f(IntrMask, cp_intr_mask); | ||
1001 | |||
1002 | cpw8_f(Cfg9346, Cfg9346_Lock); | 1005 | cpw8_f(Cfg9346, Cfg9346_Lock); |
1003 | } | 1006 | } |
1004 | 1007 | ||
@@ -1130,6 +1133,8 @@ static int cp_open (struct net_device *dev) | |||
1130 | if (rc) | 1133 | if (rc) |
1131 | goto err_out_hw; | 1134 | goto err_out_hw; |
1132 | 1135 | ||
1136 | cp_enable_irq(cp); | ||
1137 | |||
1133 | netif_carrier_off(dev); | 1138 | netif_carrier_off(dev); |
1134 | mii_check_media(&cp->mii_if, netif_msg_link(cp), true); | 1139 | mii_check_media(&cp->mii_if, netif_msg_link(cp), true); |
1135 | netif_start_queue(dev); | 1140 | netif_start_queue(dev); |
@@ -2031,6 +2036,7 @@ static int cp_resume (struct pci_dev *pdev) | |||
2031 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ | 2036 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ |
2032 | cp_init_rings_index (cp); | 2037 | cp_init_rings_index (cp); |
2033 | cp_init_hw (cp); | 2038 | cp_init_hw (cp); |
2039 | cp_enable_irq(cp); | ||
2034 | netif_start_queue (dev); | 2040 | netif_start_queue (dev); |
2035 | 2041 | ||
2036 | spin_lock_irqsave (&cp->lock, flags); | 2042 | spin_lock_irqsave (&cp->lock, flags); |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 7b23554f80b6..f54509377efa 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -5810,7 +5810,10 @@ static void __rtl8169_resume(struct net_device *dev) | |||
5810 | 5810 | ||
5811 | rtl_pll_power_up(tp); | 5811 | rtl_pll_power_up(tp); |
5812 | 5812 | ||
5813 | rtl_lock_work(tp); | ||
5814 | napi_enable(&tp->napi); | ||
5813 | set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags); | 5815 | set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags); |
5816 | rtl_unlock_work(tp); | ||
5814 | 5817 | ||
5815 | rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING); | 5818 | rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING); |
5816 | } | 5819 | } |
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig index 9755b49bbefb..3fb2355af37e 100644 --- a/drivers/net/ethernet/renesas/Kconfig +++ b/drivers/net/ethernet/renesas/Kconfig | |||
@@ -7,7 +7,8 @@ config SH_ETH | |||
7 | depends on SUPERH && \ | 7 | depends on SUPERH && \ |
8 | (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \ | 8 | (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \ |
9 | CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \ | 9 | CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \ |
10 | CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757) | 10 | CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \ |
11 | CPU_SUBTYPE_SH7757) | ||
11 | select CRC32 | 12 | select CRC32 |
12 | select NET_CORE | 13 | select NET_CORE |
13 | select MII | 14 | select MII |
@@ -16,4 +17,4 @@ config SH_ETH | |||
16 | ---help--- | 17 | ---help--- |
17 | Renesas SuperH Ethernet device driver. | 18 | Renesas SuperH Ethernet device driver. |
18 | This driver supporting CPUs are: | 19 | This driver supporting CPUs are: |
19 | - SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757. | 20 | - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763 and SH7757. |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 8615961c1287..d63e09b29a96 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * SuperH Ethernet device driver | 2 | * SuperH Ethernet device driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006-2008 Nobuhiro Iwamatsu | 4 | * Copyright (C) 2006-2012 Nobuhiro Iwamatsu |
5 | * Copyright (C) 2008-2009 Renesas Solutions Corp. | 5 | * Copyright (C) 2008-2012 Renesas Solutions Corp. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
8 | * under the terms and conditions of the GNU General Public License, | 8 | * under the terms and conditions of the GNU General Public License, |
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/ethtool.h> | 39 | #include <linux/ethtool.h> |
40 | #include <linux/if_vlan.h> | 40 | #include <linux/if_vlan.h> |
41 | #include <linux/clk.h> | ||
41 | #include <linux/sh_eth.h> | 42 | #include <linux/sh_eth.h> |
42 | 43 | ||
43 | #include "sh_eth.h" | 44 | #include "sh_eth.h" |
@@ -279,8 +280,9 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp) | |||
279 | return &sh_eth_my_cpu_data; | 280 | return &sh_eth_my_cpu_data; |
280 | } | 281 | } |
281 | 282 | ||
282 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | 283 | #elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) |
283 | #define SH_ETH_HAS_TSU 1 | 284 | #define SH_ETH_HAS_TSU 1 |
285 | static void sh_eth_reset_hw_crc(struct net_device *ndev); | ||
284 | static void sh_eth_chip_reset(struct net_device *ndev) | 286 | static void sh_eth_chip_reset(struct net_device *ndev) |
285 | { | 287 | { |
286 | struct sh_eth_private *mdp = netdev_priv(ndev); | 288 | struct sh_eth_private *mdp = netdev_priv(ndev); |
@@ -314,6 +316,9 @@ static void sh_eth_reset(struct net_device *ndev) | |||
314 | sh_eth_write(ndev, 0x0, RDFAR); | 316 | sh_eth_write(ndev, 0x0, RDFAR); |
315 | sh_eth_write(ndev, 0x0, RDFXR); | 317 | sh_eth_write(ndev, 0x0, RDFXR); |
316 | sh_eth_write(ndev, 0x0, RDFFR); | 318 | sh_eth_write(ndev, 0x0, RDFFR); |
319 | |||
320 | /* Reset HW CRC register */ | ||
321 | sh_eth_reset_hw_crc(ndev); | ||
317 | } | 322 | } |
318 | 323 | ||
319 | static void sh_eth_set_duplex(struct net_device *ndev) | 324 | static void sh_eth_set_duplex(struct net_device *ndev) |
@@ -370,8 +375,17 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | |||
370 | .no_trimd = 1, | 375 | .no_trimd = 1, |
371 | .no_ade = 1, | 376 | .no_ade = 1, |
372 | .tsu = 1, | 377 | .tsu = 1, |
378 | #if defined(CONFIG_CPU_SUBTYPE_SH7734) | ||
379 | .hw_crc = 1, | ||
380 | #endif | ||
373 | }; | 381 | }; |
374 | 382 | ||
383 | static void sh_eth_reset_hw_crc(struct net_device *ndev) | ||
384 | { | ||
385 | if (sh_eth_my_cpu_data.hw_crc) | ||
386 | sh_eth_write(ndev, 0x0, CSMR); | ||
387 | } | ||
388 | |||
375 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) | 389 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) |
376 | #define SH_ETH_RESET_DEFAULT 1 | 390 | #define SH_ETH_RESET_DEFAULT 1 |
377 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { | 391 | static struct sh_eth_cpu_data sh_eth_my_cpu_data = { |
@@ -790,7 +804,7 @@ static int sh_eth_dev_init(struct net_device *ndev) | |||
790 | /* all sh_eth int mask */ | 804 | /* all sh_eth int mask */ |
791 | sh_eth_write(ndev, 0, EESIPR); | 805 | sh_eth_write(ndev, 0, EESIPR); |
792 | 806 | ||
793 | #if defined(__LITTLE_ENDIAN__) | 807 | #if defined(__LITTLE_ENDIAN) |
794 | if (mdp->cd->hw_swap) | 808 | if (mdp->cd->hw_swap) |
795 | sh_eth_write(ndev, EDMR_EL, EDMR); | 809 | sh_eth_write(ndev, EDMR_EL, EDMR); |
796 | else | 810 | else |
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h index 57dc26261116..0fa14afce23d 100644 --- a/drivers/net/ethernet/renesas/sh_eth.h +++ b/drivers/net/ethernet/renesas/sh_eth.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * SuperH Ethernet device driver | 2 | * SuperH Ethernet device driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006-2008 Nobuhiro Iwamatsu | 4 | * Copyright (C) 2006-2012 Nobuhiro Iwamatsu |
5 | * Copyright (C) 2008-2011 Renesas Solutions Corp. | 5 | * Copyright (C) 2008-2012 Renesas Solutions Corp. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
8 | * under the terms and conditions of the GNU General Public License, | 8 | * under the terms and conditions of the GNU General Public License, |
@@ -98,6 +98,8 @@ enum { | |||
98 | CEECR, | 98 | CEECR, |
99 | MAFCR, | 99 | MAFCR, |
100 | RTRATE, | 100 | RTRATE, |
101 | CSMR, | ||
102 | RMII_MII, | ||
101 | 103 | ||
102 | /* TSU Absolute address */ | 104 | /* TSU Absolute address */ |
103 | ARSTR, | 105 | ARSTR, |
@@ -172,6 +174,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = { | |||
172 | [RMCR] = 0x0458, | 174 | [RMCR] = 0x0458, |
173 | [RPADIR] = 0x0460, | 175 | [RPADIR] = 0x0460, |
174 | [FCFTR] = 0x0468, | 176 | [FCFTR] = 0x0468, |
177 | [CSMR] = 0x04E4, | ||
175 | 178 | ||
176 | [ECMR] = 0x0500, | 179 | [ECMR] = 0x0500, |
177 | [ECSR] = 0x0510, | 180 | [ECSR] = 0x0510, |
@@ -200,6 +203,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = { | |||
200 | [CERCR] = 0x0768, | 203 | [CERCR] = 0x0768, |
201 | [CEECR] = 0x0770, | 204 | [CEECR] = 0x0770, |
202 | [MAFCR] = 0x0778, | 205 | [MAFCR] = 0x0778, |
206 | [RMII_MII] = 0x0790, | ||
203 | 207 | ||
204 | [ARSTR] = 0x0000, | 208 | [ARSTR] = 0x0000, |
205 | [TSU_CTRST] = 0x0004, | 209 | [TSU_CTRST] = 0x0004, |
@@ -377,7 +381,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = { | |||
377 | /* | 381 | /* |
378 | * Register's bits | 382 | * Register's bits |
379 | */ | 383 | */ |
380 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | 384 | #if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) |
381 | /* EDSR */ | 385 | /* EDSR */ |
382 | enum EDSR_BIT { | 386 | enum EDSR_BIT { |
383 | EDSR_ENT = 0x01, EDSR_ENR = 0x02, | 387 | EDSR_ENT = 0x01, EDSR_ENR = 0x02, |
@@ -689,7 +693,7 @@ enum TSU_FWSLC_BIT { | |||
689 | */ | 693 | */ |
690 | struct sh_eth_txdesc { | 694 | struct sh_eth_txdesc { |
691 | u32 status; /* TD0 */ | 695 | u32 status; /* TD0 */ |
692 | #if defined(CONFIG_CPU_LITTLE_ENDIAN) | 696 | #if defined(__LITTLE_ENDIAN) |
693 | u16 pad0; /* TD1 */ | 697 | u16 pad0; /* TD1 */ |
694 | u16 buffer_length; /* TD1 */ | 698 | u16 buffer_length; /* TD1 */ |
695 | #else | 699 | #else |
@@ -706,7 +710,7 @@ struct sh_eth_txdesc { | |||
706 | */ | 710 | */ |
707 | struct sh_eth_rxdesc { | 711 | struct sh_eth_rxdesc { |
708 | u32 status; /* RD0 */ | 712 | u32 status; /* RD0 */ |
709 | #if defined(CONFIG_CPU_LITTLE_ENDIAN) | 713 | #if defined(__LITTLE_ENDIAN) |
710 | u16 frame_length; /* RD1 */ | 714 | u16 frame_length; /* RD1 */ |
711 | u16 buffer_length; /* RD1 */ | 715 | u16 buffer_length; /* RD1 */ |
712 | #else | 716 | #else |
@@ -751,6 +755,7 @@ struct sh_eth_cpu_data { | |||
751 | unsigned rpadir:1; /* E-DMAC have RPADIR */ | 755 | unsigned rpadir:1; /* E-DMAC have RPADIR */ |
752 | unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */ | 756 | unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */ |
753 | unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ | 757 | unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ |
758 | unsigned hw_crc:1; /* E-DMAC have CSMR */ | ||
754 | }; | 759 | }; |
755 | 760 | ||
756 | struct sh_eth_private { | 761 | struct sh_eth_private { |
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 4a6971027076..cd3defb11ffb 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat) | |||
1166 | 1166 | ||
1167 | /* Quickly dumps bad packets */ | 1167 | /* Quickly dumps bad packets */ |
1168 | static void | 1168 | static void |
1169 | smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes) | 1169 | smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords) |
1170 | { | 1170 | { |
1171 | unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2; | ||
1172 | |||
1173 | if (likely(pktwords >= 4)) { | 1171 | if (likely(pktwords >= 4)) { |
1174 | unsigned int timeout = 500; | 1172 | unsigned int timeout = 500; |
1175 | unsigned int val; | 1173 | unsigned int val; |
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) | |||
1233 | continue; | 1231 | continue; |
1234 | } | 1232 | } |
1235 | 1233 | ||
1236 | skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN); | 1234 | skb = netdev_alloc_skb(dev, pktwords << 2); |
1237 | if (unlikely(!skb)) { | 1235 | if (unlikely(!skb)) { |
1238 | SMSC_WARN(pdata, rx_err, | 1236 | SMSC_WARN(pdata, rx_err, |
1239 | "Unable to allocate skb for rx packet"); | 1237 | "Unable to allocate skb for rx packet"); |
@@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) | |||
1243 | break; | 1241 | break; |
1244 | } | 1242 | } |
1245 | 1243 | ||
1246 | skb->data = skb->head; | 1244 | pdata->ops->rx_readfifo(pdata, |
1247 | skb_reset_tail_pointer(skb); | 1245 | (unsigned int *)skb->data, pktwords); |
1248 | 1246 | ||
1249 | /* Align IP on 16B boundary */ | 1247 | /* Align IP on 16B boundary */ |
1250 | skb_reserve(skb, NET_IP_ALIGN); | 1248 | skb_reserve(skb, NET_IP_ALIGN); |
1251 | skb_put(skb, pktlength - 4); | 1249 | skb_put(skb, pktlength - 4); |
1252 | pdata->ops->rx_readfifo(pdata, | ||
1253 | (unsigned int *)skb->head, pktwords); | ||
1254 | skb->protocol = eth_type_trans(skb, dev); | 1250 | skb->protocol = eth_type_trans(skb, dev); |
1255 | skb_checksum_none_assert(skb); | 1251 | skb_checksum_none_assert(skb); |
1256 | netif_receive_skb(skb); | 1252 | netif_receive_skb(skb); |
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev) | |||
1565 | smsc911x_reg_write(pdata, FIFO_INT, temp); | 1561 | smsc911x_reg_write(pdata, FIFO_INT, temp); |
1566 | 1562 | ||
1567 | /* set RX Data offset to 2 bytes for alignment */ | 1563 | /* set RX Data offset to 2 bytes for alignment */ |
1568 | smsc911x_reg_write(pdata, RX_CFG, (2 << 8)); | 1564 | smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8)); |
1569 | 1565 | ||
1570 | /* enable NAPI polling before enabling RX interrupts */ | 1566 | /* enable NAPI polling before enabling RX interrupts */ |
1571 | napi_enable(&pdata->napi); | 1567 | napi_enable(&pdata->napi); |
@@ -2382,7 +2378,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
2382 | SET_NETDEV_DEV(dev, &pdev->dev); | 2378 | SET_NETDEV_DEV(dev, &pdev->dev); |
2383 | 2379 | ||
2384 | pdata = netdev_priv(dev); | 2380 | pdata = netdev_priv(dev); |
2385 | |||
2386 | dev->irq = irq_res->start; | 2381 | dev->irq = irq_res->start; |
2387 | irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; | 2382 | irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; |
2388 | pdata->ioaddr = ioremap_nocache(res->start, res_size); | 2383 | pdata->ioaddr = ioremap_nocache(res->start, res_size); |
@@ -2446,7 +2441,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
2446 | if (retval) { | 2441 | if (retval) { |
2447 | SMSC_WARN(pdata, probe, | 2442 | SMSC_WARN(pdata, probe, |
2448 | "Unable to claim requested irq: %d", dev->irq); | 2443 | "Unable to claim requested irq: %d", dev->irq); |
2449 | goto out_free_irq; | 2444 | goto out_disable_resources; |
2450 | } | 2445 | } |
2451 | 2446 | ||
2452 | retval = register_netdev(dev); | 2447 | retval = register_netdev(dev); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e85ffbd54830..48d56da62f08 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1737,10 +1737,12 @@ static int stmmac_hw_init(struct stmmac_priv *priv) | |||
1737 | struct mac_device_info *mac; | 1737 | struct mac_device_info *mac; |
1738 | 1738 | ||
1739 | /* Identify the MAC HW device */ | 1739 | /* Identify the MAC HW device */ |
1740 | if (priv->plat->has_gmac) | 1740 | if (priv->plat->has_gmac) { |
1741 | priv->dev->priv_flags |= IFF_UNICAST_FLT; | ||
1741 | mac = dwmac1000_setup(priv->ioaddr); | 1742 | mac = dwmac1000_setup(priv->ioaddr); |
1742 | else | 1743 | } else { |
1743 | mac = dwmac100_setup(priv->ioaddr); | 1744 | mac = dwmac100_setup(priv->ioaddr); |
1745 | } | ||
1744 | if (!mac) | 1746 | if (!mac) |
1745 | return -ENOMEM; | 1747 | return -ENOMEM; |
1746 | 1748 | ||
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c index 558409ff4058..4ba969096717 100644 --- a/drivers/net/ethernet/sun/sungem.c +++ b/drivers/net/ethernet/sun/sungem.c | |||
@@ -2339,7 +2339,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2339 | netif_device_detach(dev); | 2339 | netif_device_detach(dev); |
2340 | 2340 | ||
2341 | /* Switch off chip, remember WOL setting */ | 2341 | /* Switch off chip, remember WOL setting */ |
2342 | gp->asleep_wol = gp->wake_on_lan; | 2342 | gp->asleep_wol = !!gp->wake_on_lan; |
2343 | gem_do_stop(dev, gp->asleep_wol); | 2343 | gem_do_stop(dev, gp->asleep_wol); |
2344 | 2344 | ||
2345 | /* Unlock the network stack */ | 2345 | /* Unlock the network stack */ |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 174a3348f676..08aff1a2087c 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -1511,7 +1511,7 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) | |||
1511 | 1511 | ||
1512 | static int match_first_device(struct device *dev, void *data) | 1512 | static int match_first_device(struct device *dev, void *data) |
1513 | { | 1513 | { |
1514 | return 1; | 1514 | return !strncmp(dev_name(dev), "davinci_mdio", 12); |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | /** | 1517 | /** |
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 2757c7d6e633..e4e47088e26b 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c | |||
@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) | |||
181 | __davinci_mdio_reset(data); | 181 | __davinci_mdio_reset(data); |
182 | return -EAGAIN; | 182 | return -EAGAIN; |
183 | } | 183 | } |
184 | |||
185 | reg = __raw_readl(®s->user[0].access); | ||
186 | if ((reg & USERACCESS_GO) == 0) | ||
187 | return 0; | ||
188 | |||
184 | dev_err(data->dev, "timed out waiting for user access\n"); | 189 | dev_err(data->dev, "timed out waiting for user access\n"); |
185 | return -ETIMEDOUT; | 190 | return -ETIMEDOUT; |
186 | } | 191 | } |
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c index 817ad3bc4957..efd36691ce54 100644 --- a/drivers/net/ethernet/ti/tlan.c +++ b/drivers/net/ethernet/ti/tlan.c | |||
@@ -228,7 +228,7 @@ tlan_get_skb(const struct tlan_list *tag) | |||
228 | unsigned long addr; | 228 | unsigned long addr; |
229 | 229 | ||
230 | addr = tag->buffer[9].address; | 230 | addr = tag->buffer[9].address; |
231 | addr |= (tag->buffer[8].address << 16) << 16; | 231 | addr |= ((unsigned long) tag->buffer[8].address << 16) << 16; |
232 | return (struct sk_buff *) addr; | 232 | return (struct sk_buff *) addr; |
233 | } | 233 | } |
234 | 234 | ||
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 261356c2dc99..3d501ec7fad7 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -342,6 +342,21 @@ inline int __netio_fastio1(u32 fastio_index, u32 arg0) | |||
342 | } | 342 | } |
343 | 343 | ||
344 | 344 | ||
345 | static void tile_net_return_credit(struct tile_net_cpu *info) | ||
346 | { | ||
347 | struct tile_netio_queue *queue = &info->queue; | ||
348 | netio_queue_user_impl_t *qup = &queue->__user_part; | ||
349 | |||
350 | /* Return four credits after every fourth packet. */ | ||
351 | if (--qup->__receive_credit_remaining == 0) { | ||
352 | u32 interval = qup->__receive_credit_interval; | ||
353 | qup->__receive_credit_remaining = interval; | ||
354 | __netio_fastio_return_credits(qup->__fastio_index, interval); | ||
355 | } | ||
356 | } | ||
357 | |||
358 | |||
359 | |||
345 | /* | 360 | /* |
346 | * Provide a linux buffer to LIPP. | 361 | * Provide a linux buffer to LIPP. |
347 | */ | 362 | */ |
@@ -433,7 +448,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info, | |||
433 | struct sk_buff **skb_ptr; | 448 | struct sk_buff **skb_ptr; |
434 | 449 | ||
435 | /* Request 96 extra bytes for alignment purposes. */ | 450 | /* Request 96 extra bytes for alignment purposes. */ |
436 | skb = netdev_alloc_skb(info->napi->dev, len + padding); | 451 | skb = netdev_alloc_skb(info->napi.dev, len + padding); |
437 | if (skb == NULL) | 452 | if (skb == NULL) |
438 | return false; | 453 | return false; |
439 | 454 | ||
@@ -864,19 +879,11 @@ static bool tile_net_poll_aux(struct tile_net_cpu *info, int index) | |||
864 | 879 | ||
865 | stats->rx_packets++; | 880 | stats->rx_packets++; |
866 | stats->rx_bytes += len; | 881 | stats->rx_bytes += len; |
867 | |||
868 | if (small) | ||
869 | info->num_needed_small_buffers++; | ||
870 | else | ||
871 | info->num_needed_large_buffers++; | ||
872 | } | 882 | } |
873 | 883 | ||
874 | /* Return four credits after every fourth packet. */ | 884 | /* ISSUE: It would be nice to defer this until the packet has */ |
875 | if (--qup->__receive_credit_remaining == 0) { | 885 | /* actually been processed. */ |
876 | u32 interval = qup->__receive_credit_interval; | 886 | tile_net_return_credit(info); |
877 | qup->__receive_credit_remaining = interval; | ||
878 | __netio_fastio_return_credits(qup->__fastio_index, interval); | ||
879 | } | ||
880 | 887 | ||
881 | /* Consume this packet. */ | 888 | /* Consume this packet. */ |
882 | qup->__packet_receive_read = index2; | 889 | qup->__packet_receive_read = index2; |
@@ -1543,7 +1550,7 @@ static int tile_net_drain_lipp_buffers(struct tile_net_priv *priv) | |||
1543 | 1550 | ||
1544 | /* Drain all the LIPP buffers. */ | 1551 | /* Drain all the LIPP buffers. */ |
1545 | while (true) { | 1552 | while (true) { |
1546 | int buffer; | 1553 | unsigned int buffer; |
1547 | 1554 | ||
1548 | /* NOTE: This should never fail. */ | 1555 | /* NOTE: This should never fail. */ |
1549 | if (hv_dev_pread(priv->hv_devhdl, 0, (HV_VirtAddr)&buffer, | 1556 | if (hv_dev_pread(priv->hv_devhdl, 0, (HV_VirtAddr)&buffer, |
@@ -1707,7 +1714,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, | |||
1707 | if (!hash_default) { | 1714 | if (!hash_default) { |
1708 | void *va = pfn_to_kaddr(pfn) + f->page_offset; | 1715 | void *va = pfn_to_kaddr(pfn) + f->page_offset; |
1709 | BUG_ON(PageHighMem(skb_frag_page(f))); | 1716 | BUG_ON(PageHighMem(skb_frag_page(f))); |
1710 | finv_buffer_remote(va, f->size, 0); | 1717 | finv_buffer_remote(va, skb_frag_size(f), 0); |
1711 | } | 1718 | } |
1712 | 1719 | ||
1713 | cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset; | 1720 | cpa = ((phys_addr_t)pfn << PAGE_SHIFT) + f->page_offset; |
@@ -1735,8 +1742,8 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, | |||
1735 | * Sometimes, if "sendfile()" requires copying, we will be called with | 1742 | * Sometimes, if "sendfile()" requires copying, we will be called with |
1736 | * "data" containing the header and payload, with "frags" being empty. | 1743 | * "data" containing the header and payload, with "frags" being empty. |
1737 | * | 1744 | * |
1738 | * In theory, "sh->nr_frags" could be 3, but in practice, it seems | 1745 | * Sometimes, for example when using NFS over TCP, a single segment can |
1739 | * that this will never actually happen. | 1746 | * span 3 fragments, which must be handled carefully in LEPP. |
1740 | * | 1747 | * |
1741 | * See "emulate_large_send_offload()" for some reference code, which | 1748 | * See "emulate_large_send_offload()" for some reference code, which |
1742 | * does not handle checksumming. | 1749 | * does not handle checksumming. |
@@ -1844,10 +1851,8 @@ static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev) | |||
1844 | 1851 | ||
1845 | spin_lock_irqsave(&priv->eq_lock, irqflags); | 1852 | spin_lock_irqsave(&priv->eq_lock, irqflags); |
1846 | 1853 | ||
1847 | /* | 1854 | /* Handle completions if needed to make room. */ |
1848 | * Handle completions if needed to make room. | 1855 | /* NOTE: Return NETDEV_TX_BUSY if there is still no room. */ |
1849 | * HACK: Spin until there is sufficient room. | ||
1850 | */ | ||
1851 | if (lepp_num_free_comp_slots(eq) == 0) { | 1856 | if (lepp_num_free_comp_slots(eq) == 0) { |
1852 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); | 1857 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); |
1853 | if (nolds == 0) { | 1858 | if (nolds == 0) { |
@@ -1861,6 +1866,7 @@ busy: | |||
1861 | cmd_tail = eq->cmd_tail; | 1866 | cmd_tail = eq->cmd_tail; |
1862 | 1867 | ||
1863 | /* Prepare to advance, detecting full queue. */ | 1868 | /* Prepare to advance, detecting full queue. */ |
1869 | /* NOTE: Return NETDEV_TX_BUSY if the queue is full. */ | ||
1864 | cmd_next = cmd_tail + cmd_size; | 1870 | cmd_next = cmd_tail + cmd_size; |
1865 | if (cmd_tail < cmd_head && cmd_next >= cmd_head) | 1871 | if (cmd_tail < cmd_head && cmd_next >= cmd_head) |
1866 | goto busy; | 1872 | goto busy; |
@@ -2023,10 +2029,8 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) | |||
2023 | 2029 | ||
2024 | spin_lock_irqsave(&priv->eq_lock, irqflags); | 2030 | spin_lock_irqsave(&priv->eq_lock, irqflags); |
2025 | 2031 | ||
2026 | /* | 2032 | /* Handle completions if needed to make room. */ |
2027 | * Handle completions if needed to make room. | 2033 | /* NOTE: Return NETDEV_TX_BUSY if there is still no room. */ |
2028 | * HACK: Spin until there is sufficient room. | ||
2029 | */ | ||
2030 | if (lepp_num_free_comp_slots(eq) == 0) { | 2034 | if (lepp_num_free_comp_slots(eq) == 0) { |
2031 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); | 2035 | nolds = tile_net_lepp_grab_comps(eq, olds, wanted, 0); |
2032 | if (nolds == 0) { | 2036 | if (nolds == 0) { |
@@ -2040,6 +2044,7 @@ busy: | |||
2040 | cmd_tail = eq->cmd_tail; | 2044 | cmd_tail = eq->cmd_tail; |
2041 | 2045 | ||
2042 | /* Copy the commands, or fail. */ | 2046 | /* Copy the commands, or fail. */ |
2047 | /* NOTE: Return NETDEV_TX_BUSY if the queue is full. */ | ||
2043 | for (i = 0; i < num_frags; i++) { | 2048 | for (i = 0; i < num_frags; i++) { |
2044 | 2049 | ||
2045 | /* Prepare to advance, detecting full queue. */ | 2050 | /* Prepare to advance, detecting full queue. */ |
@@ -2261,6 +2266,23 @@ static int tile_net_get_mac(struct net_device *dev) | |||
2261 | return 0; | 2266 | return 0; |
2262 | } | 2267 | } |
2263 | 2268 | ||
2269 | |||
2270 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2271 | /* | ||
2272 | * Polling 'interrupt' - used by things like netconsole to send skbs | ||
2273 | * without having to re-enable interrupts. It's not called while | ||
2274 | * the interrupt routine is executing. | ||
2275 | */ | ||
2276 | static void tile_net_netpoll(struct net_device *dev) | ||
2277 | { | ||
2278 | struct tile_net_priv *priv = netdev_priv(dev); | ||
2279 | disable_percpu_irq(priv->intr_id); | ||
2280 | tile_net_handle_ingress_interrupt(priv->intr_id, dev); | ||
2281 | enable_percpu_irq(priv->intr_id, 0); | ||
2282 | } | ||
2283 | #endif | ||
2284 | |||
2285 | |||
2264 | static const struct net_device_ops tile_net_ops = { | 2286 | static const struct net_device_ops tile_net_ops = { |
2265 | .ndo_open = tile_net_open, | 2287 | .ndo_open = tile_net_open, |
2266 | .ndo_stop = tile_net_stop, | 2288 | .ndo_stop = tile_net_stop, |
@@ -2269,7 +2291,10 @@ static const struct net_device_ops tile_net_ops = { | |||
2269 | .ndo_get_stats = tile_net_get_stats, | 2291 | .ndo_get_stats = tile_net_get_stats, |
2270 | .ndo_change_mtu = tile_net_change_mtu, | 2292 | .ndo_change_mtu = tile_net_change_mtu, |
2271 | .ndo_tx_timeout = tile_net_tx_timeout, | 2293 | .ndo_tx_timeout = tile_net_tx_timeout, |
2272 | .ndo_set_mac_address = tile_net_set_mac_address | 2294 | .ndo_set_mac_address = tile_net_set_mac_address, |
2295 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2296 | .ndo_poll_controller = tile_net_netpoll, | ||
2297 | #endif | ||
2273 | }; | 2298 | }; |
2274 | 2299 | ||
2275 | 2300 | ||
@@ -2409,7 +2434,7 @@ static void tile_net_cleanup(void) | |||
2409 | */ | 2434 | */ |
2410 | static int tile_net_init_module(void) | 2435 | static int tile_net_init_module(void) |
2411 | { | 2436 | { |
2412 | pr_info("Tilera IPP Net Driver\n"); | 2437 | pr_info("Tilera Network Driver\n"); |
2413 | 2438 | ||
2414 | tile_net_devs[0] = tile_net_dev_init("xgbe0"); | 2439 | tile_net_devs[0] = tile_net_dev_init("xgbe0"); |
2415 | tile_net_devs[1] = tile_net_dev_init("xgbe1"); | 2440 | tile_net_devs[1] = tile_net_dev_init("xgbe1"); |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 39b8cf3dafcd..fcfa01f7ceb6 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -503,30 +503,32 @@ static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid); | |||
503 | static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); | 503 | static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); |
504 | static void rhine_restart_tx(struct net_device *dev); | 504 | static void rhine_restart_tx(struct net_device *dev); |
505 | 505 | ||
506 | static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool high) | 506 | static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low) |
507 | { | 507 | { |
508 | void __iomem *ioaddr = rp->base; | 508 | void __iomem *ioaddr = rp->base; |
509 | int i; | 509 | int i; |
510 | 510 | ||
511 | for (i = 0; i < 1024; i++) { | 511 | for (i = 0; i < 1024; i++) { |
512 | if (high ^ !!(ioread8(ioaddr + reg) & mask)) | 512 | bool has_mask_bits = !!(ioread8(ioaddr + reg) & mask); |
513 | |||
514 | if (low ^ has_mask_bits) | ||
513 | break; | 515 | break; |
514 | udelay(10); | 516 | udelay(10); |
515 | } | 517 | } |
516 | if (i > 64) { | 518 | if (i > 64) { |
517 | netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle " | 519 | netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle " |
518 | "count: %04d\n", high ? "high" : "low", reg, mask, i); | 520 | "count: %04d\n", low ? "low" : "high", reg, mask, i); |
519 | } | 521 | } |
520 | } | 522 | } |
521 | 523 | ||
522 | static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask) | 524 | static void rhine_wait_bit_high(struct rhine_private *rp, u8 reg, u8 mask) |
523 | { | 525 | { |
524 | rhine_wait_bit(rp, reg, mask, true); | 526 | rhine_wait_bit(rp, reg, mask, false); |
525 | } | 527 | } |
526 | 528 | ||
527 | static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask) | 529 | static void rhine_wait_bit_low(struct rhine_private *rp, u8 reg, u8 mask) |
528 | { | 530 | { |
529 | rhine_wait_bit(rp, reg, mask, false); | 531 | rhine_wait_bit(rp, reg, mask, true); |
530 | } | 532 | } |
531 | 533 | ||
532 | static u32 rhine_get_events(struct rhine_private *rp) | 534 | static u32 rhine_get_events(struct rhine_private *rp) |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index cc83af083fd7..44b8d2bad8c3 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h | |||
@@ -2,9 +2,7 @@ | |||
2 | * Definitions for Xilinx Axi Ethernet device driver. | 2 | * Definitions for Xilinx Axi Ethernet device driver. |
3 | * | 3 | * |
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
5 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 5 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
6 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | ||
7 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | ||
8 | */ | 6 | */ |
9 | 7 | ||
10 | #ifndef XILINX_AXIENET_H | 8 | #ifndef XILINX_AXIENET_H |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 2fcbeba6814b..9c365e192a31 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c | |||
@@ -4,9 +4,9 @@ | |||
4 | * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi | 4 | * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi |
5 | * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net> | 5 | * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net> |
6 | * Copyright (c) 2008-2009 Secret Lab Technologies Ltd. | 6 | * Copyright (c) 2008-2009 Secret Lab Technologies Ltd. |
7 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 7 | * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> |
8 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | 8 | * Copyright (c) 2010 - 2011 PetaLogix |
9 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | 9 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
10 | * | 10 | * |
11 | * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6 | 11 | * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6 |
12 | * and Spartan6. | 12 | * and Spartan6. |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c index d70b6e79f6c0..e90e1f46121e 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | |||
@@ -2,9 +2,9 @@ | |||
2 | * MDIO bus driver for the Xilinx Axi Ethernet device | 2 | * MDIO bus driver for the Xilinx Axi Ethernet device |
3 | * | 3 | * |
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
5 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 5 | * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> |
6 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | 6 | * Copyright (c) 2010 - 2011 PetaLogix |
7 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | 7 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/of_address.h> | 10 | #include <linux/of_address.h> |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index dd294783b5c5..2d59138db7f3 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -44,6 +44,7 @@ struct net_device_context { | |||
44 | /* point back to our device context */ | 44 | /* point back to our device context */ |
45 | struct hv_device *device_ctx; | 45 | struct hv_device *device_ctx; |
46 | struct delayed_work dwork; | 46 | struct delayed_work dwork; |
47 | struct work_struct work; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | 50 | ||
@@ -51,30 +52,22 @@ static int ring_size = 128; | |||
51 | module_param(ring_size, int, S_IRUGO); | 52 | module_param(ring_size, int, S_IRUGO); |
52 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); | 53 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); |
53 | 54 | ||
54 | struct set_multicast_work { | ||
55 | struct work_struct work; | ||
56 | struct net_device *net; | ||
57 | }; | ||
58 | |||
59 | static void do_set_multicast(struct work_struct *w) | 55 | static void do_set_multicast(struct work_struct *w) |
60 | { | 56 | { |
61 | struct set_multicast_work *swk = | 57 | struct net_device_context *ndevctx = |
62 | container_of(w, struct set_multicast_work, work); | 58 | container_of(w, struct net_device_context, work); |
63 | struct net_device *net = swk->net; | ||
64 | |||
65 | struct net_device_context *ndevctx = netdev_priv(net); | ||
66 | struct netvsc_device *nvdev; | 59 | struct netvsc_device *nvdev; |
67 | struct rndis_device *rdev; | 60 | struct rndis_device *rdev; |
68 | 61 | ||
69 | nvdev = hv_get_drvdata(ndevctx->device_ctx); | 62 | nvdev = hv_get_drvdata(ndevctx->device_ctx); |
70 | if (nvdev == NULL) | 63 | if (nvdev == NULL || nvdev->ndev == NULL) |
71 | goto out; | 64 | return; |
72 | 65 | ||
73 | rdev = nvdev->extension; | 66 | rdev = nvdev->extension; |
74 | if (rdev == NULL) | 67 | if (rdev == NULL) |
75 | goto out; | 68 | return; |
76 | 69 | ||
77 | if (net->flags & IFF_PROMISC) | 70 | if (nvdev->ndev->flags & IFF_PROMISC) |
78 | rndis_filter_set_packet_filter(rdev, | 71 | rndis_filter_set_packet_filter(rdev, |
79 | NDIS_PACKET_TYPE_PROMISCUOUS); | 72 | NDIS_PACKET_TYPE_PROMISCUOUS); |
80 | else | 73 | else |
@@ -82,21 +75,13 @@ static void do_set_multicast(struct work_struct *w) | |||
82 | NDIS_PACKET_TYPE_BROADCAST | | 75 | NDIS_PACKET_TYPE_BROADCAST | |
83 | NDIS_PACKET_TYPE_ALL_MULTICAST | | 76 | NDIS_PACKET_TYPE_ALL_MULTICAST | |
84 | NDIS_PACKET_TYPE_DIRECTED); | 77 | NDIS_PACKET_TYPE_DIRECTED); |
85 | |||
86 | out: | ||
87 | kfree(w); | ||
88 | } | 78 | } |
89 | 79 | ||
90 | static void netvsc_set_multicast_list(struct net_device *net) | 80 | static void netvsc_set_multicast_list(struct net_device *net) |
91 | { | 81 | { |
92 | struct set_multicast_work *swk = | 82 | struct net_device_context *net_device_ctx = netdev_priv(net); |
93 | kmalloc(sizeof(struct set_multicast_work), GFP_ATOMIC); | ||
94 | if (swk == NULL) | ||
95 | return; | ||
96 | 83 | ||
97 | swk->net = net; | 84 | schedule_work(&net_device_ctx->work); |
98 | INIT_WORK(&swk->work, do_set_multicast); | ||
99 | schedule_work(&swk->work); | ||
100 | } | 85 | } |
101 | 86 | ||
102 | static int netvsc_open(struct net_device *net) | 87 | static int netvsc_open(struct net_device *net) |
@@ -125,6 +110,8 @@ static int netvsc_close(struct net_device *net) | |||
125 | 110 | ||
126 | netif_tx_disable(net); | 111 | netif_tx_disable(net); |
127 | 112 | ||
113 | /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */ | ||
114 | cancel_work_sync(&net_device_ctx->work); | ||
128 | ret = rndis_filter_close(device_obj); | 115 | ret = rndis_filter_close(device_obj); |
129 | if (ret != 0) | 116 | if (ret != 0) |
130 | netdev_err(net, "unable to close device (ret %d).\n", ret); | 117 | netdev_err(net, "unable to close device (ret %d).\n", ret); |
@@ -335,6 +322,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) | |||
335 | 322 | ||
336 | nvdev->start_remove = true; | 323 | nvdev->start_remove = true; |
337 | cancel_delayed_work_sync(&ndevctx->dwork); | 324 | cancel_delayed_work_sync(&ndevctx->dwork); |
325 | cancel_work_sync(&ndevctx->work); | ||
338 | netif_tx_disable(ndev); | 326 | netif_tx_disable(ndev); |
339 | rndis_filter_device_remove(hdev); | 327 | rndis_filter_device_remove(hdev); |
340 | 328 | ||
@@ -403,6 +391,7 @@ static int netvsc_probe(struct hv_device *dev, | |||
403 | net_device_ctx->device_ctx = dev; | 391 | net_device_ctx->device_ctx = dev; |
404 | hv_set_drvdata(dev, net); | 392 | hv_set_drvdata(dev, net); |
405 | INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp); | 393 | INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp); |
394 | INIT_WORK(&net_device_ctx->work, do_set_multicast); | ||
406 | 395 | ||
407 | net->netdev_ops = &device_ops; | 396 | net->netdev_ops = &device_ops; |
408 | 397 | ||
@@ -456,6 +445,7 @@ static int netvsc_remove(struct hv_device *dev) | |||
456 | 445 | ||
457 | ndev_ctx = netdev_priv(net); | 446 | ndev_ctx = netdev_priv(net); |
458 | cancel_delayed_work_sync(&ndev_ctx->dwork); | 447 | cancel_delayed_work_sync(&ndev_ctx->dwork); |
448 | cancel_work_sync(&ndev_ctx->work); | ||
459 | 449 | ||
460 | /* Stop outbound asap */ | 450 | /* Stop outbound asap */ |
461 | netif_tx_disable(net); | 451 | netif_tx_disable(net); |
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index a0d1913a58d3..e25067552b20 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c | |||
@@ -147,7 +147,7 @@ static void sa1100_irda_dma_start(struct sa1100_buf *buf, | |||
147 | struct dma_async_tx_descriptor *desc; | 147 | struct dma_async_tx_descriptor *desc; |
148 | struct dma_chan *chan = buf->chan; | 148 | struct dma_chan *chan = buf->chan; |
149 | 149 | ||
150 | desc = chan->device->device_prep_slave_sg(chan, &buf->sg, 1, dir, | 150 | desc = dmaengine_prep_slave_sg(chan, &buf->sg, 1, dir, |
151 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 151 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
152 | if (desc) { | 152 | if (desc) { |
153 | desc->callback = cb; | 153 | desc->callback = cb; |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index 0856e1b7a849..5ac46f5226f3 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
@@ -40,6 +40,7 @@ MODULE_LICENSE("GPL"); | |||
40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ | 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ |
41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
43 | #define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ | ||
43 | 44 | ||
44 | static int ip175c_config_init(struct phy_device *phydev) | 45 | static int ip175c_config_init(struct phy_device *phydev) |
45 | { | 46 | { |
@@ -162,7 +163,8 @@ static int ip101a_g_config_init(struct phy_device *phydev) | |||
162 | /* Enable Auto Power Saving mode */ | 163 | /* Enable Auto Power Saving mode */ |
163 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); | 164 | c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); |
164 | c |= IP101A_G_APS_ON; | 165 | c |= IP101A_G_APS_ON; |
165 | return c; | 166 | |
167 | return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); | ||
166 | } | 168 | } |
167 | 169 | ||
168 | static int ip175c_read_status(struct phy_device *phydev) | 170 | static int ip175c_read_status(struct phy_device *phydev) |
@@ -184,6 +186,15 @@ static int ip175c_config_aneg(struct phy_device *phydev) | |||
184 | return 0; | 186 | return 0; |
185 | } | 187 | } |
186 | 188 | ||
189 | static int ip101a_g_ack_interrupt(struct phy_device *phydev) | ||
190 | { | ||
191 | int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS); | ||
192 | if (err < 0) | ||
193 | return err; | ||
194 | |||
195 | return 0; | ||
196 | } | ||
197 | |||
187 | static struct phy_driver ip175c_driver = { | 198 | static struct phy_driver ip175c_driver = { |
188 | .phy_id = 0x02430d80, | 199 | .phy_id = 0x02430d80, |
189 | .name = "ICPlus IP175C", | 200 | .name = "ICPlus IP175C", |
@@ -203,7 +214,6 @@ static struct phy_driver ip1001_driver = { | |||
203 | .phy_id_mask = 0x0ffffff0, | 214 | .phy_id_mask = 0x0ffffff0, |
204 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | 215 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | |
205 | SUPPORTED_Asym_Pause, | 216 | SUPPORTED_Asym_Pause, |
206 | .flags = PHY_HAS_INTERRUPT, | ||
207 | .config_init = &ip1001_config_init, | 217 | .config_init = &ip1001_config_init, |
208 | .config_aneg = &genphy_config_aneg, | 218 | .config_aneg = &genphy_config_aneg, |
209 | .read_status = &genphy_read_status, | 219 | .read_status = &genphy_read_status, |
@@ -219,6 +229,7 @@ static struct phy_driver ip101a_g_driver = { | |||
219 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | | 229 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | |
220 | SUPPORTED_Asym_Pause, | 230 | SUPPORTED_Asym_Pause, |
221 | .flags = PHY_HAS_INTERRUPT, | 231 | .flags = PHY_HAS_INTERRUPT, |
232 | .ack_interrupt = ip101a_g_ack_interrupt, | ||
222 | .config_init = &ip101a_g_config_init, | 233 | .config_init = &ip101a_g_config_init, |
223 | .config_aneg = &genphy_config_aneg, | 234 | .config_aneg = &genphy_config_aneg, |
224 | .read_status = &genphy_read_status, | 235 | .read_status = &genphy_read_status, |
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 159da2905fe9..21d7151fb0ab 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -968,7 +968,6 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
968 | proto = npindex_to_proto[npi]; | 968 | proto = npindex_to_proto[npi]; |
969 | put_unaligned_be16(proto, pp); | 969 | put_unaligned_be16(proto, pp); |
970 | 970 | ||
971 | netif_stop_queue(dev); | ||
972 | skb_queue_tail(&ppp->file.xq, skb); | 971 | skb_queue_tail(&ppp->file.xq, skb); |
973 | ppp_xmit_process(ppp); | 972 | ppp_xmit_process(ppp); |
974 | return NETDEV_TX_OK; | 973 | return NETDEV_TX_OK; |
@@ -1063,6 +1062,8 @@ ppp_xmit_process(struct ppp *ppp) | |||
1063 | code that we can accept some more. */ | 1062 | code that we can accept some more. */ |
1064 | if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) | 1063 | if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) |
1065 | netif_wake_queue(ppp->dev); | 1064 | netif_wake_queue(ppp->dev); |
1065 | else | ||
1066 | netif_stop_queue(ppp->dev); | ||
1066 | } | 1067 | } |
1067 | ppp_xmit_unlock(ppp); | 1068 | ppp_xmit_unlock(ppp); |
1068 | } | 1069 | } |
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index a57f05726b57..91d25888a1b9 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
@@ -375,8 +375,8 @@ static void rionet_remove(struct rio_dev *rdev) | |||
375 | struct net_device *ndev = rio_get_drvdata(rdev); | 375 | struct net_device *ndev = rio_get_drvdata(rdev); |
376 | struct rionet_peer *peer, *tmp; | 376 | struct rionet_peer *peer, *tmp; |
377 | 377 | ||
378 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 378 | free_pages((unsigned long)rionet_active, get_order(sizeof(void *) * |
379 | __fls(sizeof(void *)) + 4 : 0); | 379 | RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size))); |
380 | unregister_netdev(ndev); | 380 | unregister_netdev(ndev); |
381 | free_netdev(ndev); | 381 | free_netdev(ndev); |
382 | 382 | ||
@@ -432,15 +432,16 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev) | |||
432 | int rc = 0; | 432 | int rc = 0; |
433 | struct rionet_private *rnet; | 433 | struct rionet_private *rnet; |
434 | u16 device_id; | 434 | u16 device_id; |
435 | const size_t rionet_active_bytes = sizeof(void *) * | ||
436 | RIO_MAX_ROUTE_ENTRIES(mport->sys_size); | ||
435 | 437 | ||
436 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, | 438 | rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, |
437 | mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); | 439 | get_order(rionet_active_bytes)); |
438 | if (!rionet_active) { | 440 | if (!rionet_active) { |
439 | rc = -ENOMEM; | 441 | rc = -ENOMEM; |
440 | goto out; | 442 | goto out; |
441 | } | 443 | } |
442 | memset((void *)rionet_active, 0, sizeof(void *) * | 444 | memset((void *)rionet_active, 0, rionet_active_bytes); |
443 | RIO_MAX_ROUTE_ENTRIES(mport->sys_size)); | ||
444 | 445 | ||
445 | /* Set up private area */ | 446 | /* Set up private area */ |
446 | rnet = netdev_priv(ndev); | 447 | rnet = netdev_priv(ndev); |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 5ee032cafade..42b5151aa78a 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -355,7 +355,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
355 | u32 packet_len; | 355 | u32 packet_len; |
356 | u32 padbytes = 0xffff0000; | 356 | u32 padbytes = 0xffff0000; |
357 | 357 | ||
358 | padlen = ((skb->len + 4) % 512) ? 0 : 4; | 358 | padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4; |
359 | 359 | ||
360 | if ((!skb_cloned(skb)) && | 360 | if ((!skb_cloned(skb)) && |
361 | ((headroom + tailroom) >= (4 + padlen))) { | 361 | ((headroom + tailroom) >= (4 + padlen))) { |
@@ -377,7 +377,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
377 | cpu_to_le32s(&packet_len); | 377 | cpu_to_le32s(&packet_len); |
378 | skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len)); | 378 | skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len)); |
379 | 379 | ||
380 | if ((skb->len % 512) == 0) { | 380 | if (padlen) { |
381 | cpu_to_le32s(&padbytes); | 381 | cpu_to_le32s(&padbytes); |
382 | memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes)); | 382 | memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes)); |
383 | skb_put(skb, sizeof(padbytes)); | 383 | skb_put(skb, sizeof(padbytes)); |
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 3886b30ed373..3e41b00c6806 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -165,13 +165,13 @@ static void rx_complete(struct urb *req) | |||
165 | memcpy(skb_put(skb, 1), page_address(page), 1); | 165 | memcpy(skb_put(skb, 1), page_address(page), 1); |
166 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, | 166 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, |
167 | page, 1, req->actual_length, | 167 | page, 1, req->actual_length, |
168 | req->actual_length); | 168 | PAGE_SIZE); |
169 | page = NULL; | 169 | page = NULL; |
170 | } | 170 | } |
171 | } else { | 171 | } else { |
172 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, | 172 | skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, |
173 | page, 0, req->actual_length, | 173 | page, 0, req->actual_length, |
174 | req->actual_length); | 174 | PAGE_SIZE); |
175 | page = NULL; | 175 | page = NULL; |
176 | } | 176 | } |
177 | if (req->actual_length < PAGE_SIZE) | 177 | if (req->actual_length < PAGE_SIZE) |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 439690be519f..685a4e22c768 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf) | |||
93 | /* no jumbogram (16K) support for now */ | 93 | /* no jumbogram (16K) support for now */ |
94 | 94 | ||
95 | dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; | 95 | dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; |
96 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | ||
96 | 97 | ||
97 | return 0; | 98 | return 0; |
98 | } | 99 | } |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 552d24bf862e..d316503b35d4 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -365,6 +365,27 @@ static const struct driver_info qmi_wwan_force_int4 = { | |||
365 | .data = BIT(4), /* interface whitelist bitmap */ | 365 | .data = BIT(4), /* interface whitelist bitmap */ |
366 | }; | 366 | }; |
367 | 367 | ||
368 | /* Sierra Wireless provide equally useless interface descriptors | ||
369 | * Devices in QMI mode can be switched between two different | ||
370 | * configurations: | ||
371 | * a) USB interface #8 is QMI/wwan | ||
372 | * b) USB interfaces #8, #19 and #20 are QMI/wwan | ||
373 | * | ||
374 | * Both configurations provide a number of other interfaces (serial++), | ||
375 | * some of which have the same endpoint configuration as we expect, so | ||
376 | * a whitelist or blacklist is necessary. | ||
377 | * | ||
378 | * FIXME: The below whitelist should include BIT(20). It does not | ||
379 | * because I cannot get it to work... | ||
380 | */ | ||
381 | static const struct driver_info qmi_wwan_sierra = { | ||
382 | .description = "Sierra Wireless wwan/QMI device", | ||
383 | .flags = FLAG_WWAN, | ||
384 | .bind = qmi_wwan_bind_gobi, | ||
385 | .unbind = qmi_wwan_unbind_shared, | ||
386 | .manage_power = qmi_wwan_manage_power, | ||
387 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | ||
388 | }; | ||
368 | 389 | ||
369 | #define HUAWEI_VENDOR_ID 0x12D1 | 390 | #define HUAWEI_VENDOR_ID 0x12D1 |
370 | #define QMI_GOBI_DEVICE(vend, prod) \ | 391 | #define QMI_GOBI_DEVICE(vend, prod) \ |
@@ -445,6 +466,15 @@ static const struct usb_device_id products[] = { | |||
445 | .bInterfaceProtocol = 0xff, | 466 | .bInterfaceProtocol = 0xff, |
446 | .driver_info = (unsigned long)&qmi_wwan_force_int4, | 467 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
447 | }, | 468 | }, |
469 | { /* Sierra Wireless MC77xx in QMI mode */ | ||
470 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | ||
471 | .idVendor = 0x1199, | ||
472 | .idProduct = 0x68a2, | ||
473 | .bInterfaceClass = 0xff, | ||
474 | .bInterfaceSubClass = 0xff, | ||
475 | .bInterfaceProtocol = 0xff, | ||
476 | .driver_info = (unsigned long)&qmi_wwan_sierra, | ||
477 | }, | ||
448 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 478 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
449 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 479 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
450 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 480 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 6dda2fe5b15b..d363b31053da 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -85,32 +85,6 @@ | |||
85 | #define INT_CRERR_CNT 0x06 | 85 | #define INT_CRERR_CNT 0x06 |
86 | #define INT_COL_CNT 0x07 | 86 | #define INT_COL_CNT 0x07 |
87 | 87 | ||
88 | /* Transmit status register errors */ | ||
89 | #define TSR_ECOL (1<<5) | ||
90 | #define TSR_LCOL (1<<4) | ||
91 | #define TSR_LOSS_CRS (1<<3) | ||
92 | #define TSR_JBR (1<<2) | ||
93 | #define TSR_ERRORS (TSR_ECOL | TSR_LCOL | TSR_LOSS_CRS | TSR_JBR) | ||
94 | /* Receive status register errors */ | ||
95 | #define RSR_CRC (1<<2) | ||
96 | #define RSR_FAE (1<<1) | ||
97 | #define RSR_ERRORS (RSR_CRC | RSR_FAE) | ||
98 | |||
99 | /* Media status register definitions */ | ||
100 | #define MSR_DUPLEX (1<<4) | ||
101 | #define MSR_SPEED (1<<3) | ||
102 | #define MSR_LINK (1<<2) | ||
103 | |||
104 | /* Interrupt pipe data */ | ||
105 | #define INT_TSR 0x00 | ||
106 | #define INT_RSR 0x01 | ||
107 | #define INT_MSR 0x02 | ||
108 | #define INT_WAKSR 0x03 | ||
109 | #define INT_TXOK_CNT 0x04 | ||
110 | #define INT_RXLOST_CNT 0x05 | ||
111 | #define INT_CRERR_CNT 0x06 | ||
112 | #define INT_COL_CNT 0x07 | ||
113 | |||
114 | 88 | ||
115 | #define RTL8150_MTU 1540 | 89 | #define RTL8150_MTU 1540 |
116 | #define RTL8150_TX_TIMEOUT (HZ) | 90 | #define RTL8150_TX_TIMEOUT (HZ) |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 187d01ccb973..00103a8c5e04 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index, | |||
98 | 98 | ||
99 | if (unlikely(ret < 0)) | 99 | if (unlikely(ret < 0)) |
100 | netdev_warn(dev->net, | 100 | netdev_warn(dev->net, |
101 | "Failed to read register index 0x%08x", index); | 101 | "Failed to read reg index 0x%08x: %d", index, ret); |
102 | 102 | ||
103 | le32_to_cpus(buf); | 103 | le32_to_cpus(buf); |
104 | *data = *buf; | 104 | *data = *buf; |
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index, | |||
128 | 128 | ||
129 | if (unlikely(ret < 0)) | 129 | if (unlikely(ret < 0)) |
130 | netdev_warn(dev->net, | 130 | netdev_warn(dev->net, |
131 | "Failed to write register index 0x%08x", index); | 131 | "Failed to write reg index 0x%08x: %d", index, ret); |
132 | 132 | ||
133 | kfree(buf); | 133 | kfree(buf); |
134 | 134 | ||
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx) | |||
171 | idx &= dev->mii.reg_num_mask; | 171 | idx &= dev->mii.reg_num_mask; |
172 | addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) | 172 | addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) |
173 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) | 173 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) |
174 | | MII_ACCESS_READ; | 174 | | MII_ACCESS_READ | MII_ACCESS_BUSY; |
175 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); | 175 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); |
176 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); | 176 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); |
177 | 177 | ||
@@ -210,7 +210,7 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx, | |||
210 | idx &= dev->mii.reg_num_mask; | 210 | idx &= dev->mii.reg_num_mask; |
211 | addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) | 211 | addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) |
212 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) | 212 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) |
213 | | MII_ACCESS_WRITE; | 213 | | MII_ACCESS_WRITE | MII_ACCESS_BUSY; |
214 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); | 214 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); |
215 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); | 215 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); |
216 | 216 | ||
@@ -508,9 +508,10 @@ static int smsc75xx_link_reset(struct usbnet *dev) | |||
508 | u16 lcladv, rmtadv; | 508 | u16 lcladv, rmtadv; |
509 | int ret; | 509 | int ret; |
510 | 510 | ||
511 | /* clear interrupt status */ | 511 | /* read and write to clear phy interrupt status */ |
512 | ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); | 512 | ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); |
513 | check_warn_return(ret, "Error reading PHY_INT_SRC"); | 513 | check_warn_return(ret, "Error reading PHY_INT_SRC"); |
514 | smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff); | ||
514 | 515 | ||
515 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); | 516 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); |
516 | check_warn_return(ret, "Error writing INT_STS"); | 517 | check_warn_return(ret, "Error writing INT_STS"); |
@@ -643,7 +644,7 @@ static int smsc75xx_set_mac_address(struct usbnet *dev) | |||
643 | 644 | ||
644 | static int smsc75xx_phy_initialize(struct usbnet *dev) | 645 | static int smsc75xx_phy_initialize(struct usbnet *dev) |
645 | { | 646 | { |
646 | int bmcr, timeout = 0; | 647 | int bmcr, ret, timeout = 0; |
647 | 648 | ||
648 | /* Initialize MII structure */ | 649 | /* Initialize MII structure */ |
649 | dev->mii.dev = dev->net; | 650 | dev->mii.dev = dev->net; |
@@ -651,6 +652,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) | |||
651 | dev->mii.mdio_write = smsc75xx_mdio_write; | 652 | dev->mii.mdio_write = smsc75xx_mdio_write; |
652 | dev->mii.phy_id_mask = 0x1f; | 653 | dev->mii.phy_id_mask = 0x1f; |
653 | dev->mii.reg_num_mask = 0x1f; | 654 | dev->mii.reg_num_mask = 0x1f; |
655 | dev->mii.supports_gmii = 1; | ||
654 | dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID; | 656 | dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID; |
655 | 657 | ||
656 | /* reset phy and wait for reset to complete */ | 658 | /* reset phy and wait for reset to complete */ |
@@ -661,7 +663,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) | |||
661 | bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); | 663 | bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); |
662 | check_warn_return(bmcr, "Error reading MII_BMCR"); | 664 | check_warn_return(bmcr, "Error reading MII_BMCR"); |
663 | timeout++; | 665 | timeout++; |
664 | } while ((bmcr & MII_BMCR) && (timeout < 100)); | 666 | } while ((bmcr & BMCR_RESET) && (timeout < 100)); |
665 | 667 | ||
666 | if (timeout >= 100) { | 668 | if (timeout >= 100) { |
667 | netdev_warn(dev->net, "timeout on PHY Reset"); | 669 | netdev_warn(dev->net, "timeout on PHY Reset"); |
@@ -671,10 +673,13 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) | |||
671 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, | 673 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, |
672 | ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | | 674 | ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | |
673 | ADVERTISE_PAUSE_ASYM); | 675 | ADVERTISE_PAUSE_ASYM); |
676 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000, | ||
677 | ADVERTISE_1000FULL); | ||
674 | 678 | ||
675 | /* read to clear */ | 679 | /* read and write to clear phy interrupt status */ |
676 | smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); | 680 | ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); |
677 | check_warn_return(bmcr, "Error reading PHY_INT_SRC"); | 681 | check_warn_return(ret, "Error reading PHY_INT_SRC"); |
682 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff); | ||
678 | 683 | ||
679 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, | 684 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, |
680 | PHY_INT_MASK_DEFAULT); | 685 | PHY_INT_MASK_DEFAULT); |
@@ -946,6 +951,14 @@ static int smsc75xx_reset(struct usbnet *dev) | |||
946 | ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); | 951 | ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); |
947 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret); | 952 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret); |
948 | 953 | ||
954 | /* allow mac to detect speed and duplex from phy */ | ||
955 | ret = smsc75xx_read_reg(dev, MAC_CR, &buf); | ||
956 | check_warn_return(ret, "Failed to read MAC_CR: %d", ret); | ||
957 | |||
958 | buf |= (MAC_CR_ADD | MAC_CR_ASD); | ||
959 | ret = smsc75xx_write_reg(dev, MAC_CR, buf); | ||
960 | check_warn_return(ret, "Failed to write MAC_CR: %d", ret); | ||
961 | |||
949 | ret = smsc75xx_read_reg(dev, MAC_TX, &buf); | 962 | ret = smsc75xx_read_reg(dev, MAC_TX, &buf); |
950 | check_warn_return(ret, "Failed to read MAC_TX: %d", ret); | 963 | check_warn_return(ret, "Failed to read MAC_TX: %d", ret); |
951 | 964 | ||
@@ -1051,6 +1064,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1051 | dev->net->ethtool_ops = &smsc75xx_ethtool_ops; | 1064 | dev->net->ethtool_ops = &smsc75xx_ethtool_ops; |
1052 | dev->net->flags |= IFF_MULTICAST; | 1065 | dev->net->flags |= IFF_MULTICAST; |
1053 | dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD; | 1066 | dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD; |
1067 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | ||
1054 | return 0; | 1068 | return 0; |
1055 | } | 1069 | } |
1056 | 1070 | ||
@@ -1211,7 +1225,7 @@ static const struct driver_info smsc75xx_info = { | |||
1211 | .rx_fixup = smsc75xx_rx_fixup, | 1225 | .rx_fixup = smsc75xx_rx_fixup, |
1212 | .tx_fixup = smsc75xx_tx_fixup, | 1226 | .tx_fixup = smsc75xx_tx_fixup, |
1213 | .status = smsc75xx_status, | 1227 | .status = smsc75xx_status, |
1214 | .flags = FLAG_ETHER | FLAG_SEND_ZLP, | 1228 | .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR, |
1215 | }; | 1229 | }; |
1216 | 1230 | ||
1217 | static const struct usb_device_id products[] = { | 1231 | static const struct usb_device_id products[] = { |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 5f19f84d3494..94ae66999f59 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1017,6 +1017,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1017 | dev->net->ethtool_ops = &smsc95xx_ethtool_ops; | 1017 | dev->net->ethtool_ops = &smsc95xx_ethtool_ops; |
1018 | dev->net->flags |= IFF_MULTICAST; | 1018 | dev->net->flags |= IFF_MULTICAST; |
1019 | dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; | 1019 | dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; |
1020 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | ||
1020 | return 0; | 1021 | return 0; |
1021 | } | 1022 | } |
1022 | 1023 | ||
@@ -1191,7 +1192,7 @@ static const struct driver_info smsc95xx_info = { | |||
1191 | .rx_fixup = smsc95xx_rx_fixup, | 1192 | .rx_fixup = smsc95xx_rx_fixup, |
1192 | .tx_fixup = smsc95xx_tx_fixup, | 1193 | .tx_fixup = smsc95xx_tx_fixup, |
1193 | .status = smsc95xx_status, | 1194 | .status = smsc95xx_status, |
1194 | .flags = FLAG_ETHER | FLAG_SEND_ZLP, | 1195 | .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR, |
1195 | }; | 1196 | }; |
1196 | 1197 | ||
1197 | static const struct usb_device_id products[] = { | 1198 | static const struct usb_device_id products[] = { |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index b7b3f5b0d406..2d927fb4adf4 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -210,6 +210,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf) | |||
210 | } else { | 210 | } else { |
211 | usb_fill_int_urb(dev->interrupt, dev->udev, pipe, | 211 | usb_fill_int_urb(dev->interrupt, dev->udev, pipe, |
212 | buf, maxp, intr_complete, dev, period); | 212 | buf, maxp, intr_complete, dev, period); |
213 | dev->interrupt->transfer_flags |= URB_FREE_BUFFER; | ||
213 | dev_dbg(&intf->dev, | 214 | dev_dbg(&intf->dev, |
214 | "status ep%din, %d bytes period %d\n", | 215 | "status ep%din, %d bytes period %d\n", |
215 | usb_pipeendpoint(pipe), maxp, period); | 216 | usb_pipeendpoint(pipe), maxp, period); |
@@ -1443,7 +1444,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1443 | 1444 | ||
1444 | status = register_netdev (net); | 1445 | status = register_netdev (net); |
1445 | if (status) | 1446 | if (status) |
1446 | goto out3; | 1447 | goto out4; |
1447 | netif_info(dev, probe, dev->net, | 1448 | netif_info(dev, probe, dev->net, |
1448 | "register '%s' at usb-%s-%s, %s, %pM\n", | 1449 | "register '%s' at usb-%s-%s, %s, %pM\n", |
1449 | udev->dev.driver->name, | 1450 | udev->dev.driver->name, |
@@ -1461,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1461 | 1462 | ||
1462 | return 0; | 1463 | return 0; |
1463 | 1464 | ||
1465 | out4: | ||
1466 | usb_free_urb(dev->interrupt); | ||
1464 | out3: | 1467 | out3: |
1465 | if (info->unbind) | 1468 | if (info->unbind) |
1466 | info->unbind (dev, udev); | 1469 | info->unbind (dev, udev); |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index c3197ce0e2ad..34db195fb8b0 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -337,6 +337,11 @@ static const struct usb_device_id products [] = { | |||
337 | .driver_info = ZAURUS_PXA_INFO, | 337 | .driver_info = ZAURUS_PXA_INFO, |
338 | }, | 338 | }, |
339 | { | 339 | { |
340 | /* Motorola Rokr E6 */ | ||
341 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6027, USB_CLASS_COMM, | ||
342 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
343 | .driver_info = (unsigned long) &bogus_mdlm_info, | ||
344 | }, { | ||
340 | /* Motorola MOTOMAGX phones */ | 345 | /* Motorola MOTOMAGX phones */ |
341 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, | 346 | USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, |
342 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 347 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 019da012669f..af8acc85f4bb 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -625,16 +625,16 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
625 | 625 | ||
626 | /* This can happen with OOM and indirect buffers. */ | 626 | /* This can happen with OOM and indirect buffers. */ |
627 | if (unlikely(capacity < 0)) { | 627 | if (unlikely(capacity < 0)) { |
628 | if (net_ratelimit()) { | 628 | if (likely(capacity == -ENOMEM)) { |
629 | if (likely(capacity == -ENOMEM)) { | 629 | if (net_ratelimit()) |
630 | dev_warn(&dev->dev, | 630 | dev_warn(&dev->dev, |
631 | "TX queue failure: out of memory\n"); | 631 | "TX queue failure: out of memory\n"); |
632 | } else { | 632 | } else { |
633 | dev->stats.tx_fifo_errors++; | 633 | dev->stats.tx_fifo_errors++; |
634 | if (net_ratelimit()) | ||
634 | dev_warn(&dev->dev, | 635 | dev_warn(&dev->dev, |
635 | "Unexpected TX queue failure: %d\n", | 636 | "Unexpected TX queue failure: %d\n", |
636 | capacity); | 637 | capacity); |
637 | } | ||
638 | } | 638 | } |
639 | dev->stats.tx_dropped++; | 639 | dev->stats.tx_dropped++; |
640 | kfree_skb(skb); | 640 | kfree_skb(skb); |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index ebb9f24eefb5..1a623183cbe5 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -2483,6 +2483,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2483 | pr_err("Control memory remap failed\n"); | 2483 | pr_err("Control memory remap failed\n"); |
2484 | pci_release_regions(pdev); | 2484 | pci_release_regions(pdev); |
2485 | pci_disable_device(pdev); | 2485 | pci_disable_device(pdev); |
2486 | iounmap(card->mem); | ||
2486 | kfree(card); | 2487 | kfree(card); |
2487 | return -ENODEV; | 2488 | return -ENODEV; |
2488 | } | 2489 | } |
diff --git a/drivers/net/wimax/i2400m/debugfs.c b/drivers/net/wimax/i2400m/debugfs.c index 129ba36bd04d..4b66ab1d0e5c 100644 --- a/drivers/net/wimax/i2400m/debugfs.c +++ b/drivers/net/wimax/i2400m/debugfs.c | |||
@@ -53,17 +53,6 @@ struct dentry *debugfs_create_netdev_queue_stopped( | |||
53 | &fops_netdev_queue_stopped); | 53 | &fops_netdev_queue_stopped); |
54 | } | 54 | } |
55 | 55 | ||
56 | |||
57 | /* | ||
58 | * inode->i_private has the @data argument to debugfs_create_file() | ||
59 | */ | ||
60 | static | ||
61 | int i2400m_stats_open(struct inode *inode, struct file *filp) | ||
62 | { | ||
63 | filp->private_data = inode->i_private; | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | /* | 56 | /* |
68 | * We don't allow partial reads of this file, as then the reader would | 57 | * We don't allow partial reads of this file, as then the reader would |
69 | * get weirdly confused data as it is updated. | 58 | * get weirdly confused data as it is updated. |
@@ -117,7 +106,7 @@ ssize_t i2400m_rx_stats_write(struct file *filp, const char __user *buffer, | |||
117 | static | 106 | static |
118 | const struct file_operations i2400m_rx_stats_fops = { | 107 | const struct file_operations i2400m_rx_stats_fops = { |
119 | .owner = THIS_MODULE, | 108 | .owner = THIS_MODULE, |
120 | .open = i2400m_stats_open, | 109 | .open = simple_open, |
121 | .read = i2400m_rx_stats_read, | 110 | .read = i2400m_rx_stats_read, |
122 | .write = i2400m_rx_stats_write, | 111 | .write = i2400m_rx_stats_write, |
123 | .llseek = default_llseek, | 112 | .llseek = default_llseek, |
@@ -170,7 +159,7 @@ ssize_t i2400m_tx_stats_write(struct file *filp, const char __user *buffer, | |||
170 | static | 159 | static |
171 | const struct file_operations i2400m_tx_stats_fops = { | 160 | const struct file_operations i2400m_tx_stats_fops = { |
172 | .owner = THIS_MODULE, | 161 | .owner = THIS_MODULE, |
173 | .open = i2400m_stats_open, | 162 | .open = simple_open, |
174 | .read = i2400m_tx_stats_read, | 163 | .read = i2400m_tx_stats_read, |
175 | .write = i2400m_tx_stats_write, | 164 | .write = i2400m_tx_stats_write, |
176 | .llseek = default_llseek, | 165 | .llseek = default_llseek, |
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index 63e4b709efa9..1d76ae855f07 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -597,7 +597,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev, | |||
597 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | 597 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); |
598 | 598 | ||
599 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); | 599 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); |
600 | strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1); | 600 | strncpy(info->fw_version, |
601 | i2400m->fw_name ? : "", sizeof(info->fw_version) - 1); | ||
601 | if (net_dev->dev.parent) | 602 | if (net_dev->dev.parent) |
602 | strncpy(info->bus_info, dev_name(net_dev->dev.parent), | 603 | strncpy(info->bus_info, dev_name(net_dev->dev.parent), |
603 | sizeof(info->bus_info) - 1); | 604 | sizeof(info->bus_info) - 1); |
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index 2c1b8b687646..29b1e033a10b 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -339,6 +339,23 @@ int i2400mu_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt) | |||
339 | return result; | 339 | return result; |
340 | } | 340 | } |
341 | 341 | ||
342 | static void i2400mu_get_drvinfo(struct net_device *net_dev, | ||
343 | struct ethtool_drvinfo *info) | ||
344 | { | ||
345 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | ||
346 | struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m); | ||
347 | struct usb_device *udev = i2400mu->usb_dev; | ||
348 | |||
349 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); | ||
350 | strncpy(info->fw_version, | ||
351 | i2400m->fw_name ? : "", sizeof(info->fw_version) - 1); | ||
352 | usb_make_path(udev, info->bus_info, sizeof(info->bus_info)); | ||
353 | } | ||
354 | |||
355 | static const struct ethtool_ops i2400mu_ethtool_ops = { | ||
356 | .get_drvinfo = i2400mu_get_drvinfo, | ||
357 | .get_link = ethtool_op_get_link, | ||
358 | }; | ||
342 | 359 | ||
343 | static | 360 | static |
344 | void i2400mu_netdev_setup(struct net_device *net_dev) | 361 | void i2400mu_netdev_setup(struct net_device *net_dev) |
@@ -347,6 +364,7 @@ void i2400mu_netdev_setup(struct net_device *net_dev) | |||
347 | struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m); | 364 | struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m); |
348 | i2400mu_init(i2400mu); | 365 | i2400mu_init(i2400mu); |
349 | i2400m_netdev_setup(net_dev); | 366 | i2400m_netdev_setup(net_dev); |
367 | net_dev->ethtool_ops = &i2400mu_ethtool_ops; | ||
350 | } | 368 | } |
351 | 369 | ||
352 | 370 | ||
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index 8faa129da5a0..aec33cc207fd 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/nl80211.h> | 19 | #include <linux/nl80211.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/etherdevice.h> | 21 | #include <linux/etherdevice.h> |
22 | #include <linux/export.h> | ||
22 | #include <ar231x_platform.h> | 23 | #include <ar231x_platform.h> |
23 | #include "ath5k.h" | 24 | #include "ath5k.h" |
24 | #include "debug.h" | 25 | #include "debug.h" |
@@ -119,7 +120,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
119 | if (res == NULL) { | 120 | if (res == NULL) { |
120 | dev_err(&pdev->dev, "no IRQ resource found\n"); | 121 | dev_err(&pdev->dev, "no IRQ resource found\n"); |
121 | ret = -ENXIO; | 122 | ret = -ENXIO; |
122 | goto err_out; | 123 | goto err_iounmap; |
123 | } | 124 | } |
124 | 125 | ||
125 | irq = res->start; | 126 | irq = res->start; |
@@ -128,7 +129,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
128 | if (hw == NULL) { | 129 | if (hw == NULL) { |
129 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); | 130 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); |
130 | ret = -ENOMEM; | 131 | ret = -ENOMEM; |
131 | goto err_out; | 132 | goto err_iounmap; |
132 | } | 133 | } |
133 | 134 | ||
134 | ah = hw->priv; | 135 | ah = hw->priv; |
@@ -185,6 +186,8 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
185 | err_free_hw: | 186 | err_free_hw: |
186 | ieee80211_free_hw(hw); | 187 | ieee80211_free_hw(hw); |
187 | platform_set_drvdata(pdev, NULL); | 188 | platform_set_drvdata(pdev, NULL); |
189 | err_iounmap: | ||
190 | iounmap(mem); | ||
188 | err_out: | 191 | err_out: |
189 | return ret; | 192 | return ret; |
190 | } | 193 | } |
@@ -217,6 +220,7 @@ static int ath_ahb_remove(struct platform_device *pdev) | |||
217 | } | 220 | } |
218 | 221 | ||
219 | ath5k_deinit_ah(ah); | 222 | ath5k_deinit_ah(ah); |
223 | iounmap(ah->iobase); | ||
220 | platform_set_drvdata(pdev, NULL); | 224 | platform_set_drvdata(pdev, NULL); |
221 | ieee80211_free_hw(hw); | 225 | ieee80211_free_hw(hw); |
222 | 226 | ||
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 8c5ce8b0c734..e5e8f45d86ac 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c | |||
@@ -71,13 +71,6 @@ static unsigned int ath5k_debug; | |||
71 | module_param_named(debug, ath5k_debug, uint, 0); | 71 | module_param_named(debug, ath5k_debug, uint, 0); |
72 | 72 | ||
73 | 73 | ||
74 | static int ath5k_debugfs_open(struct inode *inode, struct file *file) | ||
75 | { | ||
76 | file->private_data = inode->i_private; | ||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | |||
81 | /* debugfs: registers */ | 74 | /* debugfs: registers */ |
82 | 75 | ||
83 | struct reg { | 76 | struct reg { |
@@ -265,7 +258,7 @@ static ssize_t write_file_beacon(struct file *file, | |||
265 | static const struct file_operations fops_beacon = { | 258 | static const struct file_operations fops_beacon = { |
266 | .read = read_file_beacon, | 259 | .read = read_file_beacon, |
267 | .write = write_file_beacon, | 260 | .write = write_file_beacon, |
268 | .open = ath5k_debugfs_open, | 261 | .open = simple_open, |
269 | .owner = THIS_MODULE, | 262 | .owner = THIS_MODULE, |
270 | .llseek = default_llseek, | 263 | .llseek = default_llseek, |
271 | }; | 264 | }; |
@@ -285,7 +278,7 @@ static ssize_t write_file_reset(struct file *file, | |||
285 | 278 | ||
286 | static const struct file_operations fops_reset = { | 279 | static const struct file_operations fops_reset = { |
287 | .write = write_file_reset, | 280 | .write = write_file_reset, |
288 | .open = ath5k_debugfs_open, | 281 | .open = simple_open, |
289 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
290 | .llseek = noop_llseek, | 283 | .llseek = noop_llseek, |
291 | }; | 284 | }; |
@@ -365,7 +358,7 @@ static ssize_t write_file_debug(struct file *file, | |||
365 | static const struct file_operations fops_debug = { | 358 | static const struct file_operations fops_debug = { |
366 | .read = read_file_debug, | 359 | .read = read_file_debug, |
367 | .write = write_file_debug, | 360 | .write = write_file_debug, |
368 | .open = ath5k_debugfs_open, | 361 | .open = simple_open, |
369 | .owner = THIS_MODULE, | 362 | .owner = THIS_MODULE, |
370 | .llseek = default_llseek, | 363 | .llseek = default_llseek, |
371 | }; | 364 | }; |
@@ -477,7 +470,7 @@ static ssize_t write_file_antenna(struct file *file, | |||
477 | static const struct file_operations fops_antenna = { | 470 | static const struct file_operations fops_antenna = { |
478 | .read = read_file_antenna, | 471 | .read = read_file_antenna, |
479 | .write = write_file_antenna, | 472 | .write = write_file_antenna, |
480 | .open = ath5k_debugfs_open, | 473 | .open = simple_open, |
481 | .owner = THIS_MODULE, | 474 | .owner = THIS_MODULE, |
482 | .llseek = default_llseek, | 475 | .llseek = default_llseek, |
483 | }; | 476 | }; |
@@ -532,7 +525,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, | |||
532 | 525 | ||
533 | static const struct file_operations fops_misc = { | 526 | static const struct file_operations fops_misc = { |
534 | .read = read_file_misc, | 527 | .read = read_file_misc, |
535 | .open = ath5k_debugfs_open, | 528 | .open = simple_open, |
536 | .owner = THIS_MODULE, | 529 | .owner = THIS_MODULE, |
537 | }; | 530 | }; |
538 | 531 | ||
@@ -647,7 +640,7 @@ static ssize_t write_file_frameerrors(struct file *file, | |||
647 | static const struct file_operations fops_frameerrors = { | 640 | static const struct file_operations fops_frameerrors = { |
648 | .read = read_file_frameerrors, | 641 | .read = read_file_frameerrors, |
649 | .write = write_file_frameerrors, | 642 | .write = write_file_frameerrors, |
650 | .open = ath5k_debugfs_open, | 643 | .open = simple_open, |
651 | .owner = THIS_MODULE, | 644 | .owner = THIS_MODULE, |
652 | .llseek = default_llseek, | 645 | .llseek = default_llseek, |
653 | }; | 646 | }; |
@@ -810,7 +803,7 @@ static ssize_t write_file_ani(struct file *file, | |||
810 | static const struct file_operations fops_ani = { | 803 | static const struct file_operations fops_ani = { |
811 | .read = read_file_ani, | 804 | .read = read_file_ani, |
812 | .write = write_file_ani, | 805 | .write = write_file_ani, |
813 | .open = ath5k_debugfs_open, | 806 | .open = simple_open, |
814 | .owner = THIS_MODULE, | 807 | .owner = THIS_MODULE, |
815 | .llseek = default_llseek, | 808 | .llseek = default_llseek, |
816 | }; | 809 | }; |
@@ -881,7 +874,7 @@ static ssize_t write_file_queue(struct file *file, | |||
881 | static const struct file_operations fops_queue = { | 874 | static const struct file_operations fops_queue = { |
882 | .read = read_file_queue, | 875 | .read = read_file_queue, |
883 | .write = write_file_queue, | 876 | .write = write_file_queue, |
884 | .open = ath5k_debugfs_open, | 877 | .open = simple_open, |
885 | .owner = THIS_MODULE, | 878 | .owner = THIS_MODULE, |
886 | .llseek = default_llseek, | 879 | .llseek = default_llseek, |
887 | }; | 880 | }; |
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 552adb3f80d0..d01403a263ff 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c | |||
@@ -217,12 +217,6 @@ void dump_cred_dist_stats(struct htc_target *target) | |||
217 | target->credit_info->cur_free_credits); | 217 | target->credit_info->cur_free_credits); |
218 | } | 218 | } |
219 | 219 | ||
220 | static int ath6kl_debugfs_open(struct inode *inode, struct file *file) | ||
221 | { | ||
222 | file->private_data = inode->i_private; | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war) | 220 | void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war) |
227 | { | 221 | { |
228 | switch (war) { | 222 | switch (war) { |
@@ -263,7 +257,7 @@ static ssize_t read_file_war_stats(struct file *file, char __user *user_buf, | |||
263 | 257 | ||
264 | static const struct file_operations fops_war_stats = { | 258 | static const struct file_operations fops_war_stats = { |
265 | .read = read_file_war_stats, | 259 | .read = read_file_war_stats, |
266 | .open = ath6kl_debugfs_open, | 260 | .open = simple_open, |
267 | .owner = THIS_MODULE, | 261 | .owner = THIS_MODULE, |
268 | .llseek = default_llseek, | 262 | .llseek = default_llseek, |
269 | }; | 263 | }; |
@@ -488,7 +482,7 @@ static ssize_t ath6kl_fwlog_mask_write(struct file *file, | |||
488 | } | 482 | } |
489 | 483 | ||
490 | static const struct file_operations fops_fwlog_mask = { | 484 | static const struct file_operations fops_fwlog_mask = { |
491 | .open = ath6kl_debugfs_open, | 485 | .open = simple_open, |
492 | .read = ath6kl_fwlog_mask_read, | 486 | .read = ath6kl_fwlog_mask_read, |
493 | .write = ath6kl_fwlog_mask_write, | 487 | .write = ath6kl_fwlog_mask_write, |
494 | .owner = THIS_MODULE, | 488 | .owner = THIS_MODULE, |
@@ -634,7 +628,7 @@ static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf, | |||
634 | 628 | ||
635 | static const struct file_operations fops_tgt_stats = { | 629 | static const struct file_operations fops_tgt_stats = { |
636 | .read = read_file_tgt_stats, | 630 | .read = read_file_tgt_stats, |
637 | .open = ath6kl_debugfs_open, | 631 | .open = simple_open, |
638 | .owner = THIS_MODULE, | 632 | .owner = THIS_MODULE, |
639 | .llseek = default_llseek, | 633 | .llseek = default_llseek, |
640 | }; | 634 | }; |
@@ -699,7 +693,7 @@ static ssize_t read_file_credit_dist_stats(struct file *file, | |||
699 | 693 | ||
700 | static const struct file_operations fops_credit_dist_stats = { | 694 | static const struct file_operations fops_credit_dist_stats = { |
701 | .read = read_file_credit_dist_stats, | 695 | .read = read_file_credit_dist_stats, |
702 | .open = ath6kl_debugfs_open, | 696 | .open = simple_open, |
703 | .owner = THIS_MODULE, | 697 | .owner = THIS_MODULE, |
704 | .llseek = default_llseek, | 698 | .llseek = default_llseek, |
705 | }; | 699 | }; |
@@ -802,7 +796,7 @@ static ssize_t ath6kl_endpoint_stats_write(struct file *file, | |||
802 | } | 796 | } |
803 | 797 | ||
804 | static const struct file_operations fops_endpoint_stats = { | 798 | static const struct file_operations fops_endpoint_stats = { |
805 | .open = ath6kl_debugfs_open, | 799 | .open = simple_open, |
806 | .read = ath6kl_endpoint_stats_read, | 800 | .read = ath6kl_endpoint_stats_read, |
807 | .write = ath6kl_endpoint_stats_write, | 801 | .write = ath6kl_endpoint_stats_write, |
808 | .owner = THIS_MODULE, | 802 | .owner = THIS_MODULE, |
@@ -875,7 +869,7 @@ static ssize_t ath6kl_regread_write(struct file *file, | |||
875 | static const struct file_operations fops_diag_reg_read = { | 869 | static const struct file_operations fops_diag_reg_read = { |
876 | .read = ath6kl_regread_read, | 870 | .read = ath6kl_regread_read, |
877 | .write = ath6kl_regread_write, | 871 | .write = ath6kl_regread_write, |
878 | .open = ath6kl_debugfs_open, | 872 | .open = simple_open, |
879 | .owner = THIS_MODULE, | 873 | .owner = THIS_MODULE, |
880 | .llseek = default_llseek, | 874 | .llseek = default_llseek, |
881 | }; | 875 | }; |
@@ -999,7 +993,7 @@ static ssize_t ath6kl_lrssi_roam_read(struct file *file, | |||
999 | static const struct file_operations fops_lrssi_roam_threshold = { | 993 | static const struct file_operations fops_lrssi_roam_threshold = { |
1000 | .read = ath6kl_lrssi_roam_read, | 994 | .read = ath6kl_lrssi_roam_read, |
1001 | .write = ath6kl_lrssi_roam_write, | 995 | .write = ath6kl_lrssi_roam_write, |
1002 | .open = ath6kl_debugfs_open, | 996 | .open = simple_open, |
1003 | .owner = THIS_MODULE, | 997 | .owner = THIS_MODULE, |
1004 | .llseek = default_llseek, | 998 | .llseek = default_llseek, |
1005 | }; | 999 | }; |
@@ -1061,7 +1055,7 @@ static ssize_t ath6kl_regwrite_write(struct file *file, | |||
1061 | static const struct file_operations fops_diag_reg_write = { | 1055 | static const struct file_operations fops_diag_reg_write = { |
1062 | .read = ath6kl_regwrite_read, | 1056 | .read = ath6kl_regwrite_read, |
1063 | .write = ath6kl_regwrite_write, | 1057 | .write = ath6kl_regwrite_write, |
1064 | .open = ath6kl_debugfs_open, | 1058 | .open = simple_open, |
1065 | .owner = THIS_MODULE, | 1059 | .owner = THIS_MODULE, |
1066 | .llseek = default_llseek, | 1060 | .llseek = default_llseek, |
1067 | }; | 1061 | }; |
@@ -1166,7 +1160,7 @@ static ssize_t ath6kl_roam_table_read(struct file *file, char __user *user_buf, | |||
1166 | 1160 | ||
1167 | static const struct file_operations fops_roam_table = { | 1161 | static const struct file_operations fops_roam_table = { |
1168 | .read = ath6kl_roam_table_read, | 1162 | .read = ath6kl_roam_table_read, |
1169 | .open = ath6kl_debugfs_open, | 1163 | .open = simple_open, |
1170 | .owner = THIS_MODULE, | 1164 | .owner = THIS_MODULE, |
1171 | .llseek = default_llseek, | 1165 | .llseek = default_llseek, |
1172 | }; | 1166 | }; |
@@ -1204,7 +1198,7 @@ static ssize_t ath6kl_force_roam_write(struct file *file, | |||
1204 | 1198 | ||
1205 | static const struct file_operations fops_force_roam = { | 1199 | static const struct file_operations fops_force_roam = { |
1206 | .write = ath6kl_force_roam_write, | 1200 | .write = ath6kl_force_roam_write, |
1207 | .open = ath6kl_debugfs_open, | 1201 | .open = simple_open, |
1208 | .owner = THIS_MODULE, | 1202 | .owner = THIS_MODULE, |
1209 | .llseek = default_llseek, | 1203 | .llseek = default_llseek, |
1210 | }; | 1204 | }; |
@@ -1244,7 +1238,7 @@ static ssize_t ath6kl_roam_mode_write(struct file *file, | |||
1244 | 1238 | ||
1245 | static const struct file_operations fops_roam_mode = { | 1239 | static const struct file_operations fops_roam_mode = { |
1246 | .write = ath6kl_roam_mode_write, | 1240 | .write = ath6kl_roam_mode_write, |
1247 | .open = ath6kl_debugfs_open, | 1241 | .open = simple_open, |
1248 | .owner = THIS_MODULE, | 1242 | .owner = THIS_MODULE, |
1249 | .llseek = default_llseek, | 1243 | .llseek = default_llseek, |
1250 | }; | 1244 | }; |
@@ -1286,7 +1280,7 @@ static ssize_t ath6kl_keepalive_write(struct file *file, | |||
1286 | } | 1280 | } |
1287 | 1281 | ||
1288 | static const struct file_operations fops_keepalive = { | 1282 | static const struct file_operations fops_keepalive = { |
1289 | .open = ath6kl_debugfs_open, | 1283 | .open = simple_open, |
1290 | .read = ath6kl_keepalive_read, | 1284 | .read = ath6kl_keepalive_read, |
1291 | .write = ath6kl_keepalive_write, | 1285 | .write = ath6kl_keepalive_write, |
1292 | .owner = THIS_MODULE, | 1286 | .owner = THIS_MODULE, |
@@ -1331,7 +1325,7 @@ static ssize_t ath6kl_disconnect_timeout_write(struct file *file, | |||
1331 | } | 1325 | } |
1332 | 1326 | ||
1333 | static const struct file_operations fops_disconnect_timeout = { | 1327 | static const struct file_operations fops_disconnect_timeout = { |
1334 | .open = ath6kl_debugfs_open, | 1328 | .open = simple_open, |
1335 | .read = ath6kl_disconnect_timeout_read, | 1329 | .read = ath6kl_disconnect_timeout_read, |
1336 | .write = ath6kl_disconnect_timeout_write, | 1330 | .write = ath6kl_disconnect_timeout_write, |
1337 | .owner = THIS_MODULE, | 1331 | .owner = THIS_MODULE, |
@@ -1512,7 +1506,7 @@ static ssize_t ath6kl_create_qos_write(struct file *file, | |||
1512 | 1506 | ||
1513 | static const struct file_operations fops_create_qos = { | 1507 | static const struct file_operations fops_create_qos = { |
1514 | .write = ath6kl_create_qos_write, | 1508 | .write = ath6kl_create_qos_write, |
1515 | .open = ath6kl_debugfs_open, | 1509 | .open = simple_open, |
1516 | .owner = THIS_MODULE, | 1510 | .owner = THIS_MODULE, |
1517 | .llseek = default_llseek, | 1511 | .llseek = default_llseek, |
1518 | }; | 1512 | }; |
@@ -1560,7 +1554,7 @@ static ssize_t ath6kl_delete_qos_write(struct file *file, | |||
1560 | 1554 | ||
1561 | static const struct file_operations fops_delete_qos = { | 1555 | static const struct file_operations fops_delete_qos = { |
1562 | .write = ath6kl_delete_qos_write, | 1556 | .write = ath6kl_delete_qos_write, |
1563 | .open = ath6kl_debugfs_open, | 1557 | .open = simple_open, |
1564 | .owner = THIS_MODULE, | 1558 | .owner = THIS_MODULE, |
1565 | .llseek = default_llseek, | 1559 | .llseek = default_llseek, |
1566 | }; | 1560 | }; |
@@ -1593,7 +1587,7 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file, | |||
1593 | 1587 | ||
1594 | static const struct file_operations fops_bgscan_int = { | 1588 | static const struct file_operations fops_bgscan_int = { |
1595 | .write = ath6kl_bgscan_int_write, | 1589 | .write = ath6kl_bgscan_int_write, |
1596 | .open = ath6kl_debugfs_open, | 1590 | .open = simple_open, |
1597 | .owner = THIS_MODULE, | 1591 | .owner = THIS_MODULE, |
1598 | .llseek = default_llseek, | 1592 | .llseek = default_llseek, |
1599 | }; | 1593 | }; |
@@ -1651,7 +1645,7 @@ static ssize_t ath6kl_listen_int_read(struct file *file, | |||
1651 | static const struct file_operations fops_listen_int = { | 1645 | static const struct file_operations fops_listen_int = { |
1652 | .read = ath6kl_listen_int_read, | 1646 | .read = ath6kl_listen_int_read, |
1653 | .write = ath6kl_listen_int_write, | 1647 | .write = ath6kl_listen_int_write, |
1654 | .open = ath6kl_debugfs_open, | 1648 | .open = simple_open, |
1655 | .owner = THIS_MODULE, | 1649 | .owner = THIS_MODULE, |
1656 | .llseek = default_llseek, | 1650 | .llseek = default_llseek, |
1657 | }; | 1651 | }; |
@@ -1711,7 +1705,7 @@ static ssize_t ath6kl_power_params_write(struct file *file, | |||
1711 | 1705 | ||
1712 | static const struct file_operations fops_power_params = { | 1706 | static const struct file_operations fops_power_params = { |
1713 | .write = ath6kl_power_params_write, | 1707 | .write = ath6kl_power_params_write, |
1714 | .open = ath6kl_debugfs_open, | 1708 | .open = simple_open, |
1715 | .owner = THIS_MODULE, | 1709 | .owner = THIS_MODULE, |
1716 | .llseek = default_llseek, | 1710 | .llseek = default_llseek, |
1717 | }; | 1711 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index d7d8e9199140..aba088005b22 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -869,7 +869,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, | |||
869 | ar5008_hw_set_channel_regs(ah, chan); | 869 | ar5008_hw_set_channel_regs(ah, chan); |
870 | ar5008_hw_init_chain_masks(ah); | 870 | ar5008_hw_init_chain_masks(ah); |
871 | ath9k_olc_init(ah); | 871 | ath9k_olc_init(ah); |
872 | ath9k_hw_apply_txpower(ah, chan); | 872 | ath9k_hw_apply_txpower(ah, chan, false); |
873 | 873 | ||
874 | /* Write analog registers */ | 874 | /* Write analog registers */ |
875 | if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { | 875 | if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 59647a3ceb7f..3d400e8d6535 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
@@ -54,7 +54,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) | |||
54 | 54 | ||
55 | if (val) { | 55 | if (val) { |
56 | ah->paprd_table_write_done = true; | 56 | ah->paprd_table_write_done = true; |
57 | ath9k_hw_apply_txpower(ah, chan); | 57 | ath9k_hw_apply_txpower(ah, chan, false); |
58 | } | 58 | } |
59 | 59 | ||
60 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, | 60 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index bc992b237ae5..deb6cfb2959a 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -694,7 +694,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
694 | ar9003_hw_override_ini(ah); | 694 | ar9003_hw_override_ini(ah); |
695 | ar9003_hw_set_channel_regs(ah, chan); | 695 | ar9003_hw_set_channel_regs(ah, chan); |
696 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); | 696 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); |
697 | ath9k_hw_apply_txpower(ah, chan); | 697 | ath9k_hw_apply_txpower(ah, chan, false); |
698 | 698 | ||
699 | if (AR_SREV_9462(ah)) { | 699 | if (AR_SREV_9462(ah)) { |
700 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, | 700 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, |
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c index 2f4b48e6fb03..e5cceb077574 100644 --- a/drivers/net/wireless/ath/ath9k/calib.c +++ b/drivers/net/wireless/ath/ath9k/calib.c | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | /* Common calibration code */ | 21 | /* Common calibration code */ |
22 | 22 | ||
23 | #define ATH9K_NF_TOO_HIGH -60 | ||
24 | 23 | ||
25 | static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer) | 24 | static int16_t ath9k_hw_get_nf_hist_mid(int16_t *nfCalBuffer) |
26 | { | 25 | { |
@@ -346,10 +345,10 @@ static void ath9k_hw_nf_sanitize(struct ath_hw *ah, s16 *nf) | |||
346 | "NF calibrated [%s] [chain %d] is %d\n", | 345 | "NF calibrated [%s] [chain %d] is %d\n", |
347 | (i >= 3 ? "ext" : "ctl"), i % 3, nf[i]); | 346 | (i >= 3 ? "ext" : "ctl"), i % 3, nf[i]); |
348 | 347 | ||
349 | if (nf[i] > ATH9K_NF_TOO_HIGH) { | 348 | if (nf[i] > limit->max) { |
350 | ath_dbg(common, CALIBRATE, | 349 | ath_dbg(common, CALIBRATE, |
351 | "NF[%d] (%d) > MAX (%d), correcting to MAX\n", | 350 | "NF[%d] (%d) > MAX (%d), correcting to MAX\n", |
352 | i, nf[i], ATH9K_NF_TOO_HIGH); | 351 | i, nf[i], limit->max); |
353 | nf[i] = limit->max; | 352 | nf[i] = limit->max; |
354 | } else if (nf[i] < limit->min) { | 353 | } else if (nf[i] < limit->min) { |
355 | ath_dbg(common, CALIBRATE, | 354 | ath_dbg(common, CALIBRATE, |
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 35d1c8e91d1c..ff47b32ecaf4 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -26,11 +26,6 @@ | |||
26 | #define REG_READ_D(_ah, _reg) \ | 26 | #define REG_READ_D(_ah, _reg) \ |
27 | ath9k_hw_common(_ah)->ops->read((_ah), (_reg)) | 27 | ath9k_hw_common(_ah)->ops->read((_ah), (_reg)) |
28 | 28 | ||
29 | static int ath9k_debugfs_open(struct inode *inode, struct file *file) | ||
30 | { | ||
31 | file->private_data = inode->i_private; | ||
32 | return 0; | ||
33 | } | ||
34 | 29 | ||
35 | static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf, | 30 | static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf, |
36 | size_t count, loff_t *ppos) | 31 | size_t count, loff_t *ppos) |
@@ -83,7 +78,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf, | |||
83 | static const struct file_operations fops_debug = { | 78 | static const struct file_operations fops_debug = { |
84 | .read = read_file_debug, | 79 | .read = read_file_debug, |
85 | .write = write_file_debug, | 80 | .write = write_file_debug, |
86 | .open = ath9k_debugfs_open, | 81 | .open = simple_open, |
87 | .owner = THIS_MODULE, | 82 | .owner = THIS_MODULE, |
88 | .llseek = default_llseek, | 83 | .llseek = default_llseek, |
89 | }; | 84 | }; |
@@ -129,7 +124,7 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use | |||
129 | static const struct file_operations fops_tx_chainmask = { | 124 | static const struct file_operations fops_tx_chainmask = { |
130 | .read = read_file_tx_chainmask, | 125 | .read = read_file_tx_chainmask, |
131 | .write = write_file_tx_chainmask, | 126 | .write = write_file_tx_chainmask, |
132 | .open = ath9k_debugfs_open, | 127 | .open = simple_open, |
133 | .owner = THIS_MODULE, | 128 | .owner = THIS_MODULE, |
134 | .llseek = default_llseek, | 129 | .llseek = default_llseek, |
135 | }; | 130 | }; |
@@ -172,7 +167,7 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use | |||
172 | static const struct file_operations fops_rx_chainmask = { | 167 | static const struct file_operations fops_rx_chainmask = { |
173 | .read = read_file_rx_chainmask, | 168 | .read = read_file_rx_chainmask, |
174 | .write = write_file_rx_chainmask, | 169 | .write = write_file_rx_chainmask, |
175 | .open = ath9k_debugfs_open, | 170 | .open = simple_open, |
176 | .owner = THIS_MODULE, | 171 | .owner = THIS_MODULE, |
177 | .llseek = default_llseek, | 172 | .llseek = default_llseek, |
178 | }; | 173 | }; |
@@ -223,7 +218,7 @@ static ssize_t write_file_disable_ani(struct file *file, | |||
223 | static const struct file_operations fops_disable_ani = { | 218 | static const struct file_operations fops_disable_ani = { |
224 | .read = read_file_disable_ani, | 219 | .read = read_file_disable_ani, |
225 | .write = write_file_disable_ani, | 220 | .write = write_file_disable_ani, |
226 | .open = ath9k_debugfs_open, | 221 | .open = simple_open, |
227 | .owner = THIS_MODULE, | 222 | .owner = THIS_MODULE, |
228 | .llseek = default_llseek, | 223 | .llseek = default_llseek, |
229 | }; | 224 | }; |
@@ -324,7 +319,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, | |||
324 | 319 | ||
325 | static const struct file_operations fops_dma = { | 320 | static const struct file_operations fops_dma = { |
326 | .read = read_file_dma, | 321 | .read = read_file_dma, |
327 | .open = ath9k_debugfs_open, | 322 | .open = simple_open, |
328 | .owner = THIS_MODULE, | 323 | .owner = THIS_MODULE, |
329 | .llseek = default_llseek, | 324 | .llseek = default_llseek, |
330 | }; | 325 | }; |
@@ -446,7 +441,7 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, | |||
446 | 441 | ||
447 | static const struct file_operations fops_interrupt = { | 442 | static const struct file_operations fops_interrupt = { |
448 | .read = read_file_interrupt, | 443 | .read = read_file_interrupt, |
449 | .open = ath9k_debugfs_open, | 444 | .open = simple_open, |
450 | .owner = THIS_MODULE, | 445 | .owner = THIS_MODULE, |
451 | .llseek = default_llseek, | 446 | .llseek = default_llseek, |
452 | }; | 447 | }; |
@@ -852,28 +847,28 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | |||
852 | 847 | ||
853 | static const struct file_operations fops_xmit = { | 848 | static const struct file_operations fops_xmit = { |
854 | .read = read_file_xmit, | 849 | .read = read_file_xmit, |
855 | .open = ath9k_debugfs_open, | 850 | .open = simple_open, |
856 | .owner = THIS_MODULE, | 851 | .owner = THIS_MODULE, |
857 | .llseek = default_llseek, | 852 | .llseek = default_llseek, |
858 | }; | 853 | }; |
859 | 854 | ||
860 | static const struct file_operations fops_stations = { | 855 | static const struct file_operations fops_stations = { |
861 | .read = read_file_stations, | 856 | .read = read_file_stations, |
862 | .open = ath9k_debugfs_open, | 857 | .open = simple_open, |
863 | .owner = THIS_MODULE, | 858 | .owner = THIS_MODULE, |
864 | .llseek = default_llseek, | 859 | .llseek = default_llseek, |
865 | }; | 860 | }; |
866 | 861 | ||
867 | static const struct file_operations fops_misc = { | 862 | static const struct file_operations fops_misc = { |
868 | .read = read_file_misc, | 863 | .read = read_file_misc, |
869 | .open = ath9k_debugfs_open, | 864 | .open = simple_open, |
870 | .owner = THIS_MODULE, | 865 | .owner = THIS_MODULE, |
871 | .llseek = default_llseek, | 866 | .llseek = default_llseek, |
872 | }; | 867 | }; |
873 | 868 | ||
874 | static const struct file_operations fops_reset = { | 869 | static const struct file_operations fops_reset = { |
875 | .read = read_file_reset, | 870 | .read = read_file_reset, |
876 | .open = ath9k_debugfs_open, | 871 | .open = simple_open, |
877 | .owner = THIS_MODULE, | 872 | .owner = THIS_MODULE, |
878 | .llseek = default_llseek, | 873 | .llseek = default_llseek, |
879 | }; | 874 | }; |
@@ -1016,7 +1011,7 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) | |||
1016 | 1011 | ||
1017 | static const struct file_operations fops_recv = { | 1012 | static const struct file_operations fops_recv = { |
1018 | .read = read_file_recv, | 1013 | .read = read_file_recv, |
1019 | .open = ath9k_debugfs_open, | 1014 | .open = simple_open, |
1020 | .owner = THIS_MODULE, | 1015 | .owner = THIS_MODULE, |
1021 | .llseek = default_llseek, | 1016 | .llseek = default_llseek, |
1022 | }; | 1017 | }; |
@@ -1055,7 +1050,7 @@ static ssize_t write_file_regidx(struct file *file, const char __user *user_buf, | |||
1055 | static const struct file_operations fops_regidx = { | 1050 | static const struct file_operations fops_regidx = { |
1056 | .read = read_file_regidx, | 1051 | .read = read_file_regidx, |
1057 | .write = write_file_regidx, | 1052 | .write = write_file_regidx, |
1058 | .open = ath9k_debugfs_open, | 1053 | .open = simple_open, |
1059 | .owner = THIS_MODULE, | 1054 | .owner = THIS_MODULE, |
1060 | .llseek = default_llseek, | 1055 | .llseek = default_llseek, |
1061 | }; | 1056 | }; |
@@ -1102,7 +1097,7 @@ static ssize_t write_file_regval(struct file *file, const char __user *user_buf, | |||
1102 | static const struct file_operations fops_regval = { | 1097 | static const struct file_operations fops_regval = { |
1103 | .read = read_file_regval, | 1098 | .read = read_file_regval, |
1104 | .write = write_file_regval, | 1099 | .write = write_file_regval, |
1105 | .open = ath9k_debugfs_open, | 1100 | .open = simple_open, |
1106 | .owner = THIS_MODULE, | 1101 | .owner = THIS_MODULE, |
1107 | .llseek = default_llseek, | 1102 | .llseek = default_llseek, |
1108 | }; | 1103 | }; |
@@ -1191,7 +1186,7 @@ static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf, | |||
1191 | 1186 | ||
1192 | static const struct file_operations fops_dump_nfcal = { | 1187 | static const struct file_operations fops_dump_nfcal = { |
1193 | .read = read_file_dump_nfcal, | 1188 | .read = read_file_dump_nfcal, |
1194 | .open = ath9k_debugfs_open, | 1189 | .open = simple_open, |
1195 | .owner = THIS_MODULE, | 1190 | .owner = THIS_MODULE, |
1196 | .llseek = default_llseek, | 1191 | .llseek = default_llseek, |
1197 | }; | 1192 | }; |
@@ -1219,7 +1214,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, | |||
1219 | 1214 | ||
1220 | static const struct file_operations fops_base_eeprom = { | 1215 | static const struct file_operations fops_base_eeprom = { |
1221 | .read = read_file_base_eeprom, | 1216 | .read = read_file_base_eeprom, |
1222 | .open = ath9k_debugfs_open, | 1217 | .open = simple_open, |
1223 | .owner = THIS_MODULE, | 1218 | .owner = THIS_MODULE, |
1224 | .llseek = default_llseek, | 1219 | .llseek = default_llseek, |
1225 | }; | 1220 | }; |
@@ -1247,7 +1242,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf, | |||
1247 | 1242 | ||
1248 | static const struct file_operations fops_modal_eeprom = { | 1243 | static const struct file_operations fops_modal_eeprom = { |
1249 | .read = read_file_modal_eeprom, | 1244 | .read = read_file_modal_eeprom, |
1250 | .open = ath9k_debugfs_open, | 1245 | .open = simple_open, |
1251 | .owner = THIS_MODULE, | 1246 | .owner = THIS_MODULE, |
1252 | .llseek = default_llseek, | 1247 | .llseek = default_llseek, |
1253 | }; | 1248 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c index 106d031d834a..4364c103ed33 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c | |||
@@ -60,16 +60,9 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf, | |||
60 | return retval; | 60 | return retval; |
61 | } | 61 | } |
62 | 62 | ||
63 | static int ath9k_dfs_debugfs_open(struct inode *inode, struct file *file) | ||
64 | { | ||
65 | file->private_data = inode->i_private; | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static const struct file_operations fops_dfs_stats = { | 63 | static const struct file_operations fops_dfs_stats = { |
71 | .read = read_file_dfs, | 64 | .read = read_file_dfs, |
72 | .open = ath9k_dfs_debugfs_open, | 65 | .open = simple_open, |
73 | .owner = THIS_MODULE, | 66 | .owner = THIS_MODULE, |
74 | .llseek = default_llseek, | 67 | .llseek = default_llseek, |
75 | }; | 68 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c index f272236d8053..b34e8b2990b1 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c | |||
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah, | |||
824 | regulatory->max_power_level = ratesArray[i]; | 824 | regulatory->max_power_level = ratesArray[i]; |
825 | } | 825 | } |
826 | 826 | ||
827 | ath9k_hw_update_regulatory_maxpower(ah); | ||
828 | |||
827 | if (test) | 829 | if (test) |
828 | return; | 830 | return; |
829 | 831 | ||
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index d3ff33c71aa5..3035deb7a0cd 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c | |||
@@ -16,12 +16,6 @@ | |||
16 | 16 | ||
17 | #include "htc.h" | 17 | #include "htc.h" |
18 | 18 | ||
19 | static int ath9k_debugfs_open(struct inode *inode, struct file *file) | ||
20 | { | ||
21 | file->private_data = inode->i_private; | ||
22 | return 0; | ||
23 | } | ||
24 | |||
25 | static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, | 19 | static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, |
26 | size_t count, loff_t *ppos) | 20 | size_t count, loff_t *ppos) |
27 | { | 21 | { |
@@ -75,7 +69,7 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, | |||
75 | 69 | ||
76 | static const struct file_operations fops_tgt_int_stats = { | 70 | static const struct file_operations fops_tgt_int_stats = { |
77 | .read = read_file_tgt_int_stats, | 71 | .read = read_file_tgt_int_stats, |
78 | .open = ath9k_debugfs_open, | 72 | .open = simple_open, |
79 | .owner = THIS_MODULE, | 73 | .owner = THIS_MODULE, |
80 | .llseek = default_llseek, | 74 | .llseek = default_llseek, |
81 | }; | 75 | }; |
@@ -145,7 +139,7 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf, | |||
145 | 139 | ||
146 | static const struct file_operations fops_tgt_tx_stats = { | 140 | static const struct file_operations fops_tgt_tx_stats = { |
147 | .read = read_file_tgt_tx_stats, | 141 | .read = read_file_tgt_tx_stats, |
148 | .open = ath9k_debugfs_open, | 142 | .open = simple_open, |
149 | .owner = THIS_MODULE, | 143 | .owner = THIS_MODULE, |
150 | .llseek = default_llseek, | 144 | .llseek = default_llseek, |
151 | }; | 145 | }; |
@@ -191,7 +185,7 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf, | |||
191 | 185 | ||
192 | static const struct file_operations fops_tgt_rx_stats = { | 186 | static const struct file_operations fops_tgt_rx_stats = { |
193 | .read = read_file_tgt_rx_stats, | 187 | .read = read_file_tgt_rx_stats, |
194 | .open = ath9k_debugfs_open, | 188 | .open = simple_open, |
195 | .owner = THIS_MODULE, | 189 | .owner = THIS_MODULE, |
196 | .llseek = default_llseek, | 190 | .llseek = default_llseek, |
197 | }; | 191 | }; |
@@ -243,7 +237,7 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | |||
243 | 237 | ||
244 | static const struct file_operations fops_xmit = { | 238 | static const struct file_operations fops_xmit = { |
245 | .read = read_file_xmit, | 239 | .read = read_file_xmit, |
246 | .open = ath9k_debugfs_open, | 240 | .open = simple_open, |
247 | .owner = THIS_MODULE, | 241 | .owner = THIS_MODULE, |
248 | .llseek = default_llseek, | 242 | .llseek = default_llseek, |
249 | }; | 243 | }; |
@@ -364,7 +358,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, | |||
364 | 358 | ||
365 | static const struct file_operations fops_recv = { | 359 | static const struct file_operations fops_recv = { |
366 | .read = read_file_recv, | 360 | .read = read_file_recv, |
367 | .open = ath9k_debugfs_open, | 361 | .open = simple_open, |
368 | .owner = THIS_MODULE, | 362 | .owner = THIS_MODULE, |
369 | .llseek = default_llseek, | 363 | .llseek = default_llseek, |
370 | }; | 364 | }; |
@@ -399,7 +393,7 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf, | |||
399 | 393 | ||
400 | static const struct file_operations fops_slot = { | 394 | static const struct file_operations fops_slot = { |
401 | .read = read_file_slot, | 395 | .read = read_file_slot, |
402 | .open = ath9k_debugfs_open, | 396 | .open = simple_open, |
403 | .owner = THIS_MODULE, | 397 | .owner = THIS_MODULE, |
404 | .llseek = default_llseek, | 398 | .llseek = default_llseek, |
405 | }; | 399 | }; |
@@ -446,7 +440,7 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf, | |||
446 | 440 | ||
447 | static const struct file_operations fops_queue = { | 441 | static const struct file_operations fops_queue = { |
448 | .read = read_file_queue, | 442 | .read = read_file_queue, |
449 | .open = ath9k_debugfs_open, | 443 | .open = simple_open, |
450 | .owner = THIS_MODULE, | 444 | .owner = THIS_MODULE, |
451 | .llseek = default_llseek, | 445 | .llseek = default_llseek, |
452 | }; | 446 | }; |
@@ -487,7 +481,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf, | |||
487 | static const struct file_operations fops_debug = { | 481 | static const struct file_operations fops_debug = { |
488 | .read = read_file_debug, | 482 | .read = read_file_debug, |
489 | .write = write_file_debug, | 483 | .write = write_file_debug, |
490 | .open = ath9k_debugfs_open, | 484 | .open = simple_open, |
491 | .owner = THIS_MODULE, | 485 | .owner = THIS_MODULE, |
492 | .llseek = default_llseek, | 486 | .llseek = default_llseek, |
493 | }; | 487 | }; |
@@ -636,7 +630,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, | |||
636 | 630 | ||
637 | static const struct file_operations fops_base_eeprom = { | 631 | static const struct file_operations fops_base_eeprom = { |
638 | .read = read_file_base_eeprom, | 632 | .read = read_file_base_eeprom, |
639 | .open = ath9k_debugfs_open, | 633 | .open = simple_open, |
640 | .owner = THIS_MODULE, | 634 | .owner = THIS_MODULE, |
641 | .llseek = default_llseek, | 635 | .llseek = default_llseek, |
642 | }; | 636 | }; |
@@ -917,7 +911,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf, | |||
917 | 911 | ||
918 | static const struct file_operations fops_modal_eeprom = { | 912 | static const struct file_operations fops_modal_eeprom = { |
919 | .read = read_file_modal_eeprom, | 913 | .read = read_file_modal_eeprom, |
920 | .open = ath9k_debugfs_open, | 914 | .open = simple_open, |
921 | .owner = THIS_MODULE, | 915 | .owner = THIS_MODULE, |
922 | .llseek = default_llseek, | 916 | .llseek = default_llseek, |
923 | }; | 917 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 6c69e4e8b1cb..fa84e37bf091 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1454,7 +1454,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1454 | return false; | 1454 | return false; |
1455 | } | 1455 | } |
1456 | ath9k_hw_set_clockrate(ah); | 1456 | ath9k_hw_set_clockrate(ah); |
1457 | ath9k_hw_apply_txpower(ah, chan); | 1457 | ath9k_hw_apply_txpower(ah, chan, false); |
1458 | ath9k_hw_rfbus_done(ah); | 1458 | ath9k_hw_rfbus_done(ah); |
1459 | 1459 | ||
1460 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) | 1460 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) |
@@ -2652,7 +2652,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan) | |||
2652 | return ah->eep_ops->get_eeprom(ah, gain_param); | 2652 | return ah->eep_ops->get_eeprom(ah, gain_param); |
2653 | } | 2653 | } |
2654 | 2654 | ||
2655 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) | 2655 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan, |
2656 | bool test) | ||
2656 | { | 2657 | { |
2657 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); | 2658 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); |
2658 | struct ieee80211_channel *channel; | 2659 | struct ieee80211_channel *channel; |
@@ -2673,7 +2674,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) | |||
2673 | 2674 | ||
2674 | ah->eep_ops->set_txpower(ah, chan, | 2675 | ah->eep_ops->set_txpower(ah, chan, |
2675 | ath9k_regd_get_ctl(reg, chan), | 2676 | ath9k_regd_get_ctl(reg, chan), |
2676 | ant_reduction, new_pwr, false); | 2677 | ant_reduction, new_pwr, test); |
2677 | } | 2678 | } |
2678 | 2679 | ||
2679 | void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | 2680 | void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) |
@@ -2686,7 +2687,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | |||
2686 | if (test) | 2687 | if (test) |
2687 | channel->max_power = MAX_RATE_POWER / 2; | 2688 | channel->max_power = MAX_RATE_POWER / 2; |
2688 | 2689 | ||
2689 | ath9k_hw_apply_txpower(ah, chan); | 2690 | ath9k_hw_apply_txpower(ah, chan, test); |
2690 | 2691 | ||
2691 | if (test) | 2692 | if (test) |
2692 | channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); | 2693 | channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index aa1680a0c7fd..e88f182ff45c 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -985,7 +985,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len); | |||
985 | /* PHY */ | 985 | /* PHY */ |
986 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, | 986 | void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, |
987 | u32 *coef_mantissa, u32 *coef_exponent); | 987 | u32 *coef_mantissa, u32 *coef_exponent); |
988 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan); | 988 | void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan, |
989 | bool test); | ||
989 | 990 | ||
990 | /* | 991 | /* |
991 | * Code Specific to AR5008, AR9001 or AR9002, | 992 | * Code Specific to AR5008, AR9001 or AR9002, |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 60159f4ee532..cb006458fc4b 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -680,7 +680,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
680 | hw->queues = 4; | 680 | hw->queues = 4; |
681 | hw->max_rates = 4; | 681 | hw->max_rates = 4; |
682 | hw->channel_change_time = 5000; | 682 | hw->channel_change_time = 5000; |
683 | hw->max_listen_interval = 10; | 683 | hw->max_listen_interval = 1; |
684 | hw->max_rate_tries = 10; | 684 | hw->max_rate_tries = 10; |
685 | hw->sta_data_size = sizeof(struct ath_node); | 685 | hw->sta_data_size = sizeof(struct ath_node); |
686 | hw->vif_data_size = sizeof(struct ath_vif); | 686 | hw->vif_data_size = sizeof(struct ath_vif); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 38794850f005..798ea57252b4 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -118,15 +118,13 @@ void ath9k_ps_restore(struct ath_softc *sc) | |||
118 | if (--sc->ps_usecount != 0) | 118 | if (--sc->ps_usecount != 0) |
119 | goto unlock; | 119 | goto unlock; |
120 | 120 | ||
121 | if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) | 121 | if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK)) |
122 | goto unlock; | ||
123 | |||
124 | if (sc->ps_idle) | ||
125 | mode = ATH9K_PM_FULL_SLEEP; | 122 | mode = ATH9K_PM_FULL_SLEEP; |
126 | else if (sc->ps_enabled && | 123 | else if (sc->ps_enabled && |
127 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | 124 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | |
128 | PS_WAIT_FOR_CAB | | 125 | PS_WAIT_FOR_CAB | |
129 | PS_WAIT_FOR_PSPOLL_DATA))) | 126 | PS_WAIT_FOR_PSPOLL_DATA | |
127 | PS_WAIT_FOR_TX_ACK))) | ||
130 | mode = ATH9K_PM_NETWORK_SLEEP; | 128 | mode = ATH9K_PM_NETWORK_SLEEP; |
131 | else | 129 | else |
132 | goto unlock; | 130 | goto unlock; |
@@ -640,7 +638,7 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
640 | an->sta = sta; | 638 | an->sta = sta; |
641 | an->vif = vif; | 639 | an->vif = vif; |
642 | 640 | ||
643 | if (sta->ht_cap.ht_supported) { | 641 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) { |
644 | ath_tx_node_init(sc, an); | 642 | ath_tx_node_init(sc, an); |
645 | an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + | 643 | an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + |
646 | sta->ht_cap.ampdu_factor); | 644 | sta->ht_cap.ampdu_factor); |
@@ -659,7 +657,7 @@ static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) | |||
659 | an->sta = NULL; | 657 | an->sta = NULL; |
660 | #endif | 658 | #endif |
661 | 659 | ||
662 | if (sta->ht_cap.ht_supported) | 660 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) |
663 | ath_tx_node_cleanup(sc, an); | 661 | ath_tx_node_cleanup(sc, an); |
664 | } | 662 | } |
665 | 663 | ||
@@ -1550,6 +1548,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1550 | struct ath_hw *ah = sc->sc_ah; | 1548 | struct ath_hw *ah = sc->sc_ah; |
1551 | struct ath_common *common = ath9k_hw_common(ah); | 1549 | struct ath_common *common = ath9k_hw_common(ah); |
1552 | struct ieee80211_conf *conf = &hw->conf; | 1550 | struct ieee80211_conf *conf = &hw->conf; |
1551 | bool reset_channel = false; | ||
1553 | 1552 | ||
1554 | ath9k_ps_wakeup(sc); | 1553 | ath9k_ps_wakeup(sc); |
1555 | mutex_lock(&sc->mutex); | 1554 | mutex_lock(&sc->mutex); |
@@ -1558,6 +1557,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1558 | sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); | 1557 | sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); |
1559 | if (sc->ps_idle) | 1558 | if (sc->ps_idle) |
1560 | ath_cancel_work(sc); | 1559 | ath_cancel_work(sc); |
1560 | else | ||
1561 | /* | ||
1562 | * The chip needs a reset to properly wake up from | ||
1563 | * full sleep | ||
1564 | */ | ||
1565 | reset_channel = ah->chip_fullsleep; | ||
1561 | } | 1566 | } |
1562 | 1567 | ||
1563 | /* | 1568 | /* |
@@ -1586,7 +1591,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1586 | } | 1591 | } |
1587 | } | 1592 | } |
1588 | 1593 | ||
1589 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | 1594 | if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { |
1590 | struct ieee80211_channel *curchan = hw->conf.channel; | 1595 | struct ieee80211_channel *curchan = hw->conf.channel; |
1591 | int pos = curchan->hw_value; | 1596 | int pos = curchan->hw_value; |
1592 | int old_pos = -1; | 1597 | int old_pos = -1; |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 4f848493fece..08bb45532701 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -1480,12 +1480,6 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1480 | 1480 | ||
1481 | #ifdef CONFIG_ATH9K_DEBUGFS | 1481 | #ifdef CONFIG_ATH9K_DEBUGFS |
1482 | 1482 | ||
1483 | static int ath9k_debugfs_open(struct inode *inode, struct file *file) | ||
1484 | { | ||
1485 | file->private_data = inode->i_private; | ||
1486 | return 0; | ||
1487 | } | ||
1488 | |||
1489 | static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, | 1483 | static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, |
1490 | size_t count, loff_t *ppos) | 1484 | size_t count, loff_t *ppos) |
1491 | { | 1485 | { |
@@ -1553,7 +1547,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, | |||
1553 | 1547 | ||
1554 | static const struct file_operations fops_rcstat = { | 1548 | static const struct file_operations fops_rcstat = { |
1555 | .read = read_file_rcstat, | 1549 | .read = read_file_rcstat, |
1556 | .open = ath9k_debugfs_open, | 1550 | .open = simple_open, |
1557 | .owner = THIS_MODULE | 1551 | .owner = THIS_MODULE |
1558 | }; | 1552 | }; |
1559 | 1553 | ||
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index f4ae3ba994a8..1c4583c7ff7c 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1913,13 +1913,13 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1913 | if (sc->rx.frag) { | 1913 | if (sc->rx.frag) { |
1914 | int space = skb->len - skb_tailroom(hdr_skb); | 1914 | int space = skb->len - skb_tailroom(hdr_skb); |
1915 | 1915 | ||
1916 | sc->rx.frag = NULL; | ||
1917 | |||
1918 | if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { | 1916 | if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { |
1919 | dev_kfree_skb(skb); | 1917 | dev_kfree_skb(skb); |
1920 | goto requeue_drop_frag; | 1918 | goto requeue_drop_frag; |
1921 | } | 1919 | } |
1922 | 1920 | ||
1921 | sc->rx.frag = NULL; | ||
1922 | |||
1923 | skb_copy_from_linear_data(skb, skb_put(hdr_skb, skb->len), | 1923 | skb_copy_from_linear_data(skb, skb_put(hdr_skb, skb->len), |
1924 | skb->len); | 1924 | skb->len); |
1925 | dev_kfree_skb_any(skb); | 1925 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 834e6bc45e8b..23eaa1b26ebe 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1820,6 +1820,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | |||
1820 | struct ath_frame_info *fi = get_frame_info(skb); | 1820 | struct ath_frame_info *fi = get_frame_info(skb); |
1821 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1821 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1822 | struct ath_buf *bf; | 1822 | struct ath_buf *bf; |
1823 | int fragno; | ||
1823 | u16 seqno; | 1824 | u16 seqno; |
1824 | 1825 | ||
1825 | bf = ath_tx_get_buffer(sc); | 1826 | bf = ath_tx_get_buffer(sc); |
@@ -1831,9 +1832,16 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | |||
1831 | ATH_TXBUF_RESET(bf); | 1832 | ATH_TXBUF_RESET(bf); |
1832 | 1833 | ||
1833 | if (tid) { | 1834 | if (tid) { |
1835 | fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; | ||
1834 | seqno = tid->seq_next; | 1836 | seqno = tid->seq_next; |
1835 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); | 1837 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); |
1836 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | 1838 | |
1839 | if (fragno) | ||
1840 | hdr->seq_ctrl |= cpu_to_le16(fragno); | ||
1841 | |||
1842 | if (!ieee80211_has_morefrags(hdr->frame_control)) | ||
1843 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | ||
1844 | |||
1837 | bf->bf_state.seqno = seqno; | 1845 | bf->bf_state.seqno = seqno; |
1838 | } | 1846 | } |
1839 | 1847 | ||
diff --git a/drivers/net/wireless/ath/carl9170/debug.c b/drivers/net/wireless/ath/carl9170/debug.c index 3c164226687f..93fe6003a493 100644 --- a/drivers/net/wireless/ath/carl9170/debug.c +++ b/drivers/net/wireless/ath/carl9170/debug.c | |||
@@ -48,11 +48,6 @@ | |||
48 | #define ADD(buf, off, max, fmt, args...) \ | 48 | #define ADD(buf, off, max, fmt, args...) \ |
49 | off += snprintf(&buf[off], max - off, fmt, ##args); | 49 | off += snprintf(&buf[off], max - off, fmt, ##args); |
50 | 50 | ||
51 | static int carl9170_debugfs_open(struct inode *inode, struct file *file) | ||
52 | { | ||
53 | file->private_data = inode->i_private; | ||
54 | return 0; | ||
55 | } | ||
56 | 51 | ||
57 | struct carl9170_debugfs_fops { | 52 | struct carl9170_debugfs_fops { |
58 | unsigned int read_bufsize; | 53 | unsigned int read_bufsize; |
@@ -178,7 +173,7 @@ static const struct carl9170_debugfs_fops carl_debugfs_##name ##_ops = {\ | |||
178 | .attr = _attr, \ | 173 | .attr = _attr, \ |
179 | .req_dev_state = _dstate, \ | 174 | .req_dev_state = _dstate, \ |
180 | .fops = { \ | 175 | .fops = { \ |
181 | .open = carl9170_debugfs_open, \ | 176 | .open = simple_open, \ |
182 | .read = carl9170_debugfs_read, \ | 177 | .read = carl9170_debugfs_read, \ |
183 | .write = carl9170_debugfs_write, \ | 178 | .write = carl9170_debugfs_write, \ |
184 | .owner = THIS_MODULE \ | 179 | .owner = THIS_MODULE \ |
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index e751fdee89b2..e807bd930647 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
@@ -500,12 +500,6 @@ out: | |||
500 | 500 | ||
501 | #undef fappend | 501 | #undef fappend |
502 | 502 | ||
503 | static int b43_debugfs_open(struct inode *inode, struct file *file) | ||
504 | { | ||
505 | file->private_data = inode->i_private; | ||
506 | return 0; | ||
507 | } | ||
508 | |||
509 | static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf, | 503 | static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf, |
510 | size_t count, loff_t *ppos) | 504 | size_t count, loff_t *ppos) |
511 | { | 505 | { |
@@ -624,7 +618,7 @@ out_unlock: | |||
624 | .read = _read, \ | 618 | .read = _read, \ |
625 | .write = _write, \ | 619 | .write = _write, \ |
626 | .fops = { \ | 620 | .fops = { \ |
627 | .open = b43_debugfs_open, \ | 621 | .open = simple_open, \ |
628 | .read = b43_debugfs_read, \ | 622 | .read = b43_debugfs_read, \ |
629 | .write = b43_debugfs_write, \ | 623 | .write = b43_debugfs_write, \ |
630 | .llseek = generic_file_llseek, \ | 624 | .llseek = generic_file_llseek, \ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index c79e6638c88d..e4d6dc2e37d1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
4827 | out_mutex_unlock: | 4827 | out_mutex_unlock: |
4828 | mutex_unlock(&wl->mutex); | 4828 | mutex_unlock(&wl->mutex); |
4829 | 4829 | ||
4830 | /* reload configuration */ | 4830 | /* |
4831 | b43_op_config(hw, ~0); | 4831 | * Configuration may have been overwritten during initialization. |
4832 | * Reload the configuration, but only if initialization was | ||
4833 | * successful. Reloading the configuration after a failed init | ||
4834 | * may hang the system. | ||
4835 | */ | ||
4836 | if (!err) | ||
4837 | b43_op_config(hw, ~0); | ||
4832 | 4838 | ||
4833 | return err; | 4839 | return err; |
4834 | } | 4840 | } |
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index 5e28ad0d6d17..1965edb765a2 100644 --- a/drivers/net/wireless/b43legacy/debugfs.c +++ b/drivers/net/wireless/b43legacy/debugfs.c | |||
@@ -197,12 +197,6 @@ static int restart_write_file(struct b43legacy_wldev *dev, const char *buf, size | |||
197 | 197 | ||
198 | #undef fappend | 198 | #undef fappend |
199 | 199 | ||
200 | static int b43legacy_debugfs_open(struct inode *inode, struct file *file) | ||
201 | { | ||
202 | file->private_data = inode->i_private; | ||
203 | return 0; | ||
204 | } | ||
205 | |||
206 | static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf, | 200 | static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf, |
207 | size_t count, loff_t *ppos) | 201 | size_t count, loff_t *ppos) |
208 | { | 202 | { |
@@ -331,7 +325,7 @@ out_unlock: | |||
331 | .read = _read, \ | 325 | .read = _read, \ |
332 | .write = _write, \ | 326 | .write = _write, \ |
333 | .fops = { \ | 327 | .fops = { \ |
334 | .open = b43legacy_debugfs_open, \ | 328 | .open = simple_open, \ |
335 | .read = b43legacy_debugfs_read, \ | 329 | .read = b43legacy_debugfs_read, \ |
336 | .write = b43legacy_debugfs_write, \ | 330 | .write = b43legacy_debugfs_write, \ |
337 | .llseek = generic_file_llseek, \ | 331 | .llseek = generic_file_llseek, \ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 4688904908ec..758c115b556e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | |||
@@ -108,9 +108,15 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev, | |||
108 | sdio_release_host(sdfunc); | 108 | sdio_release_host(sdfunc); |
109 | } | 109 | } |
110 | } else if (regaddr == SDIO_CCCR_ABORT) { | 110 | } else if (regaddr == SDIO_CCCR_ABORT) { |
111 | sdfunc = kmemdup(sdiodev->func[0], sizeof(struct sdio_func), | ||
112 | GFP_KERNEL); | ||
113 | if (!sdfunc) | ||
114 | return -ENOMEM; | ||
115 | sdfunc->num = 0; | ||
111 | sdio_claim_host(sdfunc); | 116 | sdio_claim_host(sdfunc); |
112 | sdio_writeb(sdfunc, *byte, regaddr, &err_ret); | 117 | sdio_writeb(sdfunc, *byte, regaddr, &err_ret); |
113 | sdio_release_host(sdfunc); | 118 | sdio_release_host(sdfunc); |
119 | kfree(sdfunc); | ||
114 | } else if (regaddr < 0xF0) { | 120 | } else if (regaddr < 0xF0) { |
115 | brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr); | 121 | brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr); |
116 | err_ret = -EPERM; | 122 | err_ret = -EPERM; |
@@ -486,7 +492,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, | |||
486 | kfree(bus_if); | 492 | kfree(bus_if); |
487 | return -ENOMEM; | 493 | return -ENOMEM; |
488 | } | 494 | } |
489 | sdiodev->func[0] = func->card->sdio_func[0]; | 495 | sdiodev->func[0] = func; |
490 | sdiodev->func[1] = func; | 496 | sdiodev->func[1] = func; |
491 | sdiodev->bus_if = bus_if; | 497 | sdiodev->bus_if = bus_if; |
492 | bus_if->bus_priv.sdio = sdiodev; | 498 | bus_if->bus_priv.sdio = sdiodev; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 2bf5dda29291..eb3829b03cd3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -574,6 +574,8 @@ struct brcmf_sdio { | |||
574 | 574 | ||
575 | struct task_struct *dpc_tsk; | 575 | struct task_struct *dpc_tsk; |
576 | struct completion dpc_wait; | 576 | struct completion dpc_wait; |
577 | struct list_head dpc_tsklst; | ||
578 | spinlock_t dpc_tl_lock; | ||
577 | 579 | ||
578 | struct semaphore sdsem; | 580 | struct semaphore sdsem; |
579 | 581 | ||
@@ -2594,29 +2596,58 @@ clkwait: | |||
2594 | return resched; | 2596 | return resched; |
2595 | } | 2597 | } |
2596 | 2598 | ||
2599 | static inline void brcmf_sdbrcm_adddpctsk(struct brcmf_sdio *bus) | ||
2600 | { | ||
2601 | struct list_head *new_hd; | ||
2602 | unsigned long flags; | ||
2603 | |||
2604 | if (in_interrupt()) | ||
2605 | new_hd = kzalloc(sizeof(struct list_head), GFP_ATOMIC); | ||
2606 | else | ||
2607 | new_hd = kzalloc(sizeof(struct list_head), GFP_KERNEL); | ||
2608 | if (new_hd == NULL) | ||
2609 | return; | ||
2610 | |||
2611 | spin_lock_irqsave(&bus->dpc_tl_lock, flags); | ||
2612 | list_add_tail(new_hd, &bus->dpc_tsklst); | ||
2613 | spin_unlock_irqrestore(&bus->dpc_tl_lock, flags); | ||
2614 | } | ||
2615 | |||
2597 | static int brcmf_sdbrcm_dpc_thread(void *data) | 2616 | static int brcmf_sdbrcm_dpc_thread(void *data) |
2598 | { | 2617 | { |
2599 | struct brcmf_sdio *bus = (struct brcmf_sdio *) data; | 2618 | struct brcmf_sdio *bus = (struct brcmf_sdio *) data; |
2619 | struct list_head *cur_hd, *tmp_hd; | ||
2620 | unsigned long flags; | ||
2600 | 2621 | ||
2601 | allow_signal(SIGTERM); | 2622 | allow_signal(SIGTERM); |
2602 | /* Run until signal received */ | 2623 | /* Run until signal received */ |
2603 | while (1) { | 2624 | while (1) { |
2604 | if (kthread_should_stop()) | 2625 | if (kthread_should_stop()) |
2605 | break; | 2626 | break; |
2606 | if (!wait_for_completion_interruptible(&bus->dpc_wait)) { | 2627 | |
2607 | /* Call bus dpc unless it indicated down | 2628 | if (list_empty(&bus->dpc_tsklst)) |
2608 | (then clean stop) */ | 2629 | if (wait_for_completion_interruptible(&bus->dpc_wait)) |
2609 | if (bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN) { | 2630 | break; |
2610 | if (brcmf_sdbrcm_dpc(bus)) | 2631 | |
2611 | complete(&bus->dpc_wait); | 2632 | spin_lock_irqsave(&bus->dpc_tl_lock, flags); |
2612 | } else { | 2633 | list_for_each_safe(cur_hd, tmp_hd, &bus->dpc_tsklst) { |
2634 | spin_unlock_irqrestore(&bus->dpc_tl_lock, flags); | ||
2635 | |||
2636 | if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) { | ||
2613 | /* after stopping the bus, exit thread */ | 2637 | /* after stopping the bus, exit thread */ |
2614 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); | 2638 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); |
2615 | bus->dpc_tsk = NULL; | 2639 | bus->dpc_tsk = NULL; |
2616 | break; | 2640 | break; |
2617 | } | 2641 | } |
2618 | } else | 2642 | |
2619 | break; | 2643 | if (brcmf_sdbrcm_dpc(bus)) |
2644 | brcmf_sdbrcm_adddpctsk(bus); | ||
2645 | |||
2646 | spin_lock_irqsave(&bus->dpc_tl_lock, flags); | ||
2647 | list_del(cur_hd); | ||
2648 | kfree(cur_hd); | ||
2649 | } | ||
2650 | spin_unlock_irqrestore(&bus->dpc_tl_lock, flags); | ||
2620 | } | 2651 | } |
2621 | return 0; | 2652 | return 0; |
2622 | } | 2653 | } |
@@ -2669,8 +2700,10 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt) | |||
2669 | /* Schedule DPC if needed to send queued packet(s) */ | 2700 | /* Schedule DPC if needed to send queued packet(s) */ |
2670 | if (!bus->dpc_sched) { | 2701 | if (!bus->dpc_sched) { |
2671 | bus->dpc_sched = true; | 2702 | bus->dpc_sched = true; |
2672 | if (bus->dpc_tsk) | 2703 | if (bus->dpc_tsk) { |
2704 | brcmf_sdbrcm_adddpctsk(bus); | ||
2673 | complete(&bus->dpc_wait); | 2705 | complete(&bus->dpc_wait); |
2706 | } | ||
2674 | } | 2707 | } |
2675 | 2708 | ||
2676 | return ret; | 2709 | return ret; |
@@ -3514,8 +3547,10 @@ void brcmf_sdbrcm_isr(void *arg) | |||
3514 | brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); | 3547 | brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); |
3515 | 3548 | ||
3516 | bus->dpc_sched = true; | 3549 | bus->dpc_sched = true; |
3517 | if (bus->dpc_tsk) | 3550 | if (bus->dpc_tsk) { |
3551 | brcmf_sdbrcm_adddpctsk(bus); | ||
3518 | complete(&bus->dpc_wait); | 3552 | complete(&bus->dpc_wait); |
3553 | } | ||
3519 | } | 3554 | } |
3520 | 3555 | ||
3521 | static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) | 3556 | static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) |
@@ -3559,8 +3594,10 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) | |||
3559 | bus->ipend = true; | 3594 | bus->ipend = true; |
3560 | 3595 | ||
3561 | bus->dpc_sched = true; | 3596 | bus->dpc_sched = true; |
3562 | if (bus->dpc_tsk) | 3597 | if (bus->dpc_tsk) { |
3598 | brcmf_sdbrcm_adddpctsk(bus); | ||
3563 | complete(&bus->dpc_wait); | 3599 | complete(&bus->dpc_wait); |
3600 | } | ||
3564 | } | 3601 | } |
3565 | } | 3602 | } |
3566 | 3603 | ||
@@ -3897,6 +3934,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) | |||
3897 | } | 3934 | } |
3898 | /* Initialize DPC thread */ | 3935 | /* Initialize DPC thread */ |
3899 | init_completion(&bus->dpc_wait); | 3936 | init_completion(&bus->dpc_wait); |
3937 | INIT_LIST_HEAD(&bus->dpc_tsklst); | ||
3938 | spin_lock_init(&bus->dpc_tl_lock); | ||
3900 | bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread, | 3939 | bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread, |
3901 | bus, "brcmf_dpc"); | 3940 | bus, "brcmf_dpc"); |
3902 | if (IS_ERR(bus->dpc_tsk)) { | 3941 | if (IS_ERR(bus->dpc_tsk)) { |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 231ddf4a674f..b4d92792c502 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -847,8 +847,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
847 | */ | 847 | */ |
848 | if (!(txs->status & TX_STATUS_AMPDU) | 848 | if (!(txs->status & TX_STATUS_AMPDU) |
849 | && (txs->status & TX_STATUS_INTERMEDIATE)) { | 849 | && (txs->status & TX_STATUS_INTERMEDIATE)) { |
850 | wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n", | 850 | BCMMSG(wlc->wiphy, "INTERMEDIATE but not AMPDU\n"); |
851 | __func__); | ||
852 | return false; | 851 | return false; |
853 | } | 852 | } |
854 | 853 | ||
@@ -7614,6 +7613,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, | |||
7614 | { | 7613 | { |
7615 | int len_mpdu; | 7614 | int len_mpdu; |
7616 | struct ieee80211_rx_status rx_status; | 7615 | struct ieee80211_rx_status rx_status; |
7616 | struct ieee80211_hdr *hdr; | ||
7617 | 7617 | ||
7618 | memset(&rx_status, 0, sizeof(rx_status)); | 7618 | memset(&rx_status, 0, sizeof(rx_status)); |
7619 | prep_mac80211_status(wlc, rxh, p, &rx_status); | 7619 | prep_mac80211_status(wlc, rxh, p, &rx_status); |
@@ -7623,6 +7623,13 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, | |||
7623 | skb_pull(p, D11_PHY_HDR_LEN); | 7623 | skb_pull(p, D11_PHY_HDR_LEN); |
7624 | __skb_trim(p, len_mpdu); | 7624 | __skb_trim(p, len_mpdu); |
7625 | 7625 | ||
7626 | /* unmute transmit */ | ||
7627 | if (wlc->hw->suspended_fifos) { | ||
7628 | hdr = (struct ieee80211_hdr *)p->data; | ||
7629 | if (ieee80211_is_beacon(hdr->frame_control)) | ||
7630 | brcms_b_mute(wlc->hw, false); | ||
7631 | } | ||
7632 | |||
7626 | memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status)); | 7633 | memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status)); |
7627 | ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); | 7634 | ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); |
7628 | } | 7635 | } |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 4fcdac63a300..1779db3aa2b0 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -2191,6 +2191,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd) | |||
2191 | { | 2191 | { |
2192 | int rc = 0; | 2192 | int rc = 0; |
2193 | unsigned long flags; | 2193 | unsigned long flags; |
2194 | unsigned long now, end; | ||
2194 | 2195 | ||
2195 | spin_lock_irqsave(&priv->lock, flags); | 2196 | spin_lock_irqsave(&priv->lock, flags); |
2196 | if (priv->status & STATUS_HCMD_ACTIVE) { | 2197 | if (priv->status & STATUS_HCMD_ACTIVE) { |
@@ -2232,10 +2233,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd) | |||
2232 | } | 2233 | } |
2233 | spin_unlock_irqrestore(&priv->lock, flags); | 2234 | spin_unlock_irqrestore(&priv->lock, flags); |
2234 | 2235 | ||
2236 | now = jiffies; | ||
2237 | end = now + HOST_COMPLETE_TIMEOUT; | ||
2238 | again: | ||
2235 | rc = wait_event_interruptible_timeout(priv->wait_command_queue, | 2239 | rc = wait_event_interruptible_timeout(priv->wait_command_queue, |
2236 | !(priv-> | 2240 | !(priv-> |
2237 | status & STATUS_HCMD_ACTIVE), | 2241 | status & STATUS_HCMD_ACTIVE), |
2238 | HOST_COMPLETE_TIMEOUT); | 2242 | end - now); |
2243 | if (rc < 0) { | ||
2244 | now = jiffies; | ||
2245 | if (time_before(now, end)) | ||
2246 | goto again; | ||
2247 | rc = 0; | ||
2248 | } | ||
2249 | |||
2239 | if (rc == 0) { | 2250 | if (rc == 0) { |
2240 | spin_lock_irqsave(&priv->lock, flags); | 2251 | spin_lock_irqsave(&priv->lock, flags); |
2241 | if (priv->status & STATUS_HCMD_ACTIVE) { | 2252 | if (priv->status & STATUS_HCMD_ACTIVE) { |
@@ -11507,9 +11518,9 @@ static int ipw_wdev_init(struct net_device *dev) | |||
11507 | rc = -ENOMEM; | 11518 | rc = -ENOMEM; |
11508 | goto out; | 11519 | goto out; |
11509 | } | 11520 | } |
11510 | /* translate geo->bg to a_band.channels */ | 11521 | /* translate geo->a to a_band.channels */ |
11511 | for (i = 0; i < geo->a_channels; i++) { | 11522 | for (i = 0; i < geo->a_channels; i++) { |
11512 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; | 11523 | a_band->channels[i].band = IEEE80211_BAND_5GHZ; |
11513 | a_band->channels[i].center_freq = geo->a[i].freq; | 11524 | a_band->channels[i].center_freq = geo->a[i].freq; |
11514 | a_band->channels[i].hw_value = geo->a[i].channel; | 11525 | a_band->channels[i].hw_value = geo->a[i].channel; |
11515 | a_band->channels[i].max_power = geo->a[i].max_power; | 11526 | a_band->channels[i].max_power = geo->a[i].max_power; |
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c index 0c1209390169..faec40467208 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c | |||
@@ -2673,8 +2673,6 @@ il3945_bg_restart(struct work_struct *data) | |||
2673 | 2673 | ||
2674 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { | 2674 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { |
2675 | mutex_lock(&il->mutex); | 2675 | mutex_lock(&il->mutex); |
2676 | /* FIXME: vif can be dereferenced */ | ||
2677 | il->vif = NULL; | ||
2678 | il->is_open = 0; | 2676 | il->is_open = 0; |
2679 | mutex_unlock(&il->mutex); | 2677 | mutex_unlock(&il->mutex); |
2680 | il3945_down(il); | 2678 | il3945_down(il); |
diff --git a/drivers/net/wireless/iwlegacy/3945-rs.c b/drivers/net/wireless/iwlegacy/3945-rs.c index 70bee1a4d876..4b10157d8686 100644 --- a/drivers/net/wireless/iwlegacy/3945-rs.c +++ b/drivers/net/wireless/iwlegacy/3945-rs.c | |||
@@ -821,12 +821,6 @@ out: | |||
821 | } | 821 | } |
822 | 822 | ||
823 | #ifdef CONFIG_MAC80211_DEBUGFS | 823 | #ifdef CONFIG_MAC80211_DEBUGFS |
824 | static int | ||
825 | il3945_open_file_generic(struct inode *inode, struct file *file) | ||
826 | { | ||
827 | file->private_data = inode->i_private; | ||
828 | return 0; | ||
829 | } | ||
830 | 824 | ||
831 | static ssize_t | 825 | static ssize_t |
832 | il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | 826 | il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, |
@@ -862,7 +856,7 @@ il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | |||
862 | 856 | ||
863 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | 857 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { |
864 | .read = il3945_sta_dbgfs_stats_table_read, | 858 | .read = il3945_sta_dbgfs_stats_table_read, |
865 | .open = il3945_open_file_generic, | 859 | .open = simple_open, |
866 | .llseek = default_llseek, | 860 | .llseek = default_llseek, |
867 | }; | 861 | }; |
868 | 862 | ||
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 17f1c6853182..c46275a92565 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -5652,8 +5652,6 @@ il4965_bg_restart(struct work_struct *data) | |||
5652 | 5652 | ||
5653 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { | 5653 | if (test_and_clear_bit(S_FW_ERROR, &il->status)) { |
5654 | mutex_lock(&il->mutex); | 5654 | mutex_lock(&il->mutex); |
5655 | /* FIXME: do we dereference vif without mutex locked ? */ | ||
5656 | il->vif = NULL; | ||
5657 | il->is_open = 0; | 5655 | il->is_open = 0; |
5658 | 5656 | ||
5659 | __il4965_down(il); | 5657 | __il4965_down(il); |
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c index d7e2856e41d3..11ab1247fae1 100644 --- a/drivers/net/wireless/iwlegacy/4965-rs.c +++ b/drivers/net/wireless/iwlegacy/4965-rs.c | |||
@@ -2518,12 +2518,6 @@ il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta, void *il_sta) | |||
2518 | } | 2518 | } |
2519 | 2519 | ||
2520 | #ifdef CONFIG_MAC80211_DEBUGFS | 2520 | #ifdef CONFIG_MAC80211_DEBUGFS |
2521 | static int | ||
2522 | il4965_open_file_generic(struct inode *inode, struct file *file) | ||
2523 | { | ||
2524 | file->private_data = inode->i_private; | ||
2525 | return 0; | ||
2526 | } | ||
2527 | 2521 | ||
2528 | static void | 2522 | static void |
2529 | il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) | 2523 | il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) |
@@ -2695,7 +2689,7 @@ il4965_rs_sta_dbgfs_scale_table_read(struct file *file, char __user *user_buf, | |||
2695 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { | 2689 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { |
2696 | .write = il4965_rs_sta_dbgfs_scale_table_write, | 2690 | .write = il4965_rs_sta_dbgfs_scale_table_write, |
2697 | .read = il4965_rs_sta_dbgfs_scale_table_read, | 2691 | .read = il4965_rs_sta_dbgfs_scale_table_read, |
2698 | .open = il4965_open_file_generic, | 2692 | .open = simple_open, |
2699 | .llseek = default_llseek, | 2693 | .llseek = default_llseek, |
2700 | }; | 2694 | }; |
2701 | 2695 | ||
@@ -2740,7 +2734,7 @@ il4965_rs_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf, | |||
2740 | 2734 | ||
2741 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | 2735 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { |
2742 | .read = il4965_rs_sta_dbgfs_stats_table_read, | 2736 | .read = il4965_rs_sta_dbgfs_stats_table_read, |
2743 | .open = il4965_open_file_generic, | 2737 | .open = simple_open, |
2744 | .llseek = default_llseek, | 2738 | .llseek = default_llseek, |
2745 | }; | 2739 | }; |
2746 | 2740 | ||
@@ -2768,7 +2762,7 @@ il4965_rs_sta_dbgfs_rate_scale_data_read(struct file *file, | |||
2768 | 2762 | ||
2769 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { | 2763 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { |
2770 | .read = il4965_rs_sta_dbgfs_rate_scale_data_read, | 2764 | .read = il4965_rs_sta_dbgfs_rate_scale_data_read, |
2771 | .open = il4965_open_file_generic, | 2765 | .open = simple_open, |
2772 | .llseek = default_llseek, | 2766 | .llseek = default_llseek, |
2773 | }; | 2767 | }; |
2774 | 2768 | ||
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index e5ac04739bcc..eaf249452e51 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4508,6 +4508,7 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4508 | { | 4508 | { |
4509 | struct il_priv *il = hw->priv; | 4509 | struct il_priv *il = hw->priv; |
4510 | int err; | 4510 | int err; |
4511 | bool reset; | ||
4511 | 4512 | ||
4512 | mutex_lock(&il->mutex); | 4513 | mutex_lock(&il->mutex); |
4513 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); | 4514 | D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr); |
@@ -4518,7 +4519,12 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4518 | goto out; | 4519 | goto out; |
4519 | } | 4520 | } |
4520 | 4521 | ||
4521 | if (il->vif) { | 4522 | /* |
4523 | * We do not support multiple virtual interfaces, but on hardware reset | ||
4524 | * we have to add the same interface again. | ||
4525 | */ | ||
4526 | reset = (il->vif == vif); | ||
4527 | if (il->vif && !reset) { | ||
4522 | err = -EOPNOTSUPP; | 4528 | err = -EOPNOTSUPP; |
4523 | goto out; | 4529 | goto out; |
4524 | } | 4530 | } |
@@ -4528,8 +4534,11 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
4528 | 4534 | ||
4529 | err = il_set_mode(il); | 4535 | err = il_set_mode(il); |
4530 | if (err) { | 4536 | if (err) { |
4531 | il->vif = NULL; | 4537 | IL_WARN("Fail to set mode %d\n", vif->type); |
4532 | il->iw_mode = NL80211_IFTYPE_STATION; | 4538 | if (!reset) { |
4539 | il->vif = NULL; | ||
4540 | il->iw_mode = NL80211_IFTYPE_STATION; | ||
4541 | } | ||
4533 | } | 4542 | } |
4534 | 4543 | ||
4535 | out: | 4544 | out: |
@@ -5279,9 +5288,9 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5279 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); | 5288 | D_MAC80211("BSSID %pM\n", bss_conf->bssid); |
5280 | 5289 | ||
5281 | /* | 5290 | /* |
5282 | * If there is currently a HW scan going on in the | 5291 | * If there is currently a HW scan going on in the background, |
5283 | * background then we need to cancel it else the RXON | 5292 | * then we need to cancel it, otherwise sometimes we are not |
5284 | * below/in post_associate will fail. | 5293 | * able to authenticate (FIXME: why ?) |
5285 | */ | 5294 | */ |
5286 | if (il_scan_cancel_timeout(il, 100)) { | 5295 | if (il_scan_cancel_timeout(il, 100)) { |
5287 | D_MAC80211("leave - scan abort failed\n"); | 5296 | D_MAC80211("leave - scan abort failed\n"); |
@@ -5290,14 +5299,10 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5290 | } | 5299 | } |
5291 | 5300 | ||
5292 | /* mac80211 only sets assoc when in STATION mode */ | 5301 | /* mac80211 only sets assoc when in STATION mode */ |
5293 | if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) { | 5302 | memcpy(il->staging.bssid_addr, bss_conf->bssid, ETH_ALEN); |
5294 | memcpy(il->staging.bssid_addr, bss_conf->bssid, | ||
5295 | ETH_ALEN); | ||
5296 | 5303 | ||
5297 | /* currently needed in a few places */ | 5304 | /* FIXME: currently needed in a few places */ |
5298 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); | 5305 | memcpy(il->bssid, bss_conf->bssid, ETH_ALEN); |
5299 | } else | ||
5300 | il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
5301 | } | 5306 | } |
5302 | 5307 | ||
5303 | /* | 5308 | /* |
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c index 229849150aac..eff26501d60a 100644 --- a/drivers/net/wireless/iwlegacy/debug.c +++ b/drivers/net/wireless/iwlegacy/debug.c | |||
@@ -160,18 +160,12 @@ static ssize_t il_dbgfs_##name##_write(struct file *file, \ | |||
160 | const char __user *user_buf, \ | 160 | const char __user *user_buf, \ |
161 | size_t count, loff_t *ppos); | 161 | size_t count, loff_t *ppos); |
162 | 162 | ||
163 | static int | ||
164 | il_dbgfs_open_file_generic(struct inode *inode, struct file *file) | ||
165 | { | ||
166 | file->private_data = inode->i_private; | ||
167 | return 0; | ||
168 | } | ||
169 | 163 | ||
170 | #define DEBUGFS_READ_FILE_OPS(name) \ | 164 | #define DEBUGFS_READ_FILE_OPS(name) \ |
171 | DEBUGFS_READ_FUNC(name); \ | 165 | DEBUGFS_READ_FUNC(name); \ |
172 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 166 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
173 | .read = il_dbgfs_##name##_read, \ | 167 | .read = il_dbgfs_##name##_read, \ |
174 | .open = il_dbgfs_open_file_generic, \ | 168 | .open = simple_open, \ |
175 | .llseek = generic_file_llseek, \ | 169 | .llseek = generic_file_llseek, \ |
176 | }; | 170 | }; |
177 | 171 | ||
@@ -179,7 +173,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \ | |||
179 | DEBUGFS_WRITE_FUNC(name); \ | 173 | DEBUGFS_WRITE_FUNC(name); \ |
180 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 174 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
181 | .write = il_dbgfs_##name##_write, \ | 175 | .write = il_dbgfs_##name##_write, \ |
182 | .open = il_dbgfs_open_file_generic, \ | 176 | .open = simple_open, \ |
183 | .llseek = generic_file_llseek, \ | 177 | .llseek = generic_file_llseek, \ |
184 | }; | 178 | }; |
185 | 179 | ||
@@ -189,7 +183,7 @@ static const struct file_operations il_dbgfs_##name##_ops = { \ | |||
189 | static const struct file_operations il_dbgfs_##name##_ops = { \ | 183 | static const struct file_operations il_dbgfs_##name##_ops = { \ |
190 | .write = il_dbgfs_##name##_write, \ | 184 | .write = il_dbgfs_##name##_write, \ |
191 | .read = il_dbgfs_##name##_read, \ | 185 | .read = il_dbgfs_##name##_read, \ |
192 | .open = il_dbgfs_open_file_generic, \ | 186 | .open = simple_open, \ |
193 | .llseek = generic_file_llseek, \ | 187 | .llseek = generic_file_llseek, \ |
194 | }; | 188 | }; |
195 | 189 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 5b0d888f746b..8d80e233bc7a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -46,8 +46,8 @@ | |||
46 | #include "iwl-prph.h" | 46 | #include "iwl-prph.h" |
47 | 47 | ||
48 | /* Highest firmware API version supported */ | 48 | /* Highest firmware API version supported */ |
49 | #define IWL1000_UCODE_API_MAX 6 | 49 | #define IWL1000_UCODE_API_MAX 5 |
50 | #define IWL100_UCODE_API_MAX 6 | 50 | #define IWL100_UCODE_API_MAX 5 |
51 | 51 | ||
52 | /* Oldest version we won't warn about */ | 52 | /* Oldest version we won't warn about */ |
53 | #define IWL1000_UCODE_API_OK 5 | 53 | #define IWL1000_UCODE_API_OK 5 |
@@ -226,5 +226,5 @@ const struct iwl_cfg iwl100_bg_cfg = { | |||
226 | IWL_DEVICE_100, | 226 | IWL_DEVICE_100, |
227 | }; | 227 | }; |
228 | 228 | ||
229 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 229 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK)); |
230 | MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX)); | 230 | MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 5635b9e2c69e..ea108622e0bd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
@@ -51,10 +51,10 @@ | |||
51 | #define IWL135_UCODE_API_MAX 6 | 51 | #define IWL135_UCODE_API_MAX 6 |
52 | 52 | ||
53 | /* Oldest version we won't warn about */ | 53 | /* Oldest version we won't warn about */ |
54 | #define IWL2030_UCODE_API_OK 5 | 54 | #define IWL2030_UCODE_API_OK 6 |
55 | #define IWL2000_UCODE_API_OK 5 | 55 | #define IWL2000_UCODE_API_OK 6 |
56 | #define IWL105_UCODE_API_OK 5 | 56 | #define IWL105_UCODE_API_OK 6 |
57 | #define IWL135_UCODE_API_OK 5 | 57 | #define IWL135_UCODE_API_OK 6 |
58 | 58 | ||
59 | /* Lowest firmware API version supported */ | 59 | /* Lowest firmware API version supported */ |
60 | #define IWL2030_UCODE_API_MIN 5 | 60 | #define IWL2030_UCODE_API_MIN 5 |
@@ -328,7 +328,7 @@ const struct iwl_cfg iwl135_bgn_cfg = { | |||
328 | .ht_params = &iwl2000_ht_params, | 328 | .ht_params = &iwl2000_ht_params, |
329 | }; | 329 | }; |
330 | 330 | ||
331 | MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX)); | 331 | MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK)); |
332 | MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX)); | 332 | MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK)); |
333 | MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX)); | 333 | MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK)); |
334 | MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX)); | 334 | MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index a805e97b89af..de0920c74cdd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -51,6 +51,10 @@ | |||
51 | #define IWL5000_UCODE_API_MAX 5 | 51 | #define IWL5000_UCODE_API_MAX 5 |
52 | #define IWL5150_UCODE_API_MAX 2 | 52 | #define IWL5150_UCODE_API_MAX 2 |
53 | 53 | ||
54 | /* Oldest version we won't warn about */ | ||
55 | #define IWL5000_UCODE_API_OK 5 | ||
56 | #define IWL5150_UCODE_API_OK 2 | ||
57 | |||
54 | /* Lowest firmware API version supported */ | 58 | /* Lowest firmware API version supported */ |
55 | #define IWL5000_UCODE_API_MIN 1 | 59 | #define IWL5000_UCODE_API_MIN 1 |
56 | #define IWL5150_UCODE_API_MIN 1 | 60 | #define IWL5150_UCODE_API_MIN 1 |
@@ -326,6 +330,7 @@ static const struct iwl_ht_params iwl5000_ht_params = { | |||
326 | #define IWL_DEVICE_5000 \ | 330 | #define IWL_DEVICE_5000 \ |
327 | .fw_name_pre = IWL5000_FW_PRE, \ | 331 | .fw_name_pre = IWL5000_FW_PRE, \ |
328 | .ucode_api_max = IWL5000_UCODE_API_MAX, \ | 332 | .ucode_api_max = IWL5000_UCODE_API_MAX, \ |
333 | .ucode_api_ok = IWL5000_UCODE_API_OK, \ | ||
329 | .ucode_api_min = IWL5000_UCODE_API_MIN, \ | 334 | .ucode_api_min = IWL5000_UCODE_API_MIN, \ |
330 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 335 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
331 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 336 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
@@ -371,6 +376,7 @@ const struct iwl_cfg iwl5350_agn_cfg = { | |||
371 | .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", | 376 | .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", |
372 | .fw_name_pre = IWL5000_FW_PRE, | 377 | .fw_name_pre = IWL5000_FW_PRE, |
373 | .ucode_api_max = IWL5000_UCODE_API_MAX, | 378 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
379 | .ucode_api_ok = IWL5000_UCODE_API_OK, | ||
374 | .ucode_api_min = IWL5000_UCODE_API_MIN, | 380 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
375 | .max_inst_size = IWLAGN_RTC_INST_SIZE, | 381 | .max_inst_size = IWLAGN_RTC_INST_SIZE, |
376 | .max_data_size = IWLAGN_RTC_DATA_SIZE, | 382 | .max_data_size = IWLAGN_RTC_DATA_SIZE, |
@@ -386,6 +392,7 @@ const struct iwl_cfg iwl5350_agn_cfg = { | |||
386 | #define IWL_DEVICE_5150 \ | 392 | #define IWL_DEVICE_5150 \ |
387 | .fw_name_pre = IWL5150_FW_PRE, \ | 393 | .fw_name_pre = IWL5150_FW_PRE, \ |
388 | .ucode_api_max = IWL5150_UCODE_API_MAX, \ | 394 | .ucode_api_max = IWL5150_UCODE_API_MAX, \ |
395 | .ucode_api_ok = IWL5150_UCODE_API_OK, \ | ||
389 | .ucode_api_min = IWL5150_UCODE_API_MIN, \ | 396 | .ucode_api_min = IWL5150_UCODE_API_MIN, \ |
390 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ | 397 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
391 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ | 398 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
@@ -409,5 +416,5 @@ const struct iwl_cfg iwl5150_abg_cfg = { | |||
409 | IWL_DEVICE_5150, | 416 | IWL_DEVICE_5150, |
410 | }; | 417 | }; |
411 | 418 | ||
412 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); | 419 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK)); |
413 | MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); | 420 | MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 64060cd738b5..f0c91505a7f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -53,6 +53,8 @@ | |||
53 | /* Oldest version we won't warn about */ | 53 | /* Oldest version we won't warn about */ |
54 | #define IWL6000_UCODE_API_OK 4 | 54 | #define IWL6000_UCODE_API_OK 4 |
55 | #define IWL6000G2_UCODE_API_OK 5 | 55 | #define IWL6000G2_UCODE_API_OK 5 |
56 | #define IWL6050_UCODE_API_OK 5 | ||
57 | #define IWL6000G2B_UCODE_API_OK 6 | ||
56 | 58 | ||
57 | /* Lowest firmware API version supported */ | 59 | /* Lowest firmware API version supported */ |
58 | #define IWL6000_UCODE_API_MIN 4 | 60 | #define IWL6000_UCODE_API_MIN 4 |
@@ -388,7 +390,7 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = { | |||
388 | #define IWL_DEVICE_6030 \ | 390 | #define IWL_DEVICE_6030 \ |
389 | .fw_name_pre = IWL6030_FW_PRE, \ | 391 | .fw_name_pre = IWL6030_FW_PRE, \ |
390 | .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ | 392 | .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ |
391 | .ucode_api_ok = IWL6000G2_UCODE_API_OK, \ | 393 | .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \ |
392 | .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ | 394 | .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ |
393 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | 395 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
394 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | 396 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
@@ -557,6 +559,6 @@ const struct iwl_cfg iwl6000_3agn_cfg = { | |||
557 | }; | 559 | }; |
558 | 560 | ||
559 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK)); | 561 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK)); |
560 | MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); | 562 | MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK)); |
561 | MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); | 563 | MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK)); |
562 | MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); | 564 | MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 53f8c51cfcdb..7e590b349dd7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -3083,11 +3083,6 @@ static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta, | |||
3083 | } | 3083 | } |
3084 | 3084 | ||
3085 | #ifdef CONFIG_MAC80211_DEBUGFS | 3085 | #ifdef CONFIG_MAC80211_DEBUGFS |
3086 | static int open_file_generic(struct inode *inode, struct file *file) | ||
3087 | { | ||
3088 | file->private_data = inode->i_private; | ||
3089 | return 0; | ||
3090 | } | ||
3091 | static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | 3086 | static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, |
3092 | u32 *rate_n_flags, int index) | 3087 | u32 *rate_n_flags, int index) |
3093 | { | 3088 | { |
@@ -3226,7 +3221,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | |||
3226 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { | 3221 | static const struct file_operations rs_sta_dbgfs_scale_table_ops = { |
3227 | .write = rs_sta_dbgfs_scale_table_write, | 3222 | .write = rs_sta_dbgfs_scale_table_write, |
3228 | .read = rs_sta_dbgfs_scale_table_read, | 3223 | .read = rs_sta_dbgfs_scale_table_read, |
3229 | .open = open_file_generic, | 3224 | .open = simple_open, |
3230 | .llseek = default_llseek, | 3225 | .llseek = default_llseek, |
3231 | }; | 3226 | }; |
3232 | static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, | 3227 | static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, |
@@ -3269,7 +3264,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, | |||
3269 | 3264 | ||
3270 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | 3265 | static const struct file_operations rs_sta_dbgfs_stats_table_ops = { |
3271 | .read = rs_sta_dbgfs_stats_table_read, | 3266 | .read = rs_sta_dbgfs_stats_table_read, |
3272 | .open = open_file_generic, | 3267 | .open = simple_open, |
3273 | .llseek = default_llseek, | 3268 | .llseek = default_llseek, |
3274 | }; | 3269 | }; |
3275 | 3270 | ||
@@ -3295,7 +3290,7 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file, | |||
3295 | 3290 | ||
3296 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { | 3291 | static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = { |
3297 | .read = rs_sta_dbgfs_rate_scale_data_read, | 3292 | .read = rs_sta_dbgfs_rate_scale_data_read, |
3298 | .open = open_file_generic, | 3293 | .open = simple_open, |
3299 | .llseek = default_llseek, | 3294 | .llseek = default_llseek, |
3300 | }; | 3295 | }; |
3301 | 3296 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index f1226dbf789d..2a9a16f901c3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -863,7 +863,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work) | |||
863 | 863 | ||
864 | void iwlagn_prepare_restart(struct iwl_priv *priv) | 864 | void iwlagn_prepare_restart(struct iwl_priv *priv) |
865 | { | 865 | { |
866 | struct iwl_rxon_context *ctx; | ||
867 | bool bt_full_concurrent; | 866 | bool bt_full_concurrent; |
868 | u8 bt_ci_compliance; | 867 | u8 bt_ci_compliance; |
869 | u8 bt_load; | 868 | u8 bt_load; |
@@ -872,8 +871,6 @@ void iwlagn_prepare_restart(struct iwl_priv *priv) | |||
872 | 871 | ||
873 | lockdep_assert_held(&priv->mutex); | 872 | lockdep_assert_held(&priv->mutex); |
874 | 873 | ||
875 | for_each_context(priv, ctx) | ||
876 | ctx->vif = NULL; | ||
877 | priv->is_open = 0; | 874 | priv->is_open = 0; |
878 | 875 | ||
879 | /* | 876 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index b7b1c04f2fba..2bbaebd99ad4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -84,17 +84,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file, \ | |||
84 | size_t count, loff_t *ppos); | 84 | size_t count, loff_t *ppos); |
85 | 85 | ||
86 | 86 | ||
87 | static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) | ||
88 | { | ||
89 | file->private_data = inode->i_private; | ||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | #define DEBUGFS_READ_FILE_OPS(name) \ | 87 | #define DEBUGFS_READ_FILE_OPS(name) \ |
94 | DEBUGFS_READ_FUNC(name); \ | 88 | DEBUGFS_READ_FUNC(name); \ |
95 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 89 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
96 | .read = iwl_dbgfs_##name##_read, \ | 90 | .read = iwl_dbgfs_##name##_read, \ |
97 | .open = iwl_dbgfs_open_file_generic, \ | 91 | .open = simple_open, \ |
98 | .llseek = generic_file_llseek, \ | 92 | .llseek = generic_file_llseek, \ |
99 | }; | 93 | }; |
100 | 94 | ||
@@ -102,7 +96,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
102 | DEBUGFS_WRITE_FUNC(name); \ | 96 | DEBUGFS_WRITE_FUNC(name); \ |
103 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 97 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
104 | .write = iwl_dbgfs_##name##_write, \ | 98 | .write = iwl_dbgfs_##name##_write, \ |
105 | .open = iwl_dbgfs_open_file_generic, \ | 99 | .open = simple_open, \ |
106 | .llseek = generic_file_llseek, \ | 100 | .llseek = generic_file_llseek, \ |
107 | }; | 101 | }; |
108 | 102 | ||
@@ -113,7 +107,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
113 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 107 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
114 | .write = iwl_dbgfs_##name##_write, \ | 108 | .write = iwl_dbgfs_##name##_write, \ |
115 | .read = iwl_dbgfs_##name##_read, \ | 109 | .read = iwl_dbgfs_##name##_read, \ |
116 | .open = iwl_dbgfs_open_file_generic, \ | 110 | .open = simple_open, \ |
117 | .llseek = generic_file_llseek, \ | 111 | .llseek = generic_file_llseek, \ |
118 | }; | 112 | }; |
119 | 113 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index 90208094b8eb..74bce97a8600 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -104,15 +104,29 @@ | |||
104 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 | 104 | * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 |
105 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte | 105 | * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte |
106 | * aligned (address bits 0-7 must be 0). | 106 | * aligned (address bits 0-7 must be 0). |
107 | * Later devices have 20 (5000 series) or 30 (higher) queues, but the registers | ||
108 | * for them are in different places. | ||
107 | * | 109 | * |
108 | * Bit fields in each pointer register: | 110 | * Bit fields in each pointer register: |
109 | * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned | 111 | * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned |
110 | */ | 112 | */ |
111 | #define FH_MEM_CBBC_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0) | 113 | #define FH_MEM_CBBC_0_15_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0) |
112 | #define FH_MEM_CBBC_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10) | 114 | #define FH_MEM_CBBC_0_15_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10) |
113 | 115 | #define FH_MEM_CBBC_16_19_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xBF0) | |
114 | /* Find TFD CB base pointer for given queue (range 0-15). */ | 116 | #define FH_MEM_CBBC_16_19_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xC00) |
115 | #define FH_MEM_CBBC_QUEUE(x) (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4) | 117 | #define FH_MEM_CBBC_20_31_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xB20) |
118 | #define FH_MEM_CBBC_20_31_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xB80) | ||
119 | |||
120 | /* Find TFD CB base pointer for given queue */ | ||
121 | static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl) | ||
122 | { | ||
123 | if (chnl < 16) | ||
124 | return FH_MEM_CBBC_0_15_LOWER_BOUND + 4 * chnl; | ||
125 | if (chnl < 20) | ||
126 | return FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16); | ||
127 | WARN_ON_ONCE(chnl >= 32); | ||
128 | return FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20); | ||
129 | } | ||
116 | 130 | ||
117 | 131 | ||
118 | /** | 132 | /** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index b6805f8e9a01..c24a7134a6f9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -1244,6 +1244,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, | |||
1244 | struct iwl_rxon_context *tmp, *ctx = NULL; | 1244 | struct iwl_rxon_context *tmp, *ctx = NULL; |
1245 | int err; | 1245 | int err; |
1246 | enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); | 1246 | enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); |
1247 | bool reset = false; | ||
1247 | 1248 | ||
1248 | IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", | 1249 | IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", |
1249 | viftype, vif->addr); | 1250 | viftype, vif->addr); |
@@ -1265,6 +1266,13 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, | |||
1265 | tmp->interface_modes | tmp->exclusive_interface_modes; | 1266 | tmp->interface_modes | tmp->exclusive_interface_modes; |
1266 | 1267 | ||
1267 | if (tmp->vif) { | 1268 | if (tmp->vif) { |
1269 | /* On reset we need to add the same interface again */ | ||
1270 | if (tmp->vif == vif) { | ||
1271 | reset = true; | ||
1272 | ctx = tmp; | ||
1273 | break; | ||
1274 | } | ||
1275 | |||
1268 | /* check if this busy context is exclusive */ | 1276 | /* check if this busy context is exclusive */ |
1269 | if (tmp->exclusive_interface_modes & | 1277 | if (tmp->exclusive_interface_modes & |
1270 | BIT(tmp->vif->type)) { | 1278 | BIT(tmp->vif->type)) { |
@@ -1291,7 +1299,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, | |||
1291 | ctx->vif = vif; | 1299 | ctx->vif = vif; |
1292 | 1300 | ||
1293 | err = iwl_setup_interface(priv, ctx); | 1301 | err = iwl_setup_interface(priv, ctx); |
1294 | if (!err) | 1302 | if (!err || reset) |
1295 | goto out; | 1303 | goto out; |
1296 | 1304 | ||
1297 | ctx->vif = NULL; | 1305 | ctx->vif = NULL; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h index 75dc20bd965b..3b1069290fa9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/drivers/net/wireless/iwlwifi/iwl-prph.h | |||
@@ -223,12 +223,33 @@ | |||
223 | #define SCD_AIT (SCD_BASE + 0x0c) | 223 | #define SCD_AIT (SCD_BASE + 0x0c) |
224 | #define SCD_TXFACT (SCD_BASE + 0x10) | 224 | #define SCD_TXFACT (SCD_BASE + 0x10) |
225 | #define SCD_ACTIVE (SCD_BASE + 0x14) | 225 | #define SCD_ACTIVE (SCD_BASE + 0x14) |
226 | #define SCD_QUEUE_WRPTR(x) (SCD_BASE + 0x18 + (x) * 4) | ||
227 | #define SCD_QUEUE_RDPTR(x) (SCD_BASE + 0x68 + (x) * 4) | ||
228 | #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) | 226 | #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) |
229 | #define SCD_AGGR_SEL (SCD_BASE + 0x248) | 227 | #define SCD_AGGR_SEL (SCD_BASE + 0x248) |
230 | #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) | 228 | #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) |
231 | #define SCD_QUEUE_STATUS_BITS(x) (SCD_BASE + 0x10c + (x) * 4) | 229 | |
230 | static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl) | ||
231 | { | ||
232 | if (chnl < 20) | ||
233 | return SCD_BASE + 0x18 + chnl * 4; | ||
234 | WARN_ON_ONCE(chnl >= 32); | ||
235 | return SCD_BASE + 0x284 + (chnl - 20) * 4; | ||
236 | } | ||
237 | |||
238 | static inline unsigned int SCD_QUEUE_RDPTR(unsigned int chnl) | ||
239 | { | ||
240 | if (chnl < 20) | ||
241 | return SCD_BASE + 0x68 + chnl * 4; | ||
242 | WARN_ON_ONCE(chnl >= 32); | ||
243 | return SCD_BASE + 0x2B4 + (chnl - 20) * 4; | ||
244 | } | ||
245 | |||
246 | static inline unsigned int SCD_QUEUE_STATUS_BITS(unsigned int chnl) | ||
247 | { | ||
248 | if (chnl < 20) | ||
249 | return SCD_BASE + 0x10c + chnl * 4; | ||
250 | WARN_ON_ONCE(chnl >= 32); | ||
251 | return SCD_BASE + 0x384 + (chnl - 20) * 4; | ||
252 | } | ||
232 | 253 | ||
233 | /*********************** END TX SCHEDULER *************************************/ | 254 | /*********************** END TX SCHEDULER *************************************/ |
234 | 255 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index b4f796c82e1e..4d7b30d3e648 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1898,17 +1898,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file, \ | |||
1898 | size_t count, loff_t *ppos); | 1898 | size_t count, loff_t *ppos); |
1899 | 1899 | ||
1900 | 1900 | ||
1901 | static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file) | ||
1902 | { | ||
1903 | file->private_data = inode->i_private; | ||
1904 | return 0; | ||
1905 | } | ||
1906 | |||
1907 | #define DEBUGFS_READ_FILE_OPS(name) \ | 1901 | #define DEBUGFS_READ_FILE_OPS(name) \ |
1908 | DEBUGFS_READ_FUNC(name); \ | 1902 | DEBUGFS_READ_FUNC(name); \ |
1909 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 1903 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
1910 | .read = iwl_dbgfs_##name##_read, \ | 1904 | .read = iwl_dbgfs_##name##_read, \ |
1911 | .open = iwl_dbgfs_open_file_generic, \ | 1905 | .open = simple_open, \ |
1912 | .llseek = generic_file_llseek, \ | 1906 | .llseek = generic_file_llseek, \ |
1913 | }; | 1907 | }; |
1914 | 1908 | ||
@@ -1916,7 +1910,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
1916 | DEBUGFS_WRITE_FUNC(name); \ | 1910 | DEBUGFS_WRITE_FUNC(name); \ |
1917 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 1911 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
1918 | .write = iwl_dbgfs_##name##_write, \ | 1912 | .write = iwl_dbgfs_##name##_write, \ |
1919 | .open = iwl_dbgfs_open_file_generic, \ | 1913 | .open = simple_open, \ |
1920 | .llseek = generic_file_llseek, \ | 1914 | .llseek = generic_file_llseek, \ |
1921 | }; | 1915 | }; |
1922 | 1916 | ||
@@ -1926,7 +1920,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \ | |||
1926 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ | 1920 | static const struct file_operations iwl_dbgfs_##name##_ops = { \ |
1927 | .write = iwl_dbgfs_##name##_write, \ | 1921 | .write = iwl_dbgfs_##name##_write, \ |
1928 | .read = iwl_dbgfs_##name##_read, \ | 1922 | .read = iwl_dbgfs_##name##_read, \ |
1929 | .open = iwl_dbgfs_open_file_generic, \ | 1923 | .open = simple_open, \ |
1930 | .llseek = generic_file_llseek, \ | 1924 | .llseek = generic_file_llseek, \ |
1931 | }; | 1925 | }; |
1932 | 1926 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c index 87eef5773a02..b6199d124bb9 100644 --- a/drivers/net/wireless/iwmc3200wifi/debugfs.c +++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c | |||
@@ -99,12 +99,6 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_iwm_dbg_modules, | |||
99 | iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write, | 99 | iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write, |
100 | "%llu\n"); | 100 | "%llu\n"); |
101 | 101 | ||
102 | static int iwm_generic_open(struct inode *inode, struct file *filp) | ||
103 | { | ||
104 | filp->private_data = inode->i_private; | ||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | 102 | ||
109 | static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer, | 103 | static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer, |
110 | size_t count, loff_t *ppos) | 104 | size_t count, loff_t *ppos) |
@@ -401,28 +395,28 @@ out: | |||
401 | 395 | ||
402 | static const struct file_operations iwm_debugfs_txq_fops = { | 396 | static const struct file_operations iwm_debugfs_txq_fops = { |
403 | .owner = THIS_MODULE, | 397 | .owner = THIS_MODULE, |
404 | .open = iwm_generic_open, | 398 | .open = simple_open, |
405 | .read = iwm_debugfs_txq_read, | 399 | .read = iwm_debugfs_txq_read, |
406 | .llseek = default_llseek, | 400 | .llseek = default_llseek, |
407 | }; | 401 | }; |
408 | 402 | ||
409 | static const struct file_operations iwm_debugfs_tx_credit_fops = { | 403 | static const struct file_operations iwm_debugfs_tx_credit_fops = { |
410 | .owner = THIS_MODULE, | 404 | .owner = THIS_MODULE, |
411 | .open = iwm_generic_open, | 405 | .open = simple_open, |
412 | .read = iwm_debugfs_tx_credit_read, | 406 | .read = iwm_debugfs_tx_credit_read, |
413 | .llseek = default_llseek, | 407 | .llseek = default_llseek, |
414 | }; | 408 | }; |
415 | 409 | ||
416 | static const struct file_operations iwm_debugfs_rx_ticket_fops = { | 410 | static const struct file_operations iwm_debugfs_rx_ticket_fops = { |
417 | .owner = THIS_MODULE, | 411 | .owner = THIS_MODULE, |
418 | .open = iwm_generic_open, | 412 | .open = simple_open, |
419 | .read = iwm_debugfs_rx_ticket_read, | 413 | .read = iwm_debugfs_rx_ticket_read, |
420 | .llseek = default_llseek, | 414 | .llseek = default_llseek, |
421 | }; | 415 | }; |
422 | 416 | ||
423 | static const struct file_operations iwm_debugfs_fw_err_fops = { | 417 | static const struct file_operations iwm_debugfs_fw_err_fops = { |
424 | .owner = THIS_MODULE, | 418 | .owner = THIS_MODULE, |
425 | .open = iwm_generic_open, | 419 | .open = simple_open, |
426 | .read = iwm_debugfs_fw_err_read, | 420 | .read = iwm_debugfs_fw_err_read, |
427 | .llseek = default_llseek, | 421 | .llseek = default_llseek, |
428 | }; | 422 | }; |
diff --git a/drivers/net/wireless/iwmc3200wifi/sdio.c b/drivers/net/wireless/iwmc3200wifi/sdio.c index 764b40dd24ad..0042f204b07f 100644 --- a/drivers/net/wireless/iwmc3200wifi/sdio.c +++ b/drivers/net/wireless/iwmc3200wifi/sdio.c | |||
@@ -264,13 +264,6 @@ static int if_sdio_send_chunk(struct iwm_priv *iwm, u8 *buf, int count) | |||
264 | return ret; | 264 | return ret; |
265 | } | 265 | } |
266 | 266 | ||
267 | /* debugfs hooks */ | ||
268 | static int iwm_debugfs_sdio_open(struct inode *inode, struct file *filp) | ||
269 | { | ||
270 | filp->private_data = inode->i_private; | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer, | 267 | static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer, |
275 | size_t count, loff_t *ppos) | 268 | size_t count, loff_t *ppos) |
276 | { | 269 | { |
@@ -363,7 +356,7 @@ err: | |||
363 | 356 | ||
364 | static const struct file_operations iwm_debugfs_sdio_fops = { | 357 | static const struct file_operations iwm_debugfs_sdio_fops = { |
365 | .owner = THIS_MODULE, | 358 | .owner = THIS_MODULE, |
366 | .open = iwm_debugfs_sdio_open, | 359 | .open = simple_open, |
367 | .read = iwm_debugfs_sdio_read, | 360 | .read = iwm_debugfs_sdio_read, |
368 | .llseek = default_llseek, | 361 | .llseek = default_llseek, |
369 | }; | 362 | }; |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 3fa1ecebadfd..2fa879b015b6 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = { | |||
103 | * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 | 103 | * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 |
104 | * in the firmware spec | 104 | * in the firmware spec |
105 | */ | 105 | */ |
106 | static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type) | 106 | static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type) |
107 | { | 107 | { |
108 | int ret = -ENOTSUPP; | 108 | int ret = -ENOTSUPP; |
109 | 109 | ||
@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1411 | goto done; | 1411 | goto done; |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | lbs_set_authtype(priv, sme); | 1414 | ret = lbs_set_authtype(priv, sme); |
1415 | if (ret == -ENOTSUPP) { | ||
1416 | wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type); | ||
1417 | goto done; | ||
1418 | } | ||
1419 | |||
1415 | lbs_set_radio(priv, preamble, 1); | 1420 | lbs_set_radio(priv, preamble, 1); |
1416 | 1421 | ||
1417 | /* Do the actual association */ | 1422 | /* Do the actual association */ |
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index c192671610fc..a06cc283e23d 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -21,12 +21,6 @@ static char *szStates[] = { | |||
21 | static void lbs_debug_init(struct lbs_private *priv); | 21 | static void lbs_debug_init(struct lbs_private *priv); |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | static int open_file_generic(struct inode *inode, struct file *file) | ||
25 | { | ||
26 | file->private_data = inode->i_private; | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | static ssize_t write_file_dummy(struct file *file, const char __user *buf, | 24 | static ssize_t write_file_dummy(struct file *file, const char __user *buf, |
31 | size_t count, loff_t *ppos) | 25 | size_t count, loff_t *ppos) |
32 | { | 26 | { |
@@ -696,7 +690,7 @@ out_unlock: | |||
696 | 690 | ||
697 | #define FOPS(fread, fwrite) { \ | 691 | #define FOPS(fread, fwrite) { \ |
698 | .owner = THIS_MODULE, \ | 692 | .owner = THIS_MODULE, \ |
699 | .open = open_file_generic, \ | 693 | .open = simple_open, \ |
700 | .read = (fread), \ | 694 | .read = (fread), \ |
701 | .write = (fwrite), \ | 695 | .write = (fwrite), \ |
702 | .llseek = generic_file_llseek, \ | 696 | .llseek = generic_file_llseek, \ |
@@ -962,7 +956,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf, | |||
962 | 956 | ||
963 | static const struct file_operations lbs_debug_fops = { | 957 | static const struct file_operations lbs_debug_fops = { |
964 | .owner = THIS_MODULE, | 958 | .owner = THIS_MODULE, |
965 | .open = open_file_generic, | 959 | .open = simple_open, |
966 | .write = lbs_debugfs_write, | 960 | .write = lbs_debugfs_write, |
967 | .read = lbs_debugfs_read, | 961 | .read = lbs_debugfs_read, |
968 | .llseek = default_llseek, | 962 | .llseek = default_llseek, |
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c index d26a78b6b3c4..1a845074c52a 100644 --- a/drivers/net/wireless/mwifiex/debugfs.c +++ b/drivers/net/wireless/mwifiex/debugfs.c | |||
@@ -140,18 +140,6 @@ static struct mwifiex_debug_data items[] = { | |||
140 | static int num_of_items = ARRAY_SIZE(items); | 140 | static int num_of_items = ARRAY_SIZE(items); |
141 | 141 | ||
142 | /* | 142 | /* |
143 | * Generic proc file open handler. | ||
144 | * | ||
145 | * This function is called every time a file is accessed for read or write. | ||
146 | */ | ||
147 | static int | ||
148 | mwifiex_open_generic(struct inode *inode, struct file *file) | ||
149 | { | ||
150 | file->private_data = inode->i_private; | ||
151 | return 0; | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * Proc info file read handler. | 143 | * Proc info file read handler. |
156 | * | 144 | * |
157 | * This function is called when the 'info' file is opened for reading. | 145 | * This function is called when the 'info' file is opened for reading. |
@@ -676,19 +664,19 @@ done: | |||
676 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ | 664 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ |
677 | .read = mwifiex_##name##_read, \ | 665 | .read = mwifiex_##name##_read, \ |
678 | .write = mwifiex_##name##_write, \ | 666 | .write = mwifiex_##name##_write, \ |
679 | .open = mwifiex_open_generic, \ | 667 | .open = simple_open, \ |
680 | }; | 668 | }; |
681 | 669 | ||
682 | #define MWIFIEX_DFS_FILE_READ_OPS(name) \ | 670 | #define MWIFIEX_DFS_FILE_READ_OPS(name) \ |
683 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ | 671 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ |
684 | .read = mwifiex_##name##_read, \ | 672 | .read = mwifiex_##name##_read, \ |
685 | .open = mwifiex_open_generic, \ | 673 | .open = simple_open, \ |
686 | }; | 674 | }; |
687 | 675 | ||
688 | #define MWIFIEX_DFS_FILE_WRITE_OPS(name) \ | 676 | #define MWIFIEX_DFS_FILE_WRITE_OPS(name) \ |
689 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ | 677 | static const struct file_operations mwifiex_dfs_##name##_fops = { \ |
690 | .write = mwifiex_##name##_write, \ | 678 | .write = mwifiex_##name##_write, \ |
691 | .open = mwifiex_open_generic, \ | 679 | .open = simple_open, \ |
692 | }; | 680 | }; |
693 | 681 | ||
694 | 682 | ||
diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h index 445ff21772e2..2f218f9a3fd3 100644 --- a/drivers/net/wireless/mwifiex/pcie.h +++ b/drivers/net/wireless/mwifiex/pcie.h | |||
@@ -48,15 +48,15 @@ | |||
48 | #define PCIE_HOST_INT_STATUS_MASK 0xC3C | 48 | #define PCIE_HOST_INT_STATUS_MASK 0xC3C |
49 | #define PCIE_SCRATCH_2_REG 0xC40 | 49 | #define PCIE_SCRATCH_2_REG 0xC40 |
50 | #define PCIE_SCRATCH_3_REG 0xC44 | 50 | #define PCIE_SCRATCH_3_REG 0xC44 |
51 | #define PCIE_SCRATCH_4_REG 0xCC0 | 51 | #define PCIE_SCRATCH_4_REG 0xCD0 |
52 | #define PCIE_SCRATCH_5_REG 0xCC4 | 52 | #define PCIE_SCRATCH_5_REG 0xCD4 |
53 | #define PCIE_SCRATCH_6_REG 0xCC8 | 53 | #define PCIE_SCRATCH_6_REG 0xCD8 |
54 | #define PCIE_SCRATCH_7_REG 0xCCC | 54 | #define PCIE_SCRATCH_7_REG 0xCDC |
55 | #define PCIE_SCRATCH_8_REG 0xCD0 | 55 | #define PCIE_SCRATCH_8_REG 0xCE0 |
56 | #define PCIE_SCRATCH_9_REG 0xCD4 | 56 | #define PCIE_SCRATCH_9_REG 0xCE4 |
57 | #define PCIE_SCRATCH_10_REG 0xCD8 | 57 | #define PCIE_SCRATCH_10_REG 0xCE8 |
58 | #define PCIE_SCRATCH_11_REG 0xCDC | 58 | #define PCIE_SCRATCH_11_REG 0xCEC |
59 | #define PCIE_SCRATCH_12_REG 0xCE0 | 59 | #define PCIE_SCRATCH_12_REG 0xCF0 |
60 | 60 | ||
61 | #define CPU_INTR_DNLD_RDY BIT(0) | 61 | #define CPU_INTR_DNLD_RDY BIT(0) |
62 | #define CPU_INTR_DOOR_BELL BIT(1) | 62 | #define CPU_INTR_DOOR_BELL BIT(1) |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index dd6c64ac406e..88e3ad2d1db8 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -1336,6 +1336,10 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf, | |||
1336 | unsigned long flags; | 1336 | unsigned long flags; |
1337 | 1337 | ||
1338 | sd = kmalloc(sizeof(*sd), GFP_ATOMIC); | 1338 | sd = kmalloc(sizeof(*sd), GFP_ATOMIC); |
1339 | if (!sd) { | ||
1340 | printk(KERN_ERR "%s: failed to alloc memory\n", __func__); | ||
1341 | return; | ||
1342 | } | ||
1339 | sd->buf = buf; | 1343 | sd->buf = buf; |
1340 | sd->len = len; | 1344 | sd->len = len; |
1341 | sd->type = type; | 1345 | sd->type = type; |
@@ -1353,6 +1357,10 @@ static void qabort_scan(struct orinoco_private *priv) | |||
1353 | unsigned long flags; | 1357 | unsigned long flags; |
1354 | 1358 | ||
1355 | sd = kmalloc(sizeof(*sd), GFP_ATOMIC); | 1359 | sd = kmalloc(sizeof(*sd), GFP_ATOMIC); |
1360 | if (!sd) { | ||
1361 | printk(KERN_ERR "%s: failed to alloc memory\n", __func__); | ||
1362 | return; | ||
1363 | } | ||
1356 | sd->len = -1; /* Abort */ | 1364 | sd->len = -1; /* Abort */ |
1357 | 1365 | ||
1358 | spin_lock_irqsave(&priv->scan_lock, flags); | 1366 | spin_lock_irqsave(&priv->scan_lock, flags); |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index cd490abced91..001735f7a661 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -163,7 +163,13 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev, | |||
163 | 163 | ||
164 | /* Reschedule urb to read TX status again instantly */ | 164 | /* Reschedule urb to read TX status again instantly */ |
165 | return true; | 165 | return true; |
166 | } else if (rt2800usb_txstatus_pending(rt2x00dev)) { | 166 | } |
167 | |||
168 | /* Check if there is any entry that timedout waiting on TX status */ | ||
169 | if (rt2800usb_txstatus_timeout(rt2x00dev)) | ||
170 | queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work); | ||
171 | |||
172 | if (rt2800usb_txstatus_pending(rt2x00dev)) { | ||
167 | /* Read register after 250 us */ | 173 | /* Read register after 250 us */ |
168 | hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000), | 174 | hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000), |
169 | HRTIMER_MODE_REL); | 175 | HRTIMER_MODE_REL); |
@@ -178,7 +184,7 @@ stop_reading: | |||
178 | * here again if status reading is needed. | 184 | * here again if status reading is needed. |
179 | */ | 185 | */ |
180 | if (rt2800usb_txstatus_pending(rt2x00dev) && | 186 | if (rt2800usb_txstatus_pending(rt2x00dev) && |
181 | test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags)) | 187 | !test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags)) |
182 | return true; | 188 | return true; |
183 | else | 189 | else |
184 | return false; | 190 | return false; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index fc9901e027c1..90cc5e772650 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1062,11 +1062,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) | |||
1062 | 1062 | ||
1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); | 1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); |
1064 | 1064 | ||
1065 | /* | ||
1066 | * Register the extra components. | ||
1067 | */ | ||
1068 | rt2x00rfkill_register(rt2x00dev); | ||
1069 | |||
1070 | return 0; | 1065 | return 0; |
1071 | } | 1066 | } |
1072 | 1067 | ||
@@ -1210,6 +1205,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
1210 | rt2x00link_register(rt2x00dev); | 1205 | rt2x00link_register(rt2x00dev); |
1211 | rt2x00leds_register(rt2x00dev); | 1206 | rt2x00leds_register(rt2x00dev); |
1212 | rt2x00debug_register(rt2x00dev); | 1207 | rt2x00debug_register(rt2x00dev); |
1208 | rt2x00rfkill_register(rt2x00dev); | ||
1213 | 1209 | ||
1214 | return 0; | 1210 | return 0; |
1215 | 1211 | ||
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 510023554e5f..e54488db0e10 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, | |||
838 | __le16 fc = hdr->frame_control; | 838 | __le16 fc = hdr->frame_control; |
839 | 839 | ||
840 | txrate = ieee80211_get_tx_rate(hw, info); | 840 | txrate = ieee80211_get_tx_rate(hw, info); |
841 | tcb_desc->hw_rate = txrate->hw_value; | 841 | if (txrate) |
842 | tcb_desc->hw_rate = txrate->hw_value; | ||
843 | else | ||
844 | tcb_desc->hw_rate = 0; | ||
842 | 845 | ||
843 | if (ieee80211_is_data(fc)) { | 846 | if (ieee80211_is_data(fc)) { |
844 | /* | 847 | /* |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 07dd38efe62a..cc15fdb36060 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -912,8 +912,13 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | 912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); |
913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
914 | pskb = __skb_dequeue(&ring->queue); | 914 | pskb = __skb_dequeue(&ring->queue); |
915 | if (pskb) | 915 | if (pskb) { |
916 | struct rtl_tx_desc *entry = &ring->desc[ring->idx]; | ||
917 | pci_unmap_single(rtlpci->pdev, rtlpriv->cfg->ops->get_desc( | ||
918 | (u8 *) entry, true, HW_DESC_TXBUFF_ADDR), | ||
919 | pskb->len, PCI_DMA_TODEVICE); | ||
916 | kfree_skb(pskb); | 920 | kfree_skb(pskb); |
921 | } | ||
917 | 922 | ||
918 | /*NB: the beacon data buffer must be 32-bit aligned. */ | 923 | /*NB: the beacon data buffer must be 32-bit aligned. */ |
919 | pskb = ieee80211_beacon_get(hw, mac->vif); | 924 | pskb = ieee80211_beacon_get(hw, mac->vif); |
@@ -1936,6 +1941,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) | |||
1936 | rtl_deinit_deferred_work(hw); | 1941 | rtl_deinit_deferred_work(hw); |
1937 | rtlpriv->intf_ops->adapter_stop(hw); | 1942 | rtlpriv->intf_ops->adapter_stop(hw); |
1938 | } | 1943 | } |
1944 | rtlpriv->cfg->ops->disable_interrupt(hw); | ||
1939 | 1945 | ||
1940 | /*deinit rfkill */ | 1946 | /*deinit rfkill */ |
1941 | rtl_deinit_rfkill(hw); | 1947 | rtl_deinit_rfkill(hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c index 1eec3a06d1f3..4c016241f340 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | |||
@@ -1893,7 +1893,7 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw) | |||
1893 | break; | 1893 | break; |
1894 | case IO_CMD_PAUSE_DM_BY_SCAN: | 1894 | case IO_CMD_PAUSE_DM_BY_SCAN: |
1895 | rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue; | 1895 | rtlphy->initgain_backup.xaagccore1 = dm_digtable.cur_igvalue; |
1896 | dm_digtable.cur_igvalue = 0x17; | 1896 | dm_digtable.cur_igvalue = 0x37; |
1897 | rtl92c_dm_write_dig(hw); | 1897 | rtl92c_dm_write_dig(hw); |
1898 | break; | 1898 | break; |
1899 | default: | 1899 | default: |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c index 34591eeb8376..28fc5fb8057b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c | |||
@@ -3077,7 +3077,7 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw) | |||
3077 | break; | 3077 | break; |
3078 | case IO_CMD_PAUSE_DM_BY_SCAN: | 3078 | case IO_CMD_PAUSE_DM_BY_SCAN: |
3079 | rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue; | 3079 | rtlphy->initgain_backup.xaagccore1 = de_digtable.cur_igvalue; |
3080 | de_digtable.cur_igvalue = 0x17; | 3080 | de_digtable.cur_igvalue = 0x37; |
3081 | rtl92d_dm_write_dig(hw); | 3081 | rtl92d_dm_write_dig(hw); |
3082 | break; | 3082 | break; |
3083 | default: | 3083 | default: |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 4898c502974d..480862c07f92 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -91,7 +91,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
91 | u8 tid; | 91 | u8 tid; |
92 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 92 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
94 | static int header_print; | ||
95 | 94 | ||
96 | rtlpriv->dm.dm_initialgain_enable = true; | 95 | rtlpriv->dm.dm_initialgain_enable = true; |
97 | rtlpriv->dm.dm_flag = 0; | 96 | rtlpriv->dm.dm_flag = 0; |
@@ -171,10 +170,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
171 | for (tid = 0; tid < 8; tid++) | 170 | for (tid = 0; tid < 8; tid++) |
172 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); | 171 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); |
173 | 172 | ||
174 | /* Only load firmware for first MAC */ | ||
175 | if (header_print) | ||
176 | return 0; | ||
177 | |||
178 | /* for firmware buf */ | 173 | /* for firmware buf */ |
179 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); | 174 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); |
180 | if (!rtlpriv->rtlhal.pfirmware) { | 175 | if (!rtlpriv->rtlhal.pfirmware) { |
@@ -186,7 +181,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
186 | rtlpriv->max_fw_size = 0x8000; | 181 | rtlpriv->max_fw_size = 0x8000; |
187 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); | 182 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); |
188 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); | 183 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); |
189 | header_print++; | ||
190 | 184 | ||
191 | /* request fw */ | 185 | /* request fw */ |
192 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, | 186 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 2e1e352864bb..d04dbda13f5a 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -124,46 +124,38 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, | |||
124 | return status; | 124 | return status; |
125 | } | 125 | } |
126 | 126 | ||
127 | static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len) | 127 | static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len) |
128 | { | 128 | { |
129 | struct device *dev = rtlpriv->io.dev; | ||
130 | struct usb_device *udev = to_usb_device(dev); | ||
129 | u8 request; | 131 | u8 request; |
130 | u16 wvalue; | 132 | u16 wvalue; |
131 | u16 index; | 133 | u16 index; |
132 | u32 *data; | 134 | __le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index]; |
133 | u32 ret; | ||
134 | 135 | ||
135 | data = kmalloc(sizeof(u32), GFP_KERNEL); | ||
136 | if (!data) | ||
137 | return -ENOMEM; | ||
138 | request = REALTEK_USB_VENQT_CMD_REQ; | 136 | request = REALTEK_USB_VENQT_CMD_REQ; |
139 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ | 137 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ |
140 | 138 | ||
141 | wvalue = (u16)addr; | 139 | wvalue = (u16)addr; |
142 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); | 140 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); |
143 | ret = le32_to_cpu(*data); | 141 | if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT) |
144 | kfree(data); | 142 | rtlpriv->usb_data_index = 0; |
145 | return ret; | 143 | return le32_to_cpu(*data); |
146 | } | 144 | } |
147 | 145 | ||
148 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) | 146 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) |
149 | { | 147 | { |
150 | struct device *dev = rtlpriv->io.dev; | 148 | return (u8)_usb_read_sync(rtlpriv, addr, 1); |
151 | |||
152 | return (u8)_usb_read_sync(to_usb_device(dev), addr, 1); | ||
153 | } | 149 | } |
154 | 150 | ||
155 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) | 151 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) |
156 | { | 152 | { |
157 | struct device *dev = rtlpriv->io.dev; | 153 | return (u16)_usb_read_sync(rtlpriv, addr, 2); |
158 | |||
159 | return (u16)_usb_read_sync(to_usb_device(dev), addr, 2); | ||
160 | } | 154 | } |
161 | 155 | ||
162 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) | 156 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) |
163 | { | 157 | { |
164 | struct device *dev = rtlpriv->io.dev; | 158 | return _usb_read_sync(rtlpriv, addr, 4); |
165 | |||
166 | return _usb_read_sync(to_usb_device(dev), addr, 4); | ||
167 | } | 159 | } |
168 | 160 | ||
169 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, | 161 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, |
@@ -955,6 +947,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
955 | return -ENOMEM; | 947 | return -ENOMEM; |
956 | } | 948 | } |
957 | rtlpriv = hw->priv; | 949 | rtlpriv = hw->priv; |
950 | rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32), | ||
951 | GFP_KERNEL); | ||
952 | if (!rtlpriv->usb_data) | ||
953 | return -ENOMEM; | ||
954 | rtlpriv->usb_data_index = 0; | ||
958 | init_completion(&rtlpriv->firmware_loading_complete); | 955 | init_completion(&rtlpriv->firmware_loading_complete); |
959 | SET_IEEE80211_DEV(hw, &intf->dev); | 956 | SET_IEEE80211_DEV(hw, &intf->dev); |
960 | udev = interface_to_usbdev(intf); | 957 | udev = interface_to_usbdev(intf); |
@@ -1025,6 +1022,7 @@ void rtl_usb_disconnect(struct usb_interface *intf) | |||
1025 | /* rtl_deinit_rfkill(hw); */ | 1022 | /* rtl_deinit_rfkill(hw); */ |
1026 | rtl_usb_deinit(hw); | 1023 | rtl_usb_deinit(hw); |
1027 | rtl_deinit_core(hw); | 1024 | rtl_deinit_core(hw); |
1025 | kfree(rtlpriv->usb_data); | ||
1028 | rtlpriv->cfg->ops->deinit_sw_leds(hw); | 1026 | rtlpriv->cfg->ops->deinit_sw_leds(hw); |
1029 | rtlpriv->cfg->ops->deinit_sw_vars(hw); | 1027 | rtlpriv->cfg->ops->deinit_sw_vars(hw); |
1030 | _rtl_usb_io_handler_release(hw); | 1028 | _rtl_usb_io_handler_release(hw); |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index b591614c3b9b..28ebc69218a3 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -67,7 +67,7 @@ | |||
67 | #define QOS_QUEUE_NUM 4 | 67 | #define QOS_QUEUE_NUM 4 |
68 | #define RTL_MAC80211_NUM_QUEUE 5 | 68 | #define RTL_MAC80211_NUM_QUEUE 5 |
69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 | 69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 |
70 | 70 | #define RTL_USB_MAX_RX_COUNT 100 | |
71 | #define QBSS_LOAD_SIZE 5 | 71 | #define QBSS_LOAD_SIZE 5 |
72 | #define MAX_WMMELE_LENGTH 64 | 72 | #define MAX_WMMELE_LENGTH 64 |
73 | 73 | ||
@@ -1629,6 +1629,10 @@ struct rtl_priv { | |||
1629 | interface or hardware */ | 1629 | interface or hardware */ |
1630 | unsigned long status; | 1630 | unsigned long status; |
1631 | 1631 | ||
1632 | /* data buffer pointer for USB reads */ | ||
1633 | __le32 *usb_data; | ||
1634 | int usb_data_index; | ||
1635 | |||
1632 | /*This must be the last item so | 1636 | /*This must be the last item so |
1633 | that it points to the data allocated | 1637 | that it points to the data allocated |
1634 | beyond this structure like: | 1638 | beyond this structure like: |
diff --git a/drivers/net/wireless/wl1251/debugfs.c b/drivers/net/wireless/wl1251/debugfs.c index 6c274007d200..448da1f8c22f 100644 --- a/drivers/net/wireless/wl1251/debugfs.c +++ b/drivers/net/wireless/wl1251/debugfs.c | |||
@@ -47,7 +47,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ | |||
47 | \ | 47 | \ |
48 | static const struct file_operations name## _ops = { \ | 48 | static const struct file_operations name## _ops = { \ |
49 | .read = name## _read, \ | 49 | .read = name## _read, \ |
50 | .open = wl1251_open_file_generic, \ | 50 | .open = simple_open, \ |
51 | .llseek = generic_file_llseek, \ | 51 | .llseek = generic_file_llseek, \ |
52 | }; | 52 | }; |
53 | 53 | ||
@@ -84,7 +84,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \ | |||
84 | \ | 84 | \ |
85 | static const struct file_operations sub## _ ##name## _ops = { \ | 85 | static const struct file_operations sub## _ ##name## _ops = { \ |
86 | .read = sub## _ ##name## _read, \ | 86 | .read = sub## _ ##name## _read, \ |
87 | .open = wl1251_open_file_generic, \ | 87 | .open = simple_open, \ |
88 | .llseek = generic_file_llseek, \ | 88 | .llseek = generic_file_llseek, \ |
89 | }; | 89 | }; |
90 | 90 | ||
@@ -117,12 +117,6 @@ out: | |||
117 | mutex_unlock(&wl->mutex); | 117 | mutex_unlock(&wl->mutex); |
118 | } | 118 | } |
119 | 119 | ||
120 | static int wl1251_open_file_generic(struct inode *inode, struct file *file) | ||
121 | { | ||
122 | file->private_data = inode->i_private; | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u"); | 120 | DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u"); |
127 | 121 | ||
128 | DEBUGFS_FWSTATS_FILE(rx, out_of_mem, 20, "%u"); | 122 | DEBUGFS_FWSTATS_FILE(rx, out_of_mem, 20, "%u"); |
@@ -235,7 +229,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf, | |||
235 | 229 | ||
236 | static const struct file_operations tx_queue_len_ops = { | 230 | static const struct file_operations tx_queue_len_ops = { |
237 | .read = tx_queue_len_read, | 231 | .read = tx_queue_len_read, |
238 | .open = wl1251_open_file_generic, | 232 | .open = simple_open, |
239 | .llseek = generic_file_llseek, | 233 | .llseek = generic_file_llseek, |
240 | }; | 234 | }; |
241 | 235 | ||
@@ -257,7 +251,7 @@ static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf, | |||
257 | 251 | ||
258 | static const struct file_operations tx_queue_status_ops = { | 252 | static const struct file_operations tx_queue_status_ops = { |
259 | .read = tx_queue_status_read, | 253 | .read = tx_queue_status_read, |
260 | .open = wl1251_open_file_generic, | 254 | .open = simple_open, |
261 | .llseek = generic_file_llseek, | 255 | .llseek = generic_file_llseek, |
262 | }; | 256 | }; |
263 | 257 | ||
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c index 41302c7b1ad0..d1afb8e3b2ef 100644 --- a/drivers/net/wireless/wl1251/main.c +++ b/drivers/net/wireless/wl1251/main.c | |||
@@ -479,6 +479,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw) | |||
479 | cancel_work_sync(&wl->irq_work); | 479 | cancel_work_sync(&wl->irq_work); |
480 | cancel_work_sync(&wl->tx_work); | 480 | cancel_work_sync(&wl->tx_work); |
481 | cancel_work_sync(&wl->filter_work); | 481 | cancel_work_sync(&wl->filter_work); |
482 | cancel_delayed_work_sync(&wl->elp_work); | ||
482 | 483 | ||
483 | mutex_lock(&wl->mutex); | 484 | mutex_lock(&wl->mutex); |
484 | 485 | ||
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c index f78694295c39..1b851f650e07 100644 --- a/drivers/net/wireless/wl1251/sdio.c +++ b/drivers/net/wireless/wl1251/sdio.c | |||
@@ -315,8 +315,8 @@ static void __devexit wl1251_sdio_remove(struct sdio_func *func) | |||
315 | 315 | ||
316 | if (wl->irq) | 316 | if (wl->irq) |
317 | free_irq(wl->irq, wl); | 317 | free_irq(wl->irq, wl); |
318 | kfree(wl_sdio); | ||
319 | wl1251_free_hw(wl); | 318 | wl1251_free_hw(wl); |
319 | kfree(wl_sdio); | ||
320 | 320 | ||
321 | sdio_claim_host(func); | 321 | sdio_claim_host(func); |
322 | sdio_release_irq(func); | 322 | sdio_release_irq(func); |
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index e1cf72765965..564d49575c94 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -63,7 +63,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \ | |||
63 | \ | 63 | \ |
64 | static const struct file_operations name## _ops = { \ | 64 | static const struct file_operations name## _ops = { \ |
65 | .read = name## _read, \ | 65 | .read = name## _read, \ |
66 | .open = wl1271_open_file_generic, \ | 66 | .open = simple_open, \ |
67 | .llseek = generic_file_llseek, \ | 67 | .llseek = generic_file_llseek, \ |
68 | }; | 68 | }; |
69 | 69 | ||
@@ -96,7 +96,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \ | |||
96 | \ | 96 | \ |
97 | static const struct file_operations sub## _ ##name## _ops = { \ | 97 | static const struct file_operations sub## _ ##name## _ops = { \ |
98 | .read = sub## _ ##name## _read, \ | 98 | .read = sub## _ ##name## _read, \ |
99 | .open = wl1271_open_file_generic, \ | 99 | .open = simple_open, \ |
100 | .llseek = generic_file_llseek, \ | 100 | .llseek = generic_file_llseek, \ |
101 | }; | 101 | }; |
102 | 102 | ||
@@ -126,12 +126,6 @@ out: | |||
126 | mutex_unlock(&wl->mutex); | 126 | mutex_unlock(&wl->mutex); |
127 | } | 127 | } |
128 | 128 | ||
129 | static int wl1271_open_file_generic(struct inode *inode, struct file *file) | ||
130 | { | ||
131 | file->private_data = inode->i_private; | ||
132 | return 0; | ||
133 | } | ||
134 | |||
135 | DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u"); | 129 | DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u"); |
136 | 130 | ||
137 | DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u"); | 131 | DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u"); |
@@ -243,7 +237,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf, | |||
243 | 237 | ||
244 | static const struct file_operations tx_queue_len_ops = { | 238 | static const struct file_operations tx_queue_len_ops = { |
245 | .read = tx_queue_len_read, | 239 | .read = tx_queue_len_read, |
246 | .open = wl1271_open_file_generic, | 240 | .open = simple_open, |
247 | .llseek = default_llseek, | 241 | .llseek = default_llseek, |
248 | }; | 242 | }; |
249 | 243 | ||
@@ -289,7 +283,7 @@ static ssize_t gpio_power_write(struct file *file, | |||
289 | static const struct file_operations gpio_power_ops = { | 283 | static const struct file_operations gpio_power_ops = { |
290 | .read = gpio_power_read, | 284 | .read = gpio_power_read, |
291 | .write = gpio_power_write, | 285 | .write = gpio_power_write, |
292 | .open = wl1271_open_file_generic, | 286 | .open = simple_open, |
293 | .llseek = default_llseek, | 287 | .llseek = default_llseek, |
294 | }; | 288 | }; |
295 | 289 | ||
@@ -308,7 +302,7 @@ static ssize_t start_recovery_write(struct file *file, | |||
308 | 302 | ||
309 | static const struct file_operations start_recovery_ops = { | 303 | static const struct file_operations start_recovery_ops = { |
310 | .write = start_recovery_write, | 304 | .write = start_recovery_write, |
311 | .open = wl1271_open_file_generic, | 305 | .open = simple_open, |
312 | .llseek = default_llseek, | 306 | .llseek = default_llseek, |
313 | }; | 307 | }; |
314 | 308 | ||
@@ -372,7 +366,7 @@ out: | |||
372 | static const struct file_operations dynamic_ps_timeout_ops = { | 366 | static const struct file_operations dynamic_ps_timeout_ops = { |
373 | .read = dynamic_ps_timeout_read, | 367 | .read = dynamic_ps_timeout_read, |
374 | .write = dynamic_ps_timeout_write, | 368 | .write = dynamic_ps_timeout_write, |
375 | .open = wl1271_open_file_generic, | 369 | .open = simple_open, |
376 | .llseek = default_llseek, | 370 | .llseek = default_llseek, |
377 | }; | 371 | }; |
378 | 372 | ||
@@ -441,7 +435,7 @@ out: | |||
441 | static const struct file_operations forced_ps_ops = { | 435 | static const struct file_operations forced_ps_ops = { |
442 | .read = forced_ps_read, | 436 | .read = forced_ps_read, |
443 | .write = forced_ps_write, | 437 | .write = forced_ps_write, |
444 | .open = wl1271_open_file_generic, | 438 | .open = simple_open, |
445 | .llseek = default_llseek, | 439 | .llseek = default_llseek, |
446 | }; | 440 | }; |
447 | 441 | ||
@@ -483,7 +477,7 @@ static ssize_t split_scan_timeout_write(struct file *file, | |||
483 | static const struct file_operations split_scan_timeout_ops = { | 477 | static const struct file_operations split_scan_timeout_ops = { |
484 | .read = split_scan_timeout_read, | 478 | .read = split_scan_timeout_read, |
485 | .write = split_scan_timeout_write, | 479 | .write = split_scan_timeout_write, |
486 | .open = wl1271_open_file_generic, | 480 | .open = simple_open, |
487 | .llseek = default_llseek, | 481 | .llseek = default_llseek, |
488 | }; | 482 | }; |
489 | 483 | ||
@@ -566,7 +560,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
566 | 560 | ||
567 | static const struct file_operations driver_state_ops = { | 561 | static const struct file_operations driver_state_ops = { |
568 | .read = driver_state_read, | 562 | .read = driver_state_read, |
569 | .open = wl1271_open_file_generic, | 563 | .open = simple_open, |
570 | .llseek = default_llseek, | 564 | .llseek = default_llseek, |
571 | }; | 565 | }; |
572 | 566 | ||
@@ -675,7 +669,7 @@ static ssize_t vifs_state_read(struct file *file, char __user *user_buf, | |||
675 | 669 | ||
676 | static const struct file_operations vifs_state_ops = { | 670 | static const struct file_operations vifs_state_ops = { |
677 | .read = vifs_state_read, | 671 | .read = vifs_state_read, |
678 | .open = wl1271_open_file_generic, | 672 | .open = simple_open, |
679 | .llseek = default_llseek, | 673 | .llseek = default_llseek, |
680 | }; | 674 | }; |
681 | 675 | ||
@@ -733,7 +727,7 @@ static ssize_t dtim_interval_write(struct file *file, | |||
733 | static const struct file_operations dtim_interval_ops = { | 727 | static const struct file_operations dtim_interval_ops = { |
734 | .read = dtim_interval_read, | 728 | .read = dtim_interval_read, |
735 | .write = dtim_interval_write, | 729 | .write = dtim_interval_write, |
736 | .open = wl1271_open_file_generic, | 730 | .open = simple_open, |
737 | .llseek = default_llseek, | 731 | .llseek = default_llseek, |
738 | }; | 732 | }; |
739 | 733 | ||
@@ -791,7 +785,7 @@ static ssize_t suspend_dtim_interval_write(struct file *file, | |||
791 | static const struct file_operations suspend_dtim_interval_ops = { | 785 | static const struct file_operations suspend_dtim_interval_ops = { |
792 | .read = suspend_dtim_interval_read, | 786 | .read = suspend_dtim_interval_read, |
793 | .write = suspend_dtim_interval_write, | 787 | .write = suspend_dtim_interval_write, |
794 | .open = wl1271_open_file_generic, | 788 | .open = simple_open, |
795 | .llseek = default_llseek, | 789 | .llseek = default_llseek, |
796 | }; | 790 | }; |
797 | 791 | ||
@@ -849,7 +843,7 @@ static ssize_t beacon_interval_write(struct file *file, | |||
849 | static const struct file_operations beacon_interval_ops = { | 843 | static const struct file_operations beacon_interval_ops = { |
850 | .read = beacon_interval_read, | 844 | .read = beacon_interval_read, |
851 | .write = beacon_interval_write, | 845 | .write = beacon_interval_write, |
852 | .open = wl1271_open_file_generic, | 846 | .open = simple_open, |
853 | .llseek = default_llseek, | 847 | .llseek = default_llseek, |
854 | }; | 848 | }; |
855 | 849 | ||
@@ -904,7 +898,7 @@ static ssize_t rx_streaming_interval_read(struct file *file, | |||
904 | static const struct file_operations rx_streaming_interval_ops = { | 898 | static const struct file_operations rx_streaming_interval_ops = { |
905 | .read = rx_streaming_interval_read, | 899 | .read = rx_streaming_interval_read, |
906 | .write = rx_streaming_interval_write, | 900 | .write = rx_streaming_interval_write, |
907 | .open = wl1271_open_file_generic, | 901 | .open = simple_open, |
908 | .llseek = default_llseek, | 902 | .llseek = default_llseek, |
909 | }; | 903 | }; |
910 | 904 | ||
@@ -959,7 +953,7 @@ static ssize_t rx_streaming_always_read(struct file *file, | |||
959 | static const struct file_operations rx_streaming_always_ops = { | 953 | static const struct file_operations rx_streaming_always_ops = { |
960 | .read = rx_streaming_always_read, | 954 | .read = rx_streaming_always_read, |
961 | .write = rx_streaming_always_write, | 955 | .write = rx_streaming_always_write, |
962 | .open = wl1271_open_file_generic, | 956 | .open = simple_open, |
963 | .llseek = default_llseek, | 957 | .llseek = default_llseek, |
964 | }; | 958 | }; |
965 | 959 | ||
@@ -1003,7 +997,7 @@ out: | |||
1003 | 997 | ||
1004 | static const struct file_operations beacon_filtering_ops = { | 998 | static const struct file_operations beacon_filtering_ops = { |
1005 | .write = beacon_filtering_write, | 999 | .write = beacon_filtering_write, |
1006 | .open = wl1271_open_file_generic, | 1000 | .open = simple_open, |
1007 | .llseek = default_llseek, | 1001 | .llseek = default_llseek, |
1008 | }; | 1002 | }; |
1009 | 1003 | ||
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 663b32c2e931..0ebbb1906c30 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1965,7 +1965,7 @@ static int __init netif_init(void) | |||
1965 | if (xen_initial_domain()) | 1965 | if (xen_initial_domain()) |
1966 | return 0; | 1966 | return 0; |
1967 | 1967 | ||
1968 | if (!xen_platform_pci_unplug) | 1968 | if (xen_hvm_domain() && !xen_platform_pci_unplug) |
1969 | return -ENODEV; | 1969 | return -ENODEV; |
1970 | 1970 | ||
1971 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); | 1971 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); |