aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinkler, Tomas <tomas.winkler@intel.com>2008-12-18 21:37:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:17 -0500
commit15b1687cb4f45b87ddbe4dfc7759ff5bb69497d2 (patch)
treec4e3e70b0d9b7ba877e52cd0a5116c4411bbf8e1
parent39aadf8c29ad959e823efca15381bea9d0770b1e (diff)
iwlwifi: replace IWL_ERROR with IWL_ERR
IWL_ERR doesn't use hidden priv pointer. 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>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-led.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c30
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c29
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c88
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c41
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-io.h18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rfkill.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-spectrum.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c35
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c192
21 files changed, 299 insertions, 272 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
index 165da9e314d9..958e705ec336 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
@@ -216,7 +216,7 @@ static int iwl3945_led_register_led(struct iwl_priv *priv,
216 216
217 ret = led_classdev_register(device, &led->led_dev); 217 ret = led_classdev_register(device, &led->led_dev);
218 if (ret) { 218 if (ret) {
219 IWL_ERROR("Error: failed to register led handler.\n"); 219 IWL_ERR(priv, "Error: failed to register led handler.\n");
220 return ret; 220 return ret;
221 } 221 }
222 222
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 4a2cc78f0d73..8cf40bcd6a05 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -152,7 +152,7 @@ void iwl3945_disable_events(struct iwl_priv *priv)
152 152
153 base = le32_to_cpu(priv->card_alive.log_event_table_ptr); 153 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
154 if (!iwl3945_hw_valid_rtc_data_addr(base)) { 154 if (!iwl3945_hw_valid_rtc_data_addr(base)) {
155 IWL_ERROR("Invalid event log pointer 0x%08X\n", base); 155 IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
156 return; 156 return;
157 } 157 }
158 158
@@ -224,7 +224,7 @@ __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
224 } 224 }
225 225
226 /* bad antenna selector value */ 226 /* bad antenna selector value */
227 IWL_ERROR("Bad antenna selector value (0x%x)\n", priv->antenna); 227 IWL_ERR(priv, "Bad antenna selector value (0x%x)\n", priv->antenna);
228 return 0; /* "diversity" is default if error */ 228 return 0; /* "diversity" is default if error */
229} 229}
230 230
@@ -344,7 +344,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
344 int fail; 344 int fail;
345 345
346 if ((index >= txq->q.n_bd) || (iwl3945_x2_queue_used(&txq->q, index) == 0)) { 346 if ((index >= txq->q.n_bd) || (iwl3945_x2_queue_used(&txq->q, index) == 0)) {
347 IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " 347 IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
348 "is out of range [0-%d] %d %d\n", txq_id, 348 "is out of range [0-%d] %d %d\n", txq_id,
349 index, txq->q.n_bd, txq->q.write_ptr, 349 index, txq->q.n_bd, txq->q.write_ptr,
350 txq->q.read_ptr); 350 txq->q.read_ptr);
@@ -376,7 +376,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
376 iwl3945_tx_queue_reclaim(priv, txq_id, index); 376 iwl3945_tx_queue_reclaim(priv, txq_id, index);
377 377
378 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 378 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
379 IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); 379 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
380} 380}
381 381
382 382
@@ -734,7 +734,7 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
734 pad = TFD_CTL_PAD_GET(le32_to_cpu(tfd->control_flags)); 734 pad = TFD_CTL_PAD_GET(le32_to_cpu(tfd->control_flags));
735 735
736 if ((count >= NUM_TFD_CHUNKS) || (count < 0)) { 736 if ((count >= NUM_TFD_CHUNKS) || (count < 0)) {
737 IWL_ERROR("Error can not send more than %d chunks\n", 737 IWL_ERR(priv, "Error can not send more than %d chunks\n",
738 NUM_TFD_CHUNKS); 738 NUM_TFD_CHUNKS);
739 return -EINVAL; 739 return -EINVAL;
740 } 740 }
@@ -771,7 +771,7 @@ int iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
771 /* sanity check */ 771 /* sanity check */
772 counter = TFD_CTL_COUNT_GET(le32_to_cpu(bd->control_flags)); 772 counter = TFD_CTL_COUNT_GET(le32_to_cpu(bd->control_flags));
773 if (counter > NUM_TFD_CHUNKS) { 773 if (counter > NUM_TFD_CHUNKS) {
774 IWL_ERROR("Too many chunks: %i\n", counter); 774 IWL_ERR(priv, "Too many chunks: %i\n", counter);
775 /* @todo issue fatal error, it is quite serious situation */ 775 /* @todo issue fatal error, it is quite serious situation */
776 return 0; 776 return 0;
777 } 777 }
@@ -1065,7 +1065,7 @@ static int iwl3945_txq_ctx_reset(struct iwl_priv *priv)
1065 rc = iwl3945_tx_queue_init(priv, &priv->txq39[txq_id], slots_num, 1065 rc = iwl3945_tx_queue_init(priv, &priv->txq39[txq_id], slots_num,
1066 txq_id); 1066 txq_id);
1067 if (rc) { 1067 if (rc) {
1068 IWL_ERROR("Tx %d queue init failed\n", txq_id); 1068 IWL_ERR(priv, "Tx %d queue init failed\n", txq_id);
1069 goto error; 1069 goto error;
1070 } 1070 }
1071 } 1071 }
@@ -1177,7 +1177,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
1177 if (!rxq->bd) { 1177 if (!rxq->bd) {
1178 rc = iwl3945_rx_queue_alloc(priv); 1178 rc = iwl3945_rx_queue_alloc(priv);
1179 if (rc) { 1179 if (rc) {
1180 IWL_ERROR("Unable to initialize Rx queue\n"); 1180 IWL_ERR(priv, "Unable to initialize Rx queue\n");
1181 return -ENOMEM; 1181 return -ENOMEM;
1182 } 1182 }
1183 } else 1183 } else
@@ -1377,7 +1377,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl_priv *priv)
1377 1377
1378 /* handle insane temp reading */ 1378 /* handle insane temp reading */
1379 if (iwl3945_hw_reg_temp_out_of_range(temperature)) { 1379 if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
1380 IWL_ERROR("Error bad temperature value %d\n", temperature); 1380 IWL_ERR(priv, "Error bad temperature value %d\n", temperature);
1381 1381
1382 /* if really really hot(?), 1382 /* if really really hot(?),
1383 * substitute the 3rd band/group's temp measured at factory */ 1383 * substitute the 3rd band/group's temp measured at factory */
@@ -1685,9 +1685,9 @@ int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv)
1685 priv->band, 1685 priv->band,
1686 le16_to_cpu(priv->active39_rxon.channel)); 1686 le16_to_cpu(priv->active39_rxon.channel));
1687 if (!ch_info) { 1687 if (!ch_info) {
1688 IWL_ERROR 1688 IWL_ERR(priv,
1689 ("Failed to get channel info for channel %d [%d]\n", 1689 "Failed to get channel info for channel %d [%d]\n",
1690 le16_to_cpu(priv->active39_rxon.channel), priv->band); 1690 le16_to_cpu(priv->active39_rxon.channel), priv->band);
1691 return -EINVAL; 1691 return -EINVAL;
1692 } 1692 }
1693 1693
@@ -2224,7 +2224,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
2224 ch_info->group_index, 2224 ch_info->group_index,
2225 &power_idx); 2225 &power_idx);
2226 if (rc) { 2226 if (rc) {
2227 IWL_ERROR("Invalid power index\n"); 2227 IWL_ERR(priv, "Invalid power index\n");
2228 return rc; 2228 return rc;
2229 } 2229 }
2230 pwr_info->base_power_index = (u8) power_idx; 2230 pwr_info->base_power_index = (u8) power_idx;
@@ -2300,7 +2300,7 @@ int iwl3945_hw_rxq_stop(struct iwl_priv *priv)
2300 rc = iwl_poll_direct_bit(priv, FH39_RSSR_STATUS, 2300 rc = iwl_poll_direct_bit(priv, FH39_RSSR_STATUS,
2301 FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000); 2301 FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
2302 if (rc < 0) 2302 if (rc < 0)
2303 IWL_ERROR("Can't stop Rx DMA.\n"); 2303 IWL_ERR(priv, "Can't stop Rx DMA.\n");
2304 2304
2305 iwl_release_nic_access(priv); 2305 iwl_release_nic_access(priv);
2306 spin_unlock_irqrestore(&priv->lock, flags); 2306 spin_unlock_irqrestore(&priv->lock, flags);
@@ -2440,7 +2440,7 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
2440 &priv->shared_phys); 2440 &priv->shared_phys);
2441 2441
2442 if (!priv->shared_virt) { 2442 if (!priv->shared_virt) {
2443 IWL_ERROR("failed to allocate pci memory\n"); 2443 IWL_ERR(priv, "failed to allocate pci memory\n");
2444 mutex_unlock(&priv->mutex); 2444 mutex_unlock(&priv->mutex);
2445 return -ENOMEM; 2445 return -ENOMEM;
2446 } 2446 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 3de8d6413994..e68d587a44b1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -85,7 +85,7 @@ static int iwl4965_verify_bsm(struct iwl_priv *priv)
85 reg += sizeof(u32), image++) { 85 reg += sizeof(u32), image++) {
86 val = iwl_read_prph(priv, reg); 86 val = iwl_read_prph(priv, reg);
87 if (val != le32_to_cpu(*image)) { 87 if (val != le32_to_cpu(*image)) {
88 IWL_ERROR("BSM uCode verification failed at " 88 IWL_ERR(priv, "BSM uCode verification failed at "
89 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n", 89 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
90 BSM_SRAM_LOWER_BOUND, 90 BSM_SRAM_LOWER_BOUND,
91 reg - BSM_SRAM_LOWER_BOUND, len, 91 reg - BSM_SRAM_LOWER_BOUND, len,
@@ -203,7 +203,7 @@ static int iwl4965_load_bsm(struct iwl_priv *priv)
203 if (i < 100) 203 if (i < 100)
204 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i); 204 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
205 else { 205 else {
206 IWL_ERROR("BSM write did not complete!\n"); 206 IWL_ERR(priv, "BSM write did not complete!\n");
207 return -EIO; 207 return -EIO;
208 } 208 }
209 209
@@ -523,7 +523,8 @@ static void iwl4965_chain_noise_reset(struct iwl_priv *priv)
523 cmd.diff_gain_c = 0; 523 cmd.diff_gain_c = 0;
524 if (iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD, 524 if (iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
525 sizeof(cmd), &cmd)) 525 sizeof(cmd), &cmd))
526 IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n"); 526 IWL_ERR(priv,
527 "Could not send REPLY_PHY_CALIBRATION_CMD\n");
527 data->state = IWL_CHAIN_NOISE_ACCUMULATE; 528 data->state = IWL_CHAIN_NOISE_ACCUMULATE;
528 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n"); 529 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
529 } 530 }
@@ -804,8 +805,9 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
804 805
805 if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) || 806 if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) ||
806 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) { 807 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
807 IWL_ERROR("invalid queues_num, should be between %d and %d\n", 808 IWL_ERR(priv,
808 IWL_MIN_NUM_QUEUES, IWL49_NUM_QUEUES); 809 "invalid queues_num, should be between %d and %d\n",
810 IWL_MIN_NUM_QUEUES, IWL49_NUM_QUEUES);
809 return -EINVAL; 811 return -EINVAL;
810 } 812 }
811 813
@@ -955,7 +957,7 @@ static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel,
955 957
956 s = iwl4965_get_sub_band(priv, channel); 958 s = iwl4965_get_sub_band(priv, channel);
957 if (s >= EEPROM_TX_POWER_BANDS) { 959 if (s >= EEPROM_TX_POWER_BANDS) {
958 IWL_ERROR("Tx Power can not find channel %d\n", channel); 960 IWL_ERR(priv, "Tx Power can not find channel %d\n", channel);
959 return -1; 961 return -1;
960 } 962 }
961 963
@@ -1319,7 +1321,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1319 * and 2) mimo txpower balance between Tx chains. */ 1321 * and 2) mimo txpower balance between Tx chains. */
1320 txatten_grp = iwl4965_get_tx_atten_grp(channel); 1322 txatten_grp = iwl4965_get_tx_atten_grp(channel);
1321 if (txatten_grp < 0) { 1323 if (txatten_grp < 0) {
1322 IWL_ERROR("Can't find txatten group for channel %d.\n", 1324 IWL_ERR(priv, "Can't find txatten group for channel %d.\n",
1323 channel); 1325 channel);
1324 return -EINVAL; 1326 return -EINVAL;
1325 } 1327 }
@@ -1727,7 +1729,7 @@ static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
1727 IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt); 1729 IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt);
1728 1730
1729 if (R3 == R1) { 1731 if (R3 == R1) {
1730 IWL_ERROR("Calibration conflict R1 == R3\n"); 1732 IWL_ERR(priv, "Calibration conflict R1 == R3\n");
1731 return -1; 1733 return -1;
1732 } 1734 }
1733 1735
@@ -2071,10 +2073,10 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2071 2073
2072 sc = le16_to_cpu(hdr->seq_ctrl); 2074 sc = le16_to_cpu(hdr->seq_ctrl);
2073 if (idx != (SEQ_TO_SN(sc) & 0xff)) { 2075 if (idx != (SEQ_TO_SN(sc) & 0xff)) {
2074 IWL_ERROR("BUG_ON idx doesn't match seq control" 2076 IWL_ERR(priv,
2075 " idx=%d, seq_idx=%d, seq=%d\n", 2077 "BUG_ON idx doesn't match seq control"
2076 idx, SEQ_TO_SN(sc), 2078 " idx=%d, seq_idx=%d, seq=%d\n",
2077 hdr->seq_ctrl); 2079 idx, SEQ_TO_SN(sc), hdr->seq_ctrl);
2078 return -1; 2080 return -1;
2079 } 2081 }
2080 2082
@@ -2133,7 +2135,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2133 u8 *qc = NULL; 2135 u8 *qc = NULL;
2134 2136
2135 if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { 2137 if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
2136 IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " 2138 IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
2137 "is out of range [0-%d] %d %d\n", txq_id, 2139 "is out of range [0-%d] %d %d\n", txq_id,
2138 index, txq->q.n_bd, txq->q.write_ptr, 2140 index, txq->q.n_bd, txq->q.write_ptr,
2139 txq->q.read_ptr); 2141 txq->q.read_ptr);
@@ -2151,7 +2153,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2151 2153
2152 sta_id = iwl_get_ra_sta_id(priv, hdr); 2154 sta_id = iwl_get_ra_sta_id(priv, hdr);
2153 if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) { 2155 if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) {
2154 IWL_ERROR("Station not known\n"); 2156 IWL_ERR(priv, "Station not known\n");
2155 return; 2157 return;
2156 } 2158 }
2157 2159
@@ -2214,7 +2216,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2214 iwl_txq_check_empty(priv, sta_id, tid, txq_id); 2216 iwl_txq_check_empty(priv, sta_id, tid, txq_id);
2215 2217
2216 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 2218 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
2217 IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); 2219 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
2218} 2220}
2219 2221
2220static int iwl4965_calc_rssi(struct iwl_priv *priv, 2222static int iwl4965_calc_rssi(struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 448bdb65bffe..76d86fe2b41d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -289,7 +289,7 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
289 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS); 289 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS);
290 break; 290 break;
291 default: 291 default:
292 IWL_ERROR("illegal indirect type: 0x%X\n", 292 IWL_ERR(priv, "illegal indirect type: 0x%X\n",
293 address & INDIRECT_TYPE_MSK); 293 address & INDIRECT_TYPE_MSK);
294 break; 294 break;
295 } 295 }
@@ -384,7 +384,8 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
384 ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD, 384 ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
385 sizeof(cmd), &cmd); 385 sizeof(cmd), &cmd);
386 if (ret) 386 if (ret)
387 IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n"); 387 IWL_ERR(priv,
388 "Could not send REPLY_PHY_CALIBRATION_CMD\n");
388 data->state = IWL_CHAIN_NOISE_ACCUMULATE; 389 data->state = IWL_CHAIN_NOISE_ACCUMULATE;
389 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n"); 390 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
390 } 391 }
@@ -507,7 +508,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
507 index = IWL_CALIB_BASE_BAND; 508 index = IWL_CALIB_BASE_BAND;
508 break; 509 break;
509 default: 510 default:
510 IWL_ERROR("Unknown calibration notification %d\n", 511 IWL_ERR(priv, "Unknown calibration notification %d\n",
511 hdr->op_code); 512 hdr->op_code);
512 return; 513 return;
513 } 514 }
@@ -589,12 +590,12 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
589 ret = wait_event_interruptible_timeout(priv->wait_command_queue, 590 ret = wait_event_interruptible_timeout(priv->wait_command_queue,
590 priv->ucode_write_complete, 5 * HZ); 591 priv->ucode_write_complete, 5 * HZ);
591 if (ret == -ERESTARTSYS) { 592 if (ret == -ERESTARTSYS) {
592 IWL_ERROR("Could not load the INST uCode section due " 593 IWL_ERR(priv, "Could not load the INST uCode section due "
593 "to interrupt\n"); 594 "to interrupt\n");
594 return ret; 595 return ret;
595 } 596 }
596 if (!ret) { 597 if (!ret) {
597 IWL_ERROR("Could not load the INST uCode section\n"); 598 IWL_ERR(priv, "Could not load the INST uCode section\n");
598 return -ETIMEDOUT; 599 return -ETIMEDOUT;
599 } 600 }
600 601
@@ -610,11 +611,11 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
610 ret = wait_event_interruptible_timeout(priv->wait_command_queue, 611 ret = wait_event_interruptible_timeout(priv->wait_command_queue,
611 priv->ucode_write_complete, 5 * HZ); 612 priv->ucode_write_complete, 5 * HZ);
612 if (ret == -ERESTARTSYS) { 613 if (ret == -ERESTARTSYS) {
613 IWL_ERROR("Could not load the INST uCode section due " 614 IWL_ERR(priv, "Could not load the INST uCode section due "
614 "to interrupt\n"); 615 "to interrupt\n");
615 return ret; 616 return ret;
616 } else if (!ret) { 617 } else if (!ret) {
617 IWL_ERROR("Could not load the DATA uCode section\n"); 618 IWL_ERR(priv, "Could not load the DATA uCode section\n");
618 return -ETIMEDOUT; 619 return -ETIMEDOUT;
619 } else 620 } else
620 ret = 0; 621 ret = 0;
@@ -826,8 +827,9 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
826{ 827{
827 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) || 828 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
828 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) { 829 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
829 IWL_ERROR("invalid queues_num, should be between %d and %d\n", 830 IWL_ERR(priv,
830 IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES); 831 "invalid queues_num, should be between %d and %d\n",
832 IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
831 return -EINVAL; 833 return -EINVAL;
832 } 834 }
833 835
@@ -1201,8 +1203,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1201 1203
1202 sc = le16_to_cpu(hdr->seq_ctrl); 1204 sc = le16_to_cpu(hdr->seq_ctrl);
1203 if (idx != (SEQ_TO_SN(sc) & 0xff)) { 1205 if (idx != (SEQ_TO_SN(sc) & 0xff)) {
1204 IWL_ERROR("BUG_ON idx doesn't match seq control" 1206 IWL_ERR(priv,
1205 " idx=%d, seq_idx=%d, seq=%d\n", 1207 "BUG_ON idx doesn't match seq control"
1208 " idx=%d, seq_idx=%d, seq=%d\n",
1206 idx, SEQ_TO_SN(sc), 1209 idx, SEQ_TO_SN(sc),
1207 hdr->seq_ctrl); 1210 hdr->seq_ctrl);
1208 return -1; 1211 return -1;
@@ -1258,7 +1261,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
1258 int freed; 1261 int freed;
1259 1262
1260 if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { 1263 if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
1261 IWL_ERROR("Read index for DMA queue txq_id (%d) index %d " 1264 IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
1262 "is out of range [0-%d] %d %d\n", txq_id, 1265 "is out of range [0-%d] %d %d\n", txq_id,
1263 index, txq->q.n_bd, txq->q.write_ptr, 1266 index, txq->q.n_bd, txq->q.write_ptr,
1264 txq->q.read_ptr); 1267 txq->q.read_ptr);
@@ -1332,7 +1335,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
1332 iwl_txq_check_empty(priv, sta_id, tid, txq_id); 1335 iwl_txq_check_empty(priv, sta_id, tid, txq_id);
1333 1336
1334 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 1337 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
1335 IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); 1338 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
1336} 1339}
1337 1340
1338/* Currently 5000 is the superset of everything */ 1341/* Currently 5000 is the superset of everything */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c
index 16e656a311a7..2c8e676c4b5d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c
@@ -101,7 +101,7 @@ int iwl_agn_check_rxon_cmd(struct iwl_priv *priv)
101 le16_to_cpu(rxon->channel)); 101 le16_to_cpu(rxon->channel));
102 102
103 if (error) { 103 if (error) {
104 IWL_ERROR("Not a valid iwl4965_rxon_assoc_cmd field values\n"); 104 IWL_ERR(priv, "Not a valid iwl_rxon_assoc_cmd field values\n");
105 return -1; 105 return -1;
106 } 106 }
107 return 0; 107 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index c0f8b96b9f8b..75b418e5e874 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -1431,7 +1431,8 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1431 if (!tbl->is_SGI) 1431 if (!tbl->is_SGI)
1432 break; 1432 break;
1433 else 1433 else
1434 IWL_ERROR("SGI was set in GF+SISO\n"); 1434 IWL_ERR(priv,
1435 "SGI was set in GF+SISO\n");
1435 } 1436 }
1436 search_tbl->is_SGI = !tbl->is_SGI; 1437 search_tbl->is_SGI = !tbl->is_SGI;
1437 rs_set_expected_tpt_table(lq_sta, search_tbl); 1438 rs_set_expected_tpt_table(lq_sta, search_tbl);
@@ -1748,13 +1749,13 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1748 rate_scale_index_msk = rate_mask; 1749 rate_scale_index_msk = rate_mask;
1749 1750
1750 if (!((1 << index) & rate_scale_index_msk)) { 1751 if (!((1 << index) & rate_scale_index_msk)) {
1751 IWL_ERROR("Current Rate is not valid\n"); 1752 IWL_ERR(priv, "Current Rate is not valid\n");
1752 return; 1753 return;
1753 } 1754 }
1754 1755
1755 /* Get expected throughput table and history window for current rate */ 1756 /* Get expected throughput table and history window for current rate */
1756 if (!tbl->expected_tpt) { 1757 if (!tbl->expected_tpt) {
1757 IWL_ERROR("tbl->expected_tpt is NULL\n"); 1758 IWL_ERR(priv, "tbl->expected_tpt is NULL\n");
1758 return; 1759 return;
1759 } 1760 }
1760 1761
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ce290f6867f3..1ef9f58fec85 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -181,7 +181,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
181 181
182 ret = iwl_agn_check_rxon_cmd(priv); 182 ret = iwl_agn_check_rxon_cmd(priv);
183 if (ret) { 183 if (ret) {
184 IWL_ERROR("Invalid RXON configuration. Not committing.\n"); 184 IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n");
185 return -EINVAL; 185 return -EINVAL;
186 } 186 }
187 187
@@ -191,7 +191,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
191 if (!iwl_full_rxon_required(priv)) { 191 if (!iwl_full_rxon_required(priv)) {
192 ret = iwl_send_rxon_assoc(priv); 192 ret = iwl_send_rxon_assoc(priv);
193 if (ret) { 193 if (ret) {
194 IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); 194 IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret);
195 return ret; 195 return ret;
196 } 196 }
197 197
@@ -218,7 +218,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
218 * active_rxon back to what it was previously */ 218 * active_rxon back to what it was previously */
219 if (ret) { 219 if (ret) {
220 active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK; 220 active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK;
221 IWL_ERROR("Error clearing ASSOC_MSK (%d)\n", ret); 221 IWL_ERR(priv, "Error clearing ASSOC_MSK (%d)\n", ret);
222 return ret; 222 return ret;
223 } 223 }
224 } 224 }
@@ -242,7 +242,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
242 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 242 ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
243 sizeof(struct iwl_rxon_cmd), &priv->staging_rxon); 243 sizeof(struct iwl_rxon_cmd), &priv->staging_rxon);
244 if (ret) { 244 if (ret) {
245 IWL_ERROR("Error setting new RXON (%d)\n", ret); 245 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
246 return ret; 246 return ret;
247 } 247 }
248 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); 248 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
@@ -256,7 +256,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
256 /* Add the broadcast address so we can send broadcast frames */ 256 /* Add the broadcast address so we can send broadcast frames */
257 if (iwl_rxon_add_station(priv, iwl_bcast_addr, 0) == 257 if (iwl_rxon_add_station(priv, iwl_bcast_addr, 0) ==
258 IWL_INVALID_STATION) { 258 IWL_INVALID_STATION) {
259 IWL_ERROR("Error adding BROADCAST address for transmit.\n"); 259 IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n");
260 return -EIO; 260 return -EIO;
261 } 261 }
262 262
@@ -267,13 +267,15 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
267 ret = iwl_rxon_add_station(priv, 267 ret = iwl_rxon_add_station(priv,
268 priv->active_rxon.bssid_addr, 1); 268 priv->active_rxon.bssid_addr, 1);
269 if (ret == IWL_INVALID_STATION) { 269 if (ret == IWL_INVALID_STATION) {
270 IWL_ERROR("Error adding AP address for TX.\n"); 270 IWL_ERR(priv,
271 "Error adding AP address for TX.\n");
271 return -EIO; 272 return -EIO;
272 } 273 }
273 priv->assoc_station_added = 1; 274 priv->assoc_station_added = 1;
274 if (priv->default_wep_key && 275 if (priv->default_wep_key &&
275 iwl_send_static_wepkey_cmd(priv, 0)) 276 iwl_send_static_wepkey_cmd(priv, 0))
276 IWL_ERROR("Could not send WEP static key.\n"); 277 IWL_ERR(priv,
278 "Could not send WEP static key.\n");
277 } 279 }
278 280
279 /* Apply the new configuration 281 /* Apply the new configuration
@@ -282,7 +284,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
282 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 284 ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
283 sizeof(struct iwl_rxon_cmd), &priv->staging_rxon); 285 sizeof(struct iwl_rxon_cmd), &priv->staging_rxon);
284 if (ret) { 286 if (ret) {
285 IWL_ERROR("Error setting new RXON (%d)\n", ret); 287 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
286 return ret; 288 return ret;
287 } 289 }
288 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); 290 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
@@ -294,7 +296,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
294 * send a new TXPOWER command or we won't be able to Tx any frames */ 296 * send a new TXPOWER command or we won't be able to Tx any frames */
295 ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 297 ret = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
296 if (ret) { 298 if (ret) {
297 IWL_ERROR("Error sending TX power (%d)\n", ret); 299 IWL_ERR(priv, "Error sending TX power (%d)\n", ret);
298 return ret; 300 return ret;
299 } 301 }
300 302
@@ -350,7 +352,7 @@ static struct iwl_frame *iwl_get_free_frame(struct iwl_priv *priv)
350 if (list_empty(&priv->free_frames)) { 352 if (list_empty(&priv->free_frames)) {
351 frame = kzalloc(sizeof(*frame), GFP_KERNEL); 353 frame = kzalloc(sizeof(*frame), GFP_KERNEL);
352 if (!frame) { 354 if (!frame) {
353 IWL_ERROR("Could not allocate frame!\n"); 355 IWL_ERR(priv, "Could not allocate frame!\n");
354 return NULL; 356 return NULL;
355 } 357 }
356 358
@@ -452,7 +454,7 @@ static int iwl_send_beacon_cmd(struct iwl_priv *priv)
452 frame = iwl_get_free_frame(priv); 454 frame = iwl_get_free_frame(priv);
453 455
454 if (!frame) { 456 if (!frame) {
455 IWL_ERROR("Could not obtain free frame buffer for beacon " 457 IWL_ERR(priv, "Could not obtain free frame buffer for beacon "
456 "command.\n"); 458 "command.\n");
457 return -ENOMEM; 459 return -ENOMEM;
458 } 460 }
@@ -686,7 +688,7 @@ static void iwl_connection_init_rx_config(struct iwl_priv *priv, int mode)
686 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; 688 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
687 break; 689 break;
688 default: 690 default:
689 IWL_ERROR("Unsupported interface type %d\n", mode); 691 IWL_ERR(priv, "Unsupported interface type %d\n", mode);
690 break; 692 break;
691 } 693 }
692 694
@@ -763,7 +765,7 @@ static void iwl_set_rate(struct iwl_priv *priv)
763 765
764 hw = iwl_get_hw_mode(priv, priv->band); 766 hw = iwl_get_hw_mode(priv, priv->band);
765 if (!hw) { 767 if (!hw) {
766 IWL_ERROR("Failed to set rate: unable to get hw mode\n"); 768 IWL_ERR(priv, "Failed to set rate: unable to get hw mode\n");
767 return; 769 return;
768 } 770 }
769 771
@@ -849,7 +851,7 @@ static void iwl_rx_reply_error(struct iwl_priv *priv,
849{ 851{
850 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 852 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
851 853
852 IWL_ERROR("Error Reply type 0x%08X cmd %s (0x%02X) " 854 IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
853 "seq 0x%04X ser 0x%08X\n", 855 "seq 0x%04X ser 0x%08X\n",
854 le32_to_cpu(pkt->u.err_resp.error_type), 856 le32_to_cpu(pkt->u.err_resp.error_type),
855 get_cmd_string(pkt->u.err_resp.cmd_id), 857 get_cmd_string(pkt->u.err_resp.cmd_id),
@@ -902,7 +904,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)
902 beacon = ieee80211_beacon_get(priv->hw, priv->vif); 904 beacon = ieee80211_beacon_get(priv->hw, priv->vif);
903 905
904 if (!beacon) { 906 if (!beacon) {
905 IWL_ERROR("update beacon failed\n"); 907 IWL_ERR(priv, "update beacon failed\n");
906 return; 908 return;
907 } 909 }
908 910
@@ -1357,7 +1359,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1357 1359
1358 /* Now service all interrupt bits discovered above. */ 1360 /* Now service all interrupt bits discovered above. */
1359 if (inta & CSR_INT_BIT_HW_ERR) { 1361 if (inta & CSR_INT_BIT_HW_ERR) {
1360 IWL_ERROR("Microcode HW error detected. Restarting.\n"); 1362 IWL_ERR(priv, "Microcode HW error detected. Restarting.\n");
1361 1363
1362 /* Tell the device to stop sending interrupts */ 1364 /* Tell the device to stop sending interrupts */
1363 iwl_disable_interrupts(priv); 1365 iwl_disable_interrupts(priv);
@@ -1411,14 +1413,14 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1411 1413
1412 /* Chip got too hot and stopped itself */ 1414 /* Chip got too hot and stopped itself */
1413 if (inta & CSR_INT_BIT_CT_KILL) { 1415 if (inta & CSR_INT_BIT_CT_KILL) {
1414 IWL_ERROR("Microcode CT kill error detected.\n"); 1416 IWL_ERR(priv, "Microcode CT kill error detected.\n");
1415 handled |= CSR_INT_BIT_CT_KILL; 1417 handled |= CSR_INT_BIT_CT_KILL;
1416 } 1418 }
1417 1419
1418 /* Error detected by uCode */ 1420 /* Error detected by uCode */
1419 if (inta & CSR_INT_BIT_SW_ERR) { 1421 if (inta & CSR_INT_BIT_SW_ERR) {
1420 IWL_ERROR("Microcode SW error detected. Restarting 0x%X.\n", 1422 IWL_ERR(priv, "Microcode SW error detected. "
1421 inta); 1423 " Restarting 0x%X.\n", inta);
1422 iwl_irq_handle_error(priv); 1424 iwl_irq_handle_error(priv);
1423 handled |= CSR_INT_BIT_SW_ERR; 1425 handled |= CSR_INT_BIT_SW_ERR;
1424 } 1426 }
@@ -1454,7 +1456,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1454 } 1456 }
1455 1457
1456 if (inta & ~handled) 1458 if (inta & ~handled)
1457 IWL_ERROR("Unhandled INTA bits 0x%08x\n", inta & ~handled); 1459 IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled);
1458 1460
1459 if (inta & ~CSR_INI_SET_MASK) { 1461 if (inta & ~CSR_INI_SET_MASK) {
1460 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n", 1462 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n",
@@ -1584,7 +1586,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1584 sprintf(buf, "%s%d%s", name_pre, index, ".ucode"); 1586 sprintf(buf, "%s%d%s", name_pre, index, ".ucode");
1585 ret = request_firmware(&ucode_raw, buf, &priv->pci_dev->dev); 1587 ret = request_firmware(&ucode_raw, buf, &priv->pci_dev->dev);
1586 if (ret < 0) { 1588 if (ret < 0) {
1587 IWL_ERROR("%s firmware file req failed: Reason %d\n", 1589 IWL_ERR(priv, "%s firmware file req failed: %d\n",
1588 buf, ret); 1590 buf, ret);
1589 if (ret == -ENOENT) 1591 if (ret == -ENOENT)
1590 continue; 1592 continue;
@@ -1592,8 +1594,11 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1592 goto error; 1594 goto error;
1593 } else { 1595 } else {
1594 if (index < api_max) 1596 if (index < api_max)
1595 IWL_ERROR("Loaded firmware %s, which is deprecated. Please use API v%u instead.\n", 1597 IWL_ERR(priv, "Loaded firmware %s, "
1598 "which is deprecated. "
1599 "Please use API v%u instead.\n",
1596 buf, api_max); 1600 buf, api_max);
1601
1597 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n", 1602 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n",
1598 buf, ucode_raw->size); 1603 buf, ucode_raw->size);
1599 break; 1604 break;
@@ -1605,7 +1610,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1605 1610
1606 /* Make sure that we got at least our header! */ 1611 /* Make sure that we got at least our header! */
1607 if (ucode_raw->size < sizeof(*ucode)) { 1612 if (ucode_raw->size < sizeof(*ucode)) {
1608 IWL_ERROR("File size way too small!\n"); 1613 IWL_ERR(priv, "File size way too small!\n");
1609 ret = -EINVAL; 1614 ret = -EINVAL;
1610 goto err_release; 1615 goto err_release;
1611 } 1616 }
@@ -1626,7 +1631,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1626 * on the API version read from firware header from here on forward */ 1631 * on the API version read from firware header from here on forward */
1627 1632
1628 if (api_ver < api_min || api_ver > api_max) { 1633 if (api_ver < api_min || api_ver > api_max) {
1629 IWL_ERROR("Driver unable to support your firmware API. " 1634 IWL_ERR(priv, "Driver unable to support your firmware API. "
1630 "Driver supports v%u, firmware is v%u.\n", 1635 "Driver supports v%u, firmware is v%u.\n",
1631 api_max, api_ver); 1636 api_max, api_ver);
1632 priv->ucode_ver = 0; 1637 priv->ucode_ver = 0;
@@ -1787,7 +1792,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1787 return 0; 1792 return 0;
1788 1793
1789 err_pci_alloc: 1794 err_pci_alloc:
1790 IWL_ERROR("failed to allocate pci memory\n"); 1795 IWL_ERR(priv, "failed to allocate pci memory\n");
1791 ret = -ENOMEM; 1796 ret = -ENOMEM;
1792 iwl_dealloc_ucode_pci(priv); 1797 iwl_dealloc_ucode_pci(priv);
1793 1798
@@ -2025,7 +2030,7 @@ static int __iwl_up(struct iwl_priv *priv)
2025 } 2030 }
2026 2031
2027 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) { 2032 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
2028 IWL_ERROR("ucode not available for device bringup\n"); 2033 IWL_ERR(priv, "ucode not available for device bringup\n");
2029 return -EIO; 2034 return -EIO;
2030 } 2035 }
2031 2036
@@ -2046,7 +2051,7 @@ static int __iwl_up(struct iwl_priv *priv)
2046 2051
2047 ret = iwl_hw_nic_init(priv); 2052 ret = iwl_hw_nic_init(priv);
2048 if (ret) { 2053 if (ret) {
2049 IWL_ERROR("Unable to init nic\n"); 2054 IWL_ERR(priv, "Unable to init nic\n");
2050 return ret; 2055 return ret;
2051 } 2056 }
2052 2057
@@ -2079,7 +2084,8 @@ static int __iwl_up(struct iwl_priv *priv)
2079 ret = priv->cfg->ops->lib->load_ucode(priv); 2084 ret = priv->cfg->ops->lib->load_ucode(priv);
2080 2085
2081 if (ret) { 2086 if (ret) {
2082 IWL_ERROR("Unable to set up bootstrap uCode: %d\n", ret); 2087 IWL_ERR(priv, "Unable to set up bootstrap uCode: %d\n",
2088 ret);
2083 continue; 2089 continue;
2084 } 2090 }
2085 2091
@@ -2100,7 +2106,7 @@ static int __iwl_up(struct iwl_priv *priv)
2100 2106
2101 /* tried to restart and config the device for as long as our 2107 /* tried to restart and config the device for as long as our
2102 * patience could withstand */ 2108 * patience could withstand */
2103 IWL_ERROR("Unable to initialize device after %d attempts.\n", i); 2109 IWL_ERR(priv, "Unable to initialize device after %d attempts.\n", i);
2104 return -EIO; 2110 return -EIO;
2105} 2111}
2106 2112
@@ -2240,7 +2246,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
2240 unsigned long flags; 2246 unsigned long flags;
2241 2247
2242 if (priv->iw_mode == NL80211_IFTYPE_AP) { 2248 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2243 IWL_ERROR("%s Should not be called in AP mode\n", __func__); 2249 IWL_ERR(priv, "%s Should not be called in AP mode\n", __func__);
2244 return; 2250 return;
2245 } 2251 }
2246 2252
@@ -2313,7 +2319,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
2313 break; 2319 break;
2314 2320
2315 default: 2321 default:
2316 IWL_ERROR("%s Should not be called in %d mode\n", 2322 IWL_ERR(priv, "%s Should not be called in %d mode\n",
2317 __func__, priv->iw_mode); 2323 __func__, priv->iw_mode);
2318 break; 2324 break;
2319 } 2325 }
@@ -2354,7 +2360,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2354 IWL_DEBUG_MAC80211("enter\n"); 2360 IWL_DEBUG_MAC80211("enter\n");
2355 2361
2356 if (pci_enable_device(priv->pci_dev)) { 2362 if (pci_enable_device(priv->pci_dev)) {
2357 IWL_ERROR("Fail to pci_enable_device\n"); 2363 IWL_ERR(priv, "Fail to pci_enable_device\n");
2358 return -ENODEV; 2364 return -ENODEV;
2359 } 2365 }
2360 pci_restore_state(priv->pci_dev); 2366 pci_restore_state(priv->pci_dev);
@@ -2370,7 +2376,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2370 ret = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED, 2376 ret = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED,
2371 DRV_NAME, priv); 2377 DRV_NAME, priv);
2372 if (ret) { 2378 if (ret) {
2373 IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq); 2379 IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq);
2374 goto out_disable_msi; 2380 goto out_disable_msi;
2375 } 2381 }
2376 2382
@@ -2384,7 +2390,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2384 if (!priv->ucode_code.len) { 2390 if (!priv->ucode_code.len) {
2385 ret = iwl_read_ucode(priv); 2391 ret = iwl_read_ucode(priv);
2386 if (ret) { 2392 if (ret) {
2387 IWL_ERROR("Could not read microcode: %d\n", ret); 2393 IWL_ERR(priv, "Could not read microcode: %d\n", ret);
2388 mutex_unlock(&priv->mutex); 2394 mutex_unlock(&priv->mutex);
2389 goto out_release_irq; 2395 goto out_release_irq;
2390 } 2396 }
@@ -2414,7 +2420,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2414 UCODE_READY_TIMEOUT); 2420 UCODE_READY_TIMEOUT);
2415 if (!ret) { 2421 if (!ret) {
2416 if (!test_bit(STATUS_READY, &priv->status)) { 2422 if (!test_bit(STATUS_READY, &priv->status)) {
2417 IWL_ERROR("START_ALIVE timeout after %dms.\n", 2423 IWL_ERR(priv, "START_ALIVE timeout after %dms.\n",
2418 jiffies_to_msecs(UCODE_READY_TIMEOUT)); 2424 jiffies_to_msecs(UCODE_READY_TIMEOUT));
2419 ret = -ETIMEDOUT; 2425 ret = -ETIMEDOUT;
2420 goto out_release_irq; 2426 goto out_release_irq;
@@ -2573,7 +2579,7 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2573 2579
2574 if (priv->iw_mode == NL80211_IFTYPE_ADHOC && 2580 if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
2575 !is_channel_ibss(ch_info)) { 2581 !is_channel_ibss(ch_info)) {
2576 IWL_ERROR("channel %d in band %d not IBSS channel\n", 2582 IWL_ERR(priv, "channel %d in band %d not IBSS channel\n",
2577 conf->channel->hw_value, conf->channel->band); 2583 conf->channel->hw_value, conf->channel->band);
2578 ret = -EINVAL; 2584 ret = -EINVAL;
2579 goto out; 2585 goto out;
@@ -3818,7 +3824,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3818 /* Read the EEPROM */ 3824 /* Read the EEPROM */
3819 err = iwl_eeprom_init(priv); 3825 err = iwl_eeprom_init(priv);
3820 if (err) { 3826 if (err) {
3821 IWL_ERROR("Unable to init EEPROM\n"); 3827 IWL_ERR(priv, "Unable to init EEPROM\n");
3822 goto out_iounmap; 3828 goto out_iounmap;
3823 } 3829 }
3824 err = iwl_eeprom_check_version(priv); 3830 err = iwl_eeprom_check_version(priv);
@@ -3834,7 +3840,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3834 * 5. Setup HW constants 3840 * 5. Setup HW constants
3835 ************************/ 3841 ************************/
3836 if (iwl_set_hw_params(priv)) { 3842 if (iwl_set_hw_params(priv)) {
3837 IWL_ERROR("failed to set hw parameters\n"); 3843 IWL_ERR(priv, "failed to set hw parameters\n");
3838 goto out_free_eeprom; 3844 goto out_free_eeprom;
3839 } 3845 }
3840 3846
@@ -3866,7 +3872,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3866 3872
3867 err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group); 3873 err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
3868 if (err) { 3874 if (err) {
3869 IWL_ERROR("failed to create sysfs device attributes\n"); 3875 IWL_ERR(priv, "failed to create sysfs device attributes\n");
3870 goto out_uninit_drv; 3876 goto out_uninit_drv;
3871 } 3877 }
3872 3878
@@ -3890,11 +3896,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3890 3896
3891 err = iwl_dbgfs_register(priv, DRV_NAME); 3897 err = iwl_dbgfs_register(priv, DRV_NAME);
3892 if (err) 3898 if (err)
3893 IWL_ERROR("failed to create debugfs files\n"); 3899 IWL_ERR(priv, "failed to create debugfs files\n");
3894 3900
3895 err = iwl_rfkill_init(priv); 3901 err = iwl_rfkill_init(priv);
3896 if (err) 3902 if (err)
3897 IWL_ERROR("Unable to initialize RFKILL system. " 3903 IWL_ERR(priv, "Unable to initialize RFKILL system. "
3898 "Ignoring error: %d\n", err); 3904 "Ignoring error: %d\n", err);
3899 iwl_power_initialize(priv); 3905 iwl_power_initialize(priv);
3900 return 0; 3906 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index f836ecc55758..d2aabbc38d6f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -102,7 +102,7 @@ int iwl_send_calib_results(struct iwl_priv *priv)
102 102
103 return 0; 103 return 0;
104err: 104err:
105 IWL_ERROR("Error %d iteration %d\n", ret, i); 105 IWL_ERR(priv, "Error %d iteration %d\n", ret, i);
106 return ret; 106 return ret;
107} 107}
108EXPORT_SYMBOL(iwl_send_calib_results); 108EXPORT_SYMBOL(iwl_send_calib_results);
@@ -483,7 +483,7 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
483 483
484 ret = iwl_send_cmd(priv, &cmd_out); 484 ret = iwl_send_cmd(priv, &cmd_out);
485 if (ret) 485 if (ret)
486 IWL_ERROR("SENSITIVITY_CMD failed\n"); 486 IWL_ERR(priv, "SENSITIVITY_CMD failed\n");
487 487
488 return ret; 488 return ret;
489} 489}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2bc461a610ad..cde233d1574e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -211,7 +211,7 @@ int iwl_hw_nic_init(struct iwl_priv *priv)
211 if (!rxq->bd) { 211 if (!rxq->bd) {
212 ret = iwl_rx_queue_alloc(priv); 212 ret = iwl_rx_queue_alloc(priv);
213 if (ret) { 213 if (ret) {
214 IWL_ERROR("Unable to initialize Rx queue\n"); 214 IWL_ERR(priv, "Unable to initialize Rx queue\n");
215 return -ENOMEM; 215 return -ENOMEM;
216 } 216 }
217 } else 217 } else
@@ -678,7 +678,7 @@ static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt)
678 break; 678 break;
679 case WLAN_HT_CAP_SM_PS_INVALID: 679 case WLAN_HT_CAP_SM_PS_INVALID:
680 default: 680 default:
681 IWL_ERROR("invalid mimo ps mode %d\n", 681 IWL_ERR(priv, "invalid mimo ps mode %d\n",
682 priv->current_ht_config.sm_ps); 682 priv->current_ht_config.sm_ps);
683 WARN_ON(1); 683 WARN_ON(1);
684 idle_cnt = -1; 684 idle_cnt = -1;
@@ -830,7 +830,7 @@ int iwl_setup_mac(struct iwl_priv *priv)
830 830
831 ret = ieee80211_register_hw(priv->hw); 831 ret = ieee80211_register_hw(priv->hw);
832 if (ret) { 832 if (ret) {
833 IWL_ERROR("Failed to register hw (error %d)\n", ret); 833 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
834 return ret; 834 return ret;
835 } 835 }
836 priv->mac80211_registered = 1; 836 priv->mac80211_registered = 1;
@@ -901,13 +901,13 @@ int iwl_init_drv(struct iwl_priv *priv)
901 901
902 ret = iwl_init_channel_map(priv); 902 ret = iwl_init_channel_map(priv);
903 if (ret) { 903 if (ret) {
904 IWL_ERROR("initializing regulatory failed: %d\n", ret); 904 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
905 goto err; 905 goto err;
906 } 906 }
907 907
908 ret = iwlcore_init_geos(priv); 908 ret = iwlcore_init_geos(priv);
909 if (ret) { 909 if (ret) {
910 IWL_ERROR("initializing geos failed: %d\n", ret); 910 IWL_ERR(priv, "initializing geos failed: %d\n", ret);
911 goto err_free_channel_map; 911 goto err_free_channel_map;
912 } 912 }
913 913
@@ -1059,7 +1059,7 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 *image,
1059 * if IWL_DL_IO is set */ 1059 * if IWL_DL_IO is set */
1060 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); 1060 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1061 if (val != le32_to_cpu(*image)) { 1061 if (val != le32_to_cpu(*image)) {
1062 IWL_ERROR("uCode INST section is invalid at " 1062 IWL_ERR(priv, "uCode INST section is invalid at "
1063 "offset 0x%x, is 0x%x, s/b 0x%x\n", 1063 "offset 0x%x, is 0x%x, s/b 0x%x\n",
1064 save_len - len, val, le32_to_cpu(*image)); 1064 save_len - len, val, le32_to_cpu(*image));
1065 ret = -EIO; 1065 ret = -EIO;
@@ -1115,7 +1115,7 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1115 return 0; 1115 return 0;
1116 } 1116 }
1117 1117
1118 IWL_ERROR("NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n"); 1118 IWL_ERR(priv, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
1119 1119
1120 /* Since nothing seems to match, show first several data entries in 1120 /* Since nothing seems to match, show first several data entries in
1121 * instruction SRAM, so maybe visual inspection will give a clue. 1121 * instruction SRAM, so maybe visual inspection will give a clue.
@@ -1187,7 +1187,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1187 base = le32_to_cpu(priv->card_alive.error_event_table_ptr); 1187 base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
1188 1188
1189 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 1189 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
1190 IWL_ERROR("Not valid error log pointer 0x%08X\n", base); 1190 IWL_ERR(priv, "Not valid error log pointer 0x%08X\n", base);
1191 return; 1191 return;
1192 } 1192 }
1193 1193
@@ -1200,8 +1200,9 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1200 count = iwl_read_targ_mem(priv, base); 1200 count = iwl_read_targ_mem(priv, base);
1201 1201
1202 if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) { 1202 if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
1203 IWL_ERROR("Start IWL Error Log Dump:\n"); 1203 IWL_ERR(priv, "Start IWL Error Log Dump:\n");
1204 IWL_ERROR("Status: 0x%08lX, count: %d\n", priv->status, count); 1204 IWL_ERR(priv, "Status: 0x%08lX, count: %d\n",
1205 priv->status, count);
1205 } 1206 }
1206 1207
1207 desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32)); 1208 desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
@@ -1214,12 +1215,12 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1214 line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32)); 1215 line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
1215 time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32)); 1216 time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
1216 1217
1217 IWL_ERROR("Desc Time " 1218 IWL_ERR(priv, "Desc Time "
1218 "data1 data2 line\n"); 1219 "data1 data2 line\n");
1219 IWL_ERROR("%-28s (#%02d) %010u 0x%08X 0x%08X %u\n", 1220 IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
1220 desc_lookup(desc), desc, time, data1, data2, line); 1221 desc_lookup(desc), desc, time, data1, data2, line);
1221 IWL_ERROR("blink1 blink2 ilink1 ilink2\n"); 1222 IWL_ERR(priv, "blink1 blink2 ilink1 ilink2\n");
1222 IWL_ERROR("0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2, 1223 IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
1223 ilink1, ilink2); 1224 ilink1, ilink2);
1224 1225
1225 iwl_release_nic_access(priv); 1226 iwl_release_nic_access(priv);
@@ -1265,11 +1266,11 @@ static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
1265 ptr += sizeof(u32); 1266 ptr += sizeof(u32);
1266 if (mode == 0) { 1267 if (mode == 0) {
1267 /* data, ev */ 1268 /* data, ev */
1268 IWL_ERROR("EVT_LOG:0x%08x:%04u\n", time, ev); 1269 IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n", time, ev);
1269 } else { 1270 } else {
1270 data = iwl_read_targ_mem(priv, ptr); 1271 data = iwl_read_targ_mem(priv, ptr);
1271 ptr += sizeof(u32); 1272 ptr += sizeof(u32);
1272 IWL_ERROR("EVT_LOGT:%010u:0x%08x:%04u\n", 1273 IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
1273 time, data, ev); 1274 time, data, ev);
1274 } 1275 }
1275 } 1276 }
@@ -1291,7 +1292,7 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv)
1291 base = le32_to_cpu(priv->card_alive.log_event_table_ptr); 1292 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1292 1293
1293 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 1294 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
1294 IWL_ERROR("Invalid event log pointer 0x%08X\n", base); 1295 IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
1295 return; 1296 return;
1296 } 1297 }
1297 1298
@@ -1311,12 +1312,12 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv)
1311 1312
1312 /* bail out if nothing in log */ 1313 /* bail out if nothing in log */
1313 if (size == 0) { 1314 if (size == 0) {
1314 IWL_ERROR("Start IWL Event Log Dump: nothing in log\n"); 1315 IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
1315 iwl_release_nic_access(priv); 1316 iwl_release_nic_access(priv);
1316 return; 1317 return;
1317 } 1318 }
1318 1319
1319 IWL_ERROR("Start IWL Event Log Dump: display count %d, wraps %d\n", 1320 IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n",
1320 size, num_wraps); 1321 size, num_wraps);
1321 1322
1322 /* if uCode has wrapped back to top of log, start at the oldest entry, 1323 /* if uCode has wrapped back to top of log, start at the oldest entry,
@@ -1348,7 +1349,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1348 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, 1349 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD,
1349 sizeof(cmd), &cmd); 1350 sizeof(cmd), &cmd);
1350 if (ret) 1351 if (ret)
1351 IWL_ERROR("REPLY_CT_KILL_CONFIG_CMD failed\n"); 1352 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n");
1352 else 1353 else
1353 IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded, " 1354 IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded, "
1354 "critical temperature is %d\n", 1355 "critical temperature is %d\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 654dc9cdd23f..057781c8f82a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -31,7 +31,6 @@
31 31
32struct iwl_priv; 32struct iwl_priv;
33 33
34#define IWL_ERROR(f, a...) dev_err(&(priv->pci_dev->dev), f, ## a)
35#define IWL_ERR(p, f, a...) dev_err(&((p)->pci_dev->dev), f, ## a) 34#define IWL_ERR(p, f, a...) dev_err(&((p)->pci_dev->dev), f, ## a)
36#define IWL_WARN(p, f, a...) dev_warn(&((p)->pci_dev->dev), f, ## a) 35#define IWL_WARN(p, f, a...) dev_warn(&((p)->pci_dev->dev), f, ## a)
37#define IWL_INFO(p, f, a...) dev_info(&((p)->pci_dev->dev), f, ## a) 36#define IWL_INFO(p, f, a...) dev_info(&((p)->pci_dev->dev), f, ## a)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index f27dbb922739..40441b8db89b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -306,14 +306,14 @@ static ssize_t iwl_dbgfs_eeprom_read(struct file *file,
306 buf_size = 4 * eeprom_len + 256; 306 buf_size = 4 * eeprom_len + 256;
307 307
308 if (eeprom_len % 16) { 308 if (eeprom_len % 16) {
309 IWL_ERROR("EEPROM size is not multiple of 16.\n"); 309 IWL_ERR(priv, "EEPROM size is not multiple of 16.\n");
310 return -ENODATA; 310 return -ENODATA;
311 } 311 }
312 312
313 /* 4 characters for byte 0xYY */ 313 /* 4 characters for byte 0xYY */
314 buf = kzalloc(buf_size, GFP_KERNEL); 314 buf = kzalloc(buf_size, GFP_KERNEL);
315 if (!buf) { 315 if (!buf) {
316 IWL_ERROR("Can not allocate Buffer\n"); 316 IWL_ERR(priv, "Can not allocate Buffer\n");
317 return -ENOMEM; 317 return -ENOMEM;
318 } 318 }
319 319
@@ -370,7 +370,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,
370 370
371 buf = kzalloc(bufsz, GFP_KERNEL); 371 buf = kzalloc(bufsz, GFP_KERNEL);
372 if (!buf) { 372 if (!buf) {
373 IWL_ERROR("Can not allocate Buffer\n"); 373 IWL_ERR(priv, "Can not allocate Buffer\n");
374 return -ENOMEM; 374 return -ENOMEM;
375 } 375 }
376 376
@@ -474,7 +474,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
474 return 0; 474 return 0;
475 475
476err: 476err:
477 IWL_ERROR("Can't open the debugfs directory\n"); 477 IWL_ERR(priv, "Can't open the debugfs directory\n");
478 iwl_dbgfs_unregister(priv); 478 iwl_dbgfs_unregister(priv);
479 return ret; 479 return ret;
480} 480}
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index ce2f47306cea..59abac09a788 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -145,7 +145,7 @@ int iwlcore_eeprom_verify_signature(struct iwl_priv *priv)
145{ 145{
146 u32 gp = iwl_read32(priv, CSR_EEPROM_GP); 146 u32 gp = iwl_read32(priv, CSR_EEPROM_GP);
147 if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { 147 if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) {
148 IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); 148 IWL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp);
149 return -ENOENT; 149 return -ENOENT;
150 } 150 }
151 return 0; 151 return 0;
@@ -223,7 +223,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
223 223
224 ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); 224 ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv);
225 if (ret < 0) { 225 if (ret < 0) {
226 IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); 226 IWL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp);
227 ret = -ENOENT; 227 ret = -ENOENT;
228 goto err; 228 goto err;
229 } 229 }
@@ -231,7 +231,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
231 /* Make sure driver (instead of uCode) is allowed to read EEPROM */ 231 /* Make sure driver (instead of uCode) is allowed to read EEPROM */
232 ret = priv->cfg->ops->lib->eeprom_ops.acquire_semaphore(priv); 232 ret = priv->cfg->ops->lib->eeprom_ops.acquire_semaphore(priv);
233 if (ret < 0) { 233 if (ret < 0) {
234 IWL_ERROR("Failed to acquire EEPROM semaphore.\n"); 234 IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n");
235 ret = -ENOENT; 235 ret = -ENOENT;
236 goto err; 236 goto err;
237 } 237 }
@@ -247,7 +247,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
247 CSR_EEPROM_REG_READ_VALID_MSK, 247 CSR_EEPROM_REG_READ_VALID_MSK,
248 IWL_EEPROM_ACCESS_TIMEOUT); 248 IWL_EEPROM_ACCESS_TIMEOUT);
249 if (ret < 0) { 249 if (ret < 0) {
250 IWL_ERROR("Time out reading EEPROM[%d]\n", addr); 250 IWL_ERR(priv, "Time out reading EEPROM[%d]\n", addr);
251 goto done; 251 goto done;
252 } 252 }
253 r = _iwl_read_direct32(priv, CSR_EEPROM_REG); 253 r = _iwl_read_direct32(priv, CSR_EEPROM_REG);
@@ -285,7 +285,7 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
285 285
286 return 0; 286 return 0;
287err: 287err:
288 IWL_ERROR("Unsupported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", 288 IWL_ERR(priv, "Unsupported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n",
289 eeprom_ver, priv->cfg->eeprom_ver, 289 eeprom_ver, priv->cfg->eeprom_ver,
290 calib_ver, priv->cfg->eeprom_calib_ver); 290 calib_ver, priv->cfg->eeprom_calib_ver);
291 return -EINVAL; 291 return -EINVAL;
@@ -450,7 +450,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)
450 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) * 450 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) *
451 priv->channel_count, GFP_KERNEL); 451 priv->channel_count, GFP_KERNEL);
452 if (!priv->channel_info) { 452 if (!priv->channel_info) {
453 IWL_ERROR("Could not allocate channel_info\n"); 453 IWL_ERR(priv, "Could not allocate channel_info\n");
454 priv->channel_count = 0; 454 priv->channel_count = 0;
455 return -ENOMEM; 455 return -ENOMEM;
456 } 456 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index 4b35b30e493e..af14d8fdcc79 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -109,14 +109,14 @@ static int iwl_generic_cmd_callback(struct iwl_priv *priv,
109 struct iwl_rx_packet *pkt = NULL; 109 struct iwl_rx_packet *pkt = NULL;
110 110
111 if (!skb) { 111 if (!skb) {
112 IWL_ERROR("Error: Response NULL in %s.\n", 112 IWL_ERR(priv, "Error: Response NULL in %s.\n",
113 get_cmd_string(cmd->hdr.cmd)); 113 get_cmd_string(cmd->hdr.cmd));
114 return 1; 114 return 1;
115 } 115 }
116 116
117 pkt = (struct iwl_rx_packet *)skb->data; 117 pkt = (struct iwl_rx_packet *)skb->data;
118 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { 118 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) {
119 IWL_ERROR("Bad return from %s (0x%08X)\n", 119 IWL_ERR(priv, "Bad return from %s (0x%08X)\n",
120 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 120 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
121 return 1; 121 return 1;
122 } 122 }
@@ -156,7 +156,7 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
156 156
157 ret = iwl_enqueue_hcmd(priv, cmd); 157 ret = iwl_enqueue_hcmd(priv, cmd);
158 if (ret < 0) { 158 if (ret < 0) {
159 IWL_ERROR("Error sending %s: enqueue_hcmd failed: %d\n", 159 IWL_ERR(priv, "Error sending %s: enqueue_hcmd failed: %d\n",
160 get_cmd_string(cmd->id), ret); 160 get_cmd_string(cmd->id), ret);
161 return ret; 161 return ret;
162 } 162 }
@@ -174,8 +174,9 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
174 BUG_ON(cmd->meta.u.callback != NULL); 174 BUG_ON(cmd->meta.u.callback != NULL);
175 175
176 if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) { 176 if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) {
177 IWL_ERROR("Error sending %s: Already sending a host command\n", 177 IWL_ERR(priv,
178 get_cmd_string(cmd->id)); 178 "Error sending %s: Already sending a host command\n",
179 get_cmd_string(cmd->id));
179 ret = -EBUSY; 180 ret = -EBUSY;
180 goto out; 181 goto out;
181 } 182 }
@@ -188,7 +189,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
188 cmd_idx = iwl_enqueue_hcmd(priv, cmd); 189 cmd_idx = iwl_enqueue_hcmd(priv, cmd);
189 if (cmd_idx < 0) { 190 if (cmd_idx < 0) {
190 ret = cmd_idx; 191 ret = cmd_idx;
191 IWL_ERROR("Error sending %s: enqueue_hcmd failed: %d\n", 192 IWL_ERR(priv, "Error sending %s: enqueue_hcmd failed: %d\n",
192 get_cmd_string(cmd->id), ret); 193 get_cmd_string(cmd->id), ret);
193 goto out; 194 goto out;
194 } 195 }
@@ -198,9 +199,10 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
198 HOST_COMPLETE_TIMEOUT); 199 HOST_COMPLETE_TIMEOUT);
199 if (!ret) { 200 if (!ret) {
200 if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) { 201 if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) {
201 IWL_ERROR("Error sending %s: time out after %dms.\n", 202 IWL_ERR(priv,
202 get_cmd_string(cmd->id), 203 "Error sending %s: time out after %dms.\n",
203 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT)); 204 get_cmd_string(cmd->id),
205 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
204 206
205 clear_bit(STATUS_HCMD_ACTIVE, &priv->status); 207 clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
206 ret = -ETIMEDOUT; 208 ret = -ETIMEDOUT;
@@ -221,7 +223,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
221 goto fail; 223 goto fail;
222 } 224 }
223 if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) { 225 if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) {
224 IWL_ERROR("Error: Response NULL in '%s'\n", 226 IWL_ERR(priv, "Error: Response NULL in '%s'\n",
225 get_cmd_string(cmd->id)); 227 get_cmd_string(cmd->id));
226 ret = -EIO; 228 ret = -EIO;
227 goto cancel; 229 goto cancel;
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h
index 0a92e7431ada..801d5ffd21e0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-io.h
+++ b/drivers/net/wireless/iwlwifi/iwl-io.h
@@ -167,7 +167,7 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
167 (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | 167 (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
168 CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50); 168 CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
169 if (ret < 0) { 169 if (ret < 0) {
170 IWL_ERROR("MAC is in deep sleep!\n"); 170 IWL_ERR(priv, "MAC is in deep sleep!\n");
171 return -EIO; 171 return -EIO;
172 } 172 }
173 173
@@ -182,7 +182,7 @@ static inline int __iwl_grab_nic_access(const char *f, u32 l,
182 struct iwl_priv *priv) 182 struct iwl_priv *priv)
183{ 183{
184 if (atomic_read(&priv->restrict_refcnt)) 184 if (atomic_read(&priv->restrict_refcnt))
185 IWL_ERROR("Grabbing access while already held %s %d.\n", f, l); 185 IWL_ERR(priv, "Grabbing access while already held %s %d.\n", f, l);
186 186
187 IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l); 187 IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l);
188 return _iwl_grab_nic_access(priv); 188 return _iwl_grab_nic_access(priv);
@@ -207,7 +207,7 @@ static inline void __iwl_release_nic_access(const char *f, u32 l,
207 struct iwl_priv *priv) 207 struct iwl_priv *priv)
208{ 208{
209 if (atomic_read(&priv->restrict_refcnt) <= 0) 209 if (atomic_read(&priv->restrict_refcnt) <= 0)
210 IWL_ERROR("Release unheld nic access at line %s %d.\n", f, l); 210 IWL_ERR(priv, "Release unheld nic access at line %s %d.\n", f, l);
211 211
212 IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l); 212 IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l);
213 _iwl_release_nic_access(priv); 213 _iwl_release_nic_access(priv);
@@ -229,7 +229,7 @@ static inline u32 __iwl_read_direct32(const char *f, u32 l,
229{ 229{
230 u32 value = _iwl_read_direct32(priv, reg); 230 u32 value = _iwl_read_direct32(priv, reg);
231 if (!atomic_read(&priv->restrict_refcnt)) 231 if (!atomic_read(&priv->restrict_refcnt))
232 IWL_ERROR("Nic access not held from %s %d\n", f, l); 232 IWL_ERR(priv, "Nic access not held from %s %d\n", f, l);
233 IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value, 233 IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
234 f, l); 234 f, l);
235 return value; 235 return value;
@@ -250,7 +250,7 @@ static void __iwl_write_direct32(const char *f , u32 line,
250 struct iwl_priv *priv, u32 reg, u32 value) 250 struct iwl_priv *priv, u32 reg, u32 value)
251{ 251{
252 if (!atomic_read(&priv->restrict_refcnt)) 252 if (!atomic_read(&priv->restrict_refcnt))
253 IWL_ERROR("Nic access not held from %s line %d\n", f, line); 253 IWL_ERR(priv, "Nic access not held from %s line %d\n", f, line);
254 _iwl_write_direct32(priv, reg, value); 254 _iwl_write_direct32(priv, reg, value);
255} 255}
256#define iwl_write_direct32(priv, reg, value) \ 256#define iwl_write_direct32(priv, reg, value) \
@@ -308,7 +308,7 @@ static inline u32 __iwl_read_prph(const char *f, u32 line,
308 struct iwl_priv *priv, u32 reg) 308 struct iwl_priv *priv, u32 reg)
309{ 309{
310 if (!atomic_read(&priv->restrict_refcnt)) 310 if (!atomic_read(&priv->restrict_refcnt))
311 IWL_ERROR("Nic access not held from %s line %d\n", f, line); 311 IWL_ERR(priv, "Nic access not held from %s line %d\n", f, line);
312 return _iwl_read_prph(priv, reg); 312 return _iwl_read_prph(priv, reg);
313} 313}
314 314
@@ -331,7 +331,7 @@ static inline void __iwl_write_prph(const char *f, u32 line,
331 struct iwl_priv *priv, u32 addr, u32 val) 331 struct iwl_priv *priv, u32 addr, u32 val)
332{ 332{
333 if (!atomic_read(&priv->restrict_refcnt)) 333 if (!atomic_read(&priv->restrict_refcnt))
334 IWL_ERROR("Nic access not held from %s line %d\n", f, line); 334 IWL_ERR(priv, "Nic access not held from %s line %d\n", f, line);
335 _iwl_write_prph(priv, addr, val); 335 _iwl_write_prph(priv, addr, val);
336} 336}
337 337
@@ -349,7 +349,7 @@ static inline void __iwl_set_bits_prph(const char *f, u32 line,
349 u32 reg, u32 mask) 349 u32 reg, u32 mask)
350{ 350{
351 if (!atomic_read(&priv->restrict_refcnt)) 351 if (!atomic_read(&priv->restrict_refcnt))
352 IWL_ERROR("Nic access not held from %s line %d\n", f, line); 352 IWL_ERR(priv, "Nic access not held from %s line %d\n", f, line);
353 353
354 _iwl_set_bits_prph(priv, reg, mask); 354 _iwl_set_bits_prph(priv, reg, mask);
355} 355}
@@ -367,7 +367,7 @@ static inline void __iwl_set_bits_mask_prph(const char *f, u32 line,
367 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) 367 struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
368{ 368{
369 if (!atomic_read(&priv->restrict_refcnt)) 369 if (!atomic_read(&priv->restrict_refcnt))
370 IWL_ERROR("Nic access not held from %s line %d\n", f, line); 370 IWL_ERR(priv, "Nic access not held from %s line %d\n", f, line);
371 _iwl_set_bits_mask_prph(priv, reg, bits, mask); 371 _iwl_set_bits_mask_prph(priv, reg, bits, mask);
372} 372}
373#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \ 373#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index 11eccd7d268c..98be90f245c8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -254,7 +254,7 @@ static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led,
254 254
255 ret = led_classdev_register(device, &led->led_dev); 255 ret = led_classdev_register(device, &led->led_dev);
256 if (ret) { 256 if (ret) {
257 IWL_ERROR("Error: failed to register led handler.\n"); 257 IWL_ERR(priv, "Error: failed to register led handler.\n");
258 return ret; 258 return ret;
259 } 259 }
260 260
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
index cece1c563939..98df755e21b1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
@@ -82,7 +82,7 @@ int iwl_rfkill_init(struct iwl_priv *priv)
82 IWL_DEBUG_RF_KILL("Initializing RFKILL.\n"); 82 IWL_DEBUG_RF_KILL("Initializing RFKILL.\n");
83 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN); 83 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN);
84 if (!priv->rfkill) { 84 if (!priv->rfkill) {
85 IWL_ERROR("Unable to allocate RFKILL device.\n"); 85 IWL_ERR(priv, "Unable to allocate RFKILL device.\n");
86 ret = -ENOMEM; 86 ret = -ENOMEM;
87 goto error; 87 goto error;
88 } 88 }
@@ -98,7 +98,7 @@ int iwl_rfkill_init(struct iwl_priv *priv)
98 98
99 ret = rfkill_register(priv->rfkill); 99 ret = rfkill_register(priv->rfkill);
100 if (ret) { 100 if (ret) {
101 IWL_ERROR("Unable to register RFKILL: %d\n", ret); 101 IWL_ERR(priv, "Unable to register RFKILL: %d\n", ret);
102 goto free_rfkill; 102 goto free_rfkill;
103 } 103 }
104 104
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 18c630d74a3c..bc3febe74d68 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -894,7 +894,7 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
894 rx_start = (struct iwl_rx_phy_res *)&priv->last_phy_res[1]; 894 rx_start = (struct iwl_rx_phy_res *)&priv->last_phy_res[1];
895 895
896 if (!rx_start) { 896 if (!rx_start) {
897 IWL_ERROR("MPDU frame without a PHY data\n"); 897 IWL_ERR(priv, "MPDU frame without a PHY data\n");
898 return; 898 return;
899 } 899 }
900 if (include_phy) { 900 if (include_phy) {
@@ -1020,7 +1020,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1020 } 1020 }
1021 1021
1022 if (!rx_start) { 1022 if (!rx_start) {
1023 IWL_ERROR("MPDU frame without a PHY data\n"); 1023 IWL_ERR(priv, "MPDU frame without a PHY data\n");
1024 return; 1024 return;
1025 } 1025 }
1026 1026
diff --git a/drivers/net/wireless/iwlwifi/iwl-spectrum.c b/drivers/net/wireless/iwlwifi/iwl-spectrum.c
index 836c3c80b69e..f4ed49701f69 100644
--- a/drivers/net/wireless/iwlwifi/iwl-spectrum.c
+++ b/drivers/net/wireless/iwlwifi/iwl-spectrum.c
@@ -146,7 +146,7 @@ static int iwl_get_measurement(struct iwl_priv *priv,
146 146
147 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 147 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
148 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 148 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
149 IWL_ERROR("Bad return from REPLY_RX_ON_ASSOC command\n"); 149 IWL_ERR(priv, "Bad return from REPLY_RX_ON_ASSOC command\n");
150 rc = -EIO; 150 rc = -EIO;
151 } 151 }
152 152
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 41e9013c7427..672574fb5262 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -87,7 +87,8 @@ static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
87 spin_lock_irqsave(&priv->sta_lock, flags); 87 spin_lock_irqsave(&priv->sta_lock, flags);
88 88
89 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) 89 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE))
90 IWL_ERROR("ACTIVATE a non DRIVER active station %d\n", sta_id); 90 IWL_ERR(priv, "ACTIVATE a non DRIVER active station %d\n",
91 sta_id);
91 92
92 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE; 93 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE;
93 IWL_DEBUG_ASSOC("Added STA to Ucode: %pM\n", 94 IWL_DEBUG_ASSOC("Added STA to Ucode: %pM\n",
@@ -105,13 +106,13 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,
105 u8 sta_id = addsta->sta.sta_id; 106 u8 sta_id = addsta->sta.sta_id;
106 107
107 if (!skb) { 108 if (!skb) {
108 IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n"); 109 IWL_ERR(priv, "Error: Response NULL in REPLY_ADD_STA.\n");
109 return 1; 110 return 1;
110 } 111 }
111 112
112 res = (struct iwl_rx_packet *)skb->data; 113 res = (struct iwl_rx_packet *)skb->data;
113 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 114 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
114 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", 115 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n",
115 res->hdr.flags); 116 res->hdr.flags);
116 return 1; 117 return 1;
117 } 118 }
@@ -155,7 +156,7 @@ static int iwl_send_add_sta(struct iwl_priv *priv,
155 156
156 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 157 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
157 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 158 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
158 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", 159 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n",
159 res->hdr.flags); 160 res->hdr.flags);
160 ret = -EIO; 161 ret = -EIO;
161 } 162 }
@@ -307,7 +308,7 @@ static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr)
307 308
308 /* Ucode must be active and driver must be non active */ 309 /* Ucode must be active and driver must be non active */
309 if (priv->stations[sta_id].used != IWL_STA_UCODE_ACTIVE) 310 if (priv->stations[sta_id].used != IWL_STA_UCODE_ACTIVE)
310 IWL_ERROR("removed non active STA %d\n", sta_id); 311 IWL_ERR(priv, "removed non active STA %d\n", sta_id);
311 312
312 priv->stations[sta_id].used &= ~IWL_STA_UCODE_ACTIVE; 313 priv->stations[sta_id].used &= ~IWL_STA_UCODE_ACTIVE;
313 314
@@ -324,13 +325,13 @@ static int iwl_remove_sta_callback(struct iwl_priv *priv,
324 const char *addr = rm_sta->addr; 325 const char *addr = rm_sta->addr;
325 326
326 if (!skb) { 327 if (!skb) {
327 IWL_ERROR("Error: Response NULL in REPLY_REMOVE_STA.\n"); 328 IWL_ERR(priv, "Error: Response NULL in REPLY_REMOVE_STA.\n");
328 return 1; 329 return 1;
329 } 330 }
330 331
331 res = (struct iwl_rx_packet *)skb->data; 332 res = (struct iwl_rx_packet *)skb->data;
332 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 333 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
333 IWL_ERROR("Bad return from REPLY_REMOVE_STA (0x%08X)\n", 334 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n",
334 res->hdr.flags); 335 res->hdr.flags);
335 return 1; 336 return 1;
336 } 337 }
@@ -340,7 +341,7 @@ static int iwl_remove_sta_callback(struct iwl_priv *priv,
340 iwl_sta_ucode_deactivate(priv, addr); 341 iwl_sta_ucode_deactivate(priv, addr);
341 break; 342 break;
342 default: 343 default:
343 IWL_ERROR("REPLY_REMOVE_STA failed\n"); 344 IWL_ERR(priv, "REPLY_REMOVE_STA failed\n");
344 break; 345 break;
345 } 346 }
346 347
@@ -378,7 +379,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,
378 379
379 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 380 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
380 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 381 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
381 IWL_ERROR("Bad return from REPLY_REMOVE_STA (0x%08X)\n", 382 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n",
382 res->hdr.flags); 383 res->hdr.flags);
383 ret = -EIO; 384 ret = -EIO;
384 } 385 }
@@ -391,7 +392,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,
391 break; 392 break;
392 default: 393 default:
393 ret = -EIO; 394 ret = -EIO;
394 IWL_ERROR("REPLY_REMOVE_STA failed\n"); 395 IWL_ERR(priv, "REPLY_REMOVE_STA failed\n");
395 break; 396 break;
396 } 397 }
397 } 398 }
@@ -433,13 +434,13 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
433 sta_id, addr); 434 sta_id, addr);
434 435
435 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) { 436 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) {
436 IWL_ERROR("Removing %pM but non DRIVER active\n", 437 IWL_ERR(priv, "Removing %pM but non DRIVER active\n",
437 addr); 438 addr);
438 goto out; 439 goto out;
439 } 440 }
440 441
441 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) { 442 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) {
442 IWL_ERROR("Removing %pM but non UCODE active\n", 443 IWL_ERR(priv, "Removing %pM but non UCODE active\n",
443 addr); 444 addr);
444 goto out; 445 goto out;
445 } 446 }
@@ -475,7 +476,7 @@ void iwl_clear_stations_table(struct iwl_priv *priv)
475 if (iwl_is_alive(priv) && 476 if (iwl_is_alive(priv) &&
476 !test_bit(STATUS_EXIT_PENDING, &priv->status) && 477 !test_bit(STATUS_EXIT_PENDING, &priv->status) &&
477 iwl_send_cmd_pdu_async(priv, REPLY_REMOVE_ALL_STA, 0, NULL, NULL)) 478 iwl_send_cmd_pdu_async(priv, REPLY_REMOVE_ALL_STA, 0, NULL, NULL))
478 IWL_ERROR("Couldn't clear the station table\n"); 479 IWL_ERR(priv, "Couldn't clear the station table\n");
479 480
480 priv->num_stations = 0; 481 priv->num_stations = 0;
481 memset(priv->stations, 0, sizeof(priv->stations)); 482 memset(priv->stations, 0, sizeof(priv->stations));
@@ -548,7 +549,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
548 spin_lock_irqsave(&priv->sta_lock, flags); 549 spin_lock_irqsave(&priv->sta_lock, flags);
549 550
550 if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table)) 551 if (!test_and_clear_bit(keyconf->keyidx, &priv->ucode_key_table))
551 IWL_ERROR("index %d not used in uCode key table.\n", 552 IWL_ERR(priv, "index %d not used in uCode key table.\n",
552 keyconf->keyidx); 553 keyconf->keyidx);
553 554
554 priv->default_wep_key--; 555 priv->default_wep_key--;
@@ -582,7 +583,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
582 priv->default_wep_key++; 583 priv->default_wep_key++;
583 584
584 if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table)) 585 if (test_and_set_bit(keyconf->keyidx, &priv->ucode_key_table))
585 IWL_ERROR("index %d already used in uCode key table.\n", 586 IWL_ERR(priv, "index %d already used in uCode key table.\n",
586 keyconf->keyidx); 587 keyconf->keyidx);
587 588
588 priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; 589 priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen;
@@ -820,7 +821,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
820 821
821 if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset, 822 if (!test_and_clear_bit(priv->stations[sta_id].sta.key.key_offset,
822 &priv->ucode_key_table)) 823 &priv->ucode_key_table))
823 IWL_ERROR("index %d not used in uCode key table.\n", 824 IWL_ERR(priv, "index %d not used in uCode key table.\n",
824 priv->stations[sta_id].sta.key.key_offset); 825 priv->stations[sta_id].sta.key.key_offset);
825 memset(&priv->stations[sta_id].keyinfo, 0, 826 memset(&priv->stations[sta_id].keyinfo, 0,
826 sizeof(struct iwl_hw_key)); 827 sizeof(struct iwl_hw_key));
@@ -857,7 +858,8 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
857 ret = iwl_set_wep_dynamic_key_info(priv, keyconf, sta_id); 858 ret = iwl_set_wep_dynamic_key_info(priv, keyconf, sta_id);
858 break; 859 break;
859 default: 860 default:
860 IWL_ERROR("Unknown alg: %s alg = %d\n", __func__, keyconf->alg); 861 IWL_ERR(priv,
862 "Unknown alg: %s alg = %d\n", __func__, keyconf->alg);
861 ret = -EINVAL; 863 ret = -EINVAL;
862 } 864 }
863 865
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index e829e86181ec..77a573f2c6ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -138,7 +138,7 @@ static void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
138 num_tbs = iwl_tfd_get_num_tbs(tfd); 138 num_tbs = iwl_tfd_get_num_tbs(tfd);
139 139
140 if (num_tbs >= IWL_NUM_OF_TBS) { 140 if (num_tbs >= IWL_NUM_OF_TBS) {
141 IWL_ERROR("Too many chunks: %i\n", num_tbs); 141 IWL_ERR(priv, "Too many chunks: %i\n", num_tbs);
142 /* @todo issue fatal error, it is quite serious situation */ 142 /* @todo issue fatal error, it is quite serious situation */
143 return; 143 return;
144 } 144 }
@@ -171,14 +171,14 @@ static int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
171 171
172 /* Each TFD can point to a maximum 20 Tx buffers */ 172 /* Each TFD can point to a maximum 20 Tx buffers */
173 if (num_tbs >= IWL_NUM_OF_TBS) { 173 if (num_tbs >= IWL_NUM_OF_TBS) {
174 IWL_ERROR("Error can not send more than %d chunks\n", 174 IWL_ERR(priv, "Error can not send more than %d chunks\n",
175 IWL_NUM_OF_TBS); 175 IWL_NUM_OF_TBS);
176 return -EINVAL; 176 return -EINVAL;
177 } 177 }
178 178
179 BUG_ON(addr & ~DMA_BIT_MASK(36)); 179 BUG_ON(addr & ~DMA_BIT_MASK(36));
180 if (unlikely(addr & ~IWL_TX_DMA_MASK)) 180 if (unlikely(addr & ~IWL_TX_DMA_MASK))
181 IWL_ERROR("Unaligned address = %llx\n", 181 IWL_ERR(priv, "Unaligned address = %llx\n",
182 (unsigned long long)addr); 182 (unsigned long long)addr);
183 183
184 iwl_tfd_set_tb(tfd, num_tbs, addr, len); 184 iwl_tfd_set_tb(tfd, num_tbs, addr, len);
@@ -395,7 +395,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
395 txq->txb = kmalloc(sizeof(txq->txb[0]) * 395 txq->txb = kmalloc(sizeof(txq->txb[0]) *
396 TFD_QUEUE_SIZE_MAX, GFP_KERNEL); 396 TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
397 if (!txq->txb) { 397 if (!txq->txb) {
398 IWL_ERROR("kmalloc for auxiliary BD " 398 IWL_ERR(priv, "kmalloc for auxiliary BD "
399 "structures failed\n"); 399 "structures failed\n");
400 goto error; 400 goto error;
401 } 401 }
@@ -409,7 +409,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
409 &txq->q.dma_addr); 409 &txq->q.dma_addr);
410 410
411 if (!txq->tfds) { 411 if (!txq->tfds) {
412 IWL_ERROR("pci_alloc_consistent(%zd) failed\n", 412 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
413 sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX); 413 sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX);
414 goto error; 414 goto error;
415 } 415 }
@@ -557,13 +557,13 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv)
557 ret = iwl_alloc_dma_ptr(priv, &priv->scd_bc_tbls, 557 ret = iwl_alloc_dma_ptr(priv, &priv->scd_bc_tbls,
558 priv->hw_params.scd_bc_tbls_size); 558 priv->hw_params.scd_bc_tbls_size);
559 if (ret) { 559 if (ret) {
560 IWL_ERROR("Scheduler BC Table allocation failed\n"); 560 IWL_ERR(priv, "Scheduler BC Table allocation failed\n");
561 goto error_bc_tbls; 561 goto error_bc_tbls;
562 } 562 }
563 /* Alloc keep-warm buffer */ 563 /* Alloc keep-warm buffer */
564 ret = iwl_alloc_dma_ptr(priv, &priv->kw, IWL_KW_SIZE); 564 ret = iwl_alloc_dma_ptr(priv, &priv->kw, IWL_KW_SIZE);
565 if (ret) { 565 if (ret) {
566 IWL_ERROR("Keep Warm allocation failed\n"); 566 IWL_ERR(priv, "Keep Warm allocation failed\n");
567 goto error_kw; 567 goto error_kw;
568 } 568 }
569 spin_lock_irqsave(&priv->lock, flags); 569 spin_lock_irqsave(&priv->lock, flags);
@@ -589,7 +589,7 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv)
589 ret = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num, 589 ret = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
590 txq_id); 590 txq_id);
591 if (ret) { 591 if (ret) {
592 IWL_ERROR("Tx %d queue init failed\n", txq_id); 592 IWL_ERR(priv, "Tx %d queue init failed\n", txq_id);
593 goto error; 593 goto error;
594 } 594 }
595 } 595 }
@@ -850,7 +850,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
850 850
851 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == 851 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) ==
852 IWL_INVALID_RATE) { 852 IWL_INVALID_RATE) {
853 IWL_ERROR("ERROR: No TX rate available.\n"); 853 IWL_ERR(priv, "ERROR: No TX rate available.\n");
854 goto drop_unlock; 854 goto drop_unlock;
855 } 855 }
856 856
@@ -1086,7 +1086,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
1086 } 1086 }
1087 1087
1088 if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) { 1088 if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
1089 IWL_ERROR("No space for Tx\n"); 1089 IWL_ERR(priv, "No space for Tx\n");
1090 return -ENOSPC; 1090 return -ENOSPC;
1091 } 1091 }
1092 1092
@@ -1163,7 +1163,7 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1163 int nfreed = 0; 1163 int nfreed = 0;
1164 1164
1165 if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) { 1165 if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {
1166 IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " 1166 IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
1167 "is out of range [0-%d] %d %d.\n", txq_id, 1167 "is out of range [0-%d] %d %d.\n", txq_id,
1168 index, q->n_bd, q->write_ptr, q->read_ptr); 1168 index, q->n_bd, q->write_ptr, q->read_ptr);
1169 return 0; 1169 return 0;
@@ -1203,7 +1203,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id,
1203 int nfreed = 0; 1203 int nfreed = 0;
1204 1204
1205 if ((idx >= q->n_bd) || (iwl_queue_used(q, idx) == 0)) { 1205 if ((idx >= q->n_bd) || (iwl_queue_used(q, idx) == 0)) {
1206 IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " 1206 IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
1207 "is out of range [0-%d] %d %d.\n", txq_id, 1207 "is out of range [0-%d] %d %d.\n", txq_id,
1208 idx, q->n_bd, q->write_ptr, q->read_ptr); 1208 idx, q->n_bd, q->write_ptr, q->read_ptr);
1209 return; 1209 return;
@@ -1218,7 +1218,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id,
1218 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 1218 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
1219 1219
1220 if (nfreed++ > 0) { 1220 if (nfreed++ > 0) {
1221 IWL_ERROR("HCMD skipped: index (%d) %d %d\n", idx, 1221 IWL_ERR(priv, "HCMD skipped: index (%d) %d %d\n", idx,
1222 q->write_ptr, q->read_ptr); 1222 q->write_ptr, q->read_ptr);
1223 queue_work(priv->workqueue, &priv->restart); 1223 queue_work(priv->workqueue, &priv->restart);
1224 } 1224 }
@@ -1314,7 +1314,7 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn)
1314 return -ENXIO; 1314 return -ENXIO;
1315 1315
1316 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { 1316 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) {
1317 IWL_ERROR("Start AGG when state is not IWL_AGG_OFF !\n"); 1317 IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n");
1318 return -ENXIO; 1318 return -ENXIO;
1319 } 1319 }
1320 1320
@@ -1354,7 +1354,7 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
1354 unsigned long flags; 1354 unsigned long flags;
1355 1355
1356 if (!ra) { 1356 if (!ra) {
1357 IWL_ERROR("ra = NULL\n"); 1357 IWL_ERR(priv, "ra = NULL\n");
1358 return -EINVAL; 1358 return -EINVAL;
1359 } 1359 }
1360 1360
@@ -1455,7 +1455,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv,
1455 struct ieee80211_tx_info *info; 1455 struct ieee80211_tx_info *info;
1456 1456
1457 if (unlikely(!agg->wait_for_ba)) { 1457 if (unlikely(!agg->wait_for_ba)) {
1458 IWL_ERROR("Received BA when not expected\n"); 1458 IWL_ERR(priv, "Received BA when not expected\n");
1459 return -EINVAL; 1459 return -EINVAL;
1460 } 1460 }
1461 1461
@@ -1528,7 +1528,8 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
1528 u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn); 1528 u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn);
1529 1529
1530 if (scd_flow >= priv->hw_params.max_txq_num) { 1530 if (scd_flow >= priv->hw_params.max_txq_num) {
1531 IWL_ERROR("BUG_ON scd_flow is bigger than number of queues\n"); 1531 IWL_ERR(priv,
1532 "BUG_ON scd_flow is bigger than number of queues\n");
1532 return; 1533 return;
1533 } 1534 }
1534 1535
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 26f53647bf36..52c9075b1889 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -185,7 +185,7 @@ static int iwl3945_tx_queue_alloc(struct iwl_priv *priv,
185 txq->txb = kmalloc(sizeof(txq->txb[0]) * 185 txq->txb = kmalloc(sizeof(txq->txb[0]) *
186 TFD_QUEUE_SIZE_MAX, GFP_KERNEL); 186 TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
187 if (!txq->txb) { 187 if (!txq->txb) {
188 IWL_ERROR("kmalloc for auxiliary BD " 188 IWL_ERR(priv, "kmalloc for auxiliary BD "
189 "structures failed\n"); 189 "structures failed\n");
190 goto error; 190 goto error;
191 } 191 }
@@ -199,7 +199,7 @@ static int iwl3945_tx_queue_alloc(struct iwl_priv *priv,
199 &txq->q.dma_addr); 199 &txq->q.dma_addr);
200 200
201 if (!txq->bd) { 201 if (!txq->bd) {
202 IWL_ERROR("pci_alloc_consistent(%zd) failed\n", 202 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
203 sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX); 203 sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX);
204 goto error; 204 goto error;
205 } 205 }
@@ -528,7 +528,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *
528 } 528 }
529 529
530 if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) { 530 if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
531 IWL_ERROR("No space for Tx\n"); 531 IWL_ERR(priv, "No space for Tx\n");
532 return -ENOSPC; 532 return -ENOSPC;
533 } 533 }
534 534
@@ -596,8 +596,9 @@ static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd
596 596
597 ret = iwl3945_enqueue_hcmd(priv, cmd); 597 ret = iwl3945_enqueue_hcmd(priv, cmd);
598 if (ret < 0) { 598 if (ret < 0) {
599 IWL_ERROR("Error sending %s: iwl3945_enqueue_hcmd failed: %d\n", 599 IWL_ERR(priv,
600 get_cmd_string(cmd->id), ret); 600 "Error sending %s: iwl3945_enqueue_hcmd failed: %d\n",
601 get_cmd_string(cmd->id), ret);
601 return ret; 602 return ret;
602 } 603 }
603 return 0; 604 return 0;
@@ -614,8 +615,9 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
614 BUG_ON(cmd->meta.u.callback != NULL); 615 BUG_ON(cmd->meta.u.callback != NULL);
615 616
616 if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) { 617 if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) {
617 IWL_ERROR("Error sending %s: Already sending a host command\n", 618 IWL_ERR(priv,
618 get_cmd_string(cmd->id)); 619 "Error sending %s: Already sending a host command\n",
620 get_cmd_string(cmd->id));
619 ret = -EBUSY; 621 ret = -EBUSY;
620 goto out; 622 goto out;
621 } 623 }
@@ -628,8 +630,9 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
628 cmd_idx = iwl3945_enqueue_hcmd(priv, cmd); 630 cmd_idx = iwl3945_enqueue_hcmd(priv, cmd);
629 if (cmd_idx < 0) { 631 if (cmd_idx < 0) {
630 ret = cmd_idx; 632 ret = cmd_idx;
631 IWL_ERROR("Error sending %s: iwl3945_enqueue_hcmd failed: %d\n", 633 IWL_ERR(priv,
632 get_cmd_string(cmd->id), ret); 634 "Error sending %s: iwl3945_enqueue_hcmd failed: %d\n",
635 get_cmd_string(cmd->id), ret);
633 goto out; 636 goto out;
634 } 637 }
635 638
@@ -638,7 +641,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
638 HOST_COMPLETE_TIMEOUT); 641 HOST_COMPLETE_TIMEOUT);
639 if (!ret) { 642 if (!ret) {
640 if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) { 643 if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) {
641 IWL_ERROR("Error sending %s: time out after %dms.\n", 644 IWL_ERR(priv, "Error sending %s: time out after %dms\n",
642 get_cmd_string(cmd->id), 645 get_cmd_string(cmd->id),
643 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT)); 646 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
644 647
@@ -661,7 +664,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
661 goto fail; 664 goto fail;
662 } 665 }
663 if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) { 666 if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) {
664 IWL_ERROR("Error: Response NULL in '%s'\n", 667 IWL_ERR(priv, "Error: Response NULL in '%s'\n",
665 get_cmd_string(cmd->id)); 668 get_cmd_string(cmd->id));
666 ret = -EIO; 669 ret = -EIO;
667 goto cancel; 670 goto cancel;
@@ -837,7 +840,7 @@ static int iwl3945_check_rxon_cmd(struct iwl_priv *priv)
837 le16_to_cpu(rxon->channel)); 840 le16_to_cpu(rxon->channel));
838 841
839 if (error) { 842 if (error) {
840 IWL_ERROR("Not a valid iwl3945_rxon_assoc_cmd field values\n"); 843 IWL_ERR(priv, "Not a valid rxon_assoc_cmd field values\n");
841 return -1; 844 return -1;
842 } 845 }
843 return 0; 846 return 0;
@@ -920,7 +923,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
920 923
921 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 924 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
922 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 925 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
923 IWL_ERROR("Bad return from REPLY_RXON_ASSOC command\n"); 926 IWL_ERR(priv, "Bad return from REPLY_RXON_ASSOC command\n");
924 rc = -EIO; 927 rc = -EIO;
925 } 928 }
926 929
@@ -957,7 +960,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
957 960
958 rc = iwl3945_check_rxon_cmd(priv); 961 rc = iwl3945_check_rxon_cmd(priv);
959 if (rc) { 962 if (rc) {
960 IWL_ERROR("Invalid RXON configuration. Not committing.\n"); 963 IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n");
961 return -EINVAL; 964 return -EINVAL;
962 } 965 }
963 966
@@ -967,7 +970,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
967 if (!iwl3945_full_rxon_required(priv)) { 970 if (!iwl3945_full_rxon_required(priv)) {
968 rc = iwl3945_send_rxon_assoc(priv); 971 rc = iwl3945_send_rxon_assoc(priv);
969 if (rc) { 972 if (rc) {
970 IWL_ERROR("Error setting RXON_ASSOC " 973 IWL_ERR(priv, "Error setting RXON_ASSOC "
971 "configuration (%d).\n", rc); 974 "configuration (%d).\n", rc);
972 return rc; 975 return rc;
973 } 976 }
@@ -994,7 +997,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
994 * active_rxon back to what it was previously */ 997 * active_rxon back to what it was previously */
995 if (rc) { 998 if (rc) {
996 active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK; 999 active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK;
997 IWL_ERROR("Error clearing ASSOC_MSK on current " 1000 IWL_ERR(priv, "Error clearing ASSOC_MSK on current "
998 "configuration (%d).\n", rc); 1001 "configuration (%d).\n", rc);
999 return rc; 1002 return rc;
1000 } 1003 }
@@ -1013,7 +1016,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
1013 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON, 1016 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON,
1014 sizeof(struct iwl3945_rxon_cmd), &priv->staging39_rxon); 1017 sizeof(struct iwl3945_rxon_cmd), &priv->staging39_rxon);
1015 if (rc) { 1018 if (rc) {
1016 IWL_ERROR("Error setting new configuration (%d).\n", rc); 1019 IWL_ERR(priv, "Error setting new configuration (%d).\n", rc);
1017 return rc; 1020 return rc;
1018 } 1021 }
1019 1022
@@ -1025,14 +1028,14 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
1025 * send a new TXPOWER command or we won't be able to Tx any frames */ 1028 * send a new TXPOWER command or we won't be able to Tx any frames */
1026 rc = iwl3945_hw_reg_send_txpower(priv); 1029 rc = iwl3945_hw_reg_send_txpower(priv);
1027 if (rc) { 1030 if (rc) {
1028 IWL_ERROR("Error setting Tx power (%d).\n", rc); 1031 IWL_ERR(priv, "Error setting Tx power (%d).\n", rc);
1029 return rc; 1032 return rc;
1030 } 1033 }
1031 1034
1032 /* Add the broadcast address so we can send broadcast frames */ 1035 /* Add the broadcast address so we can send broadcast frames */
1033 if (iwl3945_add_station(priv, iwl_bcast_addr, 0, 0) == 1036 if (iwl3945_add_station(priv, iwl_bcast_addr, 0, 0) ==
1034 IWL_INVALID_STATION) { 1037 IWL_INVALID_STATION) {
1035 IWL_ERROR("Error adding BROADCAST address for transmit.\n"); 1038 IWL_ERR(priv, "Error adding BROADCAST address for transmit.\n");
1036 return -EIO; 1039 return -EIO;
1037 } 1040 }
1038 1041
@@ -1042,14 +1045,14 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
1042 (priv->iw_mode == NL80211_IFTYPE_STATION)) 1045 (priv->iw_mode == NL80211_IFTYPE_STATION))
1043 if (iwl3945_add_station(priv, priv->active39_rxon.bssid_addr, 1, 0) 1046 if (iwl3945_add_station(priv, priv->active39_rxon.bssid_addr, 1, 0)
1044 == IWL_INVALID_STATION) { 1047 == IWL_INVALID_STATION) {
1045 IWL_ERROR("Error adding AP address for transmit.\n"); 1048 IWL_ERR(priv, "Error adding AP address for transmit\n");
1046 return -EIO; 1049 return -EIO;
1047 } 1050 }
1048 1051
1049 /* Init the hardware's rate fallback order based on the band */ 1052 /* Init the hardware's rate fallback order based on the band */
1050 rc = iwl3945_init_hw_rate_table(priv); 1053 rc = iwl3945_init_hw_rate_table(priv);
1051 if (rc) { 1054 if (rc) {
1052 IWL_ERROR("Error setting HW rate table: %02X\n", rc); 1055 IWL_ERR(priv, "Error setting HW rate table: %02X\n", rc);
1053 return -EIO; 1056 return -EIO;
1054 } 1057 }
1055 1058
@@ -1149,13 +1152,13 @@ static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv,
1149 struct iwl_rx_packet *res = NULL; 1152 struct iwl_rx_packet *res = NULL;
1150 1153
1151 if (!skb) { 1154 if (!skb) {
1152 IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n"); 1155 IWL_ERR(priv, "Error: Response NULL in REPLY_ADD_STA.\n");
1153 return 1; 1156 return 1;
1154 } 1157 }
1155 1158
1156 res = (struct iwl_rx_packet *)skb->data; 1159 res = (struct iwl_rx_packet *)skb->data;
1157 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 1160 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
1158 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", 1161 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n",
1159 res->hdr.flags); 1162 res->hdr.flags);
1160 return 1; 1163 return 1;
1161 } 1164 }
@@ -1195,7 +1198,7 @@ int iwl3945_send_add_station(struct iwl_priv *priv,
1195 1198
1196 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 1199 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
1197 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 1200 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
1198 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", 1201 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n",
1199 res->hdr.flags); 1202 res->hdr.flags);
1200 rc = -EIO; 1203 rc = -EIO;
1201 } 1204 }
@@ -1302,7 +1305,7 @@ static struct iwl3945_frame *iwl3945_get_free_frame(struct iwl_priv *priv)
1302 if (list_empty(&priv->free_frames)) { 1305 if (list_empty(&priv->free_frames)) {
1303 frame = kzalloc(sizeof(*frame), GFP_KERNEL); 1306 frame = kzalloc(sizeof(*frame), GFP_KERNEL);
1304 if (!frame) { 1307 if (!frame) {
1305 IWL_ERROR("Could not allocate frame!\n"); 1308 IWL_ERR(priv, "Could not allocate frame!\n");
1306 return NULL; 1309 return NULL;
1307 } 1310 }
1308 1311
@@ -1373,7 +1376,7 @@ static int iwl3945_send_beacon_cmd(struct iwl_priv *priv)
1373 frame = iwl3945_get_free_frame(priv); 1376 frame = iwl3945_get_free_frame(priv);
1374 1377
1375 if (!frame) { 1378 if (!frame) {
1376 IWL_ERROR("Could not obtain free frame buffer for beacon " 1379 IWL_ERR(priv, "Could not obtain free frame buffer for beacon "
1377 "command.\n"); 1380 "command.\n");
1378 return -ENOMEM; 1381 return -ENOMEM;
1379 } 1382 }
@@ -1437,14 +1440,14 @@ int iwl3945_eeprom_init(struct iwl_priv *priv)
1437 BUILD_BUG_ON(sizeof(priv->eeprom39) != IWL_EEPROM_IMAGE_SIZE); 1440 BUILD_BUG_ON(sizeof(priv->eeprom39) != IWL_EEPROM_IMAGE_SIZE);
1438 1441
1439 if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { 1442 if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) {
1440 IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); 1443 IWL_ERR(priv, "EEPROM not found, EEPROM_GP=0x%08x\n", gp);
1441 return -ENOENT; 1444 return -ENOENT;
1442 } 1445 }
1443 1446
1444 /* Make sure driver (instead of uCode) is allowed to read EEPROM */ 1447 /* Make sure driver (instead of uCode) is allowed to read EEPROM */
1445 ret = iwl3945_eeprom_acquire_semaphore(priv); 1448 ret = iwl3945_eeprom_acquire_semaphore(priv);
1446 if (ret < 0) { 1449 if (ret < 0) {
1447 IWL_ERROR("Failed to acquire EEPROM semaphore.\n"); 1450 IWL_ERR(priv, "Failed to acquire EEPROM semaphore.\n");
1448 return -ENOENT; 1451 return -ENOENT;
1449 } 1452 }
1450 1453
@@ -1459,7 +1462,7 @@ int iwl3945_eeprom_init(struct iwl_priv *priv)
1459 CSR_EEPROM_REG_READ_VALID_MSK, 1462 CSR_EEPROM_REG_READ_VALID_MSK,
1460 IWL_EEPROM_ACCESS_TIMEOUT); 1463 IWL_EEPROM_ACCESS_TIMEOUT);
1461 if (ret < 0) { 1464 if (ret < 0) {
1462 IWL_ERROR("Time out reading EEPROM[%d]\n", addr); 1465 IWL_ERR(priv, "Time out reading EEPROM[%d]\n", addr);
1463 return ret; 1466 return ret;
1464 } 1467 }
1465 1468
@@ -2120,7 +2123,7 @@ static void iwl3945_connection_init_rx_config(struct iwl_priv *priv,
2120 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; 2123 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
2121 break; 2124 break;
2122 default: 2125 default:
2123 IWL_ERROR("Unsupported interface type %d\n", mode); 2126 IWL_ERR(priv, "Unsupported interface type %d\n", mode);
2124 break; 2127 break;
2125 } 2128 }
2126 2129
@@ -2170,7 +2173,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
2170 le16_to_cpu(priv->staging39_rxon.channel)); 2173 le16_to_cpu(priv->staging39_rxon.channel));
2171 2174
2172 if (!ch_info || !is_channel_ibss(ch_info)) { 2175 if (!ch_info || !is_channel_ibss(ch_info)) {
2173 IWL_ERROR("channel %d not IBSS channel\n", 2176 IWL_ERR(priv, "channel %d not IBSS channel\n",
2174 le16_to_cpu(priv->staging39_rxon.channel)); 2177 le16_to_cpu(priv->staging39_rxon.channel));
2175 return -EINVAL; 2178 return -EINVAL;
2176 } 2179 }
@@ -2403,7 +2406,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
2403 } 2406 }
2404 2407
2405 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) { 2408 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) {
2406 IWL_ERROR("ERROR: No TX rate available.\n"); 2409 IWL_ERR(priv, "ERROR: No TX rate available.\n");
2407 goto drop_unlock; 2410 goto drop_unlock;
2408 } 2411 }
2409 2412
@@ -2603,7 +2606,7 @@ static void iwl3945_set_rate(struct iwl_priv *priv)
2603 2606
2604 sband = iwl3945_get_band(priv, priv->band); 2607 sband = iwl3945_get_band(priv, priv->band);
2605 if (!sband) { 2608 if (!sband) {
2606 IWL_ERROR("Failed to set rate: unable to get hw mode\n"); 2609 IWL_ERR(priv, "Failed to set rate: unable to get hw mode\n");
2607 return; 2610 return;
2608 } 2611 }
2609 2612
@@ -2836,7 +2839,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
2836 2839
2837 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; 2840 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
2838 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 2841 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
2839 IWL_ERROR("Bad return from REPLY_RX_ON_ASSOC command\n"); 2842 IWL_ERR(priv, "Bad return from REPLY_RX_ON_ASSOC command\n");
2840 rc = -EIO; 2843 rc = -EIO;
2841 } 2844 }
2842 2845
@@ -2913,7 +2916,7 @@ static void iwl3945_rx_reply_error(struct iwl_priv *priv,
2913{ 2916{
2914 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 2917 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
2915 2918
2916 IWL_ERROR("Error Reply type 0x%08X cmd %s (0x%02X) " 2919 IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
2917 "seq 0x%04X ser 0x%08X\n", 2920 "seq 0x%04X ser 0x%08X\n",
2918 le32_to_cpu(pkt->u.err_resp.error_type), 2921 le32_to_cpu(pkt->u.err_resp.error_type),
2919 get_cmd_string(pkt->u.err_resp.cmd_id), 2922 get_cmd_string(pkt->u.err_resp.cmd_id),
@@ -2985,7 +2988,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work)
2985 beacon = ieee80211_beacon_get(priv->hw, priv->vif); 2988 beacon = ieee80211_beacon_get(priv->hw, priv->vif);
2986 2989
2987 if (!beacon) { 2990 if (!beacon) {
2988 IWL_ERROR("update beacon failed\n"); 2991 IWL_ERR(priv, "update beacon failed\n");
2989 return; 2992 return;
2990 } 2993 }
2991 2994
@@ -3232,7 +3235,7 @@ static void iwl3945_cmd_queue_reclaim(struct iwl_priv *priv,
3232 int nfreed = 0; 3235 int nfreed = 0;
3233 3236
3234 if ((index >= q->n_bd) || (iwl3945_x2_queue_used(q, index) == 0)) { 3237 if ((index >= q->n_bd) || (iwl3945_x2_queue_used(q, index) == 0)) {
3235 IWL_ERROR("Read index for DMA queue txq id (%d), index %d, " 3238 IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
3236 "is out of range [0-%d] %d %d.\n", txq_id, 3239 "is out of range [0-%d] %d %d.\n", txq_id,
3237 index, q->n_bd, q->write_ptr, q->read_ptr); 3240 index, q->n_bd, q->write_ptr, q->read_ptr);
3238 return; 3241 return;
@@ -3241,7 +3244,7 @@ static void iwl3945_cmd_queue_reclaim(struct iwl_priv *priv,
3241 for (index = iwl_queue_inc_wrap(index, q->n_bd); q->read_ptr != index; 3244 for (index = iwl_queue_inc_wrap(index, q->n_bd); q->read_ptr != index;
3242 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 3245 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
3243 if (nfreed > 1) { 3246 if (nfreed > 1) {
3244 IWL_ERROR("HCMD skipped: index (%d) %d %d\n", index, 3247 IWL_ERR(priv, "HCMD skipped: index (%d) %d %d\n", index,
3245 q->write_ptr, q->read_ptr); 3248 q->write_ptr, q->read_ptr);
3246 queue_work(priv->workqueue, &priv->restart); 3249 queue_work(priv->workqueue, &priv->restart);
3247 break; 3250 break;
@@ -3955,7 +3958,7 @@ static void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
3955 base = le32_to_cpu(priv->card_alive.error_event_table_ptr); 3958 base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
3956 3959
3957 if (!iwl3945_hw_valid_rtc_data_addr(base)) { 3960 if (!iwl3945_hw_valid_rtc_data_addr(base)) {
3958 IWL_ERROR("Not valid error log pointer 0x%08X\n", base); 3961 IWL_ERR(priv, "Not valid error log pointer 0x%08X\n", base);
3959 return; 3962 return;
3960 } 3963 }
3961 3964
@@ -3968,11 +3971,12 @@ static void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
3968 count = iwl_read_targ_mem(priv, base); 3971 count = iwl_read_targ_mem(priv, base);
3969 3972
3970 if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) { 3973 if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
3971 IWL_ERROR("Start IWL Error Log Dump:\n"); 3974 IWL_ERR(priv, "Start IWL Error Log Dump:\n");
3972 IWL_ERROR("Status: 0x%08lX, count: %d\n", priv->status, count); 3975 IWL_ERR(priv, "Status: 0x%08lX, count: %d\n",
3976 priv->status, count);
3973 } 3977 }
3974 3978
3975 IWL_ERROR("Desc Time asrtPC blink2 " 3979 IWL_ERR(priv, "Desc Time asrtPC blink2 "
3976 "ilink1 nmiPC Line\n"); 3980 "ilink1 nmiPC Line\n");
3977 for (i = ERROR_START_OFFSET; 3981 for (i = ERROR_START_OFFSET;
3978 i < (count * ERROR_ELEM_SIZE) + ERROR_START_OFFSET; 3982 i < (count * ERROR_ELEM_SIZE) + ERROR_START_OFFSET;
@@ -3991,10 +3995,10 @@ static void iwl3945_dump_nic_error_log(struct iwl_priv *priv)
3991 data1 = 3995 data1 =
3992 iwl_read_targ_mem(priv, base + i + 6 * sizeof(u32)); 3996 iwl_read_targ_mem(priv, base + i + 6 * sizeof(u32));
3993 3997
3994 IWL_ERROR 3998 IWL_ERR(priv,
3995 ("%-13s (#%d) %010u 0x%05X 0x%05X 0x%05X 0x%05X %u\n\n", 3999 "%-13s (#%d) %010u 0x%05X 0x%05X 0x%05X 0x%05X %u\n\n",
3996 desc_lookup(desc), desc, time, blink1, blink2, 4000 desc_lookup(desc), desc, time, blink1, blink2,
3997 ilink1, ilink2, data1); 4001 ilink1, ilink2, data1);
3998 } 4002 }
3999 4003
4000 iwl_release_nic_access(priv); 4004 iwl_release_nic_access(priv);
@@ -4036,12 +4040,13 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
4036 ptr += sizeof(u32); 4040 ptr += sizeof(u32);
4037 time = iwl_read_targ_mem(priv, ptr); 4041 time = iwl_read_targ_mem(priv, ptr);
4038 ptr += sizeof(u32); 4042 ptr += sizeof(u32);
4039 if (mode == 0) 4043 if (mode == 0) {
4040 IWL_ERROR("0x%08x\t%04u\n", time, ev); /* data, ev */ 4044 /* data, ev */
4041 else { 4045 IWL_ERR(priv, "0x%08x\t%04u\n", time, ev);
4046 } else {
4042 data = iwl_read_targ_mem(priv, ptr); 4047 data = iwl_read_targ_mem(priv, ptr);
4043 ptr += sizeof(u32); 4048 ptr += sizeof(u32);
4044 IWL_ERROR("%010u\t0x%08x\t%04u\n", time, data, ev); 4049 IWL_ERR(priv, "%010u\t0x%08x\t%04u\n", time, data, ev);
4045 } 4050 }
4046 } 4051 }
4047} 4052}
@@ -4058,7 +4063,7 @@ static void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
4058 4063
4059 base = le32_to_cpu(priv->card_alive.log_event_table_ptr); 4064 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
4060 if (!iwl3945_hw_valid_rtc_data_addr(base)) { 4065 if (!iwl3945_hw_valid_rtc_data_addr(base)) {
4061 IWL_ERROR("Invalid event log pointer 0x%08X\n", base); 4066 IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
4062 return; 4067 return;
4063 } 4068 }
4064 4069
@@ -4078,12 +4083,12 @@ static void iwl3945_dump_nic_event_log(struct iwl_priv *priv)
4078 4083
4079 /* bail out if nothing in log */ 4084 /* bail out if nothing in log */
4080 if (size == 0) { 4085 if (size == 0) {
4081 IWL_ERROR("Start IWL Event Log Dump: nothing in log\n"); 4086 IWL_ERR(priv, "Start IWL Event Log Dump: nothing in log\n");
4082 iwl_release_nic_access(priv); 4087 iwl_release_nic_access(priv);
4083 return; 4088 return;
4084 } 4089 }
4085 4090
4086 IWL_ERROR("Start IWL Event Log Dump: display count %d, wraps %d\n", 4091 IWL_ERR(priv, "Start IWL Event Log Dump: display count %d, wraps %d\n",
4087 size, num_wraps); 4092 size, num_wraps);
4088 4093
4089 /* if uCode has wrapped back to top of log, start at the oldest entry, 4094 /* if uCode has wrapped back to top of log, start at the oldest entry,
@@ -4196,7 +4201,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
4196 4201
4197 /* Now service all interrupt bits discovered above. */ 4202 /* Now service all interrupt bits discovered above. */
4198 if (inta & CSR_INT_BIT_HW_ERR) { 4203 if (inta & CSR_INT_BIT_HW_ERR) {
4199 IWL_ERROR("Microcode HW error detected. Restarting.\n"); 4204 IWL_ERR(priv, "Microcode HW error detected. Restarting.\n");
4200 4205
4201 /* Tell the device to stop sending interrupts */ 4206 /* Tell the device to stop sending interrupts */
4202 iwl3945_disable_interrupts(priv); 4207 iwl3945_disable_interrupts(priv);
@@ -4227,8 +4232,8 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
4227 4232
4228 /* Error detected by uCode */ 4233 /* Error detected by uCode */
4229 if (inta & CSR_INT_BIT_SW_ERR) { 4234 if (inta & CSR_INT_BIT_SW_ERR) {
4230 IWL_ERROR("Microcode SW error detected. Restarting 0x%X.\n", 4235 IWL_ERR(priv, "Microcode SW error detected. "
4231 inta); 4236 "Restarting 0x%X.\n", inta);
4232 iwl3945_irq_handle_error(priv); 4237 iwl3945_irq_handle_error(priv);
4233 handled |= CSR_INT_BIT_SW_ERR; 4238 handled |= CSR_INT_BIT_SW_ERR;
4234 } 4239 }
@@ -4268,7 +4273,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
4268 } 4273 }
4269 4274
4270 if (inta & ~handled) 4275 if (inta & ~handled)
4271 IWL_ERROR("Unhandled INTA bits 0x%08x\n", inta & ~handled); 4276 IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled);
4272 4277
4273 if (inta & ~CSR_INI_SET_MASK) { 4278 if (inta & ~CSR_INI_SET_MASK) {
4274 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n", 4279 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n",
@@ -4510,7 +4515,7 @@ static int iwl3945_init_channel_map(struct iwl_priv *priv)
4510 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) * 4515 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) *
4511 priv->channel_count, GFP_KERNEL); 4516 priv->channel_count, GFP_KERNEL);
4512 if (!priv->channel_info) { 4517 if (!priv->channel_info) {
4513 IWL_ERROR("Could not allocate channel_info\n"); 4518 IWL_ERR(priv, "Could not allocate channel_info\n");
4514 priv->channel_count = 0; 4519 priv->channel_count = 0;
4515 return -ENOMEM; 4520 return -ENOMEM;
4516 } 4521 }
@@ -4949,7 +4954,7 @@ static int iwl3945_verify_inst_full(struct iwl_priv *priv, __le32 *image, u32 le
4949 * if IWL_DL_IO is set */ 4954 * if IWL_DL_IO is set */
4950 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); 4955 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
4951 if (val != le32_to_cpu(*image)) { 4956 if (val != le32_to_cpu(*image)) {
4952 IWL_ERROR("uCode INST section is invalid at " 4957 IWL_ERR(priv, "uCode INST section is invalid at "
4953 "offset 0x%x, is 0x%x, s/b 0x%x\n", 4958 "offset 0x%x, is 0x%x, s/b 0x%x\n",
4954 save_len - len, val, le32_to_cpu(*image)); 4959 save_len - len, val, le32_to_cpu(*image));
4955 rc = -EIO; 4960 rc = -EIO;
@@ -4995,7 +5000,7 @@ static int iwl3945_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32
4995 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); 5000 val = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
4996 if (val != le32_to_cpu(*image)) { 5001 if (val != le32_to_cpu(*image)) {
4997#if 0 /* Enable this if you want to see details */ 5002#if 0 /* Enable this if you want to see details */
4998 IWL_ERROR("uCode INST section is invalid at " 5003 IWL_ERR(priv, "uCode INST section is invalid at "
4999 "offset 0x%x, is 0x%x, s/b 0x%x\n", 5004 "offset 0x%x, is 0x%x, s/b 0x%x\n",
5000 i, val, *image); 5005 i, val, *image);
5001#endif 5006#endif
@@ -5049,7 +5054,7 @@ static int iwl3945_verify_ucode(struct iwl_priv *priv)
5049 return 0; 5054 return 0;
5050 } 5055 }
5051 5056
5052 IWL_ERROR("NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n"); 5057 IWL_ERR(priv, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
5053 5058
5054 /* Since nothing seems to match, show first several data entries in 5059 /* Since nothing seems to match, show first several data entries in
5055 * instruction SRAM, so maybe visual inspection will give a clue. 5060 * instruction SRAM, so maybe visual inspection will give a clue.
@@ -5079,7 +5084,7 @@ static int iwl3945_verify_bsm(struct iwl_priv *priv)
5079 reg += sizeof(u32), image++) { 5084 reg += sizeof(u32), image++) {
5080 val = iwl_read_prph(priv, reg); 5085 val = iwl_read_prph(priv, reg);
5081 if (val != le32_to_cpu(*image)) { 5086 if (val != le32_to_cpu(*image)) {
5082 IWL_ERROR("BSM uCode verification failed at " 5087 IWL_ERR(priv, "BSM uCode verification failed at "
5083 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n", 5088 "addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
5084 BSM_SRAM_LOWER_BOUND, 5089 BSM_SRAM_LOWER_BOUND,
5085 reg - BSM_SRAM_LOWER_BOUND, len, 5090 reg - BSM_SRAM_LOWER_BOUND, len,
@@ -5197,7 +5202,7 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
5197 if (i < 100) 5202 if (i < 100)
5198 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i); 5203 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
5199 else { 5204 else {
5200 IWL_ERROR("BSM write did not complete!\n"); 5205 IWL_ERR(priv, "BSM write did not complete!\n");
5201 return -EIO; 5206 return -EIO;
5202 } 5207 }
5203 5208
@@ -5242,7 +5247,7 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5242 sprintf(buf, "%s%u%s", name_pre, index, ".ucode"); 5247 sprintf(buf, "%s%u%s", name_pre, index, ".ucode");
5243 ret = request_firmware(&ucode_raw, buf, &priv->pci_dev->dev); 5248 ret = request_firmware(&ucode_raw, buf, &priv->pci_dev->dev);
5244 if (ret < 0) { 5249 if (ret < 0) {
5245 IWL_ERROR("%s firmware file req failed: Reason %d\n", 5250 IWL_ERR(priv, "%s firmware file req failed: %d\n",
5246 buf, ret); 5251 buf, ret);
5247 if (ret == -ENOENT) 5252 if (ret == -ENOENT)
5248 continue; 5253 continue;
@@ -5250,7 +5255,9 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5250 goto error; 5255 goto error;
5251 } else { 5256 } else {
5252 if (index < api_max) 5257 if (index < api_max)
5253 IWL_ERROR("Loaded firmware %s, which is deprecated. Please use API v%u instead.\n", 5258 IWL_ERR(priv, "Loaded firmware %s, "
5259 "which is deprecated. "
5260 " Please use API v%u instead.\n",
5254 buf, api_max); 5261 buf, api_max);
5255 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n", 5262 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n",
5256 buf, ucode_raw->size); 5263 buf, ucode_raw->size);
@@ -5263,7 +5270,7 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5263 5270
5264 /* Make sure that we got at least our header! */ 5271 /* Make sure that we got at least our header! */
5265 if (ucode_raw->size < sizeof(*ucode)) { 5272 if (ucode_raw->size < sizeof(*ucode)) {
5266 IWL_ERROR("File size way too small!\n"); 5273 IWL_ERR(priv, "File size way too small!\n");
5267 ret = -EINVAL; 5274 ret = -EINVAL;
5268 goto err_release; 5275 goto err_release;
5269 } 5276 }
@@ -5284,7 +5291,7 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5284 * on the API version read from firware header from here on forward */ 5291 * on the API version read from firware header from here on forward */
5285 5292
5286 if (api_ver < api_min || api_ver > api_max) { 5293 if (api_ver < api_min || api_ver > api_max) {
5287 IWL_ERROR("Driver unable to support your firmware API. " 5294 IWL_ERR(priv, "Driver unable to support your firmware API. "
5288 "Driver supports v%u, firmware is v%u.\n", 5295 "Driver supports v%u, firmware is v%u.\n",
5289 api_max, api_ver); 5296 api_max, api_ver);
5290 priv->ucode_ver = 0; 5297 priv->ucode_ver = 0;
@@ -5292,7 +5299,7 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5292 goto err_release; 5299 goto err_release;
5293 } 5300 }
5294 if (api_ver != api_max) 5301 if (api_ver != api_max)
5295 IWL_ERROR("Firmware has old API version. Expected %u, " 5302 IWL_ERR(priv, "Firmware has old API version. Expected %u, "
5296 "got %u. New firmware can be obtained " 5303 "got %u. New firmware can be obtained "
5297 "from http://www.intellinuxwireless.org.\n", 5304 "from http://www.intellinuxwireless.org.\n",
5298 api_max, api_ver); 5305 api_max, api_ver);
@@ -5443,7 +5450,7 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
5443 return 0; 5450 return 0;
5444 5451
5445 err_pci_alloc: 5452 err_pci_alloc:
5446 IWL_ERROR("failed to allocate pci memory\n"); 5453 IWL_ERR(priv, "failed to allocate pci memory\n");
5447 ret = -ENOMEM; 5454 ret = -ENOMEM;
5448 iwl3945_dealloc_ucode_pci(priv); 5455 iwl3945_dealloc_ucode_pci(priv);
5449 5456
@@ -5795,7 +5802,7 @@ static int __iwl3945_up(struct iwl_priv *priv)
5795 } 5802 }
5796 5803
5797 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) { 5804 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
5798 IWL_ERROR("ucode not available for device bring up\n"); 5805 IWL_ERR(priv, "ucode not available for device bring up\n");
5799 return -EIO; 5806 return -EIO;
5800 } 5807 }
5801 5808
@@ -5815,7 +5822,7 @@ static int __iwl3945_up(struct iwl_priv *priv)
5815 5822
5816 rc = iwl3945_hw_nic_init(priv); 5823 rc = iwl3945_hw_nic_init(priv);
5817 if (rc) { 5824 if (rc) {
5818 IWL_ERROR("Unable to int nic\n"); 5825 IWL_ERR(priv, "Unable to int nic\n");
5819 return rc; 5826 return rc;
5820 } 5827 }
5821 5828
@@ -5852,7 +5859,8 @@ static int __iwl3945_up(struct iwl_priv *priv)
5852 rc = iwl3945_load_bsm(priv); 5859 rc = iwl3945_load_bsm(priv);
5853 5860
5854 if (rc) { 5861 if (rc) {
5855 IWL_ERROR("Unable to set up bootstrap uCode: %d\n", rc); 5862 IWL_ERR(priv,
5863 "Unable to set up bootstrap uCode: %d\n", rc);
5856 continue; 5864 continue;
5857 } 5865 }
5858 5866
@@ -5870,7 +5878,7 @@ static int __iwl3945_up(struct iwl_priv *priv)
5870 5878
5871 /* tried to restart and config the device for as long as our 5879 /* tried to restart and config the device for as long as our
5872 * patience could withstand */ 5880 * patience could withstand */
5873 IWL_ERROR("Unable to initialize device after %d attempts.\n", i); 5881 IWL_ERR(priv, "Unable to initialize device after %d attempts.\n", i);
5874 return -EIO; 5882 return -EIO;
5875} 5883}
5876 5884
@@ -6203,7 +6211,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
6203 struct ieee80211_conf *conf = NULL; 6211 struct ieee80211_conf *conf = NULL;
6204 6212
6205 if (priv->iw_mode == NL80211_IFTYPE_AP) { 6213 if (priv->iw_mode == NL80211_IFTYPE_AP) {
6206 IWL_ERROR("%s Should not be called in AP mode\n", __func__); 6214 IWL_ERR(priv, "%s Should not be called in AP mode\n", __func__);
6207 return; 6215 return;
6208 } 6216 }
6209 6217
@@ -6276,7 +6284,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
6276 break; 6284 break;
6277 6285
6278 default: 6286 default:
6279 IWL_ERROR("%s Should not be called in %d mode\n", 6287 IWL_ERR(priv, "%s Should not be called in %d mode\n",
6280 __func__, priv->iw_mode); 6288 __func__, priv->iw_mode);
6281 break; 6289 break;
6282 } 6290 }
@@ -6342,7 +6350,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
6342 IWL_DEBUG_MAC80211("enter\n"); 6350 IWL_DEBUG_MAC80211("enter\n");
6343 6351
6344 if (pci_enable_device(priv->pci_dev)) { 6352 if (pci_enable_device(priv->pci_dev)) {
6345 IWL_ERROR("Fail to pci_enable_device\n"); 6353 IWL_ERR(priv, "Fail to pci_enable_device\n");
6346 return -ENODEV; 6354 return -ENODEV;
6347 } 6355 }
6348 pci_restore_state(priv->pci_dev); 6356 pci_restore_state(priv->pci_dev);
@@ -6351,7 +6359,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
6351 ret = request_irq(priv->pci_dev->irq, iwl3945_isr, IRQF_SHARED, 6359 ret = request_irq(priv->pci_dev->irq, iwl3945_isr, IRQF_SHARED,
6352 DRV_NAME, priv); 6360 DRV_NAME, priv);
6353 if (ret) { 6361 if (ret) {
6354 IWL_ERROR("Error allocating IRQ %d\n", priv->pci_dev->irq); 6362 IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq);
6355 goto out_disable_msi; 6363 goto out_disable_msi;
6356 } 6364 }
6357 6365
@@ -6365,7 +6373,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
6365 if (!priv->ucode_code.len) { 6373 if (!priv->ucode_code.len) {
6366 ret = iwl3945_read_ucode(priv); 6374 ret = iwl3945_read_ucode(priv);
6367 if (ret) { 6375 if (ret) {
6368 IWL_ERROR("Could not read microcode: %d\n", ret); 6376 IWL_ERR(priv, "Could not read microcode: %d\n", ret);
6369 mutex_unlock(&priv->mutex); 6377 mutex_unlock(&priv->mutex);
6370 goto out_release_irq; 6378 goto out_release_irq;
6371 } 6379 }
@@ -6392,8 +6400,9 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
6392 UCODE_READY_TIMEOUT); 6400 UCODE_READY_TIMEOUT);
6393 if (!ret) { 6401 if (!ret) {
6394 if (!test_bit(STATUS_READY, &priv->status)) { 6402 if (!test_bit(STATUS_READY, &priv->status)) {
6395 IWL_ERROR("Wait for START_ALIVE timeout after %dms.\n", 6403 IWL_ERR(priv,
6396 jiffies_to_msecs(UCODE_READY_TIMEOUT)); 6404 "Wait for START_ALIVE timeout after %dms.\n",
6405 jiffies_to_msecs(UCODE_READY_TIMEOUT));
6397 ret = -ETIMEDOUT; 6406 ret = -ETIMEDOUT;
6398 goto out_release_irq; 6407 goto out_release_irq;
6399 } 6408 }
@@ -7738,8 +7747,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7738 7747
7739 if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) || 7748 if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) ||
7740 (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) { 7749 (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) {
7741 IWL_ERROR("invalid queues_num, should be between %d and %d\n", 7750 IWL_ERR(priv,
7742 IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES); 7751 "invalid queues_num, should be between %d and %d\n",
7752 IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES);
7743 err = -EINVAL; 7753 err = -EINVAL;
7744 goto out; 7754 goto out;
7745 } 7755 }
@@ -7833,7 +7843,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7833 /* Read the EEPROM */ 7843 /* Read the EEPROM */
7834 err = iwl3945_eeprom_init(priv); 7844 err = iwl3945_eeprom_init(priv);
7835 if (err) { 7845 if (err) {
7836 IWL_ERROR("Unable to init EEPROM\n"); 7846 IWL_ERR(priv, "Unable to init EEPROM\n");
7837 goto out_remove_sysfs; 7847 goto out_remove_sysfs;
7838 } 7848 }
7839 /* MAC Address location in EEPROM same for 3945/4965 */ 7849 /* MAC Address location in EEPROM same for 3945/4965 */
@@ -7846,7 +7856,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7846 * ********************/ 7856 * ********************/
7847 /* Device-specific setup */ 7857 /* Device-specific setup */
7848 if (iwl3945_hw_set_hw_params(priv)) { 7858 if (iwl3945_hw_set_hw_params(priv)) {
7849 IWL_ERROR("failed to set hw settings\n"); 7859 IWL_ERR(priv, "failed to set hw settings\n");
7850 goto out_iounmap; 7860 goto out_iounmap;
7851 } 7861 }
7852 7862
@@ -7887,13 +7897,13 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7887 7897
7888 err = iwl3945_init_channel_map(priv); 7898 err = iwl3945_init_channel_map(priv);
7889 if (err) { 7899 if (err) {
7890 IWL_ERROR("initializing regulatory failed: %d\n", err); 7900 IWL_ERR(priv, "initializing regulatory failed: %d\n", err);
7891 goto out_release_irq; 7901 goto out_release_irq;
7892 } 7902 }
7893 7903
7894 err = iwl3945_init_geos(priv); 7904 err = iwl3945_init_geos(priv);
7895 if (err) { 7905 if (err) {
7896 IWL_ERROR("initializing geos failed: %d\n", err); 7906 IWL_ERR(priv, "initializing geos failed: %d\n", err);
7897 goto out_free_channel_map; 7907 goto out_free_channel_map;
7898 } 7908 }
7899 7909
@@ -7922,7 +7932,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7922 7932
7923 err = sysfs_create_group(&pdev->dev.kobj, &iwl3945_attribute_group); 7933 err = sysfs_create_group(&pdev->dev.kobj, &iwl3945_attribute_group);
7924 if (err) { 7934 if (err) {
7925 IWL_ERROR("failed to create sysfs device attributes\n"); 7935 IWL_ERR(priv, "failed to create sysfs device attributes\n");
7926 goto out_free_geos; 7936 goto out_free_geos;
7927 } 7937 }
7928 7938
@@ -7942,7 +7952,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7942 7952
7943 err = ieee80211_register_hw(priv->hw); 7953 err = ieee80211_register_hw(priv->hw);
7944 if (err) { 7954 if (err) {
7945 IWL_ERROR("Failed to register network device (error %d)\n", err); 7955 IWL_ERR(priv, "Failed to register network device: %d\n", err);
7946 goto out_remove_sysfs; 7956 goto out_remove_sysfs;
7947 } 7957 }
7948 7958
@@ -7952,7 +7962,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7952 7962
7953 err = iwl3945_rfkill_init(priv); 7963 err = iwl3945_rfkill_init(priv);
7954 if (err) 7964 if (err)
7955 IWL_ERROR("Unable to initialize RFKILL system. " 7965 IWL_ERR(priv, "Unable to initialize RFKILL system. "
7956 "Ignoring error: %d\n", err); 7966 "Ignoring error: %d\n", err);
7957 7967
7958 return 0; 7968 return 0;
@@ -8124,7 +8134,7 @@ int iwl3945_rfkill_init(struct iwl_priv *priv)
8124 IWL_DEBUG_RF_KILL("Initializing RFKILL.\n"); 8134 IWL_DEBUG_RF_KILL("Initializing RFKILL.\n");
8125 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN); 8135 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN);
8126 if (!priv->rfkill) { 8136 if (!priv->rfkill) {
8127 IWL_ERROR("Unable to allocate rfkill device.\n"); 8137 IWL_ERR(priv, "Unable to allocate rfkill device.\n");
8128 ret = -ENOMEM; 8138 ret = -ENOMEM;
8129 goto error; 8139 goto error;
8130 } 8140 }
@@ -8140,7 +8150,7 @@ int iwl3945_rfkill_init(struct iwl_priv *priv)
8140 8150
8141 ret = rfkill_register(priv->rfkill); 8151 ret = rfkill_register(priv->rfkill);
8142 if (ret) { 8152 if (ret) {
8143 IWL_ERROR("Unable to register rfkill: %d\n", ret); 8153 IWL_ERR(priv, "Unable to register rfkill: %d\n", ret);
8144 goto freed_rfkill; 8154 goto freed_rfkill;
8145 } 8155 }
8146 8156