diff options
author | Guy Cohen <guy.cohen@intel.com> | 2008-04-23 20:14:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:18 -0400 |
commit | 39e885049d9d5e6a65bb2543f82e136c02c253b5 (patch) | |
tree | 86edc7552e5b0ad423845f0ec91b6cd809460e67 /drivers/net/wireless/iwlwifi/iwl4965-base.c | |
parent | 399f490067992715044cbf2be1923e2f613b2e18 (diff) |
iwlwifi: TLC modifications
1. Merge TLC fixes from AP support code
2. Remove struct iwl4965_rate
3. Misc code restructuring
Signed-off-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 783f722f3c35..3452cc662429 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1073,17 +1073,29 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, | |||
1073 | return priv->ibss_beacon->len; | 1073 | return priv->ibss_beacon->len; |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | static u8 iwl4965_rate_get_lowest_plcp(int rate_mask) | 1076 | static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv) |
1077 | { | 1077 | { |
1078 | u8 i; | 1078 | int i; |
1079 | int rate_mask; | ||
1080 | |||
1081 | /* Set rate mask*/ | ||
1082 | if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) | ||
1083 | rate_mask = priv->active_rate_basic & 0xF; | ||
1084 | else | ||
1085 | rate_mask = priv->active_rate_basic & 0xFF0; | ||
1079 | 1086 | ||
1087 | /* Find lowest valid rate */ | ||
1080 | for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID; | 1088 | for (i = IWL_RATE_1M_INDEX; i != IWL_RATE_INVALID; |
1081 | i = iwl4965_rates[i].next_ieee) { | 1089 | i = iwl4965_rates[i].next_ieee) { |
1082 | if (rate_mask & (1 << i)) | 1090 | if (rate_mask & (1 << i)) |
1083 | return iwl4965_rates[i].plcp; | 1091 | return iwl4965_rates[i].plcp; |
1084 | } | 1092 | } |
1085 | 1093 | ||
1086 | return IWL_RATE_INVALID; | 1094 | /* No valid rate was found. Assign the lowest one */ |
1095 | if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) | ||
1096 | return IWL_RATE_1M_PLCP; | ||
1097 | else | ||
1098 | return IWL_RATE_6M_PLCP; | ||
1087 | } | 1099 | } |
1088 | 1100 | ||
1089 | static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) | 1101 | static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) |
@@ -1101,16 +1113,7 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) | |||
1101 | return -ENOMEM; | 1113 | return -ENOMEM; |
1102 | } | 1114 | } |
1103 | 1115 | ||
1104 | if (!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK)) { | 1116 | rate = iwl4965_rate_get_lowest_plcp(priv); |
1105 | rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic & | ||
1106 | 0xFF0); | ||
1107 | if (rate == IWL_INVALID_RATE) | ||
1108 | rate = IWL_RATE_6M_PLCP; | ||
1109 | } else { | ||
1110 | rate = iwl4965_rate_get_lowest_plcp(priv->active_rate_basic & 0xF); | ||
1111 | if (rate == IWL_INVALID_RATE) | ||
1112 | rate = IWL_RATE_1M_PLCP; | ||
1113 | } | ||
1114 | 1117 | ||
1115 | frame_size = iwl4965_hw_get_beacon_cmd(priv, frame, rate); | 1118 | frame_size = iwl4965_hw_get_beacon_cmd(priv, frame, rate); |
1116 | 1119 | ||