diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2008-04-24 14:55:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:25 -0400 |
commit | 7839fc03862704677902be2d63c0482fee3deae3 (patch) | |
tree | 6e64b07246d09565f4a79aa8bddd9d747bdd9e69 /drivers | |
parent | d4100dd985dcc13cc7bd1712ce10dea51b7c8261 (diff) |
iwlwifi-5000: update the byte count in SCD
This patch udpates the byte count of the frame in the registers of the
scheduler.
This patch also moves two defines in iwl-4965.h to a more appropriate
area in the file.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000-hw.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 49 |
2 files changed, 53 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h index 31592fb8ddfd..9e557ce315b7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h | |||
@@ -83,6 +83,10 @@ | |||
83 | #define IWL50_NUM_QUEUES 20 | 83 | #define IWL50_NUM_QUEUES 20 |
84 | #define IWL50_BACK_QUEUE_FIRST_ID 10 | 84 | #define IWL50_BACK_QUEUE_FIRST_ID 10 |
85 | 85 | ||
86 | #define IWL_sta_id_POS 12 | ||
87 | #define IWL_sta_id_LEN 4 | ||
88 | #define IWL_sta_id_SYM val | ||
89 | |||
86 | /* Fixed (non-configurable) rx data from phy */ | 90 | /* Fixed (non-configurable) rx data from phy */ |
87 | 91 | ||
88 | /* Base physical address of iwl5000_shared is provided to SCD_DRAM_BASE_ADDR | 92 | /* Base physical address of iwl5000_shared is provided to SCD_DRAM_BASE_ADDR |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 8e2a6a5749a1..1e63b497471d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -314,6 +314,54 @@ static void iwl5000_free_shared_mem(struct iwl_priv *priv) | |||
314 | priv->shared_phys); | 314 | priv->shared_phys); |
315 | } | 315 | } |
316 | 316 | ||
317 | /** | ||
318 | * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array | ||
319 | */ | ||
320 | static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, | ||
321 | struct iwl4965_tx_queue *txq, | ||
322 | u16 byte_cnt) | ||
323 | { | ||
324 | struct iwl5000_shared *shared_data = priv->shared_virt; | ||
325 | int txq_id = txq->q.id; | ||
326 | u8 sec_ctl = 0; | ||
327 | u8 sta = 0; | ||
328 | int len; | ||
329 | |||
330 | len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; | ||
331 | |||
332 | if (txq_id != IWL_CMD_QUEUE_NUM) { | ||
333 | sta = txq->cmd[txq->q.write_ptr].cmd.tx.sta_id; | ||
334 | sec_ctl = txq->cmd[txq->q.write_ptr].cmd.tx.sec_ctl; | ||
335 | |||
336 | switch (sec_ctl & TX_CMD_SEC_MSK) { | ||
337 | case TX_CMD_SEC_CCM: | ||
338 | len += CCMP_MIC_LEN; | ||
339 | break; | ||
340 | case TX_CMD_SEC_TKIP: | ||
341 | len += TKIP_ICV_LEN; | ||
342 | break; | ||
343 | case TX_CMD_SEC_WEP: | ||
344 | len += WEP_IV_LEN + WEP_ICV_LEN; | ||
345 | break; | ||
346 | } | ||
347 | } | ||
348 | |||
349 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | ||
350 | tfd_offset[txq->q.write_ptr], byte_cnt, len); | ||
351 | |||
352 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | ||
353 | tfd_offset[txq->q.write_ptr], sta_id, sta); | ||
354 | |||
355 | if (txq->q.write_ptr < IWL50_MAX_WIN_SIZE) { | ||
356 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | ||
357 | tfd_offset[IWL50_QUEUE_SIZE + txq->q.write_ptr], | ||
358 | byte_cnt, len); | ||
359 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | ||
360 | tfd_offset[IWL50_QUEUE_SIZE + txq->q.write_ptr], | ||
361 | sta_id, sta); | ||
362 | } | ||
363 | } | ||
364 | |||
317 | static struct iwl_hcmd_ops iwl5000_hcmd = { | 365 | static struct iwl_hcmd_ops iwl5000_hcmd = { |
318 | }; | 366 | }; |
319 | 367 | ||
@@ -328,6 +376,7 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
328 | .set_hw_params = iwl5000_hw_set_hw_params, | 376 | .set_hw_params = iwl5000_hw_set_hw_params, |
329 | .alloc_shared_mem = iwl5000_alloc_shared_mem, | 377 | .alloc_shared_mem = iwl5000_alloc_shared_mem, |
330 | .free_shared_mem = iwl5000_free_shared_mem, | 378 | .free_shared_mem = iwl5000_free_shared_mem, |
379 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | ||
331 | .apm_ops = { | 380 | .apm_ops = { |
332 | .init = iwl5000_apm_init, | 381 | .init = iwl5000_apm_init, |
333 | .set_pwr_src = iwl4965_set_pwr_src, | 382 | .set_pwr_src = iwl4965_set_pwr_src, |