aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c62
1 files changed, 19 insertions, 43 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 89aba76e4a2c..2e3cda75f3ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -46,6 +46,7 @@
46#include "iwl-calib.h" 46#include "iwl-calib.h"
47#include "iwl-sta.h" 47#include "iwl-sta.h"
48#include "iwl-agn-led.h" 48#include "iwl-agn-led.h"
49#include "iwl-agn.h"
49 50
50static int iwl4965_send_tx_power(struct iwl_priv *priv); 51static int iwl4965_send_tx_power(struct iwl_priv *priv);
51static int iwl4965_hw_get_temperature(struct iwl_priv *priv); 52static int iwl4965_hw_get_temperature(struct iwl_priv *priv);
@@ -60,14 +61,6 @@ static int iwl4965_hw_get_temperature(struct iwl_priv *priv);
60#define _IWL4965_MODULE_FIRMWARE(api) IWL4965_FW_PRE #api ".ucode" 61#define _IWL4965_MODULE_FIRMWARE(api) IWL4965_FW_PRE #api ".ucode"
61#define IWL4965_MODULE_FIRMWARE(api) _IWL4965_MODULE_FIRMWARE(api) 62#define IWL4965_MODULE_FIRMWARE(api) _IWL4965_MODULE_FIRMWARE(api)
62 63
63
64/* module parameters */
65static struct iwl_mod_params iwl4965_mod_params = {
66 .amsdu_size_8K = 1,
67 .restart_fw = 1,
68 /* the rest are 0 by default */
69};
70
71/* check contents of special bootstrap uCode SRAM */ 64/* check contents of special bootstrap uCode SRAM */
72static int iwl4965_verify_bsm(struct iwl_priv *priv) 65static int iwl4965_verify_bsm(struct iwl_priv *priv)
73{ 66{
@@ -417,7 +410,7 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
417 sizeof(cmd), &cmd); 410 sizeof(cmd), &cmd);
418 if (ret) 411 if (ret)
419 IWL_DEBUG_CALIB(priv, "fail sending cmd " 412 IWL_DEBUG_CALIB(priv, "fail sending cmd "
420 "REPLY_PHY_CALIBRATION_CMD \n"); 413 "REPLY_PHY_CALIBRATION_CMD\n");
421 414
422 /* TODO we might want recalculate 415 /* TODO we might want recalculate
423 * rx_chain in rxon cmd */ 416 * rx_chain in rxon cmd */
@@ -1619,19 +1612,19 @@ static int iwl4965_is_temp_calib_needed(struct iwl_priv *priv)
1619 1612
1620 /* get absolute value */ 1613 /* get absolute value */
1621 if (temp_diff < 0) { 1614 if (temp_diff < 0) {
1622 IWL_DEBUG_POWER(priv, "Getting cooler, delta %d, \n", temp_diff); 1615 IWL_DEBUG_POWER(priv, "Getting cooler, delta %d\n", temp_diff);
1623 temp_diff = -temp_diff; 1616 temp_diff = -temp_diff;
1624 } else if (temp_diff == 0) 1617 } else if (temp_diff == 0)
1625 IWL_DEBUG_POWER(priv, "Same temp, \n"); 1618 IWL_DEBUG_POWER(priv, "Temperature unchanged\n");
1626 else 1619 else
1627 IWL_DEBUG_POWER(priv, "Getting warmer, delta %d, \n", temp_diff); 1620 IWL_DEBUG_POWER(priv, "Getting warmer, delta %d\n", temp_diff);
1628 1621
1629 if (temp_diff < IWL_TEMPERATURE_THRESHOLD) { 1622 if (temp_diff < IWL_TEMPERATURE_THRESHOLD) {
1630 IWL_DEBUG_POWER(priv, "Thermal txpower calib not needed\n"); 1623 IWL_DEBUG_POWER(priv, " => thermal txpower calib not needed\n");
1631 return 0; 1624 return 0;
1632 } 1625 }
1633 1626
1634 IWL_DEBUG_POWER(priv, "Thermal txpower calib needed\n"); 1627 IWL_DEBUG_POWER(priv, " => thermal txpower calib needed\n");
1635 1628
1636 return 1; 1629 return 1;
1637} 1630}
@@ -1880,7 +1873,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
1880 info->status.rates[0].count = tx_resp->failure_frame + 1; 1873 info->status.rates[0].count = tx_resp->failure_frame + 1;
1881 info->flags &= ~IEEE80211_TX_CTL_AMPDU; 1874 info->flags &= ~IEEE80211_TX_CTL_AMPDU;
1882 info->flags |= iwl_tx_status_to_mac80211(status); 1875 info->flags |= iwl_tx_status_to_mac80211(status);
1883 iwl_hwrate_to_tx_control(priv, rate_n_flags, info); 1876 iwlagn_hwrate_to_tx_control(priv, rate_n_flags, info);
1884 /* FIXME: code repetition end */ 1877 /* FIXME: code repetition end */
1885 1878
1886 IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n", 1879 IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n",
@@ -2020,7 +2013,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2020 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); 2013 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
2021 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn " 2014 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
2022 "%d index %d\n", scd_ssn , index); 2015 "%d index %d\n", scd_ssn , index);
2023 freed = iwl_tx_queue_reclaim(priv, txq_id, index); 2016 freed = iwlagn_tx_queue_reclaim(priv, txq_id, index);
2024 if (qc) 2017 if (qc)
2025 iwl_free_tfds_in_queue(priv, sta_id, 2018 iwl_free_tfds_in_queue(priv, sta_id,
2026 tid, freed); 2019 tid, freed);
@@ -2037,7 +2030,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2037 } else { 2030 } else {
2038 info->status.rates[0].count = tx_resp->failure_frame + 1; 2031 info->status.rates[0].count = tx_resp->failure_frame + 1;
2039 info->flags |= iwl_tx_status_to_mac80211(status); 2032 info->flags |= iwl_tx_status_to_mac80211(status);
2040 iwl_hwrate_to_tx_control(priv, 2033 iwlagn_hwrate_to_tx_control(priv,
2041 le32_to_cpu(tx_resp->rate_n_flags), 2034 le32_to_cpu(tx_resp->rate_n_flags),
2042 info); 2035 info);
2043 2036
@@ -2048,7 +2041,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2048 le32_to_cpu(tx_resp->rate_n_flags), 2041 le32_to_cpu(tx_resp->rate_n_flags),
2049 tx_resp->failure_frame); 2042 tx_resp->failure_frame);
2050 2043
2051 freed = iwl_tx_queue_reclaim(priv, txq_id, index); 2044 freed = iwlagn_tx_queue_reclaim(priv, txq_id, index);
2052 if (qc && likely(sta_id != IWL_INVALID_STATION)) 2045 if (qc && likely(sta_id != IWL_INVALID_STATION))
2053 iwl_free_tfds_in_queue(priv, sta_id, tid, freed); 2046 iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
2054 else if (sta_id == IWL_INVALID_STATION) 2047 else if (sta_id == IWL_INVALID_STATION)
@@ -2059,10 +2052,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2059 iwl_wake_queue(priv, txq_id); 2052 iwl_wake_queue(priv, txq_id);
2060 } 2053 }
2061 if (qc && likely(sta_id != IWL_INVALID_STATION)) 2054 if (qc && likely(sta_id != IWL_INVALID_STATION))
2062 iwl_txq_check_empty(priv, sta_id, tid, txq_id); 2055 iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
2063 2056
2064 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 2057 iwl_check_abort_status(priv, tx_resp->frame_count, status);
2065 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
2066} 2058}
2067 2059
2068static int iwl4965_calc_rssi(struct iwl_priv *priv, 2060static int iwl4965_calc_rssi(struct iwl_priv *priv,
@@ -2096,7 +2088,7 @@ static int iwl4965_calc_rssi(struct iwl_priv *priv,
2096 2088
2097 /* dBm = max_rssi dB - agc dB - constant. 2089 /* dBm = max_rssi dB - agc dB - constant.
2098 * Higher AGC (higher radio gain) means lower signal. */ 2090 * Higher AGC (higher radio gain) means lower signal. */
2099 return max_rssi - agc - IWL49_RSSI_OFFSET; 2091 return max_rssi - agc - IWLAGN_RSSI_OFFSET;
2100} 2092}
2101 2093
2102 2094
@@ -2104,7 +2096,7 @@ static int iwl4965_calc_rssi(struct iwl_priv *priv,
2104static void iwl4965_rx_handler_setup(struct iwl_priv *priv) 2096static void iwl4965_rx_handler_setup(struct iwl_priv *priv)
2105{ 2097{
2106 /* Legacy Rx frames */ 2098 /* Legacy Rx frames */
2107 priv->rx_handlers[REPLY_RX] = iwl_rx_reply_rx; 2099 priv->rx_handlers[REPLY_RX] = iwlagn_rx_reply_rx;
2108 /* Tx response */ 2100 /* Tx response */
2109 priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx; 2101 priv->rx_handlers[REPLY_TX] = iwl4965_rx_reply_tx;
2110} 2102}
@@ -2247,7 +2239,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
2247 .ops = &iwl4965_ops, 2239 .ops = &iwl4965_ops,
2248 .num_of_queues = IWL49_NUM_QUEUES, 2240 .num_of_queues = IWL49_NUM_QUEUES,
2249 .num_of_ampdu_queues = IWL49_NUM_AMPDU_QUEUES, 2241 .num_of_ampdu_queues = IWL49_NUM_AMPDU_QUEUES,
2250 .mod_params = &iwl4965_mod_params, 2242 .mod_params = &iwlagn_mod_params,
2251 .valid_tx_ant = ANT_AB, 2243 .valid_tx_ant = ANT_AB,
2252 .valid_rx_ant = ANT_ABC, 2244 .valid_rx_ant = ANT_ABC,
2253 .pll_cfg_val = 0, 2245 .pll_cfg_val = 0,
@@ -2260,27 +2252,11 @@ struct iwl_cfg iwl4965_agn_cfg = {
2260 .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, 2252 .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS,
2261 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, 2253 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
2262 .monitor_recover_period = IWL_MONITORING_PERIOD, 2254 .monitor_recover_period = IWL_MONITORING_PERIOD,
2255 .temperature_kelvin = true,
2256 .off_channel_workaround = true,
2257 .max_event_log_size = 512,
2263}; 2258};
2264 2259
2265/* Module firmware */ 2260/* Module firmware */
2266MODULE_FIRMWARE(IWL4965_MODULE_FIRMWARE(IWL4965_UCODE_API_MAX)); 2261MODULE_FIRMWARE(IWL4965_MODULE_FIRMWARE(IWL4965_UCODE_API_MAX));
2267 2262
2268module_param_named(antenna, iwl4965_mod_params.antenna, int, S_IRUGO);
2269MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
2270module_param_named(swcrypto, iwl4965_mod_params.sw_crypto, int, S_IRUGO);
2271MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
2272module_param_named(
2273 disable_hw_scan, iwl4965_mod_params.disable_hw_scan, int, S_IRUGO);
2274MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 0)");
2275
2276module_param_named(queues_num, iwl4965_mod_params.num_of_queues, int, S_IRUGO);
2277MODULE_PARM_DESC(queues_num, "number of hw queues.");
2278/* 11n */
2279module_param_named(11n_disable, iwl4965_mod_params.disable_11n, int, S_IRUGO);
2280MODULE_PARM_DESC(11n_disable, "disable 11n functionality");
2281module_param_named(amsdu_size_8K, iwl4965_mod_params.amsdu_size_8K,
2282 int, S_IRUGO);
2283MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size");
2284
2285module_param_named(fw_restart4965, iwl4965_mod_params.restart_fw, int, S_IRUGO);
2286MODULE_PARM_DESC(fw_restart4965, "restart firmware in case of error");