aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-29 10:55:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-29 10:55:45 -0400
commit3dacbdad2401c06b97d8d754974233a70c165536 (patch)
treedc33467f26190572eabf49f7dcac3cd8aa50a101 /drivers
parent56a50adda49b2020156616c4eb15353e0f9ad7de (diff)
parentac7c992cac0c8f276aa8e4a8273204a6db707bb3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits) e100: do not go D3 in shutdown unless system is powering off netfilter: revised locking for x_tables Bluetooth: Fix connection establishment with low security requirement Bluetooth: Add different pairing timeout for Legacy Pairing Bluetooth: Ensure that HCI sysfs add/del is preempt safe net: Avoid extra wakeups of threads blocked in wait_for_packet() net: Fix typo in net_device_ops description. ipv4: Limit size of route cache hash table Add reference to CAPI 2.0 standard Documentation/isdn/INTERFACE.CAPI update Documentation/isdn/00-INDEX ixgbe: Fix WoL functionality for 82599 KX4 devices veth: prevent oops caused by netdev destructor xfrm: wrong hash value for temporary SA forcedeth: tx timeout fix net: Fix LL_MAX_HEADER for CONFIG_TR_MODULE mlx4_en: Handle page allocation failure during receive mlx4_en: Fix cleanup flow on cq activation vlan: update vlan carrier state for admin up/down netfilter: xt_recent: fix stack overread in compat code ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/capi/kcapi.c171
-rw-r--r--drivers/net/e100.c30
-rw-r--r--drivers/net/forcedeth.c31
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c51
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/mlx4/en_netdev.c2
-rw-r--r--drivers/net/mlx4/en_rx.c4
-rw-r--r--drivers/net/veth.c41
8 files changed, 242 insertions, 98 deletions
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
index 5360c4fd473..f33170368cd 100644
--- a/drivers/isdn/capi/kcapi.c
+++ b/drivers/isdn/capi/kcapi.c
@@ -270,6 +270,15 @@ static void recv_handler(struct work_struct *work)
270 mutex_unlock(&ap->recv_mtx); 270 mutex_unlock(&ap->recv_mtx);
271} 271}
272 272
273/**
274 * capi_ctr_handle_message() - handle incoming CAPI message
275 * @card: controller descriptor structure.
276 * @appl: application ID.
277 * @skb: message.
278 *
279 * Called by hardware driver to pass a CAPI message to the application.
280 */
281
273void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb) 282void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb)
274{ 283{
275 struct capi20_appl *ap; 284 struct capi20_appl *ap;
@@ -348,6 +357,13 @@ error:
348 357
349EXPORT_SYMBOL(capi_ctr_handle_message); 358EXPORT_SYMBOL(capi_ctr_handle_message);
350 359
360/**
361 * capi_ctr_ready() - signal CAPI controller ready
362 * @card: controller descriptor structure.
363 *
364 * Called by hardware driver to signal that the controller is up and running.
365 */
366
351void capi_ctr_ready(struct capi_ctr * card) 367void capi_ctr_ready(struct capi_ctr * card)
352{ 368{
353 card->cardstate = CARD_RUNNING; 369 card->cardstate = CARD_RUNNING;
@@ -360,6 +376,14 @@ void capi_ctr_ready(struct capi_ctr * card)
360 376
361EXPORT_SYMBOL(capi_ctr_ready); 377EXPORT_SYMBOL(capi_ctr_ready);
362 378
379/**
380 * capi_ctr_reseted() - signal CAPI controller reset
381 * @card: controller descriptor structure.
382 *
383 * Called by hardware driver to signal that the controller is down and
384 * unavailable for use.
385 */
386
363void capi_ctr_reseted(struct capi_ctr * card) 387void capi_ctr_reseted(struct capi_ctr * card)
364{ 388{
365 u16 appl; 389 u16 appl;
@@ -391,6 +415,13 @@ void capi_ctr_reseted(struct capi_ctr * card)
391 415
392EXPORT_SYMBOL(capi_ctr_reseted); 416EXPORT_SYMBOL(capi_ctr_reseted);
393 417
418/**
419 * capi_ctr_suspend_output() - suspend controller
420 * @card: controller descriptor structure.
421 *
422 * Called by hardware driver to stop data flow.
423 */
424
394void capi_ctr_suspend_output(struct capi_ctr *card) 425void capi_ctr_suspend_output(struct capi_ctr *card)
395{ 426{
396 if (!card->blocked) { 427 if (!card->blocked) {
@@ -401,6 +432,13 @@ void capi_ctr_suspend_output(struct capi_ctr *card)
401 432
402EXPORT_SYMBOL(capi_ctr_suspend_output); 433EXPORT_SYMBOL(capi_ctr_suspend_output);
403 434
435/**
436 * capi_ctr_resume_output() - resume controller
437 * @card: controller descriptor structure.
438 *
439 * Called by hardware driver to resume data flow.
440 */
441
404void capi_ctr_resume_output(struct capi_ctr *card) 442void capi_ctr_resume_output(struct capi_ctr *card)
405{ 443{
406 if (card->blocked) { 444 if (card->blocked) {
@@ -413,6 +451,14 @@ EXPORT_SYMBOL(capi_ctr_resume_output);
413 451
414/* ------------------------------------------------------------- */ 452/* ------------------------------------------------------------- */
415 453
454/**
455 * attach_capi_ctr() - register CAPI controller
456 * @card: controller descriptor structure.
457 *
458 * Called by hardware driver to register a controller with the CAPI subsystem.
459 * Return value: 0 on success, error code < 0 on error
460 */
461
416int 462int
417attach_capi_ctr(struct capi_ctr *card) 463attach_capi_ctr(struct capi_ctr *card)
418{ 464{
@@ -459,6 +505,15 @@ attach_capi_ctr(struct capi_ctr *card)
459 505
460EXPORT_SYMBOL(attach_capi_ctr); 506EXPORT_SYMBOL(attach_capi_ctr);
461 507
508/**
509 * detach_capi_ctr() - unregister CAPI controller
510 * @card: controller descriptor structure.
511 *
512 * Called by hardware driver to remove the registration of a controller
513 * with the CAPI subsystem.
514 * Return value: 0 on success, error code < 0 on error
515 */
516
462int detach_capi_ctr(struct capi_ctr *card) 517int detach_capi_ctr(struct capi_ctr *card)
463{ 518{
464 if (card->cardstate != CARD_DETECTED) 519 if (card->cardstate != CARD_DETECTED)
@@ -479,6 +534,13 @@ int detach_capi_ctr(struct capi_ctr *card)
479 534
480EXPORT_SYMBOL(detach_capi_ctr); 535EXPORT_SYMBOL(detach_capi_ctr);
481 536
537/**
538 * register_capi_driver() - register CAPI driver
539 * @driver: driver descriptor structure.
540 *
541 * Called by hardware driver to register itself with the CAPI subsystem.
542 */
543
482void register_capi_driver(struct capi_driver *driver) 544void register_capi_driver(struct capi_driver *driver)
483{ 545{
484 unsigned long flags; 546 unsigned long flags;
@@ -490,6 +552,13 @@ void register_capi_driver(struct capi_driver *driver)
490 552
491EXPORT_SYMBOL(register_capi_driver); 553EXPORT_SYMBOL(register_capi_driver);
492 554
555/**
556 * unregister_capi_driver() - unregister CAPI driver
557 * @driver: driver descriptor structure.
558 *
559 * Called by hardware driver to unregister itself from the CAPI subsystem.
560 */
561
493void unregister_capi_driver(struct capi_driver *driver) 562void unregister_capi_driver(struct capi_driver *driver)
494{ 563{
495 unsigned long flags; 564 unsigned long flags;
@@ -505,6 +574,13 @@ EXPORT_SYMBOL(unregister_capi_driver);
505/* -------- CAPI2.0 Interface ---------------------------------- */ 574/* -------- CAPI2.0 Interface ---------------------------------- */
506/* ------------------------------------------------------------- */ 575/* ------------------------------------------------------------- */
507 576
577/**
578 * capi20_isinstalled() - CAPI 2.0 operation CAPI_INSTALLED
579 *
580 * Return value: CAPI result code (CAPI_NOERROR if at least one ISDN controller
581 * is ready for use, CAPI_REGNOTINSTALLED otherwise)
582 */
583
508u16 capi20_isinstalled(void) 584u16 capi20_isinstalled(void)
509{ 585{
510 int i; 586 int i;
@@ -517,6 +593,18 @@ u16 capi20_isinstalled(void)
517 593
518EXPORT_SYMBOL(capi20_isinstalled); 594EXPORT_SYMBOL(capi20_isinstalled);
519 595
596/**
597 * capi20_register() - CAPI 2.0 operation CAPI_REGISTER
598 * @ap: CAPI application descriptor structure.
599 *
600 * Register an application's presence with CAPI.
601 * A unique application ID is assigned and stored in @ap->applid.
602 * After this function returns successfully, the message receive
603 * callback function @ap->recv_message() may be called at any time
604 * until capi20_release() has been called for the same @ap.
605 * Return value: CAPI result code
606 */
607
520u16 capi20_register(struct capi20_appl *ap) 608u16 capi20_register(struct capi20_appl *ap)
521{ 609{
522 int i; 610 int i;
@@ -571,6 +659,16 @@ u16 capi20_register(struct capi20_appl *ap)
571 659
572EXPORT_SYMBOL(capi20_register); 660EXPORT_SYMBOL(capi20_register);
573 661
662/**
663 * capi20_release() - CAPI 2.0 operation CAPI_RELEASE
664 * @ap: CAPI application descriptor structure.
665 *
666 * Terminate an application's registration with CAPI.
667 * After this function returns successfully, the message receive
668 * callback function @ap->recv_message() will no longer be called.
669 * Return value: CAPI result code
670 */
671
574u16 capi20_release(struct capi20_appl *ap) 672u16 capi20_release(struct capi20_appl *ap)
575{ 673{
576 int i; 674 int i;
@@ -603,6 +701,15 @@ u16 capi20_release(struct capi20_appl *ap)
603 701
604EXPORT_SYMBOL(capi20_release); 702EXPORT_SYMBOL(capi20_release);
605 703
704/**
705 * capi20_put_message() - CAPI 2.0 operation CAPI_PUT_MESSAGE
706 * @ap: CAPI application descriptor structure.
707 * @skb: CAPI message.
708 *
709 * Transfer a single message to CAPI.
710 * Return value: CAPI result code
711 */
712
606u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb) 713u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
607{ 714{
608 struct capi_ctr *card; 715 struct capi_ctr *card;
@@ -668,6 +775,16 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
668 775
669EXPORT_SYMBOL(capi20_put_message); 776EXPORT_SYMBOL(capi20_put_message);
670 777
778/**
779 * capi20_get_manufacturer() - CAPI 2.0 operation CAPI_GET_MANUFACTURER
780 * @contr: controller number.
781 * @buf: result buffer (64 bytes).
782 *
783 * Retrieve information about the manufacturer of the specified ISDN controller
784 * or (for @contr == 0) the driver itself.
785 * Return value: CAPI result code
786 */
787
671u16 capi20_get_manufacturer(u32 contr, u8 *buf) 788u16 capi20_get_manufacturer(u32 contr, u8 *buf)
672{ 789{
673 struct capi_ctr *card; 790 struct capi_ctr *card;
@@ -685,6 +802,16 @@ u16 capi20_get_manufacturer(u32 contr, u8 *buf)
685 802
686EXPORT_SYMBOL(capi20_get_manufacturer); 803EXPORT_SYMBOL(capi20_get_manufacturer);
687 804
805/**
806 * capi20_get_version() - CAPI 2.0 operation CAPI_GET_VERSION
807 * @contr: controller number.
808 * @verp: result structure.
809 *
810 * Retrieve version information for the specified ISDN controller
811 * or (for @contr == 0) the driver itself.
812 * Return value: CAPI result code
813 */
814
688u16 capi20_get_version(u32 contr, struct capi_version *verp) 815u16 capi20_get_version(u32 contr, struct capi_version *verp)
689{ 816{
690 struct capi_ctr *card; 817 struct capi_ctr *card;
@@ -703,6 +830,16 @@ u16 capi20_get_version(u32 contr, struct capi_version *verp)
703 830
704EXPORT_SYMBOL(capi20_get_version); 831EXPORT_SYMBOL(capi20_get_version);
705 832
833/**
834 * capi20_get_serial() - CAPI 2.0 operation CAPI_GET_SERIAL_NUMBER
835 * @contr: controller number.
836 * @serial: result buffer (8 bytes).
837 *
838 * Retrieve the serial number of the specified ISDN controller
839 * or (for @contr == 0) the driver itself.
840 * Return value: CAPI result code
841 */
842
706u16 capi20_get_serial(u32 contr, u8 *serial) 843u16 capi20_get_serial(u32 contr, u8 *serial)
707{ 844{
708 struct capi_ctr *card; 845 struct capi_ctr *card;
@@ -721,6 +858,16 @@ u16 capi20_get_serial(u32 contr, u8 *serial)
721 858
722EXPORT_SYMBOL(capi20_get_serial); 859EXPORT_SYMBOL(capi20_get_serial);
723 860
861/**
862 * capi20_get_profile() - CAPI 2.0 operation CAPI_GET_PROFILE
863 * @contr: controller number.
864 * @profp: result structure.
865 *
866 * Retrieve capability information for the specified ISDN controller
867 * or (for @contr == 0) the number of installed controllers.
868 * Return value: CAPI result code
869 */
870
724u16 capi20_get_profile(u32 contr, struct capi_profile *profp) 871u16 capi20_get_profile(u32 contr, struct capi_profile *profp)
725{ 872{
726 struct capi_ctr *card; 873 struct capi_ctr *card;
@@ -903,6 +1050,15 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
903} 1050}
904#endif 1051#endif
905 1052
1053/**
1054 * capi20_manufacturer() - CAPI 2.0 operation CAPI_MANUFACTURER
1055 * @cmd: command.
1056 * @data: parameter.
1057 *
1058 * Perform manufacturer specific command.
1059 * Return value: CAPI result code
1060 */
1061
906int capi20_manufacturer(unsigned int cmd, void __user *data) 1062int capi20_manufacturer(unsigned int cmd, void __user *data)
907{ 1063{
908 struct capi_ctr *card; 1064 struct capi_ctr *card;
@@ -981,6 +1137,21 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
981EXPORT_SYMBOL(capi20_manufacturer); 1137EXPORT_SYMBOL(capi20_manufacturer);
982 1138
983/* temporary hack */ 1139/* temporary hack */
1140
1141/**
1142 * capi20_set_callback() - set CAPI application notification callback function
1143 * @ap: CAPI application descriptor structure.
1144 * @callback: callback function (NULL to remove).
1145 *
1146 * If not NULL, the callback function will be called to notify the
1147 * application of the addition or removal of a controller.
1148 * The first argument (cmd) will tell whether the controller was added
1149 * (KCI_CONTRUP) or removed (KCI_CONTRDOWN).
1150 * The second argument (contr) will be the controller number.
1151 * For cmd==KCI_CONTRUP the third argument (data) will be a pointer to the
1152 * new controller's capability profile structure.
1153 */
1154
984void capi20_set_callback(struct capi20_appl *ap, 1155void capi20_set_callback(struct capi20_appl *ap,
985 void (*callback) (unsigned int cmd, __u32 contr, void *data)) 1156 void (*callback) (unsigned int cmd, __u32 contr, void *data))
986{ 1157{
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 5c0b457c786..0f9ee134855 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2728,7 +2728,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2728#define E100_82552_SMARTSPEED 0x14 /* SmartSpeed Ctrl register */ 2728#define E100_82552_SMARTSPEED 0x14 /* SmartSpeed Ctrl register */
2729#define E100_82552_REV_ANEG 0x0200 /* Reverse auto-negotiation */ 2729#define E100_82552_REV_ANEG 0x0200 /* Reverse auto-negotiation */
2730#define E100_82552_ANEG_NOW 0x0400 /* Auto-negotiate now */ 2730#define E100_82552_ANEG_NOW 0x0400 /* Auto-negotiate now */
2731static int e100_suspend(struct pci_dev *pdev, pm_message_t state) 2731static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
2732{ 2732{
2733 struct net_device *netdev = pci_get_drvdata(pdev); 2733 struct net_device *netdev = pci_get_drvdata(pdev);
2734 struct nic *nic = netdev_priv(netdev); 2734 struct nic *nic = netdev_priv(netdev);
@@ -2749,19 +2749,32 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2749 E100_82552_SMARTSPEED, smartspeed | 2749 E100_82552_SMARTSPEED, smartspeed |
2750 E100_82552_REV_ANEG | E100_82552_ANEG_NOW); 2750 E100_82552_REV_ANEG | E100_82552_ANEG_NOW);
2751 } 2751 }
2752 if (pci_enable_wake(pdev, PCI_D3cold, true)) 2752 *enable_wake = true;
2753 pci_enable_wake(pdev, PCI_D3hot, true);
2754 } else { 2753 } else {
2755 pci_enable_wake(pdev, PCI_D3hot, false); 2754 *enable_wake = false;
2756 } 2755 }
2757 2756
2758 pci_disable_device(pdev); 2757 pci_disable_device(pdev);
2759 pci_set_power_state(pdev, PCI_D3hot); 2758}
2760 2759
2761 return 0; 2760static int __e100_power_off(struct pci_dev *pdev, bool wake)
2761{
2762 if (wake) {
2763 return pci_prepare_to_sleep(pdev);
2764 } else {
2765 pci_wake_from_d3(pdev, false);
2766 return pci_set_power_state(pdev, PCI_D3hot);
2767 }
2762} 2768}
2763 2769
2764#ifdef CONFIG_PM 2770#ifdef CONFIG_PM
2771static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2772{
2773 bool wake;
2774 __e100_shutdown(pdev, &wake);
2775 return __e100_power_off(pdev, wake);
2776}
2777
2765static int e100_resume(struct pci_dev *pdev) 2778static int e100_resume(struct pci_dev *pdev)
2766{ 2779{
2767 struct net_device *netdev = pci_get_drvdata(pdev); 2780 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2792,7 +2805,10 @@ static int e100_resume(struct pci_dev *pdev)
2792 2805
2793static void e100_shutdown(struct pci_dev *pdev) 2806static void e100_shutdown(struct pci_dev *pdev)
2794{ 2807{
2795 e100_suspend(pdev, PMSG_SUSPEND); 2808 bool wake;
2809 __e100_shutdown(pdev, &wake);
2810 if (system_state == SYSTEM_POWER_OFF)
2811 __e100_power_off(pdev, wake);
2796} 2812}
2797 2813
2798/* ------------------ PCI Error Recovery infrastructure -------------- */ 2814/* ------------------ PCI Error Recovery infrastructure -------------- */
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 11d5db16ed9..f9a846b1b92 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1880,6 +1880,7 @@ static void nv_init_tx(struct net_device *dev)
1880 np->tx_pkts_in_progress = 0; 1880 np->tx_pkts_in_progress = 0;
1881 np->tx_change_owner = NULL; 1881 np->tx_change_owner = NULL;
1882 np->tx_end_flip = NULL; 1882 np->tx_end_flip = NULL;
1883 np->tx_stop = 0;
1883 1884
1884 for (i = 0; i < np->tx_ring_size; i++) { 1885 for (i = 0; i < np->tx_ring_size; i++) {
1885 if (!nv_optimized(np)) { 1886 if (!nv_optimized(np)) {
@@ -2530,6 +2531,8 @@ static void nv_tx_timeout(struct net_device *dev)
2530 struct fe_priv *np = netdev_priv(dev); 2531 struct fe_priv *np = netdev_priv(dev);
2531 u8 __iomem *base = get_hwbase(dev); 2532 u8 __iomem *base = get_hwbase(dev);
2532 u32 status; 2533 u32 status;
2534 union ring_type put_tx;
2535 int saved_tx_limit;
2533 2536
2534 if (np->msi_flags & NV_MSI_X_ENABLED) 2537 if (np->msi_flags & NV_MSI_X_ENABLED)
2535 status = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK; 2538 status = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK;
@@ -2589,24 +2592,32 @@ static void nv_tx_timeout(struct net_device *dev)
2589 /* 1) stop tx engine */ 2592 /* 1) stop tx engine */
2590 nv_stop_tx(dev); 2593 nv_stop_tx(dev);
2591 2594
2592 /* 2) check that the packets were not sent already: */ 2595 /* 2) complete any outstanding tx and do not give HW any limited tx pkts */
2596 saved_tx_limit = np->tx_limit;
2597 np->tx_limit = 0; /* prevent giving HW any limited pkts */
2598 np->tx_stop = 0; /* prevent waking tx queue */
2593 if (!nv_optimized(np)) 2599 if (!nv_optimized(np))
2594 nv_tx_done(dev, np->tx_ring_size); 2600 nv_tx_done(dev, np->tx_ring_size);
2595 else 2601 else
2596 nv_tx_done_optimized(dev, np->tx_ring_size); 2602 nv_tx_done_optimized(dev, np->tx_ring_size);
2597 2603
2598 /* 3) if there are dead entries: clear everything */ 2604 /* save current HW postion */
2599 if (np->get_tx_ctx != np->put_tx_ctx) { 2605 if (np->tx_change_owner)
2600 printk(KERN_DEBUG "%s: tx_timeout: dead entries!\n", dev->name); 2606 put_tx.ex = np->tx_change_owner->first_tx_desc;
2601 nv_drain_tx(dev); 2607 else
2602 nv_init_tx(dev); 2608 put_tx = np->put_tx;
2603 setup_hw_rings(dev, NV_SETUP_TX_RING);
2604 }
2605 2609
2606 netif_wake_queue(dev); 2610 /* 3) clear all tx state */
2611 nv_drain_tx(dev);
2612 nv_init_tx(dev);
2613
2614 /* 4) restore state to current HW position */
2615 np->get_tx = np->put_tx = put_tx;
2616 np->tx_limit = saved_tx_limit;
2607 2617
2608 /* 4) restart tx engine */ 2618 /* 5) restart tx engine */
2609 nv_start_tx(dev); 2619 nv_start_tx(dev);
2620 netif_wake_queue(dev);
2610 spin_unlock_irq(&np->lock); 2621 spin_unlock_irq(&np->lock);
2611} 2622}
2612 2623
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 5567519676d..186a65069b3 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -50,7 +50,6 @@ static u16 ixgbe_calc_eeprom_checksum(struct ixgbe_hw *hw);
50static void ixgbe_enable_rar(struct ixgbe_hw *hw, u32 index); 50static void ixgbe_enable_rar(struct ixgbe_hw *hw, u32 index);
51static void ixgbe_disable_rar(struct ixgbe_hw *hw, u32 index); 51static void ixgbe_disable_rar(struct ixgbe_hw *hw, u32 index);
52static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr); 52static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr);
53static void ixgbe_add_mc_addr(struct ixgbe_hw *hw, u8 *mc_addr);
54static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq); 53static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
55 54
56/** 55/**
@@ -1377,8 +1376,7 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list,
1377 * Clear accounting of old secondary address list, 1376 * Clear accounting of old secondary address list,
1378 * don't count RAR[0] 1377 * don't count RAR[0]
1379 */ 1378 */
1380 uc_addr_in_use = hw->addr_ctrl.rar_used_count - 1379 uc_addr_in_use = hw->addr_ctrl.rar_used_count - 1;
1381 hw->addr_ctrl.mc_addr_in_rar_count - 1;
1382 hw->addr_ctrl.rar_used_count -= uc_addr_in_use; 1380 hw->addr_ctrl.rar_used_count -= uc_addr_in_use;
1383 hw->addr_ctrl.overflow_promisc = 0; 1381 hw->addr_ctrl.overflow_promisc = 0;
1384 1382
@@ -1493,40 +1491,6 @@ static void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr)
1493} 1491}
1494 1492
1495/** 1493/**
1496 * ixgbe_add_mc_addr - Adds a multicast address.
1497 * @hw: pointer to hardware structure
1498 * @mc_addr: new multicast address
1499 *
1500 * Adds it to unused receive address register or to the multicast table.
1501 **/
1502static void ixgbe_add_mc_addr(struct ixgbe_hw *hw, u8 *mc_addr)
1503{
1504 u32 rar_entries = hw->mac.num_rar_entries;
1505 u32 rar;
1506
1507 hw_dbg(hw, " MC Addr =%.2X %.2X %.2X %.2X %.2X %.2X\n",
1508 mc_addr[0], mc_addr[1], mc_addr[2],
1509 mc_addr[3], mc_addr[4], mc_addr[5]);
1510
1511 /*
1512 * Place this multicast address in the RAR if there is room,
1513 * else put it in the MTA
1514 */
1515 if (hw->addr_ctrl.rar_used_count < rar_entries) {
1516 /* use RAR from the end up for multicast */
1517 rar = rar_entries - hw->addr_ctrl.mc_addr_in_rar_count - 1;
1518 hw->mac.ops.set_rar(hw, rar, mc_addr, 0, IXGBE_RAH_AV);
1519 hw_dbg(hw, "Added a multicast address to RAR[%d]\n", rar);
1520 hw->addr_ctrl.rar_used_count++;
1521 hw->addr_ctrl.mc_addr_in_rar_count++;
1522 } else {
1523 ixgbe_set_mta(hw, mc_addr);
1524 }
1525
1526 hw_dbg(hw, "ixgbe_add_mc_addr Complete\n");
1527}
1528
1529/**
1530 * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses 1494 * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses
1531 * @hw: pointer to hardware structure 1495 * @hw: pointer to hardware structure
1532 * @mc_addr_list: the list of new multicast addresses 1496 * @mc_addr_list: the list of new multicast addresses
@@ -1542,7 +1506,6 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
1542 u32 mc_addr_count, ixgbe_mc_addr_itr next) 1506 u32 mc_addr_count, ixgbe_mc_addr_itr next)
1543{ 1507{
1544 u32 i; 1508 u32 i;
1545 u32 rar_entries = hw->mac.num_rar_entries;
1546 u32 vmdq; 1509 u32 vmdq;
1547 1510
1548 /* 1511 /*
@@ -1550,18 +1513,8 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
1550 * use. 1513 * use.
1551 */ 1514 */
1552 hw->addr_ctrl.num_mc_addrs = mc_addr_count; 1515 hw->addr_ctrl.num_mc_addrs = mc_addr_count;
1553 hw->addr_ctrl.rar_used_count -= hw->addr_ctrl.mc_addr_in_rar_count;
1554 hw->addr_ctrl.mc_addr_in_rar_count = 0;
1555 hw->addr_ctrl.mta_in_use = 0; 1516 hw->addr_ctrl.mta_in_use = 0;
1556 1517
1557 /* Zero out the other receive addresses. */
1558 hw_dbg(hw, "Clearing RAR[%d-%d]\n", hw->addr_ctrl.rar_used_count,
1559 rar_entries - 1);
1560 for (i = hw->addr_ctrl.rar_used_count; i < rar_entries; i++) {
1561 IXGBE_WRITE_REG(hw, IXGBE_RAL(i), 0);
1562 IXGBE_WRITE_REG(hw, IXGBE_RAH(i), 0);
1563 }
1564
1565 /* Clear the MTA */ 1518 /* Clear the MTA */
1566 hw_dbg(hw, " Clearing MTA\n"); 1519 hw_dbg(hw, " Clearing MTA\n");
1567 for (i = 0; i < hw->mac.mcft_size; i++) 1520 for (i = 0; i < hw->mac.mcft_size; i++)
@@ -1570,7 +1523,7 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list,
1570 /* Add the new addresses */ 1523 /* Add the new addresses */
1571 for (i = 0; i < mc_addr_count; i++) { 1524 for (i = 0; i < mc_addr_count; i++) {
1572 hw_dbg(hw, " Adding the multicast addresses:\n"); 1525 hw_dbg(hw, " Adding the multicast addresses:\n");
1573 ixgbe_add_mc_addr(hw, next(hw, &mc_addr_list, &vmdq)); 1526 ixgbe_set_mta(hw, next(hw, &mc_addr_list, &vmdq));
1574 } 1527 }
1575 1528
1576 /* Enable mta */ 1529 /* Enable mta */
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 01884256f4c..07e778d3e5d 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3646,6 +3646,8 @@ static int ixgbe_resume(struct pci_dev *pdev)
3646 3646
3647 ixgbe_reset(adapter); 3647 ixgbe_reset(adapter);
3648 3648
3649 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0);
3650
3649 if (netif_running(netdev)) { 3651 if (netif_running(netdev)) {
3650 err = ixgbe_open(adapter->netdev); 3652 err = ixgbe_open(adapter->netdev);
3651 if (err) 3653 if (err)
@@ -4575,7 +4577,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
4575 const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data]; 4577 const struct ixgbe_info *ii = ixgbe_info_tbl[ent->driver_data];
4576 static int cards_found; 4578 static int cards_found;
4577 int i, err, pci_using_dac; 4579 int i, err, pci_using_dac;
4578 u16 pm_value = 0;
4579 u32 part_num, eec; 4580 u32 part_num, eec;
4580 4581
4581 err = pci_enable_device(pdev); 4582 err = pci_enable_device(pdev);
@@ -4763,11 +4764,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
4763 4764
4764 switch (pdev->device) { 4765 switch (pdev->device) {
4765 case IXGBE_DEV_ID_82599_KX4: 4766 case IXGBE_DEV_ID_82599_KX4:
4766#define IXGBE_PCIE_PMCSR 0x44 4767 adapter->wol = (IXGBE_WUFC_MAG | IXGBE_WUFC_EX |
4767 adapter->wol = IXGBE_WUFC_MAG; 4768 IXGBE_WUFC_MC | IXGBE_WUFC_BC);
4768 pci_read_config_word(pdev, IXGBE_PCIE_PMCSR, &pm_value);
4769 pci_write_config_word(pdev, IXGBE_PCIE_PMCSR,
4770 (pm_value | (1 << 8)));
4771 break; 4769 break;
4772 default: 4770 default:
4773 adapter->wol = 0; 4771 adapter->wol = 0;
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 438678ab2a1..7bcc49de163 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -583,7 +583,7 @@ int mlx4_en_start_port(struct net_device *dev)
583 err = mlx4_en_activate_cq(priv, cq); 583 err = mlx4_en_activate_cq(priv, cq);
584 if (err) { 584 if (err) {
585 mlx4_err(mdev, "Failed activating Rx CQ\n"); 585 mlx4_err(mdev, "Failed activating Rx CQ\n");
586 goto rx_err; 586 goto cq_err;
587 } 587 }
588 for (j = 0; j < cq->size; j++) 588 for (j = 0; j < cq->size; j++)
589 cq->buf[j].owner_sr_opcode = MLX4_CQE_OWNER_MASK; 589 cq->buf[j].owner_sr_opcode = MLX4_CQE_OWNER_MASK;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 0cbb78ca7b2..7942c4d3cd8 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -610,6 +610,10 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
610 used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, 610 used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags,
611 skb_shinfo(skb)->frags, 611 skb_shinfo(skb)->frags,
612 page_alloc, length); 612 page_alloc, length);
613 if (unlikely(!used_frags)) {
614 kfree_skb(skb);
615 return NULL;
616 }
613 skb_shinfo(skb)->nr_frags = used_frags; 617 skb_shinfo(skb)->nr_frags = used_frags;
614 618
615 /* Copy headers into the skb linear buffer */ 619 /* Copy headers into the skb linear buffer */
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 015db1cece7..8e56fcf0a0e 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -210,14 +210,11 @@ rx_drop:
210 210
211static struct net_device_stats *veth_get_stats(struct net_device *dev) 211static struct net_device_stats *veth_get_stats(struct net_device *dev)
212{ 212{
213 struct veth_priv *priv; 213 struct veth_priv *priv = netdev_priv(dev);
214 struct net_device_stats *dev_stats; 214 struct net_device_stats *dev_stats = &dev->stats;
215 int cpu; 215 unsigned int cpu;
216 struct veth_net_stats *stats; 216 struct veth_net_stats *stats;
217 217
218 priv = netdev_priv(dev);
219 dev_stats = &dev->stats;
220
221 dev_stats->rx_packets = 0; 218 dev_stats->rx_packets = 0;
222 dev_stats->tx_packets = 0; 219 dev_stats->tx_packets = 0;
223 dev_stats->rx_bytes = 0; 220 dev_stats->rx_bytes = 0;
@@ -225,16 +222,17 @@ static struct net_device_stats *veth_get_stats(struct net_device *dev)
225 dev_stats->tx_dropped = 0; 222 dev_stats->tx_dropped = 0;
226 dev_stats->rx_dropped = 0; 223 dev_stats->rx_dropped = 0;
227 224
228 for_each_online_cpu(cpu) { 225 if (priv->stats)
229 stats = per_cpu_ptr(priv->stats, cpu); 226 for_each_online_cpu(cpu) {
227 stats = per_cpu_ptr(priv->stats, cpu);
230 228
231 dev_stats->rx_packets += stats->rx_packets; 229 dev_stats->rx_packets += stats->rx_packets;
232 dev_stats->tx_packets += stats->tx_packets; 230 dev_stats->tx_packets += stats->tx_packets;
233 dev_stats->rx_bytes += stats->rx_bytes; 231 dev_stats->rx_bytes += stats->rx_bytes;
234 dev_stats->tx_bytes += stats->tx_bytes; 232 dev_stats->tx_bytes += stats->tx_bytes;
235 dev_stats->tx_dropped += stats->tx_dropped; 233 dev_stats->tx_dropped += stats->tx_dropped;
236 dev_stats->rx_dropped += stats->rx_dropped; 234 dev_stats->rx_dropped += stats->rx_dropped;
237 } 235 }
238 236
239 return dev_stats; 237 return dev_stats;
240} 238}
@@ -261,6 +259,8 @@ static int veth_close(struct net_device *dev)
261 netif_carrier_off(dev); 259 netif_carrier_off(dev);
262 netif_carrier_off(priv->peer); 260 netif_carrier_off(priv->peer);
263 261
262 free_percpu(priv->stats);
263 priv->stats = NULL;
264 return 0; 264 return 0;
265} 265}
266 266
@@ -291,15 +291,6 @@ static int veth_dev_init(struct net_device *dev)
291 return 0; 291 return 0;
292} 292}
293 293
294static void veth_dev_free(struct net_device *dev)
295{
296 struct veth_priv *priv;
297
298 priv = netdev_priv(dev);
299 free_percpu(priv->stats);
300 free_netdev(dev);
301}
302
303static const struct net_device_ops veth_netdev_ops = { 294static const struct net_device_ops veth_netdev_ops = {
304 .ndo_init = veth_dev_init, 295 .ndo_init = veth_dev_init,
305 .ndo_open = veth_open, 296 .ndo_open = veth_open,
@@ -317,7 +308,7 @@ static void veth_setup(struct net_device *dev)
317 dev->netdev_ops = &veth_netdev_ops; 308 dev->netdev_ops = &veth_netdev_ops;
318 dev->ethtool_ops = &veth_ethtool_ops; 309 dev->ethtool_ops = &veth_ethtool_ops;
319 dev->features |= NETIF_F_LLTX; 310 dev->features |= NETIF_F_LLTX;
320 dev->destructor = veth_dev_free; 311 dev->destructor = free_netdev;
321} 312}
322 313
323/* 314/*