aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-01-11 12:25:18 -0500
committerLuciano Coelho <coelho@ti.com>2011-01-24 15:11:52 -0500
commita8aaaf53d5f22f7f60ca5af26fc85c2940575c37 (patch)
treefe63b2dc13a245dff40ea2be40fa1619f38119f2 /drivers/net/wireless/wl12xx/main.c
parentfa287b8f291d79f080182eb353d1c1f4f374ae87 (diff)
wl12xx: don't modify the global supported band structures
When 11a is not supported, we were modifying the global structure that contains the bands supported by the driver. This causes problems when having more one wl12xx device in the same system because they all use the same global. This also causes problems when the wl12xx_sdio module is removed and the wl12xx module remains. Fix this problem by copying the band structure into the wl12xx instance. Reported-by: Arik Nemtsov <arik@wizery.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a3529f56a3d6..588e10ee282c 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3150,8 +3150,20 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
3150 */ 3150 */
3151 wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE - 3151 wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
3152 sizeof(struct ieee80211_header); 3152 sizeof(struct ieee80211_header);
3153 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz; 3153
3154 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz; 3154 /*
3155 * We keep local copies of the band structs because we need to
3156 * modify them on a per-device basis.
3157 */
3158 memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz,
3159 sizeof(wl1271_band_2ghz));
3160 memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz,
3161 sizeof(wl1271_band_5ghz));
3162
3163 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
3164 &wl->bands[IEEE80211_BAND_2GHZ];
3165 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
3166 &wl->bands[IEEE80211_BAND_5GHZ];
3155 3167
3156 wl->hw->queues = 4; 3168 wl->hw->queues = 4;
3157 wl->hw->max_rates = 1; 3169 wl->hw->max_rates = 1;