aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/at76c50x-usb.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-07-26 17:39:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-27 15:14:13 -0400
commitc96c31e499b70964cfc88744046c998bb710e4b8 (patch)
tree0157102fbc952e3646690f3491199607669eed69 /drivers/net/wireless/at76c50x-usb.c
parente1db74fcc3d95c8a051ec457241b5aa65a01a603 (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/at76c50x-usb.c')
-rw-r--r--drivers/net/wireless/at76c50x-usb.c139
1 files changed, 67 insertions, 72 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index cd8caeab86ea..9b0f055420ee 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -658,8 +658,8 @@ static int at76_get_hw_config(struct at76_priv *priv)
658exit: 658exit:
659 kfree(hwcfg); 659 kfree(hwcfg);
660 if (ret < 0) 660 if (ret < 0)
661 printk(KERN_ERR "%s: cannot get HW Config (error %d)\n", 661 wiphy_err(priv->hw->wiphy, "cannot get hw config (error %d)\n",
662 wiphy_name(priv->hw->wiphy), ret); 662 ret);
663 663
664 return ret; 664 return ret;
665} 665}
@@ -794,8 +794,9 @@ static int at76_wait_completion(struct at76_priv *priv, int cmd)
794 do { 794 do {
795 status = at76_get_cmd_status(priv->udev, cmd); 795 status = at76_get_cmd_status(priv->udev, cmd);
796 if (status < 0) { 796 if (status < 0) {
797 printk(KERN_ERR "%s: at76_get_cmd_status failed: %d\n", 797 wiphy_err(priv->hw->wiphy,
798 wiphy_name(priv->hw->wiphy), status); 798 "at76_get_cmd_status failed: %d\n",
799 status);
799 break; 800 break;
800 } 801 }
801 802
@@ -810,9 +811,8 @@ static int at76_wait_completion(struct at76_priv *priv, int cmd)
810 811
811 schedule_timeout_interruptible(HZ / 10); /* 100 ms */ 812 schedule_timeout_interruptible(HZ / 10); /* 100 ms */
812 if (time_after(jiffies, timeout)) { 813 if (time_after(jiffies, timeout)) {
813 printk(KERN_ERR 814 wiphy_err(priv->hw->wiphy,
814 "%s: completion timeout for command %d\n", 815 "completion timeout for command %d\n", cmd);
815 wiphy_name(priv->hw->wiphy), cmd);
816 status = -ETIMEDOUT; 816 status = -ETIMEDOUT;
817 break; 817 break;
818 } 818 }
@@ -833,9 +833,9 @@ static int at76_set_mib(struct at76_priv *priv, struct set_mib_buffer *buf)
833 833
834 ret = at76_wait_completion(priv, CMD_SET_MIB); 834 ret = at76_wait_completion(priv, CMD_SET_MIB);
835 if (ret != CMD_STATUS_COMPLETE) { 835 if (ret != CMD_STATUS_COMPLETE) {
836 printk(KERN_INFO 836 wiphy_info(priv->hw->wiphy,
837 "%s: set_mib: at76_wait_completion failed " 837 "set_mib: at76_wait_completion failed with %d\n",
838 "with %d\n", wiphy_name(priv->hw->wiphy), ret); 838 ret);
839 ret = -EIO; 839 ret = -EIO;
840 } 840 }
841 841
@@ -855,8 +855,8 @@ static int at76_set_radio(struct at76_priv *priv, int enable)
855 855
856 ret = at76_set_card_command(priv->udev, cmd, NULL, 0); 856 ret = at76_set_card_command(priv->udev, cmd, NULL, 0);
857 if (ret < 0) 857 if (ret < 0)
858 printk(KERN_ERR "%s: at76_set_card_command(%d) failed: %d\n", 858 wiphy_err(priv->hw->wiphy,
859 wiphy_name(priv->hw->wiphy), cmd, ret); 859 "at76_set_card_command(%d) failed: %d\n", cmd, ret);
860 else 860 else
861 ret = 1; 861 ret = 1;
862 862
@@ -876,8 +876,8 @@ static int at76_set_pm_mode(struct at76_priv *priv)
876 876
877 ret = at76_set_mib(priv, &priv->mib_buf); 877 ret = at76_set_mib(priv, &priv->mib_buf);
878 if (ret < 0) 878 if (ret < 0)
879 printk(KERN_ERR "%s: set_mib (pm_mode) failed: %d\n", 879 wiphy_err(priv->hw->wiphy, "set_mib (pm_mode) failed: %d\n",
880 wiphy_name(priv->hw->wiphy), ret); 880 ret);
881 881
882 return ret; 882 return ret;
883} 883}
@@ -893,8 +893,8 @@ static int at76_set_preamble(struct at76_priv *priv, u8 type)
893 893
894 ret = at76_set_mib(priv, &priv->mib_buf); 894 ret = at76_set_mib(priv, &priv->mib_buf);
895 if (ret < 0) 895 if (ret < 0)
896 printk(KERN_ERR "%s: set_mib (preamble) failed: %d\n", 896 wiphy_err(priv->hw->wiphy, "set_mib (preamble) failed: %d\n",
897 wiphy_name(priv->hw->wiphy), ret); 897 ret);
898 898
899 return ret; 899 return ret;
900} 900}
@@ -910,8 +910,8 @@ static int at76_set_frag(struct at76_priv *priv, u16 size)
910 910
911 ret = at76_set_mib(priv, &priv->mib_buf); 911 ret = at76_set_mib(priv, &priv->mib_buf);
912 if (ret < 0) 912 if (ret < 0)
913 printk(KERN_ERR "%s: set_mib (frag threshold) failed: %d\n", 913 wiphy_err(priv->hw->wiphy,
914 wiphy_name(priv->hw->wiphy), ret); 914 "set_mib (frag threshold) failed: %d\n", ret);
915 915
916 return ret; 916 return ret;
917} 917}
@@ -927,8 +927,7 @@ static int at76_set_rts(struct at76_priv *priv, u16 size)
927 927
928 ret = at76_set_mib(priv, &priv->mib_buf); 928 ret = at76_set_mib(priv, &priv->mib_buf);
929 if (ret < 0) 929 if (ret < 0)
930 printk(KERN_ERR "%s: set_mib (rts) failed: %d\n", 930 wiphy_err(priv->hw->wiphy, "set_mib (rts) failed: %d\n", ret);
931 wiphy_name(priv->hw->wiphy), ret);
932 931
933 return ret; 932 return ret;
934} 933}
@@ -944,8 +943,8 @@ static int at76_set_autorate_fallback(struct at76_priv *priv, int onoff)
944 943
945 ret = at76_set_mib(priv, &priv->mib_buf); 944 ret = at76_set_mib(priv, &priv->mib_buf);
946 if (ret < 0) 945 if (ret < 0)
947 printk(KERN_ERR "%s: set_mib (autorate fallback) failed: %d\n", 946 wiphy_err(priv->hw->wiphy,
948 wiphy_name(priv->hw->wiphy), ret); 947 "set_mib (autorate fallback) failed: %d\n", ret);
949 948
950 return ret; 949 return ret;
951} 950}
@@ -963,8 +962,8 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv)
963 ret = at76_get_mib(priv->udev, MIB_MAC_ADDR, m, 962 ret = at76_get_mib(priv->udev, MIB_MAC_ADDR, m,
964 sizeof(struct mib_mac_addr)); 963 sizeof(struct mib_mac_addr));
965 if (ret < 0) { 964 if (ret < 0) {
966 printk(KERN_ERR "%s: at76_get_mib (MAC_ADDR) failed: %d\n", 965 wiphy_err(priv->hw->wiphy,
967 wiphy_name(priv->hw->wiphy), ret); 966 "at76_get_mib (mac_addr) failed: %d\n", ret);
968 goto exit; 967 goto exit;
969 } 968 }
970 969
@@ -992,8 +991,8 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv)
992 ret = at76_get_mib(priv->udev, MIB_MAC_WEP, m, 991 ret = at76_get_mib(priv->udev, MIB_MAC_WEP, m,
993 sizeof(struct mib_mac_wep)); 992 sizeof(struct mib_mac_wep));
994 if (ret < 0) { 993 if (ret < 0) {
995 printk(KERN_ERR "%s: at76_get_mib (MAC_WEP) failed: %d\n", 994 wiphy_err(priv->hw->wiphy,
996 wiphy_name(priv->hw->wiphy), ret); 995 "at76_get_mib (mac_wep) failed: %d\n", ret);
997 goto exit; 996 goto exit;
998 } 997 }
999 998
@@ -1029,8 +1028,8 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
1029 ret = at76_get_mib(priv->udev, MIB_MAC_MGMT, m, 1028 ret = at76_get_mib(priv->udev, MIB_MAC_MGMT, m,
1030 sizeof(struct mib_mac_mgmt)); 1029 sizeof(struct mib_mac_mgmt));
1031 if (ret < 0) { 1030 if (ret < 0) {
1032 printk(KERN_ERR "%s: at76_get_mib (MAC_MGMT) failed: %d\n", 1031 wiphy_err(priv->hw->wiphy,
1033 wiphy_name(priv->hw->wiphy), ret); 1032 "at76_get_mib (mac_mgmt) failed: %d\n", ret);
1034 goto exit; 1033 goto exit;
1035 } 1034 }
1036 1035
@@ -1065,8 +1064,8 @@ static void at76_dump_mib_mac(struct at76_priv *priv)
1065 1064
1066 ret = at76_get_mib(priv->udev, MIB_MAC, m, sizeof(struct mib_mac)); 1065 ret = at76_get_mib(priv->udev, MIB_MAC, m, sizeof(struct mib_mac));
1067 if (ret < 0) { 1066 if (ret < 0) {
1068 printk(KERN_ERR "%s: at76_get_mib (MAC) failed: %d\n", 1067 wiphy_err(priv->hw->wiphy,
1069 wiphy_name(priv->hw->wiphy), ret); 1068 "at76_get_mib (mac) failed: %d\n", ret);
1070 goto exit; 1069 goto exit;
1071 } 1070 }
1072 1071
@@ -1102,8 +1101,8 @@ static void at76_dump_mib_phy(struct at76_priv *priv)
1102 1101
1103 ret = at76_get_mib(priv->udev, MIB_PHY, m, sizeof(struct mib_phy)); 1102 ret = at76_get_mib(priv->udev, MIB_PHY, m, sizeof(struct mib_phy));
1104 if (ret < 0) { 1103 if (ret < 0) {
1105 printk(KERN_ERR "%s: at76_get_mib (PHY) failed: %d\n", 1104 wiphy_err(priv->hw->wiphy,
1106 wiphy_name(priv->hw->wiphy), ret); 1105 "at76_get_mib (phy) failed: %d\n", ret);
1107 goto exit; 1106 goto exit;
1108 } 1107 }
1109 1108
@@ -1135,8 +1134,8 @@ static void at76_dump_mib_local(struct at76_priv *priv)
1135 1134
1136 ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local)); 1135 ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local));
1137 if (ret < 0) { 1136 if (ret < 0) {
1138 printk(KERN_ERR "%s: at76_get_mib (LOCAL) failed: %d\n", 1137 wiphy_err(priv->hw->wiphy,
1139 wiphy_name(priv->hw->wiphy), ret); 1138 "at76_get_mib (local) failed: %d\n", ret);
1140 goto exit; 1139 goto exit;
1141 } 1140 }
1142 1141
@@ -1161,8 +1160,8 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv)
1161 ret = at76_get_mib(priv->udev, MIB_MDOMAIN, m, 1160 ret = at76_get_mib(priv->udev, MIB_MDOMAIN, m,
1162 sizeof(struct mib_mdomain)); 1161 sizeof(struct mib_mdomain));
1163 if (ret < 0) { 1162 if (ret < 0) {
1164 printk(KERN_ERR "%s: at76_get_mib (MDOMAIN) failed: %d\n", 1163 wiphy_err(priv->hw->wiphy,
1165 wiphy_name(priv->hw->wiphy), ret); 1164 "at76_get_mib (mdomain) failed: %d\n", ret);
1166 goto exit; 1165 goto exit;
1167 } 1166 }
1168 1167
@@ -1233,16 +1232,16 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
1233 struct sk_buff *skb = priv->rx_skb; 1232 struct sk_buff *skb = priv->rx_skb;
1234 1233
1235 if (!priv->rx_urb) { 1234 if (!priv->rx_urb) {
1236 printk(KERN_ERR "%s: %s: priv->rx_urb is NULL\n", 1235 wiphy_err(priv->hw->wiphy, "%s: priv->rx_urb is null\n",
1237 wiphy_name(priv->hw->wiphy), __func__); 1236 __func__);
1238 return -EFAULT; 1237 return -EFAULT;
1239 } 1238 }
1240 1239
1241 if (!skb) { 1240 if (!skb) {
1242 skb = dev_alloc_skb(sizeof(struct at76_rx_buffer)); 1241 skb = dev_alloc_skb(sizeof(struct at76_rx_buffer));
1243 if (!skb) { 1242 if (!skb) {
1244 printk(KERN_ERR "%s: cannot allocate rx skbuff\n", 1243 wiphy_err(priv->hw->wiphy,
1245 wiphy_name(priv->hw->wiphy)); 1244 "cannot allocate rx skbuff\n");
1246 ret = -ENOMEM; 1245 ret = -ENOMEM;
1247 goto exit; 1246 goto exit;
1248 } 1247 }
@@ -1261,15 +1260,14 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
1261 at76_dbg(DBG_DEVSTART, 1260 at76_dbg(DBG_DEVSTART,
1262 "usb_submit_urb returned -ENODEV"); 1261 "usb_submit_urb returned -ENODEV");
1263 else 1262 else
1264 printk(KERN_ERR "%s: rx, usb_submit_urb failed: %d\n", 1263 wiphy_err(priv->hw->wiphy,
1265 wiphy_name(priv->hw->wiphy), ret); 1264 "rx, usb_submit_urb failed: %d\n", ret);
1266 } 1265 }
1267 1266
1268exit: 1267exit:
1269 if (ret < 0 && ret != -ENODEV) 1268 if (ret < 0 && ret != -ENODEV)
1270 printk(KERN_ERR "%s: cannot submit rx urb - please unload the " 1269 wiphy_err(priv->hw->wiphy,
1271 "driver and/or power cycle the device\n", 1270 "cannot submit rx urb - please unload the driver and/or power cycle the device\n");
1272 wiphy_name(priv->hw->wiphy));
1273 1271
1274 return ret; 1272 return ret;
1275} 1273}
@@ -1438,8 +1436,8 @@ static int at76_startup_device(struct at76_priv *priv)
1438 ret = at76_set_card_command(priv->udev, CMD_STARTUP, &priv->card_config, 1436 ret = at76_set_card_command(priv->udev, CMD_STARTUP, &priv->card_config,
1439 sizeof(struct at76_card_config)); 1437 sizeof(struct at76_card_config));
1440 if (ret < 0) { 1438 if (ret < 0) {
1441 printk(KERN_ERR "%s: at76_set_card_command failed: %d\n", 1439 wiphy_err(priv->hw->wiphy, "at76_set_card_command failed: %d\n",
1442 wiphy_name(priv->hw->wiphy), ret); 1440 ret);
1443 return ret; 1441 return ret;
1444 } 1442 }
1445 1443
@@ -1504,8 +1502,8 @@ static void at76_work_set_promisc(struct work_struct *work)
1504 1502
1505 ret = at76_set_mib(priv, &priv->mib_buf); 1503 ret = at76_set_mib(priv, &priv->mib_buf);
1506 if (ret < 0) 1504 if (ret < 0)
1507 printk(KERN_ERR "%s: set_mib (promiscuous_mode) failed: %d\n", 1505 wiphy_err(priv->hw->wiphy,
1508 wiphy_name(priv->hw->wiphy), ret); 1506 "set_mib (promiscuous_mode) failed: %d\n", ret);
1509 1507
1510 mutex_unlock(&priv->mtx); 1508 mutex_unlock(&priv->mtx);
1511} 1509}
@@ -1668,16 +1666,16 @@ static int at76_join(struct at76_priv *priv)
1668 sizeof(struct at76_req_join)); 1666 sizeof(struct at76_req_join));
1669 1667
1670 if (ret < 0) { 1668 if (ret < 0) {
1671 printk(KERN_ERR "%s: at76_set_card_command failed: %d\n", 1669 wiphy_err(priv->hw->wiphy, "at76_set_card_command failed: %d\n",
1672 wiphy_name(priv->hw->wiphy), ret); 1670 ret);
1673 return 0; 1671 return 0;
1674 } 1672 }
1675 1673
1676 ret = at76_wait_completion(priv, CMD_JOIN); 1674 ret = at76_wait_completion(priv, CMD_JOIN);
1677 at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret); 1675 at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret);
1678 if (ret != CMD_STATUS_COMPLETE) { 1676 if (ret != CMD_STATUS_COMPLETE) {
1679 printk(KERN_ERR "%s: at76_wait_completion failed: %d\n", 1677 wiphy_err(priv->hw->wiphy, "at76_wait_completion failed: %d\n",
1680 wiphy_name(priv->hw->wiphy), ret); 1678 ret);
1681 return 0; 1679 return 0;
1682 } 1680 }
1683 1681
@@ -1745,8 +1743,8 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1745 at76_dbg(DBG_MAC80211, "%s()", __func__); 1743 at76_dbg(DBG_MAC80211, "%s()", __func__);
1746 1744
1747 if (priv->tx_urb->status == -EINPROGRESS) { 1745 if (priv->tx_urb->status == -EINPROGRESS) {
1748 printk(KERN_ERR "%s: %s called while tx urb is pending\n", 1746 wiphy_err(priv->hw->wiphy,
1749 wiphy_name(priv->hw->wiphy), __func__); 1747 "%s called while tx urb is pending\n", __func__);
1750 return NETDEV_TX_BUSY; 1748 return NETDEV_TX_BUSY;
1751 } 1749 }
1752 1750
@@ -1794,13 +1792,12 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1794 submit_len, at76_mac80211_tx_callback, priv); 1792 submit_len, at76_mac80211_tx_callback, priv);
1795 ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC); 1793 ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
1796 if (ret) { 1794 if (ret) {
1797 printk(KERN_ERR "%s: error in tx submit urb: %d\n", 1795 wiphy_err(priv->hw->wiphy, "error in tx submit urb: %d\n", ret);
1798 wiphy_name(priv->hw->wiphy), ret);
1799 if (ret == -EINVAL) 1796 if (ret == -EINVAL)
1800 printk(KERN_ERR 1797 wiphy_err(priv->hw->wiphy,
1801 "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n", 1798 "-einval: tx urb %p hcpriv %p complete %p\n",
1802 wiphy_name(priv->hw->wiphy), priv->tx_urb, 1799 priv->tx_urb,
1803 priv->tx_urb->hcpriv, priv->tx_urb->complete); 1800 priv->tx_urb->hcpriv, priv->tx_urb->complete);
1804 } 1801 }
1805 1802
1806 return 0; 1803 return 0;
@@ -1817,8 +1814,8 @@ static int at76_mac80211_start(struct ieee80211_hw *hw)
1817 1814
1818 ret = at76_submit_rx_urb(priv); 1815 ret = at76_submit_rx_urb(priv);
1819 if (ret < 0) { 1816 if (ret < 0) {
1820 printk(KERN_ERR "%s: open: submit_rx_urb failed: %d\n", 1817 wiphy_err(priv->hw->wiphy, "open: submit_rx_urb failed: %d\n",
1821 wiphy_name(priv->hw->wiphy), ret); 1818 ret);
1822 goto error; 1819 goto error;
1823 } 1820 }
1824 1821
@@ -2316,14 +2313,12 @@ static int at76_init_new_device(struct at76_priv *priv,
2316 2313
2317 priv->mac80211_registered = 1; 2314 priv->mac80211_registered = 1;
2318 2315
2319 printk(KERN_INFO "%s: USB %s, MAC %pM, firmware %d.%d.%d-%d\n", 2316 wiphy_info(priv->hw->wiphy, "usb %s, mac %pm, firmware %d.%d.%d-%d\n",
2320 wiphy_name(priv->hw->wiphy), 2317 dev_name(&interface->dev), priv->mac_addr,
2321 dev_name(&interface->dev), priv->mac_addr, 2318 priv->fw_version.major, priv->fw_version.minor,
2322 priv->fw_version.major, priv->fw_version.minor, 2319 priv->fw_version.patch, priv->fw_version.build);
2323 priv->fw_version.patch, priv->fw_version.build); 2320 wiphy_info(priv->hw->wiphy, "regulatory domain 0x%02x: %s\n",
2324 printk(KERN_INFO "%s: regulatory domain 0x%02x: %s\n", 2321 priv->regulatory_domain, priv->domain->name);
2325 wiphy_name(priv->hw->wiphy),
2326 priv->regulatory_domain, priv->domain->name);
2327 2322
2328exit: 2323exit:
2329 return ret; 2324 return ret;
@@ -2485,7 +2480,7 @@ static void at76_disconnect(struct usb_interface *interface)
2485 if (!priv) 2480 if (!priv)
2486 return; 2481 return;
2487 2482
2488 printk(KERN_INFO "%s: disconnecting\n", wiphy_name(priv->hw->wiphy)); 2483 wiphy_info(priv->hw->wiphy, "disconnecting\n");
2489 at76_delete_device(priv); 2484 at76_delete_device(priv);
2490 dev_printk(KERN_INFO, &interface->dev, "disconnected\n"); 2485 dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
2491} 2486}