diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-07 16:12:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-10 15:30:41 -0400 |
commit | 15e473046cb6e5d18a4d0057e61d76315230382b (patch) | |
tree | 893d2df5d46a6ce156933ac57a1398f0ad22b889 /net/wireless | |
parent | 9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (diff) |
netlink: Rename pid to portid to avoid confusion
It is a frequent mistake to confuse the netlink port identifier with a
process identifier. Try to reduce this confusion by renaming fields
that hold port identifiers portid instead of pid.
I have carefully avoided changing the structures exported to
userspace to avoid changing the userspace API.
I have successfully built an allyesconfig kernel with this change.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.h | 2 | ||||
-rw-r--r-- | net/wireless/mlme.c | 16 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 110 |
3 files changed, 64 insertions, 64 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h index bc7430b54771..a343be4a52bd 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -55,7 +55,7 @@ struct cfg80211_registered_device { | |||
55 | int opencount; /* also protected by devlist_mtx */ | 55 | int opencount; /* also protected by devlist_mtx */ |
56 | wait_queue_head_t dev_wait; | 56 | wait_queue_head_t dev_wait; |
57 | 57 | ||
58 | u32 ap_beacons_nlpid; | 58 | u32 ap_beacons_nlportid; |
59 | 59 | ||
60 | /* protected by RTNL only */ | 60 | /* protected by RTNL only */ |
61 | int num_running_ifaces; | 61 | int num_running_ifaces; |
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 8fd0242ee169..ec7fcee5bad6 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -615,7 +615,7 @@ EXPORT_SYMBOL(cfg80211_del_sta); | |||
615 | struct cfg80211_mgmt_registration { | 615 | struct cfg80211_mgmt_registration { |
616 | struct list_head list; | 616 | struct list_head list; |
617 | 617 | ||
618 | u32 nlpid; | 618 | u32 nlportid; |
619 | 619 | ||
620 | int match_len; | 620 | int match_len; |
621 | 621 | ||
@@ -624,7 +624,7 @@ struct cfg80211_mgmt_registration { | |||
624 | u8 match[]; | 624 | u8 match[]; |
625 | }; | 625 | }; |
626 | 626 | ||
627 | int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid, | 627 | int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, |
628 | u16 frame_type, const u8 *match_data, | 628 | u16 frame_type, const u8 *match_data, |
629 | int match_len) | 629 | int match_len) |
630 | { | 630 | { |
@@ -672,7 +672,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid, | |||
672 | 672 | ||
673 | memcpy(nreg->match, match_data, match_len); | 673 | memcpy(nreg->match, match_data, match_len); |
674 | nreg->match_len = match_len; | 674 | nreg->match_len = match_len; |
675 | nreg->nlpid = snd_pid; | 675 | nreg->nlportid = snd_portid; |
676 | nreg->frame_type = cpu_to_le16(frame_type); | 676 | nreg->frame_type = cpu_to_le16(frame_type); |
677 | list_add(&nreg->list, &wdev->mgmt_registrations); | 677 | list_add(&nreg->list, &wdev->mgmt_registrations); |
678 | 678 | ||
@@ -685,7 +685,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid, | |||
685 | return err; | 685 | return err; |
686 | } | 686 | } |
687 | 687 | ||
688 | void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid) | 688 | void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid) |
689 | { | 689 | { |
690 | struct wiphy *wiphy = wdev->wiphy; | 690 | struct wiphy *wiphy = wdev->wiphy; |
691 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 691 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
@@ -694,7 +694,7 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid) | |||
694 | spin_lock_bh(&wdev->mgmt_registrations_lock); | 694 | spin_lock_bh(&wdev->mgmt_registrations_lock); |
695 | 695 | ||
696 | list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) { | 696 | list_for_each_entry_safe(reg, tmp, &wdev->mgmt_registrations, list) { |
697 | if (reg->nlpid != nlpid) | 697 | if (reg->nlportid != nlportid) |
698 | continue; | 698 | continue; |
699 | 699 | ||
700 | if (rdev->ops->mgmt_frame_register) { | 700 | if (rdev->ops->mgmt_frame_register) { |
@@ -710,8 +710,8 @@ void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid) | |||
710 | 710 | ||
711 | spin_unlock_bh(&wdev->mgmt_registrations_lock); | 711 | spin_unlock_bh(&wdev->mgmt_registrations_lock); |
712 | 712 | ||
713 | if (nlpid == wdev->ap_unexpected_nlpid) | 713 | if (nlportid == wdev->ap_unexpected_nlportid) |
714 | wdev->ap_unexpected_nlpid = 0; | 714 | wdev->ap_unexpected_nlportid = 0; |
715 | } | 715 | } |
716 | 716 | ||
717 | void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev) | 717 | void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev) |
@@ -872,7 +872,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, | |||
872 | /* found match! */ | 872 | /* found match! */ |
873 | 873 | ||
874 | /* Indicate the received Action frame to user space */ | 874 | /* Indicate the received Action frame to user space */ |
875 | if (nl80211_send_mgmt(rdev, wdev, reg->nlpid, | 875 | if (nl80211_send_mgmt(rdev, wdev, reg->nlportid, |
876 | freq, sig_mbm, | 876 | freq, sig_mbm, |
877 | buf, len, gfp)) | 877 | buf, len, gfp)) |
878 | continue; | 878 | continue; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 787aeaa902fe..34eb5c07a567 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -496,11 +496,11 @@ static bool is_valid_ie_attr(const struct nlattr *attr) | |||
496 | } | 496 | } |
497 | 497 | ||
498 | /* message building helper */ | 498 | /* message building helper */ |
499 | static inline void *nl80211hdr_put(struct sk_buff *skb, u32 pid, u32 seq, | 499 | static inline void *nl80211hdr_put(struct sk_buff *skb, u32 portid, u32 seq, |
500 | int flags, u8 cmd) | 500 | int flags, u8 cmd) |
501 | { | 501 | { |
502 | /* since there is no private header just add the generic one */ | 502 | /* since there is no private header just add the generic one */ |
503 | return genlmsg_put(skb, pid, seq, &nl80211_fam, flags, cmd); | 503 | return genlmsg_put(skb, portid, seq, &nl80211_fam, flags, cmd); |
504 | } | 504 | } |
505 | 505 | ||
506 | static int nl80211_msg_put_channel(struct sk_buff *msg, | 506 | static int nl80211_msg_put_channel(struct sk_buff *msg, |
@@ -851,7 +851,7 @@ nla_put_failure: | |||
851 | return -ENOBUFS; | 851 | return -ENOBUFS; |
852 | } | 852 | } |
853 | 853 | ||
854 | static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | 854 | static int nl80211_send_wiphy(struct sk_buff *msg, u32 portid, u32 seq, int flags, |
855 | struct cfg80211_registered_device *dev) | 855 | struct cfg80211_registered_device *dev) |
856 | { | 856 | { |
857 | void *hdr; | 857 | void *hdr; |
@@ -866,7 +866,7 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
866 | const struct ieee80211_txrx_stypes *mgmt_stypes = | 866 | const struct ieee80211_txrx_stypes *mgmt_stypes = |
867 | dev->wiphy.mgmt_stypes; | 867 | dev->wiphy.mgmt_stypes; |
868 | 868 | ||
869 | hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_WIPHY); | 869 | hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_WIPHY); |
870 | if (!hdr) | 870 | if (!hdr) |
871 | return -1; | 871 | return -1; |
872 | 872 | ||
@@ -1267,7 +1267,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) | |||
1267 | continue; | 1267 | continue; |
1268 | if (++idx <= start) | 1268 | if (++idx <= start) |
1269 | continue; | 1269 | continue; |
1270 | if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid, | 1270 | if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).portid, |
1271 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 1271 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
1272 | dev) < 0) { | 1272 | dev) < 0) { |
1273 | idx--; | 1273 | idx--; |
@@ -1290,7 +1290,7 @@ static int nl80211_get_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
1290 | if (!msg) | 1290 | if (!msg) |
1291 | return -ENOMEM; | 1291 | return -ENOMEM; |
1292 | 1292 | ||
1293 | if (nl80211_send_wiphy(msg, info->snd_pid, info->snd_seq, 0, dev) < 0) { | 1293 | if (nl80211_send_wiphy(msg, info->snd_portid, info->snd_seq, 0, dev) < 0) { |
1294 | nlmsg_free(msg); | 1294 | nlmsg_free(msg); |
1295 | return -ENOBUFS; | 1295 | return -ENOBUFS; |
1296 | } | 1296 | } |
@@ -1736,14 +1736,14 @@ static inline u64 wdev_id(struct wireless_dev *wdev) | |||
1736 | ((u64)wiphy_to_dev(wdev->wiphy)->wiphy_idx << 32); | 1736 | ((u64)wiphy_to_dev(wdev->wiphy)->wiphy_idx << 32); |
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags, | 1739 | static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, |
1740 | struct cfg80211_registered_device *rdev, | 1740 | struct cfg80211_registered_device *rdev, |
1741 | struct wireless_dev *wdev) | 1741 | struct wireless_dev *wdev) |
1742 | { | 1742 | { |
1743 | struct net_device *dev = wdev->netdev; | 1743 | struct net_device *dev = wdev->netdev; |
1744 | void *hdr; | 1744 | void *hdr; |
1745 | 1745 | ||
1746 | hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_INTERFACE); | 1746 | hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_INTERFACE); |
1747 | if (!hdr) | 1747 | if (!hdr) |
1748 | return -1; | 1748 | return -1; |
1749 | 1749 | ||
@@ -1807,7 +1807,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback * | |||
1807 | if_idx++; | 1807 | if_idx++; |
1808 | continue; | 1808 | continue; |
1809 | } | 1809 | } |
1810 | if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).pid, | 1810 | if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).portid, |
1811 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 1811 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
1812 | rdev, wdev) < 0) { | 1812 | rdev, wdev) < 0) { |
1813 | mutex_unlock(&rdev->devlist_mtx); | 1813 | mutex_unlock(&rdev->devlist_mtx); |
@@ -1838,7 +1838,7 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info) | |||
1838 | if (!msg) | 1838 | if (!msg) |
1839 | return -ENOMEM; | 1839 | return -ENOMEM; |
1840 | 1840 | ||
1841 | if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, | 1841 | if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, |
1842 | dev, wdev) < 0) { | 1842 | dev, wdev) < 0) { |
1843 | nlmsg_free(msg); | 1843 | nlmsg_free(msg); |
1844 | return -ENOBUFS; | 1844 | return -ENOBUFS; |
@@ -2056,7 +2056,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) | |||
2056 | break; | 2056 | break; |
2057 | } | 2057 | } |
2058 | 2058 | ||
2059 | if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, | 2059 | if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, |
2060 | rdev, wdev) < 0) { | 2060 | rdev, wdev) < 0) { |
2061 | nlmsg_free(msg); | 2061 | nlmsg_free(msg); |
2062 | return -ENOBUFS; | 2062 | return -ENOBUFS; |
@@ -2191,7 +2191,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2191 | if (!msg) | 2191 | if (!msg) |
2192 | return -ENOMEM; | 2192 | return -ENOMEM; |
2193 | 2193 | ||
2194 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 2194 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
2195 | NL80211_CMD_NEW_KEY); | 2195 | NL80211_CMD_NEW_KEY); |
2196 | if (IS_ERR(hdr)) | 2196 | if (IS_ERR(hdr)) |
2197 | return PTR_ERR(hdr); | 2197 | return PTR_ERR(hdr); |
@@ -2769,7 +2769,7 @@ nla_put_failure: | |||
2769 | return false; | 2769 | return false; |
2770 | } | 2770 | } |
2771 | 2771 | ||
2772 | static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, | 2772 | static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq, |
2773 | int flags, | 2773 | int flags, |
2774 | struct cfg80211_registered_device *rdev, | 2774 | struct cfg80211_registered_device *rdev, |
2775 | struct net_device *dev, | 2775 | struct net_device *dev, |
@@ -2778,7 +2778,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, | |||
2778 | void *hdr; | 2778 | void *hdr; |
2779 | struct nlattr *sinfoattr, *bss_param; | 2779 | struct nlattr *sinfoattr, *bss_param; |
2780 | 2780 | ||
2781 | hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_STATION); | 2781 | hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_STATION); |
2782 | if (!hdr) | 2782 | if (!hdr) |
2783 | return -1; | 2783 | return -1; |
2784 | 2784 | ||
@@ -2931,7 +2931,7 @@ static int nl80211_dump_station(struct sk_buff *skb, | |||
2931 | goto out_err; | 2931 | goto out_err; |
2932 | 2932 | ||
2933 | if (nl80211_send_station(skb, | 2933 | if (nl80211_send_station(skb, |
2934 | NETLINK_CB(cb->skb).pid, | 2934 | NETLINK_CB(cb->skb).portid, |
2935 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 2935 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
2936 | dev, netdev, mac_addr, | 2936 | dev, netdev, mac_addr, |
2937 | &sinfo) < 0) | 2937 | &sinfo) < 0) |
@@ -2977,7 +2977,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) | |||
2977 | if (!msg) | 2977 | if (!msg) |
2978 | return -ENOMEM; | 2978 | return -ENOMEM; |
2979 | 2979 | ||
2980 | if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0, | 2980 | if (nl80211_send_station(msg, info->snd_portid, info->snd_seq, 0, |
2981 | rdev, dev, mac_addr, &sinfo) < 0) { | 2981 | rdev, dev, mac_addr, &sinfo) < 0) { |
2982 | nlmsg_free(msg); | 2982 | nlmsg_free(msg); |
2983 | return -ENOBUFS; | 2983 | return -ENOBUFS; |
@@ -3303,7 +3303,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) | |||
3303 | return rdev->ops->del_station(&rdev->wiphy, dev, mac_addr); | 3303 | return rdev->ops->del_station(&rdev->wiphy, dev, mac_addr); |
3304 | } | 3304 | } |
3305 | 3305 | ||
3306 | static int nl80211_send_mpath(struct sk_buff *msg, u32 pid, u32 seq, | 3306 | static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, |
3307 | int flags, struct net_device *dev, | 3307 | int flags, struct net_device *dev, |
3308 | u8 *dst, u8 *next_hop, | 3308 | u8 *dst, u8 *next_hop, |
3309 | struct mpath_info *pinfo) | 3309 | struct mpath_info *pinfo) |
@@ -3311,7 +3311,7 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 pid, u32 seq, | |||
3311 | void *hdr; | 3311 | void *hdr; |
3312 | struct nlattr *pinfoattr; | 3312 | struct nlattr *pinfoattr; |
3313 | 3313 | ||
3314 | hdr = nl80211hdr_put(msg, pid, seq, flags, NL80211_CMD_NEW_STATION); | 3314 | hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_STATION); |
3315 | if (!hdr) | 3315 | if (!hdr) |
3316 | return -1; | 3316 | return -1; |
3317 | 3317 | ||
@@ -3389,7 +3389,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb, | |||
3389 | if (err) | 3389 | if (err) |
3390 | goto out_err; | 3390 | goto out_err; |
3391 | 3391 | ||
3392 | if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).pid, | 3392 | if (nl80211_send_mpath(skb, NETLINK_CB(cb->skb).portid, |
3393 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 3393 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
3394 | netdev, dst, next_hop, | 3394 | netdev, dst, next_hop, |
3395 | &pinfo) < 0) | 3395 | &pinfo) < 0) |
@@ -3438,7 +3438,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info) | |||
3438 | if (!msg) | 3438 | if (!msg) |
3439 | return -ENOMEM; | 3439 | return -ENOMEM; |
3440 | 3440 | ||
3441 | if (nl80211_send_mpath(msg, info->snd_pid, info->snd_seq, 0, | 3441 | if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, |
3442 | dev, dst, next_hop, &pinfo) < 0) { | 3442 | dev, dst, next_hop, &pinfo) < 0) { |
3443 | nlmsg_free(msg); | 3443 | nlmsg_free(msg); |
3444 | return -ENOBUFS; | 3444 | return -ENOBUFS; |
@@ -3679,7 +3679,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
3679 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); | 3679 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
3680 | if (!msg) | 3680 | if (!msg) |
3681 | return -ENOMEM; | 3681 | return -ENOMEM; |
3682 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 3682 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
3683 | NL80211_CMD_GET_MESH_CONFIG); | 3683 | NL80211_CMD_GET_MESH_CONFIG); |
3684 | if (!hdr) | 3684 | if (!hdr) |
3685 | goto out; | 3685 | goto out; |
@@ -3998,7 +3998,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info) | |||
3998 | goto out; | 3998 | goto out; |
3999 | } | 3999 | } |
4000 | 4000 | ||
4001 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 4001 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
4002 | NL80211_CMD_GET_REG); | 4002 | NL80211_CMD_GET_REG); |
4003 | if (!hdr) | 4003 | if (!hdr) |
4004 | goto put_failure; | 4004 | goto put_failure; |
@@ -4616,7 +4616,7 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, | |||
4616 | 4616 | ||
4617 | ASSERT_WDEV_LOCK(wdev); | 4617 | ASSERT_WDEV_LOCK(wdev); |
4618 | 4618 | ||
4619 | hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).pid, seq, flags, | 4619 | hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, |
4620 | NL80211_CMD_NEW_SCAN_RESULTS); | 4620 | NL80211_CMD_NEW_SCAN_RESULTS); |
4621 | if (!hdr) | 4621 | if (!hdr) |
4622 | return -1; | 4622 | return -1; |
@@ -4735,14 +4735,14 @@ static int nl80211_dump_scan(struct sk_buff *skb, | |||
4735 | return skb->len; | 4735 | return skb->len; |
4736 | } | 4736 | } |
4737 | 4737 | ||
4738 | static int nl80211_send_survey(struct sk_buff *msg, u32 pid, u32 seq, | 4738 | static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, |
4739 | int flags, struct net_device *dev, | 4739 | int flags, struct net_device *dev, |
4740 | struct survey_info *survey) | 4740 | struct survey_info *survey) |
4741 | { | 4741 | { |
4742 | void *hdr; | 4742 | void *hdr; |
4743 | struct nlattr *infoattr; | 4743 | struct nlattr *infoattr; |
4744 | 4744 | ||
4745 | hdr = nl80211hdr_put(msg, pid, seq, flags, | 4745 | hdr = nl80211hdr_put(msg, portid, seq, flags, |
4746 | NL80211_CMD_NEW_SURVEY_RESULTS); | 4746 | NL80211_CMD_NEW_SURVEY_RESULTS); |
4747 | if (!hdr) | 4747 | if (!hdr) |
4748 | return -ENOMEM; | 4748 | return -ENOMEM; |
@@ -4836,7 +4836,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, | |||
4836 | } | 4836 | } |
4837 | 4837 | ||
4838 | if (nl80211_send_survey(skb, | 4838 | if (nl80211_send_survey(skb, |
4839 | NETLINK_CB(cb->skb).pid, | 4839 | NETLINK_CB(cb->skb).portid, |
4840 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 4840 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
4841 | netdev, | 4841 | netdev, |
4842 | &survey) < 0) | 4842 | &survey) < 0) |
@@ -5451,7 +5451,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | |||
5451 | } | 5451 | } |
5452 | 5452 | ||
5453 | while (1) { | 5453 | while (1) { |
5454 | void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).pid, | 5454 | void *hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).portid, |
5455 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 5455 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
5456 | NL80211_CMD_TESTMODE); | 5456 | NL80211_CMD_TESTMODE); |
5457 | struct nlattr *tmdata; | 5457 | struct nlattr *tmdata; |
@@ -5491,7 +5491,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | |||
5491 | 5491 | ||
5492 | static struct sk_buff * | 5492 | static struct sk_buff * |
5493 | __cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev, | 5493 | __cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev, |
5494 | int approxlen, u32 pid, u32 seq, gfp_t gfp) | 5494 | int approxlen, u32 portid, u32 seq, gfp_t gfp) |
5495 | { | 5495 | { |
5496 | struct sk_buff *skb; | 5496 | struct sk_buff *skb; |
5497 | void *hdr; | 5497 | void *hdr; |
@@ -5501,7 +5501,7 @@ __cfg80211_testmode_alloc_skb(struct cfg80211_registered_device *rdev, | |||
5501 | if (!skb) | 5501 | if (!skb) |
5502 | return NULL; | 5502 | return NULL; |
5503 | 5503 | ||
5504 | hdr = nl80211hdr_put(skb, pid, seq, 0, NL80211_CMD_TESTMODE); | 5504 | hdr = nl80211hdr_put(skb, portid, seq, 0, NL80211_CMD_TESTMODE); |
5505 | if (!hdr) { | 5505 | if (!hdr) { |
5506 | kfree_skb(skb); | 5506 | kfree_skb(skb); |
5507 | return NULL; | 5507 | return NULL; |
@@ -5531,7 +5531,7 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | |||
5531 | return NULL; | 5531 | return NULL; |
5532 | 5532 | ||
5533 | return __cfg80211_testmode_alloc_skb(rdev, approxlen, | 5533 | return __cfg80211_testmode_alloc_skb(rdev, approxlen, |
5534 | rdev->testmode_info->snd_pid, | 5534 | rdev->testmode_info->snd_portid, |
5535 | rdev->testmode_info->snd_seq, | 5535 | rdev->testmode_info->snd_seq, |
5536 | GFP_KERNEL); | 5536 | GFP_KERNEL); |
5537 | } | 5537 | } |
@@ -5867,7 +5867,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, | |||
5867 | if (!msg) | 5867 | if (!msg) |
5868 | return -ENOMEM; | 5868 | return -ENOMEM; |
5869 | 5869 | ||
5870 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 5870 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
5871 | NL80211_CMD_REMAIN_ON_CHANNEL); | 5871 | NL80211_CMD_REMAIN_ON_CHANNEL); |
5872 | 5872 | ||
5873 | if (IS_ERR(hdr)) { | 5873 | if (IS_ERR(hdr)) { |
@@ -6086,7 +6086,7 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
6086 | if (!rdev->ops->mgmt_tx) | 6086 | if (!rdev->ops->mgmt_tx) |
6087 | return -EOPNOTSUPP; | 6087 | return -EOPNOTSUPP; |
6088 | 6088 | ||
6089 | return cfg80211_mlme_register_mgmt(wdev, info->snd_pid, frame_type, | 6089 | return cfg80211_mlme_register_mgmt(wdev, info->snd_portid, frame_type, |
6090 | nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), | 6090 | nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), |
6091 | nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); | 6091 | nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); |
6092 | } | 6092 | } |
@@ -6167,7 +6167,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
6167 | if (!msg) | 6167 | if (!msg) |
6168 | return -ENOMEM; | 6168 | return -ENOMEM; |
6169 | 6169 | ||
6170 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 6170 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
6171 | NL80211_CMD_FRAME); | 6171 | NL80211_CMD_FRAME); |
6172 | 6172 | ||
6173 | if (IS_ERR(hdr)) { | 6173 | if (IS_ERR(hdr)) { |
@@ -6284,7 +6284,7 @@ static int nl80211_get_power_save(struct sk_buff *skb, struct genl_info *info) | |||
6284 | if (!msg) | 6284 | if (!msg) |
6285 | return -ENOMEM; | 6285 | return -ENOMEM; |
6286 | 6286 | ||
6287 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 6287 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
6288 | NL80211_CMD_GET_POWER_SAVE); | 6288 | NL80211_CMD_GET_POWER_SAVE); |
6289 | if (!hdr) { | 6289 | if (!hdr) { |
6290 | err = -ENOBUFS; | 6290 | err = -ENOBUFS; |
@@ -6486,7 +6486,7 @@ static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info) | |||
6486 | if (!msg) | 6486 | if (!msg) |
6487 | return -ENOMEM; | 6487 | return -ENOMEM; |
6488 | 6488 | ||
6489 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 6489 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
6490 | NL80211_CMD_GET_WOWLAN); | 6490 | NL80211_CMD_GET_WOWLAN); |
6491 | if (!hdr) | 6491 | if (!hdr) |
6492 | goto nla_put_failure; | 6492 | goto nla_put_failure; |
@@ -6760,10 +6760,10 @@ static int nl80211_register_unexpected_frame(struct sk_buff *skb, | |||
6760 | wdev->iftype != NL80211_IFTYPE_P2P_GO) | 6760 | wdev->iftype != NL80211_IFTYPE_P2P_GO) |
6761 | return -EINVAL; | 6761 | return -EINVAL; |
6762 | 6762 | ||
6763 | if (wdev->ap_unexpected_nlpid) | 6763 | if (wdev->ap_unexpected_nlportid) |
6764 | return -EBUSY; | 6764 | return -EBUSY; |
6765 | 6765 | ||
6766 | wdev->ap_unexpected_nlpid = info->snd_pid; | 6766 | wdev->ap_unexpected_nlportid = info->snd_portid; |
6767 | return 0; | 6767 | return 0; |
6768 | } | 6768 | } |
6769 | 6769 | ||
@@ -6793,7 +6793,7 @@ static int nl80211_probe_client(struct sk_buff *skb, | |||
6793 | if (!msg) | 6793 | if (!msg) |
6794 | return -ENOMEM; | 6794 | return -ENOMEM; |
6795 | 6795 | ||
6796 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 6796 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
6797 | NL80211_CMD_PROBE_CLIENT); | 6797 | NL80211_CMD_PROBE_CLIENT); |
6798 | 6798 | ||
6799 | if (IS_ERR(hdr)) { | 6799 | if (IS_ERR(hdr)) { |
@@ -6828,10 +6828,10 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info) | |||
6828 | if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) | 6828 | if (!(rdev->wiphy.flags & WIPHY_FLAG_REPORTS_OBSS)) |
6829 | return -EOPNOTSUPP; | 6829 | return -EOPNOTSUPP; |
6830 | 6830 | ||
6831 | if (rdev->ap_beacons_nlpid) | 6831 | if (rdev->ap_beacons_nlportid) |
6832 | return -EBUSY; | 6832 | return -EBUSY; |
6833 | 6833 | ||
6834 | rdev->ap_beacons_nlpid = info->snd_pid; | 6834 | rdev->ap_beacons_nlportid = info->snd_portid; |
6835 | 6835 | ||
6836 | return 0; | 6836 | return 0; |
6837 | } | 6837 | } |
@@ -7628,12 +7628,12 @@ static int nl80211_add_scan_req(struct sk_buff *msg, | |||
7628 | static int nl80211_send_scan_msg(struct sk_buff *msg, | 7628 | static int nl80211_send_scan_msg(struct sk_buff *msg, |
7629 | struct cfg80211_registered_device *rdev, | 7629 | struct cfg80211_registered_device *rdev, |
7630 | struct wireless_dev *wdev, | 7630 | struct wireless_dev *wdev, |
7631 | u32 pid, u32 seq, int flags, | 7631 | u32 portid, u32 seq, int flags, |
7632 | u32 cmd) | 7632 | u32 cmd) |
7633 | { | 7633 | { |
7634 | void *hdr; | 7634 | void *hdr; |
7635 | 7635 | ||
7636 | hdr = nl80211hdr_put(msg, pid, seq, flags, cmd); | 7636 | hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); |
7637 | if (!hdr) | 7637 | if (!hdr) |
7638 | return -1; | 7638 | return -1; |
7639 | 7639 | ||
@@ -7657,11 +7657,11 @@ static int | |||
7657 | nl80211_send_sched_scan_msg(struct sk_buff *msg, | 7657 | nl80211_send_sched_scan_msg(struct sk_buff *msg, |
7658 | struct cfg80211_registered_device *rdev, | 7658 | struct cfg80211_registered_device *rdev, |
7659 | struct net_device *netdev, | 7659 | struct net_device *netdev, |
7660 | u32 pid, u32 seq, int flags, u32 cmd) | 7660 | u32 portid, u32 seq, int flags, u32 cmd) |
7661 | { | 7661 | { |
7662 | void *hdr; | 7662 | void *hdr; |
7663 | 7663 | ||
7664 | hdr = nl80211hdr_put(msg, pid, seq, flags, cmd); | 7664 | hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); |
7665 | if (!hdr) | 7665 | if (!hdr) |
7666 | return -1; | 7666 | return -1; |
7667 | 7667 | ||
@@ -8370,9 +8370,9 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
8370 | struct sk_buff *msg; | 8370 | struct sk_buff *msg; |
8371 | void *hdr; | 8371 | void *hdr; |
8372 | int err; | 8372 | int err; |
8373 | u32 nlpid = ACCESS_ONCE(wdev->ap_unexpected_nlpid); | 8373 | u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); |
8374 | 8374 | ||
8375 | if (!nlpid) | 8375 | if (!nlportid) |
8376 | return false; | 8376 | return false; |
8377 | 8377 | ||
8378 | msg = nlmsg_new(100, gfp); | 8378 | msg = nlmsg_new(100, gfp); |
@@ -8396,7 +8396,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
8396 | return true; | 8396 | return true; |
8397 | } | 8397 | } |
8398 | 8398 | ||
8399 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); | 8399 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); |
8400 | return true; | 8400 | return true; |
8401 | 8401 | ||
8402 | nla_put_failure: | 8402 | nla_put_failure: |
@@ -8420,7 +8420,7 @@ bool nl80211_unexpected_4addr_frame(struct net_device *dev, | |||
8420 | } | 8420 | } |
8421 | 8421 | ||
8422 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | 8422 | int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, |
8423 | struct wireless_dev *wdev, u32 nlpid, | 8423 | struct wireless_dev *wdev, u32 nlportid, |
8424 | int freq, int sig_dbm, | 8424 | int freq, int sig_dbm, |
8425 | const u8 *buf, size_t len, gfp_t gfp) | 8425 | const u8 *buf, size_t len, gfp_t gfp) |
8426 | { | 8426 | { |
@@ -8449,7 +8449,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, | |||
8449 | 8449 | ||
8450 | genlmsg_end(msg, hdr); | 8450 | genlmsg_end(msg, hdr); |
8451 | 8451 | ||
8452 | return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); | 8452 | return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); |
8453 | 8453 | ||
8454 | nla_put_failure: | 8454 | nla_put_failure: |
8455 | genlmsg_cancel(msg, hdr); | 8455 | genlmsg_cancel(msg, hdr); |
@@ -8804,9 +8804,9 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
8804 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 8804 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
8805 | struct sk_buff *msg; | 8805 | struct sk_buff *msg; |
8806 | void *hdr; | 8806 | void *hdr; |
8807 | u32 nlpid = ACCESS_ONCE(rdev->ap_beacons_nlpid); | 8807 | u32 nlportid = ACCESS_ONCE(rdev->ap_beacons_nlportid); |
8808 | 8808 | ||
8809 | if (!nlpid) | 8809 | if (!nlportid) |
8810 | return; | 8810 | return; |
8811 | 8811 | ||
8812 | msg = nlmsg_new(len + 100, gfp); | 8812 | msg = nlmsg_new(len + 100, gfp); |
@@ -8829,7 +8829,7 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
8829 | 8829 | ||
8830 | genlmsg_end(msg, hdr); | 8830 | genlmsg_end(msg, hdr); |
8831 | 8831 | ||
8832 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlpid); | 8832 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); |
8833 | return; | 8833 | return; |
8834 | 8834 | ||
8835 | nla_put_failure: | 8835 | nla_put_failure: |
@@ -8853,9 +8853,9 @@ static int nl80211_netlink_notify(struct notifier_block * nb, | |||
8853 | 8853 | ||
8854 | list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) { | 8854 | list_for_each_entry_rcu(rdev, &cfg80211_rdev_list, list) { |
8855 | list_for_each_entry_rcu(wdev, &rdev->wdev_list, list) | 8855 | list_for_each_entry_rcu(wdev, &rdev->wdev_list, list) |
8856 | cfg80211_mlme_unregister_socket(wdev, notify->pid); | 8856 | cfg80211_mlme_unregister_socket(wdev, notify->portid); |
8857 | if (rdev->ap_beacons_nlpid == notify->pid) | 8857 | if (rdev->ap_beacons_nlportid == notify->portid) |
8858 | rdev->ap_beacons_nlpid = 0; | 8858 | rdev->ap_beacons_nlportid = 0; |
8859 | } | 8859 | } |
8860 | 8860 | ||
8861 | rcu_read_unlock(); | 8861 | rcu_read_unlock(); |