Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46d14a58 authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: General code scrub



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: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e63835b0
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -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,
+2 −2
Original line number Diff line number Diff line
@@ -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);
+4 −5
Original line number Diff line number Diff line
@@ -346,17 +346,16 @@ 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]);
		kfree(tx_info_priv);
		tx_info->rate_driver_data[0] = NULL;
	}
	}

	if (tx_status->flags & ATH_TX_BAR) {
		tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
Loading