aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-04-17 15:25:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-22 15:20:22 -0400
commitb75c1a301b7d4e55f2354d8a7210a17d8402a218 (patch)
tree99806658b8e8bb949e1e136988eaee6de3b289eb
parent130e380b4470d5c704b492a2beb631d84c93bf09 (diff)
brcmfmac: destination mac closed when interface is closed
Firmware signals a destination is closed as well as an interface. A destination is associated with an interface. When an interface is closed consequently the destination should be considered closed as well. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@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.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index 9dae8fcea2c5..0d2ff60e925d 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -714,11 +714,21 @@ done:
714 return entry; 714 return entry;
715} 715}
716 716
717static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_mac_descriptor *entry, 717static bool brcmf_fws_mac_desc_closed(struct brcmf_fws_info *fws,
718 struct brcmf_fws_mac_descriptor *entry,
718 int fifo) 719 int fifo)
719{ 720{
721 struct brcmf_fws_mac_descriptor *if_entry;
720 bool closed; 722 bool closed;
721 723
724 /* for unique destination entries the related interface
725 * may be closed.
726 */
727 if (entry->mac_handle) {
728 if_entry = &fws->desc.iface[entry->interface_id];
729 if (if_entry->state == BRCMF_FWS_STATE_CLOSE)
730 return true;
731 }
722 /* an entry is closed when the state is closed and 732 /* an entry is closed when the state is closed and
723 * the firmware did not request anything. 733 * the firmware did not request anything.
724 */ 734 */
@@ -1079,7 +1089,8 @@ static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
1079 1089
1080 for (i = 0; i < num_nodes; i++) { 1090 for (i = 0; i < num_nodes; i++) {
1081 entry = &table[(node_pos + i) % num_nodes]; 1091 entry = &table[(node_pos + i) % num_nodes];
1082 if (!entry->occupied || brcmf_fws_mac_desc_closed(entry, fifo)) 1092 if (!entry->occupied ||
1093 brcmf_fws_mac_desc_closed(fws, entry, fifo))
1083 continue; 1094 continue;
1084 1095
1085 if (entry->suppressed) 1096 if (entry->suppressed)
@@ -1753,7 +1764,7 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
1753 1764
1754 brcmf_fws_lock(drvr, flags); 1765 brcmf_fws_lock(drvr, flags);
1755 if (skcb->mac->suppressed || 1766 if (skcb->mac->suppressed ||
1756 brcmf_fws_mac_desc_closed(skcb->mac, fifo) || 1767 brcmf_fws_mac_desc_closed(drvr->fws, skcb->mac, fifo) ||
1757 brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) || 1768 brcmu_pktq_mlen(&skcb->mac->psq, 3 << (fifo * 2)) ||
1758 (!multicast && 1769 (!multicast &&
1759 brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) { 1770 brcmf_fws_consume_credit(drvr->fws, fifo, skb) < 0)) {