diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-10-24 02:48:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:02:27 -0400 |
commit | 127901ab69bbb263fb2b46e850cf20c57ac321d3 (patch) | |
tree | 35ab1fa324ca430ab486e9bc63cfea41966b1c49 /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | 951891c7ef844919d30aac7b1fc7396fd8be23ff (diff) |
iwlwifi: refactor tx byte count table usage
This patch drops unreadable usage of IWL_SET/GET_BITS16 in byte count
tables handling
This patch also cleans a bit the byte count table code and adds
WARN_ON traps on invalid values
This patch is pure cleanup, no functional changes.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index aad32a3ffd19..1f22140bec1a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -716,7 +716,7 @@ static int iwl4965_alive_notify(struct iwl_priv *priv) | |||
716 | /* Tel 4965 where to find Tx byte count tables */ | 716 | /* Tel 4965 where to find Tx byte count tables */ |
717 | iwl_write_prph(priv, IWL49_SCD_DRAM_BASE_ADDR, | 717 | iwl_write_prph(priv, IWL49_SCD_DRAM_BASE_ADDR, |
718 | (priv->shared_phys + | 718 | (priv->shared_phys + |
719 | offsetof(struct iwl4965_shared, queues_byte_cnt_tbls)) >> 10); | 719 | offsetof(struct iwl4965_shared, queues_bc_tbls)) >> 10); |
720 | 720 | ||
721 | /* Disable chain mode for all queues */ | 721 | /* Disable chain mode for all queues */ |
722 | iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0); | 722 | iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0); |
@@ -1668,21 +1668,22 @@ static void iwl4965_txq_update_byte_cnt_tbl(struct iwl_priv *priv, | |||
1668 | struct iwl_tx_queue *txq, | 1668 | struct iwl_tx_queue *txq, |
1669 | u16 byte_cnt) | 1669 | u16 byte_cnt) |
1670 | { | 1670 | { |
1671 | int len; | ||
1672 | int txq_id = txq->q.id; | ||
1673 | struct iwl4965_shared *shared_data = priv->shared_virt; | 1671 | struct iwl4965_shared *shared_data = priv->shared_virt; |
1672 | int txq_id = txq->q.id; | ||
1673 | int write_ptr = txq->q.write_ptr; | ||
1674 | int len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; | ||
1675 | __le16 bc_ent; | ||
1674 | 1676 | ||
1675 | len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; | 1677 | WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX); |
1676 | 1678 | ||
1679 | bc_ent = cpu_to_le16(len & 0xFFF); | ||
1677 | /* Set up byte count within first 256 entries */ | 1680 | /* Set up byte count within first 256 entries */ |
1678 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | 1681 | shared_data->queues_bc_tbls[txq_id].tfd_offset[write_ptr] = bc_ent; |
1679 | tfd_offset[txq->q.write_ptr], byte_cnt, len); | ||
1680 | 1682 | ||
1681 | /* If within first 64 entries, duplicate at end */ | 1683 | /* If within first 64 entries, duplicate at end */ |
1682 | if (txq->q.write_ptr < IWL49_MAX_WIN_SIZE) | 1684 | if (write_ptr < TFD_QUEUE_SIZE_BC_DUP) |
1683 | IWL_SET_BITS16(shared_data->queues_byte_cnt_tbls[txq_id]. | 1685 | shared_data->queues_bc_tbls[txq_id]. |
1684 | tfd_offset[IWL49_QUEUE_SIZE + txq->q.write_ptr], | 1686 | tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent; |
1685 | byte_cnt, len); | ||
1686 | } | 1687 | } |
1687 | 1688 | ||
1688 | /** | 1689 | /** |