aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-09 02:55:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-10 17:44:33 -0500
commitccfe5552aeb18c87a4d0ecb8cb7512280435bfdd (patch)
tree4856db3614b872aa01914daa161c5c6432c566a3 /drivers
parentcaec9112d6cb07cb5b82a967a448c3b15b257654 (diff)
ath5k: remove double opmode definition
opmode (operating mode) was defined in struct ath5k_hw and struct ath5k_softc. remove it from ath5k_hw and use only from ath5k_softc (sc->opmode). (btw: what's the meaning of opmode when we have multiple interfaces?) Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h3
-rw-r--r--drivers/net/wireless/ath/ath5k/attach.c3
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c7
-rw-r--r--drivers/net/wireless/ath/ath5k/pcu.c14
-rw-r--r--drivers/net/wireless/ath/ath5k/reset.c9
5 files changed, 15 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 22f9f59397c1..e5ace22b951e 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1036,7 +1036,6 @@ struct ath5k_hw {
1036 1036
1037 enum ath5k_int ah_imr; 1037 enum ath5k_int ah_imr;
1038 1038
1039 enum nl80211_iftype ah_op_mode;
1040 struct ieee80211_channel *ah_current_channel; 1039 struct ieee80211_channel *ah_current_channel;
1041 bool ah_turbo; 1040 bool ah_turbo;
1042 bool ah_calibration; 1041 bool ah_calibration;
@@ -1200,7 +1199,7 @@ void ath5k_eeprom_detach(struct ath5k_hw *ah);
1200int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac); 1199int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac);
1201 1200
1202/* Protocol Control Unit Functions */ 1201/* Protocol Control Unit Functions */
1203int ath5k_hw_set_opmode(struct ath5k_hw *ah); 1202extern int ath5k_hw_set_opmode(struct ath5k_hw *ah, enum nl80211_iftype opmode);
1204void ath5k_hw_set_coverage_class(struct ath5k_hw *ah, u8 coverage_class); 1203void ath5k_hw_set_coverage_class(struct ath5k_hw *ah, u8 coverage_class);
1205/* BSSID Functions */ 1204/* BSSID Functions */
1206int ath5k_hw_set_lladdr(struct ath5k_hw *ah, const u8 *mac); 1205int ath5k_hw_set_lladdr(struct ath5k_hw *ah, const u8 *mac);
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index c8bb102a4db4..66758cb66d50 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -113,7 +113,6 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
113 /* 113 /*
114 * HW information 114 * HW information
115 */ 115 */
116 ah->ah_op_mode = NL80211_IFTYPE_STATION;
117 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT; 116 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT;
118 ah->ah_turbo = false; 117 ah->ah_turbo = false;
119 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; 118 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
@@ -328,7 +327,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
328 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */ 327 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */
329 memcpy(common->curbssid, ath_bcast_mac, ETH_ALEN); 328 memcpy(common->curbssid, ath_bcast_mac, ETH_ALEN);
330 ath5k_hw_set_associd(ah); 329 ath5k_hw_set_associd(ah);
331 ath5k_hw_set_opmode(ah); 330 ath5k_hw_set_opmode(ah, sc->opmode);
332 331
333 ath5k_hw_rfgain_opt_init(ah); 332 ath5k_hw_rfgain_opt_init(ah);
334 333
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index fdf3190e4611..79922cfd96b8 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1137,8 +1137,6 @@ ath5k_mode_setup(struct ath5k_softc *sc)
1137 struct ath5k_hw *ah = sc->ah; 1137 struct ath5k_hw *ah = sc->ah;
1138 u32 rfilt; 1138 u32 rfilt;
1139 1139
1140 ah->ah_op_mode = sc->opmode;
1141
1142 /* configure rx filter */ 1140 /* configure rx filter */
1143 rfilt = sc->filter_flags; 1141 rfilt = sc->filter_flags;
1144 ath5k_hw_set_rx_filter(ah, rfilt); 1142 ath5k_hw_set_rx_filter(ah, rfilt);
@@ -1147,8 +1145,9 @@ ath5k_mode_setup(struct ath5k_softc *sc)
1147 ath5k_hw_set_bssid_mask(ah, sc->bssidmask); 1145 ath5k_hw_set_bssid_mask(ah, sc->bssidmask);
1148 1146
1149 /* configure operational mode */ 1147 /* configure operational mode */
1150 ath5k_hw_set_opmode(ah); 1148 ath5k_hw_set_opmode(ah, sc->opmode);
1151 1149
1150 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d\n", sc->opmode);
1152 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt); 1151 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt);
1153} 1152}
1154 1153
@@ -2901,6 +2900,8 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2901 goto end; 2900 goto end;
2902 } 2901 }
2903 2902
2903 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "add interface mode %d\n", sc->opmode);
2904
2904 ath5k_hw_set_lladdr(sc->ah, vif->addr); 2905 ath5k_hw_set_lladdr(sc->ah, vif->addr);
2905 ath5k_mode_setup(sc); 2906 ath5k_mode_setup(sc);
2906 2907
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index be69ebb2744e..c813046b3540 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -39,16 +39,16 @@
39 * ath5k_hw_set_opmode - Set PCU operating mode 39 * ath5k_hw_set_opmode - Set PCU operating mode
40 * 40 *
41 * @ah: The &struct ath5k_hw 41 * @ah: The &struct ath5k_hw
42 * @op_mode: &enum nl80211_iftype operating mode
42 * 43 *
43 * Initialize PCU for the various operating modes (AP/STA etc) 44 * Initialize PCU for the various operating modes (AP/STA etc)
44 *
45 * NOTE: ah->ah_op_mode must be set before calling this.
46 */ 45 */
47int ath5k_hw_set_opmode(struct ath5k_hw *ah) 46int ath5k_hw_set_opmode(struct ath5k_hw *ah, enum nl80211_iftype op_mode)
48{ 47{
49 struct ath_common *common = ath5k_hw_common(ah); 48 struct ath_common *common = ath5k_hw_common(ah);
50 u32 pcu_reg, beacon_reg, low_id, high_id; 49 u32 pcu_reg, beacon_reg, low_id, high_id;
51 50
51 ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_MODE, "mode %d\n", op_mode);
52 52
53 /* Preserve rest settings */ 53 /* Preserve rest settings */
54 pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000; 54 pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
@@ -61,7 +61,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
61 61
62 ATH5K_TRACE(ah->ah_sc); 62 ATH5K_TRACE(ah->ah_sc);
63 63
64 switch (ah->ah_op_mode) { 64 switch (op_mode) {
65 case NL80211_IFTYPE_ADHOC: 65 case NL80211_IFTYPE_ADHOC:
66 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_KEYSRCH_MODE; 66 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_KEYSRCH_MODE;
67 beacon_reg |= AR5K_BCR_ADHOC; 67 beacon_reg |= AR5K_BCR_ADHOC;
@@ -644,7 +644,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
644 /* 644 /*
645 * Set the additional timers by mode 645 * Set the additional timers by mode
646 */ 646 */
647 switch (ah->ah_op_mode) { 647 switch (ah->ah_sc->opmode) {
648 case NL80211_IFTYPE_MONITOR: 648 case NL80211_IFTYPE_MONITOR:
649 case NL80211_IFTYPE_STATION: 649 case NL80211_IFTYPE_STATION:
650 /* In STA mode timer1 is used as next wakeup 650 /* In STA mode timer1 is used as next wakeup
@@ -681,8 +681,8 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
681 * Set the beacon register and enable all timers. 681 * Set the beacon register and enable all timers.
682 */ 682 */
683 /* When in AP or Mesh Point mode zero timer0 to start TSF */ 683 /* When in AP or Mesh Point mode zero timer0 to start TSF */
684 if (ah->ah_op_mode == NL80211_IFTYPE_AP || 684 if (ah->ah_sc->opmode == NL80211_IFTYPE_AP ||
685 ah->ah_op_mode == NL80211_IFTYPE_MESH_POINT) 685 ah->ah_sc->opmode == NL80211_IFTYPE_MESH_POINT)
686 ath5k_hw_reg_write(ah, 0, AR5K_TIMER0); 686 ath5k_hw_reg_write(ah, 0, AR5K_TIMER0);
687 687
688 ath5k_hw_reg_write(ah, next_beacon, AR5K_TIMER0); 688 ath5k_hw_reg_write(ah, next_beacon, AR5K_TIMER0);
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index 8bd62c130b26..4120068792ec 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -1033,11 +1033,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
1033 if (ret) 1033 if (ret)
1034 return ret; 1034 return ret;
1035 1035
1036 /*
1037 * Initialize operating mode
1038 */
1039 ah->ah_op_mode = op_mode;
1040
1041 /* PHY access enable */ 1036 /* PHY access enable */
1042 if (ah->ah_mac_srev >= AR5K_SREV_AR5211) 1037 if (ah->ah_mac_srev >= AR5K_SREV_AR5211)
1043 ath5k_hw_reg_write(ah, AR5K_PHY_SHIFT_5GHZ, AR5K_PHY(0)); 1038 ath5k_hw_reg_write(ah, AR5K_PHY_SHIFT_5GHZ, AR5K_PHY(0));
@@ -1208,7 +1203,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
1208 ath5k_hw_set_associd(ah); 1203 ath5k_hw_set_associd(ah);
1209 1204
1210 /* Set PCU config */ 1205 /* Set PCU config */
1211 ath5k_hw_set_opmode(ah); 1206 ath5k_hw_set_opmode(ah, op_mode);
1212 1207
1213 /* Clear any pending interrupts 1208 /* Clear any pending interrupts
1214 * PISR/SISR Not available on 5210 */ 1209 * PISR/SISR Not available on 5210 */
@@ -1394,7 +1389,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
1394 * external 32KHz crystal when sleeping if one 1389 * external 32KHz crystal when sleeping if one
1395 * exists */ 1390 * exists */
1396 if (ah->ah_version == AR5K_AR5212 && 1391 if (ah->ah_version == AR5K_AR5212 &&
1397 ah->ah_op_mode != NL80211_IFTYPE_AP) 1392 op_mode != NL80211_IFTYPE_AP)
1398 ath5k_hw_set_sleep_clock(ah, true); 1393 ath5k_hw_set_sleep_clock(ah, true);
1399 1394
1400 /* 1395 /*