diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 05:30:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:35:40 -0500 |
commit | 60b86755929e1a7e9038c8d860a8491cfdf8d93a (patch) | |
tree | 97062c7136ead4adcdbf2bd3280143da1fabbe20 /drivers/net/wireless/rndis_wlan.c | |
parent | 82456b031e3c3b5bf95a7e49bd9b68b146446e76 (diff) |
usbnet: Convert dev(dbg|err|warn|info) macros to netdev_<level>
These macros are too similar to the dev_<level> equivalents
but take a usbnet * argument. Convert them to the recently
introduced netdev_<level> macros and remove the old macros.
The old macros had "\n" appended to the format string.
Add the "\n" to the converted uses.
Some existing uses of the dev<foo> macros in cdc_eem.c
probably mistakenly had trailing "\n". No "\n" added there.
Fix net1080 this/other log message inversion.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 325 |
1 files changed, 173 insertions, 152 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 14692bc51b51..65cbd060cc30 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -728,9 +728,9 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
728 | ret = rndis_command(dev, u.header, buflen); | 728 | ret = rndis_command(dev, u.header, buflen); |
729 | priv->current_command_oid = 0; | 729 | priv->current_command_oid = 0; |
730 | if (ret < 0) | 730 | if (ret < 0) |
731 | devdbg(dev, "rndis_query_oid(%s): rndis_command() failed, %d " | 731 | netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n", |
732 | "(%08x)", oid_to_string(oid), ret, | 732 | __func__, oid_to_string(oid), ret, |
733 | le32_to_cpu(u.get_c->status)); | 733 | le32_to_cpu(u.get_c->status)); |
734 | 734 | ||
735 | if (ret == 0) { | 735 | if (ret == 0) { |
736 | memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len); | 736 | memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len); |
@@ -741,9 +741,9 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
741 | 741 | ||
742 | ret = rndis_error_status(u.get_c->status); | 742 | ret = rndis_error_status(u.get_c->status); |
743 | if (ret < 0) | 743 | if (ret < 0) |
744 | devdbg(dev, "rndis_query_oid(%s): device returned " | 744 | netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n", |
745 | "error, 0x%08x (%d)", oid_to_string(oid), | 745 | __func__, oid_to_string(oid), |
746 | le32_to_cpu(u.get_c->status), ret); | 746 | le32_to_cpu(u.get_c->status), ret); |
747 | } | 747 | } |
748 | 748 | ||
749 | mutex_unlock(&priv->command_lock); | 749 | mutex_unlock(&priv->command_lock); |
@@ -791,17 +791,17 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len) | |||
791 | ret = rndis_command(dev, u.header, buflen); | 791 | ret = rndis_command(dev, u.header, buflen); |
792 | priv->current_command_oid = 0; | 792 | priv->current_command_oid = 0; |
793 | if (ret < 0) | 793 | if (ret < 0) |
794 | devdbg(dev, "rndis_set_oid(%s): rndis_command() failed, %d " | 794 | netdev_dbg(dev->net, "%s(%s): rndis_command() failed, %d (%08x)\n", |
795 | "(%08x)", oid_to_string(oid), ret, | 795 | __func__, oid_to_string(oid), ret, |
796 | le32_to_cpu(u.set_c->status)); | 796 | le32_to_cpu(u.set_c->status)); |
797 | 797 | ||
798 | if (ret == 0) { | 798 | if (ret == 0) { |
799 | ret = rndis_error_status(u.set_c->status); | 799 | ret = rndis_error_status(u.set_c->status); |
800 | 800 | ||
801 | if (ret < 0) | 801 | if (ret < 0) |
802 | devdbg(dev, "rndis_set_oid(%s): device returned error, " | 802 | netdev_dbg(dev->net, "%s(%s): device returned error, 0x%08x (%d)\n", |
803 | "0x%08x (%d)", oid_to_string(oid), | 803 | __func__, oid_to_string(oid), |
804 | le32_to_cpu(u.set_c->status), ret); | 804 | le32_to_cpu(u.set_c->status), ret); |
805 | } | 805 | } |
806 | 806 | ||
807 | mutex_unlock(&priv->command_lock); | 807 | mutex_unlock(&priv->command_lock); |
@@ -870,11 +870,11 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
870 | #endif | 870 | #endif |
871 | 871 | ||
872 | if (value_type == 2) | 872 | if (value_type == 2) |
873 | devdbg(dev, "setting config parameter: %s, value: %s", | 873 | netdev_dbg(dev->net, "setting config parameter: %s, value: %s\n", |
874 | param, (u8 *)value); | 874 | param, (u8 *)value); |
875 | else | 875 | else |
876 | devdbg(dev, "setting config parameter: %s, value: %d", | 876 | netdev_dbg(dev->net, "setting config parameter: %s, value: %d\n", |
877 | param, *(u32 *)value); | 877 | param, *(u32 *)value); |
878 | 878 | ||
879 | infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); | 879 | infobuf->name_offs = cpu_to_le32(sizeof(*infobuf)); |
880 | infobuf->name_length = cpu_to_le32(param_len); | 880 | infobuf->name_length = cpu_to_le32(param_len); |
@@ -897,20 +897,21 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
897 | } | 897 | } |
898 | 898 | ||
899 | #ifdef DEBUG | 899 | #ifdef DEBUG |
900 | devdbg(dev, "info buffer (len: %d):", info_len); | 900 | netdev_dbg(dev->net, "info buffer (len: %d)\n", info_len); |
901 | for (i = 0; i < info_len; i += 12) { | 901 | for (i = 0; i < info_len; i += 12) { |
902 | u32 *tmp = (u32 *)((u8 *)infobuf + i); | 902 | u32 *tmp = (u32 *)((u8 *)infobuf + i); |
903 | devdbg(dev, "%08X:%08X:%08X", | 903 | netdev_dbg(dev->net, "%08X:%08X:%08X\n", |
904 | cpu_to_be32(tmp[0]), | 904 | cpu_to_be32(tmp[0]), |
905 | cpu_to_be32(tmp[1]), | 905 | cpu_to_be32(tmp[1]), |
906 | cpu_to_be32(tmp[2])); | 906 | cpu_to_be32(tmp[2])); |
907 | } | 907 | } |
908 | #endif | 908 | #endif |
909 | 909 | ||
910 | ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, | 910 | ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, |
911 | infobuf, info_len); | 911 | infobuf, info_len); |
912 | if (ret != 0) | 912 | if (ret != 0) |
913 | devdbg(dev, "setting rndis config parameter failed, %d.", ret); | 913 | netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n", |
914 | ret); | ||
914 | 915 | ||
915 | kfree(infobuf); | 916 | kfree(infobuf); |
916 | return ret; | 917 | return ret; |
@@ -945,13 +946,13 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) | |||
945 | 946 | ||
946 | ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); | 947 | ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); |
947 | if (ret < 0) { | 948 | if (ret < 0) { |
948 | devwarn(usbdev, "setting SSID failed (%08X)", ret); | 949 | netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); |
949 | return ret; | 950 | return ret; |
950 | } | 951 | } |
951 | if (ret == 0) { | 952 | if (ret == 0) { |
952 | memcpy(&priv->essid, ssid, sizeof(priv->essid)); | 953 | memcpy(&priv->essid, ssid, sizeof(priv->essid)); |
953 | priv->radio_on = true; | 954 | priv->radio_on = true; |
954 | devdbg(usbdev, "set_essid: radio_on = true"); | 955 | netdev_dbg(usbdev->net, "%s(): radio_on = true\n", __func__); |
955 | } | 956 | } |
956 | 957 | ||
957 | return ret; | 958 | return ret; |
@@ -963,7 +964,8 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) | |||
963 | 964 | ||
964 | ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); | 965 | ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); |
965 | if (ret < 0) { | 966 | if (ret < 0) { |
966 | devwarn(usbdev, "setting BSSID[%pM] failed (%08X)", bssid, ret); | 967 | netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", |
968 | bssid, ret); | ||
967 | return ret; | 969 | return ret; |
968 | } | 970 | } |
969 | 971 | ||
@@ -1021,7 +1023,8 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid) | |||
1021 | ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); | 1023 | ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); |
1022 | if (ret == 0) { | 1024 | if (ret == 0) { |
1023 | priv->radio_on = false; | 1025 | priv->radio_on = false; |
1024 | devdbg(usbdev, "disassociate: radio_on = false"); | 1026 | netdev_dbg(usbdev->net, "%s(): radio_on = false\n", |
1027 | __func__); | ||
1025 | 1028 | ||
1026 | if (reset_ssid) | 1029 | if (reset_ssid) |
1027 | msleep(100); | 1030 | msleep(100); |
@@ -1054,8 +1057,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, | |||
1054 | __le32 tmp; | 1057 | __le32 tmp; |
1055 | int auth_mode, ret; | 1058 | int auth_mode, ret; |
1056 | 1059 | ||
1057 | devdbg(usbdev, "set_auth_mode: wpa_version=0x%x authalg=0x%x " | 1060 | netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x authalg=0x%x keymgmt=0x%x\n", |
1058 | "keymgmt=0x%x", wpa_version, auth_type, keymgmt); | 1061 | __func__, wpa_version, auth_type, keymgmt); |
1059 | 1062 | ||
1060 | if (wpa_version & NL80211_WPA_VERSION_2) { | 1063 | if (wpa_version & NL80211_WPA_VERSION_2) { |
1061 | if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X) | 1064 | if (keymgmt & RNDIS_WLAN_KEY_MGMT_802_1X) |
@@ -1082,7 +1085,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, | |||
1082 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, | 1085 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, |
1083 | sizeof(tmp)); | 1086 | sizeof(tmp)); |
1084 | if (ret != 0) { | 1087 | if (ret != 0) { |
1085 | devwarn(usbdev, "setting auth mode failed (%08X)", ret); | 1088 | netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", |
1089 | ret); | ||
1086 | return ret; | 1090 | return ret; |
1087 | } | 1091 | } |
1088 | 1092 | ||
@@ -1098,7 +1102,8 @@ static int set_priv_filter(struct usbnet *usbdev) | |||
1098 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 1102 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
1099 | __le32 tmp; | 1103 | __le32 tmp; |
1100 | 1104 | ||
1101 | devdbg(usbdev, "set_priv_filter: wpa_version=0x%x", priv->wpa_version); | 1105 | netdev_dbg(usbdev->net, "%s(): wpa_version=0x%x\n", |
1106 | __func__, priv->wpa_version); | ||
1102 | 1107 | ||
1103 | if (priv->wpa_version & NL80211_WPA_VERSION_2 || | 1108 | if (priv->wpa_version & NL80211_WPA_VERSION_2 || |
1104 | priv->wpa_version & NL80211_WPA_VERSION_1) | 1109 | priv->wpa_version & NL80211_WPA_VERSION_1) |
@@ -1116,8 +1121,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
1116 | __le32 tmp; | 1121 | __le32 tmp; |
1117 | int encr_mode, ret; | 1122 | int encr_mode, ret; |
1118 | 1123 | ||
1119 | devdbg(usbdev, "set_encr_mode: cipher_pair=0x%x cipher_group=0x%x", | 1124 | netdev_dbg(usbdev->net, "%s(): cipher_pair=0x%x cipher_group=0x%x\n", |
1120 | pairwise, groupwise); | 1125 | __func__, pairwise, groupwise); |
1121 | 1126 | ||
1122 | if (pairwise & RNDIS_WLAN_ALG_CCMP) | 1127 | if (pairwise & RNDIS_WLAN_ALG_CCMP) |
1123 | encr_mode = NDIS_80211_ENCR_CCMP_ENABLED; | 1128 | encr_mode = NDIS_80211_ENCR_CCMP_ENABLED; |
@@ -1136,7 +1141,8 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
1136 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, | 1141 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, |
1137 | sizeof(tmp)); | 1142 | sizeof(tmp)); |
1138 | if (ret != 0) { | 1143 | if (ret != 0) { |
1139 | devwarn(usbdev, "setting encr mode failed (%08X)", ret); | 1144 | netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", |
1145 | ret); | ||
1140 | return ret; | 1146 | return ret; |
1141 | } | 1147 | } |
1142 | 1148 | ||
@@ -1151,13 +1157,15 @@ static int set_infra_mode(struct usbnet *usbdev, int mode) | |||
1151 | __le32 tmp; | 1157 | __le32 tmp; |
1152 | int ret; | 1158 | int ret; |
1153 | 1159 | ||
1154 | devdbg(usbdev, "set_infra_mode: infra_mode=0x%x", priv->infra_mode); | 1160 | netdev_dbg(usbdev->net, "%s(): infra_mode=0x%x\n", |
1161 | __func__, priv->infra_mode); | ||
1155 | 1162 | ||
1156 | tmp = cpu_to_le32(mode); | 1163 | tmp = cpu_to_le32(mode); |
1157 | ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, | 1164 | ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, |
1158 | sizeof(tmp)); | 1165 | sizeof(tmp)); |
1159 | if (ret != 0) { | 1166 | if (ret != 0) { |
1160 | devwarn(usbdev, "setting infra mode failed (%08X)", ret); | 1167 | netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", |
1168 | ret); | ||
1161 | return ret; | 1169 | return ret; |
1162 | } | 1170 | } |
1163 | 1171 | ||
@@ -1174,7 +1182,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) | |||
1174 | { | 1182 | { |
1175 | __le32 tmp; | 1183 | __le32 tmp; |
1176 | 1184 | ||
1177 | devdbg(usbdev, "set_rts_threshold %i", rts_threshold); | 1185 | netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold); |
1178 | 1186 | ||
1179 | if (rts_threshold < 0 || rts_threshold > 2347) | 1187 | if (rts_threshold < 0 || rts_threshold > 2347) |
1180 | rts_threshold = 2347; | 1188 | rts_threshold = 2347; |
@@ -1188,7 +1196,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) | |||
1188 | { | 1196 | { |
1189 | __le32 tmp; | 1197 | __le32 tmp; |
1190 | 1198 | ||
1191 | devdbg(usbdev, "set_frag_threshold %i", frag_threshold); | 1199 | netdev_dbg(usbdev->net, "%s(): %i\n", __func__, frag_threshold); |
1192 | 1200 | ||
1193 | if (frag_threshold < 256 || frag_threshold > 2346) | 1201 | if (frag_threshold < 256 || frag_threshold > 2346) |
1194 | frag_threshold = 2346; | 1202 | frag_threshold = 2346; |
@@ -1222,7 +1230,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1222 | unsigned int dsconfig; | 1230 | unsigned int dsconfig; |
1223 | int len, ret; | 1231 | int len, ret; |
1224 | 1232 | ||
1225 | devdbg(usbdev, "set_channel(%d)", channel); | 1233 | netdev_dbg(usbdev->net, "%s(%d)\n", __func__, channel); |
1226 | 1234 | ||
1227 | /* this OID is valid only when not associated */ | 1235 | /* this OID is valid only when not associated */ |
1228 | if (is_associated(usbdev)) | 1236 | if (is_associated(usbdev)) |
@@ -1233,7 +1241,8 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1233 | len = sizeof(config); | 1241 | len = sizeof(config); |
1234 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); | 1242 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); |
1235 | if (ret < 0) { | 1243 | if (ret < 0) { |
1236 | devdbg(usbdev, "set_channel: querying configuration failed"); | 1244 | netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", |
1245 | __func__); | ||
1237 | return ret; | 1246 | return ret; |
1238 | } | 1247 | } |
1239 | 1248 | ||
@@ -1241,7 +1250,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1241 | ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, | 1250 | ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, |
1242 | sizeof(config)); | 1251 | sizeof(config)); |
1243 | 1252 | ||
1244 | devdbg(usbdev, "set_channel: %d -> %d", channel, ret); | 1253 | netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); |
1245 | 1254 | ||
1246 | return ret; | 1255 | return ret; |
1247 | } | 1256 | } |
@@ -1255,7 +1264,8 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1255 | u32 cipher; | 1264 | u32 cipher; |
1256 | int ret; | 1265 | int ret; |
1257 | 1266 | ||
1258 | devdbg(usbdev, "add_wep_key(idx: %d, len: %d)", index, key_len); | 1267 | netdev_dbg(usbdev->net, "%s(idx: %d, len: %d)\n", |
1268 | __func__, index, key_len); | ||
1259 | 1269 | ||
1260 | if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) | 1270 | if ((key_len != 5 && key_len != 13) || index < 0 || index > 3) |
1261 | return -EINVAL; | 1271 | return -EINVAL; |
@@ -1277,15 +1287,15 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1277 | ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, | 1287 | ret = set_encr_mode(usbdev, RNDIS_WLAN_ALG_WEP, |
1278 | RNDIS_WLAN_ALG_NONE); | 1288 | RNDIS_WLAN_ALG_NONE); |
1279 | if (ret) | 1289 | if (ret) |
1280 | devwarn(usbdev, "encryption couldn't be enabled (%08X)", | 1290 | netdev_warn(usbdev->net, "encryption couldn't be enabled (%08X)\n", |
1281 | ret); | 1291 | ret); |
1282 | } | 1292 | } |
1283 | 1293 | ||
1284 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, | 1294 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, |
1285 | sizeof(ndis_key)); | 1295 | sizeof(ndis_key)); |
1286 | if (ret != 0) { | 1296 | if (ret != 0) { |
1287 | devwarn(usbdev, "adding encryption key %d failed (%08X)", | 1297 | netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", |
1288 | index+1, ret); | 1298 | index + 1, ret); |
1289 | return ret; | 1299 | return ret; |
1290 | } | 1300 | } |
1291 | 1301 | ||
@@ -1307,22 +1317,23 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1307 | int ret; | 1317 | int ret; |
1308 | 1318 | ||
1309 | if (index < 0 || index >= 4) { | 1319 | if (index < 0 || index >= 4) { |
1310 | devdbg(usbdev, "add_wpa_key: index out of range (%i)", index); | 1320 | netdev_dbg(usbdev->net, "%s(): index out of range (%i)\n", |
1321 | __func__, index); | ||
1311 | return -EINVAL; | 1322 | return -EINVAL; |
1312 | } | 1323 | } |
1313 | if (key_len > sizeof(ndis_key.material) || key_len < 0) { | 1324 | if (key_len > sizeof(ndis_key.material) || key_len < 0) { |
1314 | devdbg(usbdev, "add_wpa_key: key length out of range (%i)", | 1325 | netdev_dbg(usbdev->net, "%s(): key length out of range (%i)\n", |
1315 | key_len); | 1326 | __func__, key_len); |
1316 | return -EINVAL; | 1327 | return -EINVAL; |
1317 | } | 1328 | } |
1318 | if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) { | 1329 | if (flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ) { |
1319 | if (!rx_seq || seq_len <= 0) { | 1330 | if (!rx_seq || seq_len <= 0) { |
1320 | devdbg(usbdev, "add_wpa_key: recv seq flag without" | 1331 | netdev_dbg(usbdev->net, "%s(): recv seq flag without buffer\n", |
1321 | "buffer"); | 1332 | __func__); |
1322 | return -EINVAL; | 1333 | return -EINVAL; |
1323 | } | 1334 | } |
1324 | if (rx_seq && seq_len > sizeof(ndis_key.rsc)) { | 1335 | if (rx_seq && seq_len > sizeof(ndis_key.rsc)) { |
1325 | devdbg(usbdev, "add_wpa_key: too big recv seq buffer"); | 1336 | netdev_dbg(usbdev->net, "%s(): too big recv seq buffer\n", __func__); |
1326 | return -EINVAL; | 1337 | return -EINVAL; |
1327 | } | 1338 | } |
1328 | } | 1339 | } |
@@ -1330,15 +1341,16 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1330 | is_addr_ok = addr && !is_zero_ether_addr(addr) && | 1341 | is_addr_ok = addr && !is_zero_ether_addr(addr) && |
1331 | !is_broadcast_ether_addr(addr); | 1342 | !is_broadcast_ether_addr(addr); |
1332 | if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) { | 1343 | if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) { |
1333 | devdbg(usbdev, "add_wpa_key: pairwise but bssid invalid (%pM)", | 1344 | netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n", |
1334 | addr); | 1345 | __func__, addr); |
1335 | return -EINVAL; | 1346 | return -EINVAL; |
1336 | } | 1347 | } |
1337 | 1348 | ||
1338 | devdbg(usbdev, "add_wpa_key(%i): flags:%i%i%i", index, | 1349 | netdev_dbg(usbdev->net, "%s(%i): flags:%i%i%i\n", |
1339 | !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY), | 1350 | __func__, index, |
1340 | !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY), | 1351 | !!(flags & NDIS_80211_ADDKEY_TRANSMIT_KEY), |
1341 | !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)); | 1352 | !!(flags & NDIS_80211_ADDKEY_PAIRWISE_KEY), |
1353 | !!(flags & NDIS_80211_ADDKEY_SET_INIT_RECV_SEQ)); | ||
1342 | 1354 | ||
1343 | memset(&ndis_key, 0, sizeof(ndis_key)); | 1355 | memset(&ndis_key, 0, sizeof(ndis_key)); |
1344 | 1356 | ||
@@ -1372,7 +1384,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1372 | 1384 | ||
1373 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, | 1385 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, |
1374 | le32_to_cpu(ndis_key.size)); | 1386 | le32_to_cpu(ndis_key.size)); |
1375 | devdbg(usbdev, "add_wpa_key: OID_802_11_ADD_KEY -> %08X", ret); | 1387 | netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n", |
1388 | __func__, ret); | ||
1376 | if (ret != 0) | 1389 | if (ret != 0) |
1377 | return ret; | 1390 | return ret; |
1378 | 1391 | ||
@@ -1401,7 +1414,7 @@ static int restore_key(struct usbnet *usbdev, int key_idx) | |||
1401 | 1414 | ||
1402 | key = priv->encr_keys[key_idx]; | 1415 | key = priv->encr_keys[key_idx]; |
1403 | 1416 | ||
1404 | devdbg(usbdev, "restore_key: %i:%i", key_idx, key.len); | 1417 | netdev_dbg(usbdev->net, "%s(): %i:%i\n", __func__, key_idx, key.len); |
1405 | 1418 | ||
1406 | if (key.len == 0) | 1419 | if (key.len == 0) |
1407 | return 0; | 1420 | return 0; |
@@ -1436,8 +1449,9 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) | |||
1436 | 1449 | ||
1437 | is_wpa = is_wpa_key(priv, index); | 1450 | is_wpa = is_wpa_key(priv, index); |
1438 | 1451 | ||
1439 | devdbg(usbdev, "remove_key: %i:%s:%i", index, is_wpa ? "wpa" : "wep", | 1452 | netdev_dbg(usbdev->net, "%s(): %i:%s:%i\n", |
1440 | priv->encr_keys[index].len); | 1453 | __func__, index, is_wpa ? "wpa" : "wep", |
1454 | priv->encr_keys[index].len); | ||
1441 | 1455 | ||
1442 | clear_key(priv, index); | 1456 | clear_key(priv, index); |
1443 | 1457 | ||
@@ -1464,9 +1478,9 @@ static int remove_key(struct usbnet *usbdev, int index, const u8 *bssid) | |||
1464 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, | 1478 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, |
1465 | sizeof(keyindex)); | 1479 | sizeof(keyindex)); |
1466 | if (ret != 0) { | 1480 | if (ret != 0) { |
1467 | devwarn(usbdev, | 1481 | netdev_warn(usbdev->net, |
1468 | "removing encryption key %d failed (%08X)", | 1482 | "removing encryption key %d failed (%08X)\n", |
1469 | index, ret); | 1483 | index, ret); |
1470 | return ret; | 1484 | return ret; |
1471 | } | 1485 | } |
1472 | } | 1486 | } |
@@ -1498,9 +1512,9 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1498 | size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); | 1512 | size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); |
1499 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); | 1513 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); |
1500 | if (!buf) { | 1514 | if (!buf) { |
1501 | devwarn(usbdev, | 1515 | netdev_warn(usbdev->net, |
1502 | "couldn't alloc %d bytes of memory", | 1516 | "couldn't alloc %d bytes of memory\n", |
1503 | size * ETH_ALEN); | 1517 | size * ETH_ALEN); |
1504 | return; | 1518 | return; |
1505 | } | 1519 | } |
1506 | 1520 | ||
@@ -1520,8 +1534,8 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1520 | else | 1534 | else |
1521 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1535 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; |
1522 | 1536 | ||
1523 | devdbg(usbdev, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d", | 1537 | netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", |
1524 | i, priv->multicast_size, ret); | 1538 | i, priv->multicast_size, ret); |
1525 | 1539 | ||
1526 | kfree(buf); | 1540 | kfree(buf); |
1527 | } | 1541 | } |
@@ -1529,12 +1543,12 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1529 | ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, | 1543 | ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, |
1530 | sizeof(filter)); | 1544 | sizeof(filter)); |
1531 | if (ret < 0) { | 1545 | if (ret < 0) { |
1532 | devwarn(usbdev, "couldn't set packet filter: %08x", | 1546 | netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", |
1533 | le32_to_cpu(filter)); | 1547 | le32_to_cpu(filter)); |
1534 | } | 1548 | } |
1535 | 1549 | ||
1536 | devdbg(usbdev, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d", | 1550 | netdev_dbg(usbdev->net, "OID_GEN_CURRENT_PACKET_FILTER(%08x) -> %d\n", |
1537 | le32_to_cpu(filter), ret); | 1551 | le32_to_cpu(filter), ret); |
1538 | } | 1552 | } |
1539 | 1553 | ||
1540 | /* | 1554 | /* |
@@ -1592,7 +1606,8 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, | |||
1592 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 1606 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
1593 | struct usbnet *usbdev = priv->usbdev; | 1607 | struct usbnet *usbdev = priv->usbdev; |
1594 | 1608 | ||
1595 | devdbg(usbdev, "rndis_set_tx_power type:0x%x dbm:%i", type, dbm); | 1609 | netdev_dbg(usbdev->net, "%s(): type:0x%x dbm:%i\n", |
1610 | __func__, type, dbm); | ||
1596 | 1611 | ||
1597 | /* Device doesn't support changing txpower after initialization, only | 1612 | /* Device doesn't support changing txpower after initialization, only |
1598 | * turn off/on radio. Support 'auto' mode and setting same dBm that is | 1613 | * turn off/on radio. Support 'auto' mode and setting same dBm that is |
@@ -1615,7 +1630,7 @@ static int rndis_get_tx_power(struct wiphy *wiphy, int *dbm) | |||
1615 | 1630 | ||
1616 | *dbm = get_bcm4320_power_dbm(priv); | 1631 | *dbm = get_bcm4320_power_dbm(priv); |
1617 | 1632 | ||
1618 | devdbg(usbdev, "rndis_get_tx_power dbm:%i", *dbm); | 1633 | netdev_dbg(usbdev->net, "%s(): dbm:%i\n", __func__, *dbm); |
1619 | 1634 | ||
1620 | return 0; | 1635 | return 0; |
1621 | } | 1636 | } |
@@ -1629,7 +1644,7 @@ static int rndis_scan(struct wiphy *wiphy, struct net_device *dev, | |||
1629 | int ret; | 1644 | int ret; |
1630 | __le32 tmp; | 1645 | __le32 tmp; |
1631 | 1646 | ||
1632 | devdbg(usbdev, "cfg80211.scan"); | 1647 | netdev_dbg(usbdev->net, "cfg80211.scan\n"); |
1633 | 1648 | ||
1634 | /* Get current bssid list from device before new scan, as new scan | 1649 | /* Get current bssid list from device before new scan, as new scan |
1635 | * clears internal bssid list. | 1650 | * clears internal bssid list. |
@@ -1669,8 +1684,8 @@ static struct cfg80211_bss *rndis_bss_info_update(struct usbnet *usbdev, | |||
1669 | int ie_len, bssid_len; | 1684 | int ie_len, bssid_len; |
1670 | u8 *ie; | 1685 | u8 *ie; |
1671 | 1686 | ||
1672 | devdbg(usbdev, " found bssid: '%.32s' [%pM]", bssid->ssid.essid, | 1687 | netdev_dbg(usbdev->net, " found bssid: '%.32s' [%pM]\n", |
1673 | bssid->mac); | 1688 | bssid->ssid.essid, bssid->mac); |
1674 | 1689 | ||
1675 | /* parse bssid structure */ | 1690 | /* parse bssid structure */ |
1676 | bssid_len = le32_to_cpu(bssid->length); | 1691 | bssid_len = le32_to_cpu(bssid->length); |
@@ -1712,7 +1727,7 @@ static int rndis_check_bssid_list(struct usbnet *usbdev) | |||
1712 | int ret = -EINVAL, len, count, bssid_len; | 1727 | int ret = -EINVAL, len, count, bssid_len; |
1713 | bool resized = false; | 1728 | bool resized = false; |
1714 | 1729 | ||
1715 | devdbg(usbdev, "check_bssid_list"); | 1730 | netdev_dbg(usbdev->net, "check_bssid_list\n"); |
1716 | 1731 | ||
1717 | len = CONTROL_BUFFER_SIZE; | 1732 | len = CONTROL_BUFFER_SIZE; |
1718 | resize_buf: | 1733 | resize_buf: |
@@ -1736,8 +1751,8 @@ resize_buf: | |||
1736 | bssid = bssid_list->bssid; | 1751 | bssid = bssid_list->bssid; |
1737 | bssid_len = le32_to_cpu(bssid->length); | 1752 | bssid_len = le32_to_cpu(bssid->length); |
1738 | count = le32_to_cpu(bssid_list->num_items); | 1753 | count = le32_to_cpu(bssid_list->num_items); |
1739 | devdbg(usbdev, "check_bssid_list: %d BSSIDs found (buflen: %d)", count, | 1754 | netdev_dbg(usbdev->net, "check_bssid_list: %d BSSIDs found (buflen: %d)\n", |
1740 | len); | 1755 | count, len); |
1741 | 1756 | ||
1742 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { | 1757 | while (count && ((void *)bssid + bssid_len) <= (buf + len)) { |
1743 | rndis_bss_info_update(usbdev, bssid); | 1758 | rndis_bss_info_update(usbdev, bssid); |
@@ -1759,7 +1774,7 @@ static void rndis_get_scan_results(struct work_struct *work) | |||
1759 | struct usbnet *usbdev = priv->usbdev; | 1774 | struct usbnet *usbdev = priv->usbdev; |
1760 | int ret; | 1775 | int ret; |
1761 | 1776 | ||
1762 | devdbg(usbdev, "get_scan_results"); | 1777 | netdev_dbg(usbdev->net, "get_scan_results\n"); |
1763 | 1778 | ||
1764 | if (!priv->scan_request) | 1779 | if (!priv->scan_request) |
1765 | return; | 1780 | return; |
@@ -1793,7 +1808,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1793 | 1808 | ||
1794 | if (sme->crypto.n_ciphers_pairwise > 0 && | 1809 | if (sme->crypto.n_ciphers_pairwise > 0 && |
1795 | pairwise == RNDIS_WLAN_ALG_NONE) { | 1810 | pairwise == RNDIS_WLAN_ALG_NONE) { |
1796 | deverr(usbdev, "Unsupported pairwise cipher"); | 1811 | netdev_err(usbdev->net, "Unsupported pairwise cipher\n"); |
1797 | return -ENOTSUPP; | 1812 | return -ENOTSUPP; |
1798 | } | 1813 | } |
1799 | 1814 | ||
@@ -1803,28 +1818,30 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1803 | 1818 | ||
1804 | if (sme->crypto.n_akm_suites > 0 && | 1819 | if (sme->crypto.n_akm_suites > 0 && |
1805 | keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) { | 1820 | keymgmt == RNDIS_WLAN_KEY_MGMT_NONE) { |
1806 | deverr(usbdev, "Invalid keymgmt"); | 1821 | netdev_err(usbdev->net, "Invalid keymgmt\n"); |
1807 | return -ENOTSUPP; | 1822 | return -ENOTSUPP; |
1808 | } | 1823 | } |
1809 | 1824 | ||
1810 | devdbg(usbdev, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:" | 1825 | netdev_dbg(usbdev->net, "cfg80211.connect('%.32s':[%pM]:%d:[%d,0x%x:0x%x]:[0x%x:0x%x]:0x%x)\n", |
1811 | "0x%x]:0x%x)", sme->ssid, sme->bssid, chan, | 1826 | sme->ssid, sme->bssid, chan, |
1812 | sme->privacy, sme->crypto.wpa_versions, sme->auth_type, | 1827 | sme->privacy, sme->crypto.wpa_versions, sme->auth_type, |
1813 | groupwise, pairwise, keymgmt); | 1828 | groupwise, pairwise, keymgmt); |
1814 | 1829 | ||
1815 | if (is_associated(usbdev)) | 1830 | if (is_associated(usbdev)) |
1816 | disassociate(usbdev, false); | 1831 | disassociate(usbdev, false); |
1817 | 1832 | ||
1818 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); | 1833 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); |
1819 | if (ret < 0) { | 1834 | if (ret < 0) { |
1820 | devdbg(usbdev, "connect: set_infra_mode failed, %d", ret); | 1835 | netdev_dbg(usbdev->net, "connect: set_infra_mode failed, %d\n", |
1836 | ret); | ||
1821 | goto err_turn_radio_on; | 1837 | goto err_turn_radio_on; |
1822 | } | 1838 | } |
1823 | 1839 | ||
1824 | ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, | 1840 | ret = set_auth_mode(usbdev, sme->crypto.wpa_versions, sme->auth_type, |
1825 | keymgmt); | 1841 | keymgmt); |
1826 | if (ret < 0) { | 1842 | if (ret < 0) { |
1827 | devdbg(usbdev, "connect: set_auth_mode failed, %d", ret); | 1843 | netdev_dbg(usbdev->net, "connect: set_auth_mode failed, %d\n", |
1844 | ret); | ||
1828 | goto err_turn_radio_on; | 1845 | goto err_turn_radio_on; |
1829 | } | 1846 | } |
1830 | 1847 | ||
@@ -1832,14 +1849,16 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1832 | 1849 | ||
1833 | ret = set_encr_mode(usbdev, pairwise, groupwise); | 1850 | ret = set_encr_mode(usbdev, pairwise, groupwise); |
1834 | if (ret < 0) { | 1851 | if (ret < 0) { |
1835 | devdbg(usbdev, "connect: set_encr_mode failed, %d", ret); | 1852 | netdev_dbg(usbdev->net, "connect: set_encr_mode failed, %d\n", |
1853 | ret); | ||
1836 | goto err_turn_radio_on; | 1854 | goto err_turn_radio_on; |
1837 | } | 1855 | } |
1838 | 1856 | ||
1839 | if (channel) { | 1857 | if (channel) { |
1840 | ret = set_channel(usbdev, chan); | 1858 | ret = set_channel(usbdev, chan); |
1841 | if (ret < 0) { | 1859 | if (ret < 0) { |
1842 | devdbg(usbdev, "connect: set_channel failed, %d", ret); | 1860 | netdev_dbg(usbdev->net, "connect: set_channel failed, %d\n", |
1861 | ret); | ||
1843 | goto err_turn_radio_on; | 1862 | goto err_turn_radio_on; |
1844 | } | 1863 | } |
1845 | } | 1864 | } |
@@ -1848,8 +1867,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1848 | priv->encr_tx_key_index = sme->key_idx; | 1867 | priv->encr_tx_key_index = sme->key_idx; |
1849 | ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); | 1868 | ret = add_wep_key(usbdev, sme->key, sme->key_len, sme->key_idx); |
1850 | if (ret < 0) { | 1869 | if (ret < 0) { |
1851 | devdbg(usbdev, "connect: add_wep_key failed, %d " | 1870 | netdev_dbg(usbdev->net, "connect: add_wep_key failed, %d (%d, %d)\n", |
1852 | "(%d, %d)", ret, sme->key_len, sme->key_idx); | 1871 | ret, sme->key_len, sme->key_idx); |
1853 | goto err_turn_radio_on; | 1872 | goto err_turn_radio_on; |
1854 | } | 1873 | } |
1855 | } | 1874 | } |
@@ -1858,7 +1877,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1858 | !is_broadcast_ether_addr(sme->bssid)) { | 1877 | !is_broadcast_ether_addr(sme->bssid)) { |
1859 | ret = set_bssid(usbdev, sme->bssid); | 1878 | ret = set_bssid(usbdev, sme->bssid); |
1860 | if (ret < 0) { | 1879 | if (ret < 0) { |
1861 | devdbg(usbdev, "connect: set_bssid failed, %d", ret); | 1880 | netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n", |
1881 | ret); | ||
1862 | goto err_turn_radio_on; | 1882 | goto err_turn_radio_on; |
1863 | } | 1883 | } |
1864 | } else | 1884 | } else |
@@ -1880,7 +1900,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1880 | 1900 | ||
1881 | ret = set_essid(usbdev, &ssid); | 1901 | ret = set_essid(usbdev, &ssid); |
1882 | if (ret < 0) | 1902 | if (ret < 0) |
1883 | devdbg(usbdev, "connect: set_essid failed, %d", ret); | 1903 | netdev_dbg(usbdev->net, "connect: set_essid failed, %d\n", ret); |
1884 | return ret; | 1904 | return ret; |
1885 | 1905 | ||
1886 | err_turn_radio_on: | 1906 | err_turn_radio_on: |
@@ -1895,7 +1915,7 @@ static int rndis_disconnect(struct wiphy *wiphy, struct net_device *dev, | |||
1895 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 1915 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
1896 | struct usbnet *usbdev = priv->usbdev; | 1916 | struct usbnet *usbdev = priv->usbdev; |
1897 | 1917 | ||
1898 | devdbg(usbdev, "cfg80211.disconnect(%d)", reason_code); | 1918 | netdev_dbg(usbdev->net, "cfg80211.disconnect(%d)\n", reason_code); |
1899 | 1919 | ||
1900 | priv->connected = false; | 1920 | priv->connected = false; |
1901 | memset(priv->bssid, 0, ETH_ALEN); | 1921 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -1929,21 +1949,23 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1929 | alg = RNDIS_WLAN_ALG_NONE; | 1949 | alg = RNDIS_WLAN_ALG_NONE; |
1930 | } | 1950 | } |
1931 | 1951 | ||
1932 | devdbg(usbdev, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)", params->ssid, | 1952 | netdev_dbg(usbdev->net, "cfg80211.join_ibss('%.32s':[%pM]:%d:%d)\n", |
1933 | params->bssid, chan, params->privacy); | 1953 | params->ssid, params->bssid, chan, params->privacy); |
1934 | 1954 | ||
1935 | if (is_associated(usbdev)) | 1955 | if (is_associated(usbdev)) |
1936 | disassociate(usbdev, false); | 1956 | disassociate(usbdev, false); |
1937 | 1957 | ||
1938 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); | 1958 | ret = set_infra_mode(usbdev, NDIS_80211_INFRA_ADHOC); |
1939 | if (ret < 0) { | 1959 | if (ret < 0) { |
1940 | devdbg(usbdev, "join_ibss: set_infra_mode failed, %d", ret); | 1960 | netdev_dbg(usbdev->net, "join_ibss: set_infra_mode failed, %d\n", |
1961 | ret); | ||
1941 | goto err_turn_radio_on; | 1962 | goto err_turn_radio_on; |
1942 | } | 1963 | } |
1943 | 1964 | ||
1944 | ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); | 1965 | ret = set_auth_mode(usbdev, 0, auth_type, RNDIS_WLAN_KEY_MGMT_NONE); |
1945 | if (ret < 0) { | 1966 | if (ret < 0) { |
1946 | devdbg(usbdev, "join_ibss: set_auth_mode failed, %d", ret); | 1967 | netdev_dbg(usbdev->net, "join_ibss: set_auth_mode failed, %d\n", |
1968 | ret); | ||
1947 | goto err_turn_radio_on; | 1969 | goto err_turn_radio_on; |
1948 | } | 1970 | } |
1949 | 1971 | ||
@@ -1951,15 +1973,16 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1951 | 1973 | ||
1952 | ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); | 1974 | ret = set_encr_mode(usbdev, alg, RNDIS_WLAN_ALG_NONE); |
1953 | if (ret < 0) { | 1975 | if (ret < 0) { |
1954 | devdbg(usbdev, "join_ibss: set_encr_mode failed, %d", ret); | 1976 | netdev_dbg(usbdev->net, "join_ibss: set_encr_mode failed, %d\n", |
1977 | ret); | ||
1955 | goto err_turn_radio_on; | 1978 | goto err_turn_radio_on; |
1956 | } | 1979 | } |
1957 | 1980 | ||
1958 | if (channel) { | 1981 | if (channel) { |
1959 | ret = set_channel(usbdev, chan); | 1982 | ret = set_channel(usbdev, chan); |
1960 | if (ret < 0) { | 1983 | if (ret < 0) { |
1961 | devdbg(usbdev, "join_ibss: set_channel failed, %d", | 1984 | netdev_dbg(usbdev->net, "join_ibss: set_channel failed, %d\n", |
1962 | ret); | 1985 | ret); |
1963 | goto err_turn_radio_on; | 1986 | goto err_turn_radio_on; |
1964 | } | 1987 | } |
1965 | } | 1988 | } |
@@ -1968,7 +1991,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1968 | !is_broadcast_ether_addr(params->bssid)) { | 1991 | !is_broadcast_ether_addr(params->bssid)) { |
1969 | ret = set_bssid(usbdev, params->bssid); | 1992 | ret = set_bssid(usbdev, params->bssid); |
1970 | if (ret < 0) { | 1993 | if (ret < 0) { |
1971 | devdbg(usbdev, "join_ibss: set_bssid failed, %d", ret); | 1994 | netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n", |
1995 | ret); | ||
1972 | goto err_turn_radio_on; | 1996 | goto err_turn_radio_on; |
1973 | } | 1997 | } |
1974 | } else | 1998 | } else |
@@ -1988,7 +2012,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, | |||
1988 | 2012 | ||
1989 | ret = set_essid(usbdev, &ssid); | 2013 | ret = set_essid(usbdev, &ssid); |
1990 | if (ret < 0) | 2014 | if (ret < 0) |
1991 | devdbg(usbdev, "join_ibss: set_essid failed, %d", ret); | 2015 | netdev_dbg(usbdev->net, "join_ibss: set_essid failed, %d\n", |
2016 | ret); | ||
1992 | return ret; | 2017 | return ret; |
1993 | 2018 | ||
1994 | err_turn_radio_on: | 2019 | err_turn_radio_on: |
@@ -2002,7 +2027,7 @@ static int rndis_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | |||
2002 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 2027 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
2003 | struct usbnet *usbdev = priv->usbdev; | 2028 | struct usbnet *usbdev = priv->usbdev; |
2004 | 2029 | ||
2005 | devdbg(usbdev, "cfg80211.leave_ibss()"); | 2030 | netdev_dbg(usbdev->net, "cfg80211.leave_ibss()\n"); |
2006 | 2031 | ||
2007 | priv->connected = false; | 2032 | priv->connected = false; |
2008 | memset(priv->bssid, 0, ETH_ALEN); | 2033 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -2028,8 +2053,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2028 | struct usbnet *usbdev = priv->usbdev; | 2053 | struct usbnet *usbdev = priv->usbdev; |
2029 | __le32 flags; | 2054 | __le32 flags; |
2030 | 2055 | ||
2031 | devdbg(usbdev, "rndis_add_key(%i, %pM, %08x)", key_index, mac_addr, | 2056 | netdev_dbg(usbdev->net, "%s(%i, %pM, %08x)\n", |
2032 | params->cipher); | 2057 | __func__, key_index, mac_addr, params->cipher); |
2033 | 2058 | ||
2034 | switch (params->cipher) { | 2059 | switch (params->cipher) { |
2035 | case WLAN_CIPHER_SUITE_WEP40: | 2060 | case WLAN_CIPHER_SUITE_WEP40: |
@@ -2050,8 +2075,8 @@ static int rndis_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2050 | key_index, mac_addr, params->seq, | 2075 | key_index, mac_addr, params->seq, |
2051 | params->seq_len, params->cipher, flags); | 2076 | params->seq_len, params->cipher, flags); |
2052 | default: | 2077 | default: |
2053 | devdbg(usbdev, "rndis_add_key: unsupported cipher %08x", | 2078 | netdev_dbg(usbdev->net, "%s(): unsupported cipher %08x\n", |
2054 | params->cipher); | 2079 | __func__, params->cipher); |
2055 | return -ENOTSUPP; | 2080 | return -ENOTSUPP; |
2056 | } | 2081 | } |
2057 | } | 2082 | } |
@@ -2062,7 +2087,7 @@ static int rndis_del_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2062 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); | 2087 | struct rndis_wlan_private *priv = wiphy_priv(wiphy); |
2063 | struct usbnet *usbdev = priv->usbdev; | 2088 | struct usbnet *usbdev = priv->usbdev; |
2064 | 2089 | ||
2065 | devdbg(usbdev, "rndis_del_key(%i, %pM)", key_index, mac_addr); | 2090 | netdev_dbg(usbdev->net, "%s(%i, %pM)\n", __func__, key_index, mac_addr); |
2066 | 2091 | ||
2067 | return remove_key(usbdev, key_index, mac_addr); | 2092 | return remove_key(usbdev, key_index, mac_addr); |
2068 | } | 2093 | } |
@@ -2074,7 +2099,7 @@ static int rndis_set_default_key(struct wiphy *wiphy, struct net_device *netdev, | |||
2074 | struct usbnet *usbdev = priv->usbdev; | 2099 | struct usbnet *usbdev = priv->usbdev; |
2075 | struct rndis_wlan_encr_key key; | 2100 | struct rndis_wlan_encr_key key; |
2076 | 2101 | ||
2077 | devdbg(usbdev, "rndis_set_default_key(%i)", key_index); | 2102 | netdev_dbg(usbdev->net, "%s(%i)\n", __func__, key_index); |
2078 | 2103 | ||
2079 | priv->encr_tx_key_index = key_index; | 2104 | priv->encr_tx_key_index = key_index; |
2080 | 2105 | ||
@@ -2188,7 +2213,8 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev) | |||
2188 | if (ret < 0) | 2213 | if (ret < 0) |
2189 | memset(bssid, 0, sizeof(bssid)); | 2214 | memset(bssid, 0, sizeof(bssid)); |
2190 | 2215 | ||
2191 | devdbg(usbdev, "link up work: [%pM] %s", bssid, roamed ? "roamed" : ""); | 2216 | netdev_dbg(usbdev->net, "link up work: [%pM]%s\n", |
2217 | bssid, roamed ? " roamed" : ""); | ||
2192 | 2218 | ||
2193 | /* Internal bss list in device always contains at least the currently | 2219 | /* Internal bss list in device always contains at least the currently |
2194 | * connected bss and we can get it to cfg80211 with | 2220 | * connected bss and we can get it to cfg80211 with |
@@ -2270,8 +2296,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, | |||
2270 | /* must have at least one array entry */ | 2296 | /* must have at least one array entry */ |
2271 | if (len < offsetof(struct ndis_80211_status_indication, u) + | 2297 | if (len < offsetof(struct ndis_80211_status_indication, u) + |
2272 | sizeof(struct ndis_80211_auth_request)) { | 2298 | sizeof(struct ndis_80211_auth_request)) { |
2273 | devinfo(usbdev, "authentication indication: " | 2299 | netdev_info(usbdev->net, "authentication indication: too short message (%i)\n", |
2274 | "too short message (%i)", len); | 2300 | len); |
2275 | return; | 2301 | return; |
2276 | } | 2302 | } |
2277 | 2303 | ||
@@ -2298,8 +2324,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev, | |||
2298 | type = "group_error"; | 2324 | type = "group_error"; |
2299 | } | 2325 | } |
2300 | 2326 | ||
2301 | devinfo(usbdev, "authentication indication: %s (0x%08x)", type, | 2327 | netdev_info(usbdev->net, "authentication indication: %s (0x%08x)\n", |
2302 | le32_to_cpu(auth_req->flags)); | 2328 | type, le32_to_cpu(auth_req->flags)); |
2303 | 2329 | ||
2304 | if (pairwise_error) { | 2330 | if (pairwise_error) { |
2305 | key_type = NL80211_KEYTYPE_PAIRWISE; | 2331 | key_type = NL80211_KEYTYPE_PAIRWISE; |
@@ -2335,8 +2361,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2335 | 2361 | ||
2336 | if (len < offsetof(struct ndis_80211_status_indication, u) + | 2362 | if (len < offsetof(struct ndis_80211_status_indication, u) + |
2337 | sizeof(struct ndis_80211_pmkid_cand_list)) { | 2363 | sizeof(struct ndis_80211_pmkid_cand_list)) { |
2338 | devinfo(usbdev, "pmkid candidate list indication: " | 2364 | netdev_info(usbdev->net, "pmkid candidate list indication: too short message (%i)\n", |
2339 | "too short message (%i)", len); | 2365 | len); |
2340 | return; | 2366 | return; |
2341 | } | 2367 | } |
2342 | 2368 | ||
@@ -2346,18 +2372,16 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2346 | offsetof(struct ndis_80211_status_indication, u); | 2372 | offsetof(struct ndis_80211_status_indication, u); |
2347 | 2373 | ||
2348 | if (len < expected_len) { | 2374 | if (len < expected_len) { |
2349 | devinfo(usbdev, "pmkid candidate list indication: " | 2375 | netdev_info(usbdev->net, "pmkid candidate list indication: list larger than buffer (%i < %i)\n", |
2350 | "list larger than buffer (%i < %i)", | 2376 | len, expected_len); |
2351 | len, expected_len); | ||
2352 | return; | 2377 | return; |
2353 | } | 2378 | } |
2354 | 2379 | ||
2355 | cand_list = &indication->u.cand_list; | 2380 | cand_list = &indication->u.cand_list; |
2356 | 2381 | ||
2357 | devinfo(usbdev, "pmkid candidate list indication: " | 2382 | netdev_info(usbdev->net, "pmkid candidate list indication: version %i, candidates %i\n", |
2358 | "version %i, candidates %i", | 2383 | le32_to_cpu(cand_list->version), |
2359 | le32_to_cpu(cand_list->version), | 2384 | le32_to_cpu(cand_list->num_candidates)); |
2360 | le32_to_cpu(cand_list->num_candidates)); | ||
2361 | 2385 | ||
2362 | if (le32_to_cpu(cand_list->version) != 1) | 2386 | if (le32_to_cpu(cand_list->version) != 1) |
2363 | return; | 2387 | return; |
@@ -2366,8 +2390,8 @@ static void rndis_wlan_pmkid_cand_list_indication(struct usbnet *usbdev, | |||
2366 | struct ndis_80211_pmkid_candidate *cand = | 2390 | struct ndis_80211_pmkid_candidate *cand = |
2367 | &cand_list->candidate_list[i]; | 2391 | &cand_list->candidate_list[i]; |
2368 | 2392 | ||
2369 | devdbg(usbdev, "cand[%i]: flags: 0x%08x, bssid: %pM", | 2393 | netdev_dbg(usbdev->net, "cand[%i]: flags: 0x%08x, bssid: %pM\n", |
2370 | i, le32_to_cpu(cand->flags), cand->bssid); | 2394 | i, le32_to_cpu(cand->flags), cand->bssid); |
2371 | 2395 | ||
2372 | #if 0 | 2396 | #if 0 |
2373 | struct iw_pmkid_cand pcand; | 2397 | struct iw_pmkid_cand pcand; |
@@ -2398,15 +2422,14 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2398 | len = le32_to_cpu(msg->length); | 2422 | len = le32_to_cpu(msg->length); |
2399 | 2423 | ||
2400 | if (len < 8) { | 2424 | if (len < 8) { |
2401 | devinfo(usbdev, "media specific indication, " | 2425 | netdev_info(usbdev->net, "media specific indication, ignore too short message (%i < 8)\n", |
2402 | "ignore too short message (%i < 8)", len); | 2426 | len); |
2403 | return; | 2427 | return; |
2404 | } | 2428 | } |
2405 | 2429 | ||
2406 | if (offset + len > buflen) { | 2430 | if (offset + len > buflen) { |
2407 | devinfo(usbdev, "media specific indication, " | 2431 | netdev_info(usbdev->net, "media specific indication, too large to fit to buffer (%i > %i)\n", |
2408 | "too large to fit to buffer (%i > %i)", | 2432 | offset + len, buflen); |
2409 | offset + len, buflen); | ||
2410 | return; | 2433 | return; |
2411 | } | 2434 | } |
2412 | 2435 | ||
@@ -2414,13 +2437,13 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2414 | 2437 | ||
2415 | switch (le32_to_cpu(indication->status_type)) { | 2438 | switch (le32_to_cpu(indication->status_type)) { |
2416 | case NDIS_80211_STATUSTYPE_RADIOSTATE: | 2439 | case NDIS_80211_STATUSTYPE_RADIOSTATE: |
2417 | devinfo(usbdev, "radio state indication: %i", | 2440 | netdev_info(usbdev->net, "radio state indication: %i\n", |
2418 | le32_to_cpu(indication->u.radio_status)); | 2441 | le32_to_cpu(indication->u.radio_status)); |
2419 | return; | 2442 | return; |
2420 | 2443 | ||
2421 | case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE: | 2444 | case NDIS_80211_STATUSTYPE_MEDIASTREAMMODE: |
2422 | devinfo(usbdev, "media stream mode indication: %i", | 2445 | netdev_info(usbdev->net, "media stream mode indication: %i\n", |
2423 | le32_to_cpu(indication->u.media_stream_mode)); | 2446 | le32_to_cpu(indication->u.media_stream_mode)); |
2424 | return; | 2447 | return; |
2425 | 2448 | ||
2426 | case NDIS_80211_STATUSTYPE_AUTHENTICATION: | 2449 | case NDIS_80211_STATUSTYPE_AUTHENTICATION: |
@@ -2432,9 +2455,8 @@ static void rndis_wlan_media_specific_indication(struct usbnet *usbdev, | |||
2432 | return; | 2455 | return; |
2433 | 2456 | ||
2434 | default: | 2457 | default: |
2435 | devinfo(usbdev, "media specific indication: " | 2458 | netdev_info(usbdev->net, "media specific indication: unknown status type 0x%08x\n", |
2436 | "unknown status type 0x%08x", | 2459 | le32_to_cpu(indication->status_type)); |
2437 | le32_to_cpu(indication->status_type)); | ||
2438 | } | 2460 | } |
2439 | } | 2461 | } |
2440 | 2462 | ||
@@ -2451,14 +2473,13 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2451 | * and userspace to think that device is | 2473 | * and userspace to think that device is |
2452 | * roaming/reassociating when it isn't. | 2474 | * roaming/reassociating when it isn't. |
2453 | */ | 2475 | */ |
2454 | devdbg(usbdev, "ignored OID_802_11_ADD_KEY triggered " | 2476 | netdev_dbg(usbdev->net, "ignored OID_802_11_ADD_KEY triggered 'media connect'\n"); |
2455 | "'media connect'"); | ||
2456 | return; | 2477 | return; |
2457 | } | 2478 | } |
2458 | 2479 | ||
2459 | usbnet_pause_rx(usbdev); | 2480 | usbnet_pause_rx(usbdev); |
2460 | 2481 | ||
2461 | devinfo(usbdev, "media connect"); | 2482 | netdev_info(usbdev->net, "media connect\n"); |
2462 | 2483 | ||
2463 | /* queue work to avoid recursive calls into rndis_command */ | 2484 | /* queue work to avoid recursive calls into rndis_command */ |
2464 | set_bit(WORK_LINK_UP, &priv->work_pending); | 2485 | set_bit(WORK_LINK_UP, &priv->work_pending); |
@@ -2466,7 +2487,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2466 | break; | 2487 | break; |
2467 | 2488 | ||
2468 | case RNDIS_STATUS_MEDIA_DISCONNECT: | 2489 | case RNDIS_STATUS_MEDIA_DISCONNECT: |
2469 | devinfo(usbdev, "media disconnect"); | 2490 | netdev_info(usbdev->net, "media disconnect\n"); |
2470 | 2491 | ||
2471 | /* queue work to avoid recursive calls into rndis_command */ | 2492 | /* queue work to avoid recursive calls into rndis_command */ |
2472 | set_bit(WORK_LINK_DOWN, &priv->work_pending); | 2493 | set_bit(WORK_LINK_DOWN, &priv->work_pending); |
@@ -2478,8 +2499,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
2478 | break; | 2499 | break; |
2479 | 2500 | ||
2480 | default: | 2501 | default: |
2481 | devinfo(usbdev, "indication: 0x%08x", | 2502 | netdev_info(usbdev->net, "indication: 0x%08x\n", |
2482 | le32_to_cpu(msg->status)); | 2503 | le32_to_cpu(msg->status)); |
2483 | break; | 2504 | break; |
2484 | } | 2505 | } |
2485 | } | 2506 | } |
@@ -2544,8 +2565,8 @@ static void rndis_device_poller(struct work_struct *work) | |||
2544 | if (ret == 0) | 2565 | if (ret == 0) |
2545 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); | 2566 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); |
2546 | 2567 | ||
2547 | devdbg(usbdev, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d", | 2568 | netdev_dbg(usbdev->net, "dev-poller: OID_802_11_RSSI -> %d, rssi:%d, qual: %d\n", |
2548 | ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi))); | 2569 | ret, le32_to_cpu(rssi), level_to_qual(le32_to_cpu(rssi))); |
2549 | 2570 | ||
2550 | /* Workaround transfer stalls on poor quality links. | 2571 | /* Workaround transfer stalls on poor quality links. |
2551 | * TODO: find right way to fix these stalls (as stalls do not happen | 2572 | * TODO: find right way to fix these stalls (as stalls do not happen |
@@ -2838,11 +2859,11 @@ static int rndis_wlan_reset(struct usbnet *usbdev) | |||
2838 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 2859 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
2839 | int retval; | 2860 | int retval; |
2840 | 2861 | ||
2841 | devdbg(usbdev, "rndis_wlan_reset"); | 2862 | netdev_dbg(usbdev->net, "%s()\n", __func__); |
2842 | 2863 | ||
2843 | retval = rndis_reset(usbdev); | 2864 | retval = rndis_reset(usbdev); |
2844 | if (retval) | 2865 | if (retval) |
2845 | devwarn(usbdev, "rndis_reset() failed: %d", retval); | 2866 | netdev_warn(usbdev->net, "rndis_reset failed: %d\n", retval); |
2846 | 2867 | ||
2847 | /* rndis_reset cleared multicast list, so restore here. | 2868 | /* rndis_reset cleared multicast list, so restore here. |
2848 | (set_multicast_list() also turns on current packet filter) */ | 2869 | (set_multicast_list() also turns on current packet filter) */ |
@@ -2860,7 +2881,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev) | |||
2860 | int retval; | 2881 | int retval; |
2861 | __le32 filter; | 2882 | __le32 filter; |
2862 | 2883 | ||
2863 | devdbg(usbdev, "rndis_wlan_stop"); | 2884 | netdev_dbg(usbdev->net, "%s()\n", __func__); |
2864 | 2885 | ||
2865 | retval = disassociate(usbdev, false); | 2886 | retval = disassociate(usbdev, false); |
2866 | 2887 | ||