brcmfmac: revise handling events in receive path
authorArend van Spriel <arend@broadcom.com>
Mon, 11 Apr 2016 09:35:27 +0000 (11:35 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 14 Apr 2016 12:57:52 +0000 (15:57 +0300)
Move event handling out of brcmf_netif_rx() avoiding the need
to pass a flag. This flag is only ever true for USB hosts as
other interface use separate brcmf_rx_event() function.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c

index 31856eb57bc48e82d680fc3b20f05ad85283b33d..2b246545647ac35810e6ade0ac81adab4c0424d8 100644 (file)
@@ -216,7 +216,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
                      int prec);
 
 /* Receive frame for delivery to OS.  Callee disposes of rxp. */
-void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_evnt);
+void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_event);
 /* Receive async event packet from firmware. Callee disposes of rxp. */
 void brcmf_rx_event(struct device *dev, struct sk_buff *rxp);
 
index a30841bbc5a18e07077fe045d5dc36937796d268..9b53555cf85c8d37df64fbcb15fa9213a43ce024 100644 (file)
@@ -298,18 +298,11 @@ void brcmf_txflowblock(struct device *dev, bool state)
        brcmf_fws_bus_blocked(drvr, state);
 }
 
-void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
-                   bool handle_event)
+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb)
 {
-       skb->protocol = eth_type_trans(skb, ifp->ndev);
-
        if (skb->pkt_type == PACKET_MULTICAST)
                ifp->stats.multicast++;
 
-       /* Process special event packets */
-       if (handle_event)
-               brcmf_fweh_process_skb(ifp->drvr, skb);
-
        if (!(ifp->ndev->flags & IFF_UP)) {
                brcmu_pkt_buf_free_skb(skb);
                return;
@@ -329,7 +322,7 @@ void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
                netif_rx_ni(skb);
 }
 
-void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt)
+void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event)
 {
        struct brcmf_if *ifp;
        struct brcmf_bus *bus_if = dev_get_drvdata(dev);
@@ -348,10 +341,17 @@ void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt)
                return;
        }
 
-       if (brcmf_proto_is_reorder_skb(skb))
+       skb->protocol = eth_type_trans(skb, ifp->ndev);
+
+       if (brcmf_proto_is_reorder_skb(skb)) {
                brcmf_proto_rxreorder(ifp, skb);
-       else
-               brcmf_netif_rx(ifp, skb, handle_evnt);
+       } else {
+               /* Process special event packets */
+               if (handle_event)
+                       brcmf_fweh_process_skb(ifp->drvr, skb);
+
+               brcmf_netif_rx(ifp, skb);
+       }
 }
 
 void brcmf_rx_event(struct device *dev, struct sk_buff *skb)
index 394ae050b960bf92c6ad0b1390ee0e4cab14e553..241ee8d13e54dccbde3bd676a56802bdb229b6bd 100644 (file)
@@ -221,8 +221,7 @@ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
 void brcmf_txflowblock_if(struct brcmf_if *ifp,
                          enum brcmf_netif_stop_reason reason, bool state);
 void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
-void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
-                   bool handle_event);
+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
 void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
 int __init brcmf_core_init(void);
 void __exit brcmf_core_exit(void);
index 8a07687b46f85672068fd29f2f4aaa34be52bf3e..5b30922b67ec27cbe698eb3325ee4c3373420546 100644 (file)
@@ -1668,7 +1668,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
        /* validate flags and flow id */
        if (flags == 0xFF) {
                brcmf_err("invalid flags...so ignore this packet\n");
-               brcmf_netif_rx(ifp, pkt, false);
+               brcmf_netif_rx(ifp, pkt);
                return;
        }
 
@@ -1680,7 +1680,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
                if (rfi == NULL) {
                        brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n",
                                  flow_id);
-                       brcmf_netif_rx(ifp, pkt, false);
+                       brcmf_netif_rx(ifp, pkt);
                        return;
                }
 
@@ -1705,7 +1705,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
                rfi = kzalloc(buf_size, GFP_ATOMIC);
                if (rfi == NULL) {
                        brcmf_err("failed to alloc buffer\n");
-                       brcmf_netif_rx(ifp, pkt, false);
+                       brcmf_netif_rx(ifp, pkt);
                        return;
                }
 
@@ -1819,7 +1819,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
 netif_rx:
        skb_queue_walk_safe(&reorder_list, pkt, pnext) {
                __skb_unlink(pkt, &reorder_list);
-               brcmf_netif_rx(ifp, pkt, false);
+               brcmf_netif_rx(ifp, pkt);
        }
 }
 
index 8c064ab24b83b8f241aa3cb864f021cf95b034f5..68f1ce02f4bf83d8d787e256cb5d74628cc4040e 100644 (file)
@@ -1157,7 +1157,7 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)
                brcmu_pkt_buf_free_skb(skb);
                return;
        }
-       brcmf_netif_rx(ifp, skb, false);
+       brcmf_netif_rx(ifp, skb);
 }