Skip to content

Commit 9c34989

Browse files
Arend van SprielKalle Valo
authored andcommitted
brcmfmac: revise handling events in receive path
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 <[email protected]> Reviewed-by: Pieter-Paul Giesberts <[email protected]> Reviewed-by: Franky Lin <[email protected]> Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent bbd1f93 commit 9c34989

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
216216
int prec);
217217

218218
/* Receive frame for delivery to OS. Callee disposes of rxp. */
219-
void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_evnt);
219+
void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_event);
220220
/* Receive async event packet from firmware. Callee disposes of rxp. */
221221
void brcmf_rx_event(struct device *dev, struct sk_buff *rxp);
222222

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,11 @@ void brcmf_txflowblock(struct device *dev, bool state)
298298
brcmf_fws_bus_blocked(drvr, state);
299299
}
300300

301-
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
302-
bool handle_event)
301+
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb)
303302
{
304-
skb->protocol = eth_type_trans(skb, ifp->ndev);
305-
306303
if (skb->pkt_type == PACKET_MULTICAST)
307304
ifp->stats.multicast++;
308305

309-
/* Process special event packets */
310-
if (handle_event)
311-
brcmf_fweh_process_skb(ifp->drvr, skb);
312-
313306
if (!(ifp->ndev->flags & IFF_UP)) {
314307
brcmu_pkt_buf_free_skb(skb);
315308
return;
@@ -329,7 +322,7 @@ void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
329322
netif_rx_ni(skb);
330323
}
331324

332-
void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt)
325+
void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event)
333326
{
334327
struct brcmf_if *ifp;
335328
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)
348341
return;
349342
}
350343

351-
if (brcmf_proto_is_reorder_skb(skb))
344+
skb->protocol = eth_type_trans(skb, ifp->ndev);
345+
346+
if (brcmf_proto_is_reorder_skb(skb)) {
352347
brcmf_proto_rxreorder(ifp, skb);
353-
else
354-
brcmf_netif_rx(ifp, skb, handle_evnt);
348+
} else {
349+
/* Process special event packets */
350+
if (handle_event)
351+
brcmf_fweh_process_skb(ifp->drvr, skb);
352+
353+
brcmf_netif_rx(ifp, skb);
354+
}
355355
}
356356

357357
void brcmf_rx_event(struct device *dev, struct sk_buff *skb)

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
221221
void brcmf_txflowblock_if(struct brcmf_if *ifp,
222222
enum brcmf_netif_stop_reason reason, bool state);
223223
void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
224-
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb,
225-
bool handle_event);
224+
void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
226225
void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
227226
int __init brcmf_core_init(void);
228227
void __exit brcmf_core_exit(void);

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
16681668
/* validate flags and flow id */
16691669
if (flags == 0xFF) {
16701670
brcmf_err("invalid flags...so ignore this packet\n");
1671-
brcmf_netif_rx(ifp, pkt, false);
1671+
brcmf_netif_rx(ifp, pkt);
16721672
return;
16731673
}
16741674

@@ -1680,7 +1680,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
16801680
if (rfi == NULL) {
16811681
brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n",
16821682
flow_id);
1683-
brcmf_netif_rx(ifp, pkt, false);
1683+
brcmf_netif_rx(ifp, pkt);
16841684
return;
16851685
}
16861686

@@ -1705,7 +1705,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
17051705
rfi = kzalloc(buf_size, GFP_ATOMIC);
17061706
if (rfi == NULL) {
17071707
brcmf_err("failed to alloc buffer\n");
1708-
brcmf_netif_rx(ifp, pkt, false);
1708+
brcmf_netif_rx(ifp, pkt);
17091709
return;
17101710
}
17111711

@@ -1819,7 +1819,7 @@ void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
18191819
netif_rx:
18201820
skb_queue_walk_safe(&reorder_list, pkt, pnext) {
18211821
__skb_unlink(pkt, &reorder_list);
1822-
brcmf_netif_rx(ifp, pkt, false);
1822+
brcmf_netif_rx(ifp, pkt);
18231823
}
18241824
}
18251825

drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)
11571157
brcmu_pkt_buf_free_skb(skb);
11581158
return;
11591159
}
1160-
brcmf_netif_rx(ifp, skb, false);
1160+
brcmf_netif_rx(ifp, skb);
11611161
}
11621162

11631163

0 commit comments

Comments
 (0)