Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / drivers / net / wireless / ath / ath5k / base.c
index c3119a6..e9ea38d 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 #include <linux/etherdevice.h>
+#include <linux/nl80211.h>
 
 #include <net/ieee80211_radiotap.h>
 
@@ -61,6 +62,8 @@
 #include "reg.h"
 #include "debug.h"
 #include "ani.h"
+#include "ath5k.h"
+#include "../regd.h"
 
 #define CREATE_TRACE_POINTS
 #include "trace.h"
@@ -272,20 +275,18 @@ static unsigned int
 ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
                unsigned int mode, unsigned int max)
 {
-       unsigned int count, size, chfreq, freq, ch;
+       unsigned int count, size, freq, ch;
        enum ieee80211_band band;
 
        switch (mode) {
        case AR5K_MODE_11A:
                /* 1..220, but 2GHz frequencies are filtered by check_channel */
                size = 220;
-               chfreq = CHANNEL_5GHZ;
                band = IEEE80211_BAND_5GHZ;
                break;
        case AR5K_MODE_11B:
        case AR5K_MODE_11G:
                size = 26;
-               chfreq = CHANNEL_2GHZ;
                band = IEEE80211_BAND_2GHZ;
                break;
        default:
@@ -300,26 +301,19 @@ ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
                if (freq == 0) /* mapping failed - not a standard channel */
                        continue;
 
+               /* Write channel info, needed for ath5k_channel_ok() */
+               channels[count].center_freq = freq;
+               channels[count].band = band;
+               channels[count].hw_value = mode;
+
                /* Check if channel is supported by the chipset */
-               if (!ath5k_channel_ok(ah, freq, chfreq))
+               if (!ath5k_channel_ok(ah, &channels[count]))
                        continue;
 
                if (!modparam_all_channels &&
                    !ath5k_is_standard_channel(ch, band))
                        continue;
 
-               /* Write channel info and increment counter */
-               channels[count].center_freq = freq;
-               channels[count].band = band;
-               switch (mode) {
-               case AR5K_MODE_11A:
-               case AR5K_MODE_11G:
-                       channels[count].hw_value = chfreq | CHANNEL_OFDM;
-                       break;
-               case AR5K_MODE_11B:
-                       channels[count].hw_value = CHANNEL_B;
-               }
-
                count++;
        }
 
@@ -2349,7 +2343,7 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
 \*************************/
 
 int __devinit
-ath5k_init_softc(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
+ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
 {
        struct ieee80211_hw *hw = ah->hw;
        struct ath_common *common;
@@ -2867,7 +2861,6 @@ ath5k_init(struct ieee80211_hw *hw)
        }
 
        SET_IEEE80211_PERM_ADDR(hw, mac);
-       memcpy(&ah->lladdr, mac, ETH_ALEN);
        /* All MAC address bits matter for ACKs */
        ath5k_update_bssid_mask_and_opmode(ah, NULL);
 
@@ -2903,7 +2896,7 @@ err:
 }
 
 void
-ath5k_deinit_softc(struct ath5k_hw *ah)
+ath5k_deinit_ah(struct ath5k_hw *ah)
 {
        struct ieee80211_hw *hw = ah->hw;