Skip to content

Commit

Permalink
iwlwifi: replace IWL_ERROR with IWL_ERR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Winkler, Tomas authored and John W. Linville committed Jan 29, 2009
1 parent 39aadf8 commit 15b1687
Show file tree
Hide file tree
Showing 21 changed files with 299 additions and 272 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945-led.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int iwl3945_led_register_led(struct iwl_priv *priv,

ret = led_classdev_register(device, &led->led_dev);
if (ret) {
IWL_ERROR("Error: failed to register led handler.\n");
IWL_ERR(priv, "Error: failed to register led handler.\n");
return ret;
}

Expand Down
30 changes: 15 additions & 15 deletions drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void iwl3945_disable_events(struct iwl_priv *priv)

base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
if (!iwl3945_hw_valid_rtc_data_addr(base)) {
IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
IWL_ERR(priv, "Invalid event log pointer 0x%08X\n", base);
return;
}

Expand Down Expand Up @@ -224,7 +224,7 @@ __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
}

/* bad antenna selector value */
IWL_ERROR("Bad antenna selector value (0x%x)\n", priv->antenna);
IWL_ERR(priv, "Bad antenna selector value (0x%x)\n", priv->antenna);
return 0; /* "diversity" is default if error */
}

Expand Down Expand Up @@ -344,7 +344,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
int fail;

if ((index >= txq->q.n_bd) || (iwl3945_x2_queue_used(&txq->q, index) == 0)) {
IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
"is out of range [0-%d] %d %d\n", txq_id,
index, txq->q.n_bd, txq->q.write_ptr,
txq->q.read_ptr);
Expand Down Expand Up @@ -376,7 +376,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
iwl3945_tx_queue_reclaim(priv, txq_id, index);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n");
IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
}


Expand Down Expand Up @@ -734,7 +734,7 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
pad = TFD_CTL_PAD_GET(le32_to_cpu(tfd->control_flags));

if ((count >= NUM_TFD_CHUNKS) || (count < 0)) {
IWL_ERROR("Error can not send more than %d chunks\n",
IWL_ERR(priv, "Error can not send more than %d chunks\n",
NUM_TFD_CHUNKS);
return -EINVAL;
}
Expand Down Expand Up @@ -771,7 +771,7 @@ int iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
/* sanity check */
counter = TFD_CTL_COUNT_GET(le32_to_cpu(bd->control_flags));
if (counter > NUM_TFD_CHUNKS) {
IWL_ERROR("Too many chunks: %i\n", counter);
IWL_ERR(priv, "Too many chunks: %i\n", counter);
/* @todo issue fatal error, it is quite serious situation */
return 0;
}
Expand Down Expand Up @@ -1065,7 +1065,7 @@ static int iwl3945_txq_ctx_reset(struct iwl_priv *priv)
rc = iwl3945_tx_queue_init(priv, &priv->txq39[txq_id], slots_num,
txq_id);
if (rc) {
IWL_ERROR("Tx %d queue init failed\n", txq_id);
IWL_ERR(priv, "Tx %d queue init failed\n", txq_id);
goto error;
}
}
Expand Down Expand Up @@ -1177,7 +1177,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
if (!rxq->bd) {
rc = iwl3945_rx_queue_alloc(priv);
if (rc) {
IWL_ERROR("Unable to initialize Rx queue\n");
IWL_ERR(priv, "Unable to initialize Rx queue\n");
return -ENOMEM;
}
} else
Expand Down Expand Up @@ -1377,7 +1377,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl_priv *priv)

/* handle insane temp reading */
if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
IWL_ERROR("Error bad temperature value %d\n", temperature);
IWL_ERR(priv, "Error bad temperature value %d\n", temperature);

/* if really really hot(?),
* substitute the 3rd band/group's temp measured at factory */
Expand Down Expand Up @@ -1685,9 +1685,9 @@ int iwl3945_hw_reg_send_txpower(struct iwl_priv *priv)
priv->band,
le16_to_cpu(priv->active39_rxon.channel));
if (!ch_info) {
IWL_ERROR
("Failed to get channel info for channel %d [%d]\n",
le16_to_cpu(priv->active39_rxon.channel), priv->band);
IWL_ERR(priv,
"Failed to get channel info for channel %d [%d]\n",
le16_to_cpu(priv->active39_rxon.channel), priv->band);
return -EINVAL;
}

