iwlwifi: fix ICT irq table endianness

The ICT IRQ table is a set of __le32 values, not u32 values,
so when reading it we need to take into account that it has
to be converted to CPU endianness. This was causing a lot of
trouble on my powerpc box where various things would simply
not work for no apparent reason with 5xxx cards, but worked
with 4965 -- which doesn't use the ICT table.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2009-08-26 22:15:13 +02:00
committed by John W. Linville
parent 924d6356b2
commit 1303dcfd05
2 changed files with 6 additions and 6 deletions

View File

@@ -1901,10 +1901,10 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
/* read all entries that not 0 start with ict_index */ /* read all entries that not 0 start with ict_index */
while (priv->ict_tbl[priv->ict_index]) { while (priv->ict_tbl[priv->ict_index]) {
val |= priv->ict_tbl[priv->ict_index]; val |= le32_to_cpu(priv->ict_tbl[priv->ict_index]);
IWL_DEBUG_ISR(priv, "ICT index %d value 0x%08X\n", IWL_DEBUG_ISR(priv, "ICT index %d value 0x%08X\n",
priv->ict_index, priv->ict_index,
priv->ict_tbl[priv->ict_index]); le32_to_cpu(priv->ict_tbl[priv->ict_index]));
priv->ict_tbl[priv->ict_index] = 0; priv->ict_tbl[priv->ict_index] = 0;
priv->ict_index = iwl_queue_inc_wrap(priv->ict_index, priv->ict_index = iwl_queue_inc_wrap(priv->ict_index,
ICT_COUNT); ICT_COUNT);

View File

@@ -1170,7 +1170,7 @@ struct iwl_priv {
struct iwl_hw_params hw_params; struct iwl_hw_params hw_params;
/* INT ICT Table */ /* INT ICT Table */
u32 *ict_tbl; __le32 *ict_tbl;
dma_addr_t ict_tbl_dma; dma_addr_t ict_tbl_dma;
dma_addr_t aligned_ict_tbl_dma; dma_addr_t aligned_ict_tbl_dma;
int ict_index; int ict_index;