diff options
author | Arend van Spriel <arend@broadcom.com> | 2013-04-03 06:40:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-03 15:07:04 -0400 |
commit | 43fa635e16c0674c9248b7feb271084c2874bb0a (patch) | |
tree | 4feec4ebf8c88729ad570c856628404dba809e80 | |
parent | ce814c1bb484f0efd221a05c936eb942657cebb5 (diff) |
brcmfmac: add handler for credit map firmware events
The firmware signalling functionality needs the credit map firmware
events. This patch adds registration of a handler for this event.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@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/fwsignal.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c index 85fd0ecd720e..542a971539b2 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | |||
@@ -197,6 +197,7 @@ struct brcmf_fws_info { | |||
197 | struct brcmf_pub *drvr; | 197 | struct brcmf_pub *drvr; |
198 | struct brcmf_fws_stats stats; | 198 | struct brcmf_fws_stats stats; |
199 | struct brcmf_fws_mac_descriptor nodes[BRCMF_FWS_MAC_DESC_TABLE_SIZE]; | 199 | struct brcmf_fws_mac_descriptor nodes[BRCMF_FWS_MAC_DESC_TABLE_SIZE]; |
200 | int fifo_credit[NL80211_NUM_ACS+1+1]; | ||
200 | }; | 201 | }; |
201 | 202 | ||
202 | /** | 203 | /** |
@@ -346,6 +347,22 @@ do { \ | |||
346 | #define brcmf_fws_unlock(drvr, flags) \ | 347 | #define brcmf_fws_unlock(drvr, flags) \ |
347 | spin_unlock_irqrestore(&((drvr)->fws_spinlock), (flags)) | 348 | spin_unlock_irqrestore(&((drvr)->fws_spinlock), (flags)) |
348 | 349 | ||
350 | static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp, | ||
351 | const struct brcmf_event_msg *e, | ||
352 | void *data) | ||
353 | { | ||
354 | struct brcmf_fws_info *fws = ifp->drvr->fws; | ||
355 | int i; | ||
356 | ulong flags; | ||
357 | u8 *credits = data; | ||
358 | |||
359 | brcmf_fws_lock(ifp->drvr, flags); | ||
360 | for (i = 0; i < ARRAY_SIZE(fws->fifo_credit); i++) | ||
361 | fws->fifo_credit[i] = *credits++; | ||
362 | brcmf_fws_unlock(ifp->drvr, flags); | ||
363 | return 0; | ||
364 | } | ||
365 | |||
349 | int brcmf_fws_init(struct brcmf_pub *drvr) | 366 | int brcmf_fws_init(struct brcmf_pub *drvr) |
350 | { | 367 | { |
351 | u32 tlv = 0; | 368 | u32 tlv = 0; |
@@ -370,6 +387,13 @@ int brcmf_fws_init(struct brcmf_pub *drvr) | |||
370 | brcmf_err("failed to set bdcv2 tlv signaling\n"); | 387 | brcmf_err("failed to set bdcv2 tlv signaling\n"); |
371 | goto fail; | 388 | goto fail; |
372 | } | 389 | } |
390 | |||
391 | if (brcmf_fweh_register(drvr, BRCMF_E_FIFO_CREDIT_MAP, | ||
392 | brcmf_fws_notify_credit_map)) { | ||
393 | brcmf_err("register credit map handler failed\n"); | ||
394 | goto fail; | ||
395 | } | ||
396 | |||
373 | /* set linkage back */ | 397 | /* set linkage back */ |
374 | drvr->fws->drvr = drvr; | 398 | drvr->fws->drvr = drvr; |
375 | 399 | ||