diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2008-12-18 21:37:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:23 -0500 |
commit | 8cd812bcda06645160b0b279e1a125271a73411c (patch) | |
tree | 5ac158f40ed46fe8c4f68dd7ebe701ac616655fd /drivers/net | |
parent | cbba18c6e3d1b2610f9a63c4636247af26141686 (diff) |
iwl3945: use iwl_rb_status
This patch makes use of iwl_rb_status also in 3945. The structure
for 3945 is not the same but since only closed_rb_num filed is used
in both cases there is no reason to duplicate it.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-fh.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 |
6 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h index 5d461bd77567..fc1b774c806b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h | |||
@@ -302,7 +302,6 @@ static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr) | |||
302 | * and &iwl3945_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */ | 302 | * and &iwl3945_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */ |
303 | struct iwl3945_shared { | 303 | struct iwl3945_shared { |
304 | __le32 tx_base_ptr[8]; | 304 | __le32 tx_base_ptr[8]; |
305 | __le32 rx_read_ptr[3]; | ||
306 | } __attribute__ ((packed)); | 305 | } __attribute__ ((packed)); |
307 | 306 | ||
308 | struct iwl3945_tfd_frame_data { | 307 | struct iwl3945_tfd_frame_data { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 5a8b75d94d7d..cb864449c397 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -974,9 +974,7 @@ static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
974 | } | 974 | } |
975 | 975 | ||
976 | iwl_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->dma_addr); | 976 | iwl_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->dma_addr); |
977 | iwl_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0), | 977 | iwl_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0), rxq->rb_stts_dma); |
978 | priv->shared_phys + | ||
979 | offsetof(struct iwl3945_shared, rx_read_ptr[0])); | ||
980 | iwl_write_direct32(priv, FH39_RCSR_WPTR(0), 0); | 978 | iwl_write_direct32(priv, FH39_RCSR_WPTR(0), 0); |
981 | iwl_write_direct32(priv, FH39_RCSR_CONFIG(0), | 979 | iwl_write_direct32(priv, FH39_RCSR_CONFIG(0), |
982 | FH39_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE | | 980 | FH39_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE | |
@@ -2377,13 +2375,6 @@ int iwl3945_hw_tx_queue_init(struct iwl_priv *priv, struct iwl3945_tx_queue *txq | |||
2377 | return 0; | 2375 | return 0; |
2378 | } | 2376 | } |
2379 | 2377 | ||
2380 | int iwl3945_hw_get_rx_read(struct iwl_priv *priv) | ||
2381 | { | ||
2382 | struct iwl3945_shared *shared_data = priv->shared_virt; | ||
2383 | |||
2384 | return le32_to_cpu(shared_data->rx_read_ptr[0]); | ||
2385 | } | ||
2386 | |||
2387 | /** | 2378 | /** |
2388 | * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table | 2379 | * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table |
2389 | */ | 2380 | */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 9c520c455a4b..aff6a3a53898 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -282,7 +282,6 @@ extern int iwl3945_hw_tx_queue_init(struct iwl_priv *priv, | |||
282 | struct iwl3945_tx_queue *txq); | 282 | struct iwl3945_tx_queue *txq); |
283 | extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv, | 283 | extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv, |
284 | struct iwl3945_frame *frame, u8 rate); | 284 | struct iwl3945_frame *frame, u8 rate); |
285 | extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv); | ||
286 | void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd, | 285 | void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd, |
287 | struct ieee80211_tx_info *info, | 286 | struct ieee80211_tx_info *info, |
288 | struct ieee80211_hdr *hdr, | 287 | struct ieee80211_hdr *hdr, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 6a07a686f85c..8981c054a4cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1021,7 +1021,7 @@ struct iwl_priv { | |||
1021 | u16 beacon_int; | 1021 | u16 beacon_int; |
1022 | struct ieee80211_vif *vif; | 1022 | struct ieee80211_vif *vif; |
1023 | 1023 | ||
1024 | /*Added for 3945 */ | 1024 | /*Added for 3945 */ |
1025 | void *shared_virt; | 1025 | void *shared_virt; |
1026 | dma_addr_t shared_phys; | 1026 | dma_addr_t shared_phys; |
1027 | /*End*/ | 1027 | /*End*/ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index d7da19864550..7c19790a3ea7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -414,6 +414,7 @@ struct iwl_rb_status { | |||
414 | __le16 closed_fr_num; | 414 | __le16 closed_fr_num; |
415 | __le16 finished_rb_num; | 415 | __le16 finished_rb_num; |
416 | __le16 finished_fr_nam; | 416 | __le16 finished_fr_nam; |
417 | __le32 __unused; /* 3945 only */ | ||
417 | } __attribute__ ((packed)); | 418 | } __attribute__ ((packed)); |
418 | 419 | ||
419 | 420 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index aaa6058dd8b0..207d55bea5fa 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3588,7 +3588,7 @@ static void iwl3945_rx_handle(struct iwl_priv *priv) | |||
3588 | 3588 | ||
3589 | /* uCode's read index (stored in shared DRAM) indicates the last Rx | 3589 | /* uCode's read index (stored in shared DRAM) indicates the last Rx |
3590 | * buffer that the driver may process (last buffer filled by ucode). */ | 3590 | * buffer that the driver may process (last buffer filled by ucode). */ |
3591 | r = iwl3945_hw_get_rx_read(priv); | 3591 | r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF; |
3592 | i = rxq->read; | 3592 | i = rxq->read; |
3593 | 3593 | ||
3594 | if (iwl3945_rx_queue_space(rxq) > (RX_QUEUE_SIZE / 2)) | 3594 | if (iwl3945_rx_queue_space(rxq) > (RX_QUEUE_SIZE / 2)) |