summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2013-05-13 12:03:21 +0400
committerEliad Peller <eliad@wizery.com>2013-07-22 14:01:47 +0400
commitfa97c8a4974bf0d67348d08d78d0beae3e4ea84c (patch)
treea0a741a8b2ea04b7e63a1942aee665cc39993805
parent662fe06390a0ef92418c7796bab67842af3f2aec (diff)
downloadwl18xx-fa97c8a4974bf0d67348d08d78d0beae3e4ea84c.tar.xz
wlcore: consider smart_config sync band (squash)
Use the smart_config sync band from the event mailbox instead of the hardcoded 2.4ghz band (for determining the frequency) Signed-off-by: Eliad Peller <eliad@wizery.com>
-rw-r--r--drivers/net/wireless/ti/wl18xx/event.c25
-rw-r--r--drivers/net/wireless/ti/wl18xx/event.h3
2 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/event.c b/drivers/net/wireless/ti/wl18xx/event.c
index 06a3907af08..166d2ccd59e 100644
--- a/drivers/net/wireless/ti/wl18xx/event.c
+++ b/drivers/net/wireless/ti/wl18xx/event.c
@@ -48,14 +48,23 @@ int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
}
#ifdef CONFIG_NL80211_TESTMODE
-static int wlcore_smart_config_sync_event(struct wl1271 *wl, u8 sync_channel)
+static int wlcore_smart_config_sync_event(struct wl1271 *wl, u8 sync_channel,
+ u8 sync_band)
{
struct sk_buff *skb;
- int freq = ieee80211_channel_to_frequency(sync_channel,
- IEEE80211_BAND_2GHZ);
+ enum ieee80211_band band;
+ int freq;
+
+ if (sync_band == WLCORE_BAND_5GHZ)
+ band = IEEE80211_BAND_5GHZ;
+ else
+ band = IEEE80211_BAND_2GHZ;
+
+ freq = ieee80211_channel_to_frequency(sync_channel, band);
+
wl1271_debug(DEBUG_EVENT,
- "SMART_CONFIG_SYNC_EVENT_ID, freq: %d (chan: %d)",
- freq, sync_channel);
+ "SMART_CONFIG_SYNC_EVENT_ID, freq: %d (chan: %d band %d)",
+ freq, sync_channel, sync_band);
skb = cfg80211_testmode_alloc_event_skb(wl->hw->wiphy, 20, GFP_KERNEL);
if (nla_put_u8(skb, WL1271_TM_ATTR_SMART_CONFIG_EVENT,
@@ -92,7 +101,8 @@ static int wlcore_smart_config_decode_event(struct wl1271 *wl,
return 0;
}
#else
-static int wlcore_smart_config_sync_event(struct wl1271 *wl, u8 sync_channel)
+static int wlcore_smart_config_sync_event(struct wl1271 *wl, u8 sync_channel,
+ u8 sync_band)
{
wl1271_error("got SMART_CONFIG event, but CONFIG_NL80211_TESTMODE is not configured!");
return -EINVAL;
@@ -229,7 +239,8 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl)
}
if (vector & SMART_CONFIG_SYNC_EVENT_ID)
- wlcore_smart_config_sync_event(wl, mbox->sc_sync_channel);
+ wlcore_smart_config_sync_event(wl, mbox->sc_sync_channel,
+ mbox->sc_sync_band);
if (vector & SMART_CONFIG_DECODE_EVENT_ID)
wlcore_smart_config_decode_event(wl,
diff --git a/drivers/net/wireless/ti/wl18xx/event.h b/drivers/net/wireless/ti/wl18xx/event.h
index 348b98dbbe8..60755297421 100644
--- a/drivers/net/wireless/ti/wl18xx/event.h
+++ b/drivers/net/wireless/ti/wl18xx/event.h
@@ -89,7 +89,8 @@ struct wl18xx_event_mailbox {
/* smart config sync channel */
u8 sc_sync_channel;
- u8 padding2[3];
+ u8 sc_sync_band;
+ u8 padding2[2];
} __packed;
int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,