qcacld-3.0: change mode to p2p device for p2p interface

Currently, mode of p2p virtual interface with type managed
is added as sta mode. This may cause issue during p2p find
as in function p2p_vdev_check_valid probe response frames
are dropped for sta mode.

Fix is to convert mode to P2P DEVICE mode from STA mode in
case added interface string contains p2p substring.

Change-Id: I9bf9d8c44af940b42c38cd7819bcdb9c00a90a26
CRs-Fixed: 3036500
This commit is contained in:
Vinod Kumar Myadam 2021-09-14 23:46:10 +05:30 • committed by Madan Koyyalamudi
commit 372fe9ce5c

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -803,7 +803,10 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
name_assign_type, true);
} else {
uint8_t *device_address;
if (strnstr(name, "p2p", 3) && mode == QDF_STA_MODE) {
hdd_debug("change mode to p2p device");
mode = QDF_P2P_DEVICE_MODE;
}
device_address = wlan_hdd_get_intf_addr(hdd_ctx, mode);
if (!device_address)
return ERR_PTR(-EINVAL);