Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266246
b: refs/heads/master
c: 42cecc3
h: refs/heads/master
v: v3
  • Loading branch information
John W. Linville committed Sep 19, 2011
1 parent 0dd1dc3 commit 6ef35f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 376cf5d3fd3c84855f1bf8d62aa05b7e4bcf1b8c
refs/heads/master: 42cecc3465578e442b794851fd8802dcb85a192c
56 changes: 19 additions & 37 deletions trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,29 +1017,15 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf,
while (bf) {
struct sk_buff *skb = bf->bf_mpdu;
struct ath_frame_info *fi = get_frame_info(skb);
struct ieee80211_hdr *hdr;
int padpos, padsize;

info.type = get_hw_packet_type(skb);
if (bf->bf_next)
info.link = bf->bf_next->bf_daddr;
else
info.link = 0;

if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
hdr = (struct ieee80211_hdr *)skb->data;
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.buf_addr[0] = bf->bf_buf_addr;
info.buf_len[0] = skb->len;
info.pkt_len = fi->framelen;
info.keyix = fi->keyix;
info.keytype = fi->keytype;
Expand Down Expand Up @@ -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);
}

if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
/* Add the padding after the header if this is not already done */
padpos = ath9k_cmn_padpos(hdr->frame_control);
padsize = padpos & 3;
if (padsize && skb->len > padpos) {
if (skb_headroom(skb) < padsize)
return -ENOMEM;
/* Add the padding after the header if this is not already done */
padpos = ath9k_cmn_padpos(hdr->frame_control);
padsize = padpos & 3;
if (padsize && skb->len > padpos) {
if (skb_headroom(skb) < padsize)
return -ENOMEM;

skb_push(skb, padsize);
memmove(skb->data, skb->data + padsize, padpos);
}
skb_push(skb, padsize);
memmove(skb->data, skb->data + padsize, padpos);
}

if ((vif && vif->type != NL80211_IFTYPE_AP &&
Expand Down Expand Up @@ -1952,17 +1936,15 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
/* Frame was ACKed */
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);
padsize = padpos & 3;
if (padsize && skb->len>padpos+padsize) {
/*
* Remove MAC header padding before giving the frame back to
* mac80211.
*/
memmove(skb->data + padsize, skb->data, padpos);
skb_pull(skb, padsize);
}
padpos = ath9k_cmn_padpos(hdr->frame_control);
padsize = padpos & 3;
if (padsize && skb->len>padpos+padsize) {
/*
* Remove MAC header padding before giving the frame back to
* mac80211.
*/
memmove(skb->data + padsize, skb->data, padpos);
skb_pull(skb, padsize);
}

if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) {
Expand Down

0 comments on commit 6ef35f8

Please sign in to comment.