aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-04-15 00:16:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 15:59:59 -0400
commite2a722eba1b3aa504ae177353d100287398881c3 (patch)
treeefe98aadadfd7c432ae6d108adff0d15c259096c /drivers/net
parent7480513f5b436321f86f5a5210af5bf8edb19e9a (diff)
iwlwifi: Fix byte count table for fragmented packets
This patch fix byte count table update. Table must be updated for each fragment Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c6
3 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 822169e61e9b..04fed5e0724a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3141,18 +3141,16 @@ static void iwl4965_hw_card_show_info(struct iwl_priv *priv)
3141#define IWL_TX_DELIMITER_SIZE 4 3141#define IWL_TX_DELIMITER_SIZE 4
3142 3142
3143/** 3143/**
3144 * iwl4965_tx_queue_update_wr_ptr - Set up entry in Tx byte-count array 3144 * iwl4965_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
3145 */ 3145 */
3146int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv, 3146static void iwl4965_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
3147 struct iwl4965_tx_queue *txq, u16 byte_cnt) 3147 struct iwl4965_tx_queue *txq,
3148 u16 byte_cnt)
3148{ 3149{
3149 int len; 3150 int len;
3150 int txq_id = txq->q.id; 3151 int txq_id = txq->q.id;
3151 struct iwl4965_shared *shared_data = priv->hw_setting.shared_virt; 3152 struct iwl4965_shared *shared_data = priv->hw_setting.shared_virt;
3152 3153
3153 if (txq->need_update == 0)
3154 return 0;
3155
3156 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; 3154 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;
3157 3155
3158 /* Set up byte count within first 256 entries */ 3156 /* Set up byte count within first 256 entries */
@@ -3164,8 +3162,6 @@ int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv,
3164 IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. 3162 IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id].
3165 tfd_offset[IWL4965_QUEUE_SIZE + txq->q.write_ptr], 3163 tfd_offset[IWL4965_QUEUE_SIZE + txq->q.write_ptr],
3166 byte_cnt, len); 3164 byte_cnt, len);
3167
3168 return 0;
3169} 3165}
3170 3166
3171/** 3167/**
@@ -4934,6 +4930,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
4934 4930
4935static struct iwl_lib_ops iwl4965_lib = { 4931static struct iwl_lib_ops iwl4965_lib = {
4936 .init_drv = iwl4965_init_drv, 4932 .init_drv = iwl4965_init_drv,
4933 .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl,
4937 .hw_nic_init = iwl4965_hw_nic_init, 4934 .hw_nic_init = iwl4965_hw_nic_init,
4938 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr, 4935 .is_valid_rtc_data_addr = iwl4965_hw_valid_rtc_data_addr,
4939 .alive_notify = iwl4965_alive_notify, 4936 .alive_notify = iwl4965_alive_notify,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 889fdbaeb735..23c21e38ca8a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -89,6 +89,10 @@ struct iwl_hcmd_utils_ops {
89struct iwl_lib_ops { 89struct iwl_lib_ops {
90 /* iwlwifi driver (priv) init */ 90 /* iwlwifi driver (priv) init */
91 int (*init_drv)(struct iwl_priv *priv); 91 int (*init_drv)(struct iwl_priv *priv);
92
93 void (*txq_update_byte_cnt_tbl)(struct iwl_priv *priv,
94 struct iwl4965_tx_queue *txq,
95 u16 byte_cnt);
92 /* nic init */ 96 /* nic init */
93 int (*hw_nic_init)(struct iwl_priv *priv); 97 int (*hw_nic_init)(struct iwl_priv *priv);
94 /* alive notification */ 98 /* alive notification */
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index bfefb05e18e9..60c0b8375f24 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -575,11 +575,11 @@ int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
575 txq->need_update = 1; 575 txq->need_update = 1;
576 576
577 /* Set up entry in queue's byte count circular buffer */ 577 /* Set up entry in queue's byte count circular buffer */
578 ret = iwl4965_tx_queue_update_wr_ptr(priv, txq, 0); 578 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 0);
579 579
580 /* Increment and update queue's write index */ 580 /* Increment and update queue's write index */
581 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); 581 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);
582 iwl4965_tx_queue_update_write_ptr(priv, txq); 582 ret = iwl4965_tx_queue_update_write_ptr(priv, txq);
583 583
584 spin_unlock_irqrestore(&priv->hcmd_lock, flags); 584 spin_unlock_irqrestore(&priv->hcmd_lock, flags);
585 return ret ? ret : idx; 585 return ret ? ret : idx;
@@ -2392,7 +2392,7 @@ static int iwl4965_tx_skb(struct iwl_priv *priv,
2392 ieee80211_get_hdrlen(fc)); 2392 ieee80211_get_hdrlen(fc));
2393 2393
2394 /* Set up entry for this TFD in Tx byte-count array */ 2394 /* Set up entry for this TFD in Tx byte-count array */
2395 iwl4965_tx_queue_update_wr_ptr(priv, txq, len); 2395 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, len);
2396 2396
2397 /* Tell device the write index *just past* this latest filled TFD */ 2397 /* Tell device the write index *just past* this latest filled TFD */
2398 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); 2398 q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd);