aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-04-24 14:55:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-07 15:02:24 -0400
commitfdd3e8a4ff96d03121b21946bfa684f3b5d783c6 (patch)
treee2124e7861d82bfb702fac78f5d9d21b4f640c5c
parent25ae3986d7ed4303fabc883a87b74956bd59c22c (diff)
iwlwifi-5000: adding iwl5000 HW parameters
This patch adds iwl 5000 HW parameters Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-commands.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000-hw.h47
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c51
3 files changed, 99 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index 6b2d6bfec1e5..d0e3f35d4984 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -712,6 +712,8 @@ struct iwl4965_qosparam_cmd {
712#define IWL_STA_ID 2 712#define IWL_STA_ID 2
713#define IWL4965_BROADCAST_ID 31 713#define IWL4965_BROADCAST_ID 31
714#define IWL4965_STATION_COUNT 32 714#define IWL4965_STATION_COUNT 32
715#define IWL5000_BROADCAST_ID 15
716#define IWL5000_STATION_COUNT 16
715 717
716#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ 718#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
717#define IWL_INVALID_STATION 255 719#define IWL_INVALID_STATION 255
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
index 5cf8a684b3e1..31592fb8ddfd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
@@ -68,6 +68,11 @@
68#ifndef __iwl_5000_hw_h__ 68#ifndef __iwl_5000_hw_h__
69#define __iwl_5000_hw_h__ 69#define __iwl_5000_hw_h__
70 70
71#define IWL50_RTC_INST_UPPER_BOUND (0x020000)
72#define IWL50_RTC_DATA_UPPER_BOUND (0x80C000)
73#define IWL50_RTC_INST_SIZE (IWL50_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
74#define IWL50_RTC_DATA_SIZE (IWL50_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
75
71/* EERPROM */ 76/* EERPROM */
72#define IWL_5000_EEPROM_IMG_SIZE 2048 77#define IWL_5000_EEPROM_IMG_SIZE 2048
73 78
@@ -78,5 +83,47 @@
78#define IWL50_NUM_QUEUES 20 83#define IWL50_NUM_QUEUES 20
79#define IWL50_BACK_QUEUE_FIRST_ID 10 84#define IWL50_BACK_QUEUE_FIRST_ID 10
80 85
86/* Fixed (non-configurable) rx data from phy */
87
88/* Base physical address of iwl5000_shared is provided to SCD_DRAM_BASE_ADDR
89 * and &iwl5000_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
90struct iwl5000_sched_queue_byte_cnt_tbl {
91 struct iwl4965_queue_byte_cnt_entry tfd_offset[IWL50_QUEUE_SIZE +
92 IWL50_MAX_WIN_SIZE];
93} __attribute__ ((packed));
94
95struct iwl5000_shared {
96 struct iwl5000_sched_queue_byte_cnt_tbl
97 queues_byte_cnt_tbls[IWL50_NUM_QUEUES];
98 __le32 rb_closed;
99
100 /* __le32 rb_closed_stts_rb_num:12; */
101#define IWL_rb_closed_stts_rb_num_POS 0
102#define IWL_rb_closed_stts_rb_num_LEN 12
103#define IWL_rb_closed_stts_rb_num_SYM rb_closed
104 /* __le32 rsrv1:4; */
105 /* __le32 rb_closed_stts_rx_frame_num:12; */
106#define IWL_rb_closed_stts_rx_frame_num_POS 16
107#define IWL_rb_closed_stts_rx_frame_num_LEN 12
108#define IWL_rb_closed_stts_rx_frame_num_SYM rb_closed
109 /* __le32 rsrv2:4; */
110
111 __le32 frm_finished;
112 /* __le32 frame_finished_stts_rb_num:12; */
113#define IWL_frame_finished_stts_rb_num_POS 0
114#define IWL_frame_finished_stts_rb_num_LEN 12
115#define IWL_frame_finished_stts_rb_num_SYM frm_finished
116 /* __le32 rsrv3:4; */
117 /* __le32 frame_finished_stts_rx_frame_num:12; */
118#define IWL_frame_finished_stts_rx_frame_num_POS 16
119#define IWL_frame_finished_stts_rx_frame_num_LEN 12
120#define IWL_frame_finished_stts_rx_frame_num_SYM frm_finished
121 /* __le32 rsrv4:4; */
122
123 __le32 padding1; /* so that allocation will be aligned to 16B */
124 __le32 padding2;
125} __attribute__ ((packed));
126
127
81#endif /* __iwl_5000_hw_h__ */ 128#endif /* __iwl_5000_hw_h__ */
82 129
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 91b3e563bbea..545970b0caa1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -133,8 +133,56 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
133 return &priv->eeprom[address]; 133 return &priv->eeprom[address];
134} 134}
135 135
136static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
137{
138 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
139 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
140 IWL_ERROR("invalid queues_num, should be between %d and %d\n",
141 IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
142 return -EINVAL;
143 }
136 144
137 145 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
146 priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
147 priv->hw_params.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
148 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
149 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
150 if (priv->cfg->mod_params->amsdu_size_8K)
151 priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K;
152 else
153 priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
154 priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
155 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
156 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
157 priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
158 priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
159 priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
160 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) |
161 BIT(IEEE80211_BAND_5GHZ);
162
163 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
164 case CSR_HW_REV_TYPE_5100:
165 case CSR_HW_REV_TYPE_5150:
166 priv->hw_params.tx_chains_num = 1;
167 priv->hw_params.rx_chains_num = 2;
168 /* FIXME: move to ANT_A, ANT_B, ANT_C enum */
169 priv->hw_params.valid_tx_ant = IWL_ANTENNA_MAIN;
170 priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN |
171 IWL_ANTENNA_AUX);
172 break;
173 case CSR_HW_REV_TYPE_5300:
174 case CSR_HW_REV_TYPE_5350:
175 priv->hw_params.tx_chains_num = 3;
176 priv->hw_params.rx_chains_num = 3;
177 /* FIXME: move to ANT_A, ANT_B, ANT_C enum */
178 priv->hw_params.valid_tx_ant = (IWL_ANTENNA_MAIN |
179 IWL_ANTENNA_AUX | 0x04);
180 priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN |
181 IWL_ANTENNA_AUX | 0x04);
182 break;
183 }
184 return 0;
185}
138static struct iwl_hcmd_ops iwl5000_hcmd = { 186static struct iwl_hcmd_ops iwl5000_hcmd = {
139}; 187};
140 188
@@ -142,6 +190,7 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = {
142}; 190};
143 191
144static struct iwl_lib_ops iwl5000_lib = { 192static struct iwl_lib_ops iwl5000_lib = {
193 .set_hw_params = iwl5000_hw_set_hw_params,
145 .apm_ops = { 194 .apm_ops = {
146 .init = iwl5000_apm_init, 195 .init = iwl5000_apm_init,
147 .set_pwr_src = iwl4965_set_pwr_src, 196 .set_pwr_src = iwl4965_set_pwr_src,