diff options
author | Zhao, Gang <gamerh2o@gmail.com> | 2014-04-21 00:53:02 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-04-25 11:32:56 -0400 |
commit | 1b8ec87aa077c527c9e3525e16098ca7efbc853d (patch) | |
tree | 5bc41e5194c59c88d3b27b637410c27c4a2a207e | |
parent | 308f7fcfdba47f24cd70cba978fd10fb4584e61c (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>
-rw-r--r-- | net/wireless/core.h | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 258 | ||||
-rw-r--r-- | net/wireless/scan.c | 130 |
3 files changed, 196 insertions, 196 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h index 5bee6cc94b21..c65f4a92710c 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -251,8 +251,8 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev, | |||
251 | 251 | ||
252 | void ieee80211_set_bitrate_flags(struct wiphy *wiphy); | 252 | void ieee80211_set_bitrate_flags(struct wiphy *wiphy); |
253 | 253 | ||
254 | void cfg80211_bss_expire(struct cfg80211_registered_device *dev); | 254 | void cfg80211_bss_expire(struct cfg80211_registered_device *rdev); |
255 | void cfg80211_bss_age(struct cfg80211_registered_device *dev, | 255 | void cfg80211_bss_age(struct cfg80211_registered_device *rdev, |
256 | unsigned long age_secs); | 256 | unsigned long age_secs); |
257 | 257 | ||
258 | /* IBSS */ | 258 | /* IBSS */ |
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 | ||
1015 | static int nl80211_send_wowlan(struct sk_buff *msg, | 1015 | static 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 | ||
1068 | static int nl80211_send_coalesce(struct sk_buff *msg, | 1068 | static 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 | ||
1212 | static int nl80211_send_wiphy(struct cfg80211_registered_device *dev, | 1212 | static 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) | |||
1781 | static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info) | 1781 | static 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 * | |||
2362 | static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info) | 2362 | static 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 | ||
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index cf478c075ddc..6d6f082b7bb8 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -81,10 +81,10 @@ static void bss_free(struct cfg80211_internal_bss *bss) | |||
81 | kfree(bss); | 81 | kfree(bss); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void bss_ref_get(struct cfg80211_registered_device *dev, | 84 | static inline void bss_ref_get(struct cfg80211_registered_device *rdev, |
85 | struct cfg80211_internal_bss *bss) | 85 | struct cfg80211_internal_bss *bss) |
86 | { | 86 | { |
87 | lockdep_assert_held(&dev->bss_lock); | 87 | lockdep_assert_held(&rdev->bss_lock); |
88 | 88 | ||
89 | bss->refcount++; | 89 | bss->refcount++; |
90 | if (bss->pub.hidden_beacon_bss) { | 90 | if (bss->pub.hidden_beacon_bss) { |
@@ -95,10 +95,10 @@ static inline void bss_ref_get(struct cfg80211_registered_device *dev, | |||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | static inline void bss_ref_put(struct cfg80211_registered_device *dev, | 98 | static inline void bss_ref_put(struct cfg80211_registered_device *rdev, |
99 | struct cfg80211_internal_bss *bss) | 99 | struct cfg80211_internal_bss *bss) |
100 | { | 100 | { |
101 | lockdep_assert_held(&dev->bss_lock); | 101 | lockdep_assert_held(&rdev->bss_lock); |
102 | 102 | ||
103 | if (bss->pub.hidden_beacon_bss) { | 103 | if (bss->pub.hidden_beacon_bss) { |
104 | struct cfg80211_internal_bss *hbss; | 104 | struct cfg80211_internal_bss *hbss; |
@@ -114,10 +114,10 @@ static inline void bss_ref_put(struct cfg80211_registered_device *dev, | |||
114 | bss_free(bss); | 114 | bss_free(bss); |
115 | } | 115 | } |
116 | 116 | ||
117 | static bool __cfg80211_unlink_bss(struct cfg80211_registered_device *dev, | 117 | static bool __cfg80211_unlink_bss(struct cfg80211_registered_device *rdev, |
118 | struct cfg80211_internal_bss *bss) | 118 | struct cfg80211_internal_bss *bss) |
119 | { | 119 | { |
120 | lockdep_assert_held(&dev->bss_lock); | 120 | lockdep_assert_held(&rdev->bss_lock); |
121 | 121 | ||
122 | if (!list_empty(&bss->hidden_list)) { | 122 | if (!list_empty(&bss->hidden_list)) { |
123 | /* | 123 | /* |
@@ -134,31 +134,31 @@ static bool __cfg80211_unlink_bss(struct cfg80211_registered_device *dev, | |||
134 | } | 134 | } |
135 | 135 | ||
136 | list_del_init(&bss->list); | 136 | list_del_init(&bss->list); |
137 | rb_erase(&bss->rbn, &dev->bss_tree); | 137 | rb_erase(&bss->rbn, &rdev->bss_tree); |
138 | bss_ref_put(dev, bss); | 138 | bss_ref_put(rdev, bss); |
139 | return true; | 139 | return true; |
140 | } | 140 | } |
141 | 141 | ||
142 | static void __cfg80211_bss_expire(struct cfg80211_registered_device *dev, | 142 | static void __cfg80211_bss_expire(struct cfg80211_registered_device *rdev, |
143 | unsigned long expire_time) | 143 | unsigned long expire_time) |
144 | { | 144 | { |
145 | struct cfg80211_internal_bss *bss, *tmp; | 145 | struct cfg80211_internal_bss *bss, *tmp; |
146 | bool expired = false; | 146 | bool expired = false; |
147 | 147 | ||
148 | lockdep_assert_held(&dev->bss_lock); | 148 | lockdep_assert_held(&rdev->bss_lock); |
149 | 149 | ||
150 | list_for_each_entry_safe(bss, tmp, &dev->bss_list, list) { | 150 | list_for_each_entry_safe(bss, tmp, &rdev->bss_list, list) { |
151 | if (atomic_read(&bss->hold)) | 151 | if (atomic_read(&bss->hold)) |
152 | continue; | 152 | continue; |
153 | if (!time_after(expire_time, bss->ts)) | 153 | if (!time_after(expire_time, bss->ts)) |
154 | continue; | 154 | continue; |
155 | 155 | ||
156 | if (__cfg80211_unlink_bss(dev, bss)) | 156 | if (__cfg80211_unlink_bss(rdev, bss)) |
157 | expired = true; | 157 | expired = true; |
158 | } | 158 | } |
159 | 159 | ||
160 | if (expired) | 160 | if (expired) |
161 | dev->bss_generation++; | 161 | rdev->bss_generation++; |
162 | } | 162 | } |
163 | 163 | ||
164 | void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, | 164 | void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, |
@@ -322,21 +322,21 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev, | |||
322 | return 0; | 322 | return 0; |
323 | } | 323 | } |
324 | 324 | ||
325 | void cfg80211_bss_age(struct cfg80211_registered_device *dev, | 325 | void cfg80211_bss_age(struct cfg80211_registered_device *rdev, |
326 | unsigned long age_secs) | 326 | unsigned long age_secs) |
327 | { | 327 | { |
328 | struct cfg80211_internal_bss *bss; | 328 | struct cfg80211_internal_bss *bss; |
329 | unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); | 329 | unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); |
330 | 330 | ||
331 | spin_lock_bh(&dev->bss_lock); | 331 | spin_lock_bh(&rdev->bss_lock); |
332 | list_for_each_entry(bss, &dev->bss_list, list) | 332 | list_for_each_entry(bss, &rdev->bss_list, list) |
333 | bss->ts -= age_jiffies; | 333 | bss->ts -= age_jiffies; |
334 | spin_unlock_bh(&dev->bss_lock); | 334 | spin_unlock_bh(&rdev->bss_lock); |
335 | } | 335 | } |
336 | 336 | ||
337 | void cfg80211_bss_expire(struct cfg80211_registered_device *dev) | 337 | void cfg80211_bss_expire(struct cfg80211_registered_device *rdev) |
338 | { | 338 | { |
339 | __cfg80211_bss_expire(dev, jiffies - IEEE80211_SCAN_RESULT_EXPIRE); | 339 | __cfg80211_bss_expire(rdev, jiffies - IEEE80211_SCAN_RESULT_EXPIRE); |
340 | } | 340 | } |
341 | 341 | ||
342 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len) | 342 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len) |
@@ -526,16 +526,16 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | |||
526 | const u8 *ssid, size_t ssid_len, | 526 | const u8 *ssid, size_t ssid_len, |
527 | u16 capa_mask, u16 capa_val) | 527 | u16 capa_mask, u16 capa_val) |
528 | { | 528 | { |
529 | struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy); | 529 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
530 | struct cfg80211_internal_bss *bss, *res = NULL; | 530 | struct cfg80211_internal_bss *bss, *res = NULL; |
531 | unsigned long now = jiffies; | 531 | unsigned long now = jiffies; |
532 | 532 | ||
533 | trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, capa_mask, | 533 | trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, capa_mask, |
534 | capa_val); | 534 | capa_val); |
535 | 535 | ||
536 | spin_lock_bh(&dev->bss_lock); | 536 | spin_lock_bh(&rdev->bss_lock); |
537 | 537 | ||
538 | list_for_each_entry(bss, &dev->bss_list, list) { | 538 | list_for_each_entry(bss, &rdev->bss_list, list) { |
539 | if ((bss->pub.capability & capa_mask) != capa_val) | 539 | if ((bss->pub.capability & capa_mask) != capa_val) |
540 | continue; | 540 | continue; |
541 | if (channel && bss->pub.channel != channel) | 541 | if (channel && bss->pub.channel != channel) |
@@ -548,12 +548,12 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | |||
548 | continue; | 548 | continue; |
549 | if (is_bss(&bss->pub, bssid, ssid, ssid_len)) { | 549 | if (is_bss(&bss->pub, bssid, ssid, ssid_len)) { |
550 | res = bss; | 550 | res = bss; |
551 | bss_ref_get(dev, res); | 551 | bss_ref_get(rdev, res); |
552 | break; | 552 | break; |
553 | } | 553 | } |
554 | } | 554 | } |
555 | 555 | ||
556 | spin_unlock_bh(&dev->bss_lock); | 556 | spin_unlock_bh(&rdev->bss_lock); |
557 | if (!res) | 557 | if (!res) |
558 | return NULL; | 558 | return NULL; |
559 | trace_cfg80211_return_bss(&res->pub); | 559 | trace_cfg80211_return_bss(&res->pub); |
@@ -561,10 +561,10 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | |||
561 | } | 561 | } |
562 | EXPORT_SYMBOL(cfg80211_get_bss); | 562 | EXPORT_SYMBOL(cfg80211_get_bss); |
563 | 563 | ||
564 | static void rb_insert_bss(struct cfg80211_registered_device *dev, | 564 | static void rb_insert_bss(struct cfg80211_registered_device *rdev, |
565 | struct cfg80211_internal_bss *bss) | 565 | struct cfg80211_internal_bss *bss) |
566 | { | 566 | { |
567 | struct rb_node **p = &dev->bss_tree.rb_node; | 567 | struct rb_node **p = &rdev->bss_tree.rb_node; |
568 | struct rb_node *parent = NULL; | 568 | struct rb_node *parent = NULL; |
569 | struct cfg80211_internal_bss *tbss; | 569 | struct cfg80211_internal_bss *tbss; |
570 | int cmp; | 570 | int cmp; |
@@ -587,15 +587,15 @@ static void rb_insert_bss(struct cfg80211_registered_device *dev, | |||
587 | } | 587 | } |
588 | 588 | ||
589 | rb_link_node(&bss->rbn, parent, p); | 589 | rb_link_node(&bss->rbn, parent, p); |
590 | rb_insert_color(&bss->rbn, &dev->bss_tree); | 590 | rb_insert_color(&bss->rbn, &rdev->bss_tree); |
591 | } | 591 | } |
592 | 592 | ||
593 | static struct cfg80211_internal_bss * | 593 | static struct cfg80211_internal_bss * |
594 | rb_find_bss(struct cfg80211_registered_device *dev, | 594 | rb_find_bss(struct cfg80211_registered_device *rdev, |
595 | struct cfg80211_internal_bss *res, | 595 | struct cfg80211_internal_bss *res, |
596 | enum bss_compare_mode mode) | 596 | enum bss_compare_mode mode) |
597 | { | 597 | { |
598 | struct rb_node *n = dev->bss_tree.rb_node; | 598 | struct rb_node *n = rdev->bss_tree.rb_node; |
599 | struct cfg80211_internal_bss *bss; | 599 | struct cfg80211_internal_bss *bss; |
600 | int r; | 600 | int r; |
601 | 601 | ||
@@ -614,7 +614,7 @@ rb_find_bss(struct cfg80211_registered_device *dev, | |||
614 | return NULL; | 614 | return NULL; |
615 | } | 615 | } |
616 | 616 | ||
617 | static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev, | 617 | static bool cfg80211_combine_bsses(struct cfg80211_registered_device *rdev, |
618 | struct cfg80211_internal_bss *new) | 618 | struct cfg80211_internal_bss *new) |
619 | { | 619 | { |
620 | const struct cfg80211_bss_ies *ies; | 620 | const struct cfg80211_bss_ies *ies; |
@@ -644,7 +644,7 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev, | |||
644 | 644 | ||
645 | /* This is the bad part ... */ | 645 | /* This is the bad part ... */ |
646 | 646 | ||
647 | list_for_each_entry(bss, &dev->bss_list, list) { | 647 | list_for_each_entry(bss, &rdev->bss_list, list) { |
648 | if (!ether_addr_equal(bss->pub.bssid, new->pub.bssid)) | 648 | if (!ether_addr_equal(bss->pub.bssid, new->pub.bssid)) |
649 | continue; | 649 | continue; |
650 | if (bss->pub.channel != new->pub.channel) | 650 | if (bss->pub.channel != new->pub.channel) |
@@ -678,7 +678,7 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev, | |||
678 | 678 | ||
679 | /* Returned bss is reference counted and must be cleaned up appropriately. */ | 679 | /* Returned bss is reference counted and must be cleaned up appropriately. */ |
680 | static struct cfg80211_internal_bss * | 680 | static struct cfg80211_internal_bss * |
681 | cfg80211_bss_update(struct cfg80211_registered_device *dev, | 681 | cfg80211_bss_update(struct cfg80211_registered_device *rdev, |
682 | struct cfg80211_internal_bss *tmp, | 682 | struct cfg80211_internal_bss *tmp, |
683 | bool signal_valid) | 683 | bool signal_valid) |
684 | { | 684 | { |
@@ -689,14 +689,14 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
689 | 689 | ||
690 | tmp->ts = jiffies; | 690 | tmp->ts = jiffies; |
691 | 691 | ||
692 | spin_lock_bh(&dev->bss_lock); | 692 | spin_lock_bh(&rdev->bss_lock); |
693 | 693 | ||
694 | if (WARN_ON(!rcu_access_pointer(tmp->pub.ies))) { | 694 | if (WARN_ON(!rcu_access_pointer(tmp->pub.ies))) { |
695 | spin_unlock_bh(&dev->bss_lock); | 695 | spin_unlock_bh(&rdev->bss_lock); |
696 | return NULL; | 696 | return NULL; |
697 | } | 697 | } |
698 | 698 | ||
699 | found = rb_find_bss(dev, tmp, BSS_CMP_REGULAR); | 699 | found = rb_find_bss(rdev, tmp, BSS_CMP_REGULAR); |
700 | 700 | ||
701 | if (found) { | 701 | if (found) { |
702 | /* Update IEs */ | 702 | /* Update IEs */ |
@@ -783,7 +783,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
783 | * is allocated on the stack since it's not needed in the | 783 | * is allocated on the stack since it's not needed in the |
784 | * more common case of an update | 784 | * more common case of an update |
785 | */ | 785 | */ |
786 | new = kzalloc(sizeof(*new) + dev->wiphy.bss_priv_size, | 786 | new = kzalloc(sizeof(*new) + rdev->wiphy.bss_priv_size, |
787 | GFP_ATOMIC); | 787 | GFP_ATOMIC); |
788 | if (!new) { | 788 | if (!new) { |
789 | ies = (void *)rcu_dereference(tmp->pub.beacon_ies); | 789 | ies = (void *)rcu_dereference(tmp->pub.beacon_ies); |
@@ -799,9 +799,9 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
799 | INIT_LIST_HEAD(&new->hidden_list); | 799 | INIT_LIST_HEAD(&new->hidden_list); |
800 | 800 | ||
801 | if (rcu_access_pointer(tmp->pub.proberesp_ies)) { | 801 | if (rcu_access_pointer(tmp->pub.proberesp_ies)) { |
802 | hidden = rb_find_bss(dev, tmp, BSS_CMP_HIDE_ZLEN); | 802 | hidden = rb_find_bss(rdev, tmp, BSS_CMP_HIDE_ZLEN); |
803 | if (!hidden) | 803 | if (!hidden) |
804 | hidden = rb_find_bss(dev, tmp, | 804 | hidden = rb_find_bss(rdev, tmp, |
805 | BSS_CMP_HIDE_NUL); | 805 | BSS_CMP_HIDE_NUL); |
806 | if (hidden) { | 806 | if (hidden) { |
807 | new->pub.hidden_beacon_bss = &hidden->pub; | 807 | new->pub.hidden_beacon_bss = &hidden->pub; |
@@ -818,24 +818,24 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
818 | * expensive search for any probe responses that should | 818 | * expensive search for any probe responses that should |
819 | * be grouped with this beacon for updates ... | 819 | * be grouped with this beacon for updates ... |
820 | */ | 820 | */ |
821 | if (!cfg80211_combine_bsses(dev, new)) { | 821 | if (!cfg80211_combine_bsses(rdev, new)) { |
822 | kfree(new); | 822 | kfree(new); |
823 | goto drop; | 823 | goto drop; |
824 | } | 824 | } |
825 | } | 825 | } |
826 | 826 | ||
827 | list_add_tail(&new->list, &dev->bss_list); | 827 | list_add_tail(&new->list, &rdev->bss_list); |
828 | rb_insert_bss(dev, new); | 828 | rb_insert_bss(rdev, new); |
829 | found = new; | 829 | found = new; |
830 | } | 830 | } |
831 | 831 | ||
832 | dev->bss_generation++; | 832 | rdev->bss_generation++; |
833 | bss_ref_get(dev, found); | 833 | bss_ref_get(rdev, found); |
834 | spin_unlock_bh(&dev->bss_lock); | 834 | spin_unlock_bh(&rdev->bss_lock); |
835 | 835 | ||
836 | return found; | 836 | return found; |
837 | drop: | 837 | drop: |
838 | spin_unlock_bh(&dev->bss_lock); | 838 | spin_unlock_bh(&rdev->bss_lock); |
839 | return NULL; | 839 | return NULL; |
840 | } | 840 | } |
841 | 841 | ||
@@ -1007,7 +1007,7 @@ EXPORT_SYMBOL(cfg80211_inform_bss_width_frame); | |||
1007 | 1007 | ||
1008 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1008 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1009 | { | 1009 | { |
1010 | struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy); | 1010 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
1011 | struct cfg80211_internal_bss *bss; | 1011 | struct cfg80211_internal_bss *bss; |
1012 | 1012 | ||
1013 | if (!pub) | 1013 | if (!pub) |
@@ -1015,15 +1015,15 @@ void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | |||
1015 | 1015 | ||
1016 | bss = container_of(pub, struct cfg80211_internal_bss, pub); | 1016 | bss = container_of(pub, struct cfg80211_internal_bss, pub); |
1017 | 1017 | ||
1018 | spin_lock_bh(&dev->bss_lock); | 1018 | spin_lock_bh(&rdev->bss_lock); |
1019 | bss_ref_get(dev, bss); | 1019 | bss_ref_get(rdev, bss); |
1020 | spin_unlock_bh(&dev->bss_lock); | 1020 | spin_unlock_bh(&rdev->bss_lock); |
1021 | } | 1021 | } |
1022 | EXPORT_SYMBOL(cfg80211_ref_bss); | 1022 | EXPORT_SYMBOL(cfg80211_ref_bss); |
1023 | 1023 | ||
1024 | void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1024 | void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1025 | { | 1025 | { |
1026 | struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy); | 1026 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
1027 | struct cfg80211_internal_bss *bss; | 1027 | struct cfg80211_internal_bss *bss; |
1028 | 1028 | ||
1029 | if (!pub) | 1029 | if (!pub) |
@@ -1031,15 +1031,15 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | |||
1031 | 1031 | ||
1032 | bss = container_of(pub, struct cfg80211_internal_bss, pub); | 1032 | bss = container_of(pub, struct cfg80211_internal_bss, pub); |
1033 | 1033 | ||
1034 | spin_lock_bh(&dev->bss_lock); | 1034 | spin_lock_bh(&rdev->bss_lock); |
1035 | bss_ref_put(dev, bss); | 1035 | bss_ref_put(rdev, bss); |
1036 | spin_unlock_bh(&dev->bss_lock); | 1036 | spin_unlock_bh(&rdev->bss_lock); |
1037 | } | 1037 | } |
1038 | EXPORT_SYMBOL(cfg80211_put_bss); | 1038 | EXPORT_SYMBOL(cfg80211_put_bss); |
1039 | 1039 | ||
1040 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1040 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1041 | { | 1041 | { |
1042 | struct cfg80211_registered_device *dev = wiphy_to_dev(wiphy); | 1042 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
1043 | struct cfg80211_internal_bss *bss; | 1043 | struct cfg80211_internal_bss *bss; |
1044 | 1044 | ||
1045 | if (WARN_ON(!pub)) | 1045 | if (WARN_ON(!pub)) |
@@ -1047,12 +1047,12 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | |||
1047 | 1047 | ||
1048 | bss = container_of(pub, struct cfg80211_internal_bss, pub); | 1048 | bss = container_of(pub, struct cfg80211_internal_bss, pub); |
1049 | 1049 | ||
1050 | spin_lock_bh(&dev->bss_lock); | 1050 | spin_lock_bh(&rdev->bss_lock); |
1051 | if (!list_empty(&bss->list)) { | 1051 | if (!list_empty(&bss->list)) { |
1052 | if (__cfg80211_unlink_bss(dev, bss)) | 1052 | if (__cfg80211_unlink_bss(rdev, bss)) |
1053 | dev->bss_generation++; | 1053 | rdev->bss_generation++; |
1054 | } | 1054 | } |
1055 | spin_unlock_bh(&dev->bss_lock); | 1055 | spin_unlock_bh(&rdev->bss_lock); |
1056 | } | 1056 | } |
1057 | EXPORT_SYMBOL(cfg80211_unlink_bss); | 1057 | EXPORT_SYMBOL(cfg80211_unlink_bss); |
1058 | 1058 | ||
@@ -1465,7 +1465,7 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info, | |||
1465 | } | 1465 | } |
1466 | 1466 | ||
1467 | 1467 | ||
1468 | static int ieee80211_scan_results(struct cfg80211_registered_device *dev, | 1468 | static int ieee80211_scan_results(struct cfg80211_registered_device *rdev, |
1469 | struct iw_request_info *info, | 1469 | struct iw_request_info *info, |
1470 | char *buf, size_t len) | 1470 | char *buf, size_t len) |
1471 | { | 1471 | { |
@@ -1473,18 +1473,18 @@ static int ieee80211_scan_results(struct cfg80211_registered_device *dev, | |||
1473 | char *end_buf = buf + len; | 1473 | char *end_buf = buf + len; |
1474 | struct cfg80211_internal_bss *bss; | 1474 | struct cfg80211_internal_bss *bss; |
1475 | 1475 | ||
1476 | spin_lock_bh(&dev->bss_lock); | 1476 | spin_lock_bh(&rdev->bss_lock); |
1477 | cfg80211_bss_expire(dev); | 1477 | cfg80211_bss_expire(rdev); |
1478 | 1478 | ||
1479 | list_for_each_entry(bss, &dev->bss_list, list) { | 1479 | list_for_each_entry(bss, &rdev->bss_list, list) { |
1480 | if (buf + len - current_ev <= IW_EV_ADDR_LEN) { | 1480 | if (buf + len - current_ev <= IW_EV_ADDR_LEN) { |
1481 | spin_unlock_bh(&dev->bss_lock); | 1481 | spin_unlock_bh(&rdev->bss_lock); |
1482 | return -E2BIG; | 1482 | return -E2BIG; |
1483 | } | 1483 | } |
1484 | current_ev = ieee80211_bss(&dev->wiphy, info, bss, | 1484 | current_ev = ieee80211_bss(&rdev->wiphy, info, bss, |
1485 | current_ev, end_buf); | 1485 | current_ev, end_buf); |
1486 | } | 1486 | } |
1487 | spin_unlock_bh(&dev->bss_lock); | 1487 | spin_unlock_bh(&rdev->bss_lock); |
1488 | return current_ev - buf; | 1488 | return current_ev - buf; |
1489 | } | 1489 | } |
1490 | 1490 | ||