aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorZhao, Gang <gamerh2o@gmail.com>2014-04-21 00:53:02 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-04-25 11:32:56 -0400
commit1b8ec87aa077c527c9e3525e16098ca7efbc853d (patch)
tree5bc41e5194c59c88d3b27b637410c27c4a2a207e /net/wireless/nl80211.c
parent308f7fcfdba47f24cd70cba978fd10fb4584e61c (diff)
cfg80211: change registered device pointer name
Name "dev" is too common and ambiguous, let all the pointer name pointing to struct cfg80211_registered_device be "rdev". This can improve code readability and consistency(since other places have already called it rdev). Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c258
1 files changed, 129 insertions, 129 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 232d15c0ac6e..9edbb5f7b1bb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1013,42 +1013,42 @@ static int nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev,
1013} 1013}
1014 1014
1015static int nl80211_send_wowlan(struct sk_buff *msg, 1015static int nl80211_send_wowlan(struct sk_buff *msg,
1016 struct cfg80211_registered_device *dev, 1016 struct cfg80211_registered_device *rdev,
1017 bool large) 1017 bool large)
1018{ 1018{
1019 struct nlattr *nl_wowlan; 1019 struct nlattr *nl_wowlan;
1020 1020
1021 if (!dev->wiphy.wowlan) 1021 if (!rdev->wiphy.wowlan)
1022 return 0; 1022 return 0;
1023 1023
1024 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED); 1024 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED);
1025 if (!nl_wowlan) 1025 if (!nl_wowlan)
1026 return -ENOBUFS; 1026 return -ENOBUFS;
1027 1027
1028 if (((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_ANY) && 1028 if (((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_ANY) &&
1029 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) || 1029 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) ||
1030 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_DISCONNECT) && 1030 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_DISCONNECT) &&
1031 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) || 1031 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) ||
1032 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_MAGIC_PKT) && 1032 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_MAGIC_PKT) &&
1033 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) || 1033 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) ||
1034 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY) && 1034 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY) &&
1035 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED)) || 1035 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED)) ||
1036 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && 1036 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
1037 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) || 1037 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) ||
1038 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ) && 1038 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ) &&
1039 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) || 1039 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) ||
1040 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE) && 1040 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE) &&
1041 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) || 1041 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) ||
1042 ((dev->wiphy.wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE) && 1042 ((rdev->wiphy.wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE) &&
1043 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE))) 1043 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE)))
1044 return -ENOBUFS; 1044 return -ENOBUFS;
1045 1045
1046 if (dev->wiphy.wowlan->n_patterns) { 1046 if (rdev->wiphy.wowlan->n_patterns) {
1047 struct nl80211_pattern_support pat = { 1047 struct nl80211_pattern_support pat = {
1048 .max_patterns = dev->wiphy.wowlan->n_patterns, 1048 .max_patterns = rdev->wiphy.wowlan->n_patterns,
1049 .min_pattern_len = dev->wiphy.wowlan->pattern_min_len, 1049 .min_pattern_len = rdev->wiphy.wowlan->pattern_min_len,
1050 .max_pattern_len = dev->wiphy.wowlan->pattern_max_len, 1050 .max_pattern_len = rdev->wiphy.wowlan->pattern_max_len,
1051 .max_pkt_offset = dev->wiphy.wowlan->max_pkt_offset, 1051 .max_pkt_offset = rdev->wiphy.wowlan->max_pkt_offset,
1052 }; 1052 };
1053 1053
1054 if (nla_put(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN, 1054 if (nla_put(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN,
@@ -1056,7 +1056,7 @@ static int nl80211_send_wowlan(struct sk_buff *msg,
1056 return -ENOBUFS; 1056 return -ENOBUFS;
1057 } 1057 }
1058 1058
1059 if (large && nl80211_send_wowlan_tcp_caps(dev, msg)) 1059 if (large && nl80211_send_wowlan_tcp_caps(rdev, msg))
1060 return -ENOBUFS; 1060 return -ENOBUFS;
1061 1061
1062 nla_nest_end(msg, nl_wowlan); 1062 nla_nest_end(msg, nl_wowlan);
@@ -1066,19 +1066,19 @@ static int nl80211_send_wowlan(struct sk_buff *msg,
1066#endif 1066#endif
1067 1067
1068static int nl80211_send_coalesce(struct sk_buff *msg, 1068static int nl80211_send_coalesce(struct sk_buff *msg,
1069 struct cfg80211_registered_device *dev) 1069 struct cfg80211_registered_device *rdev)
1070{ 1070{
1071 struct nl80211_coalesce_rule_support rule; 1071 struct nl80211_coalesce_rule_support rule;
1072 1072
1073 if (!dev->wiphy.coalesce) 1073 if (!rdev->wiphy.coalesce)
1074 return 0; 1074 return 0;
1075 1075
1076 rule.max_rules = dev->wiphy.coalesce->n_rules; 1076 rule.max_rules = rdev->wiphy.coalesce->n_rules;
1077 rule.max_delay = dev->wiphy.coalesce->max_delay; 1077 rule.max_delay = rdev->wiphy.coalesce->max_delay;
1078 rule.pat.max_patterns = dev->wiphy.coalesce->n_patterns; 1078 rule.pat.max_patterns = rdev->wiphy.coalesce->n_patterns;
1079 rule.pat.min_pattern_len = dev->wiphy.coalesce->pattern_min_len; 1079 rule.pat.min_pattern_len = rdev->wiphy.coalesce->pattern_min_len;
1080 rule.pat.max_pattern_len = dev->wiphy.coalesce->pattern_max_len; 1080 rule.pat.max_pattern_len = rdev->wiphy.coalesce->pattern_max_len;
1081 rule.pat.max_pkt_offset = dev->wiphy.coalesce->max_pkt_offset; 1081 rule.pat.max_pkt_offset = rdev->wiphy.coalesce->max_pkt_offset;
1082 1082
1083 if (nla_put(msg, NL80211_ATTR_COALESCE_RULE, sizeof(rule), &rule)) 1083 if (nla_put(msg, NL80211_ATTR_COALESCE_RULE, sizeof(rule), &rule))
1084 return -ENOBUFS; 1084 return -ENOBUFS;
@@ -1209,7 +1209,7 @@ struct nl80211_dump_wiphy_state {
1209 bool split; 1209 bool split;
1210}; 1210};
1211 1211
1212static int nl80211_send_wiphy(struct cfg80211_registered_device *dev, 1212static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
1213 struct sk_buff *msg, u32 portid, u32 seq, 1213 struct sk_buff *msg, u32 portid, u32 seq,
1214 int flags, struct nl80211_dump_wiphy_state *state) 1214 int flags, struct nl80211_dump_wiphy_state *state)
1215{ 1215{
@@ -1221,7 +1221,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1221 struct ieee80211_channel *chan; 1221 struct ieee80211_channel *chan;
1222 int i; 1222 int i;
1223 const struct ieee80211_txrx_stypes *mgmt_stypes = 1223 const struct ieee80211_txrx_stypes *mgmt_stypes =
1224 dev->wiphy.mgmt_stypes; 1224 rdev->wiphy.mgmt_stypes;
1225 u32 features; 1225 u32 features;
1226 1226
1227 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_WIPHY); 1227 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_WIPHY);
@@ -1231,9 +1231,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1231 if (WARN_ON(!state)) 1231 if (WARN_ON(!state))
1232 return -EINVAL; 1232 return -EINVAL;
1233 1233
1234 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, dev->wiphy_idx) || 1234 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
1235 nla_put_string(msg, NL80211_ATTR_WIPHY_NAME, 1235 nla_put_string(msg, NL80211_ATTR_WIPHY_NAME,
1236 wiphy_name(&dev->wiphy)) || 1236 wiphy_name(&rdev->wiphy)) ||
1237 nla_put_u32(msg, NL80211_ATTR_GENERATION, 1237 nla_put_u32(msg, NL80211_ATTR_GENERATION,
1238 cfg80211_rdev_list_generation)) 1238 cfg80211_rdev_list_generation))
1239 goto nla_put_failure; 1239 goto nla_put_failure;
@@ -1241,43 +1241,43 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1241 switch (state->split_start) { 1241 switch (state->split_start) {
1242 case 0: 1242 case 0:
1243 if (nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_SHORT, 1243 if (nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_SHORT,
1244 dev->wiphy.retry_short) || 1244 rdev->wiphy.retry_short) ||
1245 nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_LONG, 1245 nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_LONG,
1246 dev->wiphy.retry_long) || 1246 rdev->wiphy.retry_long) ||
1247 nla_put_u32(msg, NL80211_ATTR_WIPHY_FRAG_THRESHOLD, 1247 nla_put_u32(msg, NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
1248 dev->wiphy.frag_threshold) || 1248 rdev->wiphy.frag_threshold) ||
1249 nla_put_u32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, 1249 nla_put_u32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD,
1250 dev->wiphy.rts_threshold) || 1250 rdev->wiphy.rts_threshold) ||
1251 nla_put_u8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, 1251 nla_put_u8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS,
1252 dev->wiphy.coverage_class) || 1252 rdev->wiphy.coverage_class) ||
1253 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, 1253 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
1254 dev->wiphy.max_scan_ssids) || 1254 rdev->wiphy.max_scan_ssids) ||
1255 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, 1255 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
1256 dev->wiphy.max_sched_scan_ssids) || 1256 rdev->wiphy.max_sched_scan_ssids) ||
1257 nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, 1257 nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN,
1258 dev->wiphy.max_scan_ie_len) || 1258 rdev->wiphy.max_scan_ie_len) ||
1259 nla_put_u16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, 1259 nla_put_u16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
1260 dev->wiphy.max_sched_scan_ie_len) || 1260 rdev->wiphy.max_sched_scan_ie_len) ||
1261 nla_put_u8(msg, NL80211_ATTR_MAX_MATCH_SETS, 1261 nla_put_u8(msg, NL80211_ATTR_MAX_MATCH_SETS,
1262 dev->wiphy.max_match_sets)) 1262 rdev->wiphy.max_match_sets))
1263 goto nla_put_failure; 1263 goto nla_put_failure;
1264 1264
1265 if ((dev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) && 1265 if ((rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) &&
1266 nla_put_flag(msg, NL80211_ATTR_SUPPORT_IBSS_RSN)) 1266 nla_put_flag(msg, NL80211_ATTR_SUPPORT_IBSS_RSN))
1267 goto nla_put_failure; 1267 goto nla_put_failure;
1268 if ((dev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) && 1268 if ((rdev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) &&
1269 nla_put_flag(msg, NL80211_ATTR_SUPPORT_MESH_AUTH)) 1269 nla_put_flag(msg, NL80211_ATTR_SUPPORT_MESH_AUTH))
1270 goto nla_put_failure; 1270 goto nla_put_failure;
1271 if ((dev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) && 1271 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
1272 nla_put_flag(msg, NL80211_ATTR_SUPPORT_AP_UAPSD)) 1272 nla_put_flag(msg, NL80211_ATTR_SUPPORT_AP_UAPSD))
1273 goto nla_put_failure; 1273 goto nla_put_failure;
1274 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) && 1274 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
1275 nla_put_flag(msg, NL80211_ATTR_ROAM_SUPPORT)) 1275 nla_put_flag(msg, NL80211_ATTR_ROAM_SUPPORT))
1276 goto nla_put_failure; 1276 goto nla_put_failure;
1277 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) && 1277 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
1278 nla_put_flag(msg, NL80211_ATTR_TDLS_SUPPORT)) 1278 nla_put_flag(msg, NL80211_ATTR_TDLS_SUPPORT))
1279 goto nla_put_failure; 1279 goto nla_put_failure;
1280 if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) && 1280 if ((rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
1281 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP)) 1281 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
1282 goto nla_put_failure; 1282 goto nla_put_failure;
1283 state->split_start++; 1283 state->split_start++;
@@ -1285,35 +1285,35 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1285 break; 1285 break;
1286 case 1: 1286 case 1:
1287 if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES, 1287 if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES,
1288 sizeof(u32) * dev->wiphy.n_cipher_suites, 1288 sizeof(u32) * rdev->wiphy.n_cipher_suites,
1289 dev->wiphy.cipher_suites)) 1289 rdev->wiphy.cipher_suites))
1290 goto nla_put_failure; 1290 goto nla_put_failure;
1291 1291
1292 if (nla_put_u8(msg, NL80211_ATTR_MAX_NUM_PMKIDS, 1292 if (nla_put_u8(msg, NL80211_ATTR_MAX_NUM_PMKIDS,
1293 dev->wiphy.max_num_pmkids)) 1293 rdev->wiphy.max_num_pmkids))
1294 goto nla_put_failure; 1294 goto nla_put_failure;
1295 1295
1296 if ((dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) && 1296 if ((rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) &&
1297 nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE)) 1297 nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE))
1298 goto nla_put_failure; 1298 goto nla_put_failure;
1299 1299
1300 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, 1300 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
1301 dev->wiphy.available_antennas_tx) || 1301 rdev->wiphy.available_antennas_tx) ||
1302 nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, 1302 nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
1303 dev->wiphy.available_antennas_rx)) 1303 rdev->wiphy.available_antennas_rx))
1304 goto nla_put_failure; 1304 goto nla_put_failure;
1305 1305
1306 if ((dev->wiphy.flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) && 1306 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) &&
1307 nla_put_u32(msg, NL80211_ATTR_PROBE_RESP_OFFLOAD, 1307 nla_put_u32(msg, NL80211_ATTR_PROBE_RESP_OFFLOAD,
1308 dev->wiphy.probe_resp_offload)) 1308 rdev->wiphy.probe_resp_offload))
1309 goto nla_put_failure; 1309 goto nla_put_failure;
1310 1310
1311 if ((dev->wiphy.available_antennas_tx || 1311 if ((rdev->wiphy.available_antennas_tx ||
1312 dev->wiphy.available_antennas_rx) && 1312 rdev->wiphy.available_antennas_rx) &&
1313 dev->ops->get_antenna) { 1313 rdev->ops->get_antenna) {
1314 u32 tx_ant = 0, rx_ant = 0; 1314 u32 tx_ant = 0, rx_ant = 0;
1315 int res; 1315 int res;
1316 res = rdev_get_antenna(dev, &tx_ant, &rx_ant); 1316 res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
1317 if (!res) { 1317 if (!res) {
1318 if (nla_put_u32(msg, 1318 if (nla_put_u32(msg,
1319 NL80211_ATTR_WIPHY_ANTENNA_TX, 1319 NL80211_ATTR_WIPHY_ANTENNA_TX,
@@ -1330,7 +1330,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1330 break; 1330 break;
1331 case 2: 1331 case 2:
1332 if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES, 1332 if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES,
1333 dev->wiphy.interface_modes)) 1333 rdev->wiphy.interface_modes))
1334 goto nla_put_failure; 1334 goto nla_put_failure;
1335 state->split_start++; 1335 state->split_start++;
1336 if (state->split) 1336 if (state->split)
@@ -1344,7 +1344,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1344 band < IEEE80211_NUM_BANDS; band++) { 1344 band < IEEE80211_NUM_BANDS; band++) {
1345 struct ieee80211_supported_band *sband; 1345 struct ieee80211_supported_band *sband;
1346 1346
1347 sband = dev->wiphy.bands[band]; 1347 sband = rdev->wiphy.bands[band];
1348 1348
1349 if (!sband) 1349 if (!sband)
1350 continue; 1350 continue;
@@ -1421,7 +1421,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1421 i = 0; 1421 i = 0;
1422#define CMD(op, n) \ 1422#define CMD(op, n) \
1423 do { \ 1423 do { \
1424 if (dev->ops->op) { \ 1424 if (rdev->ops->op) { \
1425 i++; \ 1425 i++; \
1426 if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \ 1426 if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \
1427 goto nla_put_failure; \ 1427 goto nla_put_failure; \
@@ -1445,32 +1445,32 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1445 CMD(set_pmksa, SET_PMKSA); 1445 CMD(set_pmksa, SET_PMKSA);
1446 CMD(del_pmksa, DEL_PMKSA); 1446 CMD(del_pmksa, DEL_PMKSA);
1447 CMD(flush_pmksa, FLUSH_PMKSA); 1447 CMD(flush_pmksa, FLUSH_PMKSA);
1448 if (dev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) 1448 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL)
1449 CMD(remain_on_channel, REMAIN_ON_CHANNEL); 1449 CMD(remain_on_channel, REMAIN_ON_CHANNEL);
1450 CMD(set_bitrate_mask, SET_TX_BITRATE_MASK); 1450 CMD(set_bitrate_mask, SET_TX_BITRATE_MASK);
1451 CMD(mgmt_tx, FRAME); 1451 CMD(mgmt_tx, FRAME);
1452 CMD(mgmt_tx_cancel_wait, FRAME_WAIT_CANCEL); 1452 CMD(mgmt_tx_cancel_wait, FRAME_WAIT_CANCEL);
1453 if (dev->wiphy.flags & WIPHY_FLAG_NETNS_OK) { 1453 if (rdev->wiphy.flags & WIPHY_FLAG_NETNS_OK) {
1454 i++; 1454 i++;
1455 if (nla_put_u32(msg, i, NL80211_CMD_SET_WIPHY_NETNS)) 1455 if (nla_put_u32(msg, i, NL80211_CMD_SET_WIPHY_NETNS))
1456 goto nla_put_failure; 1456 goto nla_put_failure;
1457 } 1457 }
1458 if (dev->ops->set_monitor_channel || dev->ops->start_ap || 1458 if (rdev->ops->set_monitor_channel || rdev->ops->start_ap ||
1459 dev->ops->join_mesh) { 1459 rdev->ops->join_mesh) {
1460 i++; 1460 i++;
1461 if (nla_put_u32(msg, i, NL80211_CMD_SET_CHANNEL)) 1461 if (nla_put_u32(msg, i, NL80211_CMD_SET_CHANNEL))
1462 goto nla_put_failure; 1462 goto nla_put_failure;
1463 } 1463 }
1464 CMD(set_wds_peer, SET_WDS_PEER); 1464 CMD(set_wds_peer, SET_WDS_PEER);
1465 if (dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) { 1465 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS) {
1466 CMD(tdls_mgmt, TDLS_MGMT); 1466 CMD(tdls_mgmt, TDLS_MGMT);
1467 CMD(tdls_oper, TDLS_OPER); 1467 CMD(tdls_oper, TDLS_OPER);
1468 } 1468 }
1469 if (dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) 1469 if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN)
1470 CMD(sched_scan_start, START_SCHED_SCAN); 1470 CMD(sched_scan_start, START_SCHED_SCAN);
1471 CMD(probe_client, PROBE_CLIENT); 1471 CMD(probe_client, PROBE_CLIENT);
1472 CMD(set_noack_map, SET_NOACK_MAP); 1472 CMD(set_noack_map, SET_NOACK_MAP);
1473 if (dev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS) { 1473 if (rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS) {
1474 i++; 1474 i++;
1475 if (nla_put_u32(msg, i, NL80211_CMD_REGISTER_BEACONS)) 1475 if (nla_put_u32(msg, i, NL80211_CMD_REGISTER_BEACONS))
1476 goto nla_put_failure; 1476 goto nla_put_failure;
@@ -1480,7 +1480,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1480 if (state->split) { 1480 if (state->split) {
1481 CMD(crit_proto_start, CRIT_PROTOCOL_START); 1481 CMD(crit_proto_start, CRIT_PROTOCOL_START);
1482 CMD(crit_proto_stop, CRIT_PROTOCOL_STOP); 1482 CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
1483 if (dev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH) 1483 if (rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)
1484 CMD(channel_switch, CHANNEL_SWITCH); 1484 CMD(channel_switch, CHANNEL_SWITCH);
1485 } 1485 }
1486 CMD(set_qos_map, SET_QOS_MAP); 1486 CMD(set_qos_map, SET_QOS_MAP);
@@ -1491,13 +1491,13 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1491 1491
1492#undef CMD 1492#undef CMD
1493 1493
1494 if (dev->ops->connect || dev->ops->auth) { 1494 if (rdev->ops->connect || rdev->ops->auth) {
1495 i++; 1495 i++;
1496 if (nla_put_u32(msg, i, NL80211_CMD_CONNECT)) 1496 if (nla_put_u32(msg, i, NL80211_CMD_CONNECT))
1497 goto nla_put_failure; 1497 goto nla_put_failure;
1498 } 1498 }
1499 1499
1500 if (dev->ops->disconnect || dev->ops->deauth) { 1500 if (rdev->ops->disconnect || rdev->ops->deauth) {
1501 i++; 1501 i++;
1502 if (nla_put_u32(msg, i, NL80211_CMD_DISCONNECT)) 1502 if (nla_put_u32(msg, i, NL80211_CMD_DISCONNECT))
1503 goto nla_put_failure; 1503 goto nla_put_failure;
@@ -1508,14 +1508,14 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1508 if (state->split) 1508 if (state->split)
1509 break; 1509 break;
1510 case 5: 1510 case 5:
1511 if (dev->ops->remain_on_channel && 1511 if (rdev->ops->remain_on_channel &&
1512 (dev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) && 1512 (rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL) &&
1513 nla_put_u32(msg, 1513 nla_put_u32(msg,
1514 NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, 1514 NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
1515 dev->wiphy.max_remain_on_channel_duration)) 1515 rdev->wiphy.max_remain_on_channel_duration))
1516 goto nla_put_failure; 1516 goto nla_put_failure;
1517 1517
1518 if ((dev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX) && 1518 if ((rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_TX) &&
1519 nla_put_flag(msg, NL80211_ATTR_OFFCHANNEL_TX_OK)) 1519 nla_put_flag(msg, NL80211_ATTR_OFFCHANNEL_TX_OK))
1520 goto nla_put_failure; 1520 goto nla_put_failure;
1521 1521
@@ -1526,7 +1526,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1526 break; 1526 break;
1527 case 6: 1527 case 6:
1528#ifdef CONFIG_PM 1528#ifdef CONFIG_PM
1529 if (nl80211_send_wowlan(msg, dev, state->split)) 1529 if (nl80211_send_wowlan(msg, rdev, state->split))
1530 goto nla_put_failure; 1530 goto nla_put_failure;
1531 state->split_start++; 1531 state->split_start++;
1532 if (state->split) 1532 if (state->split)
@@ -1536,10 +1536,10 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1536#endif 1536#endif
1537 case 7: 1537 case 7:
1538 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES, 1538 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES,
1539 dev->wiphy.software_iftypes)) 1539 rdev->wiphy.software_iftypes))
1540 goto nla_put_failure; 1540 goto nla_put_failure;
1541 1541
1542 if (nl80211_put_iface_combinations(&dev->wiphy, msg, 1542 if (nl80211_put_iface_combinations(&rdev->wiphy, msg,
1543 state->split)) 1543 state->split))
1544 goto nla_put_failure; 1544 goto nla_put_failure;
1545 1545
@@ -1547,12 +1547,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1547 if (state->split) 1547 if (state->split)
1548 break; 1548 break;
1549 case 8: 1549 case 8:
1550 if ((dev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) && 1550 if ((rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME) &&
1551 nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME, 1551 nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME,
1552 dev->wiphy.ap_sme_capa)) 1552 rdev->wiphy.ap_sme_capa))
1553 goto nla_put_failure; 1553 goto nla_put_failure;
1554 1554
1555 features = dev->wiphy.features; 1555 features = rdev->wiphy.features;
1556 /* 1556 /*
1557 * We can only add the per-channel limit information if the 1557 * We can only add the per-channel limit information if the
1558 * dump is split, otherwise it makes it too big. Therefore 1558 * dump is split, otherwise it makes it too big. Therefore
@@ -1563,16 +1563,16 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1563 if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features)) 1563 if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features))
1564 goto nla_put_failure; 1564 goto nla_put_failure;
1565 1565
1566 if (dev->wiphy.ht_capa_mod_mask && 1566 if (rdev->wiphy.ht_capa_mod_mask &&
1567 nla_put(msg, NL80211_ATTR_HT_CAPABILITY_MASK, 1567 nla_put(msg, NL80211_ATTR_HT_CAPABILITY_MASK,
1568 sizeof(*dev->wiphy.ht_capa_mod_mask), 1568 sizeof(*rdev->wiphy.ht_capa_mod_mask),
1569 dev->wiphy.ht_capa_mod_mask)) 1569 rdev->wiphy.ht_capa_mod_mask))
1570 goto nla_put_failure; 1570 goto nla_put_failure;
1571 1571
1572 if (dev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME && 1572 if (rdev->wiphy.flags & WIPHY_FLAG_HAVE_AP_SME &&
1573 dev->wiphy.max_acl_mac_addrs && 1573 rdev->wiphy.max_acl_mac_addrs &&
1574 nla_put_u32(msg, NL80211_ATTR_MAC_ACL_MAX, 1574 nla_put_u32(msg, NL80211_ATTR_MAC_ACL_MAX,
1575 dev->wiphy.max_acl_mac_addrs)) 1575 rdev->wiphy.max_acl_mac_addrs))
1576 goto nla_put_failure; 1576 goto nla_put_failure;
1577 1577
1578 /* 1578 /*
@@ -1588,41 +1588,41 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1588 state->split_start++; 1588 state->split_start++;
1589 break; 1589 break;
1590 case 9: 1590 case 9:
1591 if (dev->wiphy.extended_capabilities && 1591 if (rdev->wiphy.extended_capabilities &&
1592 (nla_put(msg, NL80211_ATTR_EXT_CAPA, 1592 (nla_put(msg, NL80211_ATTR_EXT_CAPA,
1593 dev->wiphy.extended_capabilities_len, 1593 rdev->wiphy.extended_capabilities_len,
1594 dev->wiphy.extended_capabilities) || 1594 rdev->wiphy.extended_capabilities) ||
1595 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK, 1595 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
1596 dev->wiphy.extended_capabilities_len, 1596 rdev->wiphy.extended_capabilities_len,
1597 dev->wiphy.extended_capabilities_mask))) 1597 rdev->wiphy.extended_capabilities_mask)))
1598 goto nla_put_failure; 1598 goto nla_put_failure;
1599 1599
1600 if (dev->wiphy.vht_capa_mod_mask && 1600 if (rdev->wiphy.vht_capa_mod_mask &&
1601 nla_put(msg, NL80211_ATTR_VHT_CAPABILITY_MASK, 1601 nla_put(msg, NL80211_ATTR_VHT_CAPABILITY_MASK,
1602 sizeof(*dev->wiphy.vht_capa_mod_mask), 1602 sizeof(*rdev->wiphy.vht_capa_mod_mask),
1603 dev->wiphy.vht_capa_mod_mask)) 1603 rdev->wiphy.vht_capa_mod_mask))
1604 goto nla_put_failure; 1604 goto nla_put_failure;
1605 1605
1606 state->split_start++; 1606 state->split_start++;
1607 break; 1607 break;
1608 case 10: 1608 case 10:
1609 if (nl80211_send_coalesce(msg, dev)) 1609 if (nl80211_send_coalesce(msg, rdev))
1610 goto nla_put_failure; 1610 goto nla_put_failure;
1611 1611
1612 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) && 1612 if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
1613 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) || 1613 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
1614 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ))) 1614 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
1615 goto nla_put_failure; 1615 goto nla_put_failure;
1616 1616
1617 if (dev->wiphy.max_ap_assoc_sta && 1617 if (rdev->wiphy.max_ap_assoc_sta &&
1618 nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA, 1618 nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA,
1619 dev->wiphy.max_ap_assoc_sta)) 1619 rdev->wiphy.max_ap_assoc_sta))
1620 goto nla_put_failure; 1620 goto nla_put_failure;
1621 1621
1622 state->split_start++; 1622 state->split_start++;
1623 break; 1623 break;
1624 case 11: 1624 case 11:
1625 if (dev->wiphy.n_vendor_commands) { 1625 if (rdev->wiphy.n_vendor_commands) {
1626 const struct nl80211_vendor_cmd_info *info; 1626 const struct nl80211_vendor_cmd_info *info;
1627 struct nlattr *nested; 1627 struct nlattr *nested;
1628 1628
@@ -1630,15 +1630,15 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1630 if (!nested) 1630 if (!nested)
1631 goto nla_put_failure; 1631 goto nla_put_failure;
1632 1632
1633 for (i = 0; i < dev->wiphy.n_vendor_commands; i++) { 1633 for (i = 0; i < rdev->wiphy.n_vendor_commands; i++) {
1634 info = &dev->wiphy.vendor_commands[i].info; 1634 info = &rdev->wiphy.vendor_commands[i].info;
1635 if (nla_put(msg, i + 1, sizeof(*info), info)) 1635 if (nla_put(msg, i + 1, sizeof(*info), info))
1636 goto nla_put_failure; 1636 goto nla_put_failure;
1637 } 1637 }
1638 nla_nest_end(msg, nested); 1638 nla_nest_end(msg, nested);
1639 } 1639 }
1640 1640
1641 if (dev->wiphy.n_vendor_events) { 1641 if (rdev->wiphy.n_vendor_events) {
1642 const struct nl80211_vendor_cmd_info *info; 1642 const struct nl80211_vendor_cmd_info *info;
1643 struct nlattr *nested; 1643 struct nlattr *nested;
1644 1644
@@ -1647,8 +1647,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1647 if (!nested) 1647 if (!nested)
1648 goto nla_put_failure; 1648 goto nla_put_failure;
1649 1649
1650 for (i = 0; i < dev->wiphy.n_vendor_events; i++) { 1650 for (i = 0; i < rdev->wiphy.n_vendor_events; i++) {
1651 info = &dev->wiphy.vendor_events[i]; 1651 info = &rdev->wiphy.vendor_events[i];
1652 if (nla_put(msg, i + 1, sizeof(*info), info)) 1652 if (nla_put(msg, i + 1, sizeof(*info), info))
1653 goto nla_put_failure; 1653 goto nla_put_failure;
1654 } 1654 }
@@ -1704,7 +1704,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
1704{ 1704{
1705 int idx = 0, ret; 1705 int idx = 0, ret;
1706 struct nl80211_dump_wiphy_state *state = (void *)cb->args[0]; 1706 struct nl80211_dump_wiphy_state *state = (void *)cb->args[0];
1707 struct cfg80211_registered_device *dev; 1707 struct cfg80211_registered_device *rdev;
1708 1708
1709 rtnl_lock(); 1709 rtnl_lock();
1710 if (!state) { 1710 if (!state) {
@@ -1723,17 +1723,17 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
1723 cb->args[0] = (long)state; 1723 cb->args[0] = (long)state;
1724 } 1724 }
1725 1725
1726 list_for_each_entry(dev, &cfg80211_rdev_list, list) { 1726 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
1727 if (!net_eq(wiphy_net(&dev->wiphy), sock_net(skb->sk))) 1727 if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
1728 continue; 1728 continue;
1729 if (++idx <= state->start) 1729 if (++idx <= state->start)
1730 continue; 1730 continue;
1731 if (state->filter_wiphy != -1 && 1731 if (state->filter_wiphy != -1 &&
1732 state->filter_wiphy != dev->wiphy_idx) 1732 state->filter_wiphy != rdev->wiphy_idx)
1733 continue; 1733 continue;
1734 /* attempt to fit multiple wiphy data chunks into the skb */ 1734 /* attempt to fit multiple wiphy data chunks into the skb */
1735 do { 1735 do {
1736 ret = nl80211_send_wiphy(dev, skb, 1736 ret = nl80211_send_wiphy(rdev, skb,
1737 NETLINK_CB(cb->skb).portid, 1737 NETLINK_CB(cb->skb).portid,
1738 cb->nlh->nlmsg_seq, 1738 cb->nlh->nlmsg_seq,
1739 NLM_F_MULTI, state); 1739 NLM_F_MULTI, state);
@@ -1781,14 +1781,14 @@ static int nl80211_dump_wiphy_done(struct netlink_callback *cb)
1781static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info) 1781static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info)
1782{ 1782{
1783 struct sk_buff *msg; 1783 struct sk_buff *msg;
1784 struct cfg80211_registered_device *dev = info->user_ptr[0]; 1784 struct cfg80211_registered_device *rdev = info->user_ptr[0];
1785 struct nl80211_dump_wiphy_state state = {}; 1785 struct nl80211_dump_wiphy_state state = {};
1786 1786
1787 msg = nlmsg_new(4096, GFP_KERNEL); 1787 msg = nlmsg_new(4096, GFP_KERNEL);
1788 if (!msg) 1788 if (!msg)
1789 return -ENOMEM; 1789 return -ENOMEM;
1790 1790
1791 if (nl80211_send_wiphy(dev, msg, info->snd_portid, info->snd_seq, 0, 1791 if (nl80211_send_wiphy(rdev, msg, info->snd_portid, info->snd_seq, 0,
1792 &state) < 0) { 1792 &state) < 0) {
1793 nlmsg_free(msg); 1793 nlmsg_free(msg);
1794 return -ENOBUFS; 1794 return -ENOBUFS;
@@ -2362,7 +2362,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
2362static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info) 2362static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
2363{ 2363{
2364 struct sk_buff *msg; 2364 struct sk_buff *msg;
2365 struct cfg80211_registered_device *dev = info->user_ptr[0]; 2365 struct cfg80211_registered_device *rdev = info->user_ptr[0];
2366 struct wireless_dev *wdev = info->user_ptr[1]; 2366 struct wireless_dev *wdev = info->user_ptr[1];
2367 2367
2368 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 2368 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
@@ -2370,7 +2370,7 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
2370 return -ENOMEM; 2370 return -ENOMEM;
2371 2371
2372 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, 2372 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0,
2373 dev, wdev) < 0) { 2373 rdev, wdev) < 0) {
2374 nlmsg_free(msg); 2374 nlmsg_free(msg);
2375 return -ENOBUFS; 2375 return -ENOBUFS;
2376 } 2376 }
@@ -3673,13 +3673,13 @@ static int nl80211_dump_station(struct sk_buff *skb,
3673 struct netlink_callback *cb) 3673 struct netlink_callback *cb)
3674{ 3674{
3675 struct station_info sinfo; 3675 struct station_info sinfo;
3676 struct cfg80211_registered_device *dev; 3676 struct cfg80211_registered_device *rdev;
3677 struct wireless_dev *wdev; 3677 struct wireless_dev *wdev;
3678 u8 mac_addr[ETH_ALEN]; 3678 u8 mac_addr[ETH_ALEN];
3679 int sta_idx = cb->args[2]; 3679 int sta_idx = cb->args[2];
3680 int err; 3680 int err;
3681 3681
3682 err = nl80211_prepare_wdev_dump(skb, cb, &dev, &wdev); 3682 err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev);
3683 if (err) 3683 if (err)
3684 return err; 3684 return err;
3685 3685
@@ -3688,14 +3688,14 @@ static int nl80211_dump_station(struct sk_buff *skb,
3688 goto out_err; 3688 goto out_err;
3689 } 3689 }
3690 3690
3691 if (!dev->ops->dump_station) { 3691 if (!rdev->ops->dump_station) {
3692 err = -EOPNOTSUPP; 3692 err = -EOPNOTSUPP;
3693 goto out_err; 3693 goto out_err;
3694 } 3694 }
3695 3695
3696 while (1) { 3696 while (1) {
3697 memset(&sinfo, 0, sizeof(sinfo)); 3697 memset(&sinfo, 0, sizeof(sinfo));
3698 err = rdev_dump_station(dev, wdev->netdev, sta_idx, 3698 err = rdev_dump_station(rdev, wdev->netdev, sta_idx,
3699 mac_addr, &sinfo); 3699 mac_addr, &sinfo);
3700 if (err == -ENOENT) 3700 if (err == -ENOENT)
3701 break; 3701 break;
@@ -3705,7 +3705,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
3705 if (nl80211_send_station(skb, 3705 if (nl80211_send_station(skb,
3706 NETLINK_CB(cb->skb).portid, 3706 NETLINK_CB(cb->skb).portid,
3707 cb->nlh->nlmsg_seq, NLM_F_MULTI, 3707 cb->nlh->nlmsg_seq, NLM_F_MULTI,
3708 dev, wdev->netdev, mac_addr, 3708 rdev, wdev->netdev, mac_addr,
3709 &sinfo) < 0) 3709 &sinfo) < 0)
3710 goto out; 3710 goto out;
3711 3711
@@ -3717,7 +3717,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
3717 cb->args[2] = sta_idx; 3717 cb->args[2] = sta_idx;
3718 err = skb->len; 3718 err = skb->len;
3719 out_err: 3719 out_err:
3720 nl80211_finish_wdev_dump(dev); 3720 nl80211_finish_wdev_dump(rdev);
3721 3721
3722 return err; 3722 return err;
3723} 3723}
@@ -4378,18 +4378,18 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
4378 struct netlink_callback *cb) 4378 struct netlink_callback *cb)
4379{ 4379{
4380 struct mpath_info pinfo; 4380 struct mpath_info pinfo;
4381 struct cfg80211_registered_device *dev; 4381 struct cfg80211_registered_device *rdev;
4382 struct wireless_dev *wdev; 4382 struct wireless_dev *wdev;
4383 u8 dst[ETH_ALEN]; 4383 u8 dst[ETH_ALEN];
4384 u8 next_hop[ETH_ALEN]; 4384 u8 next_hop[ETH_ALEN];
4385 int path_idx = cb->args[2]; 4385 int path_idx = cb->args[2];
4386 int err; 4386 int err;
4387 4387
4388 err = nl80211_prepare_wdev_dump(skb, cb, &dev, &wdev); 4388 err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev);
4389 if (err) 4389 if (err)
4390 return err; 4390 return err;
4391 4391
4392 if (!dev->ops->dump_mpath) { 4392 if (!rdev->ops->dump_mpath) {
4393 err = -EOPNOTSUPP; 4393 err = -EOPNOTSUPP;
4394 goto out_err; 4394 goto out_err;
4395 } 4395 }
@@ -4400,7 +4400,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
4400 } 4400 }
4401 4401
4402 while (1) { 4402 while (1) {
4403 err = rdev_dump_mpath(dev, wdev->netdev, path_idx, dst, 4403 err = rdev_dump_mpath(rdev, wdev->netdev, path_idx, dst,
4404 next_hop, &pinfo); 4404 next_hop, &pinfo);
4405 if (err == -ENOENT) 4405 if (err == -ENOENT)
4406 break; 4406 break;
@@ -4421,7 +4421,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
4421 cb->args[2] = path_idx; 4421 cb->args[2] = path_idx;
4422 err = skb->len; 4422 err = skb->len;
4423 out_err: 4423 out_err:
4424 nl80211_finish_wdev_dump(dev); 4424 nl80211_finish_wdev_dump(rdev);
4425 return err; 4425 return err;
4426} 4426}
4427 4427
@@ -6162,12 +6162,12 @@ static int nl80211_dump_survey(struct sk_buff *skb,
6162 struct netlink_callback *cb) 6162 struct netlink_callback *cb)
6163{ 6163{
6164 struct survey_info survey; 6164 struct survey_info survey;
6165 struct cfg80211_registered_device *dev; 6165 struct cfg80211_registered_device *rdev;
6166 struct wireless_dev *wdev; 6166 struct wireless_dev *wdev;
6167 int survey_idx = cb->args[2]; 6167 int survey_idx = cb->args[2];
6168 int res; 6168 int res;
6169 6169
6170 res = nl80211_prepare_wdev_dump(skb, cb, &dev, &wdev); 6170 res = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev);
6171 if (res) 6171 if (res)
6172 return res; 6172 return res;
6173 6173
@@ -6176,7 +6176,7 @@ static int nl80211_dump_survey(struct sk_buff *skb,
6176 goto out_err; 6176 goto out_err;
6177 } 6177 }
6178 6178
6179 if (!dev->ops->dump_survey) { 6179 if (!rdev->ops->dump_survey) {
6180 res = -EOPNOTSUPP; 6180 res = -EOPNOTSUPP;
6181 goto out_err; 6181 goto out_err;
6182 } 6182 }
@@ -6184,7 +6184,7 @@ static int nl80211_dump_survey(struct sk_buff *skb,
6184 while (1) { 6184 while (1) {
6185 struct ieee80211_channel *chan; 6185 struct ieee80211_channel *chan;
6186 6186
6187 res = rdev_dump_survey(dev, wdev->netdev, survey_idx, &survey); 6187 res = rdev_dump_survey(rdev, wdev->netdev, survey_idx, &survey);
6188 if (res == -ENOENT) 6188 if (res == -ENOENT)
6189 break; 6189 break;
6190 if (res) 6190 if (res)
@@ -6196,7 +6196,7 @@ static int nl80211_dump_survey(struct sk_buff *skb,
6196 goto out; 6196 goto out;
6197 } 6197 }
6198 6198
6199 chan = ieee80211_get_channel(&dev->wiphy, 6199 chan = ieee80211_get_channel(&rdev->wiphy,
6200 survey.channel->center_freq); 6200 survey.channel->center_freq);
6201 if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) { 6201 if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) {
6202 survey_idx++; 6202 survey_idx++;
@@ -6215,7 +6215,7 @@ static int nl80211_dump_survey(struct sk_buff *skb,
6215 cb->args[2] = survey_idx; 6215 cb->args[2] = survey_idx;
6216 res = skb->len; 6216 res = skb->len;
6217 out_err: 6217 out_err:
6218 nl80211_finish_wdev_dump(dev); 6218 nl80211_finish_wdev_dump(rdev);
6219 return res; 6219 return res;
6220} 6220}
6221 6221