diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2012-09-11 21:18:47 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-12 14:19:15 -0400 |
commit | c4fdb05696f315f43eb44c2a44fec1677ba47b31 (patch) | |
tree | 0526604ef8a73948ee65cf5a9aec8445ec95f5a9 | |
parent | 90d03ff71b52ba1d9d53f18c07d89566ba0263b4 (diff) | |
download | blackbird-op-linux-c4fdb05696f315f43eb44c2a44fec1677ba47b31.tar.gz blackbird-op-linux-c4fdb05696f315f43eb44c2a44fec1677ba47b31.zip |
brcmfmac: Add extra data support to firmware event queueing.
Firmware events can contain extra data. This patch adds support to
copy this data when it exists.
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h index 37f57088c363..9e2fb5bc932f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h @@ -140,6 +140,8 @@ struct brcmf_event_msg { __be32 datalen; u8 addr[ETH_ALEN]; char ifname[IFNAMSIZ]; + u8 ifidx; + u8 bsscfgidx; } __packed; struct brcm_ethhdr { diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index a6b382bfabd6..4553fa07afe3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c @@ -3321,18 +3321,28 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event( static s32 brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event, - const struct brcmf_event_msg *msg) + const struct brcmf_event_msg *msg, void *data) { struct brcmf_cfg80211_event_q *e; s32 err = 0; ulong flags; + u32 data_len; + u32 total_len; - e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_ATOMIC); + total_len = sizeof(struct brcmf_cfg80211_event_q); + if (data) + data_len = be32_to_cpu(msg->datalen); + else + data_len = 0; + total_len += data_len; + e = kzalloc(total_len, GFP_ATOMIC); if (!e) return -ENOMEM; e->etype = event; memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg)); + if (data) + memcpy(&e->edata, data, data_len); spin_lock_irqsave(&cfg_priv->evt_q_lock, flags); list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list); @@ -3501,7 +3511,7 @@ brcmf_cfg80211_event(struct net_device *ndev, u32 event_type = be32_to_cpu(e->event_type); struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); - if (!brcmf_enq_event(cfg_priv, event_type, e)) + if (!brcmf_enq_event(cfg_priv, event_type, e, data)) schedule_work(&cfg_priv->event_work); } |