diff options
author | David S. Miller <davem@davemloft.net> | 2011-04-26 15:16:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-26 15:16:46 -0400 |
commit | 2bd93d7af1581d40e3c4b25242472661cb7c637a (patch) | |
tree | 43c638422d20857339d8d908d6b65ebb8045edc0 /drivers | |
parent | 64cad2ade1e6f890531a58318ca9ee013f92ef2f (diff) | |
parent | 0972ddb2373d5e127aabdcabd8305eff0242cd0b (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Resolved logic conflicts causing a build failure due to
drivers/net/r8169.c changes using a patch from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/atl1c/atl1c.h | 6 | ||||
-rw-r--r-- | drivers/net/atl1c/atl1c_main.c | 14 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 1 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 34 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 7 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 9 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fec.c | 8 | ||||
-rw-r--r-- | drivers/net/netconsole.c | 8 | ||||
-rw-r--r-- | drivers/net/r8169.c | 108 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-tx.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 10 |
14 files changed, 150 insertions, 78 deletions
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h index 7cb375e0e29c..925929d764ca 100644 --- a/drivers/net/atl1c/atl1c.h +++ b/drivers/net/atl1c/atl1c.h | |||
@@ -566,9 +566,9 @@ struct atl1c_adapter { | |||
566 | #define __AT_TESTING 0x0001 | 566 | #define __AT_TESTING 0x0001 |
567 | #define __AT_RESETTING 0x0002 | 567 | #define __AT_RESETTING 0x0002 |
568 | #define __AT_DOWN 0x0003 | 568 | #define __AT_DOWN 0x0003 |
569 | u8 work_event; | 569 | unsigned long work_event; |
570 | #define ATL1C_WORK_EVENT_RESET 0x01 | 570 | #define ATL1C_WORK_EVENT_RESET 0 |
571 | #define ATL1C_WORK_EVENT_LINK_CHANGE 0x02 | 571 | #define ATL1C_WORK_EVENT_LINK_CHANGE 1 |
572 | u32 msg_enable; | 572 | u32 msg_enable; |
573 | 573 | ||
574 | bool have_msi; | 574 | bool have_msi; |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index 5c64a5d91544..48868de386a0 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -325,7 +325,7 @@ static void atl1c_link_chg_event(struct atl1c_adapter *adapter) | |||
325 | } | 325 | } |
326 | } | 326 | } |
327 | 327 | ||
328 | adapter->work_event |= ATL1C_WORK_EVENT_LINK_CHANGE; | 328 | set_bit(ATL1C_WORK_EVENT_LINK_CHANGE, &adapter->work_event); |
329 | schedule_work(&adapter->common_task); | 329 | schedule_work(&adapter->common_task); |
330 | } | 330 | } |
331 | 331 | ||
@@ -337,20 +337,16 @@ static void atl1c_common_task(struct work_struct *work) | |||
337 | adapter = container_of(work, struct atl1c_adapter, common_task); | 337 | adapter = container_of(work, struct atl1c_adapter, common_task); |
338 | netdev = adapter->netdev; | 338 | netdev = adapter->netdev; |
339 | 339 | ||
340 | if (adapter->work_event & ATL1C_WORK_EVENT_RESET) { | 340 | if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) { |
341 | adapter->work_event &= ~ATL1C_WORK_EVENT_RESET; | ||
342 | netif_device_detach(netdev); | 341 | netif_device_detach(netdev); |
343 | atl1c_down(adapter); | 342 | atl1c_down(adapter); |
344 | atl1c_up(adapter); | 343 | atl1c_up(adapter); |
345 | netif_device_attach(netdev); | 344 | netif_device_attach(netdev); |
346 | return; | ||
347 | } | 345 | } |
348 | 346 | ||
349 | if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE) { | 347 | if (test_and_clear_bit(ATL1C_WORK_EVENT_LINK_CHANGE, |
350 | adapter->work_event &= ~ATL1C_WORK_EVENT_LINK_CHANGE; | 348 | &adapter->work_event)) |
351 | atl1c_check_link_status(adapter); | 349 | atl1c_check_link_status(adapter); |
352 | } | ||
353 | return; | ||
354 | } | 350 | } |
355 | 351 | ||
356 | 352 | ||
@@ -369,7 +365,7 @@ static void atl1c_tx_timeout(struct net_device *netdev) | |||
369 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 365 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
370 | 366 | ||
371 | /* Do the reset outside of interrupt context */ | 367 | /* Do the reset outside of interrupt context */ |
372 | adapter->work_event |= ATL1C_WORK_EVENT_RESET; | 368 | set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event); |
373 | schedule_work(&adapter->common_task); | 369 | schedule_work(&adapter->common_task); |
374 | } | 370 | } |
375 | 371 | ||
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 35294005361b..7b19931acba1 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1907,6 +1907,7 @@ static void be_worker(struct work_struct *work) | |||
1907 | } | 1907 | } |
1908 | 1908 | ||
1909 | reschedule: | 1909 | reschedule: |
1910 | adapter->work_counter++; | ||
1910 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | 1911 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); |
1911 | } | 1912 | } |
1912 | 1913 | ||
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index bec33a87bcdc..8729061a4fd5 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -2019,15 +2019,23 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, | |||
2019 | static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, | 2019 | static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, |
2020 | u32 *parsing_data, u32 xmit_type) | 2020 | u32 *parsing_data, u32 xmit_type) |
2021 | { | 2021 | { |
2022 | *parsing_data |= ((tcp_hdrlen(skb)/4) << | 2022 | *parsing_data |= |
2023 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) & | 2023 | ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) << |
2024 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW; | 2024 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & |
2025 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; | ||
2025 | 2026 | ||
2026 | *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) << | 2027 | if (xmit_type & XMIT_CSUM_TCP) { |
2027 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & | 2028 | *parsing_data |= ((tcp_hdrlen(skb) / 4) << |
2028 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; | 2029 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) & |
2030 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW; | ||
2029 | 2031 | ||
2030 | return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; | 2032 | return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; |
2033 | } else | ||
2034 | /* We support checksum offload for TCP and UDP only. | ||
2035 | * No need to pass the UDP header length - it's a constant. | ||
2036 | */ | ||
2037 | return skb_transport_header(skb) + | ||
2038 | sizeof(struct udphdr) - skb->data; | ||
2031 | } | 2039 | } |
2032 | 2040 | ||
2033 | /** | 2041 | /** |
@@ -2043,7 +2051,7 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, | |||
2043 | struct eth_tx_parse_bd_e1x *pbd, | 2051 | struct eth_tx_parse_bd_e1x *pbd, |
2044 | u32 xmit_type) | 2052 | u32 xmit_type) |
2045 | { | 2053 | { |
2046 | u8 hlen = (skb_network_header(skb) - skb->data) / 2; | 2054 | u8 hlen = (skb_network_header(skb) - skb->data) >> 1; |
2047 | 2055 | ||
2048 | /* for now NS flag is not used in Linux */ | 2056 | /* for now NS flag is not used in Linux */ |
2049 | pbd->global_data = | 2057 | pbd->global_data = |
@@ -2051,9 +2059,15 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, | |||
2051 | ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT)); | 2059 | ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT)); |
2052 | 2060 | ||
2053 | pbd->ip_hlen_w = (skb_transport_header(skb) - | 2061 | pbd->ip_hlen_w = (skb_transport_header(skb) - |
2054 | skb_network_header(skb)) / 2; | 2062 | skb_network_header(skb)) >> 1; |
2055 | 2063 | ||
2056 | hlen += pbd->ip_hlen_w + tcp_hdrlen(skb) / 2; | 2064 | hlen += pbd->ip_hlen_w; |
2065 | |||
2066 | /* We support checksum offload for TCP and UDP only */ | ||
2067 | if (xmit_type & XMIT_CSUM_TCP) | ||
2068 | hlen += tcp_hdrlen(skb) / 2; | ||
2069 | else | ||
2070 | hlen += sizeof(struct udphdr) / 2; | ||
2057 | 2071 | ||
2058 | pbd->total_hlen_w = cpu_to_le16(hlen); | 2072 | pbd->total_hlen_w = cpu_to_le16(hlen); |
2059 | hlen = hlen*2; | 2073 | hlen = hlen*2; |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index d0981c2ffbda..d4160f87e910 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -1480,8 +1480,11 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, | |||
1480 | 1480 | ||
1481 | static int agg_device_up(const struct aggregator *agg) | 1481 | static int agg_device_up(const struct aggregator *agg) |
1482 | { | 1482 | { |
1483 | return (netif_running(agg->slave->dev) && | 1483 | struct port *port = agg->lag_ports; |
1484 | netif_carrier_ok(agg->slave->dev)); | 1484 | if (!port) |
1485 | return 0; | ||
1486 | return (netif_running(port->slave->dev) && | ||
1487 | netif_carrier_ok(port->slave->dev)); | ||
1485 | } | 1488 | } |
1486 | 1489 | ||
1487 | /** | 1490 | /** |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index ce2f0ca61d9a..a004bbcf72e6 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -3040,11 +3040,14 @@ static void ehea_rereg_mrs(void) | |||
3040 | 3040 | ||
3041 | if (dev->flags & IFF_UP) { | 3041 | if (dev->flags & IFF_UP) { |
3042 | mutex_lock(&port->port_lock); | 3042 | mutex_lock(&port->port_lock); |
3043 | port_napi_enable(port); | ||
3044 | ret = ehea_restart_qps(dev); | 3043 | ret = ehea_restart_qps(dev); |
3045 | check_sqs(port); | 3044 | if (!ret) { |
3046 | if (!ret) | 3045 | check_sqs(port); |
3046 | port_napi_enable(port); | ||
3047 | netif_wake_queue(dev); | 3047 | netif_wake_queue(dev); |
3048 | } else { | ||
3049 | netdev_err(dev, "Unable to restart QPS\n"); | ||
3050 | } | ||
3048 | mutex_unlock(&port->port_lock); | 3051 | mutex_unlock(&port->port_lock); |
3049 | } | 3052 | } |
3050 | } | 3053 | } |
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 61035fc5599b..b9fbc83d64a7 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -226,8 +226,8 @@ static void set_multicast_finish(struct net_device *dev) | |||
226 | } | 226 | } |
227 | 227 | ||
228 | FC(fecp, r_cntrl, FEC_RCNTRL_PROM); | 228 | FC(fecp, r_cntrl, FEC_RCNTRL_PROM); |
229 | FW(fecp, hash_table_high, fep->fec.hthi); | 229 | FW(fecp, grp_hash_table_high, fep->fec.hthi); |
230 | FW(fecp, hash_table_low, fep->fec.htlo); | 230 | FW(fecp, grp_hash_table_low, fep->fec.htlo); |
231 | } | 231 | } |
232 | 232 | ||
233 | static void set_multicast_list(struct net_device *dev) | 233 | static void set_multicast_list(struct net_device *dev) |
@@ -273,8 +273,8 @@ static void restart(struct net_device *dev) | |||
273 | /* | 273 | /* |
274 | * Reset all multicast. | 274 | * Reset all multicast. |
275 | */ | 275 | */ |
276 | FW(fecp, hash_table_high, fep->fec.hthi); | 276 | FW(fecp, grp_hash_table_high, fep->fec.hthi); |
277 | FW(fecp, hash_table_low, fep->fec.htlo); | 277 | FW(fecp, grp_hash_table_low, fep->fec.htlo); |
278 | 278 | ||
279 | /* | 279 | /* |
280 | * Set maximum receive buffer size. | 280 | * Set maximum receive buffer size. |
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index dfb67eb2a94b..eb41e44921e6 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -671,6 +671,7 @@ static int netconsole_netdev_event(struct notifier_block *this, | |||
671 | goto done; | 671 | goto done; |
672 | 672 | ||
673 | spin_lock_irqsave(&target_list_lock, flags); | 673 | spin_lock_irqsave(&target_list_lock, flags); |
674 | restart: | ||
674 | list_for_each_entry(nt, &target_list, list) { | 675 | list_for_each_entry(nt, &target_list, list) { |
675 | netconsole_target_get(nt); | 676 | netconsole_target_get(nt); |
676 | if (nt->np.dev == dev) { | 677 | if (nt->np.dev == dev) { |
@@ -683,9 +684,16 @@ static int netconsole_netdev_event(struct notifier_block *this, | |||
683 | * rtnl_lock already held | 684 | * rtnl_lock already held |
684 | */ | 685 | */ |
685 | if (nt->np.dev) { | 686 | if (nt->np.dev) { |
687 | spin_unlock_irqrestore( | ||
688 | &target_list_lock, | ||
689 | flags); | ||
686 | __netpoll_cleanup(&nt->np); | 690 | __netpoll_cleanup(&nt->np); |
691 | spin_lock_irqsave(&target_list_lock, | ||
692 | flags); | ||
687 | dev_put(nt->np.dev); | 693 | dev_put(nt->np.dev); |
688 | nt->np.dev = NULL; | 694 | nt->np.dev = NULL; |
695 | netconsole_target_put(nt); | ||
696 | goto restart; | ||
689 | } | 697 | } |
690 | /* Fall through */ | 698 | /* Fall through */ |
691 | case NETDEV_GOING_DOWN: | 699 | case NETDEV_GOING_DOWN: |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index fb03e6ff3716..025dedda40a0 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -183,6 +183,19 @@ static const struct { | |||
183 | }; | 183 | }; |
184 | #undef _R | 184 | #undef _R |
185 | 185 | ||
186 | static const struct rtl_firmware_info { | ||
187 | int mac_version; | ||
188 | const char *fw_name; | ||
189 | } rtl_firmware_infos[] = { | ||
190 | { .mac_version = RTL_GIGA_MAC_VER_25, .fw_name = FIRMWARE_8168D_1 }, | ||
191 | { .mac_version = RTL_GIGA_MAC_VER_26, .fw_name = FIRMWARE_8168D_2 }, | ||
192 | { .mac_version = RTL_GIGA_MAC_VER_29, .fw_name = FIRMWARE_8105E_1 }, | ||
193 | { .mac_version = RTL_GIGA_MAC_VER_30, .fw_name = FIRMWARE_8105E_1 }, | ||
194 | { .mac_version = RTL_GIGA_MAC_VER_30, .fw_name = FIRMWARE_8105E_1 }, | ||
195 | { .mac_version = RTL_GIGA_MAC_VER_31, .fw_name = FIRMWARE_8168E_1 }, | ||
196 | { .mac_version = RTL_GIGA_MAC_VER_32, .fw_name = FIRMWARE_8168E_2 } | ||
197 | }; | ||
198 | |||
186 | enum cfg_version { | 199 | enum cfg_version { |
187 | RTL_CFG_0 = 0x00, | 200 | RTL_CFG_0 = 0x00, |
188 | RTL_CFG_1, | 201 | RTL_CFG_1, |
@@ -632,6 +645,7 @@ struct rtl8169_private { | |||
632 | u32 saved_wolopts; | 645 | u32 saved_wolopts; |
633 | 646 | ||
634 | const struct firmware *fw; | 647 | const struct firmware *fw; |
648 | #define RTL_FIRMWARE_UNKNOWN ERR_PTR(-EAGAIN); | ||
635 | }; | 649 | }; |
636 | 650 | ||
637 | MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); | 651 | MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); |
@@ -1847,25 +1861,26 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw) | |||
1847 | 1861 | ||
1848 | static void rtl_release_firmware(struct rtl8169_private *tp) | 1862 | static void rtl_release_firmware(struct rtl8169_private *tp) |
1849 | { | 1863 | { |
1850 | release_firmware(tp->fw); | 1864 | if (!IS_ERR_OR_NULL(tp->fw)) |
1851 | tp->fw = NULL; | 1865 | release_firmware(tp->fw); |
1866 | tp->fw = RTL_FIRMWARE_UNKNOWN; | ||
1852 | } | 1867 | } |
1853 | 1868 | ||
1854 | static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name) | 1869 | static void rtl_apply_firmware(struct rtl8169_private *tp) |
1855 | { | 1870 | { |
1856 | const struct firmware **fw = &tp->fw; | 1871 | const struct firmware *fw = tp->fw; |
1857 | int rc = !*fw; | ||
1858 | |||
1859 | if (rc) { | ||
1860 | rc = request_firmware(fw, fw_name, &tp->pci_dev->dev); | ||
1861 | if (rc < 0) | ||
1862 | goto out; | ||
1863 | } | ||
1864 | 1872 | ||
1865 | /* TODO: release firmware once rtl_phy_write_fw signals failures. */ | 1873 | /* TODO: release firmware once rtl_phy_write_fw signals failures. */ |
1866 | rtl_phy_write_fw(tp, *fw); | 1874 | if (!IS_ERR_OR_NULL(fw)) |
1867 | out: | 1875 | rtl_phy_write_fw(tp, fw); |
1868 | return rc; | 1876 | } |
1877 | |||
1878 | static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val) | ||
1879 | { | ||
1880 | if (rtl_readphy(tp, reg) != val) | ||
1881 | netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n"); | ||
1882 | else | ||
1883 | rtl_apply_firmware(tp); | ||
1869 | } | 1884 | } |
1870 | 1885 | ||
1871 | static void rtl8169s_hw_phy_config(struct rtl8169_private *tp) | 1886 | static void rtl8169s_hw_phy_config(struct rtl8169_private *tp) |
@@ -2304,10 +2319,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp) | |||
2304 | 2319 | ||
2305 | rtl_writephy(tp, 0x1f, 0x0005); | 2320 | rtl_writephy(tp, 0x1f, 0x0005); |
2306 | rtl_writephy(tp, 0x05, 0x001b); | 2321 | rtl_writephy(tp, 0x05, 0x001b); |
2307 | if ((rtl_readphy(tp, 0x06) != 0xbf00) || | 2322 | |
2308 | (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) { | 2323 | rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00); |
2309 | netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); | ||
2310 | } | ||
2311 | 2324 | ||
2312 | rtl_writephy(tp, 0x1f, 0x0000); | 2325 | rtl_writephy(tp, 0x1f, 0x0000); |
2313 | } | 2326 | } |
@@ -2409,10 +2422,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp) | |||
2409 | 2422 | ||
2410 | rtl_writephy(tp, 0x1f, 0x0005); | 2423 | rtl_writephy(tp, 0x1f, 0x0005); |
2411 | rtl_writephy(tp, 0x05, 0x001b); | 2424 | rtl_writephy(tp, 0x05, 0x001b); |
2412 | if ((rtl_readphy(tp, 0x06) != 0xb300) || | 2425 | |
2413 | (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) { | 2426 | rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300); |
2414 | netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); | ||
2415 | } | ||
2416 | 2427 | ||
2417 | rtl_writephy(tp, 0x1f, 0x0000); | 2428 | rtl_writephy(tp, 0x1f, 0x0000); |
2418 | } | 2429 | } |
@@ -2567,16 +2578,14 @@ static void rtl8168e_hw_phy_config(struct rtl8169_private *tp) | |||
2567 | 2578 | ||
2568 | static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp) | 2579 | static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp) |
2569 | { | 2580 | { |
2570 | if (rtl_apply_firmware(tp, FIRMWARE_8168E_1) < 0) | 2581 | rtl_apply_firmware(tp); |
2571 | netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); | ||
2572 | 2582 | ||
2573 | rtl8168e_hw_phy_config(tp); | 2583 | rtl8168e_hw_phy_config(tp); |
2574 | } | 2584 | } |
2575 | 2585 | ||
2576 | static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp) | 2586 | static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp) |
2577 | { | 2587 | { |
2578 | if (rtl_apply_firmware(tp, FIRMWARE_8168E_2) < 0) | 2588 | rtl_apply_firmware(tp); |
2579 | netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); | ||
2580 | 2589 | ||
2581 | rtl8168e_hw_phy_config(tp); | 2590 | rtl8168e_hw_phy_config(tp); |
2582 | } | 2591 | } |
@@ -2619,8 +2628,7 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp) | |||
2619 | rtl_writephy(tp, 0x18, 0x0310); | 2628 | rtl_writephy(tp, 0x18, 0x0310); |
2620 | msleep(100); | 2629 | msleep(100); |
2621 | 2630 | ||
2622 | if (rtl_apply_firmware(tp, FIRMWARE_8105E_1) < 0) | 2631 | rtl_apply_firmware(tp); |
2623 | netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); | ||
2624 | 2632 | ||
2625 | rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | 2633 | rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init)); |
2626 | } | 2634 | } |
@@ -3463,6 +3471,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3463 | tp->timer.data = (unsigned long) dev; | 3471 | tp->timer.data = (unsigned long) dev; |
3464 | tp->timer.function = rtl8169_phy_timer; | 3472 | tp->timer.function = rtl8169_phy_timer; |
3465 | 3473 | ||
3474 | tp->fw = RTL_FIRMWARE_UNKNOWN; | ||
3475 | |||
3466 | rc = register_netdev(dev); | 3476 | rc = register_netdev(dev); |
3467 | if (rc < 0) | 3477 | if (rc < 0) |
3468 | goto err_out_msi_4; | 3478 | goto err_out_msi_4; |
@@ -3515,10 +3525,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3515 | 3525 | ||
3516 | cancel_delayed_work_sync(&tp->task); | 3526 | cancel_delayed_work_sync(&tp->task); |
3517 | 3527 | ||
3518 | rtl_release_firmware(tp); | ||
3519 | |||
3520 | unregister_netdev(dev); | 3528 | unregister_netdev(dev); |
3521 | 3529 | ||
3530 | rtl_release_firmware(tp); | ||
3531 | |||
3522 | if (pci_dev_run_wake(pdev)) | 3532 | if (pci_dev_run_wake(pdev)) |
3523 | pm_runtime_get_noresume(&pdev->dev); | 3533 | pm_runtime_get_noresume(&pdev->dev); |
3524 | 3534 | ||
@@ -3530,6 +3540,37 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3530 | pci_set_drvdata(pdev, NULL); | 3540 | pci_set_drvdata(pdev, NULL); |
3531 | } | 3541 | } |
3532 | 3542 | ||
3543 | static void rtl_request_firmware(struct rtl8169_private *tp) | ||
3544 | { | ||
3545 | int i; | ||
3546 | |||
3547 | /* Return early if the firmware is already loaded / cached. */ | ||
3548 | if (!IS_ERR(tp->fw)) | ||
3549 | goto out; | ||
3550 | |||
3551 | for (i = 0; i < ARRAY_SIZE(rtl_firmware_infos); i++) { | ||
3552 | const struct rtl_firmware_info *info = rtl_firmware_infos + i; | ||
3553 | |||
3554 | if (info->mac_version == tp->mac_version) { | ||
3555 | const char *name = info->fw_name; | ||
3556 | int rc; | ||
3557 | |||
3558 | rc = request_firmware(&tp->fw, name, &tp->pci_dev->dev); | ||
3559 | if (rc < 0) { | ||
3560 | netif_warn(tp, ifup, tp->dev, "unable to load " | ||
3561 | "firmware patch %s (%d)\n", name, rc); | ||
3562 | goto out_disable_request_firmware; | ||
3563 | } | ||
3564 | goto out; | ||
3565 | } | ||
3566 | } | ||
3567 | |||
3568 | out_disable_request_firmware: | ||
3569 | tp->fw = NULL; | ||
3570 | out: | ||
3571 | return; | ||
3572 | } | ||
3573 | |||
3533 | static int rtl8169_open(struct net_device *dev) | 3574 | static int rtl8169_open(struct net_device *dev) |
3534 | { | 3575 | { |
3535 | struct rtl8169_private *tp = netdev_priv(dev); | 3576 | struct rtl8169_private *tp = netdev_priv(dev); |
@@ -3561,11 +3602,13 @@ static int rtl8169_open(struct net_device *dev) | |||
3561 | 3602 | ||
3562 | smp_mb(); | 3603 | smp_mb(); |
3563 | 3604 | ||
3605 | rtl_request_firmware(tp); | ||
3606 | |||
3564 | retval = request_irq(dev->irq, rtl8169_interrupt, | 3607 | retval = request_irq(dev->irq, rtl8169_interrupt, |
3565 | (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED, | 3608 | (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED, |
3566 | dev->name, dev); | 3609 | dev->name, dev); |
3567 | if (retval < 0) | 3610 | if (retval < 0) |
3568 | goto err_release_ring_2; | 3611 | goto err_release_fw_2; |
3569 | 3612 | ||
3570 | napi_enable(&tp->napi); | 3613 | napi_enable(&tp->napi); |
3571 | 3614 | ||
@@ -3586,7 +3629,8 @@ static int rtl8169_open(struct net_device *dev) | |||
3586 | out: | 3629 | out: |
3587 | return retval; | 3630 | return retval; |
3588 | 3631 | ||
3589 | err_release_ring_2: | 3632 | err_release_fw_2: |
3633 | rtl_release_firmware(tp); | ||
3590 | rtl8169_rx_clear(tp); | 3634 | rtl8169_rx_clear(tp); |
3591 | err_free_rx_1: | 3635 | err_free_rx_1: |
3592 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, | 3636 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, |
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 967371f04454..1033ef6476a4 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -54,13 +54,13 @@ | |||
54 | #include <linux/usb/usbnet.h> | 54 | #include <linux/usb/usbnet.h> |
55 | #include <linux/usb/cdc.h> | 55 | #include <linux/usb/cdc.h> |
56 | 56 | ||
57 | #define DRIVER_VERSION "7-Feb-2011" | 57 | #define DRIVER_VERSION "23-Apr-2011" |
58 | 58 | ||
59 | /* CDC NCM subclass 3.2.1 */ | 59 | /* CDC NCM subclass 3.2.1 */ |
60 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 | 60 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 |
61 | 61 | ||
62 | /* Maximum NTB length */ | 62 | /* Maximum NTB length */ |
63 | #define CDC_NCM_NTB_MAX_SIZE_TX 16384 /* bytes */ | 63 | #define CDC_NCM_NTB_MAX_SIZE_TX (16384 + 4) /* bytes, must be short terminated */ |
64 | #define CDC_NCM_NTB_MAX_SIZE_RX 16384 /* bytes */ | 64 | #define CDC_NCM_NTB_MAX_SIZE_RX 16384 /* bytes */ |
65 | 65 | ||
66 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ | 66 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 642504f9638c..f69dcdf0e2e6 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -503,7 +503,7 @@ bool ath_stoprecv(struct ath_softc *sc) | |||
503 | "confusing the DMA engine when we start RX up\n"); | 503 | "confusing the DMA engine when we start RX up\n"); |
504 | ATH_DBG_WARN_ON_ONCE(!stopped); | 504 | ATH_DBG_WARN_ON_ONCE(!stopped); |
505 | } | 505 | } |
506 | return stopped || reset; | 506 | return stopped && !reset; |
507 | } | 507 | } |
508 | 508 | ||
509 | void ath_flushrecv(struct ath_softc *sc) | 509 | void ath_flushrecv(struct ath_softc *sc) |
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c index 5c40502f869a..fbec88d48f1b 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c | |||
@@ -1127,12 +1127,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) | |||
1127 | q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) { | 1127 | q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) { |
1128 | 1128 | ||
1129 | tx_info = &txq->txb[txq->q.read_ptr]; | 1129 | tx_info = &txq->txb[txq->q.read_ptr]; |
1130 | iwl4965_tx_status(priv, tx_info, | 1130 | |
1131 | txq_id >= IWL4965_FIRST_AMPDU_QUEUE); | 1131 | if (WARN_ON_ONCE(tx_info->skb == NULL)) |
1132 | continue; | ||
1132 | 1133 | ||
1133 | hdr = (struct ieee80211_hdr *)tx_info->skb->data; | 1134 | hdr = (struct ieee80211_hdr *)tx_info->skb->data; |
1134 | if (hdr && ieee80211_is_data_qos(hdr->frame_control)) | 1135 | if (ieee80211_is_data_qos(hdr->frame_control)) |
1135 | nfreed++; | 1136 | nfreed++; |
1137 | |||
1138 | iwl4965_tx_status(priv, tx_info, | ||
1139 | txq_id >= IWL4965_FIRST_AMPDU_QUEUE); | ||
1136 | tx_info->skb = NULL; | 1140 | tx_info->skb = NULL; |
1137 | 1141 | ||
1138 | priv->cfg->ops->lib->txq_free_tfd(priv, txq); | 1142 | priv->cfg->ops->lib->txq_free_tfd(priv, txq); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index 56f46ee3bacd..90e12c17801e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | |||
@@ -336,7 +336,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
336 | struct ieee80211_channel *channel = conf->channel; | 336 | struct ieee80211_channel *channel = conf->channel; |
337 | const struct iwl_channel_info *ch_info; | 337 | const struct iwl_channel_info *ch_info; |
338 | int ret = 0; | 338 | int ret = 0; |
339 | bool ht_changed[NUM_IWL_RXON_CTX] = {}; | ||
340 | 339 | ||
341 | IWL_DEBUG_MAC80211(priv, "changed %#x", changed); | 340 | IWL_DEBUG_MAC80211(priv, "changed %#x", changed); |
342 | 341 | ||
@@ -384,10 +383,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
384 | 383 | ||
385 | for_each_context(priv, ctx) { | 384 | for_each_context(priv, ctx) { |
386 | /* Configure HT40 channels */ | 385 | /* Configure HT40 channels */ |
387 | if (ctx->ht.enabled != conf_is_ht(conf)) { | 386 | if (ctx->ht.enabled != conf_is_ht(conf)) |
388 | ctx->ht.enabled = conf_is_ht(conf); | 387 | ctx->ht.enabled = conf_is_ht(conf); |
389 | ht_changed[ctx->ctxid] = true; | ||
390 | } | ||
391 | 388 | ||
392 | if (ctx->ht.enabled) { | 389 | if (ctx->ht.enabled) { |
393 | if (conf_is_ht40_minus(conf)) { | 390 | if (conf_is_ht40_minus(conf)) { |
@@ -456,8 +453,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
456 | if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging))) | 453 | if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging))) |
457 | continue; | 454 | continue; |
458 | iwlagn_commit_rxon(priv, ctx); | 455 | iwlagn_commit_rxon(priv, ctx); |
459 | if (ht_changed[ctx->ctxid]) | ||
460 | iwlagn_update_qos(priv, ctx); | ||
461 | } | 456 | } |
462 | out: | 457 | out: |
463 | mutex_unlock(&priv->mutex); | 458 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index 2816b432c62f..494de0e59cb4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -1236,12 +1236,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) | |||
1236 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { | 1236 | q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { |
1237 | 1237 | ||
1238 | tx_info = &txq->txb[txq->q.read_ptr]; | 1238 | tx_info = &txq->txb[txq->q.read_ptr]; |
1239 | iwlagn_tx_status(priv, tx_info, | 1239 | |
1240 | txq_id >= IWLAGN_FIRST_AMPDU_QUEUE); | 1240 | if (WARN_ON_ONCE(tx_info->skb == NULL)) |
1241 | continue; | ||
1241 | 1242 | ||
1242 | hdr = (struct ieee80211_hdr *)tx_info->skb->data; | 1243 | hdr = (struct ieee80211_hdr *)tx_info->skb->data; |
1243 | if (hdr && ieee80211_is_data_qos(hdr->frame_control)) | 1244 | if (ieee80211_is_data_qos(hdr->frame_control)) |
1244 | nfreed++; | 1245 | nfreed++; |
1246 | |||
1247 | iwlagn_tx_status(priv, tx_info, | ||
1248 | txq_id >= IWLAGN_FIRST_AMPDU_QUEUE); | ||
1245 | tx_info->skb = NULL; | 1249 | tx_info->skb = NULL; |
1246 | 1250 | ||
1247 | if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) | 1251 | if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) |