Skip to content

Commit

Permalink
Added code to make sure headroom is enough.
Browse files Browse the repository at this point in the history
Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Jul 12, 2018
1 parent 2929b70 commit f5869c0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hif/pcie/dev.h
Expand Up @@ -736,6 +736,7 @@ static inline void pcie_tx_add_dma_header(struct mwl_priv *priv,
int dma_hdrlen;
int hdrlen;
int reqd_hdrlen;
int needed_room;
struct pcie_dma_data *dma_data;

dma_hdrlen = (priv->chip_type == MWL8997) ?
Expand All @@ -753,8 +754,15 @@ static inline void pcie_tx_add_dma_header(struct mwl_priv *priv,

reqd_hdrlen = dma_hdrlen + head_pad;

if (hdrlen != reqd_hdrlen)
skb_push(skb, reqd_hdrlen - hdrlen);
if (hdrlen != reqd_hdrlen) {
needed_room = reqd_hdrlen - hdrlen;
if (skb_headroom(skb) < needed_room) {
wiphy_debug(priv->hw->wiphy, "headroom is short: %d %d",
skb_headroom(skb), needed_room);
skb_cow(skb, needed_room);
}
skb_push(skb, needed_room);
}

if (ieee80211_is_data_qos(wh->frame_control))
hdrlen -= IEEE80211_QOS_CTL_LEN;
Expand Down

0 comments on commit f5869c0

Please sign in to comment.