Commit c4dea35e authored by Piotr Haber's avatar Piotr Haber Committed by John W. Linville
Browse files

brcmsmac: handle packet drop during transmit correctly

The .tx() callback function can drop packets when there is no
space in the DMA fifo. Propagate that information to caller
and make sure the freed sk_buff reference is not accessed.
Reviewed-by: default avatarArend van Spriel <>
Reviewed-by: default avatarPieter-Paul Giesberts <>
Signed-off-by: default avatarPiotr Haber <>
Signed-off-by: default avatarArend van Spriel <>
Signed-off-by: default avatarJohn W. Linville <>
parent 006a8f14
......@@ -285,7 +285,7 @@ static void brcms_ops_tx(struct ieee80211_hw *hw,
goto done;
brcms_c_sendpkt_mac80211(wl->wlc, skb, hw);
if (brcms_c_sendpkt_mac80211(wl->wlc, skb, hw))
tx_info->rate_driver_data[0] = control->sta;
......@@ -6928,17 +6928,20 @@ static int brcms_c_tx(struct brcms_c_info *wlc, struct sk_buff *skb)
return ret;
void brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
struct ieee80211_hw *hw)
uint fifo;
struct scb *scb = &wlc->pri_scb;
fifo = brcms_ac_to_fifo(skb_get_queue_mapping(sdu));
if (brcms_c_d11hdrs_mac80211(wlc, hw, sdu, scb, 0, 1, fifo, 0))
if (brcms_c_tx(wlc, sdu))
brcms_c_d11hdrs_mac80211(wlc, hw, sdu, scb, 0, 1, fifo, 0);
if (!brcms_c_tx(wlc, sdu))
return true;
/* packet discarded */
return false;
......@@ -284,7 +284,7 @@ extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
extern bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc);
extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
extern void brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
struct sk_buff *sdu,
struct ieee80211_hw *hw);
extern bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment