ath5k: merge ath5k_hw and ath5k_softc
[deliverable/linux.git] / drivers / net / wireless / ath / ath5k / pcu.c
index 618ee54d5fe5c5ba28d56c3aebb611e5c28adab9..067313845060ed9d0aa15b01c035011cb0917da6 100644 (file)
@@ -77,14 +77,13 @@ static const unsigned int ack_rates_high[] =
 int ath5k_hw_get_frame_duration(struct ath5k_hw *ah,
                int len, struct ieee80211_rate *rate, bool shortpre)
 {
-       struct ath5k_softc *sc = ah->ah_sc;
        int sifs, preamble, plcp_bits, sym_time;
        int bitrate, bits, symbols, symbol_bits;
        int dur;
 
        /* Fallback */
        if (!ah->ah_bwmode) {
-               __le16 raw_dur = ieee80211_generic_frame_duration(sc->hw,
+               __le16 raw_dur = ieee80211_generic_frame_duration(ah->hw,
                                        NULL, len, rate);
 
                /* subtract difference between long and short preamble */
@@ -205,7 +204,7 @@ unsigned int ath5k_hw_get_default_sifs(struct ath5k_hw *ah)
  */
 void ath5k_hw_update_mib_counters(struct ath5k_hw *ah)
 {
-       struct ath5k_statistics *stats = &ah->ah_sc->stats;
+       struct ath5k_statistics *stats = &ah->stats;
 
        /* Read-And-Clear */
        stats->ack_fail += ath5k_hw_reg_read(ah, AR5K_ACK_FAIL);
@@ -240,25 +239,24 @@ void ath5k_hw_update_mib_counters(struct ath5k_hw *ah)
  */
 static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah)
 {
-       struct ath5k_softc *sc = ah->ah_sc;
        struct ieee80211_rate *rate;
        unsigned int i;
        /* 802.11g covers both OFDM and CCK */
        u8 band = IEEE80211_BAND_2GHZ;
 
        /* Write rate duration table */
-       for (i = 0; i < sc->sbands[band].n_bitrates; i++) {
+       for (i = 0; i < ah->sbands[band].n_bitrates; i++) {
                u32 reg;
                u16 tx_time;
 
                if (ah->ah_ack_bitrate_high)
-                       rate = &sc->sbands[band].bitrates[ack_rates_high[i]];
+                       rate = &ah->sbands[band].bitrates[ack_rates_high[i]];
                /* CCK -> 1Mb */
                else if (i < 4)
-                       rate = &sc->sbands[band].bitrates[0];
+                       rate = &ah->sbands[band].bitrates[0];
                /* OFDM -> 6Mb */
                else
-                       rate = &sc->sbands[band].bitrates[4];
+                       rate = &ah->sbands[band].bitrates[4];
 
                /* Set ACK timeout */
                reg = AR5K_RATE_DUR(rate->hw_value);
@@ -586,7 +584,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
        /*
         * Set the additional timers by mode
         */
-       switch (ah->ah_sc->opmode) {
+       switch (ah->opmode) {
        case NL80211_IFTYPE_MONITOR:
        case NL80211_IFTYPE_STATION:
                /* In STA mode timer1 is used as next wakeup
@@ -623,8 +621,8 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
         * Set the beacon register and enable all timers.
         */
        /* When in AP or Mesh Point mode zero timer0 to start TSF */
-       if (ah->ah_sc->opmode == NL80211_IFTYPE_AP ||
-           ah->ah_sc->opmode == NL80211_IFTYPE_MESH_POINT)
+       if (ah->opmode == NL80211_IFTYPE_AP ||
+           ah->opmode == NL80211_IFTYPE_MESH_POINT)
                ath5k_hw_reg_write(ah, 0, AR5K_TIMER0);
 
        ath5k_hw_reg_write(ah, next_beacon, AR5K_TIMER0);
@@ -814,7 +812,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah, enum nl80211_iftype op_mode)
        struct ath_common *common = ath5k_hw_common(ah);
        u32 pcu_reg, beacon_reg, low_id, high_id;
 
-       ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_MODE, "mode %d\n", op_mode);
+       ATH5K_DBG(ah, ATH5K_DEBUG_MODE, "mode %d\n", op_mode);
 
        /* Preserve rest settings */
        pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
@@ -890,7 +888,7 @@ void ath5k_hw_pcu_init(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
         * XXX: rethink this after new mode changes to
         * mac80211 are integrated */
        if (ah->ah_version == AR5K_AR5212 &&
-               ah->ah_sc->nvifs)
+               ah->nvifs)
                ath5k_hw_write_rate_duration(ah);
 
        /* Set RSSI/BRSSI thresholds
This page took 0.027414 seconds and 5 git commands to generate.