diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2013-06-06 07:17:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-12 15:02:16 -0400 |
commit | df50f756966cc07addaae5449a6fd45a17bdb06c (patch) | |
tree | e0a8ac79d0241bd1293e61d2bf061753bbf8deaf /drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |
parent | 51f6dd9da27359d9218046ed0003f71e05a673c1 (diff) |
brcmfmac: Take bus flowcontrol at credit mgmt into account.
On bus flow control (no more host bus resources to send packets
to device) the netif flow control was toggled, however credit
management should also take this status into account. Since there
are multiple sources handling this flow control necessary spinlocks
were added to protect flow control related data/states.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index b98f2235978e..df37645f493e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -240,11 +240,15 @@ done: | |||
240 | void brcmf_txflowblock_if(struct brcmf_if *ifp, | 240 | void brcmf_txflowblock_if(struct brcmf_if *ifp, |
241 | enum brcmf_netif_stop_reason reason, bool state) | 241 | enum brcmf_netif_stop_reason reason, bool state) |
242 | { | 242 | { |
243 | unsigned long flags; | ||
244 | |||
243 | if (!ifp) | 245 | if (!ifp) |
244 | return; | 246 | return; |
245 | 247 | ||
246 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", | 248 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", |
247 | ifp->bssidx, ifp->netif_stop, reason, state); | 249 | ifp->bssidx, ifp->netif_stop, reason, state); |
250 | |||
251 | spin_lock_irqsave(&ifp->netif_stop_lock, flags); | ||
248 | if (state) { | 252 | if (state) { |
249 | if (!ifp->netif_stop) | 253 | if (!ifp->netif_stop) |
250 | netif_stop_queue(ifp->ndev); | 254 | netif_stop_queue(ifp->ndev); |
@@ -254,6 +258,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp, | |||
254 | if (!ifp->netif_stop) | 258 | if (!ifp->netif_stop) |
255 | netif_wake_queue(ifp->ndev); | 259 | netif_wake_queue(ifp->ndev); |
256 | } | 260 | } |
261 | spin_unlock_irqrestore(&ifp->netif_stop_lock, flags); | ||
257 | } | 262 | } |
258 | 263 | ||
259 | void brcmf_txflowblock(struct device *dev, bool state) | 264 | void brcmf_txflowblock(struct device *dev, bool state) |
@@ -264,6 +269,8 @@ void brcmf_txflowblock(struct device *dev, bool state) | |||
264 | 269 | ||
265 | brcmf_dbg(TRACE, "Enter\n"); | 270 | brcmf_dbg(TRACE, "Enter\n"); |
266 | 271 | ||
272 | brcmf_fws_bus_blocked(drvr, state); | ||
273 | |||
267 | for (i = 0; i < BRCMF_MAX_IFS; i++) | 274 | for (i = 0; i < BRCMF_MAX_IFS; i++) |
268 | brcmf_txflowblock_if(drvr->iflist[i], | 275 | brcmf_txflowblock_if(drvr->iflist[i], |
269 | BRCMF_NETIF_STOP_REASON_BLOCK_BUS, state); | 276 | BRCMF_NETIF_STOP_REASON_BLOCK_BUS, state); |
@@ -779,6 +786,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, | |||
779 | ifp->bssidx = bssidx; | 786 | ifp->bssidx = bssidx; |
780 | 787 | ||
781 | init_waitqueue_head(&ifp->pend_8021x_wait); | 788 | init_waitqueue_head(&ifp->pend_8021x_wait); |
789 | spin_lock_init(&ifp->netif_stop_lock); | ||
782 | 790 | ||
783 | if (mac_addr != NULL) | 791 | if (mac_addr != NULL) |
784 | memcpy(ifp->mac_addr, mac_addr, ETH_ALEN); | 792 | memcpy(ifp->mac_addr, mac_addr, ETH_ALEN); |