--- zzzz-none-000/linux-5.15.111/net/wireless/sme.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/wireless/sme.c 2024-02-07 10:23:31.000000000 +0000 @@ -1085,8 +1085,14 @@ } EXPORT_SYMBOL(cfg80211_port_authorized); +#ifndef CFG80211_PROP_MULTI_LINK_SUPPORT void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, size_t ie_len, u16 reason, bool from_ap) +#else /* CFG80211_PROP_MULTI_LINK_SUPPORT */ +void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, + size_t ie_len, u16 reason, bool from_ap, + int link_id) +#endif /* CFG80211_PROP_MULTI_LINK_SUPPORT */ { struct wireless_dev *wdev = dev->ieee80211_ptr; struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); @@ -1101,6 +1107,15 @@ wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)) return; +#ifdef CFG80211_PROP_MULTI_LINK_SUPPORT + if (link_id >= 0 && link_id <= NL80211_MLD_MAX_NUM_LINKS) { + /* MLO Link Downgrade */ + nl80211_send_disconnected(rdev, dev, reason, ie, + ie_len, from_ap, link_id); + return; + } +#endif /* CFG80211_PROP_MULTI_LINK_SUPPORT */ + if (wdev->current_bss) { cfg80211_unhold_bss(wdev->current_bss); cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); @@ -1112,7 +1127,12 @@ kfree_sensitive(wdev->connect_keys); wdev->connect_keys = NULL; +#ifndef CFG80211_PROP_MULTI_LINK_SUPPORT nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap); +#else /* CFG80211_PROP_MULTI_LINK_SUPPORT */ + nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap, + NL80211_MLO_INVALID_LINK_ID); +#endif /* CFG80211_PROP_MULTI_LINK_SUPPORT */ /* stop critical protocol if supported */ if (rdev->ops->crit_proto_stop && rdev->crit_proto_nlportid) { @@ -1150,9 +1170,15 @@ schedule_work(&cfg80211_disconnect_work); } +#ifndef CFG80211_PROP_MULTI_LINK_SUPPORT void cfg80211_disconnected(struct net_device *dev, u16 reason, const u8 *ie, size_t ie_len, bool locally_generated, gfp_t gfp) +#else /* CFG80211_PROP_MULTI_LINK_SUPPORT */ +void cfg80211_disconnected(struct net_device *dev, u16 reason, + const u8 *ie, size_t ie_len, + bool locally_generated, int link_id, gfp_t gfp) +#endif /* CFG80211_PROP_MULTI_LINK_SUPPORT */ { struct wireless_dev *wdev = dev->ieee80211_ptr; struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); @@ -1169,6 +1195,9 @@ memcpy((void *)ev->dc.ie, ie, ie_len); ev->dc.reason = reason; ev->dc.locally_generated = locally_generated; +#ifdef CFG80211_PROP_MULTI_LINK_SUPPORT + ev->dc.link_id = link_id; +#endif /* CFG80211_PROP_MULTI_LINK_SUPPORT */ spin_lock_irqsave(&wdev->event_lock, flags); list_add_tail(&ev->list, &wdev->event_list); @@ -1341,7 +1370,7 @@ break; case NL80211_IFTYPE_AP: case NL80211_IFTYPE_P2P_GO: - __cfg80211_stop_ap(rdev, wdev->netdev, false); + __cfg80211_stop_ap(rdev, wdev->netdev, false, NULL); break; case NL80211_IFTYPE_MESH_POINT: __cfg80211_leave_mesh(rdev, wdev->netdev);