]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ath9k_common: remove ath9k_cmn_padpos
authorFelix Fietkau <nbd@openwrt.org>
Sun, 7 Apr 2013 22:04:09 +0000 (00:04 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 10 Apr 2013 18:10:33 +0000 (14:10 -0400)
It is equivalent to ieee80211_hdrlen

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/common.c
drivers/net/wireless/ath/ath9k/common.h
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/ath9k/xmit.c

index 6c78fe7ca54d4bbb0bf1d62cb67ab8e7cb6cdd05..344fdde1d7a36f39823606c1bf64cda5adb87188 100644 (file)
@@ -27,20 +27,6 @@ MODULE_AUTHOR("Atheros Communications");
 MODULE_DESCRIPTION("Shared library for Atheros wireless 802.11n LAN cards.");
 MODULE_LICENSE("Dual BSD/GPL");
 
-int ath9k_cmn_padpos(__le16 frame_control)
-{
-       int padpos = 24;
-       if (ieee80211_has_a4(frame_control)) {
-               padpos += ETH_ALEN;
-       }
-       if (ieee80211_is_data_qos(frame_control)) {
-               padpos += IEEE80211_QOS_CTL_LEN;
-       }
-
-       return padpos;
-}
-EXPORT_SYMBOL(ath9k_cmn_padpos);
-
 int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb)
 {
        struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
index 6102476a65dea79e1958d76376fc112bbafde049..207d06995b15a9fd085de9e017f878c9cbd1b96d 100644 (file)
@@ -42,7 +42,6 @@
 #define ATH_EP_RND(x, mul)                                             \
        (((x) + ((mul)/2)) / (mul))
 
-int ath9k_cmn_padpos(__le16 frame_control);
 int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
 void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
                               struct ieee80211_channel *chan,
index d0ce1f5bba1022087ebd45fbf7275b83c4db39e5..f13f458dd65674a364d51b6616e88e1c7e358610 100644 (file)
@@ -308,7 +308,7 @@ static void ath9k_htc_send_buffered(struct ath9k_htc_priv *priv,
        while(skb) {
                hdr = (struct ieee80211_hdr *) skb->data;
 
-               padpos = ath9k_cmn_padpos(hdr->frame_control);
+               padpos = ieee80211_hdrlen(hdr->frame_control);
                padsize = padpos & 3;
                if (padsize && skb->len > padpos) {
                        if (skb_headroom(skb) < padsize) {
index 098e3545e5127011767ac9dde2bb449287812091..0743a47cef8f3c96b18b8a5bfa09fdd380cccc47 100644 (file)
@@ -866,7 +866,7 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw,
        hdr = (struct ieee80211_hdr *) skb->data;
 
        /* Add the padding after the header if this is not already done */
-       padpos = ath9k_cmn_padpos(hdr->frame_control);
+       padpos = ieee80211_hdrlen(hdr->frame_control);
        padsize = padpos & 3;
        if (padsize && skb->len > padpos) {
                if (skb_headroom(skb) < padsize) {
index 2774dd13c786090b8102cf809aa5448980c21996..6bd0e92ea2aaee7144aaa4c74fae7a8ff43a42c0 100644 (file)
@@ -966,7 +966,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
        struct sk_buff *skb = rxbuf->skb;
        struct ath_common *common = ath9k_hw_common(priv->ah);
        struct ath_htc_rx_status *rxstatus;
-       int hdrlen, padpos, padsize;
+       int hdrlen, padsize;
        int last_rssi = ATH_RSSI_DUMMY_MARKER;
        __le16 fc;
 
@@ -996,11 +996,9 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
        fc = hdr->frame_control;
        hdrlen = ieee80211_get_hdrlen_from_skb(skb);
 
-       padpos = ath9k_cmn_padpos(fc);
-
-       padsize = padpos & 3;
-       if (padsize && skb->len >= padpos+padsize+FCS_LEN) {
-               memmove(skb->data + padsize, skb->data, padpos);
+       padsize = hdrlen & 3;
+       if (padsize && skb->len >= hdrlen+padsize+FCS_LEN) {
+               memmove(skb->data + padsize, skb->data, hdrlen);
                skb_pull(skb, padsize);
        }
 
index e656e4891568c2be6106b5e7632954548ff23eab..d7c06af1778d0acdd55b9c90e0063c96e5e24a21 100644 (file)
@@ -985,7 +985,7 @@ static void ath9k_rx_skb_postprocess(struct ath_common *common,
        hdr = (struct ieee80211_hdr *) skb->data;
        hdrlen = ieee80211_get_hdrlen_from_skb(skb);
        fc = hdr->frame_control;
-       padpos = ath9k_cmn_padpos(hdr->frame_control);
+       padpos = ieee80211_hdrlen(fc);
 
        /* The MAC header is padded to have 32-bit boundary if the
         * packet payload is non-zero. The general calculation for
index 89a64411b82e42d64b345d449964cb596798da35..94b2ee1220db807fb1b409892b0aa79f30d549aa 100644 (file)
@@ -1971,7 +1971,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
        }
 
        /* Add the padding after the header if this is not already done */
-       padpos = ath9k_cmn_padpos(hdr->frame_control);
+       padpos = ieee80211_hdrlen(hdr->frame_control);
        padsize = padpos & 3;
        if (padsize && skb->len > padpos) {
                if (skb_headroom(skb) < padsize)
@@ -2033,7 +2033,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
                /* Frame was ACKed */
                tx_info->flags |= IEEE80211_TX_STAT_ACK;
 
-       padpos = ath9k_cmn_padpos(hdr->frame_control);
+       padpos = ieee80211_hdrlen(hdr->frame_control);
        padsize = padpos & 3;
        if (padsize && skb->len>padpos+padsize) {
                /*