Expand Down Expand Up @@ -2224,7 +2224,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
ch_info->group_index,
&power_idx);
if (rc) {
IWL_ERROR("Invalid power index\n");
IWL_ERR(priv, "Invalid power index\n");
return rc;
}
pwr_info->base_power_index = (u8) power_idx;
Expand Down Expand Up @@ -2300,7 +2300,7 @@ int iwl3945_hw_rxq_stop(struct iwl_priv *priv)
rc = iwl_poll_direct_bit(priv, FH39_RSSR_STATUS,
FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
if (rc < 0)
IWL_ERROR("Can't stop Rx DMA.\n");
IWL_ERR(priv, "Can't stop Rx DMA.\n");

iwl_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
Expand Down Expand Up @@ -2440,7 +2440,7 @@ int iwl3945_hw_set_hw_params(struct iwl_priv *priv)
&priv->shared_phys);

if (!priv->shared_virt) {
IWL_ERROR("failed to allocate pci memory\n");
IWL_ERR(priv, "failed to allocate pci memory\n");
mutex_unlock(&priv->mutex);
return -ENOMEM;
}
Expand Down
32 changes: 17 additions & 15 deletions drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int iwl4965_verify_bsm(struct iwl_priv *priv)
reg += sizeof(u32), image++) {
val = iwl_read_prph(priv, reg);
if (val != le32_to_cpu(*image)) {
IWL_ERROR("BSM uCode verification failed at "
IWL_ERR(priv, "BSM uCode verification failed at "
"addr 0x%08X+%u (of %u), is 0x%x, s/b 0x%x\n",
BSM_SRAM_LOWER_BOUND,
reg - BSM_SRAM_LOWER_BOUND, len,
Expand Down Expand Up @@ -203,7 +203,7 @@ static int iwl4965_load_bsm(struct iwl_priv *priv)
if (i < 100)
IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i);
else {
IWL_ERROR("BSM write did not complete!\n");
IWL_ERR(priv, "BSM write did not complete!\n");
return -EIO;
}

Expand Down Expand Up @@ -523,7 +523,8 @@ static void iwl4965_chain_noise_reset(struct iwl_priv *priv)
cmd.diff_gain_c = 0;
if (iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
sizeof(cmd), &cmd))
IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n");
IWL_ERR(priv,
"Could not send REPLY_PHY_CALIBRATION_CMD\n");
data->state = IWL_CHAIN_NOISE_ACCUMULATE;
IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
}
Expand Down Expand Up @@ -804,8 +805,9 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)

if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) ||
(priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
IWL_ERROR("invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL49_NUM_QUEUES);
IWL_ERR(priv,
"invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL49_NUM_QUEUES);
return -EINVAL;
}

Expand Down Expand Up @@ -955,7 +957,7 @@ static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel,

s = iwl4965_get_sub_band(priv, channel);
if (s >= EEPROM_TX_POWER_BANDS) {
IWL_ERROR("Tx Power can not find channel %d\n", channel);
IWL_ERR(priv, "Tx Power can not find channel %d\n", channel);
return -1;
}

Expand Down Expand Up @@ -1319,7 +1321,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
* and 2) mimo txpower balance between Tx chains. */
txatten_grp = iwl4965_get_tx_atten_grp(channel);
if (txatten_grp < 0) {
IWL_ERROR("Can't find txatten group for channel %d.\n",
IWL_ERR(priv, "Can't find txatten group for channel %d.\n",
channel);
return -EINVAL;
}
Expand Down Expand Up @@ -1727,7 +1729,7 @@ static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt);

if (R3 == R1) {
IWL_ERROR("Calibration conflict R1 == R3\n");
IWL_ERR(priv, "Calibration conflict R1 == R3\n");
return -1;
}

Expand Down Expand Up @@ -2071,10 +2073,10 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,

sc = le16_to_cpu(hdr->seq_ctrl);
if (idx != (SEQ_TO_SN(sc) & 0xff)) {
IWL_ERROR("BUG_ON idx doesn't match seq control"
" idx=%d, seq_idx=%d, seq=%d\n",
idx, SEQ_TO_SN(sc),
hdr->seq_ctrl);
IWL_ERR(priv,
"BUG_ON idx doesn't match seq control"
" idx=%d, seq_idx=%d, seq=%d\n",
idx, SEQ_TO_SN(sc), hdr->seq_ctrl);
return -1;
}

Expand Down Expand Up @@ -2133,7 +2135,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
u8 *qc = NULL;

if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
"is out of range [0-%d] %d %d\n", txq_id,
index, txq->q.n_bd, txq->q.write_ptr,
txq->q.read_ptr);
Expand All @@ -2151,7 +2153,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,

sta_id = iwl_get_ra_sta_id(priv, hdr);
if (txq->sched_retry && unlikely(sta_id == IWL_INVALID_STATION)) {
IWL_ERROR("Station not known\n");
IWL_ERR(priv, "Station not known\n");
return;
}

Expand Down Expand Up @@ -2214,7 +2216,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
iwl_txq_check_empty(priv, sta_id, tid, txq_id);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n");
IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
}

