}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
/* Stop the SME */
CsrWifiSmeWifiOffReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_LONG_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_wifi_off: unifi_mgt_wifi_off_req <-- (r=%d, status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeKeyReqSend(0, CSR_WIFI_INTERFACE_IN_USE, action, *sme_key);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
return convert_sme_error(priv->sme_reply.reply_status);
}
unifi_trace(priv, UDBG4, "sme_mgt_scan_full: -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
/* If a channel list is provided, do an active scan */
if (is_active) {
0, NULL);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_LONG_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4, "sme_mgt_scan_full: <-- (status=%d)\n", priv->sme_reply.reply_status);
- if (priv->sme_reply.reply_status == CSR_WIFI_RESULT_UNAVAILABLE) {
+ if (priv->sme_reply.reply_status == CSR_WIFI_RESULT_UNAVAILABLE)
return 0; /* initial scan already underway */
- } else {
+ else
return convert_sme_error(priv->sme_reply.reply_status);
- }
}
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeScanResultsGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_LONG_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
scan_result_list_count = priv->sme_reply.reply_scan_results_count;
scan_result_list = priv->sme_reply.reply_scan_results;
priv->connection_config.ssid.ssid);
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeConnectReqSend(0, CSR_WIFI_INTERFACE_IN_USE, priv->connection_config);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
- if (priv->sme_reply.reply_status) {
+ if (priv->sme_reply.reply_status)
unifi_trace(priv, UDBG1, "sme_mgt_connect: failed with SME status %d\n",
priv->sme_reply.reply_status);
- }
return convert_sme_error(priv->sme_reply.reply_status);
}
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeDisconnectReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4, "sme_mgt_disconnect: <-- (status=%d)\n", priv->sme_reply.reply_status);
return convert_sme_error(priv->sme_reply.reply_status);
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmePmkidReqSend(0, CSR_WIFI_INTERFACE_IN_USE, action,
pmkid_list->pmkidsCount, pmkid_list->pmkids);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4, "sme_mgt_pmkid: <-- (status=%d)\n", priv->sme_reply.reply_status);
return convert_sme_error(priv->sme_reply.reply_status);
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
priv->mib_cfm_buffer = varbind;
priv->mib_cfm_buffer_length = MAX_VARBIND_LENGTH;
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeMibSetReqSend(0, length, varbind);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4, "sme_mgt_mib_set: <-- (status=%d)\n", priv->sme_reply.reply_status);
return convert_sme_error(priv->sme_reply.reply_status);
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmePowerConfigSetReqSend(0, *powerConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_set_value_async: unifi_mgt_set_value_req <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeSmeStaConfigSetReqSend(0, CSR_WIFI_INTERFACE_IN_USE, *staConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
+
unifi_trace(priv, UDBG4,
"sme_mgt_sme_config_set: CsrWifiSmeSmeStaConfigSetReq <-- (r=%d status=%d)\n",
r, priv->sme_reply.reply_status);
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeSmeCommonConfigSetReqSend(0, *deviceConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_sme_config_set: CsrWifiSmeSmeCommonConfigSetReq <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeMibConfigSetReqSend(0, *mibConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_mib_config_set: unifi_mgt_set_mib_config_req <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeCoexConfigSetReqSend(0, *coexConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_coex_config_set: unifi_mgt_set_mib_config_req <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeHostConfigSetReqSend(0, CSR_WIFI_INTERFACE_IN_USE, *hostConfig);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_mgt_host_config_set: unifi_mgt_set_host_config_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_versions_get: unifi_mgt_versions_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeVersionsGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
if (versions != NULL) {
unifi_trace(priv, UDBG4, "sme_mgt_power_config_get: unifi_mgt_power_config_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmePowerConfigGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
if (powerConfig != NULL) {
unifi_trace(priv, UDBG4, "sme_mgt_host_config_get: unifi_mgt_host_config_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeHostConfigGetReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (hostConfig != NULL) {
+ if (hostConfig != NULL)
memcpy((unsigned char*)hostConfig,
(unsigned char*)&priv->sme_reply.hostConfig,
sizeof(CsrWifiSmeHostConfig));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_host_config_get: unifi_mgt_host_config_get_req <-- (r=%d status=%d)\n",
/* Common device config */
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeSmeCommonConfigGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (deviceConfig != NULL) {
+ if (deviceConfig != NULL)
memcpy((unsigned char*)deviceConfig,
(unsigned char*)&priv->sme_reply.deviceConfig,
sizeof(CsrWifiSmeDeviceConfig));
- }
/* STA config */
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeSmeStaConfigGetReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (staConfig != NULL) {
+ if (staConfig != NULL)
memcpy((unsigned char*)staConfig,
(unsigned char*)&priv->sme_reply.staConfig,
sizeof(CsrWifiSmeStaConfig));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_sme_config_get: unifi_mgt_sme_config_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_coex_info_get: unifi_mgt_coex_info_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeCoexInfoGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (coexInfo != NULL) {
+ if (coexInfo != NULL)
memcpy((unsigned char*)coexInfo,
(unsigned char*)&priv->sme_reply.coexInfo,
sizeof(CsrWifiSmeCoexInfo));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_coex_info_get: unifi_mgt_coex_info_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_coex_config_get: unifi_mgt_coex_config_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeCoexConfigGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (coexConfig != NULL) {
+ if (coexConfig != NULL)
memcpy((unsigned char*)coexConfig,
(unsigned char*)&priv->sme_reply.coexConfig,
sizeof(CsrWifiSmeCoexConfig));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_coex_config_get: unifi_mgt_coex_config_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_mib_config_get: unifi_mgt_mib_config_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeMibConfigGetReqSend(0);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (mibConfig != NULL) {
+ if (mibConfig != NULL)
memcpy((unsigned char*)mibConfig,
(unsigned char*)&priv->sme_reply.mibConfig,
sizeof(CsrWifiSmeMibConfig));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_mib_config_get: unifi_mgt_mib_config_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_connection_info_get: unifi_mgt_connection_info_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeConnectionInfoGetReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (connectionInfo != NULL) {
+ if (connectionInfo != NULL)
memcpy((unsigned char*)connectionInfo,
(unsigned char*)&priv->sme_reply.connectionInfo,
sizeof(CsrWifiSmeConnectionInfo));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_connection_info_get: unifi_mgt_connection_info_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_connection_config_get: unifi_mgt_connection_config_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeConnectionConfigGetReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (connectionConfig != NULL) {
+ if (connectionConfig != NULL)
memcpy((unsigned char*)connectionConfig,
(unsigned char*)&priv->sme_reply.connectionConfig,
sizeof(CsrWifiSmeConnectionConfig));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_connection_config_get: unifi_mgt_connection_config_get_req <-- (r=%d status=%d)\n",
unifi_trace(priv, UDBG4, "sme_mgt_connection_stats_get: unifi_mgt_connection_stats_get_req -->\n");
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeConnectionStatsGetReqSend(0, CSR_WIFI_INTERFACE_IN_USE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
/* store the reply */
- if (connectionStats != NULL) {
+ if (connectionStats != NULL)
memcpy((unsigned char*)connectionStats,
(unsigned char*)&priv->sme_reply.connectionStats,
sizeof(CsrWifiSmeConnectionStats));
- }
unifi_trace(priv, UDBG4,
"sme_mgt_connection_stats_get: unifi_mgt_connection_stats_get_req <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiSmeTspecReqSend(0, CSR_WIFI_INTERFACE_IN_USE,
action, tid, TRUE, 0,
tspec->length, tspec->data,
tclas->length, tclas->data);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4, "sme_mgt_tspec: <-- (status=%d)\n", priv->sme_reply.reply_status);
return convert_sme_error(priv->sme_reply.reply_status);
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
/* Suspend the SME, which MAY cause it to power down UniFi */
CsrWifiRouterCtrlSuspendIndSend(priv->CSR_WIFI_SME_IFACEQUEUE,0, 0, priv->wol_suspend);
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiRouterCtrlResumeIndSend(priv->CSR_WIFI_SME_IFACEQUEUE,0, priv->wol_suspend);
r = sme_wait_for_reply(priv, UNIFI_SME_SYS_LONG_TIMEOUT);
- if (r) {
+ if (r)
unifi_notice(priv,
"resume: SME did not reply, return success anyway\n");
- }
return 0;
}
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiNmeApStopReqSend(0,interface_tag);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_ap_stop <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiNmeApStartReqSend(0,interface_tag,CSR_WIFI_AP_TYPE_LEGACY,FALSE,
ap_config->ssid,1,ap_config->channel,
p2p_go_param,FALSE);
r = sme_wait_for_reply(priv, UNIFI_SME_MGT_SHORT_TIMEOUT);
- if (r) {
+ if (r)
return r;
- }
unifi_trace(priv, UDBG4,
"sme_ap_start <-- (r=%d status=%d)\n",
}
r = sme_init_request(priv);
- if (r) {
+ if (r)
return -EIO;
- }
CsrWifiNmeApConfigSetReqSend(0,*group_security_config,
*ap_mac_config);