wifi: Added group interface name in P2pProvisionDiscoveryCompleted event
Added group interface name in the notification of provision discovery
frame. A group interface name will be added if the provision discovery
request contains P2P Group ID attribute. i.e., when the Peer device tries
to join the existing P2P group owner.
Bug: 296063280
Test: vts test
Test: Ran P2P negotiated connection tests via Wi-Fi Direct settings
window.
Change-Id: I89c6d64b6d4095ac95cef1fbcd041f7c2dd74647
This commit is contained in:
@@ -613,7 +613,7 @@ void wpas_aidl_notify_p2p_invitation_result(
|
||||
void wpas_aidl_notify_p2p_provision_discovery(
|
||||
struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status, u16 config_methods,
|
||||
unsigned int generated_pin)
|
||||
unsigned int generated_pin, const char *group_ifname)
|
||||
{
|
||||
if (!wpa_s || !dev_addr)
|
||||
return;
|
||||
@@ -628,7 +628,8 @@ void wpas_aidl_notify_p2p_provision_discovery(
|
||||
return;
|
||||
|
||||
aidl_manager->notifyP2pProvisionDiscovery(
|
||||
wpa_s, dev_addr, request, status, config_methods, generated_pin);
|
||||
wpa_s, dev_addr, request, status, config_methods,
|
||||
generated_pin, group_ifname);
|
||||
}
|
||||
|
||||
void wpas_aidl_notify_p2p_sd_response(
|
||||
|
||||
@@ -95,7 +95,7 @@ extern "C"
|
||||
void wpas_aidl_notify_p2p_provision_discovery(
|
||||
struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status, u16 config_methods,
|
||||
unsigned int generated_pin);
|
||||
unsigned int generated_pin, const char *group_ifname);
|
||||
void wpas_aidl_notify_p2p_sd_response(
|
||||
struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
|
||||
const u8 *tlvs, size_t tlvs_len);
|
||||
@@ -253,7 +253,7 @@ static void wpas_aidl_notify_p2p_invitation_result(
|
||||
static void wpas_aidl_notify_p2p_provision_discovery(
|
||||
struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status, u16 config_methods,
|
||||
unsigned int generated_pin)
|
||||
unsigned int generated_pin, const char *group_ifname)
|
||||
{}
|
||||
static void wpas_aidl_notify_p2p_sd_response(
|
||||
struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
|
||||
|
||||
@@ -1558,7 +1558,7 @@ void AidlManager::notifyP2pInvitationResult(
|
||||
void AidlManager::notifyP2pProvisionDiscovery(
|
||||
struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status, u16 config_methods,
|
||||
unsigned int generated_pin)
|
||||
unsigned int generated_pin, const char *group_ifname)
|
||||
{
|
||||
if (!wpa_s || !dev_addr)
|
||||
return;
|
||||
@@ -1567,20 +1567,24 @@ void AidlManager::notifyP2pProvisionDiscovery(
|
||||
p2p_iface_object_map_.end())
|
||||
return;
|
||||
|
||||
std::string aidl_generated_pin;
|
||||
P2pProvisionDiscoveryCompletedEventParams params;
|
||||
params.p2pDeviceAddress = macAddrToArray(dev_addr);
|
||||
params.isRequest = (request == 1);
|
||||
params.status = static_cast<P2pProvDiscStatusCode>(status);
|
||||
params.configMethods = static_cast<WpsConfigMethods>(config_methods);
|
||||
if (generated_pin > 0) {
|
||||
aidl_generated_pin =
|
||||
params.generatedPin =
|
||||
misc_utils::convertWpsPinToString(generated_pin);
|
||||
}
|
||||
bool aidl_is_request = (request == 1 ? true : false);
|
||||
if (group_ifname != NULL) {
|
||||
params.groupInterfaceName = misc_utils::charBufToString(group_ifname);
|
||||
}
|
||||
|
||||
callWithEachP2pIfaceCallback(
|
||||
misc_utils::charBufToString(wpa_s->ifname),
|
||||
std::bind(
|
||||
&ISupplicantP2pIfaceCallback::onProvisionDiscoveryCompleted,
|
||||
std::placeholders::_1, macAddrToVec(dev_addr), aidl_is_request,
|
||||
static_cast<P2pProvDiscStatusCode>(status),
|
||||
static_cast<WpsConfigMethods>(config_methods), aidl_generated_pin));
|
||||
&ISupplicantP2pIfaceCallback::onProvisionDiscoveryCompletedEvent,
|
||||
std::placeholders::_1, params));
|
||||
}
|
||||
|
||||
void AidlManager::notifyP2pSdResponse(
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
void notifyP2pProvisionDiscovery(
|
||||
struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status, u16 config_methods,
|
||||
unsigned int generated_pin);
|
||||
unsigned int generated_pin, const char *group_ifname);
|
||||
void notifyP2pSdResponse(
|
||||
struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
|
||||
const u8 *tlvs, size_t tlvs_len);
|
||||
|
||||
@@ -793,6 +793,10 @@ void wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
|
||||
* @status: Valid only in case of response (0 in case of success)
|
||||
* @config_methods: WPS config methods
|
||||
* @generated_pin: PIN to be displayed in case of WPS_CONFIG_DISPLAY method
|
||||
* @group_ifname: Group interface name of the group owner in case the provision
|
||||
* discovery request is received with P2P Group ID attribute.
|
||||
* i.e., valid only when the peer device is joining an
|
||||
* operating P2P group.
|
||||
*
|
||||
* This can be used to notify:
|
||||
* - Requests or responses
|
||||
@@ -803,7 +807,8 @@ void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status,
|
||||
u16 config_methods,
|
||||
unsigned int generated_pin)
|
||||
unsigned int generated_pin,
|
||||
const char *group_ifname)
|
||||
{
|
||||
wpas_dbus_signal_p2p_provision_discovery(wpa_s, dev_addr, request,
|
||||
status, config_methods,
|
||||
@@ -811,7 +816,7 @@ void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
||||
|
||||
wpas_aidl_notify_p2p_provision_discovery(wpa_s, dev_addr, request,
|
||||
status, config_methods,
|
||||
generated_pin);
|
||||
generated_pin, group_ifname);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,8 @@ void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status,
|
||||
u16 config_methods,
|
||||
unsigned int generated_pin);
|
||||
unsigned int generated_pin,
|
||||
const char *group_ifname);
|
||||
void wpas_notify_p2p_group_started(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid, int persistent,
|
||||
int client, const u8 *ip);
|
||||
|
||||
@@ -2904,7 +2904,7 @@ static void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods,
|
||||
wpa_printf(MSG_DEBUG, "P2P: Could not generate PIN");
|
||||
wpas_notify_p2p_provision_discovery(
|
||||
wpa_s, peer, 0 /* response */,
|
||||
P2P_PROV_DISC_INFO_UNAVAILABLE, 0, 0);
|
||||
P2P_PROV_DISC_INFO_UNAVAILABLE, 0, 0, NULL);
|
||||
return;
|
||||
}
|
||||
wpas_prov_disc_local_display(wpa_s, peer, params,
|
||||
@@ -2917,7 +2917,8 @@ static void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods,
|
||||
|
||||
wpas_notify_p2p_provision_discovery(wpa_s, peer, 1 /* request */,
|
||||
P2P_PROV_DISC_SUCCESS,
|
||||
config_methods, generated_pin);
|
||||
config_methods, generated_pin,
|
||||
group ? group->ifname : NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -2955,7 +2956,7 @@ static void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods)
|
||||
wpa_printf(MSG_DEBUG, "P2P: Could not generate PIN");
|
||||
wpas_notify_p2p_provision_discovery(
|
||||
wpa_s, peer, 0 /* response */,
|
||||
P2P_PROV_DISC_INFO_UNAVAILABLE, 0, 0);
|
||||
P2P_PROV_DISC_INFO_UNAVAILABLE, 0, 0, NULL);
|
||||
return;
|
||||
}
|
||||
wpas_prov_disc_local_display(wpa_s, peer, params,
|
||||
@@ -2966,7 +2967,8 @@ static void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods)
|
||||
|
||||
wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */,
|
||||
P2P_PROV_DISC_SUCCESS,
|
||||
config_methods, generated_pin);
|
||||
config_methods, generated_pin,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -3013,7 +3015,7 @@ static void wpas_prov_disc_fail(void *ctx, const u8 *peer,
|
||||
}
|
||||
|
||||
wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */,
|
||||
status, 0, 0);
|
||||
status, 0, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user