aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 14:44:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 14:44:11 -0500
commit1cef9350cbee6e3bcf2ff646b8978fbec33f8b85 (patch)
tree5a750b707dcfb66033da612e8fbf238e3a2b184f /drivers/net/usb
parentecc88efbe7adceb3f4bfdbbb1efb669efcaab124 (diff)
parenteb970ff07c15f13eb474f643fd165ebe3e4e24b2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) ping_err() ICMP error handler looks at wrong ICMP header, from Li Wei. 2) TCP socket hash function on ipv6 is too weak, from Eric Dumazet. 3) netif_set_xps_queue() forgets to drop mutex on errors, fix from Alexander Duyck. 4) sum_frag_mem_limit() can deadlock due to lack of BH disabling, fix from Eric Dumazet. 5) TCP SYN data is miscalculated in tcp_send_syn_data(), because the amount of TCP option space was not taken into account properly in this code path. Fix from yuchung Cheng. 6) MLX4 driver allocates device queues with the wrong size, from Kleber Sacilotto. 7) sock_diag can access past the end of the sock_diag_handlers[] array, from Mathias Krause. 8) vlan_set_encap_proto() makes incorrect assumptions about where skb->data points, rework the logic so that it works regardless of where skb->data happens to be. From Jesse Gross. 9) Fix gianfar build failure with NET_POLL enabled, from Paul Gortmaker. 10) Fix Ipv4 ID setting and checksum calculations in GRE driver, from Pravin B Shelar. 11) bgmac driver does: int i; for (i = 0; ...; ...) { ... for (i = 0; ...; ...) { effectively corrupting the outer loop index, use a seperate variable for the inner loops. From Rafał Miłecki. 12) Fix suspend bugs in smsc95xx driver, from Ming Lei. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (35 commits) usbnet: smsc95xx: rename FEATURE_AUTOSUSPEND usbnet: smsc95xx: fix broken runtime suspend usbnet: smsc95xx: fix suspend failure bgmac: fix indexing of 2nd level loops b43: Fix lockdep splat on module unload Revert "ip_gre: propogate target device GSO capability to the tunnel device" IP_GRE: Fix GRE_CSUM case. VXLAN: Use tunnel_ip_select_ident() for tunnel IP-Identification. IP_GRE: Fix IP-Identification. net/pasemi: Fix missing coding style vmxnet3: fix ethtool ring buffer size setting vmxnet3: make local function static bnx2x: remove dead code and make local funcs static gianfar: fix compile fail for NET_POLL=y due to struct packing vlan: adjust vlan_set_encap_proto() for its callers sock_diag: Simplify sock_diag_handlers[] handling in __sock_diag_rcv_msg sock_diag: Fix out-of-bounds access to sock_diag_handlers[] vxlan: remove depends on CONFIG_EXPERIMENTAL mlx4_en: fix allocation of CPU affinity reverse-map mlx4_en: fix allocation of device tx_cq ...
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/smsc95xx.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index ff4fa37dfd1d..e6d2dea1373c 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -53,7 +53,7 @@
53 53
54#define FEATURE_8_WAKEUP_FILTERS (0x01) 54#define FEATURE_8_WAKEUP_FILTERS (0x01)
55#define FEATURE_PHY_NLP_CROSSOVER (0x02) 55#define FEATURE_PHY_NLP_CROSSOVER (0x02)
56#define FEATURE_AUTOSUSPEND (0x04) 56#define FEATURE_REMOTE_WAKEUP (0x04)
57 57
58#define SUSPEND_SUSPEND0 (0x01) 58#define SUSPEND_SUSPEND0 (0x01)
59#define SUSPEND_SUSPEND1 (0x02) 59#define SUSPEND_SUSPEND1 (0x02)
@@ -1146,7 +1146,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
1146 (val == ID_REV_CHIP_ID_89530_) || (val == ID_REV_CHIP_ID_9730_)) 1146 (val == ID_REV_CHIP_ID_89530_) || (val == ID_REV_CHIP_ID_9730_))
1147 pdata->features = (FEATURE_8_WAKEUP_FILTERS | 1147 pdata->features = (FEATURE_8_WAKEUP_FILTERS |
1148 FEATURE_PHY_NLP_CROSSOVER | 1148 FEATURE_PHY_NLP_CROSSOVER |
1149 FEATURE_AUTOSUSPEND); 1149 FEATURE_REMOTE_WAKEUP);
1150 else if (val == ID_REV_CHIP_ID_9512_) 1150 else if (val == ID_REV_CHIP_ID_9512_)
1151 pdata->features = FEATURE_8_WAKEUP_FILTERS; 1151 pdata->features = FEATURE_8_WAKEUP_FILTERS;
1152 1152
@@ -1247,10 +1247,12 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev)
1247 1247
1248 /* read back PM_CTRL */ 1248 /* read back PM_CTRL */
1249 ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); 1249 ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
1250 if (ret < 0)
1251 return ret;
1250 1252
1251 pdata->suspend_flags |= SUSPEND_SUSPEND0; 1253 pdata->suspend_flags |= SUSPEND_SUSPEND0;
1252 1254
1253 return ret; 1255 return 0;
1254} 1256}
1255 1257
1256static int smsc95xx_enter_suspend1(struct usbnet *dev) 1258static int smsc95xx_enter_suspend1(struct usbnet *dev)
@@ -1293,10 +1295,12 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
1293 val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_); 1295 val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_);
1294 1296
1295 ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); 1297 ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
1298 if (ret < 0)
1299 return ret;
1296 1300
1297 pdata->suspend_flags |= SUSPEND_SUSPEND1; 1301 pdata->suspend_flags |= SUSPEND_SUSPEND1;
1298 1302
1299 return ret; 1303 return 0;
1300} 1304}
1301 1305
1302static int smsc95xx_enter_suspend2(struct usbnet *dev) 1306static int smsc95xx_enter_suspend2(struct usbnet *dev)
@@ -1313,10 +1317,12 @@ static int smsc95xx_enter_suspend2(struct usbnet *dev)
1313 val |= PM_CTL_SUS_MODE_2; 1317 val |= PM_CTL_SUS_MODE_2;
1314 1318
1315 ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); 1319 ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
1320 if (ret < 0)
1321 return ret;
1316 1322
1317 pdata->suspend_flags |= SUSPEND_SUSPEND2; 1323 pdata->suspend_flags |= SUSPEND_SUSPEND2;
1318 1324
1319 return ret; 1325 return 0;
1320} 1326}
1321 1327
1322static int smsc95xx_enter_suspend3(struct usbnet *dev) 1328static int smsc95xx_enter_suspend3(struct usbnet *dev)
@@ -1372,7 +1378,7 @@ static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up)
1372 if (!link_up) { 1378 if (!link_up) {
1373 /* link is down so enter EDPD mode, but only if device can 1379 /* link is down so enter EDPD mode, but only if device can
1374 * reliably resume from it. This check should be redundant 1380 * reliably resume from it. This check should be redundant
1375 * as current FEATURE_AUTOSUSPEND parts also support 1381 * as current FEATURE_REMOTE_WAKEUP parts also support
1376 * FEATURE_PHY_NLP_CROSSOVER but it's included for clarity */ 1382 * FEATURE_PHY_NLP_CROSSOVER but it's included for clarity */
1377 if (!(pdata->features & FEATURE_PHY_NLP_CROSSOVER)) { 1383 if (!(pdata->features & FEATURE_PHY_NLP_CROSSOVER)) {
1378 netdev_warn(dev->net, "EDPD not supported\n"); 1384 netdev_warn(dev->net, "EDPD not supported\n");
@@ -1412,15 +1418,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
1412 u32 val, link_up; 1418 u32 val, link_up;
1413 int ret; 1419 int ret;
1414 1420
1415 /* TODO: don't indicate this feature to usb framework if
1416 * our current hardware doesn't have the capability
1417 */
1418 if ((message.event == PM_EVENT_AUTO_SUSPEND) &&
1419 (!(pdata->features & FEATURE_AUTOSUSPEND))) {
1420 netdev_warn(dev->net, "autosuspend not supported\n");
1421 return -EBUSY;
1422 }
1423
1424 ret = usbnet_suspend(intf, message); 1421 ret = usbnet_suspend(intf, message);
1425 if (ret < 0) { 1422 if (ret < 0) {
1426 netdev_warn(dev->net, "usbnet_suspend error\n"); 1423 netdev_warn(dev->net, "usbnet_suspend error\n");
@@ -1435,7 +1432,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
1435 /* determine if link is up using only _nopm functions */ 1432 /* determine if link is up using only _nopm functions */
1436 link_up = smsc95xx_link_ok_nopm(dev); 1433 link_up = smsc95xx_link_ok_nopm(dev);
1437 1434
1438 if (message.event == PM_EVENT_AUTO_SUSPEND) { 1435 if (message.event == PM_EVENT_AUTO_SUSPEND &&
1436 (pdata->features & FEATURE_REMOTE_WAKEUP)) {
1439 ret = smsc95xx_autosuspend(dev, link_up); 1437 ret = smsc95xx_autosuspend(dev, link_up);
1440 goto done; 1438 goto done;
1441 } 1439 }
@@ -1872,11 +1870,11 @@ static int smsc95xx_manage_power(struct usbnet *dev, int on)
1872 1870
1873 dev->intf->needs_remote_wakeup = on; 1871 dev->intf->needs_remote_wakeup = on;
1874 1872
1875 if (pdata->features & FEATURE_AUTOSUSPEND) 1873 if (pdata->features & FEATURE_REMOTE_WAKEUP)
1876 return 0; 1874 return 0;
1877 1875
1878 /* this chip revision doesn't support autosuspend */ 1876 /* this chip revision isn't capable of remote wakeup */
1879 netdev_info(dev->net, "hardware doesn't support USB autosuspend\n"); 1877 netdev_info(dev->net, "hardware isn't capable of remote wakeup\n");
1880 1878
1881 if (on) 1879 if (on)
1882 usb_autopm_get_interface_no_resume(dev->intf); 1880 usb_autopm_get_interface_no_resume(dev->intf);