From 372fe9ce5cc8e09c17699a988a75e7f08d1a57b9 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Myadam Date: Tue, 14 Sep 2021 23:46:10 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_p2p.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 16cc1e458c3d..d947d31a71d0 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -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);