aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_event.c
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2012-05-08 21:30:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:46:36 -0400
commite568634ae7ac379661c90731d480e067929420a1 (patch)
tree55f02f61eaf97c6e514304d9e0b5e3cee61bb0fd /drivers/net/wireless/mwifiex/sta_event.c
parent12190c5d80bd3c880c76fdaee5a56314ff0bd256 (diff)
mwifiex: add AP event handling framework
Added logic to handle AP event that are generated by the firmware. As MLME/SME is implemented in the firmware, events such as station association and deauthentication, must be sent to userspace (hostapd) for creating and deleting station database. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Yogesh Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_event.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index f6bbb9307f86..4ace5a3dcd23 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -184,8 +184,10 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv)
184int mwifiex_process_sta_event(struct mwifiex_private *priv) 184int mwifiex_process_sta_event(struct mwifiex_private *priv)
185{ 185{
186 struct mwifiex_adapter *adapter = priv->adapter; 186 struct mwifiex_adapter *adapter = priv->adapter;
187 int ret = 0; 187 int len, ret = 0;
188 u32 eventcause = adapter->event_cause; 188 u32 eventcause = adapter->event_cause;
189 struct station_info sinfo;
190 struct mwifiex_assoc_event *event;
189 191
190 switch (eventcause) { 192 switch (eventcause) {
191 case EVENT_DUMMY_HOST_WAKEUP_SIGNAL: 193 case EVENT_DUMMY_HOST_WAKEUP_SIGNAL:
@@ -402,6 +404,53 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
402 case EVENT_HOSTWAKE_STAIE: 404 case EVENT_HOSTWAKE_STAIE:
403 dev_dbg(adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause); 405 dev_dbg(adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause);
404 break; 406 break;
407
408 case EVENT_UAP_STA_ASSOC:
409 skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER);
410 memset(&sinfo, 0, sizeof(sinfo));
411 event = (struct mwifiex_assoc_event *)adapter->event_skb->data;
412 if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
413 len = -1;
414
415 if (ieee80211_is_assoc_req(event->frame_control))
416 len = 0;
417 else if (ieee80211_is_reassoc_req(event->frame_control))
418 /* There will be ETH_ALEN bytes of
419 * current_ap_addr before the re-assoc ies.
420 */
421 len = ETH_ALEN;
422
423 if (len != -1) {
424 sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
425 sinfo.assoc_req_ies = (u8 *)&event->data[len];
426 len = (u8 *)sinfo.assoc_req_ies -
427 (u8 *)&event->frame_control;
428 sinfo.assoc_req_ies_len =
429 le16_to_cpu(event->len) - (u16)len;
430 }
431 }
432 cfg80211_new_sta(priv->netdev, event->sta_addr, &sinfo,
433 GFP_KERNEL);
434 break;
435 case EVENT_UAP_STA_DEAUTH:
436 skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER);
437 cfg80211_del_sta(priv->netdev, adapter->event_skb->data,
438 GFP_KERNEL);
439 break;
440 case EVENT_UAP_BSS_IDLE:
441 priv->media_connected = false;
442 break;
443 case EVENT_UAP_BSS_ACTIVE:
444 priv->media_connected = true;
445 break;
446 case EVENT_UAP_BSS_START:
447 dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause);
448 memcpy(priv->netdev->dev_addr, adapter->event_body+2, ETH_ALEN);
449 break;
450 case EVENT_UAP_MIC_COUNTERMEASURES:
451 /* For future development */
452 dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause);
453 break;
405 default: 454 default:
406 dev_dbg(adapter->dev, "event: unknown event id: %#x\n", 455 dev_dbg(adapter->dev, "event: unknown event id: %#x\n",
407 eventcause); 456 eventcause);