aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-08-24 15:06:33 -0400
committerStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 05:23:01 -0500
commitdb54eb57ce5edeebd621b12e23f3e1cdea7fe3ee (patch)
treeb35d26ec7d9095d3b4c6994bff5b4bfc2e8dc763
parent0c1a94e299eed7ea11ebc407d1e08a26c594abe5 (diff)
iwlegacy: rename il_{read,write}_prph
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945.c48
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-tx.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.c34
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c6
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-io.h23
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c12
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c18
7 files changed, 72 insertions, 71 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c
index fc8ddb68c7c4..cdea5b036480 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945.c
@@ -797,18 +797,18 @@ static int il3945_tx_reset(struct il_priv *il)
797{ 797{
798 798
799 /* bypass mode */ 799 /* bypass mode */
800 il_write_prph(il, ALM_SCD_MODE_REG, 0x2); 800 il_wr_prph(il, ALM_SCD_MODE_REG, 0x2);
801 801
802 /* RA 0 is active */ 802 /* RA 0 is active */
803 il_write_prph(il, ALM_SCD_ARASTAT_REG, 0x01); 803 il_wr_prph(il, ALM_SCD_ARASTAT_REG, 0x01);
804 804
805 /* all 6 fifo are active */ 805 /* all 6 fifo are active */
806 il_write_prph(il, ALM_SCD_TXFACT_REG, 0x3f); 806 il_wr_prph(il, ALM_SCD_TXFACT_REG, 0x3f);
807 807
808 il_write_prph(il, ALM_SCD_SBYP_MODE_1_REG, 0x010000); 808 il_wr_prph(il, ALM_SCD_SBYP_MODE_1_REG, 0x010000);
809 il_write_prph(il, ALM_SCD_SBYP_MODE_2_REG, 0x030002); 809 il_wr_prph(il, ALM_SCD_SBYP_MODE_2_REG, 0x030002);
810 il_write_prph(il, ALM_SCD_TXF4MF_REG, 0x000004); 810 il_wr_prph(il, ALM_SCD_TXF4MF_REG, 0x000004);
811 il_write_prph(il, ALM_SCD_TXF5MF_REG, 0x000005); 811 il_wr_prph(il, ALM_SCD_TXF5MF_REG, 0x000005);
812 812
813 il_wr(il, FH39_TSSR_CBB_BASE, 813 il_wr(il, FH39_TSSR_CBB_BASE,
814 il->_3945.shared_phys); 814 il->_3945.shared_phys);
@@ -878,8 +878,8 @@ static int il3945_apm_init(struct il_priv *il)
878 int ret = il_apm_init(il); 878 int ret = il_apm_init(il);
879 879
880 /* Clear APMG (NIC's internal power management) interrupts */ 880 /* Clear APMG (NIC's internal power management) interrupts */
881 il_write_prph(il, APMG_RTC_INT_MSK_REG, 0x0); 881 il_wr_prph(il, APMG_RTC_INT_MSK_REG, 0x0);
882 il_write_prph(il, APMG_RTC_INT_STT_REG, 0xFFFFFFFF); 882 il_wr_prph(il, APMG_RTC_INT_STT_REG, 0xFFFFFFFF);
883 883
884 /* Reset radio chip */ 884 /* Reset radio chip */
885 il_set_bits_prph(il, APMG_PS_CTRL_REG, 885 il_set_bits_prph(il, APMG_PS_CTRL_REG,
@@ -1025,8 +1025,8 @@ void il3945_hw_txq_ctx_stop(struct il_priv *il)
1025 int txq_id; 1025 int txq_id;
1026 1026
1027 /* stop SCD */ 1027 /* stop SCD */
1028 il_write_prph(il, ALM_SCD_MODE_REG, 0); 1028 il_wr_prph(il, ALM_SCD_MODE_REG, 0);
1029 il_write_prph(il, ALM_SCD_TXFACT_REG, 0); 1029 il_wr_prph(il, ALM_SCD_TXFACT_REG, 0);
1030 1030
1031 /* reset TFD queues */ 1031 /* reset TFD queues */
1032 for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) { 1032 for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
@@ -2475,11 +2475,11 @@ static int il3945_verify_bsm(struct il_priv *il)
2475 D_INFO("Begin verify bsm\n"); 2475 D_INFO("Begin verify bsm\n");
2476 2476
2477 /* verify BSM SRAM contents */ 2477 /* verify BSM SRAM contents */
2478 val = il_read_prph(il, BSM_WR_DWCOUNT_REG); 2478 val = il_rd_prph(il, BSM_WR_DWCOUNT_REG);
2479 for (reg = BSM_SRAM_LOWER_BOUND; 2479 for (reg = BSM_SRAM_LOWER_BOUND;
2480 reg < BSM_SRAM_LOWER_BOUND + len; 2480 reg < BSM_SRAM_LOWER_BOUND + len;
2481 reg += sizeof(u32), image++) { 2481 reg += sizeof(u32), image++) {
2482 val = il_read_prph(il, reg); 2482 val = il_rd_prph(il, reg);
2483 if (val != le32_to_cpu(*image)) { 2483 if (val != le32_to_cpu(*image)) {
2484 IL_ERR("BSM uCode verification failed at " 2484 IL_ERR("BSM uCode verification failed at "
2485 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n", 2485 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
@@ -2583,16 +2583,16 @@ static int il3945_load_bsm(struct il_priv *il)
2583 inst_len = il->ucode_init.len; 2583 inst_len = il->ucode_init.len;
2584 data_len = il->ucode_init_data.len; 2584 data_len = il->ucode_init_data.len;
2585 2585
2586 il_write_prph(il, BSM_DRAM_INST_PTR_REG, pinst); 2586 il_wr_prph(il, BSM_DRAM_INST_PTR_REG, pinst);
2587 il_write_prph(il, BSM_DRAM_DATA_PTR_REG, pdata); 2587 il_wr_prph(il, BSM_DRAM_DATA_PTR_REG, pdata);
2588 il_write_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, inst_len); 2588 il_wr_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
2589 il_write_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, data_len); 2589 il_wr_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
2590 2590
2591 /* Fill BSM memory with bootstrap instructions */ 2591 /* Fill BSM memory with bootstrap instructions */
2592 for (reg_offset = BSM_SRAM_LOWER_BOUND; 2592 for (reg_offset = BSM_SRAM_LOWER_BOUND;
2593 reg_offset < BSM_SRAM_LOWER_BOUND + len; 2593 reg_offset < BSM_SRAM_LOWER_BOUND + len;
2594 reg_offset += sizeof(u32), image++) 2594 reg_offset += sizeof(u32), image++)
2595 _il_write_prph(il, reg_offset, 2595 _il_wr_prph(il, reg_offset,
2596 le32_to_cpu(*image)); 2596 le32_to_cpu(*image));
2597 2597
2598 rc = il3945_verify_bsm(il); 2598 rc = il3945_verify_bsm(il);
@@ -2600,19 +2600,19 @@ static int il3945_load_bsm(struct il_priv *il)
2600 return rc; 2600 return rc;
2601 2601
2602 /* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */ 2602 /* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */
2603 il_write_prph(il, BSM_WR_MEM_SRC_REG, 0x0); 2603 il_wr_prph(il, BSM_WR_MEM_SRC_REG, 0x0);
2604 il_write_prph(il, BSM_WR_MEM_DST_REG, 2604 il_wr_prph(il, BSM_WR_MEM_DST_REG,
2605 IWL39_RTC_INST_LOWER_BOUND); 2605 IWL39_RTC_INST_LOWER_BOUND);
2606 il_write_prph(il, BSM_WR_DWCOUNT_REG, len / sizeof(u32)); 2606 il_wr_prph(il, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
2607 2607
2608 /* Load bootstrap code into instruction SRAM now, 2608 /* Load bootstrap code into instruction SRAM now,
2609 * to prepare to load "initialize" uCode */ 2609 * to prepare to load "initialize" uCode */
2610 il_write_prph(il, BSM_WR_CTRL_REG, 2610 il_wr_prph(il, BSM_WR_CTRL_REG,
2611 BSM_WR_CTRL_REG_BIT_START); 2611 BSM_WR_CTRL_REG_BIT_START);
2612 2612
2613 /* Wait for load of bootstrap uCode to finish */ 2613 /* Wait for load of bootstrap uCode to finish */
2614 for (i = 0; i < 100; i++) { 2614 for (i = 0; i < 100; i++) {
2615 done = il_read_prph(il, BSM_WR_CTRL_REG); 2615 done = il_rd_prph(il, BSM_WR_CTRL_REG);
2616 if (!(done & BSM_WR_CTRL_REG_BIT_START)) 2616 if (!(done & BSM_WR_CTRL_REG_BIT_START))
2617 break; 2617 break;
2618 udelay(10); 2618 udelay(10);
@@ -2626,7 +2626,7 @@ static int il3945_load_bsm(struct il_priv *il)
2626 2626
2627 /* Enable future boot loads whenever power management unit triggers it 2627 /* Enable future boot loads whenever power management unit triggers it
2628 * (e.g. when powering back up after power-save shutdown) */ 2628 * (e.g. when powering back up after power-save shutdown) */
2629 il_write_prph(il, BSM_WR_CTRL_REG, 2629 il_wr_prph(il, BSM_WR_CTRL_REG,
2630 BSM_WR_CTRL_REG_BIT_START_EN); 2630 BSM_WR_CTRL_REG_BIT_START_EN);
2631 2631
2632 return 0; 2632 return 0;
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 25c9b7192d9a..f86a3b90fc42 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -754,7 +754,7 @@ static void il4965_tx_queue_stop_scheduler(struct il_priv *il,
754{ 754{
755 /* Simply stop the queue, but don't change any configuration; 755 /* Simply stop the queue, but don't change any configuration;
756 * the SCD_ACT_EN bit is the write-enable mask for the ACTIVE bit. */ 756 * the SCD_ACT_EN bit is the write-enable mask for the ACTIVE bit. */
757 il_write_prph(il, 757 il_wr_prph(il,
758 IWL49_SCD_QUEUE_STATUS_BITS(txq_id), 758 IWL49_SCD_QUEUE_STATUS_BITS(txq_id),
759 (0 << IWL49_SCD_QUEUE_STTS_REG_POS_ACTIVE)| 759 (0 << IWL49_SCD_QUEUE_STTS_REG_POS_ACTIVE)|
760 (1 << IWL49_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); 760 (1 << IWL49_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN));
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c
index 7b422f2346ae..a7450323a668 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965.c
@@ -72,11 +72,11 @@ static int il4965_verify_bsm(struct il_priv *il)
72 D_INFO("Begin verify bsm\n"); 72 D_INFO("Begin verify bsm\n");
73 73
74 /* verify BSM SRAM contents */ 74 /* verify BSM SRAM contents */
75 val = il_read_prph(il, BSM_WR_DWCOUNT_REG); 75 val = il_rd_prph(il, BSM_WR_DWCOUNT_REG);
76 for (reg = BSM_SRAM_LOWER_BOUND; 76 for (reg = BSM_SRAM_LOWER_BOUND;
77 reg < BSM_SRAM_LOWER_BOUND + len; 77 reg < BSM_SRAM_LOWER_BOUND + len;
78 reg += sizeof(u32), image++) { 78 reg += sizeof(u32), image++) {
79 val = il_read_prph(il, reg); 79 val = il_rd_prph(il, reg);
80 if (val != le32_to_cpu(*image)) { 80 if (val != le32_to_cpu(*image)) {
81 IL_ERR("BSM uCode verification failed at " 81 IL_ERR("BSM uCode verification failed at "
82 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n", 82 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
@@ -156,34 +156,34 @@ static int il4965_load_bsm(struct il_priv *il)
156 inst_len = il->ucode_init.len; 156 inst_len = il->ucode_init.len;
157 data_len = il->ucode_init_data.len; 157 data_len = il->ucode_init_data.len;
158 158
159 il_write_prph(il, BSM_DRAM_INST_PTR_REG, pinst); 159 il_wr_prph(il, BSM_DRAM_INST_PTR_REG, pinst);
160 il_write_prph(il, BSM_DRAM_DATA_PTR_REG, pdata); 160 il_wr_prph(il, BSM_DRAM_DATA_PTR_REG, pdata);
161 il_write_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, inst_len); 161 il_wr_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, inst_len);
162 il_write_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, data_len); 162 il_wr_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, data_len);
163 163
164 /* Fill BSM memory with bootstrap instructions */ 164 /* Fill BSM memory with bootstrap instructions */
165 for (reg_offset = BSM_SRAM_LOWER_BOUND; 165 for (reg_offset = BSM_SRAM_LOWER_BOUND;
166 reg_offset < BSM_SRAM_LOWER_BOUND + len; 166 reg_offset < BSM_SRAM_LOWER_BOUND + len;
167 reg_offset += sizeof(u32), image++) 167 reg_offset += sizeof(u32), image++)
168 _il_write_prph(il, reg_offset, le32_to_cpu(*image)); 168 _il_wr_prph(il, reg_offset, le32_to_cpu(*image));
169 169
170 ret = il4965_verify_bsm(il); 170 ret = il4965_verify_bsm(il);
171 if (ret) 171 if (ret)
172 return ret; 172 return ret;
173 173
174 /* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */ 174 /* Tell BSM to copy from BSM SRAM into instruction SRAM, when asked */
175 il_write_prph(il, BSM_WR_MEM_SRC_REG, 0x0); 175 il_wr_prph(il, BSM_WR_MEM_SRC_REG, 0x0);
176 il_write_prph(il, 176 il_wr_prph(il,
177 BSM_WR_MEM_DST_REG, IWL49_RTC_INST_LOWER_BOUND); 177 BSM_WR_MEM_DST_REG, IWL49_RTC_INST_LOWER_BOUND);
178 il_write_prph(il, BSM_WR_DWCOUNT_REG, len / sizeof(u32)); 178 il_wr_prph(il, BSM_WR_DWCOUNT_REG, len / sizeof(u32));
179 179
180 /* Load bootstrap code into instruction SRAM now, 180 /* Load bootstrap code into instruction SRAM now,
181 * to prepare to load "initialize" uCode */ 181 * to prepare to load "initialize" uCode */
182 il_write_prph(il, BSM_WR_CTRL_REG, BSM_WR_CTRL_REG_BIT_START); 182 il_wr_prph(il, BSM_WR_CTRL_REG, BSM_WR_CTRL_REG_BIT_START);
183 183
184 /* Wait for load of bootstrap uCode to finish */ 184 /* Wait for load of bootstrap uCode to finish */
185 for (i = 0; i < 100; i++) { 185 for (i = 0; i < 100; i++) {
186 done = il_read_prph(il, BSM_WR_CTRL_REG); 186 done = il_rd_prph(il, BSM_WR_CTRL_REG);
187 if (!(done & BSM_WR_CTRL_REG_BIT_START)) 187 if (!(done & BSM_WR_CTRL_REG_BIT_START))
188 break; 188 break;
189 udelay(10); 189 udelay(10);
@@ -197,7 +197,7 @@ static int il4965_load_bsm(struct il_priv *il)
197 197
198 /* Enable future boot loads whenever power management unit triggers it 198 /* Enable future boot loads whenever power management unit triggers it
199 * (e.g. when powering back up after power-save shutdown) */ 199 * (e.g. when powering back up after power-save shutdown) */
200 il_write_prph(il, 200 il_wr_prph(il,
201 BSM_WR_CTRL_REG, BSM_WR_CTRL_REG_BIT_START_EN); 201 BSM_WR_CTRL_REG, BSM_WR_CTRL_REG_BIT_START_EN);
202 202
203 203
@@ -224,14 +224,14 @@ static int il4965_set_ucode_ptrs(struct il_priv *il)
224 pdata = il->ucode_data_backup.p_addr >> 4; 224 pdata = il->ucode_data_backup.p_addr >> 4;
225 225
226 /* Tell bootstrap uCode where to find image to load */ 226 /* Tell bootstrap uCode where to find image to load */
227 il_write_prph(il, BSM_DRAM_INST_PTR_REG, pinst); 227 il_wr_prph(il, BSM_DRAM_INST_PTR_REG, pinst);
228 il_write_prph(il, BSM_DRAM_DATA_PTR_REG, pdata); 228 il_wr_prph(il, BSM_DRAM_DATA_PTR_REG, pdata);
229 il_write_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, 229 il_wr_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG,
230 il->ucode_data.len); 230 il->ucode_data.len);
231 231
232 /* Inst byte count must be last to set up, bit 31 signals uCode 232 /* Inst byte count must be last to set up, bit 31 signals uCode
233 * that all new ptr/size info is in place */ 233 * that all new ptr/size info is in place */
234 il_write_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, 234 il_wr_prph(il, BSM_DRAM_INST_BYTECOUNT_REG,
235 il->ucode_code.len | BSM_DRAM_INST_LOAD); 235 il->ucode_code.len | BSM_DRAM_INST_LOAD);
236 D_INFO("Runtime uCode pointers are set.\n"); 236 D_INFO("Runtime uCode pointers are set.\n");
237 237
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index d2534fb01448..ed4415988e97 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -1069,7 +1069,7 @@ int il_apm_init(struct il_priv *il)
1069 1069
1070 /* 1070 /*
1071 * Wait for clock stabilization; once stabilized, access to 1071 * Wait for clock stabilization; once stabilized, access to
1072 * device-internal resources is supported, e.g. il_write_prph() 1072 * device-internal resources is supported, e.g. il_wr_prph()
1073 * and accesses to uCode SRAM. 1073 * and accesses to uCode SRAM.
1074 */ 1074 */
1075 ret = _il_poll_bit(il, CSR_GP_CNTRL, 1075 ret = _il_poll_bit(il, CSR_GP_CNTRL,
@@ -1089,10 +1089,10 @@ int il_apm_init(struct il_priv *il)
1089 * set by default in "CLK_CTRL_REG" after reset. 1089 * set by default in "CLK_CTRL_REG" after reset.
1090 */ 1090 */
1091 if (il->cfg->base_params->use_bsm) 1091 if (il->cfg->base_params->use_bsm)
1092 il_write_prph(il, APMG_CLK_EN_REG, 1092 il_wr_prph(il, APMG_CLK_EN_REG,
1093 APMG_CLK_VAL_DMA_CLK_RQT | APMG_CLK_VAL_BSM_CLK_RQT); 1093 APMG_CLK_VAL_DMA_CLK_RQT | APMG_CLK_VAL_BSM_CLK_RQT);
1094 else 1094 else
1095 il_write_prph(il, APMG_CLK_EN_REG, 1095 il_wr_prph(il, APMG_CLK_EN_REG,
1096 APMG_CLK_VAL_DMA_CLK_RQT); 1096 APMG_CLK_VAL_DMA_CLK_RQT);
1097 udelay(20); 1097 udelay(20);
1098 1098
diff --git a/drivers/net/wireless/iwlegacy/iwl-io.h b/drivers/net/wireless/iwlegacy/iwl-io.h
index f435942ab458..8cb924d1e264 100644
--- a/drivers/net/wireless/iwlegacy/iwl-io.h
+++ b/drivers/net/wireless/iwlegacy/iwl-io.h
@@ -197,26 +197,27 @@ static inline int il_poll_bit(struct il_priv *il, u32 addr,
197 return -ETIMEDOUT; 197 return -ETIMEDOUT;
198} 198}
199 199
200static inline u32 _il_read_prph(struct il_priv *il, u32 reg) 200static inline u32 _il_rd_prph(struct il_priv *il, u32 reg)
201{ 201{
202 _il_wr(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); 202 _il_wr(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
203 rmb(); 203 rmb();
204 return _il_rd(il, HBUS_TARG_PRPH_RDAT); 204 return _il_rd(il, HBUS_TARG_PRPH_RDAT);
205} 205}
206static inline u32 il_read_prph(struct il_priv *il, u32 reg) 206
207static inline u32 il_rd_prph(struct il_priv *il, u32 reg)
207{ 208{
208 unsigned long reg_flags; 209 unsigned long reg_flags;
209 u32 val; 210 u32 val;
210 211
211 spin_lock_irqsave(&il->reg_lock, reg_flags); 212 spin_lock_irqsave(&il->reg_lock, reg_flags);
212 _il_grab_nic_access(il); 213 _il_grab_nic_access(il);
213 val = _il_read_prph(il, reg); 214 val = _il_rd_prph(il, reg);
214 _il_release_nic_access(il); 215 _il_release_nic_access(il);
215 spin_unlock_irqrestore(&il->reg_lock, reg_flags); 216 spin_unlock_irqrestore(&il->reg_lock, reg_flags);
216 return val; 217 return val;
217} 218}
218 219
219static inline void _il_write_prph(struct il_priv *il, 220static inline void _il_wr_prph(struct il_priv *il,
220 u32 addr, u32 val) 221 u32 addr, u32 val)
221{ 222{
222 _il_wr(il, HBUS_TARG_PRPH_WADDR, 223 _il_wr(il, HBUS_TARG_PRPH_WADDR,
@@ -226,20 +227,20 @@ static inline void _il_write_prph(struct il_priv *il,
226} 227}
227 228
228static inline void 229static inline void
229il_write_prph(struct il_priv *il, u32 addr, u32 val) 230il_wr_prph(struct il_priv *il, u32 addr, u32 val)
230{ 231{
231 unsigned long reg_flags; 232 unsigned long reg_flags;
232 233
233 spin_lock_irqsave(&il->reg_lock, reg_flags); 234 spin_lock_irqsave(&il->reg_lock, reg_flags);
234 if (!_il_grab_nic_access(il)) { 235 if (!_il_grab_nic_access(il)) {
235 _il_write_prph(il, addr, val); 236 _il_wr_prph(il, addr, val);
236 _il_release_nic_access(il); 237 _il_release_nic_access(il);
237 } 238 }
238 spin_unlock_irqrestore(&il->reg_lock, reg_flags); 239 spin_unlock_irqrestore(&il->reg_lock, reg_flags);
239} 240}
240 241
241#define _il_set_bits_prph(il, reg, mask) \ 242#define _il_set_bits_prph(il, reg, mask) \
242_il_write_prph(il, reg, (_il_read_prph(il, reg) | mask)) 243_il_wr_prph(il, reg, (_il_rd_prph(il, reg) | mask))
243 244
244static inline void 245static inline void
245il_set_bits_prph(struct il_priv *il, u32 reg, u32 mask) 246il_set_bits_prph(struct il_priv *il, u32 reg, u32 mask)
@@ -254,8 +255,8 @@ il_set_bits_prph(struct il_priv *il, u32 reg, u32 mask)
254} 255}
255 256
256#define _il_set_bits_mask_prph(il, reg, bits, mask) \ 257#define _il_set_bits_mask_prph(il, reg, bits, mask) \
257_il_write_prph(il, reg, \ 258_il_wr_prph(il, reg, \
258 ((_il_read_prph(il, reg) & mask) | bits)) 259 ((_il_rd_prph(il, reg) & mask) | bits))
259 260
260static inline void il_set_bits_mask_prph(struct il_priv *il, u32 reg, 261static inline void il_set_bits_mask_prph(struct il_priv *il, u32 reg,
261 u32 bits, u32 mask) 262 u32 bits, u32 mask)
@@ -277,8 +278,8 @@ static inline void il_clear_bits_prph(struct il_priv
277 278
278 spin_lock_irqsave(&il->reg_lock, reg_flags); 279 spin_lock_irqsave(&il->reg_lock, reg_flags);
279 _il_grab_nic_access(il); 280 _il_grab_nic_access(il);
280 val = _il_read_prph(il, reg); 281 val = _il_rd_prph(il, reg);
281 _il_write_prph(il, reg, (val & ~mask)); 282 _il_wr_prph(il, reg, (val & ~mask));
282 _il_release_nic_access(il); 283 _il_release_nic_access(il);
283 spin_unlock_irqrestore(&il->reg_lock, reg_flags); 284 spin_unlock_irqrestore(&il->reg_lock, reg_flags);
284} 285}
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index a0b5a74972a9..5037216041ca 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -2122,14 +2122,14 @@ static int il3945_set_ucode_ptrs(struct il_priv *il)
2122 pdata = il->ucode_data_backup.p_addr; 2122 pdata = il->ucode_data_backup.p_addr;
2123 2123
2124 /* Tell bootstrap uCode where to find image to load */ 2124 /* Tell bootstrap uCode where to find image to load */
2125 il_write_prph(il, BSM_DRAM_INST_PTR_REG, pinst); 2125 il_wr_prph(il, BSM_DRAM_INST_PTR_REG, pinst);
2126 il_write_prph(il, BSM_DRAM_DATA_PTR_REG, pdata); 2126 il_wr_prph(il, BSM_DRAM_DATA_PTR_REG, pdata);
2127 il_write_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG, 2127 il_wr_prph(il, BSM_DRAM_DATA_BYTECOUNT_REG,
2128 il->ucode_data.len); 2128 il->ucode_data.len);
2129 2129
2130 /* Inst byte count must be last to set up, bit 31 signals uCode 2130 /* Inst byte count must be last to set up, bit 31 signals uCode
2131 * that all new ptr/size info is in place */ 2131 * that all new ptr/size info is in place */
2132 il_write_prph(il, BSM_DRAM_INST_BYTECOUNT_REG, 2132 il_wr_prph(il, BSM_DRAM_INST_BYTECOUNT_REG,
2133 il->ucode_code.len | BSM_DRAM_INST_LOAD); 2133 il->ucode_code.len | BSM_DRAM_INST_LOAD);
2134 2134
2135 D_INFO("Runtime uCode pointers are set.\n"); 2135 D_INFO("Runtime uCode pointers are set.\n");
@@ -2210,7 +2210,7 @@ static void il3945_alive_start(struct il_priv *il)
2210 goto restart; 2210 goto restart;
2211 } 2211 }
2212 2212
2213 rfkill = il_read_prph(il, APMG_RFKILL_REG); 2213 rfkill = il_rd_prph(il, APMG_RFKILL_REG);
2214 D_INFO("RFKILL status: 0x%x\n", rfkill); 2214 D_INFO("RFKILL status: 0x%x\n", rfkill);
2215 2215
2216 if (rfkill & 0x1) { 2216 if (rfkill & 0x1) {
@@ -2342,7 +2342,7 @@ static void __il3945_down(struct il_priv *il)
2342 il3945_hw_rxq_stop(il); 2342 il3945_hw_rxq_stop(il);
2343 2343
2344 /* Power-down device's busmaster DMA clocks */ 2344 /* Power-down device's busmaster DMA clocks */
2345 il_write_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT); 2345 il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
2346 udelay(5); 2346 udelay(5);
2347 2347
2348 /* Stop the device, and put it in low power state */ 2348 /* Stop the device, and put it in low power state */
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index b0668ea9b104..0f7d44c95f08 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -1622,7 +1622,7 @@ static int il4965_alive_notify(struct il_priv *il)
1622 spin_lock_irqsave(&il->lock, flags); 1622 spin_lock_irqsave(&il->lock, flags);
1623 1623
1624 /* Clear 4965's internal Tx Scheduler data base */ 1624 /* Clear 4965's internal Tx Scheduler data base */
1625 il->scd_base_addr = il_read_prph(il, 1625 il->scd_base_addr = il_rd_prph(il,
1626 IWL49_SCD_SRAM_BASE_ADDR); 1626 IWL49_SCD_SRAM_BASE_ADDR);
1627 a = il->scd_base_addr + IWL49_SCD_CONTEXT_DATA_OFFSET; 1627 a = il->scd_base_addr + IWL49_SCD_CONTEXT_DATA_OFFSET;
1628 for (; a < il->scd_base_addr + IWL49_SCD_TX_STTS_BITMAP_OFFSET; a += 4) 1628 for (; a < il->scd_base_addr + IWL49_SCD_TX_STTS_BITMAP_OFFSET; a += 4)
@@ -1634,7 +1634,7 @@ static int il4965_alive_notify(struct il_priv *il)
1634 il_write_targ_mem(il, a, 0); 1634 il_write_targ_mem(il, a, 0);
1635 1635
1636 /* Tel 4965 where to find Tx byte count tables */ 1636 /* Tel 4965 where to find Tx byte count tables */
1637 il_write_prph(il, IWL49_SCD_DRAM_BASE_ADDR, 1637 il_wr_prph(il, IWL49_SCD_DRAM_BASE_ADDR,
1638 il->scd_bc_tbls.dma >> 10); 1638 il->scd_bc_tbls.dma >> 10);
1639 1639
1640 /* Enable DMA channel */ 1640 /* Enable DMA channel */
@@ -1650,13 +1650,13 @@ static int il4965_alive_notify(struct il_priv *il)
1650 reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); 1650 reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN);
1651 1651
1652 /* Disable chain mode for all queues */ 1652 /* Disable chain mode for all queues */
1653 il_write_prph(il, IWL49_SCD_QUEUECHAIN_SEL, 0); 1653 il_wr_prph(il, IWL49_SCD_QUEUECHAIN_SEL, 0);
1654 1654
1655 /* Initialize each Tx queue (including the command queue) */ 1655 /* Initialize each Tx queue (including the command queue) */
1656 for (i = 0; i < il->hw_params.max_txq_num; i++) { 1656 for (i = 0; i < il->hw_params.max_txq_num; i++) {
1657 1657
1658 /* TFD circular buffer read/write indexes */ 1658 /* TFD circular buffer read/write indexes */
1659 il_write_prph(il, IWL49_SCD_QUEUE_RDPTR(i), 0); 1659 il_wr_prph(il, IWL49_SCD_QUEUE_RDPTR(i), 0);
1660 il_wr(il, HBUS_TARG_WRPTR, 0 | (i << 8)); 1660 il_wr(il, HBUS_TARG_WRPTR, 0 | (i << 8));
1661 1661
1662 /* Max Tx Window size for Scheduler-ACK mode */ 1662 /* Max Tx Window size for Scheduler-ACK mode */
@@ -1675,7 +1675,7 @@ static int il4965_alive_notify(struct il_priv *il)
1675 IWL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK); 1675 IWL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK);
1676 1676
1677 } 1677 }
1678 il_write_prph(il, IWL49_SCD_INTERRUPT_MASK, 1678 il_wr_prph(il, IWL49_SCD_INTERRUPT_MASK,
1679 (1 << il->hw_params.max_txq_num) - 1); 1679 (1 << il->hw_params.max_txq_num) - 1);
1680 1680
1681 /* Activate all Tx DMA/FIFO channels */ 1681 /* Activate all Tx DMA/FIFO channels */
@@ -1868,7 +1868,7 @@ static void __il4965_down(struct il_priv *il)
1868 il4965_rxq_stop(il); 1868 il4965_rxq_stop(il);
1869 1869
1870 /* Power-down device's busmaster DMA clocks */ 1870 /* Power-down device's busmaster DMA clocks */
1871 il_write_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT); 1871 il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
1872 udelay(5); 1872 udelay(5);
1873 1873
1874 /* Make sure (redundant) we've released our request to stay awake */ 1874 /* Make sure (redundant) we've released our request to stay awake */
@@ -2733,7 +2733,7 @@ void il4965_set_wr_ptrs(struct il_priv *il, int txq_id, u32 index)
2733{ 2733{
2734 il_wr(il, HBUS_TARG_WRPTR, 2734 il_wr(il, HBUS_TARG_WRPTR,
2735 (index & 0xff) | (txq_id << 8)); 2735 (index & 0xff) | (txq_id << 8));
2736 il_write_prph(il, IWL49_SCD_QUEUE_RDPTR(txq_id), index); 2736 il_wr_prph(il, IWL49_SCD_QUEUE_RDPTR(txq_id), index);
2737} 2737}
2738 2738
2739void il4965_tx_queue_set_status(struct il_priv *il, 2739void il4965_tx_queue_set_status(struct il_priv *il,
@@ -2746,7 +2746,7 @@ void il4965_tx_queue_set_status(struct il_priv *il,
2746 int active = test_bit(txq_id, &il->txq_ctx_active_msk) ? 1 : 0; 2746 int active = test_bit(txq_id, &il->txq_ctx_active_msk) ? 1 : 0;
2747 2747
2748 /* Set up and activate */ 2748 /* Set up and activate */
2749 il_write_prph(il, IWL49_SCD_QUEUE_STATUS_BITS(txq_id), 2749 il_wr_prph(il, IWL49_SCD_QUEUE_STATUS_BITS(txq_id),
2750 (active << IWL49_SCD_QUEUE_STTS_REG_POS_ACTIVE) | 2750 (active << IWL49_SCD_QUEUE_STTS_REG_POS_ACTIVE) |
2751 (tx_fifo_id << IWL49_SCD_QUEUE_STTS_REG_POS_TXF) | 2751 (tx_fifo_id << IWL49_SCD_QUEUE_STTS_REG_POS_TXF) |
2752 (scd_retry << IWL49_SCD_QUEUE_STTS_REG_POS_WSL) | 2752 (scd_retry << IWL49_SCD_QUEUE_STTS_REG_POS_WSL) |
@@ -3195,7 +3195,7 @@ static void __devexit il4965_pci_remove(struct pci_dev *pdev)
3195 */ 3195 */
3196void il4965_txq_set_sched(struct il_priv *il, u32 mask) 3196void il4965_txq_set_sched(struct il_priv *il, u32 mask)
3197{ 3197{
3198 il_write_prph(il, IWL49_SCD_TXFACT, mask); 3198 il_wr_prph(il, IWL49_SCD_TXFACT, mask);
3199} 3199}
3200 3200
3201/***************************************************************************** 3201/*****************************************************************************