diff options
author | Joe Perches <joe@perches.com> | 2010-07-26 17:39:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-27 15:14:13 -0400 |
commit | c96c31e499b70964cfc88744046c998bb710e4b8 (patch) | |
tree | 0157102fbc952e3646690f3491199607669eed69 /drivers/net/wireless/mwl8k.c | |
parent | e1db74fcc3d95c8a051ec457241b5aa65a01a603 (diff) |
drivers/net/wireless: Use wiphy_<level>
Standardize the logging macros used.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 123 |
1 files changed, 52 insertions, 71 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 0e34260b22b1..28beeaf1f4c6 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -905,16 +905,14 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index) | |||
905 | 905 | ||
906 | rxq->rxd = pci_alloc_consistent(priv->pdev, size, &rxq->rxd_dma); | 906 | rxq->rxd = pci_alloc_consistent(priv->pdev, size, &rxq->rxd_dma); |
907 | if (rxq->rxd == NULL) { | 907 | if (rxq->rxd == NULL) { |
908 | printk(KERN_ERR "%s: failed to alloc RX descriptors\n", | 908 | wiphy_err(hw->wiphy, "failed to alloc rx descriptors\n"); |
909 | wiphy_name(hw->wiphy)); | ||
910 | return -ENOMEM; | 909 | return -ENOMEM; |
911 | } | 910 | } |
912 | memset(rxq->rxd, 0, size); | 911 | memset(rxq->rxd, 0, size); |
913 | 912 | ||
914 | rxq->buf = kmalloc(MWL8K_RX_DESCS * sizeof(*rxq->buf), GFP_KERNEL); | 913 | rxq->buf = kmalloc(MWL8K_RX_DESCS * sizeof(*rxq->buf), GFP_KERNEL); |
915 | if (rxq->buf == NULL) { | 914 | if (rxq->buf == NULL) { |
916 | printk(KERN_ERR "%s: failed to alloc RX skbuff list\n", | 915 | wiphy_err(hw->wiphy, "failed to alloc rx skbuff list\n"); |
917 | wiphy_name(hw->wiphy)); | ||
918 | pci_free_consistent(priv->pdev, size, rxq->rxd, rxq->rxd_dma); | 916 | pci_free_consistent(priv->pdev, size, rxq->rxd, rxq->rxd_dma); |
919 | return -ENOMEM; | 917 | return -ENOMEM; |
920 | } | 918 | } |
@@ -1141,16 +1139,14 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index) | |||
1141 | 1139 | ||
1142 | txq->txd = pci_alloc_consistent(priv->pdev, size, &txq->txd_dma); | 1140 | txq->txd = pci_alloc_consistent(priv->pdev, size, &txq->txd_dma); |
1143 | if (txq->txd == NULL) { | 1141 | if (txq->txd == NULL) { |
1144 | printk(KERN_ERR "%s: failed to alloc TX descriptors\n", | 1142 | wiphy_err(hw->wiphy, "failed to alloc tx descriptors\n"); |
1145 | wiphy_name(hw->wiphy)); | ||
1146 | return -ENOMEM; | 1143 | return -ENOMEM; |
1147 | } | 1144 | } |
1148 | memset(txq->txd, 0, size); | 1145 | memset(txq->txd, 0, size); |
1149 | 1146 | ||
1150 | txq->skb = kmalloc(MWL8K_TX_DESCS * sizeof(*txq->skb), GFP_KERNEL); | 1147 | txq->skb = kmalloc(MWL8K_TX_DESCS * sizeof(*txq->skb), GFP_KERNEL); |
1151 | if (txq->skb == NULL) { | 1148 | if (txq->skb == NULL) { |
1152 | printk(KERN_ERR "%s: failed to alloc TX skbuff list\n", | 1149 | wiphy_err(hw->wiphy, "failed to alloc tx skbuff list\n"); |
1153 | wiphy_name(hw->wiphy)); | ||
1154 | pci_free_consistent(priv->pdev, size, txq->txd, txq->txd_dma); | 1150 | pci_free_consistent(priv->pdev, size, txq->txd, txq->txd_dma); |
1155 | return -ENOMEM; | 1151 | return -ENOMEM; |
1156 | } | 1152 | } |
@@ -1206,11 +1202,12 @@ static void mwl8k_dump_tx_rings(struct ieee80211_hw *hw) | |||
1206 | unused++; | 1202 | unused++; |
1207 | } | 1203 | } |
1208 | 1204 | ||
1209 | printk(KERN_ERR "%s: txq[%d] len=%d head=%d tail=%d " | 1205 | wiphy_err(hw->wiphy, |
1210 | "fw_owned=%d drv_owned=%d unused=%d\n", | 1206 | "txq[%d] len=%d head=%d tail=%d " |
1211 | wiphy_name(hw->wiphy), i, | 1207 | "fw_owned=%d drv_owned=%d unused=%d\n", |
1212 | txq->len, txq->head, txq->tail, | 1208 | i, |
1213 | fw_owned, drv_owned, unused); | 1209 | txq->len, txq->head, txq->tail, |
1210 | fw_owned, drv_owned, unused); | ||
1214 | } | 1211 | } |
1215 | } | 1212 | } |
1216 | 1213 | ||
@@ -1254,25 +1251,23 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw) | |||
1254 | if (timeout) { | 1251 | if (timeout) { |
1255 | WARN_ON(priv->pending_tx_pkts); | 1252 | WARN_ON(priv->pending_tx_pkts); |
1256 | if (retry) { | 1253 | if (retry) { |
1257 | printk(KERN_NOTICE "%s: tx rings drained\n", | 1254 | wiphy_notice(hw->wiphy, "tx rings drained\n"); |
1258 | wiphy_name(hw->wiphy)); | ||
1259 | } | 1255 | } |
1260 | break; | 1256 | break; |
1261 | } | 1257 | } |
1262 | 1258 | ||
1263 | if (priv->pending_tx_pkts < oldcount) { | 1259 | if (priv->pending_tx_pkts < oldcount) { |
1264 | printk(KERN_NOTICE "%s: waiting for tx rings " | 1260 | wiphy_notice(hw->wiphy, |
1265 | "to drain (%d -> %d pkts)\n", | 1261 | "waiting for tx rings to drain (%d -> %d pkts)\n", |
1266 | wiphy_name(hw->wiphy), oldcount, | 1262 | oldcount, priv->pending_tx_pkts); |
1267 | priv->pending_tx_pkts); | ||
1268 | retry = 1; | 1263 | retry = 1; |
1269 | continue; | 1264 | continue; |
1270 | } | 1265 | } |
1271 | 1266 | ||
1272 | priv->tx_wait = NULL; | 1267 | priv->tx_wait = NULL; |
1273 | 1268 | ||
1274 | printk(KERN_ERR "%s: tx rings stuck for %d ms\n", | 1269 | wiphy_err(hw->wiphy, "tx rings stuck for %d ms\n", |
1275 | wiphy_name(hw->wiphy), MWL8K_TX_WAIT_TIMEOUT_MS); | 1270 | MWL8K_TX_WAIT_TIMEOUT_MS); |
1276 | mwl8k_dump_tx_rings(hw); | 1271 | mwl8k_dump_tx_rings(hw); |
1277 | 1272 | ||
1278 | rc = -ETIMEDOUT; | 1273 | rc = -ETIMEDOUT; |
@@ -1423,8 +1418,8 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) | |||
1423 | skb->len, PCI_DMA_TODEVICE); | 1418 | skb->len, PCI_DMA_TODEVICE); |
1424 | 1419 | ||
1425 | if (pci_dma_mapping_error(priv->pdev, dma)) { | 1420 | if (pci_dma_mapping_error(priv->pdev, dma)) { |
1426 | printk(KERN_DEBUG "%s: failed to dma map skb, " | 1421 | wiphy_debug(hw->wiphy, |
1427 | "dropping TX frame.\n", wiphy_name(hw->wiphy)); | 1422 | "failed to dma map skb, dropping TX frame.\n"); |
1428 | dev_kfree_skb(skb); | 1423 | dev_kfree_skb(skb); |
1429 | return NETDEV_TX_OK; | 1424 | return NETDEV_TX_OK; |
1430 | } | 1425 | } |
@@ -1572,10 +1567,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1572 | PCI_DMA_BIDIRECTIONAL); | 1567 | PCI_DMA_BIDIRECTIONAL); |
1573 | 1568 | ||
1574 | if (!timeout) { | 1569 | if (!timeout) { |
1575 | printk(KERN_ERR "%s: Command %s timeout after %u ms\n", | 1570 | wiphy_err(hw->wiphy, "command %s timeout after %u ms\n", |
1576 | wiphy_name(hw->wiphy), | 1571 | mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), |
1577 | mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), | 1572 | MWL8K_CMD_TIMEOUT_MS); |
1578 | MWL8K_CMD_TIMEOUT_MS); | ||
1579 | rc = -ETIMEDOUT; | 1573 | rc = -ETIMEDOUT; |
1580 | } else { | 1574 | } else { |
1581 | int ms; | 1575 | int ms; |
@@ -1584,15 +1578,14 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1584 | 1578 | ||
1585 | rc = cmd->result ? -EINVAL : 0; | 1579 | rc = cmd->result ? -EINVAL : 0; |
1586 | if (rc) | 1580 | if (rc) |
1587 | printk(KERN_ERR "%s: Command %s error 0x%x\n", | 1581 | wiphy_err(hw->wiphy, "command %s error 0x%x\n", |
1588 | wiphy_name(hw->wiphy), | 1582 | mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), |
1589 | mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), | 1583 | le16_to_cpu(cmd->result)); |
1590 | le16_to_cpu(cmd->result)); | ||
1591 | else if (ms > 2000) | 1584 | else if (ms > 2000) |
1592 | printk(KERN_NOTICE "%s: Command %s took %d ms\n", | 1585 | wiphy_notice(hw->wiphy, "command %s took %d ms\n", |
1593 | wiphy_name(hw->wiphy), | 1586 | mwl8k_cmd_name(cmd->code, |
1594 | mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), | 1587 | buf, sizeof(buf)), |
1595 | ms); | 1588 | ms); |
1596 | } | 1589 | } |
1597 | 1590 | ||
1598 | return rc; | 1591 | return rc; |
@@ -3192,8 +3185,8 @@ static int mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3192 | int rc; | 3185 | int rc; |
3193 | 3186 | ||
3194 | if (!priv->radio_on) { | 3187 | if (!priv->radio_on) { |
3195 | printk(KERN_DEBUG "%s: dropped TX frame since radio " | 3188 | wiphy_debug(hw->wiphy, |
3196 | "disabled\n", wiphy_name(hw->wiphy)); | 3189 | "dropped TX frame since radio disabled\n"); |
3197 | dev_kfree_skb(skb); | 3190 | dev_kfree_skb(skb); |
3198 | return NETDEV_TX_OK; | 3191 | return NETDEV_TX_OK; |
3199 | } | 3192 | } |
@@ -3211,8 +3204,7 @@ static int mwl8k_start(struct ieee80211_hw *hw) | |||
3211 | rc = request_irq(priv->pdev->irq, mwl8k_interrupt, | 3204 | rc = request_irq(priv->pdev->irq, mwl8k_interrupt, |
3212 | IRQF_SHARED, MWL8K_NAME, hw); | 3205 | IRQF_SHARED, MWL8K_NAME, hw); |
3213 | if (rc) { | 3206 | if (rc) { |
3214 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | 3207 | wiphy_err(hw->wiphy, "failed to register irq handler\n"); |
3215 | wiphy_name(hw->wiphy)); | ||
3216 | return -EIO; | 3208 | return -EIO; |
3217 | } | 3209 | } |
3218 | 3210 | ||
@@ -3299,9 +3291,8 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw, | |||
3299 | * mode. (Sniffer mode is only used on STA firmware.) | 3291 | * mode. (Sniffer mode is only used on STA firmware.) |
3300 | */ | 3292 | */ |
3301 | if (priv->sniffer_enabled) { | 3293 | if (priv->sniffer_enabled) { |
3302 | printk(KERN_INFO "%s: unable to create STA " | 3294 | wiphy_info(hw->wiphy, |
3303 | "interface due to sniffer mode being enabled\n", | 3295 | "unable to create STA interface because sniffer mode is enabled\n"); |
3304 | wiphy_name(hw->wiphy)); | ||
3305 | return -EINVAL; | 3296 | return -EINVAL; |
3306 | } | 3297 | } |
3307 | 3298 | ||
@@ -3583,9 +3574,8 @@ mwl8k_configure_filter_sniffer(struct ieee80211_hw *hw, | |||
3583 | */ | 3574 | */ |
3584 | if (!list_empty(&priv->vif_list)) { | 3575 | if (!list_empty(&priv->vif_list)) { |
3585 | if (net_ratelimit()) | 3576 | if (net_ratelimit()) |
3586 | printk(KERN_INFO "%s: not enabling sniffer " | 3577 | wiphy_info(hw->wiphy, |
3587 | "mode because STA interface is active\n", | 3578 | "not enabling sniffer mode because STA interface is active\n"); |
3588 | wiphy_name(hw->wiphy)); | ||
3589 | return 0; | 3579 | return 0; |
3590 | } | 3580 | } |
3591 | 3581 | ||
@@ -3913,8 +3903,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3913 | 3903 | ||
3914 | priv->sram = pci_iomap(pdev, 0, 0x10000); | 3904 | priv->sram = pci_iomap(pdev, 0, 0x10000); |
3915 | if (priv->sram == NULL) { | 3905 | if (priv->sram == NULL) { |
3916 | printk(KERN_ERR "%s: Cannot map device SRAM\n", | 3906 | wiphy_err(hw->wiphy, "cannot map device sram\n"); |
3917 | wiphy_name(hw->wiphy)); | ||
3918 | goto err_iounmap; | 3907 | goto err_iounmap; |
3919 | } | 3908 | } |
3920 | 3909 | ||
@@ -3926,8 +3915,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3926 | if (priv->regs == NULL) { | 3915 | if (priv->regs == NULL) { |
3927 | priv->regs = pci_iomap(pdev, 2, 0x10000); | 3916 | priv->regs = pci_iomap(pdev, 2, 0x10000); |
3928 | if (priv->regs == NULL) { | 3917 | if (priv->regs == NULL) { |
3929 | printk(KERN_ERR "%s: Cannot map device registers\n", | 3918 | wiphy_err(hw->wiphy, "cannot map device registers\n"); |
3930 | wiphy_name(hw->wiphy)); | ||
3931 | goto err_iounmap; | 3919 | goto err_iounmap; |
3932 | } | 3920 | } |
3933 | } | 3921 | } |
@@ -3939,16 +3927,14 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3939 | /* Ask userland hotplug daemon for the device firmware */ | 3927 | /* Ask userland hotplug daemon for the device firmware */ |
3940 | rc = mwl8k_request_firmware(priv); | 3928 | rc = mwl8k_request_firmware(priv); |
3941 | if (rc) { | 3929 | if (rc) { |
3942 | printk(KERN_ERR "%s: Firmware files not found\n", | 3930 | wiphy_err(hw->wiphy, "firmware files not found\n"); |
3943 | wiphy_name(hw->wiphy)); | ||
3944 | goto err_stop_firmware; | 3931 | goto err_stop_firmware; |
3945 | } | 3932 | } |
3946 | 3933 | ||
3947 | /* Load firmware into hardware */ | 3934 | /* Load firmware into hardware */ |
3948 | rc = mwl8k_load_firmware(hw); | 3935 | rc = mwl8k_load_firmware(hw); |
3949 | if (rc) { | 3936 | if (rc) { |
3950 | printk(KERN_ERR "%s: Cannot start firmware\n", | 3937 | wiphy_err(hw->wiphy, "cannot start firmware\n"); |
3951 | wiphy_name(hw->wiphy)); | ||
3952 | goto err_stop_firmware; | 3938 | goto err_stop_firmware; |
3953 | } | 3939 | } |
3954 | 3940 | ||
@@ -3959,9 +3945,8 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3959 | if (priv->ap_fw) { | 3945 | if (priv->ap_fw) { |
3960 | priv->rxd_ops = priv->device_info->ap_rxd_ops; | 3946 | priv->rxd_ops = priv->device_info->ap_rxd_ops; |
3961 | if (priv->rxd_ops == NULL) { | 3947 | if (priv->rxd_ops == NULL) { |
3962 | printk(KERN_ERR "%s: Driver does not have AP " | 3948 | wiphy_err(hw->wiphy, |
3963 | "firmware image support for this hardware\n", | 3949 | "Driver does not have AP firmware image support for this hardware\n"); |
3964 | wiphy_name(hw->wiphy)); | ||
3965 | goto err_stop_firmware; | 3950 | goto err_stop_firmware; |
3966 | } | 3951 | } |
3967 | } else { | 3952 | } else { |
@@ -4039,8 +4024,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
4039 | rc = request_irq(priv->pdev->irq, mwl8k_interrupt, | 4024 | rc = request_irq(priv->pdev->irq, mwl8k_interrupt, |
4040 | IRQF_SHARED, MWL8K_NAME, hw); | 4025 | IRQF_SHARED, MWL8K_NAME, hw); |
4041 | if (rc) { | 4026 | if (rc) { |
4042 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | 4027 | wiphy_err(hw->wiphy, "failed to register irq handler\n"); |
4043 | wiphy_name(hw->wiphy)); | ||
4044 | goto err_free_queues; | 4028 | goto err_free_queues; |
4045 | } | 4029 | } |
4046 | 4030 | ||
@@ -4060,8 +4044,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
4060 | rc = mwl8k_cmd_get_hw_spec_sta(hw); | 4044 | rc = mwl8k_cmd_get_hw_spec_sta(hw); |
4061 | } | 4045 | } |
4062 | if (rc) { | 4046 | if (rc) { |
4063 | printk(KERN_ERR "%s: Cannot initialise firmware\n", | 4047 | wiphy_err(hw->wiphy, "cannot initialise firmware\n"); |
4064 | wiphy_name(hw->wiphy)); | ||
4065 | goto err_free_irq; | 4048 | goto err_free_irq; |
4066 | } | 4049 | } |
4067 | 4050 | ||
@@ -4075,15 +4058,14 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
4075 | /* Turn radio off */ | 4058 | /* Turn radio off */ |
4076 | rc = mwl8k_cmd_radio_disable(hw); | 4059 | rc = mwl8k_cmd_radio_disable(hw); |
4077 | if (rc) { | 4060 | if (rc) { |
4078 | printk(KERN_ERR "%s: Cannot disable\n", wiphy_name(hw->wiphy)); | 4061 | wiphy_err(hw->wiphy, "cannot disable\n"); |
4079 | goto err_free_irq; | 4062 | goto err_free_irq; |
4080 | } | 4063 | } |
4081 | 4064 | ||
4082 | /* Clear MAC address */ | 4065 | /* Clear MAC address */ |
4083 | rc = mwl8k_cmd_set_mac_addr(hw, NULL, "\x00\x00\x00\x00\x00\x00"); | 4066 | rc = mwl8k_cmd_set_mac_addr(hw, NULL, "\x00\x00\x00\x00\x00\x00"); |
4084 | if (rc) { | 4067 | if (rc) { |
4085 | printk(KERN_ERR "%s: Cannot clear MAC address\n", | 4068 | wiphy_err(hw->wiphy, "cannot clear mac address\n"); |
4086 | wiphy_name(hw->wiphy)); | ||
4087 | goto err_free_irq; | 4069 | goto err_free_irq; |
4088 | } | 4070 | } |
4089 | 4071 | ||
@@ -4093,17 +4075,16 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
4093 | 4075 | ||
4094 | rc = ieee80211_register_hw(hw); | 4076 | rc = ieee80211_register_hw(hw); |
4095 | if (rc) { | 4077 | if (rc) { |
4096 | printk(KERN_ERR "%s: Cannot register device\n", | 4078 | wiphy_err(hw->wiphy, "cannot register device\n"); |
4097 | wiphy_name(hw->wiphy)); | ||
4098 | goto err_free_queues; | 4079 | goto err_free_queues; |
4099 | } | 4080 | } |
4100 | 4081 | ||
4101 | printk(KERN_INFO "%s: %s v%d, %pM, %s firmware %u.%u.%u.%u\n", | 4082 | wiphy_info(hw->wiphy, "%s v%d, %pm, %s firmware %u.%u.%u.%u\n", |
4102 | wiphy_name(hw->wiphy), priv->device_info->part_name, | 4083 | priv->device_info->part_name, |
4103 | priv->hw_rev, hw->wiphy->perm_addr, | 4084 | priv->hw_rev, hw->wiphy->perm_addr, |
4104 | priv->ap_fw ? "AP" : "STA", | 4085 | priv->ap_fw ? "AP" : "STA", |
4105 | (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, | 4086 | (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, |
4106 | (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); | 4087 | (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); |
4107 | 4088 | ||
4108 | return 0; | 4089 | return 0; |
4109 | 4090 | ||