Skip to content

Commit

Permalink
ath9k: General code scrub
Browse files Browse the repository at this point in the history
Replace TRUE/FALSE macros with VALID/INVALID macros.
Follow a consistent variable convention.
Remove unnecessary comments.
Add all RC phy macros into a single enum.
Merge functions into reasonably sized entities.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Sujith authored and John W. Linville committed Nov 26, 2008
1 parent e63835b commit 46d14a5
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 412 deletions.
18 changes: 12 additions & 6 deletions drivers/net/wireless/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,13 +686,19 @@ enum ath9k_ani_cmd {
ATH9K_ANI_ALL = 0xff
};

enum phytype {
PHY_DS,
PHY_FH,
PHY_OFDM,
PHY_HT,
enum {
WLAN_RC_PHY_OFDM,
WLAN_RC_PHY_CCK,
WLAN_RC_PHY_HT_20_SS,
WLAN_RC_PHY_HT_20_DS,
WLAN_RC_PHY_HT_40_SS,
WLAN_RC_PHY_HT_40_DS,
WLAN_RC_PHY_HT_20_SS_HGI,
WLAN_RC_PHY_HT_20_DS_HGI,
WLAN_RC_PHY_HT_40_SS_HGI,
WLAN_RC_PHY_HT_40_DS_HGI,
WLAN_RC_PHY_MAX
};
#define PHY_CCK PHY_DS

enum ath9k_tp_scale {
ATH9K_TP_SCALE_MAX = 0,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ u16 ath9k_hw_computetxtime(struct ath_hal *ah,
return 0;

switch (rates->info[rateix].phy) {
case PHY_CCK:
case WLAN_RC_PHY_CCK:
phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS;
if (shortPreamble && rates->info[rateix].short_preamble)
phyTime >>= 1;
numBits = frameLen << 3;
txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000) / kbps);
break;
case PHY_OFDM:
case WLAN_RC_PHY_OFDM:
if (ah->ah_curchan && IS_CHAN_QUARTER_RATE(ah->ah_curchan)) {
bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000;
numBits = OFDM_PLCP_BITS + (frameLen << 3);
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,15 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
{
struct ieee80211_hw *hw = sc->hw;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info);

DPRINTF(sc, ATH_DBG_XMIT,
"%s: TX complete: skb: %p\n", __func__, skb);

if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK ||
tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
if (tx_info->rate_driver_data[0] != NULL) {
kfree(tx_info->rate_driver_data[0]);
tx_info->rate_driver_data[0] = NULL;
}
tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
kfree(tx_info_priv);
tx_info->rate_driver_data[0] = NULL;
}

if (tx_status->flags & ATH_TX_BAR) {
Expand Down
Loading

0 comments on commit 46d14a5

Please sign in to comment.