aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-20 12:10:39 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-04-30 11:40:14 -0400
commitd2690c0db7146b12e4fc2d572053c823e512758a (patch)
treefc8254556fa4adb4f737a3b5f41f346fe2fa90d3
parentc1821c95c13240c2c8d3da8845c2021e575e29c6 (diff)
iwlagn: use proper good CRC threshold behaviour
New microcode versions use the good CRC threshold field differently, as a flag, and in that case we should set it to 1/0 instead of 1/65535 for an active/passive scan. The new behaviour is advertised by the uCode with a feature flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h7
3 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 75e1035330be..7fe9e0f17b1e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1294,9 +1294,17 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1294 * mean we never reach it, but at the same time work around 1294 * mean we never reach it, but at the same time work around
1295 * the aforementioned issue. Thus use IWL_GOOD_CRC_TH_NEVER 1295 * the aforementioned issue. Thus use IWL_GOOD_CRC_TH_NEVER
1296 * here instead of IWL_GOOD_CRC_TH_DISABLED. 1296 * here instead of IWL_GOOD_CRC_TH_DISABLED.
1297 *
1298 * This was fixed in later versions along with some other
1299 * scan changes, and the threshold behaves as a flag in those
1300 * versions.
1297 */ 1301 */
1298 scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : 1302 if (priv->new_scan_threshold_behaviour)
1299 IWL_GOOD_CRC_TH_NEVER; 1303 scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT :
1304 IWL_GOOD_CRC_TH_DISABLED;
1305 else
1306 scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT :
1307 IWL_GOOD_CRC_TH_NEVER;
1300 1308
1301 band = priv->scan_band; 1309 band = priv->scan_band;
1302 1310
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c27147c4d4a7..395d1ade39d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1716,6 +1716,9 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1716 priv->cfg->base_params->max_event_log_size; 1716 priv->cfg->base_params->max_event_log_size;
1717 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr; 1717 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr;
1718 1718
1719 priv->new_scan_threshold_behaviour =
1720 !!(ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);
1721
1719 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { 1722 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) {
1720 priv->valid_contexts |= BIT(IWL_RXON_CTX_PAN); 1723 priv->valid_contexts |= BIT(IWL_RXON_CTX_PAN);
1721 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; 1724 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 197fa742f79a..f098eff263f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -547,12 +547,13 @@ enum iwl_ucode_tlv_type {
547 * enum iwl_ucode_tlv_flag - ucode API flags 547 * enum iwl_ucode_tlv_flag - ucode API flags
548 * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously 548 * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
549 * was a separate TLV but moved here to save space. 549 * was a separate TLV but moved here to save space.
550 * @IWL_UCODE_TLV_FLAGS_RESERVED_1: reserved 550 * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID,
551 * treats good CRC threshold as a boolean
551 * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). 552 * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
552 */ 553 */
553enum iwl_ucode_tlv_flag { 554enum iwl_ucode_tlv_flag {
554 IWL_UCODE_TLV_FLAGS_PAN = BIT(0), 555 IWL_UCODE_TLV_FLAGS_PAN = BIT(0),
555 IWL_UCODE_TLV_FLAGS_RESERVED_1 = BIT(1), 556 IWL_UCODE_TLV_FLAGS_NEWSCAN = BIT(1),
556 IWL_UCODE_TLV_FLAGS_MFP = BIT(2), 557 IWL_UCODE_TLV_FLAGS_MFP = BIT(2),
557}; 558};
558 559
@@ -1263,6 +1264,8 @@ struct iwl_priv {
1263 /* max number of station keys */ 1264 /* max number of station keys */
1264 u8 sta_key_max_num; 1265 u8 sta_key_max_num;
1265 1266
1267 bool new_scan_threshold_behaviour;
1268
1266 /* EEPROM MAC addresses */ 1269 /* EEPROM MAC addresses */
1267 struct mac_address addresses[2]; 1270 struct mac_address addresses[2];
1268 1271