|
@@ -8342,106 +8342,11 @@ static int iw_setnone_getnone(struct net_device *dev,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler
|
|
|
- * @dev: device upon which the ioctl was received
|
|
|
- * @info: ioctl request information
|
|
|
- * @wrqu: ioctl request data
|
|
|
- * @extra: ioctl extra data
|
|
|
- *
|
|
|
- * This is an SSR-protected generic handler for private ioctls which
|
|
|
- * take multiple arguments. Note that this implementation is also
|
|
|
- * somewhat unique in that it is shared by both STA-mode and SAP-mode
|
|
|
- * interfaces.
|
|
|
- *
|
|
|
- * Return: 0 on success, non-zero on error
|
|
|
- */
|
|
|
-static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
- struct iw_request_info *info,
|
|
|
- union iwreq_data *wrqu, char *extra)
|
|
|
+#ifdef MPC_UT_FRAMEWORK
|
|
|
+static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx,
|
|
|
+ hdd_adapter_t *adapter, int sub_cmd, int *apps_args)
|
|
|
{
|
|
|
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
|
|
- int sub_cmd;
|
|
|
- int *apps_args = (int *) extra;
|
|
|
- hdd_context_t *hdd_ctx;
|
|
|
- int ret, num_args;
|
|
|
-
|
|
|
- ENTER_DEV(dev);
|
|
|
-
|
|
|
- hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
|
|
|
- ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (0 != ret)
|
|
|
- return ret;
|
|
|
-
|
|
|
- if (extra == NULL) {
|
|
|
- hdd_err("NULL extra buffer pointer");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- sub_cmd = wrqu->data.flags;
|
|
|
- num_args = wrqu->data.length;
|
|
|
-
|
|
|
- hdd_notice("Received length %d", wrqu->data.length);
|
|
|
-
|
|
|
- switch (sub_cmd) {
|
|
|
- case WE_IBSS_GET_PEER_INFO:
|
|
|
- {
|
|
|
- pr_info("Station ID = %d\n", apps_args[0]);
|
|
|
- hdd_wlan_get_ibss_peer_info(pAdapter, apps_args[0]);
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case WE_P2P_NOA_CMD:
|
|
|
- {
|
|
|
- p2p_app_setP2pPs_t p2pNoA;
|
|
|
-
|
|
|
- if (pAdapter->device_mode != QDF_P2P_GO_MODE) {
|
|
|
- hdd_err("Setting NoA is not allowed in Device mode %s(%d)",
|
|
|
- hdd_device_mode_to_string(
|
|
|
- pAdapter->device_mode),
|
|
|
- pAdapter->device_mode);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- p2pNoA.opp_ps = apps_args[0];
|
|
|
- p2pNoA.ctWindow = apps_args[1];
|
|
|
- p2pNoA.duration = apps_args[2];
|
|
|
- p2pNoA.interval = apps_args[3];
|
|
|
- p2pNoA.count = apps_args[4];
|
|
|
- p2pNoA.single_noa_duration = apps_args[5];
|
|
|
- p2pNoA.psSelection = apps_args[6];
|
|
|
-
|
|
|
- hdd_notice("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
|
|
|
- apps_args[0], apps_args[1], apps_args[2],
|
|
|
- apps_args[3], apps_args[4],
|
|
|
- apps_args[5], apps_args[6]);
|
|
|
-
|
|
|
- hdd_set_p2p_ps(dev, &p2pNoA);
|
|
|
-
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD:
|
|
|
- {
|
|
|
- hdd_notice("SELECTIVE_MODULE_LOG %d arg1 %d arg2",
|
|
|
- apps_args[0], apps_args[1]);
|
|
|
- qdf_trace_enable(apps_args[0], apps_args[1]);
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case WE_MTRACE_DUMP_CMD:
|
|
|
- {
|
|
|
- hdd_notice("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ",
|
|
|
- apps_args[0], apps_args[1],
|
|
|
- apps_args[2], apps_args[3]);
|
|
|
- qdf_trace_dump_all((void *)hHal, apps_args[0],
|
|
|
- apps_args[1], apps_args[2],
|
|
|
- apps_args[3]);
|
|
|
-
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
+ switch(sub_cmd) {
|
|
|
case WE_POLICY_MANAGER_CLIST_CMD:
|
|
|
{
|
|
|
hdd_err("<iwpriv wlan0 pm_clist> is called");
|
|
@@ -8504,34 +8409,12 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
- case WE_POLICY_MANAGER_CINFO_CMD:
|
|
|
- {
|
|
|
- struct cds_conc_connection_info *conn_info;
|
|
|
- uint32_t i = 0, len = 0;
|
|
|
-
|
|
|
- hdd_err("<iwpriv wlan0 pm_cinfo> is called");
|
|
|
- conn_info = cds_get_conn_info(&len);
|
|
|
- pr_info("+-----------------------------+\n");
|
|
|
- for (i = 0; i < len; i++) {
|
|
|
- pr_info("|table_index[%d]\t\t|\n", i);
|
|
|
- pr_info("|\t|vdev_id - %d\t\t|\n", conn_info->vdev_id);
|
|
|
- pr_info("|\t|chan - %d\t\t|\n", conn_info->chan);
|
|
|
- pr_info("|\t|bw - %d\t\t|\n", conn_info->bw);
|
|
|
- pr_info("|\t|mode - %d\t\t|\n", conn_info->mode);
|
|
|
- pr_info("|\t|mac - %d\t\t|\n", conn_info->mac);
|
|
|
- pr_info("|\t|in_use - %d\t\t|\n", conn_info->in_use);
|
|
|
- pr_info("+-----------------------------+\n");
|
|
|
- conn_info++;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
case WE_POLICY_SET_HW_MODE_CMD:
|
|
|
{
|
|
|
if (apps_args[0] == 0) {
|
|
|
hdd_err("set hw mode for single mac");
|
|
|
cds_pdev_set_hw_mode(
|
|
|
- pAdapter->sessionId,
|
|
|
+ adapter->sessionId,
|
|
|
HW_MODE_SS_2x2,
|
|
|
HW_MODE_80_MHZ,
|
|
|
HW_MODE_SS_0x0, HW_MODE_BW_NONE,
|
|
@@ -8542,7 +8425,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
} else if (apps_args[0] == 1) {
|
|
|
hdd_err("set hw mode for dual mac");
|
|
|
cds_pdev_set_hw_mode(
|
|
|
- pAdapter->sessionId,
|
|
|
+ adapter->sessionId,
|
|
|
HW_MODE_SS_1x1,
|
|
|
HW_MODE_80_MHZ,
|
|
|
HW_MODE_SS_1x1, HW_MODE_40_MHZ,
|
|
@@ -8557,13 +8440,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
|
|
|
{
|
|
|
enum cds_conc_next_action action;
|
|
|
- hdd_err("<iwpriv wlan0 pm_query_action> is called");
|
|
|
- action = cds_current_connections_update(pAdapter->sessionId,
|
|
|
+ hdd_notice("<iwpriv wlan0 pm_query_action> is called");
|
|
|
+ action = cds_current_connections_update(adapter->sessionId,
|
|
|
apps_args[0],
|
|
|
SIR_UPDATE_REASON_UT);
|
|
|
pr_info("next action is %d {HDD_NOP = 0, HDD_DBS, HDD_DBS_DOWNGRADE, HDD_MCC, HDD_MCC_UPGRADE}", action);
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
|
|
|
{
|
|
|
bool allow;
|
|
@@ -8617,6 +8501,139 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
print_report(hdd_ctx);
|
|
|
}
|
|
|
break;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#else
|
|
|
+static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx,
|
|
|
+ hdd_adapter_t *adapter, int sub_cmd, int *apps_args)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler
|
|
|
+ * @dev: device upon which the ioctl was received
|
|
|
+ * @info: ioctl request information
|
|
|
+ * @wrqu: ioctl request data
|
|
|
+ * @extra: ioctl extra data
|
|
|
+ *
|
|
|
+ * This is an SSR-protected generic handler for private ioctls which
|
|
|
+ * take multiple arguments. Note that this implementation is also
|
|
|
+ * somewhat unique in that it is shared by both STA-mode and SAP-mode
|
|
|
+ * interfaces.
|
|
|
+ *
|
|
|
+ * Return: 0 on success, non-zero on error
|
|
|
+ */
|
|
|
+static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
+ struct iw_request_info *info,
|
|
|
+ union iwreq_data *wrqu, char *extra)
|
|
|
+{
|
|
|
+ hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
+ tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
|
|
+ int sub_cmd;
|
|
|
+ int *apps_args = (int *) extra;
|
|
|
+ hdd_context_t *hdd_ctx;
|
|
|
+ int ret, num_args;
|
|
|
+
|
|
|
+ ENTER_DEV(dev);
|
|
|
+
|
|
|
+ hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
|
|
|
+ ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (0 != ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ if (extra == NULL) {
|
|
|
+ hdd_err("NULL extra buffer pointer");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ sub_cmd = wrqu->data.flags;
|
|
|
+ num_args = wrqu->data.length;
|
|
|
+
|
|
|
+ hdd_notice("Received length %d", wrqu->data.length);
|
|
|
+
|
|
|
+ switch (sub_cmd) {
|
|
|
+ case WE_IBSS_GET_PEER_INFO:
|
|
|
+ {
|
|
|
+ pr_info("Station ID = %d\n", apps_args[0]);
|
|
|
+ hdd_wlan_get_ibss_peer_info(pAdapter, apps_args[0]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case WE_P2P_NOA_CMD:
|
|
|
+ {
|
|
|
+ p2p_app_setP2pPs_t p2pNoA;
|
|
|
+
|
|
|
+ if (pAdapter->device_mode != QDF_P2P_GO_MODE) {
|
|
|
+ hdd_err("Setting NoA is not allowed in Device mode %s(%d)",
|
|
|
+ hdd_device_mode_to_string(
|
|
|
+ pAdapter->device_mode),
|
|
|
+ pAdapter->device_mode);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ p2pNoA.opp_ps = apps_args[0];
|
|
|
+ p2pNoA.ctWindow = apps_args[1];
|
|
|
+ p2pNoA.duration = apps_args[2];
|
|
|
+ p2pNoA.interval = apps_args[3];
|
|
|
+ p2pNoA.count = apps_args[4];
|
|
|
+ p2pNoA.single_noa_duration = apps_args[5];
|
|
|
+ p2pNoA.psSelection = apps_args[6];
|
|
|
+
|
|
|
+ hdd_notice("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
|
|
|
+ apps_args[0], apps_args[1], apps_args[2],
|
|
|
+ apps_args[3], apps_args[4],
|
|
|
+ apps_args[5], apps_args[6]);
|
|
|
+
|
|
|
+ hdd_set_p2p_ps(dev, &p2pNoA);
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD:
|
|
|
+ {
|
|
|
+ hdd_notice("SELECTIVE_MODULE_LOG %d arg1 %d arg2",
|
|
|
+ apps_args[0], apps_args[1]);
|
|
|
+ qdf_trace_enable(apps_args[0], apps_args[1]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case WE_MTRACE_DUMP_CMD:
|
|
|
+ {
|
|
|
+ hdd_notice("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ",
|
|
|
+ apps_args[0], apps_args[1],
|
|
|
+ apps_args[2], apps_args[3]);
|
|
|
+ qdf_trace_dump_all((void *)hHal, apps_args[0],
|
|
|
+ apps_args[1], apps_args[2],
|
|
|
+ apps_args[3]);
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case WE_POLICY_MANAGER_CINFO_CMD:
|
|
|
+ {
|
|
|
+ struct cds_conc_connection_info *conn_info;
|
|
|
+ uint32_t i = 0, len = 0;
|
|
|
+
|
|
|
+ hdd_info("<iwpriv wlan0 pm_cinfo> is called");
|
|
|
+ conn_info = cds_get_conn_info(&len);
|
|
|
+ pr_info("+--------------------------+\n");
|
|
|
+ for (i = 0; i < len; i++) {
|
|
|
+ pr_info("|table_index[%d]\t\t\n", i);
|
|
|
+ pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id);
|
|
|
+ pr_info("|\t|chan - %-10d|\n", conn_info->chan);
|
|
|
+ pr_info("|\t|bw - %-10d|\n", conn_info->bw);
|
|
|
+ pr_info("|\t|mode - %-10d|\n", conn_info->mode);
|
|
|
+ pr_info("|\t|mac - %-10d|\n", conn_info->mac);
|
|
|
+ pr_info("|\t|in_use - %-10d|\n", conn_info->in_use);
|
|
|
+ pr_info("+--------------------------+\n");
|
|
|
+ conn_info++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
|
|
|
#ifdef FEATURE_WLAN_TDLS
|
|
|
case WE_TDLS_CONFIG_PARAMS:
|
|
@@ -8754,6 +8771,20 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+ case WE_POLICY_MANAGER_CLIST_CMD:
|
|
|
+ case WE_POLICY_MANAGER_DLIST_CMD:
|
|
|
+ case WE_POLICY_MANAGER_ULIST_CMD:
|
|
|
+ case WE_POLICY_MANAGER_DBS_CMD:
|
|
|
+ case WE_POLICY_MANAGER_PCL_CMD:
|
|
|
+ case WE_POLICY_SET_HW_MODE_CMD:
|
|
|
+ case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
|
|
|
+ case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
|
|
|
+ case WE_POLICY_MANAGER_SCENARIO_CMD:
|
|
|
+ {
|
|
|
+ iw_get_policy_manager_ut_ops(hdd_ctx, pAdapter,
|
|
|
+ sub_cmd, apps_args);
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
{
|
|
|
hdd_err("Invalid IOCTL command %d", sub_cmd);
|
|
@@ -11392,6 +11423,12 @@ static const struct iw_priv_args we_private_args[] = {
|
|
|
IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
|
|
0,
|
|
|
"dumplog"},
|
|
|
+
|
|
|
+ {WE_POLICY_MANAGER_CINFO_CMD,
|
|
|
+ IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
|
|
+ 0,
|
|
|
+ "pm_cinfo"},
|
|
|
+
|
|
|
#ifdef MPC_UT_FRAMEWORK
|
|
|
{WE_POLICY_MANAGER_CLIST_CMD,
|
|
|
IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
|
@@ -11413,11 +11450,6 @@ static const struct iw_priv_args we_private_args[] = {
|
|
|
0,
|
|
|
"pm_pcl"},
|
|
|
|
|
|
- {WE_POLICY_MANAGER_CINFO_CMD,
|
|
|
- IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
|
|
- 0,
|
|
|
- "pm_cinfo"},
|
|
|
-
|
|
|
{WE_POLICY_MANAGER_ULIST_CMD,
|
|
|
IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
|
|
0,
|