aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/pcu.c
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 14:09:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:35 -0500
commit3017fcab416d8d1ee48ca16aa9a3062f600dab8e (patch)
tree8f6daedc2060c20a0a1a569e8e782991cd28f2a6 /drivers/net/wireless/ath/ath5k/pcu.c
parent25ddfa195735934256fda55bb4f2d749c19386ff (diff)
ath5k: Extend get_default_sifs/slot_time
* Extend get_default_sifs/slot_time to include timings for turbo half and quarter rate modes. * AR5210 code for now uses timings already on core clock units instead of usecs so rename them (we 'll clean it up later). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/pcu.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/pcu.c52
1 files changed, 39 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index 2c2ea1539849..2118f7048f37 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -43,14 +43,27 @@
43static unsigned int ath5k_hw_get_default_slottime(struct ath5k_hw *ah) 43static unsigned int ath5k_hw_get_default_slottime(struct ath5k_hw *ah)
44{ 44{
45 struct ieee80211_channel *channel = ah->ah_current_channel; 45 struct ieee80211_channel *channel = ah->ah_current_channel;
46 unsigned int slot_time;
46 47
47 if (channel->hw_value & CHANNEL_TURBO) 48 switch (ah->ah_bwmode) {
48 return 6; /* both turbo modes */ 49 case AR5K_BWMODE_40MHZ:
49 50 slot_time = AR5K_INIT_SLOT_TIME_TURBO;
50 if (channel->hw_value & CHANNEL_CCK) 51 break;
51 return 20; /* 802.11b */ 52 case AR5K_BWMODE_10MHZ:
53 slot_time = AR5K_INIT_SLOT_TIME_HALF_RATE;
54 break;
55 case AR5K_BWMODE_5MHZ:
56 slot_time = AR5K_INIT_SLOT_TIME_QUARTER_RATE;
57 break;
58 case AR5K_BWMODE_DEFAULT:
59 slot_time = AR5K_INIT_SLOT_TIME_DEFAULT;
60 default:
61 if (channel->hw_value & CHANNEL_CCK)
62 slot_time = AR5K_INIT_SLOT_TIME_B;
63 break;
64 }
52 65
53 return 9; /* 802.11 a/g */ 66 return slot_time;
54} 67}
55 68
56/** 69/**
@@ -58,17 +71,30 @@ static unsigned int ath5k_hw_get_default_slottime(struct ath5k_hw *ah)
58 * 71 *
59 * @ah: The &struct ath5k_hw 72 * @ah: The &struct ath5k_hw
60 */ 73 */
61static unsigned int ath5k_hw_get_default_sifs(struct ath5k_hw *ah) 74unsigned int ath5k_hw_get_default_sifs(struct ath5k_hw *ah)
62{ 75{
63 struct ieee80211_channel *channel = ah->ah_current_channel; 76 struct ieee80211_channel *channel = ah->ah_current_channel;
77 unsigned int sifs;
64 78
65 if (channel->hw_value & CHANNEL_TURBO) 79 switch (ah->ah_bwmode) {
66 return 8; /* both turbo modes */ 80 case AR5K_BWMODE_40MHZ:
67 81 sifs = AR5K_INIT_SIFS_TURBO;
68 if (channel->hw_value & CHANNEL_5GHZ) 82 break;
69 return 16; /* 802.11a */ 83 case AR5K_BWMODE_10MHZ:
84 sifs = AR5K_INIT_SIFS_HALF_RATE;
85 break;
86 case AR5K_BWMODE_5MHZ:
87 sifs = AR5K_INIT_SIFS_QUARTER_RATE;
88 break;
89 case AR5K_BWMODE_DEFAULT:
90 sifs = AR5K_INIT_SIFS_DEFAULT_BG;
91 default:
92 if (channel->hw_value & CHANNEL_5GHZ)
93 sifs = AR5K_INIT_SIFS_DEFAULT_A;
94 break;
95 }
70 96
71 return 10; /* 802.11 b/g */ 97 return sifs;
72} 98}
73 99
74/** 100/**