aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c192
1 files changed, 101 insertions, 91 deletions
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