aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-06 11:10:00 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-06 11:10:00 -0400
commit7cb1b0887fcc61918e3d64827fbef968bb67a57a (patch)
treefa9103423af207c68be604523b3a362e1a6c3e14 /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parent72645eff4b2ad6cf2b016b54f9d6817cca0a621d (diff)
iwlagn: reduce redundant parameter definitions
move paramater definitions to a device paramater structure only leaving the device name, which antennas are used and what firmware file to use in the iwl_cfg structure. this will not completely remove the redundancies but greatly reduce them for devices that only vary by name or antennas. the parameters that are more likely to change within a given device family are left in iwl_cfg. also separate bt param structure added to help reduce more. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 299fd9d5960..29ed6049c0f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -422,7 +422,8 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,
422 * notification again. 422 * notification again.
423 */ 423 */
424 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 && 424 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 &&
425 priv->cfg->advanced_bt_coexist) { 425 priv->cfg->bt_params &&
426 priv->cfg->bt_params->advanced_bt_coexist) {
426 IWL_WARN(priv, "receive reply tx with bt_kill\n"); 427 IWL_WARN(priv, "receive reply tx with bt_kill\n");
427 } 428 }
428 iwlagn_tx_status_reply_tx(priv, agg, tx_resp, txq_id, index); 429 iwlagn_tx_status_reply_tx(priv, agg, tx_resp, txq_id, index);
@@ -589,7 +590,7 @@ const u8 *iwlagn_eeprom_query_addr(const struct iwl_priv *priv,
589 size_t offset) 590 size_t offset)
590{ 591{
591 u32 address = eeprom_indirect_address(priv, offset); 592 u32 address = eeprom_indirect_address(priv, offset);
592 BUG_ON(address >= priv->cfg->eeprom_size); 593 BUG_ON(address >= priv->cfg->base_params->eeprom_size);
593 return &priv->eeprom[address]; 594 return &priv->eeprom[address];
594} 595}
595 596
@@ -637,7 +638,7 @@ int iwlagn_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
637 const u32 rfdnlog = RX_QUEUE_SIZE_LOG; /* 256 RBDs */ 638 const u32 rfdnlog = RX_QUEUE_SIZE_LOG; /* 256 RBDs */
638 u32 rb_timeout = 0; /* FIXME: RX_RB_TIMEOUT for all devices? */ 639 u32 rb_timeout = 0; /* FIXME: RX_RB_TIMEOUT for all devices? */
639 640
640 if (!priv->cfg->use_isr_legacy) 641 if (!priv->cfg->base_params->use_isr_legacy)
641 rb_timeout = RX_RB_TIMEOUT; 642 rb_timeout = RX_RB_TIMEOUT;
642 643
643 if (priv->cfg->mod_params->amsdu_size_8K) 644 if (priv->cfg->mod_params->amsdu_size_8K)
@@ -1424,7 +1425,8 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1424 * Internal scans are passive, so we can indiscriminately set 1425 * Internal scans are passive, so we can indiscriminately set
1425 * the BT ignore flag on 2.4 GHz since it applies to TX only. 1426 * the BT ignore flag on 2.4 GHz since it applies to TX only.
1426 */ 1427 */
1427 if (priv->cfg->advanced_bt_coexist) 1428 if (priv->cfg->bt_params &&
1429 priv->cfg->bt_params->advanced_bt_coexist)
1428 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT; 1430 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT;
1429 scan->good_CRC_th = IWL_GOOD_CRC_TH_DISABLED; 1431 scan->good_CRC_th = IWL_GOOD_CRC_TH_DISABLED;
1430 break; 1432 break;
@@ -1463,10 +1465,12 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1463 if (priv->cfg->scan_tx_antennas[band]) 1465 if (priv->cfg->scan_tx_antennas[band])
1464 scan_tx_antennas = priv->cfg->scan_tx_antennas[band]; 1466 scan_tx_antennas = priv->cfg->scan_tx_antennas[band];
1465 1467
1466 if (priv->cfg->advanced_bt_coexist && priv->bt_full_concurrent) { 1468 if (priv->cfg->bt_params &&
1469 priv->cfg->bt_params->advanced_bt_coexist &&
1470 priv->bt_full_concurrent) {
1467 /* operated as 1x1 in full concurrency mode */ 1471 /* operated as 1x1 in full concurrency mode */
1468 scan_tx_antennas = 1472 scan_tx_antennas = first_antenna(
1469 first_antenna(priv->cfg->scan_tx_antennas[band]); 1473 priv->cfg->scan_tx_antennas[band]);
1470 } 1474 }
1471 1475
1472 priv->scan_tx_ant[band] = iwl_toggle_tx_ant(priv, priv->scan_tx_ant[band], 1476 priv->scan_tx_ant[band] = iwl_toggle_tx_ant(priv, priv->scan_tx_ant[band],
@@ -1487,7 +1491,9 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1487 1491
1488 rx_ant = first_antenna(active_chains); 1492 rx_ant = first_antenna(active_chains);
1489 } 1493 }
1490 if (priv->cfg->advanced_bt_coexist && priv->bt_full_concurrent) { 1494 if (priv->cfg->bt_params &&
1495 priv->cfg->bt_params->advanced_bt_coexist &&
1496 priv->bt_full_concurrent) {
1491 /* operated as 1x1 in full concurrency mode */ 1497 /* operated as 1x1 in full concurrency mode */
1492 rx_ant = first_antenna(rx_ant); 1498 rx_ant = first_antenna(rx_ant);
1493 } 1499 }
@@ -1777,7 +1783,10 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
1777 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) != 1783 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
1778 sizeof(bt_cmd.bt3_lookup_table)); 1784 sizeof(bt_cmd.bt3_lookup_table));
1779 1785
1780 bt_cmd.prio_boost = priv->cfg->bt_prio_boost; 1786 if (priv->cfg->bt_params)
1787 bt_cmd.prio_boost = priv->cfg->bt_params->bt_prio_boost;
1788 else
1789 bt_cmd.prio_boost = 0;
1781 bt_cmd.kill_ack_mask = priv->kill_ack_mask; 1790 bt_cmd.kill_ack_mask = priv->kill_ack_mask;
1782 bt_cmd.kill_cts_mask = priv->kill_cts_mask; 1791 bt_cmd.kill_cts_mask = priv->kill_cts_mask;
1783 bt_cmd.valid = priv->bt_valid; 1792 bt_cmd.valid = priv->bt_valid;