aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-03-23 14:37:59 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-04-02 15:52:17 -0400
commitb744cb79aec7d95905943c0bc64699eb02de143b (patch)
treef9a45249920097edf6a5a8fc9855a53e682489f2 /drivers/net/wireless/iwlwifi
parentd34a5a62da12ffa53b91895d094960b35474f2fc (diff)
iwlwifi: code cleanup for generic defines
Some defines used by all agn devices, but the definitions were in iwl-4965-hw.h, move those to iwl-agn-hw.h which is the better place for those. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-hw.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hw.h16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
9 files changed, 25 insertions, 36 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
index 074f42a7dca..91bcb4e3cdf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
@@ -71,10 +71,6 @@
71 71
72#include "iwl-eeprom.h" 72#include "iwl-eeprom.h"
73 73
74/* Time constants */
75#define SHORT_SLOT_TIME 9
76#define LONG_SLOT_TIME 20
77
78/* RSSI to dBm */ 74/* RSSI to dBm */
79#define IWL39_RSSI_OFFSET 95 75#define IWL39_RSSI_OFFSET 95
80 76
@@ -230,7 +226,6 @@ struct iwl3945_eeprom {
230 226
231/* 4 DATA + 1 CMD. There are 2 HCCA queues that are not used. */ 227/* 4 DATA + 1 CMD. There are 2 HCCA queues that are not used. */
232#define IWL39_NUM_QUEUES 5 228#define IWL39_NUM_QUEUES 5
233#define IWL_NUM_SCAN_RATES (2)
234 229
235#define IWL_DEFAULT_TX_RETRY 15 230#define IWL_DEFAULT_TX_RETRY 15
236 231
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 67ef562e8db..cd4b61ae25b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -81,26 +81,6 @@
81 */ 81 */
82#define IWL49_FIRST_AMPDU_QUEUE 7 82#define IWL49_FIRST_AMPDU_QUEUE 7
83 83
84/* Time constants */
85#define SHORT_SLOT_TIME 9
86#define LONG_SLOT_TIME 20
87
88/* RSSI to dBm */
89#define IWL49_RSSI_OFFSET 44
90
91
92/* PCI registers */
93#define PCI_CFG_RETRY_TIMEOUT 0x041
94
95/* PCI register values */
96#define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01
97#define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02
98
99#define IWL_NUM_SCAN_RATES (2)
100
101#define IWL_DEFAULT_TX_RETRY 15
102
103
104/* Sizes and addresses for instruction and data memory (SRAM) in 84/* Sizes and addresses for instruction and data memory (SRAM) in
105 * 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */ 85 * 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */
106#define IWL49_RTC_INST_LOWER_BOUND (0x000000) 86#define IWL49_RTC_INST_LOWER_BOUND (0x000000)
@@ -393,10 +373,6 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
393 * location(s) in command (struct iwl4965_txpowertable_cmd). 373 * location(s) in command (struct iwl4965_txpowertable_cmd).
394 */ 374 */
395 375
396/* Limit range of txpower output target to be between these values */
397#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */
398#define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */
399
400/** 376/**
401 * When MIMO is used (2 transmitters operating simultaneously), driver should 377 * When MIMO is used (2 transmitters operating simultaneously), driver should
402 * limit each transmitter to deliver a max of 3 dB below the regulatory limit 378 * limit each transmitter to deliver a max of 3 dB below the regulatory limit
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 083983a9d69..a5122a60d63 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2086,7 +2086,7 @@ static int iwl4965_calc_rssi(struct iwl_priv *priv,
2086 2086
2087 /* dBm = max_rssi dB - agc dB - constant. 2087 /* dBm = max_rssi dB - agc dB - constant.
2088 * Higher AGC (higher radio gain) means lower signal. */ 2088 * Higher AGC (higher radio gain) means lower signal. */
2089 return max_rssi - agc - IWL49_RSSI_OFFSET; 2089 return max_rssi - agc - IWLAGN_RSSI_OFFSET;
2090} 2090}
2091 2091
2092 2092
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index 6e331f502e1..28bc8f8ba98 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -254,7 +254,7 @@ static int iwlagn_calc_rssi(struct iwl_priv *priv,
254 254
255 /* dBm = max_rssi dB - agc dB - constant. 255 /* dBm = max_rssi dB - agc dB - constant.
256 * Higher AGC (higher radio gain) means lower signal. */ 256 * Higher AGC (higher radio gain) means lower signal. */
257 return max_rssi - agc - IWL49_RSSI_OFFSET; 257 return max_rssi - agc - IWLAGN_RSSI_OFFSET;
258} 258}
259 259
260struct iwl_hcmd_ops iwlagn_hcmd = { 260struct iwl_hcmd_ops iwlagn_hcmd = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hw.h b/drivers/net/wireless/iwlwifi/iwl-agn-hw.h
index e2ad870bb34..f9a3fbb6338 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hw.h
@@ -78,6 +78,22 @@
78#define IWLAGN_RTC_DATA_SIZE (IWLAGN_RTC_DATA_UPPER_BOUND - \ 78#define IWLAGN_RTC_DATA_SIZE (IWLAGN_RTC_DATA_UPPER_BOUND - \
79 IWLAGN_RTC_DATA_LOWER_BOUND) 79 IWLAGN_RTC_DATA_LOWER_BOUND)
80 80
81/* RSSI to dBm */
82#define IWLAGN_RSSI_OFFSET 44
83
84/* PCI registers */
85#define PCI_CFG_RETRY_TIMEOUT 0x041
86
87/* PCI register values */
88#define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01
89#define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02
90
91#define IWLAGN_DEFAULT_TX_RETRY 15
92
93/* Limit range of txpower output target to be between these values */
94#define IWLAGN_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */
95#define IWLAGN_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */
96
81/* EEPROM */ 97/* EEPROM */
82#define IWLAGN_EEPROM_IMG_SIZE 2048 98#define IWLAGN_EEPROM_IMG_SIZE 2048
83 99
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 257e4aff3d9..ad6cb1b38ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -404,7 +404,7 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
404 if (ieee80211_is_probe_resp(fc)) 404 if (ieee80211_is_probe_resp(fc))
405 data_retry_limit = 3; 405 data_retry_limit = 3;
406 else 406 else
407 data_retry_limit = IWL_DEFAULT_TX_RETRY; 407 data_retry_limit = IWLAGN_DEFAULT_TX_RETRY;
408 tx_cmd->data_retry_limit = data_retry_limit; 408 tx_cmd->data_retry_limit = data_retry_limit;
409 409
410 /* Set retry limit on RTS packets */ 410 /* Set retry limit on RTS packets */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8b66010a2e8..ef5690a83b3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3368,7 +3368,7 @@ static int iwl_init_drv(struct iwl_priv *priv)
3368 /* Set the tx_power_user_lmt to the lowest power level 3368 /* Set the tx_power_user_lmt to the lowest power level
3369 * this value will get overwritten by channel max power avg 3369 * this value will get overwritten by channel max power avg
3370 * from eeprom */ 3370 * from eeprom */
3371 priv->tx_power_user_lmt = IWL_TX_POWER_TARGET_POWER_MIN; 3371 priv->tx_power_user_lmt = IWLAGN_TX_POWER_TARGET_POWER_MIN;
3372 3372
3373 ret = iwl_init_channel_map(priv); 3373 ret = iwl_init_channel_map(priv);
3374 if (ret) { 3374 if (ret) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 38d19c11c47..ff7f5c7b896 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1376,10 +1376,11 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1376 int ret = 0; 1376 int ret = 0;
1377 s8 prev_tx_power = priv->tx_power_user_lmt; 1377 s8 prev_tx_power = priv->tx_power_user_lmt;
1378 1378
1379 if (tx_power < IWL_TX_POWER_TARGET_POWER_MIN) { 1379 if (tx_power < IWLAGN_TX_POWER_TARGET_POWER_MIN) {
1380 IWL_WARN(priv, "Requested user TXPOWER %d below lower limit %d.\n", 1380 IWL_WARN(priv,
1381 "Requested user TXPOWER %d below lower limit %d.\n",
1381 tx_power, 1382 tx_power,
1382 IWL_TX_POWER_TARGET_POWER_MIN); 1383 IWLAGN_TX_POWER_TARGET_POWER_MIN);
1383 return -EINVAL; 1384 return -EINVAL;
1384 } 1385 }
1385 1386
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 7f38d2d9b57..4319bda487d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -43,6 +43,7 @@
43#include "iwl-debug.h" 43#include "iwl-debug.h"
44#include "iwl-4965-hw.h" 44#include "iwl-4965-hw.h"
45#include "iwl-3945-hw.h" 45#include "iwl-3945-hw.h"
46#include "iwl-agn-hw.h"
46#include "iwl-led.h" 47#include "iwl-led.h"
47#include "iwl-power.h" 48#include "iwl-power.h"
48#include "iwl-agn-rs.h" 49#include "iwl-agn-rs.h"