diff options
author | David S. Miller <davem@davemloft.net> | 2009-03-17 18:04:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-17 18:04:31 -0400 |
commit | af4330631cd48987755f1a8d324dc318f60cf16b (patch) | |
tree | 3c9233e81b450921326da13a7f8abacb58ab1f5e /drivers/net/wireless/ath9k/main.c | |
parent | 2d6a5e9500103680464a723a4564961675652680 (diff) | |
parent | 808ff697b357cee54e214efd27921a9ec6461a94 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index a9715f5b0af6..8db75f6de53e 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -1084,12 +1084,6 @@ fail: | |||
1084 | ath_deinit_leds(sc); | 1084 | ath_deinit_leds(sc); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) | ||
1088 | |||
1089 | /*******************/ | ||
1090 | /* Rfkill */ | ||
1091 | /*******************/ | ||
1092 | |||
1093 | void ath_radio_enable(struct ath_softc *sc) | 1087 | void ath_radio_enable(struct ath_softc *sc) |
1094 | { | 1088 | { |
1095 | struct ath_hw *ah = sc->sc_ah; | 1089 | struct ath_hw *ah = sc->sc_ah; |
@@ -1166,6 +1160,12 @@ void ath_radio_disable(struct ath_softc *sc) | |||
1166 | ath9k_ps_restore(sc); | 1160 | ath9k_ps_restore(sc); |
1167 | } | 1161 | } |
1168 | 1162 | ||
1163 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) | ||
1164 | |||
1165 | /*******************/ | ||
1166 | /* Rfkill */ | ||
1167 | /*******************/ | ||
1168 | |||
1169 | static bool ath_is_rfkill_set(struct ath_softc *sc) | 1169 | static bool ath_is_rfkill_set(struct ath_softc *sc) |
1170 | { | 1170 | { |
1171 | struct ath_hw *ah = sc->sc_ah; | 1171 | struct ath_hw *ah = sc->sc_ah; |
@@ -1583,7 +1583,8 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
1583 | IEEE80211_HW_SIGNAL_DBM | | 1583 | IEEE80211_HW_SIGNAL_DBM | |
1584 | IEEE80211_HW_AMPDU_AGGREGATION | | 1584 | IEEE80211_HW_AMPDU_AGGREGATION | |
1585 | IEEE80211_HW_SUPPORTS_PS | | 1585 | IEEE80211_HW_SUPPORTS_PS | |
1586 | IEEE80211_HW_PS_NULLFUNC_STACK; | 1586 | IEEE80211_HW_PS_NULLFUNC_STACK | |
1587 | IEEE80211_HW_SPECTRUM_MGMT; | ||
1587 | 1588 | ||
1588 | if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt) | 1589 | if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt) |
1589 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; | 1590 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; |
@@ -1671,7 +1672,7 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1671 | } | 1672 | } |
1672 | wiphy_apply_custom_regulatory(hw->wiphy, regd); | 1673 | wiphy_apply_custom_regulatory(hw->wiphy, regd); |
1673 | ath9k_reg_apply_radar_flags(hw->wiphy); | 1674 | ath9k_reg_apply_radar_flags(hw->wiphy); |
1674 | ath9k_reg_apply_world_flags(hw->wiphy, REGDOM_SET_BY_INIT); | 1675 | ath9k_reg_apply_world_flags(hw->wiphy, NL80211_REGDOM_SET_BY_DRIVER); |
1675 | 1676 | ||
1676 | INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work); | 1677 | INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work); |
1677 | INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work); | 1678 | INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work); |
@@ -1774,6 +1775,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, | |||
1774 | DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA: %u buffers %u desc/buf\n", | 1775 | DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA: %u buffers %u desc/buf\n", |
1775 | name, nbuf, ndesc); | 1776 | name, nbuf, ndesc); |
1776 | 1777 | ||
1778 | INIT_LIST_HEAD(head); | ||
1777 | /* ath_desc must be a multiple of DWORDs */ | 1779 | /* ath_desc must be a multiple of DWORDs */ |
1778 | if ((sizeof(struct ath_desc) % 4) != 0) { | 1780 | if ((sizeof(struct ath_desc) % 4) != 0) { |
1779 | DPRINTF(sc, ATH_DBG_FATAL, "ath_desc not DWORD aligned\n"); | 1781 | DPRINTF(sc, ATH_DBG_FATAL, "ath_desc not DWORD aligned\n"); |
@@ -1805,7 +1807,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, | |||
1805 | 1807 | ||
1806 | /* allocate descriptors */ | 1808 | /* allocate descriptors */ |
1807 | dd->dd_desc = dma_alloc_coherent(sc->dev, dd->dd_desc_len, | 1809 | dd->dd_desc = dma_alloc_coherent(sc->dev, dd->dd_desc_len, |
1808 | &dd->dd_desc_paddr, GFP_ATOMIC); | 1810 | &dd->dd_desc_paddr, GFP_KERNEL); |
1809 | if (dd->dd_desc == NULL) { | 1811 | if (dd->dd_desc == NULL) { |
1810 | error = -ENOMEM; | 1812 | error = -ENOMEM; |
1811 | goto fail; | 1813 | goto fail; |
@@ -1817,15 +1819,13 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, | |||
1817 | 1819 | ||
1818 | /* allocate buffers */ | 1820 | /* allocate buffers */ |
1819 | bsize = sizeof(struct ath_buf) * nbuf; | 1821 | bsize = sizeof(struct ath_buf) * nbuf; |
1820 | bf = kmalloc(bsize, GFP_KERNEL); | 1822 | bf = kzalloc(bsize, GFP_KERNEL); |
1821 | if (bf == NULL) { | 1823 | if (bf == NULL) { |
1822 | error = -ENOMEM; | 1824 | error = -ENOMEM; |
1823 | goto fail2; | 1825 | goto fail2; |
1824 | } | 1826 | } |
1825 | memset(bf, 0, bsize); | ||
1826 | dd->dd_bufptr = bf; | 1827 | dd->dd_bufptr = bf; |
1827 | 1828 | ||
1828 | INIT_LIST_HEAD(head); | ||
1829 | for (i = 0; i < nbuf; i++, bf++, ds += ndesc) { | 1829 | for (i = 0; i < nbuf; i++, bf++, ds += ndesc) { |
1830 | bf->bf_desc = ds; | 1830 | bf->bf_desc = ds; |
1831 | bf->bf_daddr = DS2PHYS(dd, ds); | 1831 | bf->bf_daddr = DS2PHYS(dd, ds); |
@@ -2859,12 +2859,20 @@ static int __init ath9k_init(void) | |||
2859 | goto err_out; | 2859 | goto err_out; |
2860 | } | 2860 | } |
2861 | 2861 | ||
2862 | error = ath9k_debug_create_root(); | ||
2863 | if (error) { | ||
2864 | printk(KERN_ERR | ||
2865 | "ath9k: Unable to create debugfs root: %d\n", | ||
2866 | error); | ||
2867 | goto err_rate_unregister; | ||
2868 | } | ||
2869 | |||
2862 | error = ath_pci_init(); | 2870 | error = ath_pci_init(); |
2863 | if (error < 0) { | 2871 | if (error < 0) { |
2864 | printk(KERN_ERR | 2872 | printk(KERN_ERR |
2865 | "ath9k: No PCI devices found, driver not installed.\n"); | 2873 | "ath9k: No PCI devices found, driver not installed.\n"); |
2866 | error = -ENODEV; | 2874 | error = -ENODEV; |
2867 | goto err_rate_unregister; | 2875 | goto err_remove_root; |
2868 | } | 2876 | } |
2869 | 2877 | ||
2870 | error = ath_ahb_init(); | 2878 | error = ath_ahb_init(); |
@@ -2878,6 +2886,8 @@ static int __init ath9k_init(void) | |||
2878 | err_pci_exit: | 2886 | err_pci_exit: |
2879 | ath_pci_exit(); | 2887 | ath_pci_exit(); |
2880 | 2888 | ||
2889 | err_remove_root: | ||
2890 | ath9k_debug_remove_root(); | ||
2881 | err_rate_unregister: | 2891 | err_rate_unregister: |
2882 | ath_rate_control_unregister(); | 2892 | ath_rate_control_unregister(); |
2883 | err_out: | 2893 | err_out: |
@@ -2889,6 +2899,7 @@ static void __exit ath9k_exit(void) | |||
2889 | { | 2899 | { |
2890 | ath_ahb_exit(); | 2900 | ath_ahb_exit(); |
2891 | ath_pci_exit(); | 2901 | ath_pci_exit(); |
2902 | ath9k_debug_remove_root(); | ||
2892 | ath_rate_control_unregister(); | 2903 | ath_rate_control_unregister(); |
2893 | printk(KERN_INFO "%s: Driver unloaded\n", dev_info); | 2904 | printk(KERN_INFO "%s: Driver unloaded\n", dev_info); |
2894 | } | 2905 | } |