aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c50
7 files changed, 18 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 8efe33805e11..24d818d1b06b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1218,7 +1218,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
1218 1218
1219 /* Look at using this instead: 1219 /* Look at using this instead:
1220 rxq->need_update = 1; 1220 rxq->need_update = 1;
1221 iwl3945_rx_queue_update_write_ptr(priv, rxq); 1221 iwl_rx_queue_update_write_ptr(priv, rxq);
1222 */ 1222 */
1223 1223
1224 rc = iwl_grab_nic_access(priv); 1224 rc = iwl_grab_nic_access(priv);
@@ -2492,6 +2492,8 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
2492 priv->hw_params.max_stations = IWL3945_STATION_COUNT; 2492 priv->hw_params.max_stations = IWL3945_STATION_COUNT;
2493 priv->hw_params.bcast_sta_id = IWL3945_BROADCAST_ID; 2493 priv->hw_params.bcast_sta_id = IWL3945_BROADCAST_ID;
2494 2494
2495 priv->hw_params.rx_wrt_ptr_reg = FH39_RSCSR_CHNL0_WPTR;
2496
2495 return 0; 2497 return 0;
2496} 2498}
2497 2499
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index c5f5481edb35..3041616d39cc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -225,8 +225,6 @@ extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv,
225 struct iwl_host_cmd *cmd); 225 struct iwl_host_cmd *cmd);
226extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv, 226extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
227 struct ieee80211_hdr *hdr,int left); 227 struct ieee80211_hdr *hdr,int left);
228extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv,
229 struct iwl_rx_queue *q);
230extern int iwl3945_send_statistics_request(struct iwl_priv *priv); 228extern int iwl3945_send_statistics_request(struct iwl_priv *priv);
231extern void iwl3945_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, 229extern void iwl3945_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
232 u32 decrypt_res, 230 u32 decrypt_res,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index e68d587a44b1..57efd4890dd0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -822,6 +822,8 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
822 priv->hw_params.max_bsm_size = BSM_SRAM_SIZE; 822 priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
823 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_5GHZ); 823 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_5GHZ);
824 824
825 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
826
825 priv->hw_params.tx_chains_num = 2; 827 priv->hw_params.tx_chains_num = 2;
826 priv->hw_params.rx_chains_num = 2; 828 priv->hw_params.rx_chains_num = 2;
827 priv->hw_params.valid_tx_ant = ANT_A | ANT_B; 829 priv->hw_params.valid_tx_ant = ANT_A | ANT_B;
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 76d86fe2b41d..d20d2ba0c10d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -844,6 +844,8 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
844 priv->hw_params.max_bsm_size = 0; 844 priv->hw_params.max_bsm_size = 0;
845 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | 845 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) |
846 BIT(IEEE80211_BAND_5GHZ); 846 BIT(IEEE80211_BAND_5GHZ);
847 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
848
847 priv->hw_params.sens = &iwl5000_sensitivity; 849 priv->hw_params.sens = &iwl5000_sensitivity;
848 850
849 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 851 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index a092401fd9c0..fbc4822c19a8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -563,6 +563,7 @@ struct iwl_sensitivity_ranges {
563 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2) 563 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
564 * @max_rxq_log: Log-base-2 of max_rxq_size 564 * @max_rxq_log: Log-base-2 of max_rxq_size
565 * @rx_buf_size: Rx buffer size 565 * @rx_buf_size: Rx buffer size
566 * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
566 * @max_stations: 567 * @max_stations:
567 * @bcast_sta_id: 568 * @bcast_sta_id:
568 * @fat_channel: is 40MHz width possible in band 2.4 569 * @fat_channel: is 40MHz width possible in band 2.4
@@ -584,6 +585,7 @@ struct iwl_hw_params {
584 u16 max_rxq_size; 585 u16 max_rxq_size;
585 u16 max_rxq_log; 586 u16 max_rxq_log;
586 u32 rx_buf_size; 587 u32 rx_buf_size;
588 u32 rx_wrt_ptr_reg;
587 u32 max_pkt_size; 589 u32 max_pkt_size;
588 u8 max_stations; 590 u8 max_stations;
589 u8 bcast_sta_id; 591 u8 bcast_sta_id;
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index bc3febe74d68..60be47f8c4a8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -125,9 +125,10 @@ EXPORT_SYMBOL(iwl_rx_queue_space);
125 */ 125 */
126int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q) 126int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
127{ 127{
128 u32 reg = 0;
129 int ret = 0;
130 unsigned long flags; 128 unsigned long flags;
129 u32 rx_wrt_ptr_reg = priv->hw_params.rx_wrt_ptr_reg;
130 u32 reg;
131 int ret = 0;
131 132
132 spin_lock_irqsave(&q->lock, flags); 133 spin_lock_irqsave(&q->lock, flags);
133 134
@@ -149,15 +150,14 @@ int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
149 goto exit_unlock; 150 goto exit_unlock;
150 151
151 /* Device expects a multiple of 8 */ 152 /* Device expects a multiple of 8 */
152 iwl_write_direct32(priv, FH_RSCSR_CHNL0_WPTR, 153 iwl_write_direct32(priv, rx_wrt_ptr_reg, q->write & ~0x7);
153 q->write & ~0x7);
154 iwl_release_nic_access(priv); 154 iwl_release_nic_access(priv);
155 155
156 /* Else device is assumed to be awake */ 156 /* Else device is assumed to be awake */
157 } else 157 } else {
158 /* Device expects a multiple of 8 */ 158 /* Device expects a multiple of 8 */
159 iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write & ~0x7); 159 iwl_write32(priv, rx_wrt_ptr_reg, q->write & ~0x7);
160 160 }
161 161
162 q->need_update = 0; 162 q->need_update = 0;
163 163
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 43cfc6ec5163..04466d30fe4b 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3219,52 +3219,6 @@ static int iwl3945_rx_queue_space(const struct iwl_rx_queue *q)
3219} 3219}
3220 3220
3221/** 3221/**
3222 * iwl3945_rx_queue_update_write_ptr - Update the write pointer for the RX queue
3223 */
3224int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
3225{
3226 u32 reg = 0;
3227 int rc = 0;
3228 unsigned long flags;
3229
3230 spin_lock_irqsave(&q->lock, flags);
3231
3232 if (q->need_update == 0)
3233 goto exit_unlock;
3234
3235 /* If power-saving is in use, make sure device is awake */
3236 if (test_bit(STATUS_POWER_PMI, &priv->status)) {
3237 reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
3238
3239 if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
3240 iwl_set_bit(priv, CSR_GP_CNTRL,
3241 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
3242 goto exit_unlock;
3243 }
3244
3245 rc = iwl_grab_nic_access(priv);
3246 if (rc)
3247 goto exit_unlock;
3248
3249 /* Device expects a multiple of 8 */
3250 iwl_write_direct32(priv, FH39_RSCSR_CHNL0_WPTR,
3251 q->write & ~0x7);
3252 iwl_release_nic_access(priv);
3253
3254 /* Else device is assumed to be awake */
3255 } else
3256 /* Device expects a multiple of 8 */
3257 iwl_write32(priv, FH39_RSCSR_CHNL0_WPTR, q->write & ~0x7);
3258
3259
3260 q->need_update = 0;
3261
3262 exit_unlock:
3263 spin_unlock_irqrestore(&q->lock, flags);
3264 return rc;
3265}
3266
3267/**
3268 * iwl3945_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr 3222 * iwl3945_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr
3269 */ 3223 */
3270static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl_priv *priv, 3224static inline __le32 iwl3945_dma_addr2rbd_ptr(struct iwl_priv *priv,
@@ -3320,7 +3274,7 @@ static int iwl3945_rx_queue_restock(struct iwl_priv *priv)
3320 spin_lock_irqsave(&rxq->lock, flags); 3274 spin_lock_irqsave(&rxq->lock, flags);
3321 rxq->need_update = 1; 3275 rxq->need_update = 1;
3322 spin_unlock_irqrestore(&rxq->lock, flags); 3276 spin_unlock_irqrestore(&rxq->lock, flags);
3323 rc = iwl3945_rx_queue_update_write_ptr(priv, rxq); 3277 rc = iwl_rx_queue_update_write_ptr(priv, rxq);
3324 if (rc) 3278 if (rc)
3325 return rc; 3279 return rc;
3326 } 3280 }
@@ -4007,7 +3961,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
4007 /* uCode wakes up after power-down sleep */ 3961 /* uCode wakes up after power-down sleep */
4008 if (inta & CSR_INT_BIT_WAKEUP) { 3962 if (inta & CSR_INT_BIT_WAKEUP) {
4009 IWL_DEBUG_ISR("Wakeup interrupt\n"); 3963 IWL_DEBUG_ISR("Wakeup interrupt\n");
4010 iwl3945_rx_queue_update_write_ptr(priv, &priv->rxq); 3964 iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
4011 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[0]); 3965 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[0]);
4012 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[1]); 3966 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[1]);
4013 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[2]); 3967 iwl3945_tx_queue_update_write_ptr(priv, &priv->txq[2]);