From b405a1733f3db08e02749918cddc361b4d18a8c7 Mon Sep 17 00:00:00 2001 From: lujunxin Date: Mon, 18 Jul 2022 14:28:24 +0800 Subject: [PATCH] hmf kernel patch Signed-off-by: lujunxin --- include/uapi/linux/netlink.h | 3 ++- net/wireless/nl80211.c | 3 ++- net/wireless/sme.c | 11 ++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h index 3d94269bbfa8..1cea4197123e 100644 --- a/include/uapi/linux/netlink.h +++ b/include/uapi/linux/netlink.h @@ -32,7 +32,8 @@ #define NETLINK_INET_DIAG NETLINK_SOCK_DIAG -#define MAX_LINKS 32 +#define NETLINK_WIFI_EXT 44 +#define MAX_LINKS 45 struct sockaddr_nl { __kernel_sa_family_t nl_family; /* AF_NETLINK */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8fb0478888fb..de5f1299331e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10499,7 +10499,8 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) return err; if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION && - dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT) + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT && + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) return -EOPNOTSUPP; wiphy = &rdev->wiphy; diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 060e365c8259..2413e8e39eec 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -689,7 +689,8 @@ void __cfg80211_connect_result(struct net_device *dev, ASSERT_WDEV_LOCK(wdev); if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION && - wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)) { + wdev->iftype != NL80211_IFTYPE_P2P_CLIENT && + wdev->iftype != NL80211_IFTYPE_P2P_GO)) { cfg80211_put_bss(wdev->wiphy, cr->bss); return; } @@ -698,6 +699,9 @@ void __cfg80211_connect_result(struct net_device *dev, nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, cr, GFP_KERNEL); + if (wdev->iftype == NL80211_IFTYPE_P2P_GO) + return; + #ifdef CONFIG_CFG80211_WEXT if (wextev) { if (cr->req_ie && cr->status == WLAN_STATUS_SUCCESS) { @@ -1186,8 +1190,9 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev, * same (which is the case for re-association.) */ if (wdev->ssid_len && - (wdev->ssid_len != connect->ssid_len || - memcmp(wdev->ssid, connect->ssid, wdev->ssid_len))) + (wdev->ssid_len != connect->ssid_len || + memcmp(wdev->ssid, connect->ssid, wdev->ssid_len)) && + (wdev->iftype != NL80211_IFTYPE_P2P_GO)) return -EALREADY; /* -- Gitee