@@ -6365,6 +6365,13 @@ union wpa_event_data {
*/
struct pasn_auth pasn_auth;
+ /**
+ * struct port_authorized - Data for EVENT_PORT_AUTHORIZED
+ */
+ struct port_authorized {
+ u8 *td_bitmap;
+ u8 td_bitmap_len;
+ } port_authorized;
};
/**
@@ -3152,7 +3152,9 @@ static void nl80211_port_authorized(struct wpa_driver_nl80211_data *drv,
struct nlattr **tb)
{
const u8 *addr;
+ union wpa_event_data event;
+ os_memset(&event, 0, sizeof(event));
if (!tb[NL80211_ATTR_MAC] ||
nla_len(tb[NL80211_ATTR_MAC]) != ETH_ALEN) {
wpa_printf(MSG_DEBUG,
@@ -3169,7 +3171,14 @@ static void nl80211_port_authorized(struct wpa_driver_nl80211_data *drv,
return;
}
- wpa_supplicant_event(drv->ctx, EVENT_PORT_AUTHORIZED, NULL);
+ if (tb[NL80211_ATTR_TD_BITMAP]) {
+ event.port_authorized.td_bitmap_len = nla_len(tb[NL80211_ATTR_TD_BITMAP]);
+ if (event.port_authorized.td_bitmap_len > 0) {
+ event.port_authorized.td_bitmap = nla_data(tb[NL80211_ATTR_TD_BITMAP]);
+ }
+ }
+
+ wpa_supplicant_event(drv->ctx, EVENT_PORT_AUTHORIZED, &event);
}
@@ -2741,6 +2741,8 @@ enum nl80211_commands {
* When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
* timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
* the incoming frame RX timestamp.
+ * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
+ * (re)associations.
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3269,6 +3271,8 @@ enum nl80211_attrs {
NL80211_ATTR_TX_HW_TIMESTAMP,
NL80211_ATTR_RX_HW_TIMESTAMP,
+ NL80211_ATTR_TD_BITMAP,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -6047,6 +6047,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
#endif /* CONFIG_PASN */
case EVENT_PORT_AUTHORIZED:
+ if (data->port_authorized.td_bitmap_len) {
+ wpa_printf(MSG_INFO, "TD_BITMAP: 0x%x",
+ data->port_authorized.td_bitmap[0]);
+ wpa_supplicant_transition_disable(wpa_s,
+ data->port_authorized.td_bitmap[0]);
+ }
wpa_supplicant_event_port_authorized(wpa_s);
break;
case EVENT_STATION_OPMODE_CHANGED:
@@ -1282,7 +1282,7 @@ static void disable_wpa_wpa2(struct wpa_ssid *ssid)
}
-static void wpa_supplicant_transition_disable(void *_wpa_s, u8 bitmap)
+void wpa_supplicant_transition_disable(void *_wpa_s, u8 bitmap)
{
struct wpa_supplicant *wpa_s = _wpa_s;
struct wpa_ssid *ssid;
@@ -27,4 +27,5 @@ enum wpa_ctrl_req_type wpa_supplicant_ctrl_req_from_string(const char *field);
void wpas_send_ctrl_req(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
const char *field_name, const char *txt);
+void wpa_supplicant_transition_disable(void *_wpa_s, u8 bitmap);
#endif /* WPAS_GLUE_H */
In case of drivers involving 4-way HS offloaded to driver, there currently exist no way of updating transition disable bitmap recieved as part EAPOL 3/4. With latest provisions in cfg80211_port_authorized, the td bitmap can be sent to the upper layer. In the current change the same is parsed as part port authorized event and according transition disable is set. Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com> --- src/drivers/driver.h | 7 +++++++ src/drivers/driver_nl80211_event.c | 11 ++++++++++- src/drivers/nl80211_copy.h | 4 ++++ wpa_supplicant/events.c | 6 ++++++ wpa_supplicant/wpas_glue.c | 2 +- wpa_supplicant/wpas_glue.h | 1 + 6 files changed, 29 insertions(+), 2 deletions(-)