diff options
-rw-r--r-- | drivers/isdn/hisax/elsa_ser.c | 22 | ||||
-rw-r--r-- | drivers/net/benet/be.h | 2 | ||||
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 8 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 28 | ||||
-rw-r--r-- | drivers/net/can/dev.c | 17 | ||||
-rw-r--r-- | drivers/net/can/usb/ems_usb.c | 5 | ||||
-rw-r--r-- | drivers/net/cassini.c | 5 | ||||
-rw-r--r-- | drivers/net/fsl_pq_mdio.c | 1 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 84 | ||||
-rw-r--r-- | drivers/net/macsonic.c | 117 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 2 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/libipw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/libipw_module.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00link.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_leds.c | 4 | ||||
-rw-r--r-- | net/can/bcm.c | 19 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 32 | ||||
-rw-r--r-- | net/netfilter/xt_connlimit.c | 10 |
23 files changed, 259 insertions, 145 deletions
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index f181db464392..1657bba7879e 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c | |||
@@ -477,62 +477,62 @@ static void | |||
477 | modem_set_init(struct IsdnCardState *cs) { | 477 | modem_set_init(struct IsdnCardState *cs) { |
478 | int timeout; | 478 | int timeout; |
479 | 479 | ||
480 | #define RCV_DELAY 20000 | 480 | #define RCV_DELAY 20 |
481 | modem_write_cmd(cs, MInit_1, strlen(MInit_1)); | 481 | modem_write_cmd(cs, MInit_1, strlen(MInit_1)); |
482 | timeout = 1000; | 482 | timeout = 1000; |
483 | while(timeout-- && cs->hw.elsa.transcnt) | 483 | while(timeout-- && cs->hw.elsa.transcnt) |
484 | udelay(1000); | 484 | udelay(1000); |
485 | debugl1(cs, "msi tout=%d", timeout); | 485 | debugl1(cs, "msi tout=%d", timeout); |
486 | udelay(RCV_DELAY); | 486 | mdelay(RCV_DELAY); |
487 | modem_write_cmd(cs, MInit_2, strlen(MInit_2)); | 487 | modem_write_cmd(cs, MInit_2, strlen(MInit_2)); |
488 | timeout = 1000; | 488 | timeout = 1000; |
489 | while(timeout-- && cs->hw.elsa.transcnt) | 489 | while(timeout-- && cs->hw.elsa.transcnt) |
490 | udelay(1000); | 490 | udelay(1000); |
491 | debugl1(cs, "msi tout=%d", timeout); | 491 | debugl1(cs, "msi tout=%d", timeout); |
492 | udelay(RCV_DELAY); | 492 | mdelay(RCV_DELAY); |
493 | modem_write_cmd(cs, MInit_3, strlen(MInit_3)); | 493 | modem_write_cmd(cs, MInit_3, strlen(MInit_3)); |
494 | timeout = 1000; | 494 | timeout = 1000; |
495 | while(timeout-- && cs->hw.elsa.transcnt) | 495 | while(timeout-- && cs->hw.elsa.transcnt) |
496 | udelay(1000); | 496 | udelay(1000); |
497 | debugl1(cs, "msi tout=%d", timeout); | 497 | debugl1(cs, "msi tout=%d", timeout); |
498 | udelay(RCV_DELAY); | 498 | mdelay(RCV_DELAY); |
499 | modem_write_cmd(cs, MInit_4, strlen(MInit_4)); | 499 | modem_write_cmd(cs, MInit_4, strlen(MInit_4)); |
500 | timeout = 1000; | 500 | timeout = 1000; |
501 | while(timeout-- && cs->hw.elsa.transcnt) | 501 | while(timeout-- && cs->hw.elsa.transcnt) |
502 | udelay(1000); | 502 | udelay(1000); |
503 | debugl1(cs, "msi tout=%d", timeout); | 503 | debugl1(cs, "msi tout=%d", timeout); |
504 | udelay(RCV_DELAY ); | 504 | mdelay(RCV_DELAY); |
505 | modem_write_cmd(cs, MInit_5, strlen(MInit_5)); | 505 | modem_write_cmd(cs, MInit_5, strlen(MInit_5)); |
506 | timeout = 1000; | 506 | timeout = 1000; |
507 | while(timeout-- && cs->hw.elsa.transcnt) | 507 | while(timeout-- && cs->hw.elsa.transcnt) |
508 | udelay(1000); | 508 | udelay(1000); |
509 | debugl1(cs, "msi tout=%d", timeout); | 509 | debugl1(cs, "msi tout=%d", timeout); |
510 | udelay(RCV_DELAY); | 510 | mdelay(RCV_DELAY); |
511 | modem_write_cmd(cs, MInit_6, strlen(MInit_6)); | 511 | modem_write_cmd(cs, MInit_6, strlen(MInit_6)); |
512 | timeout = 1000; | 512 | timeout = 1000; |
513 | while(timeout-- && cs->hw.elsa.transcnt) | 513 | while(timeout-- && cs->hw.elsa.transcnt) |
514 | udelay(1000); | 514 | udelay(1000); |
515 | debugl1(cs, "msi tout=%d", timeout); | 515 | debugl1(cs, "msi tout=%d", timeout); |
516 | udelay(RCV_DELAY); | 516 | mdelay(RCV_DELAY); |
517 | modem_write_cmd(cs, MInit_7, strlen(MInit_7)); | 517 | modem_write_cmd(cs, MInit_7, strlen(MInit_7)); |
518 | timeout = 1000; | 518 | timeout = 1000; |
519 | while(timeout-- && cs->hw.elsa.transcnt) | 519 | while(timeout-- && cs->hw.elsa.transcnt) |
520 | udelay(1000); | 520 | udelay(1000); |
521 | debugl1(cs, "msi tout=%d", timeout); | 521 | debugl1(cs, "msi tout=%d", timeout); |
522 | udelay(RCV_DELAY); | 522 | mdelay(RCV_DELAY); |
523 | } | 523 | } |
524 | 524 | ||
525 | static void | 525 | static void |
526 | modem_set_dial(struct IsdnCardState *cs, int outgoing) { | 526 | modem_set_dial(struct IsdnCardState *cs, int outgoing) { |
527 | int timeout; | 527 | int timeout; |
528 | #define RCV_DELAY 20000 | 528 | #define RCV_DELAY 20 |
529 | 529 | ||
530 | modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800)); | 530 | modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800)); |
531 | timeout = 1000; | 531 | timeout = 1000; |
532 | while(timeout-- && cs->hw.elsa.transcnt) | 532 | while(timeout-- && cs->hw.elsa.transcnt) |
533 | udelay(1000); | 533 | udelay(1000); |
534 | debugl1(cs, "msi tout=%d", timeout); | 534 | debugl1(cs, "msi tout=%d", timeout); |
535 | udelay(RCV_DELAY); | 535 | mdelay(RCV_DELAY); |
536 | if (outgoing) | 536 | if (outgoing) |
537 | modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout)); | 537 | modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout)); |
538 | else | 538 | else |
@@ -541,7 +541,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) { | |||
541 | while(timeout-- && cs->hw.elsa.transcnt) | 541 | while(timeout-- && cs->hw.elsa.transcnt) |
542 | udelay(1000); | 542 | udelay(1000); |
543 | debugl1(cs, "msi tout=%d", timeout); | 543 | debugl1(cs, "msi tout=%d", timeout); |
544 | udelay(RCV_DELAY); | 544 | mdelay(RCV_DELAY); |
545 | } | 545 | } |
546 | 546 | ||
547 | static void | 547 | static void |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index ce7563175cef..67e165cf3f4e 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -269,6 +269,8 @@ struct be_adapter { | |||
269 | u32 port_num; | 269 | u32 port_num; |
270 | bool promiscuous; | 270 | bool promiscuous; |
271 | u32 cap; | 271 | u32 cap; |
272 | u32 rx_fc; /* Rx flow control */ | ||
273 | u32 tx_fc; /* Tx flow control */ | ||
272 | }; | 274 | }; |
273 | 275 | ||
274 | extern const struct ethtool_ops be_ethtool_ops; | 276 | extern const struct ethtool_ops be_ethtool_ops; |
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index edebce994906..e8f92831021a 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -362,10 +362,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
362 | 362 | ||
363 | if (ecmd->autoneg != 0) | 363 | if (ecmd->autoneg != 0) |
364 | return -EINVAL; | 364 | return -EINVAL; |
365 | adapter->tx_fc = ecmd->tx_pause; | ||
366 | adapter->rx_fc = ecmd->rx_pause; | ||
365 | 367 | ||
366 | status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, | 368 | status = be_cmd_set_flow_control(adapter, |
367 | ecmd->rx_pause); | 369 | adapter->tx_fc, adapter->rx_fc); |
368 | if (!status) | 370 | if (status) |
369 | dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); | 371 | dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); |
370 | 372 | ||
371 | return status; | 373 | return status; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 43180dc210a2..c0bd20356eaf 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1611,11 +1611,21 @@ static int be_open(struct net_device *netdev) | |||
1611 | status = be_cmd_link_status_query(adapter, &link_up, &mac_speed, | 1611 | status = be_cmd_link_status_query(adapter, &link_up, &mac_speed, |
1612 | &link_speed); | 1612 | &link_speed); |
1613 | if (status) | 1613 | if (status) |
1614 | return status; | 1614 | goto ret_sts; |
1615 | be_link_status_update(adapter, link_up); | 1615 | be_link_status_update(adapter, link_up); |
1616 | 1616 | ||
1617 | status = be_vid_config(adapter); | ||
1618 | if (status) | ||
1619 | goto ret_sts; | ||
1620 | |||
1621 | status = be_cmd_set_flow_control(adapter, | ||
1622 | adapter->tx_fc, adapter->rx_fc); | ||
1623 | if (status) | ||
1624 | goto ret_sts; | ||
1625 | |||
1617 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); | 1626 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); |
1618 | return 0; | 1627 | ret_sts: |
1628 | return status; | ||
1619 | } | 1629 | } |
1620 | 1630 | ||
1621 | static int be_setup(struct be_adapter *adapter) | 1631 | static int be_setup(struct be_adapter *adapter) |
@@ -1649,17 +1659,8 @@ static int be_setup(struct be_adapter *adapter) | |||
1649 | if (status != 0) | 1659 | if (status != 0) |
1650 | goto rx_qs_destroy; | 1660 | goto rx_qs_destroy; |
1651 | 1661 | ||
1652 | status = be_vid_config(adapter); | ||
1653 | if (status != 0) | ||
1654 | goto mccqs_destroy; | ||
1655 | |||
1656 | status = be_cmd_set_flow_control(adapter, true, true); | ||
1657 | if (status != 0) | ||
1658 | goto mccqs_destroy; | ||
1659 | return 0; | 1662 | return 0; |
1660 | 1663 | ||
1661 | mccqs_destroy: | ||
1662 | be_mcc_queues_destroy(adapter); | ||
1663 | rx_qs_destroy: | 1664 | rx_qs_destroy: |
1664 | be_rx_queues_destroy(adapter); | 1665 | be_rx_queues_destroy(adapter); |
1665 | tx_qs_destroy: | 1666 | tx_qs_destroy: |
@@ -1910,6 +1911,10 @@ static void be_netdev_init(struct net_device *netdev) | |||
1910 | 1911 | ||
1911 | adapter->rx_csum = true; | 1912 | adapter->rx_csum = true; |
1912 | 1913 | ||
1914 | /* Default settings for Rx and Tx flow control */ | ||
1915 | adapter->rx_fc = true; | ||
1916 | adapter->tx_fc = true; | ||
1917 | |||
1913 | netif_set_gso_max_size(netdev, 65535); | 1918 | netif_set_gso_max_size(netdev, 65535); |
1914 | 1919 | ||
1915 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); | 1920 | BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); |
@@ -2172,6 +2177,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2172 | be_close(netdev); | 2177 | be_close(netdev); |
2173 | rtnl_unlock(); | 2178 | rtnl_unlock(); |
2174 | } | 2179 | } |
2180 | be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc); | ||
2175 | be_clear(adapter); | 2181 | be_clear(adapter); |
2176 | 2182 | ||
2177 | pci_save_state(pdev); | 2183 | pci_save_state(pdev); |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 5fe34d64ca2a..26c89aaeba62 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -637,6 +637,22 @@ static int can_changelink(struct net_device *dev, | |||
637 | return 0; | 637 | return 0; |
638 | } | 638 | } |
639 | 639 | ||
640 | static size_t can_get_size(const struct net_device *dev) | ||
641 | { | ||
642 | struct can_priv *priv = netdev_priv(dev); | ||
643 | size_t size; | ||
644 | |||
645 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | ||
646 | size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ | ||
647 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | ||
648 | size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ | ||
649 | size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ | ||
650 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | ||
651 | size += sizeof(struct can_bittiming_const); | ||
652 | |||
653 | return size; | ||
654 | } | ||
655 | |||
640 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) | 656 | static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) |
641 | { | 657 | { |
642 | struct can_priv *priv = netdev_priv(dev); | 658 | struct can_priv *priv = netdev_priv(dev); |
@@ -687,6 +703,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { | |||
687 | .setup = can_setup, | 703 | .setup = can_setup, |
688 | .newlink = can_newlink, | 704 | .newlink = can_newlink, |
689 | .changelink = can_changelink, | 705 | .changelink = can_changelink, |
706 | .get_size = can_get_size, | ||
690 | .fill_info = can_fill_info, | 707 | .fill_info = can_fill_info, |
691 | .fill_xstats = can_fill_xstats, | 708 | .fill_xstats = can_fill_xstats, |
692 | }; | 709 | }; |
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 3685f3e42d12..3e4419054c81 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -315,7 +315,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) | |||
315 | if (skb == NULL) | 315 | if (skb == NULL) |
316 | return; | 316 | return; |
317 | 317 | ||
318 | cf->can_id = msg->msg.can_msg.id; | 318 | cf->can_id = le32_to_cpu(msg->msg.can_msg.id); |
319 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); | 319 | cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); |
320 | 320 | ||
321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME | 321 | if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME |
@@ -801,6 +801,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne | |||
801 | msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; | 801 | msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; |
802 | } | 802 | } |
803 | 803 | ||
804 | /* Respect byte order */ | ||
805 | msg->msg.can_msg.id = cpu_to_le32(msg->msg.can_msg.id); | ||
806 | |||
804 | for (i = 0; i < MAX_TX_URBS; i++) { | 807 | for (i = 0; i < MAX_TX_URBS; i++) { |
805 | if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { | 808 | if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { |
806 | context = &dev->tx_contexts[i]; | 809 | context = &dev->tx_contexts[i]; |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 05916aafa4f1..f857afe8e488 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev) | |||
4342 | cas_unlock_all_restore(cp, flags); | 4342 | cas_unlock_all_restore(cp, flags); |
4343 | } | 4343 | } |
4344 | 4344 | ||
4345 | err = -ENOMEM; | ||
4345 | if (cas_tx_tiny_alloc(cp) < 0) | 4346 | if (cas_tx_tiny_alloc(cp) < 0) |
4346 | return -ENOMEM; | 4347 | goto err_unlock; |
4347 | 4348 | ||
4348 | /* alloc rx descriptors */ | 4349 | /* alloc rx descriptors */ |
4349 | err = -ENOMEM; | ||
4350 | if (cas_alloc_rxds(cp) < 0) | 4350 | if (cas_alloc_rxds(cp) < 0) |
4351 | goto err_tx_tiny; | 4351 | goto err_tx_tiny; |
4352 | 4352 | ||
@@ -4386,6 +4386,7 @@ err_spare: | |||
4386 | cas_free_rxds(cp); | 4386 | cas_free_rxds(cp); |
4387 | err_tx_tiny: | 4387 | err_tx_tiny: |
4388 | cas_tx_tiny_free(cp); | 4388 | cas_tx_tiny_free(cp); |
4389 | err_unlock: | ||
4389 | mutex_unlock(&cp->pm_mutex); | 4390 | mutex_unlock(&cp->pm_mutex); |
4390 | return err; | 4391 | return err; |
4391 | } | 4392 | } |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index b2ca596760f8..25fabb3eedc5 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -462,3 +462,4 @@ void fsl_pq_mdio_exit(void) | |||
462 | of_unregister_platform_driver(&fsl_pq_mdio_driver); | 462 | of_unregister_platform_driver(&fsl_pq_mdio_driver); |
463 | } | 463 | } |
464 | module_exit(fsl_pq_mdio_exit); | 464 | module_exit(fsl_pq_mdio_exit); |
465 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 45c5faf0824a..448e84d56601 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include "ixgbe.h" | 45 | #include "ixgbe.h" |
46 | #include "ixgbe_common.h" | 46 | #include "ixgbe_common.h" |
47 | #include "ixgbe_dcb_82599.h" | ||
47 | 48 | ||
48 | char ixgbe_driver_name[] = "ixgbe"; | 49 | char ixgbe_driver_name[] = "ixgbe"; |
49 | static const char ixgbe_driver_string[] = | 50 | static const char ixgbe_driver_string[] = |
@@ -228,6 +229,56 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter, | |||
228 | /* tx_buffer_info must be completely set up in the transmit path */ | 229 | /* tx_buffer_info must be completely set up in the transmit path */ |
229 | } | 230 | } |
230 | 231 | ||
232 | /** | ||
233 | * ixgbe_tx_is_paused - check if the tx ring is paused | ||
234 | * @adapter: the ixgbe adapter | ||
235 | * @tx_ring: the corresponding tx_ring | ||
236 | * | ||
237 | * If not in DCB mode, checks TFCS.TXOFF, otherwise, find out the | ||
238 | * corresponding TC of this tx_ring when checking TFCS. | ||
239 | * | ||
240 | * Returns : true if paused | ||
241 | */ | ||
242 | static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, | ||
243 | struct ixgbe_ring *tx_ring) | ||
244 | { | ||
245 | int tc; | ||
246 | u32 txoff = IXGBE_TFCS_TXOFF; | ||
247 | |||
248 | #ifdef CONFIG_IXGBE_DCB | ||
249 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | ||
250 | int reg_idx = tx_ring->reg_idx; | ||
251 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; | ||
252 | |||
253 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | ||
254 | tc = reg_idx >> 2; | ||
255 | txoff = IXGBE_TFCS_TXOFF0; | ||
256 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | ||
257 | tc = 0; | ||
258 | txoff = IXGBE_TFCS_TXOFF; | ||
259 | if (dcb_i == 8) { | ||
260 | /* TC0, TC1 */ | ||
261 | tc = reg_idx >> 5; | ||
262 | if (tc == 2) /* TC2, TC3 */ | ||
263 | tc += (reg_idx - 64) >> 4; | ||
264 | else if (tc == 3) /* TC4, TC5, TC6, TC7 */ | ||
265 | tc += 1 + ((reg_idx - 96) >> 3); | ||
266 | } else if (dcb_i == 4) { | ||
267 | /* TC0, TC1 */ | ||
268 | tc = reg_idx >> 6; | ||
269 | if (tc == 1) { | ||
270 | tc += (reg_idx - 64) >> 5; | ||
271 | if (tc == 2) /* TC2, TC3 */ | ||
272 | tc += (reg_idx - 96) >> 4; | ||
273 | } | ||
274 | } | ||
275 | } | ||
276 | txoff <<= tc; | ||
277 | } | ||
278 | #endif | ||
279 | return IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & txoff; | ||
280 | } | ||
281 | |||
231 | static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, | 282 | static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, |
232 | struct ixgbe_ring *tx_ring, | 283 | struct ixgbe_ring *tx_ring, |
233 | unsigned int eop) | 284 | unsigned int eop) |
@@ -239,7 +290,7 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, | |||
239 | adapter->detect_tx_hung = false; | 290 | adapter->detect_tx_hung = false; |
240 | if (tx_ring->tx_buffer_info[eop].time_stamp && | 291 | if (tx_ring->tx_buffer_info[eop].time_stamp && |
241 | time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && | 292 | time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && |
242 | !(IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF)) { | 293 | !ixgbe_tx_is_paused(adapter, tx_ring)) { |
243 | /* detected Tx unit hang */ | 294 | /* detected Tx unit hang */ |
244 | union ixgbe_adv_tx_desc *tx_desc; | 295 | union ixgbe_adv_tx_desc *tx_desc; |
245 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 296 | tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); |
@@ -414,19 +465,23 @@ static void ixgbe_update_tx_dca(struct ixgbe_adapter *adapter, | |||
414 | u32 txctrl; | 465 | u32 txctrl; |
415 | int cpu = get_cpu(); | 466 | int cpu = get_cpu(); |
416 | int q = tx_ring - adapter->tx_ring; | 467 | int q = tx_ring - adapter->tx_ring; |
468 | struct ixgbe_hw *hw = &adapter->hw; | ||
417 | 469 | ||
418 | if (tx_ring->cpu != cpu) { | 470 | if (tx_ring->cpu != cpu) { |
419 | txctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q)); | ||
420 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | 471 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { |
472 | txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(q)); | ||
421 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; | 473 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; |
422 | txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); | 474 | txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); |
475 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
476 | IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(q), txctrl); | ||
423 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | 477 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { |
478 | txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(q)); | ||
424 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; | 479 | txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; |
425 | txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << | 480 | txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << |
426 | IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); | 481 | IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); |
482 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
483 | IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(q), txctrl); | ||
427 | } | 484 | } |
428 | txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; | ||
429 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q), txctrl); | ||
430 | tx_ring->cpu = cpu; | 485 | tx_ring->cpu = cpu; |
431 | } | 486 | } |
432 | put_cpu(); | 487 | put_cpu(); |
@@ -1908,11 +1963,25 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter) | |||
1908 | break; | 1963 | break; |
1909 | } | 1964 | } |
1910 | } | 1965 | } |
1966 | |||
1911 | if (hw->mac.type == ixgbe_mac_82599EB) { | 1967 | if (hw->mac.type == ixgbe_mac_82599EB) { |
1968 | u32 rttdcs; | ||
1969 | |||
1970 | /* disable the arbiter while setting MTQC */ | ||
1971 | rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); | ||
1972 | rttdcs |= IXGBE_RTTDCS_ARBDIS; | ||
1973 | IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); | ||
1974 | |||
1912 | /* We enable 8 traffic classes, DCB only */ | 1975 | /* We enable 8 traffic classes, DCB only */ |
1913 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | 1976 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) |
1914 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | | 1977 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | |
1915 | IXGBE_MTQC_8TC_8TQ)); | 1978 | IXGBE_MTQC_8TC_8TQ)); |
1979 | else | ||
1980 | IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); | ||
1981 | |||
1982 | /* re-eable the arbiter */ | ||
1983 | rttdcs &= ~IXGBE_RTTDCS_ARBDIS; | ||
1984 | IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); | ||
1916 | } | 1985 | } |
1917 | } | 1986 | } |
1918 | 1987 | ||
@@ -2466,7 +2535,10 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter) | |||
2466 | ixgbe_restore_vlan(adapter); | 2535 | ixgbe_restore_vlan(adapter); |
2467 | #ifdef CONFIG_IXGBE_DCB | 2536 | #ifdef CONFIG_IXGBE_DCB |
2468 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 2537 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
2469 | netif_set_gso_max_size(netdev, 32768); | 2538 | if (hw->mac.type == ixgbe_mac_82598EB) |
2539 | netif_set_gso_max_size(netdev, 32768); | ||
2540 | else | ||
2541 | netif_set_gso_max_size(netdev, 65536); | ||
2470 | ixgbe_configure_dcb(adapter); | 2542 | ixgbe_configure_dcb(adapter); |
2471 | } else { | 2543 | } else { |
2472 | netif_set_gso_max_size(netdev, 65536); | 2544 | netif_set_gso_max_size(netdev, 65536); |
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c index 61eabcac734c..b3d7d8d77f46 100644 --- a/drivers/net/macsonic.c +++ b/drivers/net/macsonic.c | |||
@@ -223,69 +223,73 @@ static int __devinit macsonic_init(struct net_device *dev) | |||
223 | return 0; | 223 | return 0; |
224 | } | 224 | } |
225 | 225 | ||
226 | static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) | 226 | #define INVALID_MAC(mac) (memcmp(mac, "\x08\x00\x07", 3) && \ |
227 | memcmp(mac, "\x00\xA0\x40", 3) && \ | ||
228 | memcmp(mac, "\x00\x80\x19", 3) && \ | ||
229 | memcmp(mac, "\x00\x05\x02", 3)) | ||
230 | |||
231 | static void __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) | ||
227 | { | 232 | { |
228 | struct sonic_local *lp = netdev_priv(dev); | 233 | struct sonic_local *lp = netdev_priv(dev); |
229 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; | 234 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; |
230 | int i; | 235 | unsigned short val; |
231 | 236 | ||
232 | /* On NuBus boards we can sometimes look in the ROM resources. | 237 | /* |
233 | No such luck for comm-slot/onboard. */ | 238 | * On NuBus boards we can sometimes look in the ROM resources. |
234 | for(i = 0; i < 6; i++) | 239 | * No such luck for comm-slot/onboard. |
235 | dev->dev_addr[i] = SONIC_READ_PROM(i); | 240 | * On the PowerBook 520, the PROM base address is a mystery. |
241 | */ | ||
242 | if (hwreg_present((void *)prom_addr)) { | ||
243 | int i; | ||
244 | |||
245 | for (i = 0; i < 6; i++) | ||
246 | dev->dev_addr[i] = SONIC_READ_PROM(i); | ||
247 | if (!INVALID_MAC(dev->dev_addr)) | ||
248 | return; | ||
236 | 249 | ||
237 | /* Most of the time, the address is bit-reversed. The NetBSD | 250 | /* |
238 | source has a rather long and detailed historical account of | 251 | * Most of the time, the address is bit-reversed. The NetBSD |
239 | why this is so. */ | 252 | * source has a rather long and detailed historical account of |
240 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | 253 | * why this is so. |
241 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | 254 | */ |
242 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
243 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
244 | bit_reverse_addr(dev->dev_addr); | 255 | bit_reverse_addr(dev->dev_addr); |
245 | else | 256 | if (!INVALID_MAC(dev->dev_addr)) |
246 | return 0; | 257 | return; |
247 | 258 | ||
248 | /* If we still have what seems to be a bogus address, we'll | ||
249 | look in the CAM. The top entry should be ours. */ | ||
250 | /* Danger! This only works if MacOS has already initialized | ||
251 | the card... */ | ||
252 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | ||
253 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | ||
254 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
255 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
256 | { | ||
257 | unsigned short val; | ||
258 | |||
259 | printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n"); | ||
260 | |||
261 | SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); | ||
262 | SONIC_WRITE(SONIC_CEP, 15); | ||
263 | |||
264 | val = SONIC_READ(SONIC_CAP2); | ||
265 | dev->dev_addr[5] = val >> 8; | ||
266 | dev->dev_addr[4] = val & 0xff; | ||
267 | val = SONIC_READ(SONIC_CAP1); | ||
268 | dev->dev_addr[3] = val >> 8; | ||
269 | dev->dev_addr[2] = val & 0xff; | ||
270 | val = SONIC_READ(SONIC_CAP0); | ||
271 | dev->dev_addr[1] = val >> 8; | ||
272 | dev->dev_addr[0] = val & 0xff; | ||
273 | |||
274 | printk(KERN_INFO "HW Address from CAM 15: %pM\n", | ||
275 | dev->dev_addr); | ||
276 | } else return 0; | ||
277 | |||
278 | if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && | ||
279 | memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && | ||
280 | memcmp(dev->dev_addr, "\x00\x80\x19", 3) && | ||
281 | memcmp(dev->dev_addr, "\x00\x05\x02", 3)) | ||
282 | { | ||
283 | /* | 259 | /* |
284 | * Still nonsense ... messed up someplace! | 260 | * If we still have what seems to be a bogus address, we'll |
261 | * look in the CAM. The top entry should be ours. | ||
285 | */ | 262 | */ |
286 | printk(KERN_ERR "macsonic: ERROR (INVALID MAC)\n"); | 263 | printk(KERN_WARNING "macsonic: MAC address in PROM seems " |
287 | return -EIO; | 264 | "to be invalid, trying CAM\n"); |
288 | } else return 0; | 265 | } else { |
266 | printk(KERN_WARNING "macsonic: cannot read MAC address from " | ||
267 | "PROM, trying CAM\n"); | ||
268 | } | ||
269 | |||
270 | /* This only works if MacOS has already initialized the card. */ | ||
271 | |||
272 | SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); | ||
273 | SONIC_WRITE(SONIC_CEP, 15); | ||
274 | |||
275 | val = SONIC_READ(SONIC_CAP2); | ||
276 | dev->dev_addr[5] = val >> 8; | ||
277 | dev->dev_addr[4] = val & 0xff; | ||
278 | val = SONIC_READ(SONIC_CAP1); | ||
279 | dev->dev_addr[3] = val >> 8; | ||
280 | dev->dev_addr[2] = val & 0xff; | ||
281 | val = SONIC_READ(SONIC_CAP0); | ||
282 | dev->dev_addr[1] = val >> 8; | ||
283 | dev->dev_addr[0] = val & 0xff; | ||
284 | |||
285 | if (!INVALID_MAC(dev->dev_addr)) | ||
286 | return; | ||
287 | |||
288 | /* Still nonsense ... messed up someplace! */ | ||
289 | |||
290 | printk(KERN_WARNING "macsonic: MAC address in CAM entry 15 " | ||
291 | "seems invalid, will use a random MAC\n"); | ||
292 | random_ether_addr(dev->dev_addr); | ||
289 | } | 293 | } |
290 | 294 | ||
291 | static int __devinit mac_onboard_sonic_probe(struct net_device *dev) | 295 | static int __devinit mac_onboard_sonic_probe(struct net_device *dev) |
@@ -402,8 +406,7 @@ static int __devinit mac_onboard_sonic_probe(struct net_device *dev) | |||
402 | SONIC_WRITE(SONIC_ISR, 0x7fff); | 406 | SONIC_WRITE(SONIC_ISR, 0x7fff); |
403 | 407 | ||
404 | /* Now look for the MAC address. */ | 408 | /* Now look for the MAC address. */ |
405 | if (mac_onboard_sonic_ethernet_addr(dev) != 0) | 409 | mac_onboard_sonic_ethernet_addr(dev); |
406 | return -ENODEV; | ||
407 | 410 | ||
408 | /* Shared init code */ | 411 | /* Shared init code */ |
409 | return macsonic_init(dev); | 412 | return macsonic_init(dev); |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 0de596ad8a7e..bd8e164b121c 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -4145,6 +4145,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
4145 | goto err_out; | 4145 | goto err_out; |
4146 | } | 4146 | } |
4147 | 4147 | ||
4148 | /* Set PCIe reset type for EEH to fundamental. */ | ||
4149 | pdev->needs_freset = 1; | ||
4148 | pci_save_state(pdev); | 4150 | pci_save_state(pdev); |
4149 | qdev->reg_base = | 4151 | qdev->reg_base = |
4150 | ioremap_nocache(pci_resource_start(pdev, 1), | 4152 | ioremap_nocache(pci_resource_start(pdev, 1), |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index f5619fe87bb2..e2b2286102d4 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -483,7 +483,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
483 | /* Wait for the interrupt to come in. */ | 483 | /* Wait for the interrupt to come in. */ |
484 | status = ql_wait_mbx_cmd_cmplt(qdev); | 484 | status = ql_wait_mbx_cmd_cmplt(qdev); |
485 | if (status) | 485 | if (status) |
486 | goto end; | 486 | continue; |
487 | 487 | ||
488 | /* Process the event. If it's an AEN, it | 488 | /* Process the event. If it's an AEN, it |
489 | * will be handled in-line or a worker | 489 | * will be handled in-line or a worker |
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index a741d37fd96f..240cff1e6979 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -6325,10 +6325,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6325 | 6325 | ||
6326 | fail: | 6326 | fail: |
6327 | if (dev) { | 6327 | if (dev) { |
6328 | if (registered) { | 6328 | if (registered) |
6329 | unregister_ieee80211(priv->ieee); | ||
6330 | unregister_netdev(dev); | 6329 | unregister_netdev(dev); |
6331 | } | ||
6332 | 6330 | ||
6333 | ipw2100_hw_stop_adapter(priv); | 6331 | ipw2100_hw_stop_adapter(priv); |
6334 | 6332 | ||
@@ -6385,7 +6383,6 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) | |||
6385 | /* Unregister the device first - this results in close() | 6383 | /* Unregister the device first - this results in close() |
6386 | * being called if the device is open. If we free storage | 6384 | * being called if the device is open. If we free storage |
6387 | * first, then close() will crash. */ | 6385 | * first, then close() will crash. */ |
6388 | unregister_ieee80211(priv->ieee); | ||
6389 | unregister_netdev(dev); | 6386 | unregister_netdev(dev); |
6390 | 6387 | ||
6391 | /* ipw2100_down will ensure that there is no more pending work | 6388 | /* ipw2100_down will ensure that there is no more pending work |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 4539e63e978e..61ef8904af97 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11822,7 +11822,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11822 | if (err) { | 11822 | if (err) { |
11823 | IPW_ERROR("Failed to register promiscuous network " | 11823 | IPW_ERROR("Failed to register promiscuous network " |
11824 | "device (error %d).\n", err); | 11824 | "device (error %d).\n", err); |
11825 | unregister_ieee80211(priv->ieee); | ||
11826 | unregister_netdev(priv->net_dev); | 11825 | unregister_netdev(priv->net_dev); |
11827 | goto out_remove_sysfs; | 11826 | goto out_remove_sysfs; |
11828 | } | 11827 | } |
@@ -11873,7 +11872,6 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev) | |||
11873 | 11872 | ||
11874 | mutex_unlock(&priv->mutex); | 11873 | mutex_unlock(&priv->mutex); |
11875 | 11874 | ||
11876 | unregister_ieee80211(priv->ieee); | ||
11877 | unregister_netdev(priv->net_dev); | 11875 | unregister_netdev(priv->net_dev); |
11878 | 11876 | ||
11879 | if (priv->rxq) { | 11877 | if (priv->rxq) { |
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h index f42ade6c2d3e..bf45391172f3 100644 --- a/drivers/net/wireless/ipw2x00/libipw.h +++ b/drivers/net/wireless/ipw2x00/libipw.h | |||
@@ -1020,7 +1020,6 @@ static inline int libipw_is_cck_rate(u8 rate) | |||
1020 | /* ieee80211.c */ | 1020 | /* ieee80211.c */ |
1021 | extern void free_ieee80211(struct net_device *dev, int monitor); | 1021 | extern void free_ieee80211(struct net_device *dev, int monitor); |
1022 | extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); | 1022 | extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); |
1023 | extern void unregister_ieee80211(struct libipw_device *ieee); | ||
1024 | extern int libipw_change_mtu(struct net_device *dev, int new_mtu); | 1023 | extern int libipw_change_mtu(struct net_device *dev, int new_mtu); |
1025 | 1024 | ||
1026 | extern void libipw_networks_age(struct libipw_device *ieee, | 1025 | extern void libipw_networks_age(struct libipw_device *ieee, |
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c index be5b809ec97a..a0e9f6aed7da 100644 --- a/drivers/net/wireless/ipw2x00/libipw_module.c +++ b/drivers/net/wireless/ipw2x00/libipw_module.c | |||
@@ -235,19 +235,16 @@ void free_ieee80211(struct net_device *dev, int monitor) | |||
235 | libipw_networks_free(ieee); | 235 | libipw_networks_free(ieee); |
236 | 236 | ||
237 | /* free cfg80211 resources */ | 237 | /* free cfg80211 resources */ |
238 | if (!monitor) | 238 | if (!monitor) { |
239 | wiphy_unregister(ieee->wdev.wiphy); | ||
240 | kfree(ieee->a_band.channels); | ||
241 | kfree(ieee->bg_band.channels); | ||
239 | wiphy_free(ieee->wdev.wiphy); | 242 | wiphy_free(ieee->wdev.wiphy); |
243 | } | ||
240 | 244 | ||
241 | free_netdev(dev); | 245 | free_netdev(dev); |
242 | } | 246 | } |
243 | 247 | ||
244 | void unregister_ieee80211(struct libipw_device *ieee) | ||
245 | { | ||
246 | wiphy_unregister(ieee->wdev.wiphy); | ||
247 | kfree(ieee->a_band.channels); | ||
248 | kfree(ieee->bg_band.channels); | ||
249 | } | ||
250 | |||
251 | #ifdef CONFIG_LIBIPW_DEBUG | 248 | #ifdef CONFIG_LIBIPW_DEBUG |
252 | 249 | ||
253 | static int debug = 0; | 250 | static int debug = 0; |
@@ -333,4 +330,3 @@ module_init(libipw_init); | |||
333 | 330 | ||
334 | EXPORT_SYMBOL(alloc_ieee80211); | 331 | EXPORT_SYMBOL(alloc_ieee80211); |
335 | EXPORT_SYMBOL(free_ieee80211); | 332 | EXPORT_SYMBOL(free_ieee80211); |
336 | EXPORT_SYMBOL(unregister_ieee80211); | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 71761b343839..73bbec58341e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
815 | 815 | ||
816 | mutex_init(&rt2x00dev->csr_mutex); | 816 | mutex_init(&rt2x00dev->csr_mutex); |
817 | 817 | ||
818 | set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
819 | |||
818 | /* | 820 | /* |
819 | * Make room for rt2x00_intf inside the per-interface | 821 | * Make room for rt2x00_intf inside the per-interface |
820 | * structure ieee80211_vif. | 822 | * structure ieee80211_vif. |
@@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
871 | rt2x00leds_register(rt2x00dev); | 873 | rt2x00leds_register(rt2x00dev); |
872 | rt2x00debug_register(rt2x00dev); | 874 | rt2x00debug_register(rt2x00dev); |
873 | 875 | ||
874 | set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
875 | |||
876 | return 0; | 876 | return 0; |
877 | 877 | ||
878 | exit: | 878 | exit: |
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c index c64db0ba7f40..c708d0be9155 100644 --- a/drivers/net/wireless/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/rt2x00/rt2x00link.c | |||
@@ -362,8 +362,9 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev) | |||
362 | 362 | ||
363 | rt2x00link_reset_tuner(rt2x00dev, false); | 363 | rt2x00link_reset_tuner(rt2x00dev, false); |
364 | 364 | ||
365 | ieee80211_queue_delayed_work(rt2x00dev->hw, | 365 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
366 | &link->work, LINK_TUNE_INTERVAL); | 366 | ieee80211_queue_delayed_work(rt2x00dev->hw, |
367 | &link->work, LINK_TUNE_INTERVAL); | ||
367 | } | 368 | } |
368 | 369 | ||
369 | void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev) | 370 | void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev) |
@@ -469,8 +470,10 @@ static void rt2x00link_tuner(struct work_struct *work) | |||
469 | * Increase tuner counter, and reschedule the next link tuner run. | 470 | * Increase tuner counter, and reschedule the next link tuner run. |
470 | */ | 471 | */ |
471 | link->count++; | 472 | link->count++; |
472 | ieee80211_queue_delayed_work(rt2x00dev->hw, | 473 | |
473 | &link->work, LINK_TUNE_INTERVAL); | 474 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
475 | ieee80211_queue_delayed_work(rt2x00dev->hw, | ||
476 | &link->work, LINK_TUNE_INTERVAL); | ||
474 | } | 477 | } |
475 | 478 | ||
476 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) | 479 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 501544882c2c..f02b48a90593 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, | |||
47 | (requesttype == USB_VENDOR_REQUEST_IN) ? | 47 | (requesttype == USB_VENDOR_REQUEST_IN) ? |
48 | usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); | 48 | usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); |
49 | 49 | ||
50 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
51 | return -ENODEV; | ||
50 | 52 | ||
51 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | 53 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { |
52 | status = usb_control_msg(usb_dev, pipe, request, requesttype, | 54 | status = usb_control_msg(usb_dev, pipe, request, requesttype, |
@@ -60,8 +62,10 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, | |||
60 | * -ENODEV: Device has disappeared, no point continuing. | 62 | * -ENODEV: Device has disappeared, no point continuing. |
61 | * All other errors: Try again. | 63 | * All other errors: Try again. |
62 | */ | 64 | */ |
63 | else if (status == -ENODEV) | 65 | else if (status == -ENODEV) { |
66 | clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); | ||
64 | break; | 67 | break; |
68 | } | ||
65 | } | 69 | } |
66 | 70 | ||
67 | ERROR(rt2x00dev, | 71 | ERROR(rt2x00dev, |
@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
161 | { | 165 | { |
162 | unsigned int i; | 166 | unsigned int i; |
163 | 167 | ||
168 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
169 | return -ENODEV; | ||
170 | |||
164 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { | 171 | for (i = 0; i < REGISTER_BUSY_COUNT; i++) { |
165 | rt2x00usb_register_read_lock(rt2x00dev, offset, reg); | 172 | rt2x00usb_register_read_lock(rt2x00dev, offset, reg); |
166 | if (!rt2x00_get_field32(*reg, field)) | 173 | if (!rt2x00_get_field32(*reg, field)) |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c index a1c670fc1552..cf8a4a40fdf6 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_leds.c +++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c | |||
@@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev) | |||
210 | 210 | ||
211 | /* turn the LED off before exiting */ | 211 | /* turn the LED off before exiting */ |
212 | ieee80211_queue_delayed_work(dev, &priv->led_off, 0); | 212 | ieee80211_queue_delayed_work(dev, &priv->led_off, 0); |
213 | cancel_delayed_work_sync(&priv->led_off); | ||
214 | cancel_delayed_work_sync(&priv->led_on); | ||
215 | rtl8187_unregister_led(&priv->led_rx); | 213 | rtl8187_unregister_led(&priv->led_rx); |
216 | rtl8187_unregister_led(&priv->led_tx); | 214 | rtl8187_unregister_led(&priv->led_tx); |
215 | cancel_delayed_work_sync(&priv->led_off); | ||
216 | cancel_delayed_work_sync(&priv->led_on); | ||
217 | } | 217 | } |
218 | #endif /* def CONFIG_RTL8187_LED */ | 218 | #endif /* def CONFIG_RTL8187_LED */ |
219 | 219 | ||
diff --git a/net/can/bcm.c b/net/can/bcm.c index 67b5433db13b..c302c2ec959c 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -132,23 +132,27 @@ static inline struct bcm_sock *bcm_sk(const struct sock *sk) | |||
132 | /* | 132 | /* |
133 | * procfs functions | 133 | * procfs functions |
134 | */ | 134 | */ |
135 | static char *bcm_proc_getifname(int ifindex) | 135 | static char *bcm_proc_getifname(char *result, int ifindex) |
136 | { | 136 | { |
137 | struct net_device *dev; | 137 | struct net_device *dev; |
138 | 138 | ||
139 | if (!ifindex) | 139 | if (!ifindex) |
140 | return "any"; | 140 | return "any"; |
141 | 141 | ||
142 | /* no usage counting */ | 142 | read_lock(&dev_base_lock); |
143 | dev = __dev_get_by_index(&init_net, ifindex); | 143 | dev = __dev_get_by_index(&init_net, ifindex); |
144 | if (dev) | 144 | if (dev) |
145 | return dev->name; | 145 | strcpy(result, dev->name); |
146 | else | ||
147 | strcpy(result, "???"); | ||
148 | read_unlock(&dev_base_lock); | ||
146 | 149 | ||
147 | return "???"; | 150 | return result; |
148 | } | 151 | } |
149 | 152 | ||
150 | static int bcm_proc_show(struct seq_file *m, void *v) | 153 | static int bcm_proc_show(struct seq_file *m, void *v) |
151 | { | 154 | { |
155 | char ifname[IFNAMSIZ]; | ||
152 | struct sock *sk = (struct sock *)m->private; | 156 | struct sock *sk = (struct sock *)m->private; |
153 | struct bcm_sock *bo = bcm_sk(sk); | 157 | struct bcm_sock *bo = bcm_sk(sk); |
154 | struct bcm_op *op; | 158 | struct bcm_op *op; |
@@ -157,7 +161,7 @@ static int bcm_proc_show(struct seq_file *m, void *v) | |||
157 | seq_printf(m, " / sk %p", sk); | 161 | seq_printf(m, " / sk %p", sk); |
158 | seq_printf(m, " / bo %p", bo); | 162 | seq_printf(m, " / bo %p", bo); |
159 | seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs); | 163 | seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs); |
160 | seq_printf(m, " / bound %s", bcm_proc_getifname(bo->ifindex)); | 164 | seq_printf(m, " / bound %s", bcm_proc_getifname(ifname, bo->ifindex)); |
161 | seq_printf(m, " <<<\n"); | 165 | seq_printf(m, " <<<\n"); |
162 | 166 | ||
163 | list_for_each_entry(op, &bo->rx_ops, list) { | 167 | list_for_each_entry(op, &bo->rx_ops, list) { |
@@ -169,7 +173,7 @@ static int bcm_proc_show(struct seq_file *m, void *v) | |||
169 | continue; | 173 | continue; |
170 | 174 | ||
171 | seq_printf(m, "rx_op: %03X %-5s ", | 175 | seq_printf(m, "rx_op: %03X %-5s ", |
172 | op->can_id, bcm_proc_getifname(op->ifindex)); | 176 | op->can_id, bcm_proc_getifname(ifname, op->ifindex)); |
173 | seq_printf(m, "[%d]%c ", op->nframes, | 177 | seq_printf(m, "[%d]%c ", op->nframes, |
174 | (op->flags & RX_CHECK_DLC)?'d':' '); | 178 | (op->flags & RX_CHECK_DLC)?'d':' '); |
175 | if (op->kt_ival1.tv64) | 179 | if (op->kt_ival1.tv64) |
@@ -194,7 +198,8 @@ static int bcm_proc_show(struct seq_file *m, void *v) | |||
194 | list_for_each_entry(op, &bo->tx_ops, list) { | 198 | list_for_each_entry(op, &bo->tx_ops, list) { |
195 | 199 | ||
196 | seq_printf(m, "tx_op: %03X %s [%d] ", | 200 | seq_printf(m, "tx_op: %03X %s [%d] ", |
197 | op->can_id, bcm_proc_getifname(op->ifindex), | 201 | op->can_id, |
202 | bcm_proc_getifname(ifname, op->ifindex), | ||
198 | op->nframes); | 203 | op->nframes); |
199 | 204 | ||
200 | if (op->kt_ival1.tv64) | 205 | if (op->kt_ival1.tv64) |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index a2ca53da4372..c5b1f71c3cd8 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -446,25 +446,27 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
446 | goto tx_error; | 446 | goto tx_error; |
447 | } | 447 | } |
448 | 448 | ||
449 | if (tiph->frag_off) | 449 | df |= old_iph->frag_off & htons(IP_DF); |
450 | |||
451 | if (df) { | ||
450 | mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr); | 452 | mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr); |
451 | else | ||
452 | mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; | ||
453 | 453 | ||
454 | if (mtu < 68) { | 454 | if (mtu < 68) { |
455 | stats->collisions++; | 455 | stats->collisions++; |
456 | ip_rt_put(rt); | 456 | ip_rt_put(rt); |
457 | goto tx_error; | 457 | goto tx_error; |
458 | } | 458 | } |
459 | if (skb_dst(skb)) | ||
460 | skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu); | ||
461 | 459 | ||
462 | df |= (old_iph->frag_off&htons(IP_DF)); | 460 | if (skb_dst(skb)) |
461 | skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu); | ||
463 | 462 | ||
464 | if ((old_iph->frag_off&htons(IP_DF)) && mtu < ntohs(old_iph->tot_len)) { | 463 | if ((old_iph->frag_off & htons(IP_DF)) && |
465 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); | 464 | mtu < ntohs(old_iph->tot_len)) { |
466 | ip_rt_put(rt); | 465 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, |
467 | goto tx_error; | 466 | htonl(mtu)); |
467 | ip_rt_put(rt); | ||
468 | goto tx_error; | ||
469 | } | ||
468 | } | 470 | } |
469 | 471 | ||
470 | if (tunnel->err_count > 0) { | 472 | if (tunnel->err_count > 0) { |
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c index 680980954395..38f03f75a636 100644 --- a/net/netfilter/xt_connlimit.c +++ b/net/netfilter/xt_connlimit.c | |||
@@ -103,7 +103,7 @@ static int count_them(struct xt_connlimit_data *data, | |||
103 | const struct nf_conntrack_tuple *tuple, | 103 | const struct nf_conntrack_tuple *tuple, |
104 | const union nf_inet_addr *addr, | 104 | const union nf_inet_addr *addr, |
105 | const union nf_inet_addr *mask, | 105 | const union nf_inet_addr *mask, |
106 | const struct xt_match *match) | 106 | u_int8_t family) |
107 | { | 107 | { |
108 | const struct nf_conntrack_tuple_hash *found; | 108 | const struct nf_conntrack_tuple_hash *found; |
109 | struct xt_connlimit_conn *conn; | 109 | struct xt_connlimit_conn *conn; |
@@ -113,8 +113,7 @@ static int count_them(struct xt_connlimit_data *data, | |||
113 | bool addit = true; | 113 | bool addit = true; |
114 | int matches = 0; | 114 | int matches = 0; |
115 | 115 | ||
116 | 116 | if (family == NFPROTO_IPV6) | |
117 | if (match->family == NFPROTO_IPV6) | ||
118 | hash = &data->iphash[connlimit_iphash6(addr, mask)]; | 117 | hash = &data->iphash[connlimit_iphash6(addr, mask)]; |
119 | else | 118 | else |
120 | hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; | 119 | hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; |
@@ -157,8 +156,7 @@ static int count_them(struct xt_connlimit_data *data, | |||
157 | continue; | 156 | continue; |
158 | } | 157 | } |
159 | 158 | ||
160 | if (same_source_net(addr, mask, &conn->tuple.src.u3, | 159 | if (same_source_net(addr, mask, &conn->tuple.src.u3, family)) |
161 | match->family)) | ||
162 | /* same source network -> be counted! */ | 160 | /* same source network -> be counted! */ |
163 | ++matches; | 161 | ++matches; |
164 | nf_ct_put(found_ct); | 162 | nf_ct_put(found_ct); |
@@ -207,7 +205,7 @@ connlimit_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
207 | 205 | ||
208 | spin_lock_bh(&info->data->lock); | 206 | spin_lock_bh(&info->data->lock); |
209 | connections = count_them(info->data, tuple_ptr, &addr, | 207 | connections = count_them(info->data, tuple_ptr, &addr, |
210 | &info->mask, par->match); | 208 | &info->mask, par->family); |
211 | spin_unlock_bh(&info->data->lock); | 209 | spin_unlock_bh(&info->data->lock); |
212 | 210 | ||
213 | if (connections < 0) { | 211 | if (connections < 0) { |