aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaya Erez <qca_merez@qca.qualcomm.com>2017-12-14 11:53:08 -0500
committerKalle Valo <kvalo@codeaurora.org>2018-01-09 03:03:21 -0500
commit594b59ec70e14f9cdb901f9e2c7c6a771c6231fa (patch)
tree8c060bcb0c9df1949b26c823d7bfee95b6e38c97
parent38e4c25d606920f4120c4f050657fa8ee736c8d7 (diff)
wil6210: set platform features based on FW capabilities
In some cases the platform should be aware of the FW capabilities to decide which feature to enable. For example, FW can control the external REF clock for power saving. Driver should notify the platform about that, to allow platform power management optimization. Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c11
-rw-r--r--drivers/net/wireless/ath/wil6210/wil_platform.h6
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index bafd8d515618..7a8f8c209af8 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -771,6 +771,7 @@ static void wil_collect_fw_info(struct wil6210_priv *wil)
771void wil_refresh_fw_capabilities(struct wil6210_priv *wil) 771void wil_refresh_fw_capabilities(struct wil6210_priv *wil)
772{ 772{
773 struct wiphy *wiphy = wil_to_wiphy(wil); 773 struct wiphy *wiphy = wil_to_wiphy(wil);
774 int features;
774 775
775 wil->keep_radio_on_during_sleep = 776 wil->keep_radio_on_during_sleep =
776 test_bit(WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND, 777 test_bit(WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND,
@@ -792,6 +793,16 @@ void wil_refresh_fw_capabilities(struct wil6210_priv *wil)
792 wiphy->max_sched_scan_ie_len = WMI_MAX_IE_LEN; 793 wiphy->max_sched_scan_ie_len = WMI_MAX_IE_LEN;
793 wiphy->max_sched_scan_plans = WMI_MAX_PLANS_NUM; 794 wiphy->max_sched_scan_plans = WMI_MAX_PLANS_NUM;
794 } 795 }
796
797 if (wil->platform_ops.set_features) {
798 features = (test_bit(WMI_FW_CAPABILITY_REF_CLOCK_CONTROL,
799 wil->fw_capabilities) &&
800 test_bit(WIL_PLATFORM_CAPA_EXT_CLK,
801 wil->platform_capa)) ?
802 BIT(WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL) : 0;
803
804 wil->platform_ops.set_features(wil->platform_handle, features);
805 }
795} 806}
796 807
797void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r) 808void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
diff --git a/drivers/net/wireless/ath/wil6210/wil_platform.h b/drivers/net/wireless/ath/wil6210/wil_platform.h
index 5cfb946caff7..177026e5323b 100644
--- a/drivers/net/wireless/ath/wil6210/wil_platform.h
+++ b/drivers/net/wireless/ath/wil6210/wil_platform.h
@@ -27,6 +27,11 @@ enum wil_platform_event {
27 WIL_PLATFORM_EVT_POST_SUSPEND = 4, 27 WIL_PLATFORM_EVT_POST_SUSPEND = 4,
28}; 28};
29 29
30enum wil_platform_features {
31 WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL = 0,
32 WIL_PLATFORM_FEATURE_MAX,
33};
34
30enum wil_platform_capa { 35enum wil_platform_capa {
31 WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND = 0, 36 WIL_PLATFORM_CAPA_RADIO_ON_IN_SUSPEND = 0,
32 WIL_PLATFORM_CAPA_T_PWR_ON_0 = 1, 37 WIL_PLATFORM_CAPA_T_PWR_ON_0 = 1,
@@ -45,6 +50,7 @@ struct wil_platform_ops {
45 void (*uninit)(void *handle); 50 void (*uninit)(void *handle);
46 int (*notify)(void *handle, enum wil_platform_event evt); 51 int (*notify)(void *handle, enum wil_platform_event evt);
47 int (*get_capa)(void *handle); 52 int (*get_capa)(void *handle);
53 void (*set_features)(void *handle, int features);
48}; 54};
49 55
50/** 56/**
diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
index c7b84d16a582..d3e75f0ff245 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.h
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -72,6 +72,7 @@ enum wmi_fw_capability {
72 WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE = 13, 72 WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE = 13,
73 WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP = 14, 73 WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP = 14,
74 WMI_FW_CAPABILITY_PNO = 15, 74 WMI_FW_CAPABILITY_PNO = 15,
75 WMI_FW_CAPABILITY_REF_CLOCK_CONTROL = 18,
75 WMI_FW_CAPABILITY_MAX, 76 WMI_FW_CAPABILITY_MAX,
76}; 77};
77 78