aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 21:56:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:33 -0400
commit79c97e97aed7f760d2826c7daf2d42d8eefe9838 (patch)
treebf6d18d0de2c0168a292f05eb6f7296c15278b8b /net/wireless/nl80211.c
parent667503ddcb96f3b10211f997fe55907fa7509841 (diff)
cfg80211: clean up naming once and for all
We've named the registered devices 'drv' sometimes, thinking of "driver", which is not what it is, it's the internal representation of a wiphy, i.e. a device. Let's clean up the naming once and and use 'rdev' aka 'registered device' everywhere. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c340
1 files changed, 170 insertions, 170 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cf4ac786b20a..9deb12f73c44 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -29,9 +29,9 @@ static struct genl_family nl80211_fam = {
29 .maxattr = NL80211_ATTR_MAX, 29 .maxattr = NL80211_ATTR_MAX,
30}; 30};
31 31
32/* internal helper: get drv and dev */ 32/* internal helper: get rdev and dev */
33static int get_drv_dev_by_info_ifindex(struct nlattr **attrs, 33static int get_rdev_dev_by_info_ifindex(struct nlattr **attrs,
34 struct cfg80211_registered_device **drv, 34 struct cfg80211_registered_device **rdev,
35 struct net_device **dev) 35 struct net_device **dev)
36{ 36{
37 int ifindex; 37 int ifindex;
@@ -44,10 +44,10 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
44 if (!*dev) 44 if (!*dev)
45 return -ENODEV; 45 return -ENODEV;
46 46
47 *drv = cfg80211_get_dev_from_ifindex(ifindex); 47 *rdev = cfg80211_get_dev_from_ifindex(ifindex);
48 if (IS_ERR(*drv)) { 48 if (IS_ERR(*rdev)) {
49 dev_put(*dev); 49 dev_put(*dev);
50 return PTR_ERR(*drv); 50 return PTR_ERR(*rdev);
51 } 51 }
52 52
53 return 0; 53 return 0;
@@ -378,7 +378,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
378 struct cfg80211_registered_device *dev; 378 struct cfg80211_registered_device *dev;
379 379
380 mutex_lock(&cfg80211_mutex); 380 mutex_lock(&cfg80211_mutex);
381 list_for_each_entry(dev, &cfg80211_drv_list, list) { 381 list_for_each_entry(dev, &cfg80211_rdev_list, list) {
382 if (++idx <= start) 382 if (++idx <= start)
383 continue; 383 continue;
384 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid, 384 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid,
@@ -460,7 +460,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
460 460
461 mutex_lock(&cfg80211_mutex); 461 mutex_lock(&cfg80211_mutex);
462 462
463 rdev = __cfg80211_drv_from_info(info); 463 rdev = __cfg80211_rdev_from_info(info);
464 if (IS_ERR(rdev)) { 464 if (IS_ERR(rdev)) {
465 mutex_unlock(&cfg80211_mutex); 465 mutex_unlock(&cfg80211_mutex);
466 result = PTR_ERR(rdev); 466 result = PTR_ERR(rdev);
@@ -683,7 +683,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
683 struct wireless_dev *wdev; 683 struct wireless_dev *wdev;
684 684
685 mutex_lock(&cfg80211_mutex); 685 mutex_lock(&cfg80211_mutex);
686 list_for_each_entry(dev, &cfg80211_drv_list, list) { 686 list_for_each_entry(dev, &cfg80211_rdev_list, list) {
687 if (wp_idx < wp_start) { 687 if (wp_idx < wp_start) {
688 wp_idx++; 688 wp_idx++;
689 continue; 689 continue;
@@ -724,7 +724,7 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
724 struct net_device *netdev; 724 struct net_device *netdev;
725 int err; 725 int err;
726 726
727 err = get_drv_dev_by_info_ifindex(info->attrs, &dev, &netdev); 727 err = get_rdev_dev_by_info_ifindex(info->attrs, &dev, &netdev);
728 if (err) 728 if (err)
729 return err; 729 return err;
730 730
@@ -780,7 +780,7 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)
780 780
781static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) 781static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
782{ 782{
783 struct cfg80211_registered_device *drv; 783 struct cfg80211_registered_device *rdev;
784 struct vif_params params; 784 struct vif_params params;
785 int err; 785 int err;
786 enum nl80211_iftype otype, ntype; 786 enum nl80211_iftype otype, ntype;
@@ -792,7 +792,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
792 792
793 rtnl_lock(); 793 rtnl_lock();
794 794
795 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 795 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
796 if (err) 796 if (err)
797 goto unlock_rtnl; 797 goto unlock_rtnl;
798 798
@@ -808,8 +808,8 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
808 } 808 }
809 } 809 }
810 810
811 if (!drv->ops->change_virtual_intf || 811 if (!rdev->ops->change_virtual_intf ||
812 !(drv->wiphy.interface_modes & (1 << ntype))) { 812 !(rdev->wiphy.interface_modes & (1 << ntype))) {
813 err = -EOPNOTSUPP; 813 err = -EOPNOTSUPP;
814 goto unlock; 814 goto unlock;
815 } 815 }
@@ -839,7 +839,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
839 } 839 }
840 840
841 if (change) 841 if (change)
842 err = drv->ops->change_virtual_intf(&drv->wiphy, dev, 842 err = rdev->ops->change_virtual_intf(&rdev->wiphy, dev,
843 ntype, flags, &params); 843 ntype, flags, &params);
844 else 844 else
845 err = 0; 845 err = 0;
@@ -853,7 +853,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
853 853
854 unlock: 854 unlock:
855 dev_put(dev); 855 dev_put(dev);
856 cfg80211_unlock_rdev(drv); 856 cfg80211_unlock_rdev(rdev);
857 unlock_rtnl: 857 unlock_rtnl:
858 rtnl_unlock(); 858 rtnl_unlock();
859 return err; 859 return err;
@@ -861,7 +861,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
861 861
862static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) 862static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
863{ 863{
864 struct cfg80211_registered_device *drv; 864 struct cfg80211_registered_device *rdev;
865 struct vif_params params; 865 struct vif_params params;
866 int err; 866 int err;
867 enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED; 867 enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED;
@@ -880,14 +880,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
880 880
881 rtnl_lock(); 881 rtnl_lock();
882 882
883 drv = cfg80211_get_dev_from_info(info); 883 rdev = cfg80211_get_dev_from_info(info);
884 if (IS_ERR(drv)) { 884 if (IS_ERR(rdev)) {
885 err = PTR_ERR(drv); 885 err = PTR_ERR(rdev);
886 goto unlock_rtnl; 886 goto unlock_rtnl;
887 } 887 }
888 888
889 if (!drv->ops->add_virtual_intf || 889 if (!rdev->ops->add_virtual_intf ||
890 !(drv->wiphy.interface_modes & (1 << type))) { 890 !(rdev->wiphy.interface_modes & (1 << type))) {
891 err = -EOPNOTSUPP; 891 err = -EOPNOTSUPP;
892 goto unlock; 892 goto unlock;
893 } 893 }
@@ -901,12 +901,12 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
901 err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ? 901 err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ?
902 info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, 902 info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
903 &flags); 903 &flags);
904 err = drv->ops->add_virtual_intf(&drv->wiphy, 904 err = rdev->ops->add_virtual_intf(&rdev->wiphy,
905 nla_data(info->attrs[NL80211_ATTR_IFNAME]), 905 nla_data(info->attrs[NL80211_ATTR_IFNAME]),
906 type, err ? NULL : &flags, &params); 906 type, err ? NULL : &flags, &params);
907 907
908 unlock: 908 unlock:
909 cfg80211_unlock_rdev(drv); 909 cfg80211_unlock_rdev(rdev);
910 unlock_rtnl: 910 unlock_rtnl:
911 rtnl_unlock(); 911 rtnl_unlock();
912 return err; 912 return err;
@@ -914,27 +914,27 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
914 914
915static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info) 915static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
916{ 916{
917 struct cfg80211_registered_device *drv; 917 struct cfg80211_registered_device *rdev;
918 int ifindex, err; 918 int ifindex, err;
919 struct net_device *dev; 919 struct net_device *dev;
920 920
921 rtnl_lock(); 921 rtnl_lock();
922 922
923 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 923 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
924 if (err) 924 if (err)
925 goto unlock_rtnl; 925 goto unlock_rtnl;
926 ifindex = dev->ifindex; 926 ifindex = dev->ifindex;
927 dev_put(dev); 927 dev_put(dev);
928 928
929 if (!drv->ops->del_virtual_intf) { 929 if (!rdev->ops->del_virtual_intf) {
930 err = -EOPNOTSUPP; 930 err = -EOPNOTSUPP;
931 goto out; 931 goto out;
932 } 932 }
933 933
934 err = drv->ops->del_virtual_intf(&drv->wiphy, ifindex); 934 err = rdev->ops->del_virtual_intf(&rdev->wiphy, ifindex);
935 935
936 out: 936 out:
937 cfg80211_unlock_rdev(drv); 937 cfg80211_unlock_rdev(rdev);
938 unlock_rtnl: 938 unlock_rtnl:
939 rtnl_unlock(); 939 rtnl_unlock();
940 return err; 940 return err;
@@ -968,7 +968,7 @@ static void get_key_callback(void *c, struct key_params *params)
968 968
969static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) 969static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
970{ 970{
971 struct cfg80211_registered_device *drv; 971 struct cfg80211_registered_device *rdev;
972 int err; 972 int err;
973 struct net_device *dev; 973 struct net_device *dev;
974 u8 key_idx = 0; 974 u8 key_idx = 0;
@@ -990,11 +990,11 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
990 990
991 rtnl_lock(); 991 rtnl_lock();
992 992
993 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 993 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
994 if (err) 994 if (err)
995 goto unlock_rtnl; 995 goto unlock_rtnl;
996 996
997 if (!drv->ops->get_key) { 997 if (!rdev->ops->get_key) {
998 err = -EOPNOTSUPP; 998 err = -EOPNOTSUPP;
999 goto out; 999 goto out;
1000 } 1000 }
@@ -1020,7 +1020,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1020 if (mac_addr) 1020 if (mac_addr)
1021 NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr); 1021 NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
1022 1022
1023 err = drv->ops->get_key(&drv->wiphy, dev, key_idx, mac_addr, 1023 err = rdev->ops->get_key(&rdev->wiphy, dev, key_idx, mac_addr,
1024 &cookie, get_key_callback); 1024 &cookie, get_key_callback);
1025 1025
1026 if (err) 1026 if (err)
@@ -1037,7 +1037,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1037 err = -ENOBUFS; 1037 err = -ENOBUFS;
1038 nlmsg_free(msg); 1038 nlmsg_free(msg);
1039 out: 1039 out:
1040 cfg80211_unlock_rdev(drv); 1040 cfg80211_unlock_rdev(rdev);
1041 dev_put(dev); 1041 dev_put(dev);
1042 unlock_rtnl: 1042 unlock_rtnl:
1043 rtnl_unlock(); 1043 rtnl_unlock();
@@ -1047,7 +1047,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1047 1047
1048static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info) 1048static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1049{ 1049{
1050 struct cfg80211_registered_device *drv; 1050 struct cfg80211_registered_device *rdev;
1051 int err; 1051 int err;
1052 struct net_device *dev; 1052 struct net_device *dev;
1053 u8 key_idx; 1053 u8 key_idx;
@@ -1072,24 +1072,24 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1072 1072
1073 rtnl_lock(); 1073 rtnl_lock();
1074 1074
1075 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1075 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1076 if (err) 1076 if (err)
1077 goto unlock_rtnl; 1077 goto unlock_rtnl;
1078 1078
1079 if (info->attrs[NL80211_ATTR_KEY_DEFAULT]) 1079 if (info->attrs[NL80211_ATTR_KEY_DEFAULT])
1080 func = drv->ops->set_default_key; 1080 func = rdev->ops->set_default_key;
1081 else 1081 else
1082 func = drv->ops->set_default_mgmt_key; 1082 func = rdev->ops->set_default_mgmt_key;
1083 1083
1084 if (!func) { 1084 if (!func) {
1085 err = -EOPNOTSUPP; 1085 err = -EOPNOTSUPP;
1086 goto out; 1086 goto out;
1087 } 1087 }
1088 1088
1089 err = func(&drv->wiphy, dev, key_idx); 1089 err = func(&rdev->wiphy, dev, key_idx);
1090#ifdef CONFIG_WIRELESS_EXT 1090#ifdef CONFIG_WIRELESS_EXT
1091 if (!err) { 1091 if (!err) {
1092 if (func == drv->ops->set_default_key) 1092 if (func == rdev->ops->set_default_key)
1093 dev->ieee80211_ptr->wext.default_key = key_idx; 1093 dev->ieee80211_ptr->wext.default_key = key_idx;
1094 else 1094 else
1095 dev->ieee80211_ptr->wext.default_mgmt_key = key_idx; 1095 dev->ieee80211_ptr->wext.default_mgmt_key = key_idx;
@@ -1097,7 +1097,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1097#endif 1097#endif
1098 1098
1099 out: 1099 out:
1100 cfg80211_unlock_rdev(drv); 1100 cfg80211_unlock_rdev(rdev);
1101 dev_put(dev); 1101 dev_put(dev);
1102 1102
1103 unlock_rtnl: 1103 unlock_rtnl:
@@ -1108,7 +1108,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1108 1108
1109static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info) 1109static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1110{ 1110{
1111 struct cfg80211_registered_device *drv; 1111 struct cfg80211_registered_device *rdev;
1112 int err, i; 1112 int err, i;
1113 struct net_device *dev; 1113 struct net_device *dev;
1114 struct key_params params; 1114 struct key_params params;
@@ -1143,27 +1143,27 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1143 1143
1144 rtnl_lock(); 1144 rtnl_lock();
1145 1145
1146 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1146 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1147 if (err) 1147 if (err)
1148 goto unlock_rtnl; 1148 goto unlock_rtnl;
1149 1149
1150 for (i = 0; i < drv->wiphy.n_cipher_suites; i++) 1150 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++)
1151 if (params.cipher == drv->wiphy.cipher_suites[i]) 1151 if (params.cipher == rdev->wiphy.cipher_suites[i])
1152 break; 1152 break;
1153 if (i == drv->wiphy.n_cipher_suites) { 1153 if (i == rdev->wiphy.n_cipher_suites) {
1154 err = -EINVAL; 1154 err = -EINVAL;
1155 goto out; 1155 goto out;
1156 } 1156 }
1157 1157
1158 if (!drv->ops->add_key) { 1158 if (!rdev->ops->add_key) {
1159 err = -EOPNOTSUPP; 1159 err = -EOPNOTSUPP;
1160 goto out; 1160 goto out;
1161 } 1161 }
1162 1162
1163 err = drv->ops->add_key(&drv->wiphy, dev, key_idx, mac_addr, &params); 1163 err = rdev->ops->add_key(&rdev->wiphy, dev, key_idx, mac_addr, &params);
1164 1164
1165 out: 1165 out:
1166 cfg80211_unlock_rdev(drv); 1166 cfg80211_unlock_rdev(rdev);
1167 dev_put(dev); 1167 dev_put(dev);
1168 unlock_rtnl: 1168 unlock_rtnl:
1169 rtnl_unlock(); 1169 rtnl_unlock();
@@ -1173,7 +1173,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1173 1173
1174static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info) 1174static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1175{ 1175{
1176 struct cfg80211_registered_device *drv; 1176 struct cfg80211_registered_device *rdev;
1177 int err; 1177 int err;
1178 struct net_device *dev; 1178 struct net_device *dev;
1179 u8 key_idx = 0; 1179 u8 key_idx = 0;
@@ -1190,16 +1190,16 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1190 1190
1191 rtnl_lock(); 1191 rtnl_lock();
1192 1192
1193 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1193 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1194 if (err) 1194 if (err)
1195 goto unlock_rtnl; 1195 goto unlock_rtnl;
1196 1196
1197 if (!drv->ops->del_key) { 1197 if (!rdev->ops->del_key) {
1198 err = -EOPNOTSUPP; 1198 err = -EOPNOTSUPP;
1199 goto out; 1199 goto out;
1200 } 1200 }
1201 1201
1202 err = drv->ops->del_key(&drv->wiphy, dev, key_idx, mac_addr); 1202 err = rdev->ops->del_key(&rdev->wiphy, dev, key_idx, mac_addr);
1203 1203
1204#ifdef CONFIG_WIRELESS_EXT 1204#ifdef CONFIG_WIRELESS_EXT
1205 if (!err) { 1205 if (!err) {
@@ -1211,7 +1211,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1211#endif 1211#endif
1212 1212
1213 out: 1213 out:
1214 cfg80211_unlock_rdev(drv); 1214 cfg80211_unlock_rdev(rdev);
1215 dev_put(dev); 1215 dev_put(dev);
1216 1216
1217 unlock_rtnl: 1217 unlock_rtnl:
@@ -1224,7 +1224,7 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1224{ 1224{
1225 int (*call)(struct wiphy *wiphy, struct net_device *dev, 1225 int (*call)(struct wiphy *wiphy, struct net_device *dev,
1226 struct beacon_parameters *info); 1226 struct beacon_parameters *info);
1227 struct cfg80211_registered_device *drv; 1227 struct cfg80211_registered_device *rdev;
1228 int err; 1228 int err;
1229 struct net_device *dev; 1229 struct net_device *dev;
1230 struct beacon_parameters params; 1230 struct beacon_parameters params;
@@ -1235,7 +1235,7 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1235 1235
1236 rtnl_lock(); 1236 rtnl_lock();
1237 1237
1238 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1238 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1239 if (err) 1239 if (err)
1240 goto unlock_rtnl; 1240 goto unlock_rtnl;
1241 1241
@@ -1254,10 +1254,10 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1254 goto out; 1254 goto out;
1255 } 1255 }
1256 1256
1257 call = drv->ops->add_beacon; 1257 call = rdev->ops->add_beacon;
1258 break; 1258 break;
1259 case NL80211_CMD_SET_BEACON: 1259 case NL80211_CMD_SET_BEACON:
1260 call = drv->ops->set_beacon; 1260 call = rdev->ops->set_beacon;
1261 break; 1261 break;
1262 default: 1262 default:
1263 WARN_ON(1); 1263 WARN_ON(1);
@@ -1303,10 +1303,10 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1303 goto out; 1303 goto out;
1304 } 1304 }
1305 1305
1306 err = call(&drv->wiphy, dev, &params); 1306 err = call(&rdev->wiphy, dev, &params);
1307 1307
1308 out: 1308 out:
1309 cfg80211_unlock_rdev(drv); 1309 cfg80211_unlock_rdev(rdev);
1310 dev_put(dev); 1310 dev_put(dev);
1311 unlock_rtnl: 1311 unlock_rtnl:
1312 rtnl_unlock(); 1312 rtnl_unlock();
@@ -1316,17 +1316,17 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1316 1316
1317static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info) 1317static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info)
1318{ 1318{
1319 struct cfg80211_registered_device *drv; 1319 struct cfg80211_registered_device *rdev;
1320 int err; 1320 int err;
1321 struct net_device *dev; 1321 struct net_device *dev;
1322 1322
1323 rtnl_lock(); 1323 rtnl_lock();
1324 1324
1325 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1325 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1326 if (err) 1326 if (err)
1327 goto unlock_rtnl; 1327 goto unlock_rtnl;
1328 1328
1329 if (!drv->ops->del_beacon) { 1329 if (!rdev->ops->del_beacon) {
1330 err = -EOPNOTSUPP; 1330 err = -EOPNOTSUPP;
1331 goto out; 1331 goto out;
1332 } 1332 }
@@ -1335,10 +1335,10 @@ static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info)
1335 err = -EOPNOTSUPP; 1335 err = -EOPNOTSUPP;
1336 goto out; 1336 goto out;
1337 } 1337 }
1338 err = drv->ops->del_beacon(&drv->wiphy, dev); 1338 err = rdev->ops->del_beacon(&rdev->wiphy, dev);
1339 1339
1340 out: 1340 out:
1341 cfg80211_unlock_rdev(drv); 1341 cfg80211_unlock_rdev(rdev);
1342 dev_put(dev); 1342 dev_put(dev);
1343 unlock_rtnl: 1343 unlock_rtnl:
1344 rtnl_unlock(); 1344 rtnl_unlock();
@@ -1581,7 +1581,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
1581 1581
1582static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) 1582static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1583{ 1583{
1584 struct cfg80211_registered_device *drv; 1584 struct cfg80211_registered_device *rdev;
1585 int err; 1585 int err;
1586 struct net_device *dev; 1586 struct net_device *dev;
1587 struct station_info sinfo; 1587 struct station_info sinfo;
@@ -1597,16 +1597,16 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1597 1597
1598 rtnl_lock(); 1598 rtnl_lock();
1599 1599
1600 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1600 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1601 if (err) 1601 if (err)
1602 goto out_rtnl; 1602 goto out_rtnl;
1603 1603
1604 if (!drv->ops->get_station) { 1604 if (!rdev->ops->get_station) {
1605 err = -EOPNOTSUPP; 1605 err = -EOPNOTSUPP;
1606 goto out; 1606 goto out;
1607 } 1607 }
1608 1608
1609 err = drv->ops->get_station(&drv->wiphy, dev, mac_addr, &sinfo); 1609 err = rdev->ops->get_station(&rdev->wiphy, dev, mac_addr, &sinfo);
1610 if (err) 1610 if (err)
1611 goto out; 1611 goto out;
1612 1612
@@ -1624,7 +1624,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1624 out_free: 1624 out_free:
1625 nlmsg_free(msg); 1625 nlmsg_free(msg);
1626 out: 1626 out:
1627 cfg80211_unlock_rdev(drv); 1627 cfg80211_unlock_rdev(rdev);
1628 dev_put(dev); 1628 dev_put(dev);
1629 out_rtnl: 1629 out_rtnl:
1630 rtnl_unlock(); 1630 rtnl_unlock();
@@ -1655,7 +1655,7 @@ static int get_vlan(struct nlattr *vlanattr,
1655 1655
1656static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) 1656static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1657{ 1657{
1658 struct cfg80211_registered_device *drv; 1658 struct cfg80211_registered_device *rdev;
1659 int err; 1659 int err;
1660 struct net_device *dev; 1660 struct net_device *dev;
1661 struct station_parameters params; 1661 struct station_parameters params;
@@ -1697,11 +1697,11 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1697 1697
1698 rtnl_lock(); 1698 rtnl_lock();
1699 1699
1700 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1700 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1701 if (err) 1701 if (err)
1702 goto out_rtnl; 1702 goto out_rtnl;
1703 1703
1704 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, &params.vlan); 1704 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], rdev, &params.vlan);
1705 if (err) 1705 if (err)
1706 goto out; 1706 goto out;
1707 1707
@@ -1750,17 +1750,17 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1750 if (err) 1750 if (err)
1751 goto out; 1751 goto out;
1752 1752
1753 if (!drv->ops->change_station) { 1753 if (!rdev->ops->change_station) {
1754 err = -EOPNOTSUPP; 1754 err = -EOPNOTSUPP;
1755 goto out; 1755 goto out;
1756 } 1756 }
1757 1757
1758 err = drv->ops->change_station(&drv->wiphy, dev, mac_addr, &params); 1758 err = rdev->ops->change_station(&rdev->wiphy, dev, mac_addr, &params);
1759 1759
1760 out: 1760 out:
1761 if (params.vlan) 1761 if (params.vlan)
1762 dev_put(params.vlan); 1762 dev_put(params.vlan);
1763 cfg80211_unlock_rdev(drv); 1763 cfg80211_unlock_rdev(rdev);
1764 dev_put(dev); 1764 dev_put(dev);
1765 out_rtnl: 1765 out_rtnl:
1766 rtnl_unlock(); 1766 rtnl_unlock();
@@ -1770,7 +1770,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1770 1770
1771static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) 1771static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1772{ 1772{
1773 struct cfg80211_registered_device *drv; 1773 struct cfg80211_registered_device *rdev;
1774 int err; 1774 int err;
1775 struct net_device *dev; 1775 struct net_device *dev;
1776 struct station_parameters params; 1776 struct station_parameters params;
@@ -1810,11 +1810,11 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1810 1810
1811 rtnl_lock(); 1811 rtnl_lock();
1812 1812
1813 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1813 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1814 if (err) 1814 if (err)
1815 goto out_rtnl; 1815 goto out_rtnl;
1816 1816
1817 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, &params.vlan); 1817 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], rdev, &params.vlan);
1818 if (err) 1818 if (err)
1819 goto out; 1819 goto out;
1820 1820
@@ -1850,7 +1850,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1850 if (err) 1850 if (err)
1851 goto out; 1851 goto out;
1852 1852
1853 if (!drv->ops->add_station) { 1853 if (!rdev->ops->add_station) {
1854 err = -EOPNOTSUPP; 1854 err = -EOPNOTSUPP;
1855 goto out; 1855 goto out;
1856 } 1856 }
@@ -1860,12 +1860,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1860 goto out; 1860 goto out;
1861 } 1861 }
1862 1862
1863 err = drv->ops->add_station(&drv->wiphy, dev, mac_addr, &params); 1863 err = rdev->ops->add_station(&rdev->wiphy, dev, mac_addr, &params);
1864 1864
1865 out: 1865 out:
1866 if (params.vlan) 1866 if (params.vlan)
1867 dev_put(params.vlan); 1867 dev_put(params.vlan);
1868 cfg80211_unlock_rdev(drv); 1868 cfg80211_unlock_rdev(rdev);
1869 dev_put(dev); 1869 dev_put(dev);
1870 out_rtnl: 1870 out_rtnl:
1871 rtnl_unlock(); 1871 rtnl_unlock();
@@ -1875,7 +1875,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1875 1875
1876static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) 1876static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1877{ 1877{
1878 struct cfg80211_registered_device *drv; 1878 struct cfg80211_registered_device *rdev;
1879 int err; 1879 int err;
1880 struct net_device *dev; 1880 struct net_device *dev;
1881 u8 *mac_addr = NULL; 1881 u8 *mac_addr = NULL;
@@ -1885,7 +1885,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1885 1885
1886 rtnl_lock(); 1886 rtnl_lock();
1887 1887
1888 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1888 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1889 if (err) 1889 if (err)
1890 goto out_rtnl; 1890 goto out_rtnl;
1891 1891
@@ -1896,15 +1896,15 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1896 goto out; 1896 goto out;
1897 } 1897 }
1898 1898
1899 if (!drv->ops->del_station) { 1899 if (!rdev->ops->del_station) {
1900 err = -EOPNOTSUPP; 1900 err = -EOPNOTSUPP;
1901 goto out; 1901 goto out;
1902 } 1902 }
1903 1903
1904 err = drv->ops->del_station(&drv->wiphy, dev, mac_addr); 1904 err = rdev->ops->del_station(&rdev->wiphy, dev, mac_addr);
1905 1905
1906 out: 1906 out:
1907 cfg80211_unlock_rdev(drv); 1907 cfg80211_unlock_rdev(rdev);
1908 dev_put(dev); 1908 dev_put(dev);
1909 out_rtnl: 1909 out_rtnl:
1910 rtnl_unlock(); 1910 rtnl_unlock();
@@ -2044,7 +2044,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
2044 2044
2045static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info) 2045static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2046{ 2046{
2047 struct cfg80211_registered_device *drv; 2047 struct cfg80211_registered_device *rdev;
2048 int err; 2048 int err;
2049 struct net_device *dev; 2049 struct net_device *dev;
2050 struct mpath_info pinfo; 2050 struct mpath_info pinfo;
@@ -2061,11 +2061,11 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2061 2061
2062 rtnl_lock(); 2062 rtnl_lock();
2063 2063
2064 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2064 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2065 if (err) 2065 if (err)
2066 goto out_rtnl; 2066 goto out_rtnl;
2067 2067
2068 if (!drv->ops->get_mpath) { 2068 if (!rdev->ops->get_mpath) {
2069 err = -EOPNOTSUPP; 2069 err = -EOPNOTSUPP;
2070 goto out; 2070 goto out;
2071 } 2071 }
@@ -2075,7 +2075,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2075 goto out; 2075 goto out;
2076 } 2076 }
2077 2077
2078 err = drv->ops->get_mpath(&drv->wiphy, dev, dst, next_hop, &pinfo); 2078 err = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, &pinfo);
2079 if (err) 2079 if (err)
2080 goto out; 2080 goto out;
2081 2081
@@ -2093,7 +2093,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2093 out_free: 2093 out_free:
2094 nlmsg_free(msg); 2094 nlmsg_free(msg);
2095 out: 2095 out:
2096 cfg80211_unlock_rdev(drv); 2096 cfg80211_unlock_rdev(rdev);
2097 dev_put(dev); 2097 dev_put(dev);
2098 out_rtnl: 2098 out_rtnl:
2099 rtnl_unlock(); 2099 rtnl_unlock();
@@ -2103,7 +2103,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2103 2103
2104static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info) 2104static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2105{ 2105{
2106 struct cfg80211_registered_device *drv; 2106 struct cfg80211_registered_device *rdev;
2107 int err; 2107 int err;
2108 struct net_device *dev; 2108 struct net_device *dev;
2109 u8 *dst = NULL; 2109 u8 *dst = NULL;
@@ -2120,11 +2120,11 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2120 2120
2121 rtnl_lock(); 2121 rtnl_lock();
2122 2122
2123 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2123 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2124 if (err) 2124 if (err)
2125 goto out_rtnl; 2125 goto out_rtnl;
2126 2126
2127 if (!drv->ops->change_mpath) { 2127 if (!rdev->ops->change_mpath) {
2128 err = -EOPNOTSUPP; 2128 err = -EOPNOTSUPP;
2129 goto out; 2129 goto out;
2130 } 2130 }
@@ -2139,10 +2139,10 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2139 goto out; 2139 goto out;
2140 } 2140 }
2141 2141
2142 err = drv->ops->change_mpath(&drv->wiphy, dev, dst, next_hop); 2142 err = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
2143 2143
2144 out: 2144 out:
2145 cfg80211_unlock_rdev(drv); 2145 cfg80211_unlock_rdev(rdev);
2146 dev_put(dev); 2146 dev_put(dev);
2147 out_rtnl: 2147 out_rtnl:
2148 rtnl_unlock(); 2148 rtnl_unlock();
@@ -2151,7 +2151,7 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2151} 2151}
2152static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info) 2152static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2153{ 2153{
2154 struct cfg80211_registered_device *drv; 2154 struct cfg80211_registered_device *rdev;
2155 int err; 2155 int err;
2156 struct net_device *dev; 2156 struct net_device *dev;
2157 u8 *dst = NULL; 2157 u8 *dst = NULL;
@@ -2168,11 +2168,11 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2168 2168
2169 rtnl_lock(); 2169 rtnl_lock();
2170 2170
2171 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2171 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2172 if (err) 2172 if (err)
2173 goto out_rtnl; 2173 goto out_rtnl;
2174 2174
2175 if (!drv->ops->add_mpath) { 2175 if (!rdev->ops->add_mpath) {
2176 err = -EOPNOTSUPP; 2176 err = -EOPNOTSUPP;
2177 goto out; 2177 goto out;
2178 } 2178 }
@@ -2187,10 +2187,10 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2187 goto out; 2187 goto out;
2188 } 2188 }
2189 2189
2190 err = drv->ops->add_mpath(&drv->wiphy, dev, dst, next_hop); 2190 err = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
2191 2191
2192 out: 2192 out:
2193 cfg80211_unlock_rdev(drv); 2193 cfg80211_unlock_rdev(rdev);
2194 dev_put(dev); 2194 dev_put(dev);
2195 out_rtnl: 2195 out_rtnl:
2196 rtnl_unlock(); 2196 rtnl_unlock();
@@ -2200,7 +2200,7 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2200 2200
2201static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info) 2201static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2202{ 2202{
2203 struct cfg80211_registered_device *drv; 2203 struct cfg80211_registered_device *rdev;
2204 int err; 2204 int err;
2205 struct net_device *dev; 2205 struct net_device *dev;
2206 u8 *dst = NULL; 2206 u8 *dst = NULL;
@@ -2210,19 +2210,19 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2210 2210
2211 rtnl_lock(); 2211 rtnl_lock();
2212 2212
2213 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2213 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2214 if (err) 2214 if (err)
2215 goto out_rtnl; 2215 goto out_rtnl;
2216 2216
2217 if (!drv->ops->del_mpath) { 2217 if (!rdev->ops->del_mpath) {
2218 err = -EOPNOTSUPP; 2218 err = -EOPNOTSUPP;
2219 goto out; 2219 goto out;
2220 } 2220 }
2221 2221
2222 err = drv->ops->del_mpath(&drv->wiphy, dev, dst); 2222 err = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
2223 2223
2224 out: 2224 out:
2225 cfg80211_unlock_rdev(drv); 2225 cfg80211_unlock_rdev(rdev);
2226 dev_put(dev); 2226 dev_put(dev);
2227 out_rtnl: 2227 out_rtnl:
2228 rtnl_unlock(); 2228 rtnl_unlock();
@@ -2232,7 +2232,7 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2232 2232
2233static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) 2233static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2234{ 2234{
2235 struct cfg80211_registered_device *drv; 2235 struct cfg80211_registered_device *rdev;
2236 int err; 2236 int err;
2237 struct net_device *dev; 2237 struct net_device *dev;
2238 struct bss_parameters params; 2238 struct bss_parameters params;
@@ -2261,11 +2261,11 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2261 2261
2262 rtnl_lock(); 2262 rtnl_lock();
2263 2263
2264 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2264 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2265 if (err) 2265 if (err)
2266 goto out_rtnl; 2266 goto out_rtnl;
2267 2267
2268 if (!drv->ops->change_bss) { 2268 if (!rdev->ops->change_bss) {
2269 err = -EOPNOTSUPP; 2269 err = -EOPNOTSUPP;
2270 goto out; 2270 goto out;
2271 } 2271 }
@@ -2275,10 +2275,10 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2275 goto out; 2275 goto out;
2276 } 2276 }
2277 2277
2278 err = drv->ops->change_bss(&drv->wiphy, dev, &params); 2278 err = rdev->ops->change_bss(&rdev->wiphy, dev, &params);
2279 2279
2280 out: 2280 out:
2281 cfg80211_unlock_rdev(drv); 2281 cfg80211_unlock_rdev(rdev);
2282 dev_put(dev); 2282 dev_put(dev);
2283 out_rtnl: 2283 out_rtnl:
2284 rtnl_unlock(); 2284 rtnl_unlock();
@@ -2369,7 +2369,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
2369static int nl80211_get_mesh_params(struct sk_buff *skb, 2369static int nl80211_get_mesh_params(struct sk_buff *skb,
2370 struct genl_info *info) 2370 struct genl_info *info)
2371{ 2371{
2372 struct cfg80211_registered_device *drv; 2372 struct cfg80211_registered_device *rdev;
2373 struct mesh_config cur_params; 2373 struct mesh_config cur_params;
2374 int err; 2374 int err;
2375 struct net_device *dev; 2375 struct net_device *dev;
@@ -2380,17 +2380,17 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
2380 rtnl_lock(); 2380 rtnl_lock();
2381 2381
2382 /* Look up our device */ 2382 /* Look up our device */
2383 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2383 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2384 if (err) 2384 if (err)
2385 goto out_rtnl; 2385 goto out_rtnl;
2386 2386
2387 if (!drv->ops->get_mesh_params) { 2387 if (!rdev->ops->get_mesh_params) {
2388 err = -EOPNOTSUPP; 2388 err = -EOPNOTSUPP;
2389 goto out; 2389 goto out;
2390 } 2390 }
2391 2391
2392 /* Get the mesh params */ 2392 /* Get the mesh params */
2393 err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); 2393 err = rdev->ops->get_mesh_params(&rdev->wiphy, dev, &cur_params);
2394 if (err) 2394 if (err)
2395 goto out; 2395 goto out;
2396 2396
@@ -2444,7 +2444,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
2444 err = -EMSGSIZE; 2444 err = -EMSGSIZE;
2445 out: 2445 out:
2446 /* Cleanup */ 2446 /* Cleanup */
2447 cfg80211_unlock_rdev(drv); 2447 cfg80211_unlock_rdev(rdev);
2448 dev_put(dev); 2448 dev_put(dev);
2449 out_rtnl: 2449 out_rtnl:
2450 rtnl_unlock(); 2450 rtnl_unlock();
@@ -2482,7 +2482,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2482{ 2482{
2483 int err; 2483 int err;
2484 u32 mask; 2484 u32 mask;
2485 struct cfg80211_registered_device *drv; 2485 struct cfg80211_registered_device *rdev;
2486 struct net_device *dev; 2486 struct net_device *dev;
2487 struct mesh_config cfg; 2487 struct mesh_config cfg;
2488 struct nlattr *tb[NL80211_MESHCONF_ATTR_MAX + 1]; 2488 struct nlattr *tb[NL80211_MESHCONF_ATTR_MAX + 1];
@@ -2497,11 +2497,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2497 2497
2498 rtnl_lock(); 2498 rtnl_lock();
2499 2499
2500 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2500 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2501 if (err) 2501 if (err)
2502 goto out_rtnl; 2502 goto out_rtnl;
2503 2503
2504 if (!drv->ops->set_mesh_params) { 2504 if (!rdev->ops->set_mesh_params) {
2505 err = -EOPNOTSUPP; 2505 err = -EOPNOTSUPP;
2506 goto out; 2506 goto out;
2507 } 2507 }
@@ -2546,11 +2546,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2546 nla_get_u16); 2546 nla_get_u16);
2547 2547
2548 /* Apply changes */ 2548 /* Apply changes */
2549 err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); 2549 err = rdev->ops->set_mesh_params(&rdev->wiphy, dev, &cfg, mask);
2550 2550
2551 out: 2551 out:
2552 /* cleanup */ 2552 /* cleanup */
2553 cfg80211_unlock_rdev(drv); 2553 cfg80211_unlock_rdev(rdev);
2554 dev_put(dev); 2554 dev_put(dev);
2555 out_rtnl: 2555 out_rtnl:
2556 rtnl_unlock(); 2556 rtnl_unlock();
@@ -2737,7 +2737,7 @@ static int validate_scan_freqs(struct nlattr *freqs)
2737 2737
2738static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) 2738static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2739{ 2739{
2740 struct cfg80211_registered_device *drv; 2740 struct cfg80211_registered_device *rdev;
2741 struct net_device *dev; 2741 struct net_device *dev;
2742 struct cfg80211_scan_request *request; 2742 struct cfg80211_scan_request *request;
2743 struct cfg80211_ssid *ssid; 2743 struct cfg80211_ssid *ssid;
@@ -2753,13 +2753,13 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2753 2753
2754 rtnl_lock(); 2754 rtnl_lock();
2755 2755
2756 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2756 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2757 if (err) 2757 if (err)
2758 goto out_rtnl; 2758 goto out_rtnl;
2759 2759
2760 wiphy = &drv->wiphy; 2760 wiphy = &rdev->wiphy;
2761 2761
2762 if (!drv->ops->scan) { 2762 if (!rdev->ops->scan) {
2763 err = -EOPNOTSUPP; 2763 err = -EOPNOTSUPP;
2764 goto out; 2764 goto out;
2765 } 2765 }
@@ -2769,7 +2769,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2769 goto out; 2769 goto out;
2770 } 2770 }
2771 2771
2772 if (drv->scan_req) { 2772 if (rdev->scan_req) {
2773 err = -EBUSY; 2773 err = -EBUSY;
2774 goto out; 2774 goto out;
2775 } 2775 }
@@ -2876,21 +2876,21 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2876 } 2876 }
2877 2877
2878 request->ifidx = dev->ifindex; 2878 request->ifidx = dev->ifindex;
2879 request->wiphy = &drv->wiphy; 2879 request->wiphy = &rdev->wiphy;
2880 2880
2881 drv->scan_req = request; 2881 rdev->scan_req = request;
2882 err = drv->ops->scan(&drv->wiphy, dev, request); 2882 err = rdev->ops->scan(&rdev->wiphy, dev, request);
2883 2883
2884 if (!err) 2884 if (!err)
2885 nl80211_send_scan_start(drv, dev); 2885 nl80211_send_scan_start(rdev, dev);
2886 2886
2887 out_free: 2887 out_free:
2888 if (err) { 2888 if (err) {
2889 drv->scan_req = NULL; 2889 rdev->scan_req = NULL;
2890 kfree(request); 2890 kfree(request);
2891 } 2891 }
2892 out: 2892 out:
2893 cfg80211_unlock_rdev(drv); 2893 cfg80211_unlock_rdev(rdev);
2894 dev_put(dev); 2894 dev_put(dev);
2895 out_rtnl: 2895 out_rtnl:
2896 rtnl_unlock(); 2896 rtnl_unlock();
@@ -3043,7 +3043,7 @@ static bool nl80211_valid_cipher_suite(u32 cipher)
3043 3043
3044static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info) 3044static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3045{ 3045{
3046 struct cfg80211_registered_device *drv; 3046 struct cfg80211_registered_device *rdev;
3047 struct net_device *dev; 3047 struct net_device *dev;
3048 struct ieee80211_channel *chan; 3048 struct ieee80211_channel *chan;
3049 const u8 *bssid, *ssid, *ie = NULL; 3049 const u8 *bssid, *ssid, *ie = NULL;
@@ -3067,11 +3067,11 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3067 3067
3068 rtnl_lock(); 3068 rtnl_lock();
3069 3069
3070 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3070 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3071 if (err) 3071 if (err)
3072 goto unlock_rtnl; 3072 goto unlock_rtnl;
3073 3073
3074 if (!drv->ops->auth) { 3074 if (!rdev->ops->auth) {
3075 err = -EOPNOTSUPP; 3075 err = -EOPNOTSUPP;
3076 goto out; 3076 goto out;
3077 } 3077 }
@@ -3087,7 +3087,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3087 } 3087 }
3088 3088
3089 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 3089 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
3090 chan = ieee80211_get_channel(&drv->wiphy, 3090 chan = ieee80211_get_channel(&rdev->wiphy,
3091 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); 3091 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
3092 if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED)) { 3092 if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED)) {
3093 err = -EINVAL; 3093 err = -EINVAL;
@@ -3108,11 +3108,11 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3108 goto out; 3108 goto out;
3109 } 3109 }
3110 3110
3111 err = cfg80211_mlme_auth(drv, dev, chan, auth_type, bssid, 3111 err = cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
3112 ssid, ssid_len, ie, ie_len); 3112 ssid, ssid_len, ie, ie_len);
3113 3113
3114out: 3114out:
3115 cfg80211_unlock_rdev(drv); 3115 cfg80211_unlock_rdev(rdev);
3116 dev_put(dev); 3116 dev_put(dev);
3117unlock_rtnl: 3117unlock_rtnl:
3118 rtnl_unlock(); 3118 rtnl_unlock();
@@ -3202,7 +3202,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
3202 3202
3203 rtnl_lock(); 3203 rtnl_lock();
3204 3204
3205 err = get_drv_dev_by_info_ifindex(info->attrs, &rdev, &dev); 3205 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3206 if (err) 3206 if (err)
3207 goto unlock_rtnl; 3207 goto unlock_rtnl;
3208 3208
@@ -3268,7 +3268,7 @@ unlock_rtnl:
3268 3268
3269static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info) 3269static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3270{ 3270{
3271 struct cfg80211_registered_device *drv; 3271 struct cfg80211_registered_device *rdev;
3272 struct net_device *dev; 3272 struct net_device *dev;
3273 const u8 *ie = NULL, *bssid; 3273 const u8 *ie = NULL, *bssid;
3274 int err, ie_len = 0; 3274 int err, ie_len = 0;
@@ -3285,11 +3285,11 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3285 3285
3286 rtnl_lock(); 3286 rtnl_lock();
3287 3287
3288 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3288 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3289 if (err) 3289 if (err)
3290 goto unlock_rtnl; 3290 goto unlock_rtnl;
3291 3291
3292 if (!drv->ops->deauth) { 3292 if (!rdev->ops->deauth) {
3293 err = -EOPNOTSUPP; 3293 err = -EOPNOTSUPP;
3294 goto out; 3294 goto out;
3295 } 3295 }
@@ -3318,10 +3318,10 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3318 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); 3318 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
3319 } 3319 }
3320 3320
3321 err = cfg80211_mlme_deauth(drv, dev, bssid, ie, ie_len, reason_code); 3321 err = cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code);
3322 3322
3323out: 3323out:
3324 cfg80211_unlock_rdev(drv); 3324 cfg80211_unlock_rdev(rdev);
3325 dev_put(dev); 3325 dev_put(dev);
3326unlock_rtnl: 3326unlock_rtnl:
3327 rtnl_unlock(); 3327 rtnl_unlock();
@@ -3330,7 +3330,7 @@ unlock_rtnl:
3330 3330
3331static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info) 3331static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3332{ 3332{
3333 struct cfg80211_registered_device *drv; 3333 struct cfg80211_registered_device *rdev;
3334 struct net_device *dev; 3334 struct net_device *dev;
3335 const u8 *ie = NULL, *bssid; 3335 const u8 *ie = NULL, *bssid;
3336 int err, ie_len = 0; 3336 int err, ie_len = 0;
@@ -3347,11 +3347,11 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3347 3347
3348 rtnl_lock(); 3348 rtnl_lock();
3349 3349
3350 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3350 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3351 if (err) 3351 if (err)
3352 goto unlock_rtnl; 3352 goto unlock_rtnl;
3353 3353
3354 if (!drv->ops->disassoc) { 3354 if (!rdev->ops->disassoc) {
3355 err = -EOPNOTSUPP; 3355 err = -EOPNOTSUPP;
3356 goto out; 3356 goto out;
3357 } 3357 }
@@ -3380,10 +3380,10 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3380 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); 3380 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
3381 } 3381 }
3382 3382
3383 err = cfg80211_mlme_disassoc(drv, dev, bssid, ie, ie_len, reason_code); 3383 err = cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code);
3384 3384
3385out: 3385out:
3386 cfg80211_unlock_rdev(drv); 3386 cfg80211_unlock_rdev(rdev);
3387 dev_put(dev); 3387 dev_put(dev);
3388unlock_rtnl: 3388unlock_rtnl:
3389 rtnl_unlock(); 3389 rtnl_unlock();
@@ -3392,7 +3392,7 @@ unlock_rtnl:
3392 3392
3393static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) 3393static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3394{ 3394{
3395 struct cfg80211_registered_device *drv; 3395 struct cfg80211_registered_device *rdev;
3396 struct net_device *dev; 3396 struct net_device *dev;
3397 struct cfg80211_ibss_params ibss; 3397 struct cfg80211_ibss_params ibss;
3398 struct wiphy *wiphy; 3398 struct wiphy *wiphy;
@@ -3419,11 +3419,11 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3419 3419
3420 rtnl_lock(); 3420 rtnl_lock();
3421 3421
3422 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3422 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3423 if (err) 3423 if (err)
3424 goto unlock_rtnl; 3424 goto unlock_rtnl;
3425 3425
3426 if (!drv->ops->join_ibss) { 3426 if (!rdev->ops->join_ibss) {
3427 err = -EOPNOTSUPP; 3427 err = -EOPNOTSUPP;
3428 goto out; 3428 goto out;
3429 } 3429 }
@@ -3438,7 +3438,7 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3438 goto out; 3438 goto out;
3439 } 3439 }
3440 3440
3441 wiphy = &drv->wiphy; 3441 wiphy = &rdev->wiphy;
3442 3442
3443 if (info->attrs[NL80211_ATTR_MAC]) 3443 if (info->attrs[NL80211_ATTR_MAC])
3444 ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 3444 ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
@@ -3461,10 +3461,10 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3461 3461
3462 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED]; 3462 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
3463 3463
3464 err = cfg80211_join_ibss(drv, dev, &ibss); 3464 err = cfg80211_join_ibss(rdev, dev, &ibss);
3465 3465
3466out: 3466out:
3467 cfg80211_unlock_rdev(drv); 3467 cfg80211_unlock_rdev(rdev);
3468 dev_put(dev); 3468 dev_put(dev);
3469unlock_rtnl: 3469unlock_rtnl:
3470 rtnl_unlock(); 3470 rtnl_unlock();
@@ -3473,17 +3473,17 @@ unlock_rtnl:
3473 3473
3474static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info) 3474static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info)
3475{ 3475{
3476 struct cfg80211_registered_device *drv; 3476 struct cfg80211_registered_device *rdev;
3477 struct net_device *dev; 3477 struct net_device *dev;
3478 int err; 3478 int err;
3479 3479
3480 rtnl_lock(); 3480 rtnl_lock();
3481 3481
3482 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3482 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3483 if (err) 3483 if (err)
3484 goto unlock_rtnl; 3484 goto unlock_rtnl;
3485 3485
3486 if (!drv->ops->leave_ibss) { 3486 if (!rdev->ops->leave_ibss) {
3487 err = -EOPNOTSUPP; 3487 err = -EOPNOTSUPP;
3488 goto out; 3488 goto out;
3489 } 3489 }
@@ -3498,10 +3498,10 @@ static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info)
3498 goto out; 3498 goto out;
3499 } 3499 }
3500 3500
3501 err = cfg80211_leave_ibss(drv, dev, false); 3501 err = cfg80211_leave_ibss(rdev, dev, false);
3502 3502
3503out: 3503out:
3504 cfg80211_unlock_rdev(drv); 3504 cfg80211_unlock_rdev(rdev);
3505 dev_put(dev); 3505 dev_put(dev);
3506unlock_rtnl: 3506unlock_rtnl:
3507 rtnl_unlock(); 3507 rtnl_unlock();
@@ -3632,7 +3632,7 @@ EXPORT_SYMBOL(cfg80211_testmode_event);
3632 3632
3633static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) 3633static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3634{ 3634{
3635 struct cfg80211_registered_device *drv; 3635 struct cfg80211_registered_device *rdev;
3636 struct net_device *dev; 3636 struct net_device *dev;
3637 struct cfg80211_connect_params connect; 3637 struct cfg80211_connect_params connect;
3638 struct wiphy *wiphy; 3638 struct wiphy *wiphy;
@@ -3663,7 +3663,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3663 return err; 3663 return err;
3664 rtnl_lock(); 3664 rtnl_lock();
3665 3665
3666 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3666 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3667 if (err) 3667 if (err)
3668 goto unlock_rtnl; 3668 goto unlock_rtnl;
3669 3669
@@ -3677,7 +3677,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3677 goto out; 3677 goto out;
3678 } 3678 }
3679 3679
3680 wiphy = &drv->wiphy; 3680 wiphy = &rdev->wiphy;
3681 3681
3682 connect.bssid = NULL; 3682 connect.bssid = NULL;
3683 connect.channel = NULL; 3683 connect.channel = NULL;
@@ -3704,10 +3704,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3704 } 3704 }
3705 } 3705 }
3706 3706
3707 err = cfg80211_connect(drv, dev, &connect); 3707 err = cfg80211_connect(rdev, dev, &connect);
3708 3708
3709out: 3709out:
3710 cfg80211_unlock_rdev(drv); 3710 cfg80211_unlock_rdev(rdev);
3711 dev_put(dev); 3711 dev_put(dev);
3712unlock_rtnl: 3712unlock_rtnl:
3713 rtnl_unlock(); 3713 rtnl_unlock();
@@ -3716,7 +3716,7 @@ unlock_rtnl:
3716 3716
3717static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info) 3717static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3718{ 3718{
3719 struct cfg80211_registered_device *drv; 3719 struct cfg80211_registered_device *rdev;
3720 struct net_device *dev; 3720 struct net_device *dev;
3721 int err; 3721 int err;
3722 u16 reason; 3722 u16 reason;
@@ -3731,7 +3731,7 @@ static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3731 3731
3732 rtnl_lock(); 3732 rtnl_lock();
3733 3733
3734 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3734 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3735 if (err) 3735 if (err)
3736 goto unlock_rtnl; 3736 goto unlock_rtnl;
3737 3737
@@ -3745,10 +3745,10 @@ static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3745 goto out; 3745 goto out;
3746 } 3746 }
3747 3747
3748 err = cfg80211_disconnect(drv, dev, reason, true); 3748 err = cfg80211_disconnect(rdev, dev, reason, true);
3749 3749
3750out: 3750out:
3751 cfg80211_unlock_rdev(drv); 3751 cfg80211_unlock_rdev(rdev);
3752 dev_put(dev); 3752 dev_put(dev);
3753unlock_rtnl: 3753unlock_rtnl:
3754 rtnl_unlock(); 3754 rtnl_unlock();