diff options
Diffstat (limited to 'drivers/net')
30 files changed, 252 insertions, 118 deletions
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index 09b099bfab2b..bdf11d89a499 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -702,6 +702,7 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter) | |||
702 | 702 | ||
703 | 703 | ||
704 | adapter->wol = 0; | 704 | adapter->wol = 0; |
705 | device_set_wakeup_enable(&pdev->dev, false); | ||
705 | adapter->link_speed = SPEED_0; | 706 | adapter->link_speed = SPEED_0; |
706 | adapter->link_duplex = FULL_DUPLEX; | 707 | adapter->link_duplex = FULL_DUPLEX; |
707 | adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE; | 708 | adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE; |
@@ -2444,8 +2445,9 @@ static int atl1c_close(struct net_device *netdev) | |||
2444 | return 0; | 2445 | return 0; |
2445 | } | 2446 | } |
2446 | 2447 | ||
2447 | static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | 2448 | static int atl1c_suspend(struct device *dev) |
2448 | { | 2449 | { |
2450 | struct pci_dev *pdev = to_pci_dev(dev); | ||
2449 | struct net_device *netdev = pci_get_drvdata(pdev); | 2451 | struct net_device *netdev = pci_get_drvdata(pdev); |
2450 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 2452 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
2451 | struct atl1c_hw *hw = &adapter->hw; | 2453 | struct atl1c_hw *hw = &adapter->hw; |
@@ -2454,7 +2456,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2454 | u32 wol_ctrl_data = 0; | 2456 | u32 wol_ctrl_data = 0; |
2455 | u16 mii_intr_status_data = 0; | 2457 | u16 mii_intr_status_data = 0; |
2456 | u32 wufc = adapter->wol; | 2458 | u32 wufc = adapter->wol; |
2457 | int retval = 0; | ||
2458 | 2459 | ||
2459 | atl1c_disable_l0s_l1(hw); | 2460 | atl1c_disable_l0s_l1(hw); |
2460 | if (netif_running(netdev)) { | 2461 | if (netif_running(netdev)) { |
@@ -2462,9 +2463,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2462 | atl1c_down(adapter); | 2463 | atl1c_down(adapter); |
2463 | } | 2464 | } |
2464 | netif_device_detach(netdev); | 2465 | netif_device_detach(netdev); |
2465 | retval = pci_save_state(pdev); | ||
2466 | if (retval) | ||
2467 | return retval; | ||
2468 | 2466 | ||
2469 | if (wufc) | 2467 | if (wufc) |
2470 | if (atl1c_phy_power_saving(hw) != 0) | 2468 | if (atl1c_phy_power_saving(hw) != 0) |
@@ -2525,12 +2523,8 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2525 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); | 2523 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); |
2526 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | 2524 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); |
2527 | 2525 | ||
2528 | /* pcie patch */ | ||
2529 | device_set_wakeup_enable(&pdev->dev, 1); | ||
2530 | |||
2531 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | | 2526 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | |
2532 | GPHY_CTRL_EXT_RESET); | 2527 | GPHY_CTRL_EXT_RESET); |
2533 | pci_prepare_to_sleep(pdev); | ||
2534 | } else { | 2528 | } else { |
2535 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); | 2529 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); |
2536 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; | 2530 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; |
@@ -2540,25 +2534,17 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2540 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | 2534 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); |
2541 | AT_WRITE_REG(hw, REG_WOL_CTRL, 0); | 2535 | AT_WRITE_REG(hw, REG_WOL_CTRL, 0); |
2542 | hw->phy_configured = false; /* re-init PHY when resume */ | 2536 | hw->phy_configured = false; /* re-init PHY when resume */ |
2543 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | ||
2544 | } | 2537 | } |
2545 | 2538 | ||
2546 | pci_disable_device(pdev); | ||
2547 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
2548 | |||
2549 | return 0; | 2539 | return 0; |
2550 | } | 2540 | } |
2551 | 2541 | ||
2552 | static int atl1c_resume(struct pci_dev *pdev) | 2542 | static int atl1c_resume(struct device *dev) |
2553 | { | 2543 | { |
2544 | struct pci_dev *pdev = to_pci_dev(dev); | ||
2554 | struct net_device *netdev = pci_get_drvdata(pdev); | 2545 | struct net_device *netdev = pci_get_drvdata(pdev); |
2555 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 2546 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
2556 | 2547 | ||
2557 | pci_set_power_state(pdev, PCI_D0); | ||
2558 | pci_restore_state(pdev); | ||
2559 | pci_enable_wake(pdev, PCI_D3hot, 0); | ||
2560 | pci_enable_wake(pdev, PCI_D3cold, 0); | ||
2561 | |||
2562 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); | 2548 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); |
2563 | atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE | | 2549 | atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE | |
2564 | ATL1C_PCIE_PHY_RESET); | 2550 | ATL1C_PCIE_PHY_RESET); |
@@ -2582,7 +2568,12 @@ static int atl1c_resume(struct pci_dev *pdev) | |||
2582 | 2568 | ||
2583 | static void atl1c_shutdown(struct pci_dev *pdev) | 2569 | static void atl1c_shutdown(struct pci_dev *pdev) |
2584 | { | 2570 | { |
2585 | atl1c_suspend(pdev, PMSG_SUSPEND); | 2571 | struct net_device *netdev = pci_get_drvdata(pdev); |
2572 | struct atl1c_adapter *adapter = netdev_priv(netdev); | ||
2573 | |||
2574 | atl1c_suspend(&pdev->dev); | ||
2575 | pci_wake_from_d3(pdev, adapter->wol); | ||
2576 | pci_set_power_state(pdev, PCI_D3hot); | ||
2586 | } | 2577 | } |
2587 | 2578 | ||
2588 | static const struct net_device_ops atl1c_netdev_ops = { | 2579 | static const struct net_device_ops atl1c_netdev_ops = { |
@@ -2886,16 +2877,16 @@ static struct pci_error_handlers atl1c_err_handler = { | |||
2886 | .resume = atl1c_io_resume, | 2877 | .resume = atl1c_io_resume, |
2887 | }; | 2878 | }; |
2888 | 2879 | ||
2880 | static SIMPLE_DEV_PM_OPS(atl1c_pm_ops, atl1c_suspend, atl1c_resume); | ||
2881 | |||
2889 | static struct pci_driver atl1c_driver = { | 2882 | static struct pci_driver atl1c_driver = { |
2890 | .name = atl1c_driver_name, | 2883 | .name = atl1c_driver_name, |
2891 | .id_table = atl1c_pci_tbl, | 2884 | .id_table = atl1c_pci_tbl, |
2892 | .probe = atl1c_probe, | 2885 | .probe = atl1c_probe, |
2893 | .remove = __devexit_p(atl1c_remove), | 2886 | .remove = __devexit_p(atl1c_remove), |
2894 | /* Power Managment Hooks */ | ||
2895 | .suspend = atl1c_suspend, | ||
2896 | .resume = atl1c_resume, | ||
2897 | .shutdown = atl1c_shutdown, | 2887 | .shutdown = atl1c_shutdown, |
2898 | .err_handler = &atl1c_err_handler | 2888 | .err_handler = &atl1c_err_handler, |
2889 | .driver.pm = &atl1c_pm_ops, | ||
2899 | }; | 2890 | }; |
2900 | 2891 | ||
2901 | /* | 2892 | /* |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 4594a28b1f66..d64313b7090e 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -234,7 +234,7 @@ struct be_adapter { | |||
234 | u8 __iomem *db; /* Door Bell */ | 234 | u8 __iomem *db; /* Door Bell */ |
235 | u8 __iomem *pcicfg; /* PCI config space */ | 235 | u8 __iomem *pcicfg; /* PCI config space */ |
236 | 236 | ||
237 | spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */ | 237 | struct mutex mbox_lock; /* For serializing mbox cmds to BE card */ |
238 | struct be_dma_mem mbox_mem; | 238 | struct be_dma_mem mbox_mem; |
239 | /* Mbox mem is adjusted to align to 16 bytes. The allocated addr | 239 | /* Mbox mem is adjusted to align to 16 bytes. The allocated addr |
240 | * is stored for freeing purpose */ | 240 | * is stored for freeing purpose */ |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index e4465d222a7d..1c8c79c9d214 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -462,7 +462,8 @@ int be_cmd_fw_init(struct be_adapter *adapter) | |||
462 | u8 *wrb; | 462 | u8 *wrb; |
463 | int status; | 463 | int status; |
464 | 464 | ||
465 | spin_lock(&adapter->mbox_lock); | 465 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
466 | return -1; | ||
466 | 467 | ||
467 | wrb = (u8 *)wrb_from_mbox(adapter); | 468 | wrb = (u8 *)wrb_from_mbox(adapter); |
468 | *wrb++ = 0xFF; | 469 | *wrb++ = 0xFF; |
@@ -476,7 +477,7 @@ int be_cmd_fw_init(struct be_adapter *adapter) | |||
476 | 477 | ||
477 | status = be_mbox_notify_wait(adapter); | 478 | status = be_mbox_notify_wait(adapter); |
478 | 479 | ||
479 | spin_unlock(&adapter->mbox_lock); | 480 | mutex_unlock(&adapter->mbox_lock); |
480 | return status; | 481 | return status; |
481 | } | 482 | } |
482 | 483 | ||
@@ -491,7 +492,8 @@ int be_cmd_fw_clean(struct be_adapter *adapter) | |||
491 | if (adapter->eeh_err) | 492 | if (adapter->eeh_err) |
492 | return -EIO; | 493 | return -EIO; |
493 | 494 | ||
494 | spin_lock(&adapter->mbox_lock); | 495 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
496 | return -1; | ||
495 | 497 | ||
496 | wrb = (u8 *)wrb_from_mbox(adapter); | 498 | wrb = (u8 *)wrb_from_mbox(adapter); |
497 | *wrb++ = 0xFF; | 499 | *wrb++ = 0xFF; |
@@ -505,7 +507,7 @@ int be_cmd_fw_clean(struct be_adapter *adapter) | |||
505 | 507 | ||
506 | status = be_mbox_notify_wait(adapter); | 508 | status = be_mbox_notify_wait(adapter); |
507 | 509 | ||
508 | spin_unlock(&adapter->mbox_lock); | 510 | mutex_unlock(&adapter->mbox_lock); |
509 | return status; | 511 | return status; |
510 | } | 512 | } |
511 | int be_cmd_eq_create(struct be_adapter *adapter, | 513 | int be_cmd_eq_create(struct be_adapter *adapter, |
@@ -516,7 +518,8 @@ int be_cmd_eq_create(struct be_adapter *adapter, | |||
516 | struct be_dma_mem *q_mem = &eq->dma_mem; | 518 | struct be_dma_mem *q_mem = &eq->dma_mem; |
517 | int status; | 519 | int status; |
518 | 520 | ||
519 | spin_lock(&adapter->mbox_lock); | 521 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
522 | return -1; | ||
520 | 523 | ||
521 | wrb = wrb_from_mbox(adapter); | 524 | wrb = wrb_from_mbox(adapter); |
522 | req = embedded_payload(wrb); | 525 | req = embedded_payload(wrb); |
@@ -546,7 +549,7 @@ int be_cmd_eq_create(struct be_adapter *adapter, | |||
546 | eq->created = true; | 549 | eq->created = true; |
547 | } | 550 | } |
548 | 551 | ||
549 | spin_unlock(&adapter->mbox_lock); | 552 | mutex_unlock(&adapter->mbox_lock); |
550 | return status; | 553 | return status; |
551 | } | 554 | } |
552 | 555 | ||
@@ -558,7 +561,8 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
558 | struct be_cmd_req_mac_query *req; | 561 | struct be_cmd_req_mac_query *req; |
559 | int status; | 562 | int status; |
560 | 563 | ||
561 | spin_lock(&adapter->mbox_lock); | 564 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
565 | return -1; | ||
562 | 566 | ||
563 | wrb = wrb_from_mbox(adapter); | 567 | wrb = wrb_from_mbox(adapter); |
564 | req = embedded_payload(wrb); | 568 | req = embedded_payload(wrb); |
@@ -583,7 +587,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
583 | memcpy(mac_addr, resp->mac.addr, ETH_ALEN); | 587 | memcpy(mac_addr, resp->mac.addr, ETH_ALEN); |
584 | } | 588 | } |
585 | 589 | ||
586 | spin_unlock(&adapter->mbox_lock); | 590 | mutex_unlock(&adapter->mbox_lock); |
587 | return status; | 591 | return status; |
588 | } | 592 | } |
589 | 593 | ||
@@ -667,7 +671,8 @@ int be_cmd_cq_create(struct be_adapter *adapter, | |||
667 | void *ctxt; | 671 | void *ctxt; |
668 | int status; | 672 | int status; |
669 | 673 | ||
670 | spin_lock(&adapter->mbox_lock); | 674 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
675 | return -1; | ||
671 | 676 | ||
672 | wrb = wrb_from_mbox(adapter); | 677 | wrb = wrb_from_mbox(adapter); |
673 | req = embedded_payload(wrb); | 678 | req = embedded_payload(wrb); |
@@ -701,7 +706,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, | |||
701 | cq->created = true; | 706 | cq->created = true; |
702 | } | 707 | } |
703 | 708 | ||
704 | spin_unlock(&adapter->mbox_lock); | 709 | mutex_unlock(&adapter->mbox_lock); |
705 | 710 | ||
706 | return status; | 711 | return status; |
707 | } | 712 | } |
@@ -724,7 +729,8 @@ int be_cmd_mccq_create(struct be_adapter *adapter, | |||
724 | void *ctxt; | 729 | void *ctxt; |
725 | int status; | 730 | int status; |
726 | 731 | ||
727 | spin_lock(&adapter->mbox_lock); | 732 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
733 | return -1; | ||
728 | 734 | ||
729 | wrb = wrb_from_mbox(adapter); | 735 | wrb = wrb_from_mbox(adapter); |
730 | req = embedded_payload(wrb); | 736 | req = embedded_payload(wrb); |
@@ -754,7 +760,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter, | |||
754 | mccq->id = le16_to_cpu(resp->id); | 760 | mccq->id = le16_to_cpu(resp->id); |
755 | mccq->created = true; | 761 | mccq->created = true; |
756 | } | 762 | } |
757 | spin_unlock(&adapter->mbox_lock); | 763 | mutex_unlock(&adapter->mbox_lock); |
758 | 764 | ||
759 | return status; | 765 | return status; |
760 | } | 766 | } |
@@ -769,7 +775,8 @@ int be_cmd_txq_create(struct be_adapter *adapter, | |||
769 | void *ctxt; | 775 | void *ctxt; |
770 | int status; | 776 | int status; |
771 | 777 | ||
772 | spin_lock(&adapter->mbox_lock); | 778 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
779 | return -1; | ||
773 | 780 | ||
774 | wrb = wrb_from_mbox(adapter); | 781 | wrb = wrb_from_mbox(adapter); |
775 | req = embedded_payload(wrb); | 782 | req = embedded_payload(wrb); |
@@ -801,7 +808,7 @@ int be_cmd_txq_create(struct be_adapter *adapter, | |||
801 | txq->created = true; | 808 | txq->created = true; |
802 | } | 809 | } |
803 | 810 | ||
804 | spin_unlock(&adapter->mbox_lock); | 811 | mutex_unlock(&adapter->mbox_lock); |
805 | 812 | ||
806 | return status; | 813 | return status; |
807 | } | 814 | } |
@@ -816,7 +823,8 @@ int be_cmd_rxq_create(struct be_adapter *adapter, | |||
816 | struct be_dma_mem *q_mem = &rxq->dma_mem; | 823 | struct be_dma_mem *q_mem = &rxq->dma_mem; |
817 | int status; | 824 | int status; |
818 | 825 | ||
819 | spin_lock(&adapter->mbox_lock); | 826 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
827 | return -1; | ||
820 | 828 | ||
821 | wrb = wrb_from_mbox(adapter); | 829 | wrb = wrb_from_mbox(adapter); |
822 | req = embedded_payload(wrb); | 830 | req = embedded_payload(wrb); |
@@ -843,7 +851,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter, | |||
843 | *rss_id = resp->rss_id; | 851 | *rss_id = resp->rss_id; |
844 | } | 852 | } |
845 | 853 | ||
846 | spin_unlock(&adapter->mbox_lock); | 854 | mutex_unlock(&adapter->mbox_lock); |
847 | 855 | ||
848 | return status; | 856 | return status; |
849 | } | 857 | } |
@@ -862,7 +870,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
862 | if (adapter->eeh_err) | 870 | if (adapter->eeh_err) |
863 | return -EIO; | 871 | return -EIO; |
864 | 872 | ||
865 | spin_lock(&adapter->mbox_lock); | 873 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
874 | return -1; | ||
866 | 875 | ||
867 | wrb = wrb_from_mbox(adapter); | 876 | wrb = wrb_from_mbox(adapter); |
868 | req = embedded_payload(wrb); | 877 | req = embedded_payload(wrb); |
@@ -899,7 +908,7 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, | |||
899 | 908 | ||
900 | status = be_mbox_notify_wait(adapter); | 909 | status = be_mbox_notify_wait(adapter); |
901 | 910 | ||
902 | spin_unlock(&adapter->mbox_lock); | 911 | mutex_unlock(&adapter->mbox_lock); |
903 | 912 | ||
904 | return status; | 913 | return status; |
905 | } | 914 | } |
@@ -915,7 +924,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, | |||
915 | struct be_cmd_req_if_create *req; | 924 | struct be_cmd_req_if_create *req; |
916 | int status; | 925 | int status; |
917 | 926 | ||
918 | spin_lock(&adapter->mbox_lock); | 927 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
928 | return -1; | ||
919 | 929 | ||
920 | wrb = wrb_from_mbox(adapter); | 930 | wrb = wrb_from_mbox(adapter); |
921 | req = embedded_payload(wrb); | 931 | req = embedded_payload(wrb); |
@@ -941,7 +951,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, | |||
941 | *pmac_id = le32_to_cpu(resp->pmac_id); | 951 | *pmac_id = le32_to_cpu(resp->pmac_id); |
942 | } | 952 | } |
943 | 953 | ||
944 | spin_unlock(&adapter->mbox_lock); | 954 | mutex_unlock(&adapter->mbox_lock); |
945 | return status; | 955 | return status; |
946 | } | 956 | } |
947 | 957 | ||
@@ -955,7 +965,8 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id) | |||
955 | if (adapter->eeh_err) | 965 | if (adapter->eeh_err) |
956 | return -EIO; | 966 | return -EIO; |
957 | 967 | ||
958 | spin_lock(&adapter->mbox_lock); | 968 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
969 | return -1; | ||
959 | 970 | ||
960 | wrb = wrb_from_mbox(adapter); | 971 | wrb = wrb_from_mbox(adapter); |
961 | req = embedded_payload(wrb); | 972 | req = embedded_payload(wrb); |
@@ -970,7 +981,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id) | |||
970 | 981 | ||
971 | status = be_mbox_notify_wait(adapter); | 982 | status = be_mbox_notify_wait(adapter); |
972 | 983 | ||
973 | spin_unlock(&adapter->mbox_lock); | 984 | mutex_unlock(&adapter->mbox_lock); |
974 | 985 | ||
975 | return status; | 986 | return status; |
976 | } | 987 | } |
@@ -1060,7 +1071,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver) | |||
1060 | struct be_cmd_req_get_fw_version *req; | 1071 | struct be_cmd_req_get_fw_version *req; |
1061 | int status; | 1072 | int status; |
1062 | 1073 | ||
1063 | spin_lock(&adapter->mbox_lock); | 1074 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1075 | return -1; | ||
1064 | 1076 | ||
1065 | wrb = wrb_from_mbox(adapter); | 1077 | wrb = wrb_from_mbox(adapter); |
1066 | req = embedded_payload(wrb); | 1078 | req = embedded_payload(wrb); |
@@ -1077,7 +1089,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver) | |||
1077 | strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); | 1089 | strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); |
1078 | } | 1090 | } |
1079 | 1091 | ||
1080 | spin_unlock(&adapter->mbox_lock); | 1092 | mutex_unlock(&adapter->mbox_lock); |
1081 | return status; | 1093 | return status; |
1082 | } | 1094 | } |
1083 | 1095 | ||
@@ -1322,7 +1334,8 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, | |||
1322 | struct be_cmd_req_query_fw_cfg *req; | 1334 | struct be_cmd_req_query_fw_cfg *req; |
1323 | int status; | 1335 | int status; |
1324 | 1336 | ||
1325 | spin_lock(&adapter->mbox_lock); | 1337 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1338 | return -1; | ||
1326 | 1339 | ||
1327 | wrb = wrb_from_mbox(adapter); | 1340 | wrb = wrb_from_mbox(adapter); |
1328 | req = embedded_payload(wrb); | 1341 | req = embedded_payload(wrb); |
@@ -1341,7 +1354,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, | |||
1341 | *caps = le32_to_cpu(resp->function_caps); | 1354 | *caps = le32_to_cpu(resp->function_caps); |
1342 | } | 1355 | } |
1343 | 1356 | ||
1344 | spin_unlock(&adapter->mbox_lock); | 1357 | mutex_unlock(&adapter->mbox_lock); |
1345 | return status; | 1358 | return status; |
1346 | } | 1359 | } |
1347 | 1360 | ||
@@ -1352,7 +1365,8 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1352 | struct be_cmd_req_hdr *req; | 1365 | struct be_cmd_req_hdr *req; |
1353 | int status; | 1366 | int status; |
1354 | 1367 | ||
1355 | spin_lock(&adapter->mbox_lock); | 1368 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1369 | return -1; | ||
1356 | 1370 | ||
1357 | wrb = wrb_from_mbox(adapter); | 1371 | wrb = wrb_from_mbox(adapter); |
1358 | req = embedded_payload(wrb); | 1372 | req = embedded_payload(wrb); |
@@ -1365,7 +1379,7 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1365 | 1379 | ||
1366 | status = be_mbox_notify_wait(adapter); | 1380 | status = be_mbox_notify_wait(adapter); |
1367 | 1381 | ||
1368 | spin_unlock(&adapter->mbox_lock); | 1382 | mutex_unlock(&adapter->mbox_lock); |
1369 | return status; | 1383 | return status; |
1370 | } | 1384 | } |
1371 | 1385 | ||
@@ -1376,7 +1390,8 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size) | |||
1376 | u32 myhash[10]; | 1390 | u32 myhash[10]; |
1377 | int status; | 1391 | int status; |
1378 | 1392 | ||
1379 | spin_lock(&adapter->mbox_lock); | 1393 | if (mutex_lock_interruptible(&adapter->mbox_lock)) |
1394 | return -1; | ||
1380 | 1395 | ||
1381 | wrb = wrb_from_mbox(adapter); | 1396 | wrb = wrb_from_mbox(adapter); |
1382 | req = embedded_payload(wrb); | 1397 | req = embedded_payload(wrb); |
@@ -1396,7 +1411,7 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size) | |||
1396 | 1411 | ||
1397 | status = be_mbox_notify_wait(adapter); | 1412 | status = be_mbox_notify_wait(adapter); |
1398 | 1413 | ||
1399 | spin_unlock(&adapter->mbox_lock); | 1414 | mutex_unlock(&adapter->mbox_lock); |
1400 | return status; | 1415 | return status; |
1401 | } | 1416 | } |
1402 | 1417 | ||
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 93354eee2cfd..fd251b59b7f9 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -2677,7 +2677,7 @@ static int be_ctrl_init(struct be_adapter *adapter) | |||
2677 | } | 2677 | } |
2678 | memset(mc_cmd_mem->va, 0, mc_cmd_mem->size); | 2678 | memset(mc_cmd_mem->va, 0, mc_cmd_mem->size); |
2679 | 2679 | ||
2680 | spin_lock_init(&adapter->mbox_lock); | 2680 | mutex_init(&adapter->mbox_lock); |
2681 | spin_lock_init(&adapter->mcc_lock); | 2681 | spin_lock_init(&adapter->mcc_lock); |
2682 | spin_lock_init(&adapter->mcc_cq_lock); | 2682 | spin_lock_init(&adapter->mcc_cq_lock); |
2683 | 2683 | ||
diff --git a/drivers/net/bonding/bond_ipv6.c b/drivers/net/bonding/bond_ipv6.c index 121b073a6c3f..84fbd4ebd778 100644 --- a/drivers/net/bonding/bond_ipv6.c +++ b/drivers/net/bonding/bond_ipv6.c | |||
@@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev, | |||
88 | } | 88 | } |
89 | 89 | ||
90 | if (vlan_id) { | 90 | if (vlan_id) { |
91 | skb = vlan_put_tag(skb, vlan_id); | 91 | /* The Ethernet header is not present yet, so it is |
92 | * too early to insert a VLAN tag. Force use of an | ||
93 | * out-of-line tag here and let dev_hard_start_xmit() | ||
94 | * insert it if the slave hardware can't. | ||
95 | */ | ||
96 | skb = __vlan_hwaccel_put_tag(skb, vlan_id); | ||
92 | if (!skb) { | 97 | if (!skb) { |
93 | pr_err("failed to insert VLAN tag\n"); | 98 | pr_err("failed to insert VLAN tag\n"); |
94 | return; | 99 | return; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d0ea760ce419..3b16c34ed86e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -418,36 +418,11 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
418 | * @bond: bond device that got this skb for tx. | 418 | * @bond: bond device that got this skb for tx. |
419 | * @skb: hw accel VLAN tagged skb to transmit | 419 | * @skb: hw accel VLAN tagged skb to transmit |
420 | * @slave_dev: slave that is supposed to xmit this skbuff | 420 | * @slave_dev: slave that is supposed to xmit this skbuff |
421 | * | ||
422 | * When the bond gets an skb to transmit that is | ||
423 | * already hardware accelerated VLAN tagged, and it | ||
424 | * needs to relay this skb to a slave that is not | ||
425 | * hw accel capable, the skb needs to be "unaccelerated", | ||
426 | * i.e. strip the hwaccel tag and re-insert it as part | ||
427 | * of the payload. | ||
428 | */ | 421 | */ |
429 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | 422 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, |
430 | struct net_device *slave_dev) | 423 | struct net_device *slave_dev) |
431 | { | 424 | { |
432 | unsigned short uninitialized_var(vlan_id); | 425 | skb->dev = slave_dev; |
433 | |||
434 | /* Test vlan_list not vlgrp to catch and handle 802.1p tags */ | ||
435 | if (!list_empty(&bond->vlan_list) && | ||
436 | !(slave_dev->features & NETIF_F_HW_VLAN_TX) && | ||
437 | vlan_get_tag(skb, &vlan_id) == 0) { | ||
438 | skb->dev = slave_dev; | ||
439 | skb = vlan_put_tag(skb, vlan_id); | ||
440 | if (!skb) { | ||
441 | /* vlan_put_tag() frees the skb in case of error, | ||
442 | * so return success here so the calling functions | ||
443 | * won't attempt to free is again. | ||
444 | */ | ||
445 | return 0; | ||
446 | } | ||
447 | } else { | ||
448 | skb->dev = slave_dev; | ||
449 | } | ||
450 | |||
451 | skb->priority = 1; | 426 | skb->priority = 1; |
452 | #ifdef CONFIG_NET_POLL_CONTROLLER | 427 | #ifdef CONFIG_NET_POLL_CONTROLLER |
453 | if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) { | 428 | if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) { |
@@ -1203,11 +1178,13 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1203 | bond_do_fail_over_mac(bond, new_active, | 1178 | bond_do_fail_over_mac(bond, new_active, |
1204 | old_active); | 1179 | old_active); |
1205 | 1180 | ||
1206 | bond->send_grat_arp = bond->params.num_grat_arp; | 1181 | if (netif_running(bond->dev)) { |
1207 | bond_send_gratuitous_arp(bond); | 1182 | bond->send_grat_arp = bond->params.num_grat_arp; |
1183 | bond_send_gratuitous_arp(bond); | ||
1208 | 1184 | ||
1209 | bond->send_unsol_na = bond->params.num_unsol_na; | 1185 | bond->send_unsol_na = bond->params.num_unsol_na; |
1210 | bond_send_unsolicited_na(bond); | 1186 | bond_send_unsolicited_na(bond); |
1187 | } | ||
1211 | 1188 | ||
1212 | write_unlock_bh(&bond->curr_slave_lock); | 1189 | write_unlock_bh(&bond->curr_slave_lock); |
1213 | read_unlock(&bond->lock); | 1190 | read_unlock(&bond->lock); |
@@ -1221,8 +1198,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
1221 | 1198 | ||
1222 | /* resend IGMP joins since active slave has changed or | 1199 | /* resend IGMP joins since active slave has changed or |
1223 | * all were sent on curr_active_slave */ | 1200 | * all were sent on curr_active_slave */ |
1224 | if ((USES_PRIMARY(bond->params.mode) && new_active) || | 1201 | if (((USES_PRIMARY(bond->params.mode) && new_active) || |
1225 | bond->params.mode == BOND_MODE_ROUNDROBIN) { | 1202 | bond->params.mode == BOND_MODE_ROUNDROBIN) && |
1203 | netif_running(bond->dev)) { | ||
1226 | bond->igmp_retrans = bond->params.resend_igmp; | 1204 | bond->igmp_retrans = bond->params.resend_igmp; |
1227 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); | 1205 | queue_delayed_work(bond->wq, &bond->mcast_work, 0); |
1228 | } | 1206 | } |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index c2f081352a03..4feeb2d650a4 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -269,11 +269,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n | |||
269 | 269 | ||
270 | bond_for_each_slave(bond, slave, i) { | 270 | bond_for_each_slave(bond, slave, i) { |
271 | if (slave->dev == slave_dev) { | 271 | if (slave->dev == slave_dev) { |
272 | break; | 272 | return slave; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | return slave; | 276 | return 0; |
277 | } | 277 | } |
278 | 278 | ||
279 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | 279 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index aa56963ad558..c353bf3113cc 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -935,7 +935,7 @@ static void epic_init_ring(struct net_device *dev) | |||
935 | 935 | ||
936 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 936 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
937 | for (i = 0; i < RX_RING_SIZE; i++) { | 937 | for (i = 0; i < RX_RING_SIZE; i++) { |
938 | struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz); | 938 | struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz + 2); |
939 | ep->rx_skbuff[i] = skb; | 939 | ep->rx_skbuff[i] = skb; |
940 | if (skb == NULL) | 940 | if (skb == NULL) |
941 | break; | 941 | break; |
@@ -1233,7 +1233,7 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1233 | entry = ep->dirty_rx % RX_RING_SIZE; | 1233 | entry = ep->dirty_rx % RX_RING_SIZE; |
1234 | if (ep->rx_skbuff[entry] == NULL) { | 1234 | if (ep->rx_skbuff[entry] == NULL) { |
1235 | struct sk_buff *skb; | 1235 | struct sk_buff *skb; |
1236 | skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz); | 1236 | skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz + 2); |
1237 | if (skb == NULL) | 1237 | if (skb == NULL) |
1238 | break; | 1238 | break; |
1239 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1239 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 9a6485892b3d..80d25ed53344 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -1202,7 +1202,7 @@ static void hamachi_init_ring(struct net_device *dev) | |||
1202 | } | 1202 | } |
1203 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 1203 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
1204 | for (i = 0; i < RX_RING_SIZE; i++) { | 1204 | for (i = 0; i < RX_RING_SIZE; i++) { |
1205 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz); | 1205 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2); |
1206 | hmp->rx_skbuff[i] = skb; | 1206 | hmp->rx_skbuff[i] = skb; |
1207 | if (skb == NULL) | 1207 | if (skb == NULL) |
1208 | break; | 1208 | break; |
@@ -1669,7 +1669,7 @@ static int hamachi_rx(struct net_device *dev) | |||
1669 | entry = hmp->dirty_rx % RX_RING_SIZE; | 1669 | entry = hmp->dirty_rx % RX_RING_SIZE; |
1670 | desc = &(hmp->rx_ring[entry]); | 1670 | desc = &(hmp->rx_ring[entry]); |
1671 | if (hmp->rx_skbuff[entry] == NULL) { | 1671 | if (hmp->rx_skbuff[entry] == NULL) { |
1672 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz); | 1672 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2); |
1673 | 1673 | ||
1674 | hmp->rx_skbuff[entry] = skb; | 1674 | hmp->rx_skbuff[entry] = skb; |
1675 | if (skb == NULL) | 1675 | if (skb == NULL) |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 8a4d19e5de06..f1047dd8a526 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -690,6 +690,7 @@ static void block_output(struct net_device *dev, int count, | |||
690 | static struct pcmcia_device_id axnet_ids[] = { | 690 | static struct pcmcia_device_id axnet_ids[] = { |
691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081), | 691 | PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081), |
692 | PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301), | 692 | PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301), |
693 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328), | ||
693 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301), | 694 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301), |
694 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303), | 695 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303), |
695 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), | 696 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index d05c44692f08..2c158910f7ea 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1493,7 +1493,6 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1493 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), | 1493 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), |
1494 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), | 1494 | PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), |
1495 | PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), | 1495 | PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), |
1496 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328), | ||
1497 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), | 1496 | PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), |
1498 | PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), | 1497 | PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), |
1499 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), | 1498 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 3ed2a67bd6d3..b409d7ec4ac1 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev) | |||
1016 | 1016 | ||
1017 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 1017 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
1018 | for (i = 0; i < RX_RING_SIZE; i++) { | 1018 | for (i = 0; i < RX_RING_SIZE; i++) { |
1019 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); | 1019 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2); |
1020 | np->rx_skbuff[i] = skb; | 1020 | np->rx_skbuff[i] = skb; |
1021 | if (skb == NULL) | 1021 | if (skb == NULL) |
1022 | break; | 1022 | break; |
@@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev) | |||
1407 | struct sk_buff *skb; | 1407 | struct sk_buff *skb; |
1408 | entry = np->dirty_rx % RX_RING_SIZE; | 1408 | entry = np->dirty_rx % RX_RING_SIZE; |
1409 | if (np->rx_skbuff[entry] == NULL) { | 1409 | if (np->rx_skbuff[entry] == NULL) { |
1410 | skb = dev_alloc_skb(np->rx_buf_sz); | 1410 | skb = dev_alloc_skb(np->rx_buf_sz + 2); |
1411 | np->rx_skbuff[entry] = skb; | 1411 | np->rx_skbuff[entry] = skb; |
1412 | if (skb == NULL) | 1412 | if (skb == NULL) |
1413 | break; /* Better luck next round. */ | 1413 | break; /* Better luck next round. */ |
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c index 8b3dc1eb4015..296000bf5a25 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -324,7 +324,7 @@ static int bdx_fw_load(struct bdx_priv *priv) | |||
324 | ENTER; | 324 | ENTER; |
325 | master = READ_REG(priv, regINIT_SEMAPHORE); | 325 | master = READ_REG(priv, regINIT_SEMAPHORE); |
326 | if (!READ_REG(priv, regINIT_STATUS) && master) { | 326 | if (!READ_REG(priv, regINIT_STATUS) && master) { |
327 | rc = request_firmware(&fw, "tehuti/firmware.bin", &priv->pdev->dev); | 327 | rc = request_firmware(&fw, "tehuti/bdx.bin", &priv->pdev->dev); |
328 | if (rc) | 328 | if (rc) |
329 | goto out; | 329 | goto out; |
330 | bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size); | 330 | bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size); |
@@ -2510,4 +2510,4 @@ module_exit(bdx_module_exit); | |||
2510 | MODULE_LICENSE("GPL"); | 2510 | MODULE_LICENSE("GPL"); |
2511 | MODULE_AUTHOR(DRIVER_AUTHOR); | 2511 | MODULE_AUTHOR(DRIVER_AUTHOR); |
2512 | MODULE_DESCRIPTION(BDX_DRV_DESC); | 2512 | MODULE_DESCRIPTION(BDX_DRV_DESC); |
2513 | MODULE_FIRMWARE("tehuti/firmware.bin"); | 2513 | MODULE_FIRMWARE("tehuti/bdx.bin"); |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 5b83c3f35f47..a3c46f6a15e7 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -1004,7 +1004,6 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | strcpy(info->driver, KBUILD_MODNAME); | 1006 | strcpy(info->driver, KBUILD_MODNAME); |
1007 | strcpy(info->version, UTS_RELEASE); | ||
1008 | strcpy(info->bus_info, pci_name(pci_dev)); | 1007 | strcpy(info->bus_info, pci_name(pci_dev)); |
1009 | } | 1008 | } |
1010 | 1009 | ||
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index aea4645be7f6..6140b56cce53 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -1508,6 +1508,10 @@ static const struct usb_device_id products [] = { | |||
1508 | USB_DEVICE (0x0b95, 0x1780), | 1508 | USB_DEVICE (0x0b95, 0x1780), |
1509 | .driver_info = (unsigned long) &ax88178_info, | 1509 | .driver_info = (unsigned long) &ax88178_info, |
1510 | }, { | 1510 | }, { |
1511 | // Logitec LAN-GTJ/U2A | ||
1512 | USB_DEVICE (0x0789, 0x0160), | ||
1513 | .driver_info = (unsigned long) &ax88178_info, | ||
1514 | }, { | ||
1511 | // Linksys USB200M Rev 2 | 1515 | // Linksys USB200M Rev 2 |
1512 | USB_DEVICE (0x13b1, 0x0018), | 1516 | USB_DEVICE (0x13b1, 0x0018), |
1513 | .driver_info = (unsigned long) &ax88772_info, | 1517 | .driver_info = (unsigned long) &ax88772_info, |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index a6281e3987b5..2b791392e788 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * MOSCHIP MCS7830 based USB 2.0 Ethernet Devices | 2 | * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices |
3 | * | 3 | * |
4 | * based on usbnet.c, asix.c and the vendor provided mcs7830 driver | 4 | * based on usbnet.c, asix.c and the vendor provided mcs7830 driver |
5 | * | 5 | * |
@@ -11,6 +11,9 @@ | |||
11 | * | 11 | * |
12 | * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!). | 12 | * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!). |
13 | * | 13 | * |
14 | * 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"), | ||
15 | * per active notification by manufacturer | ||
16 | * | ||
14 | * TODO: | 17 | * TODO: |
15 | * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?) | 18 | * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?) |
16 | * - implement ethtool_ops get_pauseparam/set_pauseparam | 19 | * - implement ethtool_ops get_pauseparam/set_pauseparam |
@@ -60,6 +63,7 @@ | |||
60 | #define MCS7830_MAX_MCAST 64 | 63 | #define MCS7830_MAX_MCAST 64 |
61 | 64 | ||
62 | #define MCS7830_VENDOR_ID 0x9710 | 65 | #define MCS7830_VENDOR_ID 0x9710 |
66 | #define MCS7832_PRODUCT_ID 0x7832 | ||
63 | #define MCS7830_PRODUCT_ID 0x7830 | 67 | #define MCS7830_PRODUCT_ID 0x7830 |
64 | #define MCS7730_PRODUCT_ID 0x7730 | 68 | #define MCS7730_PRODUCT_ID 0x7730 |
65 | 69 | ||
@@ -351,7 +355,7 @@ static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode) | |||
351 | if (!ret) | 355 | if (!ret) |
352 | ret = mcs7830_write_phy(dev, MII_BMCR, | 356 | ret = mcs7830_write_phy(dev, MII_BMCR, |
353 | BMCR_ANENABLE | BMCR_ANRESTART ); | 357 | BMCR_ANENABLE | BMCR_ANRESTART ); |
354 | return ret < 0 ? : 0; | 358 | return ret; |
355 | } | 359 | } |
356 | 360 | ||
357 | 361 | ||
@@ -626,7 +630,7 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
626 | } | 630 | } |
627 | 631 | ||
628 | static const struct driver_info moschip_info = { | 632 | static const struct driver_info moschip_info = { |
629 | .description = "MOSCHIP 7830/7730 usb-NET adapter", | 633 | .description = "MOSCHIP 7830/7832/7730 usb-NET adapter", |
630 | .bind = mcs7830_bind, | 634 | .bind = mcs7830_bind, |
631 | .rx_fixup = mcs7830_rx_fixup, | 635 | .rx_fixup = mcs7830_rx_fixup, |
632 | .flags = FLAG_ETHER, | 636 | .flags = FLAG_ETHER, |
@@ -645,6 +649,10 @@ static const struct driver_info sitecom_info = { | |||
645 | 649 | ||
646 | static const struct usb_device_id products[] = { | 650 | static const struct usb_device_id products[] = { |
647 | { | 651 | { |
652 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID), | ||
653 | .driver_info = (unsigned long) &moschip_info, | ||
654 | }, | ||
655 | { | ||
648 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), | 656 | USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), |
649 | .driver_info = (unsigned long) &moschip_info, | 657 | .driver_info = (unsigned long) &moschip_info, |
650 | }, | 658 | }, |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 0bbc0c323135..cc83fa71c3ff 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -166,7 +166,9 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
166 | if (!(rcv->flags & IFF_UP)) | 166 | if (!(rcv->flags & IFF_UP)) |
167 | goto tx_drop; | 167 | goto tx_drop; |
168 | 168 | ||
169 | if (dev->features & NETIF_F_NO_CSUM) | 169 | /* don't change ip_summed == CHECKSUM_PARTIAL, as that |
170 | will cause bad checksum on forwarded packets */ | ||
171 | if (skb->ip_summed == CHECKSUM_NONE) | ||
170 | skb->ip_summed = rcv_priv->ip_summed; | 172 | skb->ip_summed = rcv_priv->ip_summed; |
171 | 173 | ||
172 | length = skb->len + ETH_HLEN; | 174 | length = skb->len + ETH_HLEN; |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 25a2722c8a98..1d9aed645723 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -891,7 +891,6 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local, | |||
891 | 891 | ||
892 | SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops); | 892 | SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops); |
893 | 893 | ||
894 | netif_stop_queue(dev); | ||
895 | } | 894 | } |
896 | 895 | ||
897 | static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked) | 896 | static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index db540910b110..0e027f787fbc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -315,6 +315,7 @@ struct iwl_cfg iwl100_bgn_cfg = { | |||
315 | .mod_params = &iwlagn_mod_params, | 315 | .mod_params = &iwlagn_mod_params, |
316 | .base_params = &iwl1000_base_params, | 316 | .base_params = &iwl1000_base_params, |
317 | .ht_params = &iwl1000_ht_params, | 317 | .ht_params = &iwl1000_ht_params, |
318 | .use_new_eeprom_reading = true, | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | struct iwl_cfg iwl100_bg_cfg = { | 321 | struct iwl_cfg iwl100_bg_cfg = { |
@@ -330,6 +331,7 @@ struct iwl_cfg iwl100_bg_cfg = { | |||
330 | .ops = &iwl1000_ops, | 331 | .ops = &iwl1000_ops, |
331 | .mod_params = &iwlagn_mod_params, | 332 | .mod_params = &iwlagn_mod_params, |
332 | .base_params = &iwl1000_base_params, | 333 | .base_params = &iwl1000_base_params, |
334 | .use_new_eeprom_reading = true, | ||
333 | }; | 335 | }; |
334 | 336 | ||
335 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 337 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 11e6532fc573..0ceeaac85eda 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -561,6 +561,7 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = { | |||
561 | .ht_params = &iwl6000_ht_params, | 561 | .ht_params = &iwl6000_ht_params, |
562 | .need_dc_calib = true, | 562 | .need_dc_calib = true, |
563 | .need_temp_offset_calib = true, | 563 | .need_temp_offset_calib = true, |
564 | .use_new_eeprom_reading = true, | ||
564 | }; | 565 | }; |
565 | 566 | ||
566 | struct iwl_cfg iwl6000g2a_2abg_cfg = { | 567 | struct iwl_cfg iwl6000g2a_2abg_cfg = { |
@@ -578,6 +579,7 @@ struct iwl_cfg iwl6000g2a_2abg_cfg = { | |||
578 | .base_params = &iwl6000_base_params, | 579 | .base_params = &iwl6000_base_params, |
579 | .need_dc_calib = true, | 580 | .need_dc_calib = true, |
580 | .need_temp_offset_calib = true, | 581 | .need_temp_offset_calib = true, |
582 | .use_new_eeprom_reading = true, | ||
581 | }; | 583 | }; |
582 | 584 | ||
583 | struct iwl_cfg iwl6000g2a_2bg_cfg = { | 585 | struct iwl_cfg iwl6000g2a_2bg_cfg = { |
@@ -595,6 +597,7 @@ struct iwl_cfg iwl6000g2a_2bg_cfg = { | |||
595 | .base_params = &iwl6000_base_params, | 597 | .base_params = &iwl6000_base_params, |
596 | .need_dc_calib = true, | 598 | .need_dc_calib = true, |
597 | .need_temp_offset_calib = true, | 599 | .need_temp_offset_calib = true, |
600 | .use_new_eeprom_reading = true, | ||
598 | }; | 601 | }; |
599 | 602 | ||
600 | struct iwl_cfg iwl6000g2b_2agn_cfg = { | 603 | struct iwl_cfg iwl6000g2b_2agn_cfg = { |
@@ -616,6 +619,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = { | |||
616 | .need_temp_offset_calib = true, | 619 | .need_temp_offset_calib = true, |
617 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 620 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
618 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 621 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
622 | .use_new_eeprom_reading = true, | ||
619 | }; | 623 | }; |
620 | 624 | ||
621 | struct iwl_cfg iwl6000g2b_2abg_cfg = { | 625 | struct iwl_cfg iwl6000g2b_2abg_cfg = { |
@@ -636,6 +640,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = { | |||
636 | .need_temp_offset_calib = true, | 640 | .need_temp_offset_calib = true, |
637 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 641 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
638 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 642 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
643 | .use_new_eeprom_reading = true, | ||
639 | }; | 644 | }; |
640 | 645 | ||
641 | struct iwl_cfg iwl6000g2b_2bgn_cfg = { | 646 | struct iwl_cfg iwl6000g2b_2bgn_cfg = { |
@@ -657,6 +662,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = { | |||
657 | .need_temp_offset_calib = true, | 662 | .need_temp_offset_calib = true, |
658 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 663 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
659 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 664 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
665 | .use_new_eeprom_reading = true, | ||
660 | }; | 666 | }; |
661 | 667 | ||
662 | struct iwl_cfg iwl6000g2b_2bg_cfg = { | 668 | struct iwl_cfg iwl6000g2b_2bg_cfg = { |
@@ -677,6 +683,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = { | |||
677 | .need_temp_offset_calib = true, | 683 | .need_temp_offset_calib = true, |
678 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 684 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
679 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 685 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
686 | .use_new_eeprom_reading = true, | ||
680 | }; | 687 | }; |
681 | 688 | ||
682 | struct iwl_cfg iwl6000g2b_bgn_cfg = { | 689 | struct iwl_cfg iwl6000g2b_bgn_cfg = { |
@@ -698,6 +705,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = { | |||
698 | .need_temp_offset_calib = true, | 705 | .need_temp_offset_calib = true, |
699 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 706 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
700 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 707 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
708 | .use_new_eeprom_reading = true, | ||
701 | }; | 709 | }; |
702 | 710 | ||
703 | struct iwl_cfg iwl6000g2b_bg_cfg = { | 711 | struct iwl_cfg iwl6000g2b_bg_cfg = { |
@@ -718,6 +726,7 @@ struct iwl_cfg iwl6000g2b_bg_cfg = { | |||
718 | .need_temp_offset_calib = true, | 726 | .need_temp_offset_calib = true, |
719 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 727 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
720 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 728 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
729 | .use_new_eeprom_reading = true, | ||
721 | }; | 730 | }; |
722 | 731 | ||
723 | /* | 732 | /* |
@@ -804,6 +813,7 @@ struct iwl_cfg iwl6050g2_bgn_cfg = { | |||
804 | .base_params = &iwl6050_base_params, | 813 | .base_params = &iwl6050_base_params, |
805 | .ht_params = &iwl6000_ht_params, | 814 | .ht_params = &iwl6000_ht_params, |
806 | .need_dc_calib = true, | 815 | .need_dc_calib = true, |
816 | .use_new_eeprom_reading = true, | ||
807 | }; | 817 | }; |
808 | 818 | ||
809 | struct iwl_cfg iwl6050_2abg_cfg = { | 819 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -857,6 +867,7 @@ struct iwl_cfg iwl130_bgn_cfg = { | |||
857 | .need_dc_calib = true, | 867 | .need_dc_calib = true, |
858 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 868 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
859 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 869 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
870 | .use_new_eeprom_reading = true, | ||
860 | }; | 871 | }; |
861 | 872 | ||
862 | struct iwl_cfg iwl130_bg_cfg = { | 873 | struct iwl_cfg iwl130_bg_cfg = { |
@@ -876,6 +887,7 @@ struct iwl_cfg iwl130_bg_cfg = { | |||
876 | .need_dc_calib = true, | 887 | .need_dc_calib = true, |
877 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ | 888 | /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ |
878 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, | 889 | .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, |
890 | .use_new_eeprom_reading = true, | ||
879 | }; | 891 | }; |
880 | 892 | ||
881 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 893 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c index a650baba0809..9eeeda18748d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | |||
@@ -392,7 +392,7 @@ static s8 iwl_update_channel_txpower(struct iwl_priv *priv, | |||
392 | /** | 392 | /** |
393 | * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info | 393 | * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info |
394 | */ | 394 | */ |
395 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | 395 | static void iwlcore_eeprom_enhanced_txpower_old(struct iwl_priv *priv) |
396 | { | 396 | { |
397 | int eeprom_section_count = 0; | 397 | int eeprom_section_count = 0; |
398 | int section, element; | 398 | int section, element; |
@@ -419,7 +419,8 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
419 | * always check for valid entry before process | 419 | * always check for valid entry before process |
420 | * the information | 420 | * the information |
421 | */ | 421 | */ |
422 | if (!enhanced_txpower->common || enhanced_txpower->reserved) | 422 | if (!(enhanced_txpower->flags || enhanced_txpower->channel) || |
423 | enhanced_txpower->delta_20_in_40) | ||
423 | continue; | 424 | continue; |
424 | 425 | ||
425 | for (element = 0; element < eeprom_section_count; element++) { | 426 | for (element = 0; element < eeprom_section_count; element++) { |
@@ -452,3 +453,86 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
452 | } | 453 | } |
453 | } | 454 | } |
454 | } | 455 | } |
456 | |||
457 | static void | ||
458 | iwlcore_eeprom_enh_txp_read_element(struct iwl_priv *priv, | ||
459 | struct iwl_eeprom_enhanced_txpwr *txp, | ||
460 | s8 max_txpower_avg) | ||
461 | { | ||
462 | int ch_idx; | ||
463 | bool is_ht40 = txp->flags & IWL_EEPROM_ENH_TXP_FL_40MHZ; | ||
464 | enum ieee80211_band band; | ||
465 | |||
466 | band = txp->flags & IWL_EEPROM_ENH_TXP_FL_BAND_52G ? | ||
467 | IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ; | ||
468 | |||
469 | for (ch_idx = 0; ch_idx < priv->channel_count; ch_idx++) { | ||
470 | struct iwl_channel_info *ch_info = &priv->channel_info[ch_idx]; | ||
471 | |||
472 | /* update matching channel or from common data only */ | ||
473 | if (txp->channel != 0 && ch_info->channel != txp->channel) | ||
474 | continue; | ||
475 | |||
476 | /* update matching band only */ | ||
477 | if (band != ch_info->band) | ||
478 | continue; | ||
479 | |||
480 | if (ch_info->max_power_avg < max_txpower_avg && !is_ht40) { | ||
481 | ch_info->max_power_avg = max_txpower_avg; | ||
482 | ch_info->curr_txpow = max_txpower_avg; | ||
483 | ch_info->scan_power = max_txpower_avg; | ||
484 | } | ||
485 | |||
486 | if (is_ht40 && ch_info->ht40_max_power_avg < max_txpower_avg) | ||
487 | ch_info->ht40_max_power_avg = max_txpower_avg; | ||
488 | } | ||
489 | } | ||
490 | |||
491 | #define EEPROM_TXP_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT) | ||
492 | #define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr) | ||
493 | #define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE) | ||
494 | |||
495 | static void iwlcore_eeprom_enhanced_txpower_new(struct iwl_priv *priv) | ||
496 | { | ||
497 | struct iwl_eeprom_enhanced_txpwr *txp_array, *txp; | ||
498 | int idx, entries; | ||
499 | __le16 *txp_len; | ||
500 | s8 max_txp_avg, max_txp_avg_halfdbm; | ||
501 | |||
502 | BUILD_BUG_ON(sizeof(struct iwl_eeprom_enhanced_txpwr) != 8); | ||
503 | |||
504 | /* the length is in 16-bit words, but we want entries */ | ||
505 | txp_len = (__le16 *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_SZ_OFFS); | ||
506 | entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN; | ||
507 | |||
508 | txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS); | ||
509 | for (idx = 0; idx < entries; idx++) { | ||
510 | txp = &txp_array[idx]; | ||
511 | |||
512 | /* skip invalid entries */ | ||
513 | if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID)) | ||
514 | continue; | ||
515 | |||
516 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, | ||
517 | &max_txp_avg_halfdbm); | ||
518 | |||
519 | /* | ||
520 | * Update the user limit values values to the highest | ||
521 | * power supported by any channel | ||
522 | */ | ||
523 | if (max_txp_avg > priv->tx_power_user_lmt) | ||
524 | priv->tx_power_user_lmt = max_txp_avg; | ||
525 | if (max_txp_avg_halfdbm > priv->tx_power_lmt_in_half_dbm) | ||
526 | priv->tx_power_lmt_in_half_dbm = max_txp_avg_halfdbm; | ||
527 | |||
528 | iwlcore_eeprom_enh_txp_read_element(priv, txp, max_txp_avg); | ||
529 | } | ||
530 | } | ||
531 | |||
532 | void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | ||
533 | { | ||
534 | if (priv->cfg->use_new_eeprom_reading) | ||
535 | iwlcore_eeprom_enhanced_txpower_new(priv); | ||
536 | else | ||
537 | iwlcore_eeprom_enhanced_txpower_old(priv); | ||
538 | } | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index b555edd53354..554afb7d9670 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -569,6 +569,12 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address) | |||
569 | case INDIRECT_REGULATORY: | 569 | case INDIRECT_REGULATORY: |
570 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY); | 570 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY); |
571 | break; | 571 | break; |
572 | case INDIRECT_TXP_LIMIT: | ||
573 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT); | ||
574 | break; | ||
575 | case INDIRECT_TXP_LIMIT_SIZE: | ||
576 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT_SIZE); | ||
577 | break; | ||
572 | case INDIRECT_CALIBRATION: | 578 | case INDIRECT_CALIBRATION: |
573 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION); | 579 | offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION); |
574 | break; | 580 | break; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 64527def059f..954ecc2c34c4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -390,6 +390,7 @@ struct iwl_cfg { | |||
390 | const bool need_temp_offset_calib; /* if used set to true */ | 390 | const bool need_temp_offset_calib; /* if used set to true */ |
391 | u8 scan_rx_antennas[IEEE80211_NUM_BANDS]; | 391 | u8 scan_rx_antennas[IEEE80211_NUM_BANDS]; |
392 | u8 scan_tx_antennas[IEEE80211_NUM_BANDS]; | 392 | u8 scan_tx_antennas[IEEE80211_NUM_BANDS]; |
393 | const bool use_new_eeprom_reading; /* temporary, remove later */ | ||
393 | }; | 394 | }; |
394 | 395 | ||
395 | /*************************** | 396 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index d9b590625ae4..e3a279d2d0b6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
@@ -120,6 +120,17 @@ struct iwl_eeprom_channel { | |||
120 | s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ | 120 | s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ |
121 | } __packed; | 121 | } __packed; |
122 | 122 | ||
123 | enum iwl_eeprom_enhanced_txpwr_flags { | ||
124 | IWL_EEPROM_ENH_TXP_FL_VALID = BIT(0), | ||
125 | IWL_EEPROM_ENH_TXP_FL_BAND_52G = BIT(1), | ||
126 | IWL_EEPROM_ENH_TXP_FL_OFDM = BIT(2), | ||
127 | IWL_EEPROM_ENH_TXP_FL_40MHZ = BIT(3), | ||
128 | IWL_EEPROM_ENH_TXP_FL_HT_AP = BIT(4), | ||
129 | IWL_EEPROM_ENH_TXP_FL_RES1 = BIT(5), | ||
130 | IWL_EEPROM_ENH_TXP_FL_RES2 = BIT(6), | ||
131 | IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE = BIT(7), | ||
132 | }; | ||
133 | |||
123 | /** | 134 | /** |
124 | * iwl_eeprom_enhanced_txpwr structure | 135 | * iwl_eeprom_enhanced_txpwr structure |
125 | * This structure presents the enhanced regulatory tx power limit layout | 136 | * This structure presents the enhanced regulatory tx power limit layout |
@@ -127,21 +138,23 @@ struct iwl_eeprom_channel { | |||
127 | * Enhanced regulatory tx power portion of eeprom image can be broken down | 138 | * Enhanced regulatory tx power portion of eeprom image can be broken down |
128 | * into individual structures; each one is 8 bytes in size and contain the | 139 | * into individual structures; each one is 8 bytes in size and contain the |
129 | * following information | 140 | * following information |
130 | * @common: (desc + channel) not used by driver, should _NOT_ be "zero" | 141 | * @flags: entry flags |
142 | * @channel: channel number | ||
131 | * @chain_a_max_pwr: chain a max power in 1/2 dBm | 143 | * @chain_a_max_pwr: chain a max power in 1/2 dBm |
132 | * @chain_b_max_pwr: chain b max power in 1/2 dBm | 144 | * @chain_b_max_pwr: chain b max power in 1/2 dBm |
133 | * @chain_c_max_pwr: chain c max power in 1/2 dBm | 145 | * @chain_c_max_pwr: chain c max power in 1/2 dBm |
134 | * @reserved: not used, should be "zero" | 146 | * @delta_20_in_40: 20-in-40 deltas (hi/lo) |
135 | * @mimo2_max_pwr: mimo2 max power in 1/2 dBm | 147 | * @mimo2_max_pwr: mimo2 max power in 1/2 dBm |
136 | * @mimo3_max_pwr: mimo3 max power in 1/2 dBm | 148 | * @mimo3_max_pwr: mimo3 max power in 1/2 dBm |
137 | * | 149 | * |
138 | */ | 150 | */ |
139 | struct iwl_eeprom_enhanced_txpwr { | 151 | struct iwl_eeprom_enhanced_txpwr { |
140 | __le16 common; | 152 | u8 flags; |
153 | u8 channel; | ||
141 | s8 chain_a_max; | 154 | s8 chain_a_max; |
142 | s8 chain_b_max; | 155 | s8 chain_b_max; |
143 | s8 chain_c_max; | 156 | s8 chain_c_max; |
144 | s8 reserved; | 157 | u8 delta_20_in_40; |
145 | s8 mimo2_max; | 158 | s8 mimo2_max; |
146 | s8 mimo3_max; | 159 | s8 mimo3_max; |
147 | } __packed; | 160 | } __packed; |
@@ -186,6 +199,8 @@ struct iwl_eeprom_enhanced_txpwr { | |||
186 | #define EEPROM_LINK_CALIBRATION (2*0x67) | 199 | #define EEPROM_LINK_CALIBRATION (2*0x67) |
187 | #define EEPROM_LINK_PROCESS_ADJST (2*0x68) | 200 | #define EEPROM_LINK_PROCESS_ADJST (2*0x68) |
188 | #define EEPROM_LINK_OTHERS (2*0x69) | 201 | #define EEPROM_LINK_OTHERS (2*0x69) |
202 | #define EEPROM_LINK_TXP_LIMIT (2*0x6a) | ||
203 | #define EEPROM_LINK_TXP_LIMIT_SIZE (2*0x6b) | ||
189 | 204 | ||
190 | /* agn regulatory - indirect access */ | 205 | /* agn regulatory - indirect access */ |
191 | #define EEPROM_REG_BAND_1_CHANNELS ((0x08)\ | 206 | #define EEPROM_REG_BAND_1_CHANNELS ((0x08)\ |
@@ -389,6 +404,8 @@ struct iwl_eeprom_calib_info { | |||
389 | #define INDIRECT_CALIBRATION 0x00040000 | 404 | #define INDIRECT_CALIBRATION 0x00040000 |
390 | #define INDIRECT_PROCESS_ADJST 0x00050000 | 405 | #define INDIRECT_PROCESS_ADJST 0x00050000 |
391 | #define INDIRECT_OTHERS 0x00060000 | 406 | #define INDIRECT_OTHERS 0x00060000 |
407 | #define INDIRECT_TXP_LIMIT 0x00070000 | ||
408 | #define INDIRECT_TXP_LIMIT_SIZE 0x00080000 | ||
392 | #define INDIRECT_ADDRESS 0x00100000 | 409 | #define INDIRECT_ADDRESS 0x00100000 |
393 | 410 | ||
394 | /* General */ | 411 | /* General */ |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 373930afc26b..113f4f204657 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -619,7 +619,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
619 | print_ssid(ssid_buf, ssid, ssid_len), | 619 | print_ssid(ssid_buf, ssid, ssid_len), |
620 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); | 620 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); |
621 | 621 | ||
622 | if (channel || | 622 | if (channel && |
623 | !(channel->flags & IEEE80211_CHAN_DISABLED)) | 623 | !(channel->flags & IEEE80211_CHAN_DISABLED)) |
624 | cfg80211_inform_bss(wiphy, channel, | 624 | cfg80211_inform_bss(wiphy, channel, |
625 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), | 625 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index d5bc21e5a02c..2325e56a9b0b 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -43,6 +43,7 @@ MODULE_FIRMWARE("isl3887usb"); | |||
43 | 43 | ||
44 | static struct usb_device_id p54u_table[] __devinitdata = { | 44 | static struct usb_device_id p54u_table[] __devinitdata = { |
45 | /* Version 1 devices (pci chip + net2280) */ | 45 | /* Version 1 devices (pci chip + net2280) */ |
46 | {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ | ||
46 | {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ | 47 | {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ |
47 | {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ | 48 | {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ |
48 | {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ | 49 | {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ |
@@ -56,9 +57,13 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
56 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ | 57 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ |
57 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ | 58 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ |
58 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ | 59 | {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ |
60 | {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ | ||
59 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ | 61 | {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ |
60 | {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */ | 62 | {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */ |
63 | {USB_DEVICE(0x1435, 0x0210)}, /* Inventel UR054G */ | ||
64 | {USB_DEVICE(0x15a9, 0x0002)}, /* Gemtek WUBI-100GW 802.11g */ | ||
61 | {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */ | 65 | {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */ |
66 | {USB_DEVICE(0x182d, 0x096b)}, /* Sitecom WL-107 */ | ||
62 | {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */ | 67 | {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */ |
63 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ | 68 | {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ |
64 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ | 69 | {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ |
@@ -94,6 +99,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
94 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 99 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
95 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ | 100 | {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ |
96 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 101 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
102 | {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */ | ||
97 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ | 103 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ |
98 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ | 104 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ |
99 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ | 105 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index b26739535986..09a67905c230 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -912,6 +912,7 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
912 | __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); | 912 | __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); |
913 | __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); | 913 | __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); |
914 | __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags); | 914 | __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags); |
915 | __set_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags); | ||
915 | if (!modparam_nohwcrypt) | 916 | if (!modparam_nohwcrypt) |
916 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 917 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); |
917 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); | 918 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 94fe589acfaa..ab43e7ca2a23 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -664,6 +664,7 @@ enum rt2x00_flags { | |||
664 | DRIVER_REQUIRE_COPY_IV, | 664 | DRIVER_REQUIRE_COPY_IV, |
665 | DRIVER_REQUIRE_L2PAD, | 665 | DRIVER_REQUIRE_L2PAD, |
666 | DRIVER_REQUIRE_TXSTATUS_FIFO, | 666 | DRIVER_REQUIRE_TXSTATUS_FIFO, |
667 | DRIVER_REQUIRE_TASKLET_CONTEXT, | ||
667 | 668 | ||
668 | /* | 669 | /* |
669 | * Driver features | 670 | * Driver features |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 5ba79b935f09..d019830ca840 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -390,9 +390,12 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
390 | * through a mac80211 library call (RTS/CTS) then we should not | 390 | * through a mac80211 library call (RTS/CTS) then we should not |
391 | * send the status report back. | 391 | * send the status report back. |
392 | */ | 392 | */ |
393 | if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) | 393 | if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) { |
394 | ieee80211_tx_status(rt2x00dev->hw, entry->skb); | 394 | if (test_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags)) |
395 | else | 395 | ieee80211_tx_status(rt2x00dev->hw, entry->skb); |
396 | else | ||
397 | ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb); | ||
398 | } else | ||
396 | dev_kfree_skb_any(entry->skb); | 399 | dev_kfree_skb_any(entry->skb); |
397 | 400 | ||
398 | /* | 401 | /* |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index cd1b3dcd61db..ec47e22fa186 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -744,7 +744,7 @@ static int yellowfin_init_ring(struct net_device *dev) | |||
744 | } | 744 | } |
745 | 745 | ||
746 | for (i = 0; i < RX_RING_SIZE; i++) { | 746 | for (i = 0; i < RX_RING_SIZE; i++) { |
747 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); | 747 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); |
748 | yp->rx_skbuff[i] = skb; | 748 | yp->rx_skbuff[i] = skb; |
749 | if (skb == NULL) | 749 | if (skb == NULL) |
750 | break; | 750 | break; |
@@ -1157,7 +1157,7 @@ static int yellowfin_rx(struct net_device *dev) | |||
1157 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { | 1157 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { |
1158 | entry = yp->dirty_rx % RX_RING_SIZE; | 1158 | entry = yp->dirty_rx % RX_RING_SIZE; |
1159 | if (yp->rx_skbuff[entry] == NULL) { | 1159 | if (yp->rx_skbuff[entry] == NULL) { |
1160 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); | 1160 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); |
1161 | if (skb == NULL) | 1161 | if (skb == NULL) |
1162 | break; /* Better luck next round. */ | 1162 | break; /* Better luck next round. */ |
1163 | yp->rx_skbuff[entry] = skb; | 1163 | yp->rx_skbuff[entry] = skb; |