static int iwl4965_calc_rssi(struct iwl_priv *priv,
Expand Down
29 changes: 16 additions & 13 deletions drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS);
break;
default:
IWL_ERROR("illegal indirect type: 0x%X\n",
IWL_ERR(priv, "illegal indirect type: 0x%X\n",
address & INDIRECT_TYPE_MSK);
break;
}
Expand Down Expand Up @@ -384,7 +384,8 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
sizeof(cmd), &cmd);
if (ret)
IWL_ERROR("Could not send REPLY_PHY_CALIBRATION_CMD\n");
IWL_ERR(priv,
"Could not send REPLY_PHY_CALIBRATION_CMD\n");
data->state = IWL_CHAIN_NOISE_ACCUMULATE;
IWL_DEBUG_CALIB("Run chain_noise_calibrate\n");
}
Expand Down Expand Up @@ -507,7 +508,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
index = IWL_CALIB_BASE_BAND;
break;
default:
IWL_ERROR("Unknown calibration notification %d\n",
IWL_ERR(priv, "Unknown calibration notification %d\n",
hdr->op_code);
return;
}
Expand Down Expand Up @@ -589,12 +590,12 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
ret = wait_event_interruptible_timeout(priv->wait_command_queue,
priv->ucode_write_complete, 5 * HZ);
if (ret == -ERESTARTSYS) {
IWL_ERROR("Could not load the INST uCode section due "
IWL_ERR(priv, "Could not load the INST uCode section due "
"to interrupt\n");
return ret;
}
if (!ret) {
IWL_ERROR("Could not load the INST uCode section\n");
IWL_ERR(priv, "Could not load the INST uCode section\n");
return -ETIMEDOUT;
}

Expand All @@ -610,11 +611,11 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
ret = wait_event_interruptible_timeout(priv->wait_command_queue,
priv->ucode_write_complete, 5 * HZ);
if (ret == -ERESTARTSYS) {
IWL_ERROR("Could not load the INST uCode section due "
IWL_ERR(priv, "Could not load the INST uCode section due "
"to interrupt\n");
return ret;
} else if (!ret) {
IWL_ERROR("Could not load the DATA uCode section\n");
IWL_ERR(priv, "Could not load the DATA uCode section\n");
return -ETIMEDOUT;
} else
ret = 0;
Expand Down Expand Up @@ -826,8 +827,9 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
{
if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
(priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
IWL_ERROR("invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
IWL_ERR(priv,
"invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
return -EINVAL;
}

Expand Down Expand Up @@ -1201,8 +1203,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,

sc = le16_to_cpu(hdr->seq_ctrl);
if (idx != (SEQ_TO_SN(sc) & 0xff)) {
IWL_ERROR("BUG_ON idx doesn't match seq control"
" idx=%d, seq_idx=%d, seq=%d\n",
IWL_ERR(priv,
"BUG_ON idx doesn't match seq control"
" idx=%d, seq_idx=%d, seq=%d\n",
idx, SEQ_TO_SN(sc),
hdr->seq_ctrl);
return -1;
Expand Down Expand Up @@ -1258,7 +1261,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
int freed;

if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
"is out of range [0-%d] %d %d\n", txq_id,
index, txq->q.n_bd, txq->q.write_ptr,
txq->q.read_ptr);
Expand Down Expand Up @@ -1332,7 +1335,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
iwl_txq_check_empty(priv, sta_id, tid, txq_id);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n");
IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
}

/* Currently 5000 is the superset of everything */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int iwl_agn_check_rxon_cmd(struct iwl_priv *priv)
le16_to_cpu(rxon->channel));

if (error) {
IWL_ERROR("Not a valid iwl4965_rxon_assoc_cmd field values\n");
IWL_ERR(priv, "Not a valid iwl_rxon_assoc_cmd field values\n");
return -1;
}
return 0;
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-agn-rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,8 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
if (!tbl->is_SGI)
break;
else
IWL_ERROR("SGI was set in GF+SISO\n");
IWL_ERR(priv,
"SGI was set in GF+SISO\n");
}
search_tbl->is_SGI = !tbl->is_SGI;
rs_set_expected_tpt_table(lq_sta, search_tbl);
Expand Down Expand Up @@ -1748,13 +1749,13 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
rate_scale_index_msk = rate_mask;

if (!((1 << index) & rate_scale_index_msk)) {
IWL_ERROR("Current Rate is not valid\n");
IWL_ERR(priv, "Current Rate is not valid\n");
return;
}

/* Get expected throughput table and history window for current rate */
if (!tbl->expected_tpt) {
IWL_ERROR("tbl->expected_tpt is NULL\n");
IWL_ERR(priv, "tbl->expected_tpt is NULL\n");
return;
}

Expand Down
Loading

0 comments on commit 15b1687

Please sign in to comment.