Commit 42cecc34 authored by John W. Linville's avatar John W. Linville

Revert "ath9k: do not insert padding into tx buffers on AR9380+"

This reverts commit 4245d313.
parent 376cf5d3
...@@ -1017,8 +1017,6 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf, ...@@ -1017,8 +1017,6 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf,
while (bf) { while (bf) {
struct sk_buff *skb = bf->bf_mpdu; struct sk_buff *skb = bf->bf_mpdu;
struct ath_frame_info *fi = get_frame_info(skb); struct ath_frame_info *fi = get_frame_info(skb);
struct ieee80211_hdr *hdr;
int padpos, padsize;
info.type = get_hw_packet_type(skb); info.type = get_hw_packet_type(skb);
if (bf->bf_next) if (bf->bf_next)
...@@ -1026,20 +1024,8 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf, ...@@ -1026,20 +1024,8 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf,
else else
info.link = 0; info.link = 0;
if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { info.buf_addr[0] = bf->bf_buf_addr;
hdr = (struct ieee80211_hdr *)skb->data; info.buf_len[0] = skb->len;
padpos = ath9k_cmn_padpos(hdr->frame_control);
padsize = padpos & 3;
info.buf_addr[0] = bf->bf_buf_addr;
info.buf_len[0] = padpos + padsize;
info.buf_addr[1] = info.buf_addr[0] + padpos;
info.buf_len[1] = skb->len - padpos;
} else {
info.buf_addr[0] = bf->bf_buf_addr;
info.buf_len[0] = skb->len;
}
info.pkt_len = fi->framelen; info.pkt_len = fi->framelen;
info.keyix = fi->keyix; info.keyix = fi->keyix;
info.keytype = fi->keytype; info.keytype = fi->keytype;
...@@ -1892,17 +1878,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -1892,17 +1878,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no); hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
} }
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) { /* Add the padding after the header if this is not already done */
/* Add the padding after the header if this is not already done */ padpos = ath9k_cmn_padpos(hdr->frame_control);
padpos = ath9k_cmn_padpos(hdr->frame_control); padsize = padpos & 3;
padsize = padpos & 3; if (padsize && skb->len > padpos) {
if (padsize && skb->len > padpos) { if (skb_headroom(skb) < padsize)
if (skb_headroom(skb) < padsize) return -ENOMEM;
return -ENOMEM;
skb_push(skb, padsize); skb_push(skb, padsize);
memmove(skb->data, skb->data + padsize, padpos); memmove(skb->data, skb->data + padsize, padpos);
}
} }
if ((vif && vif->type != NL80211_IFTYPE_AP && if ((vif && vif->type != NL80211_IFTYPE_AP &&
...@@ -1952,17 +1936,15 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1952,17 +1936,15 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
/* Frame was ACKed */ /* Frame was ACKed */
tx_info->flags |= IEEE80211_TX_STAT_ACK; tx_info->flags |= IEEE80211_TX_STAT_ACK;
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) { padpos = ath9k_cmn_padpos(hdr->frame_control);
padpos = ath9k_cmn_padpos(hdr->frame_control); padsize = padpos & 3;
padsize = padpos & 3; if (padsize && skb->len>padpos+padsize) {
if (padsize && skb->len>padpos+padsize) { /*
/* * Remove MAC header padding before giving the frame back to
* Remove MAC header padding before giving the frame back to * mac80211.
* mac80211. */
*/ memmove(skb->data + padsize, skb->data, padpos);
memmove(skb->data + padsize, skb->data, padpos); skb_pull(skb, padsize);
skb_pull(skb, padsize);
}
} }
if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) { if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) {
......
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