qcacld-3.0: Add firmware_default mode support for elna_bypass

Previously elna_bypass is of type bool, which check for
elna_bypass enabled or disabled with en_dis

Change en_dis to elna_mode of enum extlna_mode
to support extra mode of firmware_default

Change-Id: I12dfe3a07e04b102562b11c8235d56bd3e2a7059
CRs-Fixed: 3169266
This commit is contained in:
Divyajyothi Goparaju
2022-03-10 17:36:33 +05:30
committad av Madan Koyyalamudi
förälder d29a789ae5
incheckning bce9e688e7
3 ändrade filer med 33 tillägg och 14 borttagningar

Visa fil

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -28,15 +29,31 @@
#include "wmi_unified.h" #include "wmi_unified.h"
#ifdef WLAN_FEATURE_ELNA #ifdef WLAN_FEATURE_ELNA
/**
* enum fwol_extlna_mode - provides elna modes
* @EXTLNA_MODE_DISABLE_ELNA_BYPASS - disables elna bypass
* @EXTLNA_MODE_ENABLE_ELNA_BYPASS - enables elna bypass
* @EXTLNA_MODE_FIRMWARE_DEFAULT - Reset eLNA bypass configuration,
* the driver should revert to the default
* configuration of eLNA bypass
*/
enum fwol_extlna_mode {
EXTLNA_MODE_DISABLE_ELNA_BYPASS = 0,
EXTLNA_MODE_ENABLE_ELNA_BYPASS,
EXTLNA_MODE_FIRMWARE_DEFAULT,
};
/** /**
* struct set_elna_bypass_request - set eLNA bypass request * struct set_elna_bypass_request - set eLNA bypass request
* @vdev_id: vdev id * @vdev_id: vdev id
* @en_dis: 0 - disable eLNA bypass * @elna_mode:0 - disable eLNA bypass
* 1 - enable eLNA bypass * 1 - enable eLNA bypass
* 2 - firmware default
*/ */
struct set_elna_bypass_request { struct set_elna_bypass_request {
uint8_t vdev_id; uint8_t vdev_id;
uint8_t en_dis; enum fwol_extlna_mode elna_mode;
}; };
/** /**
@@ -50,12 +67,13 @@ struct get_elna_bypass_request {
/** /**
* struct get_elna_bypass_response - get eLNA bypass response * struct get_elna_bypass_response - get eLNA bypass response
* @vdev_id: vdev id * @vdev_id: vdev id
* @en_dis: 0 - disable eLNA bypass * @elna_mode:0 - disable eLNA bypass
* 1 - enable eLNA bypass * 1 - enable eLNA bypass
* 2 - firmware default
*/ */
struct get_elna_bypass_response { struct get_elna_bypass_response {
uint8_t vdev_id; uint8_t vdev_id;
uint8_t en_dis; enum fwol_extlna_mode elna_mode;
}; };
#endif #endif

Visa fil

@@ -8184,7 +8184,7 @@ static int hdd_process_generic_set_cmd(struct hdd_adapter *adapter,
static int hdd_process_generic_set_cmd(struct hdd_adapter *adapter, static int hdd_process_generic_set_cmd(struct hdd_adapter *adapter,
struct nlattr *tb[]) struct nlattr *tb[])
{ {
return -EINVAL; return 0;
} }
#endif #endif

Visa fil

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -35,9 +36,9 @@ int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
QDF_STATUS status; QDF_STATUS status;
req.vdev_id = vdev->vdev_objmgr.vdev_id; req.vdev_id = vdev->vdev_objmgr.vdev_id;
req.en_dis = nla_get_u8(attr); req.elna_mode = nla_get_u8(attr);
if (req.en_dis > 1) { if (req.elna_mode > EXTLNA_MODE_FIRMWARE_DEFAULT) {
osif_err("Invalid elna_bypass value %d", req.en_dis); osif_err("Invalid elna_bypass value %d", req.elna_mode);
return -EINVAL; return -EINVAL;
} }
@@ -49,7 +50,7 @@ int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
} }
struct osif_get_elna_bypass_priv { struct osif_get_elna_bypass_priv {
uint8_t en_dis; enum fwol_extlna_mode elna_mode;
}; };
/** /**
@@ -73,7 +74,7 @@ os_if_fwol_get_elna_bypass_callback(void *context,
} }
priv = osif_request_priv(request); priv = osif_request_priv(request);
priv->en_dis = response->en_dis; priv->elna_mode = response->elna_mode;
osif_request_complete(request); osif_request_complete(request);
osif_request_put(request); osif_request_put(request);
@@ -120,8 +121,8 @@ int os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev *vdev,
priv = osif_request_priv(request); priv = osif_request_priv(request);
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_ELNA_BYPASS, if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_CONFIG_ELNA_BYPASS,
priv->en_dis)) { priv->elna_mode)) {
osif_err("put fail"); osif_err("put fail with elna_mode:%d", priv->elna_mode);
ret = -EINVAL; ret = -EINVAL;
} }