aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Rindjunsky <ron.rindjunsky@intel.com>2008-04-21 18:41:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:15 -0400
commit099b40b743df80372236ba1df9796f59ba297b1d (patch)
treee11a14801bafcf447ff24368e4bf2d370fb167b5
parent073d3f5f1b3b6512eb82a3d40c84dedb14dc6f73 (diff)
iwlwifi: expanding HW parameters control
This patch adds several parameters to priv.hw_params, for better control over HW capabilities variants Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h25
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c14
4 files changed, 42 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 855a006c5e5b..0c132b93d903 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -134,10 +134,8 @@
134#define RTC_DATA_LOWER_BOUND (0x800000) 134#define RTC_DATA_LOWER_BOUND (0x800000)
135#define IWL49_RTC_DATA_UPPER_BOUND (0x80A000) 135#define IWL49_RTC_DATA_UPPER_BOUND (0x80A000)
136 136
137#define IWL49_RTC_INST_SIZE \ 137#define IWL49_RTC_INST_SIZE (IWL49_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
138 (IWL49_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND) 138#define IWL49_RTC_DATA_SIZE (IWL49_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
139#define IWL49_RTC_DATA_SIZE \
140 (IWL49_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
141 139
142#define IWL_MAX_INST_SIZE IWL49_RTC_INST_SIZE 140#define IWL_MAX_INST_SIZE IWL49_RTC_INST_SIZE
143#define IWL_MAX_DATA_SIZE IWL49_RTC_DATA_SIZE 141#define IWL_MAX_DATA_SIZE IWL49_RTC_DATA_SIZE
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 7886596b62c7..9b3a745b66b7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -999,7 +999,8 @@ void iwl4965_rf_kill_ct_config(struct iwl_priv *priv)
999 temp_th = CELSIUS_TO_KELVIN(TM_CT_KILL_THRESHOLD); 999 temp_th = CELSIUS_TO_KELVIN(TM_CT_KILL_THRESHOLD);
1000 1000
1001 crit_temperature = ((temp_th * (R3-R1))/CT_LIMIT_CONST) + R2; 1001 crit_temperature = ((temp_th * (R3-R1))/CT_LIMIT_CONST) + R2;
1002 cmd.critical_temperature_R = cpu_to_le32(crit_temperature); 1002 cmd.critical_temperature_R =
1003 cpu_to_le32(priv->hw_params.ct_kill_threshold);
1003 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, 1004 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD,
1004 sizeof(cmd), &cmd); 1005 sizeof(cmd), &cmd);
1005 if (ret) 1006 if (ret)
@@ -1340,6 +1341,7 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
1340 } 1341 }
1341 1342
1342 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; 1343 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
1344 priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
1343 priv->hw_params.tx_cmd_len = sizeof(struct iwl4965_tx_cmd); 1345 priv->hw_params.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
1344 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; 1346 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
1345 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG; 1347 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
@@ -1351,10 +1353,17 @@ int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
1351 priv->hw_params.max_stations = IWL4965_STATION_COUNT; 1353 priv->hw_params.max_stations = IWL4965_STATION_COUNT;
1352 priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID; 1354 priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID;
1353 1355
1356 priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE;
1357 priv->hw_params.max_inst_size = IWL49_RTC_INST_SIZE;
1358 priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
1359 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_5GHZ);
1360
1354 priv->hw_params.tx_chains_num = 2; 1361 priv->hw_params.tx_chains_num = 2;
1355 priv->hw_params.rx_chains_num = 2; 1362 priv->hw_params.rx_chains_num = 2;
1356 priv->hw_params.valid_tx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX); 1363 priv->hw_params.valid_tx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX);
1357 priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX); 1364 priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN | IWL_ANTENNA_AUX);
1365 priv->hw_params.ct_kill_threshold = CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD);
1366
1358#ifdef CONFIG_IWL4965_RUN_TIME_CALIB 1367#ifdef CONFIG_IWL4965_RUN_TIME_CALIB
1359 priv->hw_params.sens = &iwl4965_sensitivity; 1368 priv->hw_params.sens = &iwl4965_sensitivity;
1360#endif 1369#endif
@@ -3064,7 +3073,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
3064 hdr = (struct ieee80211_hdr *)rxb->skb->data; 3073 hdr = (struct ieee80211_hdr *)rxb->skb->data;
3065 3074
3066 /* in case of HW accelerated crypto and bad decryption, drop */ 3075 /* in case of HW accelerated crypto and bad decryption, drop */
3067 if (!priv->cfg->mod_params->sw_crypto && 3076 if (!priv->hw_params.sw_crypto &&
3068 iwl4965_set_decrypted_flag(priv, hdr, ampdu_status, stats)) 3077 iwl4965_set_decrypted_flag(priv, hdr, ampdu_status, stats))
3069 return; 3078 return;
3070 3079
@@ -3122,7 +3131,7 @@ void iwl4965_init_ht_hw_capab(struct iwl_priv *priv,
3122 3131
3123 ht_info->ht_supported = 1; 3132 ht_info->ht_supported = 1;
3124 3133
3125 if (band == IEEE80211_BAND_5GHZ) { 3134 if (priv->hw_params.fat_channel & BIT(band)) {
3126 ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH; 3135 ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH;
3127 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40; 3136 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40;
3128 ht_info->supp_mcs_set[4] = 0x01; 3137 ht_info->supp_mcs_set[4] = 0x01;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index 35a67cdf707c..31f5447b797e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -55,6 +55,8 @@ extern struct iwl_cfg iwl4965_agn_cfg;
55 * This number will also appear in << 8 position of 1st dword of uCode file */ 55 * This number will also appear in << 8 position of 1st dword of uCode file */
56#define IWL4965_UCODE_API "-1" 56#define IWL4965_UCODE_API "-1"
57 57
58/* CT-KILL constants */
59#define CT_KILL_THRESHOLD 110 /* in Celsius */
58 60
59/* Default noise level to report when noise measurement is not available. 61/* Default noise level to report when noise measurement is not available.
60 * This may be because we're: 62 * This may be because we're:
@@ -570,16 +572,25 @@ struct iwl_sensitivity_ranges {
570 u16 auto_corr_min_cck_mrc; 572 u16 auto_corr_min_cck_mrc;
571}; 573};
572 574
575
576#define IWL_FAT_CHANNEL_52 BIT(IEEE80211_BAND_5GHZ)
577
573/** 578/**
574 * struct iwl_hw_params 579 * struct iwl_hw_params
575 * @max_txq_num: Max # Tx queues supported 580 * @max_txq_num: Max # Tx queues supported
576 * @tx_cmd_len: Size of Tx command (but not including frame itself) 581 * @tx_cmd_len: Size of Tx command (but not including frame itself)
577 * @tx_ant_num: Number of TX antennas 582 * @tx/rx_chains_num: Number of TX/RX chains
583 * @valid_tx/rx_ant: usable antennas
578 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2) 584 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
579 * @rx_buffer_size:
580 * @max_rxq_log: Log-base-2 of max_rxq_size 585 * @max_rxq_log: Log-base-2 of max_rxq_size
586 * @rx_buf_size: Rx buffer size
581 * @max_stations: 587 * @max_stations:
582 * @bcast_sta_id: 588 * @bcast_sta_id:
589 * @fat_channel: is 40MHz width possible in band 2.4
590 * BIT(IEEE80211_BAND_5GHZ) BIT(IEEE80211_BAND_5GHZ)
591 * @sw_crypto: 0 for hw, 1 for sw
592 * @max_xxx_size: for ucode uses
593 * @ct_kill_threshold: temperature threshold
583 * @struct iwl_sensitivity_ranges: range of sensitivity values 594 * @struct iwl_sensitivity_ranges: range of sensitivity values
584 */ 595 */
585struct iwl_hw_params { 596struct iwl_hw_params {
@@ -595,13 +606,19 @@ struct iwl_hw_params {
595 u32 max_pkt_size; 606 u32 max_pkt_size;
596 u8 max_stations; 607 u8 max_stations;
597 u8 bcast_sta_id; 608 u8 bcast_sta_id;
609 u8 fat_channel;
610 u8 sw_crypto;
611 u32 max_inst_size;
612 u32 max_data_size;
613 u32 max_bsm_size;
614 u32 ct_kill_threshold; /* value in hw-dependent units */
598#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB 615#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB
599 const struct iwl_sensitivity_ranges *sens; 616 const struct iwl_sensitivity_ranges *sens;
600#endif 617#endif
601}; 618};
602 619
603#define HT_SHORT_GI_20MHZ_ONLY (1 << 0) 620#define HT_SHORT_GI_20MHZ_ONLY (1 << 0)
604#define HT_SHORT_GI_40MHZ_ONLY (1 << 1) 621#define HT_SHORT_GI_40MHZ_ONLY (1 << 1)
605 622
606 623
607#define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\ 624#define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index c5ac82c4aeb4..b223087b0876 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -828,7 +828,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
828 le16_to_cpu(priv->staging_rxon.channel), 828 le16_to_cpu(priv->staging_rxon.channel),
829 print_mac(mac, priv->staging_rxon.bssid_addr)); 829 print_mac(mac, priv->staging_rxon.bssid_addr));
830 830
831 iwl4965_set_rxon_hwcrypto(priv, !priv->cfg->mod_params->sw_crypto); 831 iwl4965_set_rxon_hwcrypto(priv, !priv->hw_params.sw_crypto);
832 /* Apply the new configuration */ 832 /* Apply the new configuration */
833 rc = iwl_send_cmd_pdu(priv, REPLY_RXON, 833 rc = iwl_send_cmd_pdu(priv, REPLY_RXON,
834 sizeof(struct iwl4965_rxon_cmd), &priv->staging_rxon); 834 sizeof(struct iwl4965_rxon_cmd), &priv->staging_rxon);
@@ -4855,34 +4855,34 @@ static int iwl4965_read_ucode(struct iwl_priv *priv)
4855 } 4855 }
4856 4856
4857 /* Verify that uCode images will fit in card's SRAM */ 4857 /* Verify that uCode images will fit in card's SRAM */
4858 if (inst_size > IWL_MAX_INST_SIZE) { 4858 if (inst_size > priv->hw_params.max_inst_size) {
4859 IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n", 4859 IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n",
4860 inst_size); 4860 inst_size);
4861 ret = -EINVAL; 4861 ret = -EINVAL;
4862 goto err_release; 4862 goto err_release;
4863 } 4863 }
4864 4864
4865 if (data_size > IWL_MAX_DATA_SIZE) { 4865 if (data_size > priv->hw_params.max_data_size) {
4866 IWL_DEBUG_INFO("uCode data len %d too large to fit in\n", 4866 IWL_DEBUG_INFO("uCode data len %d too large to fit in\n",
4867 data_size); 4867 data_size);
4868 ret = -EINVAL; 4868 ret = -EINVAL;
4869 goto err_release; 4869 goto err_release;
4870 } 4870 }
4871 if (init_size > IWL_MAX_INST_SIZE) { 4871 if (init_size > priv->hw_params.max_inst_size) {
4872 IWL_DEBUG_INFO 4872 IWL_DEBUG_INFO
4873 ("uCode init instr len %d too large to fit in\n", 4873 ("uCode init instr len %d too large to fit in\n",
4874 init_size); 4874 init_size);
4875 ret = -EINVAL; 4875 ret = -EINVAL;
4876 goto err_release; 4876 goto err_release;
4877 } 4877 }
4878 if (init_data_size > IWL_MAX_DATA_SIZE) { 4878 if (init_data_size > priv->hw_params.max_data_size) {
4879 IWL_DEBUG_INFO 4879 IWL_DEBUG_INFO
4880 ("uCode init data len %d too large to fit in\n", 4880 ("uCode init data len %d too large to fit in\n",
4881 init_data_size); 4881 init_data_size);
4882 ret = -EINVAL; 4882 ret = -EINVAL;
4883 goto err_release; 4883 goto err_release;
4884 } 4884 }
4885 if (boot_size > IWL_MAX_BSM_SIZE) { 4885 if (boot_size > priv->hw_params.max_bsm_size) {
4886 IWL_DEBUG_INFO 4886 IWL_DEBUG_INFO
4887 ("uCode boot instr len %d too large to fit in\n", 4887 ("uCode boot instr len %d too large to fit in\n",
4888 boot_size); 4888 boot_size);
@@ -6606,7 +6606,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
6606 6606
6607 IWL_DEBUG_MAC80211("enter\n"); 6607 IWL_DEBUG_MAC80211("enter\n");
6608 6608
6609 if (priv->cfg->mod_params->sw_crypto) { 6609 if (priv->hw_params.sw_crypto) {
6610 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); 6610 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n");
6611 return -EOPNOTSUPP; 6611 return -EOPNOTSUPP;
6612 } 6612 }