sm8250-common: qsap: add wifi_qsap_set_tx_power
Change-Id: I9ef277db6f4e068e7b92710f6039b4f261d72282
This commit is contained in:
parent
cb80d968d3
commit
22daf1fca5
42
qsap/qsap.c
42
qsap/qsap.c
@ -708,3 +708,45 @@ s32 wifi_qsap_stop_wigig_softap(void)
|
|||||||
usleep(AP_BSS_STOP_DELAY);
|
usleep(AP_BSS_STOP_DELAY);
|
||||||
return eSUCCESS;
|
return eSUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s32 wifi_qsap_set_tx_power(s32 tx_power)
|
||||||
|
{
|
||||||
|
#define QCSAP_IOCTL_SET_MAX_TX_POWER (SIOCIWFIRSTPRIV + 22)
|
||||||
|
s32 sock;
|
||||||
|
s32 ret = eERR_SET_TX_POWER;
|
||||||
|
s8 interface[128];
|
||||||
|
s8 *iface;
|
||||||
|
s32 len = 128;
|
||||||
|
struct iwreq wrq;
|
||||||
|
|
||||||
|
if(NULL == (iface = qsap_get_config_value(CONFIG_FILE, &qsap_str[STR_INTERFACE], interface, (u32*)&len))) {
|
||||||
|
ALOGE("%s :interface error \n", __func__);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Issue QCSAP_IOCTL_SET_MAX_TX_POWER ioctl */
|
||||||
|
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
|
||||||
|
if (sock < 0) {
|
||||||
|
ALOGE("%s :socket error \n", __func__);
|
||||||
|
return eERR_SET_TX_POWER;
|
||||||
|
}
|
||||||
|
|
||||||
|
strlcpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name));
|
||||||
|
wrq.u.data.length = sizeof(s32);
|
||||||
|
wrq.u.data.pointer = &tx_power;
|
||||||
|
wrq.u.data.flags = 0;
|
||||||
|
|
||||||
|
ret = ioctl(sock, QCSAP_IOCTL_SET_MAX_TX_POWER, &wrq);
|
||||||
|
close(sock);
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
ALOGE("%s :IOCTL set tx power failed: %d\n", __func__, ret);
|
||||||
|
ret = eERR_SET_TX_POWER;
|
||||||
|
} else {
|
||||||
|
ALOGD("%s :IOCTL set tx power issued\n", __func__);
|
||||||
|
ret = eSUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@ -48,6 +48,7 @@ s32 wifi_qsap_start_wigig_softap(void);
|
|||||||
s32 wifi_qsap_stop_wigig_softap(void);
|
s32 wifi_qsap_stop_wigig_softap(void);
|
||||||
s32 wifi_qsap_reload_softap(void);
|
s32 wifi_qsap_reload_softap(void);
|
||||||
s32 wifi_qsap_unload_wifi_sta_driver(void);
|
s32 wifi_qsap_unload_wifi_sta_driver(void);
|
||||||
|
s32 wifi_qsap_set_tx_power(s32 tx_power);
|
||||||
|
|
||||||
#ifdef QCOM_WLAN_CONCURRENCY
|
#ifdef QCOM_WLAN_CONCURRENCY
|
||||||
s32 wifi_qsap_start_softap_in_concurrency(void);
|
s32 wifi_qsap_start_softap_in_concurrency(void);
|
||||||
|
@ -77,7 +77,8 @@ enum error_val {
|
|||||||
eERR_LOAD_FAILED_SDIOIF,
|
eERR_LOAD_FAILED_SDIOIF,
|
||||||
eERR_LOAD_FAILED_SOFTAP,
|
eERR_LOAD_FAILED_SOFTAP,
|
||||||
eERR_SET_CHAN_RANGE,
|
eERR_SET_CHAN_RANGE,
|
||||||
eERR_GET_AUTO_CHAN
|
eERR_GET_AUTO_CHAN,
|
||||||
|
eERR_SET_TX_POWER
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef WIFI_DRIVER_CONF_FILE
|
#ifndef WIFI_DRIVER_CONF_FILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user