diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-05-04 22:22:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:46 -0400 |
commit | d67f5489d8d9be09bc8e1615ec6c57c3120a731d (patch) | |
tree | 35f3734ec1707ff2d70db32227eaaa7eb50e4293 /drivers/net/wireless/iwlwifi | |
parent | 5ec0397679f1c1606199cfd6f3e24351891c60c3 (diff) |
iwlwifi: handle shared memory Rx index access
This patch splits ucode's and driver's shared memory Rx index access to
match 4965 and 5000 offsets.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 |
6 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 866a93e3de91..a475ecea9003 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2006,7 +2006,7 @@ void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, | |||
2006 | tx->rate_n_flags = iwl4965_hw_set_rate_n_flags(rate_plcp, rate_flags); | 2006 | tx->rate_n_flags = iwl4965_hw_set_rate_n_flags(rate_plcp, rate_flags); |
2007 | } | 2007 | } |
2008 | 2008 | ||
2009 | int iwl4965_hw_get_rx_read(struct iwl_priv *priv) | 2009 | static int iwl4965_shared_mem_rx_idx(struct iwl_priv *priv) |
2010 | { | 2010 | { |
2011 | struct iwl4965_shared *s = priv->shared_virt; | 2011 | struct iwl4965_shared *s = priv->shared_virt; |
2012 | return le32_to_cpu(s->rb_closed) & 0xFFF; | 2012 | return le32_to_cpu(s->rb_closed) & 0xFFF; |
@@ -2093,6 +2093,8 @@ static int iwl4965_alloc_shared_mem(struct iwl_priv *priv) | |||
2093 | 2093 | ||
2094 | memset(priv->shared_virt, 0, sizeof(struct iwl4965_shared)); | 2094 | memset(priv->shared_virt, 0, sizeof(struct iwl4965_shared)); |
2095 | 2095 | ||
2096 | priv->rb_closed_offset = offsetof(struct iwl4965_shared, rb_closed); | ||
2097 | |||
2096 | return 0; | 2098 | return 0; |
2097 | } | 2099 | } |
2098 | 2100 | ||
@@ -3824,6 +3826,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
3824 | .set_hw_params = iwl4965_hw_set_hw_params, | 3826 | .set_hw_params = iwl4965_hw_set_hw_params, |
3825 | .alloc_shared_mem = iwl4965_alloc_shared_mem, | 3827 | .alloc_shared_mem = iwl4965_alloc_shared_mem, |
3826 | .free_shared_mem = iwl4965_free_shared_mem, | 3828 | .free_shared_mem = iwl4965_free_shared_mem, |
3829 | .shared_mem_rx_idx = iwl4965_shared_mem_rx_idx, | ||
3827 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, | 3830 | .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, |
3828 | .disable_tx_fifo = iwl4965_disable_tx_fifo, | 3831 | .disable_tx_fifo = iwl4965_disable_tx_fifo, |
3829 | .rx_handler_setup = iwl4965_rx_handler_setup, | 3832 | .rx_handler_setup = iwl4965_rx_handler_setup, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index feffcafe1495..d6b91f7e0b1b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -362,6 +362,8 @@ static int iwl5000_alloc_shared_mem(struct iwl_priv *priv) | |||
362 | 362 | ||
363 | memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared)); | 363 | memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared)); |
364 | 364 | ||
365 | priv->rb_closed_offset = offsetof(struct iwl5000_shared, rb_closed); | ||
366 | |||
365 | return 0; | 367 | return 0; |
366 | } | 368 | } |
367 | 369 | ||
@@ -374,6 +376,12 @@ static void iwl5000_free_shared_mem(struct iwl_priv *priv) | |||
374 | priv->shared_phys); | 376 | priv->shared_phys); |
375 | } | 377 | } |
376 | 378 | ||
379 | static int iwl5000_shared_mem_rx_idx(struct iwl_priv *priv) | ||
380 | { | ||
381 | struct iwl5000_shared *s = priv->shared_virt; | ||
382 | return le32_to_cpu(s->rb_closed) & 0xFFF; | ||
383 | } | ||
384 | |||
377 | /** | 385 | /** |
378 | * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array | 386 | * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array |
379 | */ | 387 | */ |
@@ -466,6 +474,7 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
466 | .set_hw_params = iwl5000_hw_set_hw_params, | 474 | .set_hw_params = iwl5000_hw_set_hw_params, |
467 | .alloc_shared_mem = iwl5000_alloc_shared_mem, | 475 | .alloc_shared_mem = iwl5000_alloc_shared_mem, |
468 | .free_shared_mem = iwl5000_free_shared_mem, | 476 | .free_shared_mem = iwl5000_free_shared_mem, |
477 | .shared_mem_rx_idx = iwl5000_shared_mem_rx_idx, | ||
469 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | 478 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, |
470 | .disable_tx_fifo = iwl5000_disable_tx_fifo, | 479 | .disable_tx_fifo = iwl5000_disable_tx_fifo, |
471 | .apm_ops = { | 480 | .apm_ops = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 08eccdefd72e..77428db6a21d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -103,6 +103,7 @@ struct iwl_lib_ops { | |||
103 | /* ucode shared memory */ | 103 | /* ucode shared memory */ |
104 | int (*alloc_shared_mem)(struct iwl_priv *priv); | 104 | int (*alloc_shared_mem)(struct iwl_priv *priv); |
105 | void (*free_shared_mem)(struct iwl_priv *priv); | 105 | void (*free_shared_mem)(struct iwl_priv *priv); |
106 | int (*shared_mem_rx_idx)(struct iwl_priv *priv); | ||
106 | void (*txq_update_byte_cnt_tbl)(struct iwl_priv *priv, | 107 | void (*txq_update_byte_cnt_tbl)(struct iwl_priv *priv, |
107 | struct iwl4965_tx_queue *txq, | 108 | struct iwl4965_tx_queue *txq, |
108 | u16 byte_cnt); | 109 | u16 byte_cnt); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 25dce14c87d8..1683bee800d1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -697,7 +697,6 @@ extern int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, | |||
697 | extern int iwl4965_hw_get_temperature(struct iwl_priv *priv); | 697 | extern int iwl4965_hw_get_temperature(struct iwl_priv *priv); |
698 | extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, | 698 | extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, |
699 | struct iwl4965_frame *frame, u8 rate); | 699 | struct iwl4965_frame *frame, u8 rate); |
700 | extern int iwl4965_hw_get_rx_read(struct iwl_priv *priv); | ||
701 | extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, | 700 | extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, |
702 | struct iwl_cmd *cmd, | 701 | struct iwl_cmd *cmd, |
703 | struct ieee80211_tx_control *ctrl, | 702 | struct ieee80211_tx_control *ctrl, |
@@ -1138,6 +1137,7 @@ struct iwl_priv { | |||
1138 | struct iwl_hw_params hw_params; | 1137 | struct iwl_hw_params hw_params; |
1139 | /* driver/uCode shared Tx Byte Counts and Rx status */ | 1138 | /* driver/uCode shared Tx Byte Counts and Rx status */ |
1140 | void *shared_virt; | 1139 | void *shared_virt; |
1140 | int rb_closed_offset; | ||
1141 | /* Physical Pointer to Tx Byte Counts and Rx status */ | 1141 | /* Physical Pointer to Tx Byte Counts and Rx status */ |
1142 | dma_addr_t shared_phys; | 1142 | dma_addr_t shared_phys; |
1143 | 1143 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 171751e417d5..a2eb90d40b7e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -399,8 +399,7 @@ int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
399 | 399 | ||
400 | /* Tell device where in DRAM to update its Rx status */ | 400 | /* Tell device where in DRAM to update its Rx status */ |
401 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, | 401 | iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, |
402 | (priv->shared_phys + | 402 | (priv->shared_phys + priv->rb_closed_offset) >> 4); |
403 | offsetof(struct iwl4965_shared, rb_closed)) >> 4); | ||
404 | 403 | ||
405 | /* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */ | 404 | /* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */ |
406 | iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, | 405 | iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 88f3554c0fbc..09f2a6383d2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -3095,7 +3095,7 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
3095 | 3095 | ||
3096 | /* uCode's read index (stored in shared DRAM) indicates the last Rx | 3096 | /* uCode's read index (stored in shared DRAM) indicates the last Rx |
3097 | * buffer that the driver may process (last buffer filled by ucode). */ | 3097 | * buffer that the driver may process (last buffer filled by ucode). */ |
3098 | r = iwl4965_hw_get_rx_read(priv); | 3098 | r = priv->cfg->ops->lib->shared_mem_rx_idx(priv); |
3099 | i = rxq->read; | 3099 | i = rxq->read; |
3100 | 3100 | ||
3101 | /* Rx interrupt, but nothing sent from uCode */ | 3101 | /* Rx interrupt, but nothing sent from uCode */ |