File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -6933,6 +6933,8 @@ void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);
6933
6933
* @ap_mld_addr: AP MLD address (in case of MLO)
6934
6934
* @links: per-link information indexed by link ID, use links[0] for
6935
6935
* non-MLO connections
6936
+ * @links.status: Set this (along with a BSS pointer) for links that
6937
+ * were rejected by the AP.
6936
6938
*/
6937
6939
struct cfg80211_rx_assoc_resp {
6938
6940
const u8 * buf ;
@@ -6944,6 +6946,7 @@ struct cfg80211_rx_assoc_resp {
6944
6946
struct {
6945
6947
const u8 * addr ;
6946
6948
struct cfg80211_bss * bss ;
6949
+ u16 status ;
6947
6950
} links [IEEE80211_MLD_MAX_NUM_LINKS ];
6948
6951
};
6949
6952
@@ -7454,6 +7457,9 @@ struct cfg80211_fils_resp_params {
7454
7457
* if the bss is expired during the connection, esp. for those drivers
7455
7458
* implementing connect op. Only one parameter among @bssid and @bss needs
7456
7459
* to be specified.
7460
+ * @links.status: per-link status code, to report a status code that's not
7461
+ * %WLAN_STATUS_SUCCESS for a given link, it must also be in the
7462
+ * @valid_links bitmap and may have a BSS pointer (which is then released)
7457
7463
*/
7458
7464
struct cfg80211_connect_resp_params {
7459
7465
int status ;
@@ -7470,6 +7476,7 @@ struct cfg80211_connect_resp_params {
7470
7476
const u8 * addr ;
7471
7477
const u8 * bssid ;
7472
7478
struct cfg80211_bss * bss ;
7479
+ u16 status ;
7473
7480
} links [IEEE80211_MLD_MAX_NUM_LINKS ];
7474
7481
};
7475
7482
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ void cfg80211_rx_assoc_resp(struct net_device *dev,
42
42
unsigned int link_id ;
43
43
44
44
for (link_id = 0 ; link_id < ARRAY_SIZE (data -> links ); link_id ++ ) {
45
+ cr .links [link_id ].status = data -> links [link_id ].status ;
46
+ WARN_ON_ONCE (cr .links [link_id ].status != WLAN_STATUS_SUCCESS &&
47
+ (!cr .ap_mld_addr || !cr .links [link_id ].bss ));
48
+
45
49
cr .links [link_id ].bss = data -> links [link_id ].bss ;
46
50
if (!cr .links [link_id ].bss )
47
51
continue ;
Original file line number Diff line number Diff line change @@ -17745,6 +17745,7 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
17745
17745
link_info_size += (cr->links[link].bssid ||
17746
17746
cr->links[link].bss) ?
17747
17747
nla_total_size(ETH_ALEN) : 0;
17748
+ link_info_size += nla_total_size(sizeof(u16));
17748
17749
}
17749
17750
}
17750
17751
@@ -17813,7 +17814,9 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
17813
17814
nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, bssid)) ||
17814
17815
(cr->links[link].addr &&
17815
17816
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN,
17816
- cr->links[link].addr)))
17817
+ cr->links[link].addr)) ||
17818
+ nla_put_u16(msg, NL80211_ATTR_STATUS_CODE,
17819
+ cr->links[link].status))
17817
17820
goto nla_put_failure;
17818
17821
17819
17822
nla_nest_end(msg, nested_mlo_links);
Original file line number Diff line number Diff line change @@ -793,6 +793,10 @@ void __cfg80211_connect_result(struct net_device *dev,
793
793
}
794
794
795
795
for_each_valid_link (cr , link ) {
796
+ /* don't do extra lookups for failures */
797
+ if (cr -> links [link ].status != WLAN_STATUS_SUCCESS )
798
+ continue ;
799
+
796
800
if (cr -> links [link ].bss )
797
801
continue ;
798
802
@@ -829,6 +833,16 @@ void __cfg80211_connect_result(struct net_device *dev,
829
833
}
830
834
831
835
memset (wdev -> links , 0 , sizeof (wdev -> links ));
836
+ for_each_valid_link (cr , link ) {
837
+ if (cr -> links [link ].status == WLAN_STATUS_SUCCESS )
838
+ continue ;
839
+ cr -> valid_links &= ~BIT (link );
840
+ /* don't require bss pointer for failed links */
841
+ if (!cr -> links [link ].bss )
842
+ continue ;
843
+ cfg80211_unhold_bss (bss_from_pub (cr -> links [link ].bss ));
844
+ cfg80211_put_bss (wdev -> wiphy , cr -> links [link ].bss );
845
+ }
832
846
wdev -> valid_links = cr -> valid_links ;
833
847
for_each_valid_link (cr , link )
834
848
wdev -> links [link ].client .current_bss =
You can’t perform that action at this time.
0 commit comments