Commit 19b73c7f authored by Sujith's avatar Sujith Committed by John W. Linville

ath9k: Add IEEE80211_HW_RX_INCLUDES_FCS to hw flags

Don't trim the FCS before passing the frame to mac80211,
move TSF_TO_TU to core.h and delete more unused macros.
Signed-off-by: default avatarSujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 60653678
...@@ -564,8 +564,6 @@ enum ath9k_cipher { ...@@ -564,8 +564,6 @@ enum ath9k_cipher {
#define CTL_5GHT40 8 #define CTL_5GHT40 8
#define AR_EEPROM_MAC(i) (0x1d+(i)) #define AR_EEPROM_MAC(i) (0x1d+(i))
#define EEP_SCALE 100
#define EEP_DELTA 10
#define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
#define AR_EEPROM_RFSILENT_GPIO_SEL_S 2 #define AR_EEPROM_RFSILENT_GPIO_SEL_S 2
...@@ -606,9 +604,6 @@ struct ath9k_country_entry { ...@@ -606,9 +604,6 @@ struct ath9k_country_entry {
#define REG_CLR_BIT(_a, _r, _f) \ #define REG_CLR_BIT(_a, _r, _f) \
REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f) REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f)
#define ATH9K_COMP_BUF_MAX_SIZE 9216
#define ATH9K_COMP_BUF_ALIGN_SIZE 512
#define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS 0x00000001 #define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS 0x00000001
#define INIT_AIFS 2 #define INIT_AIFS 2
...@@ -637,7 +632,6 @@ struct ath9k_country_entry { ...@@ -637,7 +632,6 @@ struct ath9k_country_entry {
IEEE80211_WEP_KIDLEN + \ IEEE80211_WEP_KIDLEN + \
IEEE80211_WEP_CRCLEN)) IEEE80211_WEP_CRCLEN))
#define MAX_REG_ADD_COUNT 129
#define MAX_RATE_POWER 63 #define MAX_RATE_POWER 63
enum ath9k_power_mode { enum ath9k_power_mode {
...@@ -707,13 +701,6 @@ enum phytype { ...@@ -707,13 +701,6 @@ enum phytype {
}; };
#define PHY_CCK PHY_DS #define PHY_CCK PHY_DS
enum start_adhoc_option {
START_ADHOC_NO_11A,
START_ADHOC_PER_11D,
START_ADHOC_IN_11A,
START_ADHOC_IN_11B,
};
enum ath9k_tp_scale { enum ath9k_tp_scale {
ATH9K_TP_SCALE_MAX = 0, ATH9K_TP_SCALE_MAX = 0,
ATH9K_TP_SCALE_50, ATH9K_TP_SCALE_50,
......
...@@ -551,9 +551,6 @@ void ath_beacon_free(struct ath_softc *sc) ...@@ -551,9 +551,6 @@ void ath_beacon_free(struct ath_softc *sc)
void ath9k_beacon_tasklet(unsigned long data) void ath9k_beacon_tasklet(unsigned long data)
{ {
#define TSF_TO_TU(_h,_l) \
((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
struct ath_softc *sc = (struct ath_softc *)data; struct ath_softc *sc = (struct ath_softc *)data;
struct ath_hal *ah = sc->sc_ah; struct ath_hal *ah = sc->sc_ah;
struct ath_buf *bf = NULL; struct ath_buf *bf = NULL;
...@@ -715,7 +712,6 @@ void ath9k_beacon_tasklet(unsigned long data) ...@@ -715,7 +712,6 @@ void ath9k_beacon_tasklet(unsigned long data)
sc->ast_be_xmit += bc; /* XXX per-vap? */ sc->ast_be_xmit += bc; /* XXX per-vap? */
} }
#undef TSF_TO_TU
} }
/* /*
...@@ -751,8 +747,6 @@ void ath_bstuck_process(struct ath_softc *sc) ...@@ -751,8 +747,6 @@ void ath_bstuck_process(struct ath_softc *sc)
void ath_beacon_config(struct ath_softc *sc, int if_id) void ath_beacon_config(struct ath_softc *sc, int if_id)
{ {
#define TSF_TO_TU(_h,_l) \
((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
struct ath_hal *ah = sc->sc_ah; struct ath_hal *ah = sc->sc_ah;
u32 nexttbtt, intval; u32 nexttbtt, intval;
struct ath_beacon_config conf; struct ath_beacon_config conf;
...@@ -975,7 +969,6 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -975,7 +969,6 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
ath_beacon_start_adhoc(sc, 0); ath_beacon_start_adhoc(sc, 0);
} }
#undef TSF_TO_TU
} }
/* Function to collect beacon rssi data and resync beacon if necessary */ /* Function to collect beacon rssi data and resync beacon if necessary */
......
...@@ -79,6 +79,9 @@ struct ath_node; ...@@ -79,6 +79,9 @@ struct ath_node;
} \ } \
} while (0) } while (0)
#define TSF_TO_TU(_h,_l) \
((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
/* XXX: remove */ /* XXX: remove */
#define memzero(_buf, _len) memset(_buf, 0, _len) #define memzero(_buf, _len) memset(_buf, 0, _len)
...@@ -382,10 +385,10 @@ int ath_rx_input(struct ath_softc *sc, ...@@ -382,10 +385,10 @@ int ath_rx_input(struct ath_softc *sc,
struct sk_buff *skb, struct sk_buff *skb,
struct ath_recv_status *rx_status, struct ath_recv_status *rx_status,
enum ATH_RX_TYPE *status); enum ATH_RX_TYPE *status);
int ath__rx_indicate(struct ath_softc *sc, int _ath_rx_indicate(struct ath_softc *sc,
struct sk_buff *skb, struct sk_buff *skb,
struct ath_recv_status *status, struct ath_recv_status *status,
u16 keyix); u16 keyix);
int ath_rx_subframe(struct ath_node *an, struct sk_buff *skb, int ath_rx_subframe(struct ath_node *an, struct sk_buff *skb,
struct ath_recv_status *status); struct ath_recv_status *status);
......
...@@ -1099,7 +1099,7 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1099,7 +1099,7 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
ath_node_put(sc, an, ATH9K_BH_STATUS_CHANGE); ath_node_put(sc, an, ATH9K_BH_STATUS_CHANGE);
} }
int ath__rx_indicate(struct ath_softc *sc, int _ath_rx_indicate(struct ath_softc *sc,
struct sk_buff *skb, struct sk_buff *skb,
struct ath_recv_status *status, struct ath_recv_status *status,
u16 keyix) u16 keyix)
...@@ -1119,9 +1119,6 @@ int ath__rx_indicate(struct ath_softc *sc, ...@@ -1119,9 +1119,6 @@ int ath__rx_indicate(struct ath_softc *sc,
skb_pull(skb, padsize); skb_pull(skb, padsize);
} }
/* remove FCS before passing up to protocol stack */
skb_trim(skb, (skb->len - FCS_LEN));
/* Prepare rx status */ /* Prepare rx status */
ath9k_rx_prepare(sc, skb, status, &rx_status); ath9k_rx_prepare(sc, skb, status, &rx_status);
...@@ -1364,7 +1361,8 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1364,7 +1361,8 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto bad2; goto bad2;
} }
hw->flags = IEEE80211_HW_SIGNAL_DBM | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_NOISE_DBM; IEEE80211_HW_NOISE_DBM;
SET_IEEE80211_DEV(hw, &pdev->dev); SET_IEEE80211_DEV(hw, &pdev->dev);
......
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
#define PHY_H #define PHY_H
bool ath9k_hw_ar9280_set_channel(struct ath_hal *ah, bool ath9k_hw_ar9280_set_channel(struct ath_hal *ah,
struct ath9k_channel struct ath9k_channel
*chan); *chan);
bool ath9k_hw_set_channel(struct ath_hal *ah, bool ath9k_hw_set_channel(struct ath_hal *ah,
struct ath9k_channel *chan); struct ath9k_channel *chan);
void ath9k_hw_write_regs(struct ath_hal *ah, u32 modesIndex, void ath9k_hw_write_regs(struct ath_hal *ah, u32 modesIndex,
u32 freqIndex, int regWrites); u32 freqIndex, int regWrites);
bool ath9k_hw_set_rf_regs(struct ath_hal *ah, bool ath9k_hw_set_rf_regs(struct ath_hal *ah,
struct ath9k_channel *chan, struct ath9k_channel *chan,
u16 modesIndex); u16 modesIndex);
void ath9k_hw_decrease_chain_power(struct ath_hal *ah, void ath9k_hw_decrease_chain_power(struct ath_hal *ah,
struct ath9k_channel *chan); struct ath9k_channel *chan);
bool ath9k_hw_init_rf(struct ath_hal *ah, bool ath9k_hw_init_rf(struct ath_hal *ah,
int *status); int *status);
#define AR_PHY_BASE 0x9800 #define AR_PHY_BASE 0x9800
#define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2)) #define AR_PHY(_n) (AR_PHY_BASE + ((_n)<<2))
......
...@@ -448,7 +448,7 @@ static int ath_rx_indicate(struct ath_softc *sc, ...@@ -448,7 +448,7 @@ static int ath_rx_indicate(struct ath_softc *sc,
int type; int type;
/* indicate frame to the stack, which will free the old skb. */ /* indicate frame to the stack, which will free the old skb. */
type = ath__rx_indicate(sc, skb, status, keyix); type = _ath_rx_indicate(sc, skb, status, keyix);
/* allocate a new skb and queue it to for H/W processing */ /* allocate a new skb and queue it to for H/W processing */
nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize); nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize);
......
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