|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * 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
|
|
@@ -27,6 +27,7 @@ QDF_STATUS wlan_twt_cfg_init(struct wlan_objmgr_psoc *psoc)
|
|
|
struct twt_psoc_priv_obj *twt_psoc;
|
|
|
psoc_twt_ext_cfg_params_t *twt_cfg;
|
|
|
uint32_t bcast_conf;
|
|
|
+ uint32_t rtwt_conf;
|
|
|
|
|
|
if (!psoc) {
|
|
|
twt_err("null psoc");
|
|
@@ -42,6 +43,8 @@ QDF_STATUS wlan_twt_cfg_init(struct wlan_objmgr_psoc *psoc)
|
|
|
|
|
|
twt_cfg = &twt_psoc->cfg_params;
|
|
|
bcast_conf = cfg_get(psoc, CFG_BCAST_TWT_REQ_RESP);
|
|
|
+ rtwt_conf = cfg_get(psoc, CFG_RTWT_REQ_RESP);
|
|
|
+
|
|
|
|
|
|
twt_cfg->enable_twt = cfg_get(psoc, CFG_ENABLE_TWT);
|
|
|
twt_cfg->twt_requestor = cfg_get(psoc, CFG_TWT_REQUESTOR);
|
|
@@ -55,6 +58,8 @@ QDF_STATUS wlan_twt_cfg_init(struct wlan_objmgr_psoc *psoc)
|
|
|
twt_cfg->is_twt_enabled_in_11n = cfg_get(psoc, CFG_TWT_ENABLE_IN_11N);
|
|
|
twt_cfg->req_flag = false;
|
|
|
twt_cfg->res_flag = false;
|
|
|
+ twt_cfg->rtwt_requestor_enabled = CFG_GET_RTWT_REQ(rtwt_conf);
|
|
|
+ twt_cfg->rtwt_responder_enabled = CFG_GET_RTWT_RES(rtwt_conf);
|
|
|
|
|
|
twt_debug("req: %d resp: %d", twt_cfg->twt_requestor,
|
|
|
twt_cfg->twt_responder);
|
|
@@ -343,6 +348,44 @@ wlan_twt_cfg_get_bcast_responder(struct wlan_objmgr_psoc *psoc, bool *val)
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+QDF_STATUS
|
|
|
+wlan_twt_cfg_get_rtwt_requestor(struct wlan_objmgr_psoc *psoc, bool *val)
|
|
|
+{
|
|
|
+ struct twt_psoc_priv_obj *twt_psoc_obj;
|
|
|
+
|
|
|
+ twt_psoc_obj = wlan_twt_psoc_get_comp_private_obj(psoc);
|
|
|
+ if (!twt_psoc_obj) {
|
|
|
+ uint32_t rtwt_req_res;
|
|
|
+
|
|
|
+ rtwt_req_res = cfg_default(CFG_RTWT_REQ_RESP);
|
|
|
+ *val = CFG_GET_RTWT_REQ(rtwt_req_res);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ *val = twt_psoc_obj->cfg_params.rtwt_requestor_enabled;
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+QDF_STATUS
|
|
|
+wlan_twt_cfg_get_rtwt_responder(struct wlan_objmgr_psoc *psoc, bool *val)
|
|
|
+{
|
|
|
+ struct twt_psoc_priv_obj *twt_psoc_obj;
|
|
|
+
|
|
|
+ twt_psoc_obj = wlan_twt_psoc_get_comp_private_obj(psoc);
|
|
|
+ if (!twt_psoc_obj) {
|
|
|
+ uint32_t rtwt_req_res;
|
|
|
+
|
|
|
+ rtwt_req_res = cfg_default(CFG_RTWT_REQ_RESP);
|
|
|
+ *val = CFG_GET_RTWT_RES(rtwt_req_res);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ *val = twt_psoc_obj->cfg_params.rtwt_responder_enabled;
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS
|
|
|
wlan_twt_cfg_get_support_in_11n_mode(struct wlan_objmgr_psoc *psoc,
|
|
|
bool *val)
|
|
@@ -368,3 +411,30 @@ wlan_twt_cfg_get_support_in_11n_mode(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+QDF_STATUS
|
|
|
+wlan_twt_get_restricted_support(struct wlan_objmgr_psoc *psoc, bool *val)
|
|
|
+{
|
|
|
+ struct twt_psoc_priv_obj *twt_psoc_obj;
|
|
|
+ psoc_twt_ext_cfg_params_t *twt_cfg;
|
|
|
+ struct twt_tgt_caps *tgt_caps;
|
|
|
+ bool enable_twt;
|
|
|
+
|
|
|
+ twt_psoc_obj = wlan_twt_psoc_get_comp_private_obj(psoc);
|
|
|
+ if (!twt_psoc_obj) {
|
|
|
+ *val = cfg_default(CFG_RTWT_REQ_RESP);
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ twt_cfg = &twt_psoc_obj->cfg_params;
|
|
|
+ tgt_caps = &twt_psoc_obj->twt_caps;
|
|
|
+ enable_twt = twt_cfg->enable_twt;
|
|
|
+
|
|
|
+ *val = QDF_MIN(tgt_caps->twt_bcast_req_support &&
|
|
|
+ tgt_caps->restricted_twt_support,
|
|
|
+ twt_cfg->bcast_requestor_enabled &&
|
|
|
+ twt_cfg->rtwt_requestor_enabled &&
|
|
|
+ enable_twt);
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|