developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame^] | 1 | From 0b72d2a8002e79886433ee85fd23661ec4d3d731 Mon Sep 17 00:00:00 2001 |
| 2 | From: Sriram R <quic_srirrama@quicinc.com> |
| 3 | Date: Thu, 28 Mar 2024 23:46:41 +0530 |
| 4 | Subject: [PATCH 011/104] hostapd: MLO: move mgmt and control port Tx status to |
| 5 | per BSS handling |
| 6 | |
| 7 | Currently management and control port transmit status is handled on drv's |
| 8 | first BSS only. However to support multiple MLDs there is requirement to |
| 9 | handle it in on a given BSS. |
| 10 | |
| 11 | Add changes to use the passed BSS instead of always going with drv's first |
| 12 | BSS. |
| 13 | |
| 14 | Signed-off-by: Sriram R <quic_srirrama@quicinc.com> |
| 15 | Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com> |
| 16 | --- |
| 17 | src/drivers/driver_nl80211_event.c | 25 +++++++++++++------------ |
| 18 | 1 file changed, 13 insertions(+), 12 deletions(-) |
| 19 | |
| 20 | diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c |
| 21 | index 1ca8b5bce..f5778cdaf 100644 |
| 22 | --- a/src/drivers/driver_nl80211_event.c |
| 23 | +++ b/src/drivers/driver_nl80211_event.c |
| 24 | @@ -22,7 +22,7 @@ |
| 25 | |
| 26 | |
| 27 | static void |
| 28 | -nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, |
| 29 | +nl80211_control_port_frame_tx_status(struct i802_bss *bss, |
| 30 | const u8 *frame, size_t len, |
| 31 | struct nlattr *ack, struct nlattr *cookie); |
| 32 | |
| 33 | @@ -1374,12 +1374,13 @@ static void mlme_event_mgmt(struct i802_bss *bss, |
| 34 | } |
| 35 | |
| 36 | |
| 37 | -static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv, |
| 38 | +static void mlme_event_mgmt_tx_status(struct i802_bss *bss, |
| 39 | struct nlattr *cookie, const u8 *frame, |
| 40 | size_t len, struct nlattr *ack) |
| 41 | { |
| 42 | union wpa_event_data event; |
| 43 | const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) frame; |
| 44 | + struct wpa_driver_nl80211_data *drv = bss->drv; |
| 45 | u16 fc = le_to_host16(hdr->frame_control); |
| 46 | u64 cookie_val = 0; |
| 47 | |
| 48 | @@ -1398,7 +1399,7 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv, |
| 49 | WPA_GET_BE16(frame + 2 * ETH_ALEN) == ETH_P_PAE) { |
| 50 | wpa_printf(MSG_DEBUG, |
| 51 | "nl80211: Work around misdelivered control port TX status for EAPOL"); |
| 52 | - nl80211_control_port_frame_tx_status(drv, frame, len, ack, |
| 53 | + nl80211_control_port_frame_tx_status(bss, frame, len, ack, |
| 54 | cookie); |
| 55 | return; |
| 56 | } |
| 57 | @@ -1434,7 +1435,7 @@ static void mlme_event_mgmt_tx_status(struct wpa_driver_nl80211_data *drv, |
| 58 | event.tx_status.ack = ack != NULL; |
| 59 | event.tx_status.link_id = cookie_val == drv->send_frame_cookie ? |
| 60 | drv->send_frame_link_id : NL80211_DRV_LINK_ID_NA; |
| 61 | - wpa_supplicant_event(drv->ctx, EVENT_TX_STATUS, &event); |
| 62 | + wpa_supplicant_event(bss->ctx, EVENT_TX_STATUS, &event); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | @@ -1742,7 +1743,7 @@ static void mlme_event(struct i802_bss *bss, |
| 67 | nla_len(frame), link_id); |
| 68 | break; |
| 69 | case NL80211_CMD_FRAME_TX_STATUS: |
| 70 | - mlme_event_mgmt_tx_status(drv, cookie, nla_data(frame), |
| 71 | + mlme_event_mgmt_tx_status(bss, cookie, nla_data(frame), |
| 72 | nla_len(frame), ack); |
| 73 | break; |
| 74 | case NL80211_CMD_UNPROT_DEAUTHENTICATE: |
| 75 | @@ -3652,8 +3653,7 @@ static void nl80211_sta_opmode_change_event(struct wpa_driver_nl80211_data *drv, |
| 76 | } |
| 77 | |
| 78 | |
| 79 | -static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, |
| 80 | - struct nlattr **tb) |
| 81 | +static void nl80211_control_port_frame(struct i802_bss *bss, struct nlattr **tb) |
| 82 | { |
| 83 | u8 *src_addr; |
| 84 | u16 ethertype; |
| 85 | @@ -3682,7 +3682,7 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, |
| 86 | MAC2STR(src_addr)); |
| 87 | break; |
| 88 | case ETH_P_PAE: |
| 89 | - drv_event_eapol_rx2(drv->ctx, src_addr, |
| 90 | + drv_event_eapol_rx2(bss->ctx, src_addr, |
| 91 | nla_data(tb[NL80211_ATTR_FRAME]), |
| 92 | nla_len(tb[NL80211_ATTR_FRAME]), |
| 93 | encrypted, link_id); |
| 94 | @@ -3698,10 +3698,11 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, |
| 95 | |
| 96 | |
| 97 | static void |
| 98 | -nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, |
| 99 | +nl80211_control_port_frame_tx_status(struct i802_bss *bss, |
| 100 | const u8 *frame, size_t len, |
| 101 | struct nlattr *ack, struct nlattr *cookie) |
| 102 | { |
| 103 | + struct wpa_driver_nl80211_data *drv = bss->drv; |
| 104 | union wpa_event_data event; |
| 105 | |
| 106 | if (!cookie || len < ETH_HLEN) |
| 107 | @@ -3720,7 +3721,7 @@ nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, |
| 108 | nla_get_u64(cookie) == drv->eapol_tx_cookie ? |
| 109 | drv->eapol_tx_link_id : NL80211_DRV_LINK_ID_NA; |
| 110 | |
| 111 | - wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event); |
| 112 | + wpa_supplicant_event(bss->ctx, EVENT_EAPOL_TX_STATUS, &event); |
| 113 | } |
| 114 | |
| 115 | |
| 116 | @@ -4065,7 +4066,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, |
| 117 | case NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS: |
| 118 | if (!frame) |
| 119 | break; |
| 120 | - nl80211_control_port_frame_tx_status(drv, |
| 121 | + nl80211_control_port_frame_tx_status(bss, |
| 122 | nla_data(frame), |
| 123 | nla_len(frame), |
| 124 | tb[NL80211_ATTR_ACK], |
| 125 | @@ -4238,7 +4239,7 @@ int process_bss_event(struct nl_msg *msg, void *arg) |
| 126 | nl80211_external_auth(bss->drv, tb); |
| 127 | break; |
| 128 | case NL80211_CMD_CONTROL_PORT_FRAME: |
| 129 | - nl80211_control_port_frame(bss->drv, tb); |
| 130 | + nl80211_control_port_frame(bss, tb); |
| 131 | break; |
| 132 | default: |
| 133 | wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event " |
| 134 | -- |
| 135 | 2.39.2 |
| 136 | |