diff options
author | Javier Cardona <javier@cozybit.com> | 2010-12-16 20:37:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-20 14:46:57 -0500 |
commit | 24bdd9f4c9af75b33b438d60381a67626de0128d (patch) | |
tree | f5ff8c4f9ec2a7cdb976f419532179f2c46b06e8 | |
parent | 8a09d6d80c90c02f2f8c89f69c702cab0c8d9b42 (diff) |
mac80211: Rename mesh_params to mesh_config to prepare for mesh_setup
Mesh parameters can be to setup a mesh or to configure it.
This patch renames the ambiguous name mesh_params to mesh_config
in preparation for mesh_setup.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/linux/nl80211.h | 15 | ||||
-rw-r--r-- | include/net/cfg80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 8 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 40 |
4 files changed, 38 insertions, 33 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 7483a89cee8f..11a1de67b618 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -172,10 +172,10 @@ | |||
172 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will | 172 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will |
173 | * store this as a valid request and then query userspace for it. | 173 | * store this as a valid request and then query userspace for it. |
174 | * | 174 | * |
175 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | 175 | * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the |
176 | * interface identified by %NL80211_ATTR_IFINDEX | 176 | * interface identified by %NL80211_ATTR_IFINDEX |
177 | * | 177 | * |
178 | * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the | 178 | * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the |
179 | * interface identified by %NL80211_ATTR_IFINDEX | 179 | * interface identified by %NL80211_ATTR_IFINDEX |
180 | * | 180 | * |
181 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The | 181 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The |
@@ -448,8 +448,8 @@ enum nl80211_commands { | |||
448 | NL80211_CMD_SET_REG, | 448 | NL80211_CMD_SET_REG, |
449 | NL80211_CMD_REQ_SET_REG, | 449 | NL80211_CMD_REQ_SET_REG, |
450 | 450 | ||
451 | NL80211_CMD_GET_MESH_PARAMS, | 451 | NL80211_CMD_GET_MESH_CONFIG, |
452 | NL80211_CMD_SET_MESH_PARAMS, | 452 | NL80211_CMD_SET_MESH_CONFIG, |
453 | 453 | ||
454 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, | 454 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, |
455 | 455 | ||
@@ -538,6 +538,10 @@ enum nl80211_commands { | |||
538 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE | 538 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE |
539 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT | 539 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT |
540 | 540 | ||
541 | /* source-level API compatibility */ | ||
542 | #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG | ||
543 | #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG | ||
544 | |||
541 | /** | 545 | /** |
542 | * enum nl80211_attrs - nl80211 netlink attributes | 546 | * enum nl80211_attrs - nl80211 netlink attributes |
543 | * | 547 | * |
@@ -922,7 +926,7 @@ enum nl80211_attrs { | |||
922 | NL80211_ATTR_REG_ALPHA2, | 926 | NL80211_ATTR_REG_ALPHA2, |
923 | NL80211_ATTR_REG_RULES, | 927 | NL80211_ATTR_REG_RULES, |
924 | 928 | ||
925 | NL80211_ATTR_MESH_PARAMS, | 929 | NL80211_ATTR_MESH_CONFIG, |
926 | 930 | ||
927 | NL80211_ATTR_BSS_BASIC_RATES, | 931 | NL80211_ATTR_BSS_BASIC_RATES, |
928 | 932 | ||
@@ -1058,6 +1062,7 @@ enum nl80211_attrs { | |||
1058 | 1062 | ||
1059 | /* source-level API compatibility */ | 1063 | /* source-level API compatibility */ |
1060 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | 1064 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION |
1065 | #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG | ||
1061 | 1066 | ||
1062 | /* | 1067 | /* |
1063 | * Allow user space programs to use #ifdef on new attributes by defining them | 1068 | * Allow user space programs to use #ifdef on new attributes by defining them |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6dc665a727c2..7283496c2d05 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1096,9 +1096,9 @@ struct cfg80211_pmksa { | |||
1096 | * @get_mpath: get a mesh path for the given parameters | 1096 | * @get_mpath: get a mesh path for the given parameters |
1097 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | 1097 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx |
1098 | * | 1098 | * |
1099 | * @get_mesh_params: Put the current mesh parameters into *params | 1099 | * @get_mesh_config: Get the current mesh configuration |
1100 | * | 1100 | * |
1101 | * @update_mesh_params: Update mesh parameters on a running mesh. | 1101 | * @update_mesh_config: Update mesh parameters on a running mesh. |
1102 | * The mask is a bitfield which tells us which parameters to | 1102 | * The mask is a bitfield which tells us which parameters to |
1103 | * set, and which to leave alone. | 1103 | * set, and which to leave alone. |
1104 | * | 1104 | * |
@@ -1246,10 +1246,10 @@ struct cfg80211_ops { | |||
1246 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 1246 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
1247 | int idx, u8 *dst, u8 *next_hop, | 1247 | int idx, u8 *dst, u8 *next_hop, |
1248 | struct mpath_info *pinfo); | 1248 | struct mpath_info *pinfo); |
1249 | int (*get_mesh_params)(struct wiphy *wiphy, | 1249 | int (*get_mesh_config)(struct wiphy *wiphy, |
1250 | struct net_device *dev, | 1250 | struct net_device *dev, |
1251 | struct mesh_config *conf); | 1251 | struct mesh_config *conf); |
1252 | int (*update_mesh_params)(struct wiphy *wiphy, | 1252 | int (*update_mesh_config)(struct wiphy *wiphy, |
1253 | struct net_device *dev, u32 mask, | 1253 | struct net_device *dev, u32 mask, |
1254 | const struct mesh_config *nconf); | 1254 | const struct mesh_config *nconf); |
1255 | int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev, | 1255 | int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev, |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ea06f92801e9..1c94a2ae22ee 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -984,7 +984,7 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
984 | return 0; | 984 | return 0; |
985 | } | 985 | } |
986 | 986 | ||
987 | static int ieee80211_get_mesh_params(struct wiphy *wiphy, | 987 | static int ieee80211_get_mesh_config(struct wiphy *wiphy, |
988 | struct net_device *dev, | 988 | struct net_device *dev, |
989 | struct mesh_config *conf) | 989 | struct mesh_config *conf) |
990 | { | 990 | { |
@@ -1000,7 +1000,7 @@ static inline bool _chg_mesh_attr(enum nl80211_meshconf_params parm, u32 mask) | |||
1000 | return (mask >> (parm-1)) & 0x1; | 1000 | return (mask >> (parm-1)) & 0x1; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | static int ieee80211_update_mesh_params(struct wiphy *wiphy, | 1003 | static int ieee80211_update_mesh_config(struct wiphy *wiphy, |
1004 | struct net_device *dev, u32 mask, | 1004 | struct net_device *dev, u32 mask, |
1005 | const struct mesh_config *nconf) | 1005 | const struct mesh_config *nconf) |
1006 | { | 1006 | { |
@@ -1787,8 +1787,8 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1787 | .change_mpath = ieee80211_change_mpath, | 1787 | .change_mpath = ieee80211_change_mpath, |
1788 | .get_mpath = ieee80211_get_mpath, | 1788 | .get_mpath = ieee80211_get_mpath, |
1789 | .dump_mpath = ieee80211_dump_mpath, | 1789 | .dump_mpath = ieee80211_dump_mpath, |
1790 | .update_mesh_params = ieee80211_update_mesh_params, | 1790 | .update_mesh_config = ieee80211_update_mesh_config, |
1791 | .get_mesh_params = ieee80211_get_mesh_params, | 1791 | .get_mesh_config = ieee80211_get_mesh_config, |
1792 | .join_mesh = ieee80211_join_mesh, | 1792 | .join_mesh = ieee80211_join_mesh, |
1793 | .leave_mesh = ieee80211_leave_mesh, | 1793 | .leave_mesh = ieee80211_leave_mesh, |
1794 | #endif | 1794 | #endif |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index aefce54d47e2..10be9350752e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -123,7 +123,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
123 | .len = NL80211_MAX_SUPP_RATES }, | 123 | .len = NL80211_MAX_SUPP_RATES }, |
124 | [NL80211_ATTR_BSS_HT_OPMODE] = { .type = NLA_U16 }, | 124 | [NL80211_ATTR_BSS_HT_OPMODE] = { .type = NLA_U16 }, |
125 | 125 | ||
126 | [NL80211_ATTR_MESH_PARAMS] = { .type = NLA_NESTED }, | 126 | [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, |
127 | 127 | ||
128 | [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY, | 128 | [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY, |
129 | .len = NL80211_HT_CAPABILITY_LEN }, | 129 | .len = NL80211_HT_CAPABILITY_LEN }, |
@@ -719,7 +719,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
719 | CMD(add_beacon, NEW_BEACON); | 719 | CMD(add_beacon, NEW_BEACON); |
720 | CMD(add_station, NEW_STATION); | 720 | CMD(add_station, NEW_STATION); |
721 | CMD(add_mpath, NEW_MPATH); | 721 | CMD(add_mpath, NEW_MPATH); |
722 | CMD(update_mesh_params, SET_MESH_PARAMS); | 722 | CMD(update_mesh_config, SET_MESH_CONFIG); |
723 | CMD(change_bss, SET_BSS); | 723 | CMD(change_bss, SET_BSS); |
724 | CMD(auth, AUTHENTICATE); | 724 | CMD(auth, AUTHENTICATE); |
725 | CMD(assoc, ASSOCIATE); | 725 | CMD(assoc, ASSOCIATE); |
@@ -2673,7 +2673,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info) | |||
2673 | return r; | 2673 | return r; |
2674 | } | 2674 | } |
2675 | 2675 | ||
2676 | static int nl80211_get_mesh_params(struct sk_buff *skb, | 2676 | static int nl80211_get_mesh_config(struct sk_buff *skb, |
2677 | struct genl_info *info) | 2677 | struct genl_info *info) |
2678 | { | 2678 | { |
2679 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 2679 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
@@ -2688,7 +2688,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb, | |||
2688 | if (wdev->iftype != NL80211_IFTYPE_MESH_POINT) | 2688 | if (wdev->iftype != NL80211_IFTYPE_MESH_POINT) |
2689 | return -EOPNOTSUPP; | 2689 | return -EOPNOTSUPP; |
2690 | 2690 | ||
2691 | if (!rdev->ops->get_mesh_params) | 2691 | if (!rdev->ops->get_mesh_config) |
2692 | return -EOPNOTSUPP; | 2692 | return -EOPNOTSUPP; |
2693 | 2693 | ||
2694 | wdev_lock(wdev); | 2694 | wdev_lock(wdev); |
@@ -2696,7 +2696,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb, | |||
2696 | if (!wdev->mesh_id_len) | 2696 | if (!wdev->mesh_id_len) |
2697 | memcpy(&cur_params, &default_mesh_config, sizeof(cur_params)); | 2697 | memcpy(&cur_params, &default_mesh_config, sizeof(cur_params)); |
2698 | else | 2698 | else |
2699 | err = rdev->ops->get_mesh_params(&rdev->wiphy, dev, | 2699 | err = rdev->ops->get_mesh_config(&rdev->wiphy, dev, |
2700 | &cur_params); | 2700 | &cur_params); |
2701 | wdev_unlock(wdev); | 2701 | wdev_unlock(wdev); |
2702 | 2702 | ||
@@ -2708,10 +2708,10 @@ static int nl80211_get_mesh_params(struct sk_buff *skb, | |||
2708 | if (!msg) | 2708 | if (!msg) |
2709 | return -ENOMEM; | 2709 | return -ENOMEM; |
2710 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 2710 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, |
2711 | NL80211_CMD_GET_MESH_PARAMS); | 2711 | NL80211_CMD_GET_MESH_CONFIG); |
2712 | if (!hdr) | 2712 | if (!hdr) |
2713 | goto nla_put_failure; | 2713 | goto nla_put_failure; |
2714 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_PARAMS); | 2714 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_CONFIG); |
2715 | if (!pinfoattr) | 2715 | if (!pinfoattr) |
2716 | goto nla_put_failure; | 2716 | goto nla_put_failure; |
2717 | NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex); | 2717 | NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex); |
@@ -2773,7 +2773,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A | |||
2773 | [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 }, | 2773 | [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 }, |
2774 | }; | 2774 | }; |
2775 | 2775 | ||
2776 | static int nl80211_parse_mesh_params(struct genl_info *info, | 2776 | static int nl80211_parse_mesh_config(struct genl_info *info, |
2777 | struct mesh_config *cfg, | 2777 | struct mesh_config *cfg, |
2778 | u32 *mask_out) | 2778 | u32 *mask_out) |
2779 | { | 2779 | { |
@@ -2789,10 +2789,10 @@ do {\ | |||
2789 | } while (0);\ | 2789 | } while (0);\ |
2790 | 2790 | ||
2791 | 2791 | ||
2792 | if (!info->attrs[NL80211_ATTR_MESH_PARAMS]) | 2792 | if (!info->attrs[NL80211_ATTR_MESH_CONFIG]) |
2793 | return -EINVAL; | 2793 | return -EINVAL; |
2794 | if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX, | 2794 | if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX, |
2795 | info->attrs[NL80211_ATTR_MESH_PARAMS], | 2795 | info->attrs[NL80211_ATTR_MESH_CONFIG], |
2796 | nl80211_meshconf_params_policy)) | 2796 | nl80211_meshconf_params_policy)) |
2797 | return -EINVAL; | 2797 | return -EINVAL; |
2798 | 2798 | ||
@@ -2847,7 +2847,7 @@ do {\ | |||
2847 | #undef FILL_IN_MESH_PARAM_IF_SET | 2847 | #undef FILL_IN_MESH_PARAM_IF_SET |
2848 | } | 2848 | } |
2849 | 2849 | ||
2850 | static int nl80211_update_mesh_params(struct sk_buff *skb, | 2850 | static int nl80211_update_mesh_config(struct sk_buff *skb, |
2851 | struct genl_info *info) | 2851 | struct genl_info *info) |
2852 | { | 2852 | { |
2853 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 2853 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
@@ -2860,10 +2860,10 @@ static int nl80211_update_mesh_params(struct sk_buff *skb, | |||
2860 | if (wdev->iftype != NL80211_IFTYPE_MESH_POINT) | 2860 | if (wdev->iftype != NL80211_IFTYPE_MESH_POINT) |
2861 | return -EOPNOTSUPP; | 2861 | return -EOPNOTSUPP; |
2862 | 2862 | ||
2863 | if (!rdev->ops->update_mesh_params) | 2863 | if (!rdev->ops->update_mesh_config) |
2864 | return -EOPNOTSUPP; | 2864 | return -EOPNOTSUPP; |
2865 | 2865 | ||
2866 | err = nl80211_parse_mesh_params(info, &cfg, &mask); | 2866 | err = nl80211_parse_mesh_config(info, &cfg, &mask); |
2867 | if (err) | 2867 | if (err) |
2868 | return err; | 2868 | return err; |
2869 | 2869 | ||
@@ -2872,7 +2872,7 @@ static int nl80211_update_mesh_params(struct sk_buff *skb, | |||
2872 | err = -ENOLINK; | 2872 | err = -ENOLINK; |
2873 | 2873 | ||
2874 | if (!err) | 2874 | if (!err) |
2875 | err = rdev->ops->update_mesh_params(&rdev->wiphy, dev, | 2875 | err = rdev->ops->update_mesh_config(&rdev->wiphy, dev, |
2876 | mask, &cfg); | 2876 | mask, &cfg); |
2877 | 2877 | ||
2878 | wdev_unlock(wdev); | 2878 | wdev_unlock(wdev); |
@@ -4672,9 +4672,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) | |||
4672 | /* start with default */ | 4672 | /* start with default */ |
4673 | memcpy(&cfg, &default_mesh_config, sizeof(cfg)); | 4673 | memcpy(&cfg, &default_mesh_config, sizeof(cfg)); |
4674 | 4674 | ||
4675 | if (info->attrs[NL80211_ATTR_MESH_PARAMS]) { | 4675 | if (info->attrs[NL80211_ATTR_MESH_CONFIG]) { |
4676 | /* and parse parameters if given */ | 4676 | /* and parse parameters if given */ |
4677 | err = nl80211_parse_mesh_params(info, &cfg, NULL); | 4677 | err = nl80211_parse_mesh_config(info, &cfg, NULL); |
4678 | if (err) | 4678 | if (err) |
4679 | return err; | 4679 | return err; |
4680 | } | 4680 | } |
@@ -4952,16 +4952,16 @@ static struct genl_ops nl80211_ops[] = { | |||
4952 | .flags = GENL_ADMIN_PERM, | 4952 | .flags = GENL_ADMIN_PERM, |
4953 | }, | 4953 | }, |
4954 | { | 4954 | { |
4955 | .cmd = NL80211_CMD_GET_MESH_PARAMS, | 4955 | .cmd = NL80211_CMD_GET_MESH_CONFIG, |
4956 | .doit = nl80211_get_mesh_params, | 4956 | .doit = nl80211_get_mesh_config, |
4957 | .policy = nl80211_policy, | 4957 | .policy = nl80211_policy, |
4958 | /* can be retrieved by unprivileged users */ | 4958 | /* can be retrieved by unprivileged users */ |
4959 | .internal_flags = NL80211_FLAG_NEED_NETDEV | | 4959 | .internal_flags = NL80211_FLAG_NEED_NETDEV | |
4960 | NL80211_FLAG_NEED_RTNL, | 4960 | NL80211_FLAG_NEED_RTNL, |
4961 | }, | 4961 | }, |
4962 | { | 4962 | { |
4963 | .cmd = NL80211_CMD_SET_MESH_PARAMS, | 4963 | .cmd = NL80211_CMD_SET_MESH_CONFIG, |
4964 | .doit = nl80211_update_mesh_params, | 4964 | .doit = nl80211_update_mesh_config, |
4965 | .policy = nl80211_policy, | 4965 | .policy = nl80211_policy, |
4966 | .flags = GENL_ADMIN_PERM, | 4966 | .flags = GENL_ADMIN_PERM, |
4967 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | | 4967 | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | |