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);