[PATCH 1/1] Add p2p_group_get_member_connection_info
Jouni Malinen
j at w1.fi
Sun Jan 25 10:43:51 PST 2026
On Tue, Nov 04, 2025 at 09:06:55AM +0900, 장원준 wrote:
> Implement event handling for P2P group association to record IEEE standard, and bandwidth.
> Add p2p_group_get_member_connection_info function to retrive connection capabilities of group clients.
This would leave that p2p_group_get_member_connection_info() unused,
i.e., none of the information derived here is actually used. I'm
assuming this is for some external uses, but in general, I'd prefer to
see something within hostap.git using all functionality as well. This
could be, e.g., through wpa_supplicant/ctrl_iface.c. That said, I don't
think this proposed direction is really the best way for the particular
need..
> diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
> if (req_ies) {
> - p2p_group_notif_assoc(hapd->p2p_group, sta->addr,
> + if (elems.ht_capabilities) {
> + if (!sta->ht_capabilities) {
> + sta->ht_capabilities = os_zalloc(sizeof(struct ieee80211_ht_capabilities));
> + if (!sta->ht_capabilities) {
> + wpa_printf(MSG_ERROR, "Failed to allocate memory for HT capabilities");
> + return 0;
> + }
It would be fine to fill in sta->ht_capabilities also in cases where
hostapd AP SME is not used, but ideally, this would be using the
copy_sta*() functions like the code in ieee802_11.c is doing for the AP
SME in hostapd case.
> + p2p_group_notif_assoc(hapd->p2p_group, sta,
> req_ies, req_ies_len);
This is not acceptable due to code separation between the P2P module in
src/p2p and AP code in src/ap. src/p2p/*.c is not supposed to
dereference struct sta_info directly.
> diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
> #ifdef CONFIG_P2P
> if (ies && ies_len)
> - p2p_group_notif_assoc(hapd->p2p_group, sta->addr, ies, ies_len);
> + p2p_group_notif_assoc(hapd->p2p_group, sta, ies, ies_len);
> #endif /* CONFIG_P2P */
Same here.
> diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
> +#include "ap/sta_info.h"
This is not allowed due to that code separation goal.
> diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
> @@ -26,6 +26,11 @@ struct p2p_group_member {
> struct wpabuf *wfd_ie;
> struct wpabuf *client_info;
> u8 dev_capab;
> + unsigned int connection_ht:1;
> + unsigned int connection_vht:1;
> + unsigned int connection_he:1;
> + unsigned int connection_eht:1;
> + unsigned int connection_channel_bandwidth:5;
Why would these be needed in any P2P specific code? This information
would be available on the P2P GO from the STA entries (i.e., struct
sta_info) and all this information could and should be made available
through that mechanism instead of any new P2P specific code.
For this particular set of information, it would be more appropriate to
extend ieee802_11_get_mib_sta() to provide that information and use
interface like the existing STA-FIRST/STA/STA-NEXT in the wpa_supplicant
control interface to access the information.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list