summaryrefslogtreecommitdiff
path: root/wcn6740/qcwcn/wifi_hal/wificonfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wcn6740/qcwcn/wifi_hal/wificonfig.cpp')
-rw-r--r--wcn6740/qcwcn/wifi_hal/wificonfig.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp
index 989399f..5aec138 100644
--- a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp
+++ b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp
@@ -1453,3 +1453,78 @@ cleanup:
delete wifiConfigCommand;
return (wifi_error)ret;
}
+
+/**
+ * Invoked to set voip optimization mode for the provided STA iface
+ */
+ wifi_error wifi_set_voip_mode(wifi_interface_handle iface, wifi_voip_mode mode)
+{
+ int requestId, ret = 0;
+ WiFiConfigCommand *wifiConfigCommand;
+
+ struct nlattr *nlData;
+ interface_info *ifaceInfo = getIfaceInfo(iface);
+
+ wifi_handle wifiHandle = getWifiHandle(iface);
+ if (!wifiHandle) {
+ ALOGE("%s: Error wifi_handle NULL", __FUNCTION__);
+ return WIFI_ERROR_UNKNOWN;
+ }
+
+ requestId = get_requestid();
+ ALOGV("%s: voip mode=%d", __FUNCTION__, mode);
+ wifiConfigCommand = new WiFiConfigCommand(
+ wifiHandle,
+ requestId,
+ OUI_QCA,
+ QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION);
+
+ if (wifiConfigCommand == NULL) {
+ ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__);
+ return WIFI_ERROR_UNKNOWN;
+ }
+
+ /* Create the NL message. */
+ ret = wifiConfigCommand->create();
+ if (ret < 0) {
+ ALOGE("%s: failed to create NL msg. Error:%d",
+ __FUNCTION__, ret);
+ goto cleanup;
+ }
+
+ /* Set the interface Id of the message. */
+ ret = wifiConfigCommand->set_iface_id(ifaceInfo->name);
+ if (ret < 0) {
+ ALOGE("%s: failed to set iface id. Error:%d",
+ __FUNCTION__, ret);
+ goto cleanup;
+ }
+
+ /* Add the vendor specific attributes for the NL command. */
+ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA);
+ if (!nlData) {
+ ALOGE("%s: failed attr_start for VENDOR_DATA. Error:%d",
+ __FUNCTION__, ret);
+ goto cleanup;
+ }
+
+ if (wifiConfigCommand->put_u8(
+ QCA_WLAN_VENDOR_ATTR_CONFIG_WFC_STATE, (u8)mode)) {
+ ALOGE("%s: failed to put vendor data. Error:%d",
+ __FUNCTION__, ret);
+ goto cleanup;
+ }
+ wifiConfigCommand->attr_end(nlData);
+
+ /* Send the NL msg. */
+ wifiConfigCommand->waitForRsp(false);
+ ret = wifiConfigCommand->requestEvent();
+ if (ret != 0) {
+ ALOGE("%s: requestEvent Error:%d", __FUNCTION__, ret);
+ goto cleanup;
+ }
+
+cleanup:
+ delete wifiConfigCommand;
+ return (wifi_error)ret;
+}