Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
net: wireless: bcmdhd: Fix roaming to hidden AP
Change-Id: Id64d12962049833e19705fbe109ef04b60014079
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
  • Loading branch information
Dmitry Shmidt authored and imoseyon committed Sep 22, 2013
1 parent 67d25fb commit a1fd6e4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drivers/net/wireless/bcmdhd/wl_cfg80211.c
Expand Up @@ -289,6 +289,7 @@ static void wl_ch_to_chanspec(int ch,
*/
static void wl_rst_ie(struct wl_priv *wl);
static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
static void wl_update_hidden_ap_ie(struct wl_bss_info *bi, u8 *ie_stream, u16 ie_size);
static s32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size);
static s32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size);
static u32 wl_get_ielen(struct wl_priv *wl);
Expand Down Expand Up @@ -4789,6 +4790,7 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
beacon_proberesp->capab_info = cpu_to_le16(bi->capability);
wl_rst_ie(wl);

wl_update_hidden_ap_ie(bi, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX -
offsetof(struct wl_cfg80211_bss_info, frame_buf));
Expand Down Expand Up @@ -5386,6 +5388,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl, struct net_device *ndev)
}
bi = (struct wl_bss_info *)(wl->extra_buf + 4);
if (memcmp(bi->BSSID.octet, curbssid, ETHER_ADDR_LEN)) {
WL_ERR(("Bssid doesn't match\n"));
err = -EIO;
goto update_bss_info_out;
}
Expand Down Expand Up @@ -5425,6 +5428,9 @@ static s32 wl_update_bss_info(struct wl_priv *wl, struct net_device *ndev)
wl_update_prof(wl, ndev, NULL, &dtim_period, WL_PROF_DTIMPERIOD);

update_bss_info_out:
if (unlikely(err)) {
WL_ERR(("Failed with error %d\n", err));
}
mutex_unlock(&wl->usr_sync);
return err;
}
Expand Down Expand Up @@ -7605,6 +7611,22 @@ static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
return err;
}

static void wl_update_hidden_ap_ie(struct wl_bss_info *bi, u8 *ie_stream, u16 ie_size)
{
const u8 *ssidie;

ssidie = cfg80211_find_ie(WLAN_EID_SSID, ie_stream, ie_size);
if (!ssidie)
return;
if (ssidie[1] != bi->SSID_len) {
WL_ERR(("%s: Wrong SSID len: %d != %d\n", __func__, ssidie[1], bi->SSID_len));
return;
}
if (*(ssidie + 2) == '\0')
memcpy((void *)(ssidie + 2), bi->SSID, bi->SSID_len);
return;
}

static s32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size)
{
struct wl_ie *ie = wl_to_ie(wl);
Expand Down

0 comments on commit a1fd6e4

Please sign in to comment.