diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-04-07 18:04:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-10 14:10:33 -0400 |
commit | c60c99298c50b698b0bbbe0e0146c965c322b8c1 (patch) | |
tree | 868d5991faa4dbb756778146a2d4b73c9874ae3a /drivers/net/wireless/ath/ath9k | |
parent | a043dfb90e0472049baabc4cc9168e1fe2bd7a90 (diff) |
ath9k_common: remove ath9k_cmn_padpos
It is equivalent to ieee80211_hdrlen
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 4 |
7 files changed, 9 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index 6c78fe7ca54d..344fdde1d7a3 100644 --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c | |||
@@ -27,20 +27,6 @@ MODULE_AUTHOR("Atheros Communications"); | |||
27 | MODULE_DESCRIPTION("Shared library for Atheros wireless 802.11n LAN cards."); | 27 | MODULE_DESCRIPTION("Shared library for Atheros wireless 802.11n LAN cards."); |
28 | MODULE_LICENSE("Dual BSD/GPL"); | 28 | MODULE_LICENSE("Dual BSD/GPL"); |
29 | 29 | ||
30 | int ath9k_cmn_padpos(__le16 frame_control) | ||
31 | { | ||
32 | int padpos = 24; | ||
33 | if (ieee80211_has_a4(frame_control)) { | ||
34 | padpos += ETH_ALEN; | ||
35 | } | ||
36 | if (ieee80211_is_data_qos(frame_control)) { | ||
37 | padpos += IEEE80211_QOS_CTL_LEN; | ||
38 | } | ||
39 | |||
40 | return padpos; | ||
41 | } | ||
42 | EXPORT_SYMBOL(ath9k_cmn_padpos); | ||
43 | |||
44 | int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb) | 30 | int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb) |
45 | { | 31 | { |
46 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 32 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h index 6102476a65de..207d06995b15 100644 --- a/drivers/net/wireless/ath/ath9k/common.h +++ b/drivers/net/wireless/ath/ath9k/common.h | |||
@@ -42,7 +42,6 @@ | |||
42 | #define ATH_EP_RND(x, mul) \ | 42 | #define ATH_EP_RND(x, mul) \ |
43 | (((x) + ((mul)/2)) / (mul)) | 43 | (((x) + ((mul)/2)) / (mul)) |
44 | 44 | ||
45 | int ath9k_cmn_padpos(__le16 frame_control); | ||
46 | int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb); | 45 | int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb); |
47 | void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, | 46 | void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, |
48 | struct ieee80211_channel *chan, | 47 | struct ieee80211_channel *chan, |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c index d0ce1f5bba10..f13f458dd656 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | |||
@@ -308,7 +308,7 @@ static void ath9k_htc_send_buffered(struct ath9k_htc_priv *priv, | |||
308 | while(skb) { | 308 | while(skb) { |
309 | hdr = (struct ieee80211_hdr *) skb->data; | 309 | hdr = (struct ieee80211_hdr *) skb->data; |
310 | 310 | ||
311 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 311 | padpos = ieee80211_hdrlen(hdr->frame_control); |
312 | padsize = padpos & 3; | 312 | padsize = padpos & 3; |
313 | if (padsize && skb->len > padpos) { | 313 | if (padsize && skb->len > padpos) { |
314 | if (skb_headroom(skb) < padsize) { | 314 | if (skb_headroom(skb) < padsize) { |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 098e3545e512..0743a47cef8f 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -866,7 +866,7 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw, | |||
866 | hdr = (struct ieee80211_hdr *) skb->data; | 866 | hdr = (struct ieee80211_hdr *) skb->data; |
867 | 867 | ||
868 | /* Add the padding after the header if this is not already done */ | 868 | /* Add the padding after the header if this is not already done */ |
869 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 869 | padpos = ieee80211_hdrlen(hdr->frame_control); |
870 | padsize = padpos & 3; | 870 | padsize = padpos & 3; |
871 | if (padsize && skb->len > padpos) { | 871 | if (padsize && skb->len > padpos) { |
872 | if (skb_headroom(skb) < padsize) { | 872 | if (skb_headroom(skb) < padsize) { |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index 2774dd13c786..6bd0e92ea2aa 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -966,7 +966,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
966 | struct sk_buff *skb = rxbuf->skb; | 966 | struct sk_buff *skb = rxbuf->skb; |
967 | struct ath_common *common = ath9k_hw_common(priv->ah); | 967 | struct ath_common *common = ath9k_hw_common(priv->ah); |
968 | struct ath_htc_rx_status *rxstatus; | 968 | struct ath_htc_rx_status *rxstatus; |
969 | int hdrlen, padpos, padsize; | 969 | int hdrlen, padsize; |
970 | int last_rssi = ATH_RSSI_DUMMY_MARKER; | 970 | int last_rssi = ATH_RSSI_DUMMY_MARKER; |
971 | __le16 fc; | 971 | __le16 fc; |
972 | 972 | ||
@@ -996,11 +996,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, | |||
996 | fc = hdr->frame_control; | 996 | fc = hdr->frame_control; |
997 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 997 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
998 | 998 | ||
999 | padpos = ath9k_cmn_padpos(fc); | 999 | padsize = hdrlen & 3; |
1000 | 1000 | if (padsize && skb->len >= hdrlen+padsize+FCS_LEN) { | |
1001 | padsize = padpos & 3; | 1001 | memmove(skb->data + padsize, skb->data, hdrlen); |
1002 | if (padsize && skb->len >= padpos+padsize+FCS_LEN) { | ||
1003 | memmove(skb->data + padsize, skb->data, padpos); | ||
1004 | skb_pull(skb, padsize); | 1002 | skb_pull(skb, padsize); |
1005 | } | 1003 | } |
1006 | 1004 | ||
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index e656e4891568..d7c06af1778d 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -985,7 +985,7 @@ static void ath9k_rx_skb_postprocess(struct ath_common *common, | |||
985 | hdr = (struct ieee80211_hdr *) skb->data; | 985 | hdr = (struct ieee80211_hdr *) skb->data; |
986 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 986 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
987 | fc = hdr->frame_control; | 987 | fc = hdr->frame_control; |
988 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 988 | padpos = ieee80211_hdrlen(fc); |
989 | 989 | ||
990 | /* The MAC header is padded to have 32-bit boundary if the | 990 | /* The MAC header is padded to have 32-bit boundary if the |
991 | * packet payload is non-zero. The general calculation for | 991 | * packet payload is non-zero. The general calculation for |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 89a64411b82e..94b2ee1220db 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1971,7 +1971,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | /* Add the padding after the header if this is not already done */ | 1973 | /* Add the padding after the header if this is not already done */ |
1974 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 1974 | padpos = ieee80211_hdrlen(hdr->frame_control); |
1975 | padsize = padpos & 3; | 1975 | padsize = padpos & 3; |
1976 | if (padsize && skb->len > padpos) { | 1976 | if (padsize && skb->len > padpos) { |
1977 | if (skb_headroom(skb) < padsize) | 1977 | if (skb_headroom(skb) < padsize) |
@@ -2033,7 +2033,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2033 | /* Frame was ACKed */ | 2033 | /* Frame was ACKed */ |
2034 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 2034 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
2035 | 2035 | ||
2036 | padpos = ath9k_cmn_padpos(hdr->frame_control); | 2036 | padpos = ieee80211_hdrlen(hdr->frame_control); |
2037 | padsize = padpos & 3; | 2037 | padsize = padpos & 3; |
2038 | if (padsize && skb->len>padpos+padsize) { | 2038 | if (padsize && skb->len>padpos+padsize) { |
2039 | /* | 2039 | /* |