diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-02-22 01:38:32 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-09 15:03:02 -0500 |
commit | 15305498a443c181c8fb5deafb94eae585fe3ad5 (patch) | |
tree | 8c3c46ef7a239005c47376700e3f8c01536394b4 /drivers/net/wireless | |
parent | ffb591cd0e32d817bdbd359dead3baa770b999f8 (diff) |
wl1271: Fix ad-hoc mode neighborhood detection
This patch fixes a bug in ad-hoc mode preventing mac80211 from properly
detecting other ad-hoc networks with the same SSID.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_cmd.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 15 |
3 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c index 6759aa11c132..e029bf03809d 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c | |||
@@ -247,7 +247,7 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl) | |||
247 | return ret; | 247 | return ret; |
248 | } | 248 | } |
249 | 249 | ||
250 | int wl1271_cmd_join(struct wl1271 *wl) | 250 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type) |
251 | { | 251 | { |
252 | static bool do_cal = true; | 252 | static bool do_cal = true; |
253 | struct wl1271_cmd_join *join; | 253 | struct wl1271_cmd_join *join; |
@@ -278,7 +278,7 @@ int wl1271_cmd_join(struct wl1271 *wl) | |||
278 | 278 | ||
279 | join->rx_config_options = cpu_to_le32(wl->rx_config); | 279 | join->rx_config_options = cpu_to_le32(wl->rx_config); |
280 | join->rx_filter_options = cpu_to_le32(wl->rx_filter); | 280 | join->rx_filter_options = cpu_to_le32(wl->rx_filter); |
281 | join->bss_type = wl->bss_type; | 281 | join->bss_type = bss_type; |
282 | 282 | ||
283 | /* | 283 | /* |
284 | * FIXME: disable temporarily all filters because after commit | 284 | * FIXME: disable temporarily all filters because after commit |
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h index 2dc06c73532b..4297205b8d6d 100644 --- a/drivers/net/wireless/wl12xx/wl1271_cmd.h +++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h | |||
@@ -33,7 +33,7 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len, | |||
33 | size_t res_len); | 33 | size_t res_len); |
34 | int wl1271_cmd_general_parms(struct wl1271 *wl); | 34 | int wl1271_cmd_general_parms(struct wl1271 *wl); |
35 | int wl1271_cmd_radio_parms(struct wl1271 *wl); | 35 | int wl1271_cmd_radio_parms(struct wl1271 *wl); |
36 | int wl1271_cmd_join(struct wl1271 *wl); | 36 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type); |
37 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); | 37 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); |
38 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); | 38 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); |
39 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); | 39 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 5cc778f658b9..81fb02e82923 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -1093,7 +1093,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw, | |||
1093 | 1093 | ||
1094 | memcpy(wl->bssid, conf->bssid, ETH_ALEN); | 1094 | memcpy(wl->bssid, conf->bssid, ETH_ALEN); |
1095 | 1095 | ||
1096 | ret = wl1271_cmd_join(wl); | 1096 | ret = wl1271_cmd_join(wl, wl->bss_type); |
1097 | if (ret < 0) | 1097 | if (ret < 0) |
1098 | goto out_sleep; | 1098 | goto out_sleep; |
1099 | 1099 | ||
@@ -1142,17 +1142,16 @@ static int wl1271_join_channel(struct wl1271 *wl, int channel) | |||
1142 | static const u8 dummy_bssid[ETH_ALEN] = { 0x0b, 0xad, 0xde, | 1142 | static const u8 dummy_bssid[ETH_ALEN] = { 0x0b, 0xad, 0xde, |
1143 | 0xad, 0xbe, 0xef }; | 1143 | 0xad, 0xbe, 0xef }; |
1144 | 1144 | ||
1145 | /* the dummy join is not required for ad-hoc */ | ||
1146 | if (wl->bss_type == BSS_TYPE_IBSS) | ||
1147 | goto out; | ||
1148 | |||
1149 | /* disable mac filter, so we hear everything */ | 1145 | /* disable mac filter, so we hear everything */ |
1150 | wl->rx_config &= ~CFG_BSSID_FILTER_EN; | 1146 | wl->rx_config &= ~CFG_BSSID_FILTER_EN; |
1151 | 1147 | ||
1152 | wl->channel = channel; | 1148 | wl->channel = channel; |
1153 | memcpy(wl->bssid, dummy_bssid, ETH_ALEN); | 1149 | memcpy(wl->bssid, dummy_bssid, ETH_ALEN); |
1154 | 1150 | ||
1155 | ret = wl1271_cmd_join(wl); | 1151 | /* the dummy join is performed always with STATION BSS type to allow |
1152 | also ad-hoc mode to listen to the surroundings without sending any | ||
1153 | beacons yet. */ | ||
1154 | ret = wl1271_cmd_join(wl, BSS_TYPE_STA_BSS); | ||
1156 | if (ret < 0) | 1155 | if (ret < 0) |
1157 | goto out; | 1156 | goto out; |
1158 | 1157 | ||
@@ -1221,7 +1220,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) | |||
1221 | test_bit(WL1271_FLAG_JOINED, &wl->flags)) { | 1220 | test_bit(WL1271_FLAG_JOINED, &wl->flags)) { |
1222 | wl->channel = channel; | 1221 | wl->channel = channel; |
1223 | /* FIXME: maybe use CMD_CHANNEL_SWITCH for this? */ | 1222 | /* FIXME: maybe use CMD_CHANNEL_SWITCH for this? */ |
1224 | ret = wl1271_cmd_join(wl); | 1223 | ret = wl1271_cmd_join(wl, wl->bss_type); |
1225 | if (ret < 0) | 1224 | if (ret < 0) |
1226 | wl1271_warning("cmd join to update channel failed %d", | 1225 | wl1271_warning("cmd join to update channel failed %d", |
1227 | ret); | 1226 | ret); |
@@ -1704,7 +1703,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1704 | } | 1703 | } |
1705 | 1704 | ||
1706 | if (do_join) { | 1705 | if (do_join) { |
1707 | ret = wl1271_cmd_join(wl); | 1706 | ret = wl1271_cmd_join(wl, wl->bss_type); |
1708 | if (ret < 0) { | 1707 | if (ret < 0) { |
1709 | wl1271_warning("cmd join failed %d", ret); | 1708 | wl1271_warning("cmd join failed %d", ret); |
1710 | goto out_sleep; | 1709 | goto out_sleep; |