Compare commits

...

60 Commits

Author SHA1 Message Date
Steve Kondik
fc46d223c6 Merge branch 'LA.BF64.1.2.2_rb4.1' of git://codeaurora.org/platform/system/qcom into caf-merge 2015-10-12 09:53:07 -10:00
Linux Build Service Account
c46bf72725 Merge "Modify NDC commands to write to hostapd.conf" 2015-09-22 20:58:29 -07:00
Linux Build Service Account
bb81a3fc87 Merge "wlan: Add support for 11AC, ACS hostapd config" 2015-09-22 20:58:29 -07:00
Pradeep Reddy POTTETI
a1c6f1dbe5 Provide read/write access on accept/deny files to hostapd
This commit provides read/write access on accept/deny files
to hostapd similar to hostapd.conf.

Change-Id: I1c3cda056a4067d48484cb336e748f04804b68e3
CRs-fixed: 910398
2015-09-18 20:20:16 +05:30
Ashwini Sukhadev Patil
cc16315997 Modify NDC commands to write to hostapd.conf
Provision to configure rts_threshold, fragm_threshold and
wmm_enabled in hostapd.conf through NDC commands.

CRs-Fixed: 889979
Change-Id: I94e4486573b562fbe48c641423bf1c1389d0c744
2015-09-11 19:14:22 +05:30
Manikandan Mohan
e1bfb737ad wlan: Add support for 11AC, ACS hostapd config
Support for configuring 11ac and ACS channel list parameters in
hostapd configuration file through soft AP SDK.

Change-Id: I45c4f4285357701299c44f31243dea5107b0fabb
CRs-Fixed: 892713
2015-09-09 17:38:47 -07:00
Linux Build Service Account
cddacfa293 Merge 650d036038 on remote branch
Change-Id: I622541a7fac02a2db2d869da97a513b062955b4a
2015-08-16 23:56:06 -06:00
c_rrajiv
e629e82bc8 wlan: Add softap support through ndc commands.
Changes required to support the softap commands
through ndc cli. This new support as part of the
64bit enablement and ndc is used for cli automation
in softap testcases.
Change-Id: I460a3785c3b4a44656281c7243ebdf921fe20f91
CRs-Fixed: 710050
2015-07-20 16:39:08 +05:30
Bala Krishna Bhamidipati
650d036038 Invoke qsap_set_ini_filename to set the fIni (if NULL)
If WIFI_DRIVER_CONF_FILE is not defined fIni is set to null and
hence all the set/get_cfg SAP commands fail. Thus, Invoke
qsap_set_ini_filename explicitly if fINI is NULL.

Change-Id: I9df1f95d7f4b884602cc501fe9e75ff4c26e400c
CRs-Fixed: 865432
2015-07-06 15:33:57 +05:30
Changzhi Deng
fddc6bed07 Hotspot: Set maximun client connections number
This function is for end user to set maximun client
connections number and apply this to hostapd module

Change-Id: I6150b376d22756e8c04ebabe666d81cf3af8fc87
2015-06-09 18:23:27 -07:00
Skrilax_CZ
a51136993f Implement wifi_qsap_set_tx_power
Used by radio proprietary binaries from Motorola.

Change-Id: I9fd49cbba6001a4c7ddadf5cb88df06d6146f01a
2015-04-12 21:11:14 +02:00
Linux Build Service Account
4659de289b Merge "qcom-softap: Replace strcat & strcpy with strlcat & strlcpy" 2015-03-28 09:49:54 -07:00
Naresh Jayaram
71846207cc qcom-softap: Replace strcat & strcpy with strlcat & strlcpy
strcpy and strcat are not safe, instead use strlcpy and strlcat
which have control over the number of bytes to be written to
the output str or buffer.

CRs-Fixed: 802872
Change-Id: I7b6748946633dda551a1015678d41846c19adeb2
2015-03-24 10:28:18 +05:30
Steve Kondik
595015ac77 qsap: Kill more logspam
Change-Id: I0a32abbf783ffb1534051fd89708d2a49014c6c3
2015-03-15 00:45:15 -07:00
Steve Kondik
69a004c094 qsap: Put files in a sane location
* And set their perms

Change-Id: Ifc61a3504433f6b7e1602432ecea70c37785c895
2015-03-15 00:45:15 -07:00
Steve Kondik
88df07cb5a qsap: Don't log sensitive information
Change-Id: I3ab6d73051d4647941de6eee41c2b5507c5eddc6
2015-03-15 00:45:15 -07:00
Linux Build Service Account
b8a71a5a88 Merge "wlan: Fix for OSS build compilation issue" 2015-02-12 04:39:25 -08:00
Mahesh A Saptasagar
f31a10d2e2 wlan: Fix for OSS build compilation issue
Do not include "wpa_ctrl.h" in qsap.c file to avoid compilation
errors on OSS builds.

Change-Id: Ie3afa0bc564a5b2d9c2245b85f4681b83c1d1644
CRs-Fixed: 758764
2015-01-11 09:05:15 -08:00
Linux Build Service Account
120aeacf0f Merge "Merge d98f57876f on remote branch" 2014-12-09 03:11:03 -08:00
Linux Build Service Account
64f15fc591 Merge d98f57876f on remote branch
Change-Id: I539218e4d40ef020b4913e1540ab8acbf7db1d88
2014-12-08 00:06:00 -07:00
Linux Build Service Account
d98f57876f Merge "framework: Fix for making SAP sdk code 64 bit compliant" 2014-12-06 12:18:56 -08:00
Linux Build Service Account
e9159df711 Merge "Merge 04a6a9712e on remote branch" 2014-12-05 02:45:36 -08:00
Ravi Joshi
5620bb1611 framework: Fix for making SAP sdk code 64 bit compliant
Fix for making SAP SDK code 64 bit compliant. The typedefs
were incorrect on an LP64 architecture since a long int will
be 64-bits.

Change-Id: I4c9f5f2fb2b820193fbe03fdf8e2307c281ea014
CRs-Fixed: 640894
2014-12-04 11:18:00 -08:00
Linux Build Service Account
a9fe9d38bd Merge "wlan: Change location of hostapd files." 2014-12-04 08:27:25 -08:00
Linux Build Service Account
e601816b24 Merge 04a6a9712e on remote branch
Change-Id: Icb0d8a1efb21abd2c03a539c8c2af5a2da39f4f6
2014-12-03 19:36:53 -07:00
Linux Build Service Account
04a6a9712e Merge "framework: Fix for making SAP sdk code 64 bit compliant" 2014-11-30 11:38:37 -08:00
Linux Build Service Account
56710aac73 Merge "wlan: Change location of hostapd files." 2014-11-26 19:20:37 -08:00
Ravi Joshi
9b8ed11141 framework: Fix for making SAP sdk code 64 bit compliant
Fix for making SAP SDK code 64 bit compliant. The typedefs
were incorrect on an LP64 architecture since a long int will
be 64-bits.

Change-Id: I4c9f5f2fb2b820193fbe03fdf8e2307c281ea014
CRs-Fixed: 640894
2014-11-23 22:05:50 -08:00
Linux Build Service Account
92dd0a5d38 Merge "wlan: Fix for OSS build compilation issue" 2014-11-20 07:38:22 -08:00
Linux Build Service Account
f5fecdcc36 Merge "wlan: Change location of hostapd files." 2014-11-20 00:34:55 -08:00
Neelansh Mittal
587b8b3d67 wlan: Change location of hostapd files.
Change location of hostapd accept and deny files
from /data/hostapd to /data/misc/wifi because
SElinux does not allow netd and hostapd to access
/data/hostapd directory.

Change-Id: I61e8521b3a4b6aab759d3b7cbc04acd3da3c8cf3
CRs-Fixed: 756614
2014-11-19 17:59:02 +05:30
Mahesh A Saptasagar
8e9475b346 wlan: Fix for OSS build compilation issue
Do not include "wpa_ctrl.h" in qsap.c file to avoid compilation
errors on OSS builds.

Change-Id: Ie3afa0bc564a5b2d9c2245b85f4681b83c1d1644
CRs-Fixed: 758764
2014-11-18 20:11:25 +05:30
Linux Build Service Account
00e8d69b78 Merge "wlan: Read ieee80211d param from hostapd.conf file" 2014-10-01 02:11:32 -07:00
Vinay Krishna Eranna
c4bcc0d420 wlan: Read ieee80211d param from hostapd.conf file
Read ieee80211d param from hostapd.conf file instead of reading it
from ini file.

Change-Id: I3773652bc91e2f166111704e70231af6845c5ffc
CRs-Fixed: 727043
2014-09-30 01:14:04 -07:00
Linux Build Service Account
005a67d5ca Merge "wlan:ndc command support." 2014-08-02 01:31:51 -07:00
Subhani Shaik
62ada8bd10 wlan:ndc command support.
Copying the softap sdk include files to TARGET obj
so its easy for other modules to include them.
This is required for system/netd/server/Android.mk
file

Change-Id: Ia581cf93b1849866e22ea3f93350906bc4fb8c71
2014-08-01 10:40:56 -07:00
Subhani Shaik
e42000db1a framework: softap enablement through ndc commands.
The softap libraries were missing for the 64bit enablement
through ndc commands. Makefile change required to point to
right kernel include files.

Change-Id: I03cdd609c2fa18f9926de7d67a2c7d5957a81317
2014-07-24 18:01:09 -07:00
Linux Build Service Account
bcc62d3cca Merge "wlan: Add support for configuration of AKM suite" 2014-04-18 01:20:41 -07:00
Linux Build Service Account
45c32d6e64 Merge "framework: Fix for 64-bit unsafe QCSAP_IOCTL_ASSOC_STA_MACADDR handling" 2014-04-08 12:16:34 -07:00
Ravi Joshi
124fb55d96 framework: Fix for 64-bit unsafe QCSAP_IOCTL_ASSOC_STA_MACADDR handling
Fixes for making SAP SDK 64 bit compliant for QCSAP_IOCTL_ASSOC_STA_MACADDR
ioctl

Change-Id: I161ac3113c01752f627bd876f85342d5a9b20ede
CRs-Fixed: 639046
2014-04-02 16:18:12 -07:00
Linux Build Service Account
1e7bd66054 Merge "softap: Fix for hostapd.conf corruption" 2014-03-08 23:37:26 -08:00
Ravi Joshi
8b0be84bab softap: Fix for hostapd.conf corruption
SoftAP fails to load the default hostapd.conf file
which was left behind as part of failed attempt to
start the softAP. The default hostapd.conf is required
to be copied in case of accidental corruption of
hostapd.conf

Change-Id: I4e6ab7a6bc67fcdcfe225e7e1a811fafe402ebc7
CRs-Fixed: 626022
2014-03-07 15:58:23 -08:00
Linux Build Service Account
083d51563a Merge "Updated string banned functions strncpy and memcpy" 2014-01-25 04:21:15 -08:00
Hanumantha Reddy Pothula
87d01a1158 Updated string banned functions strncpy and memcpy
Banned call strncpy has been updated
with strlcpy

Change-Id: I992c2d3580dce24981a4ec9fd9d50ecca109c044
CRs-Fixed: 554334
2014-01-17 11:56:22 +05:30
Linux Build Service Account
e976b492fe Merge "Revert "wlan: Don't overwrite the channel configured in hostapd.conf"" 2014-01-09 15:54:41 -08:00
Linux Build Service Account
0ecf7a3d93 Merge "Revert "wlan: Don't overwrite the channel configured in hostapd.conf"" 2014-01-07 12:04:43 -08:00
Linux Build Service Account
549156b81d Merge "SAP: Make QSAP SDK compatible w.r.t Android framework." 2013-12-18 09:22:59 -08:00
Mahesh A Saptasagar
4a7a459864 Revert "wlan: Don't overwrite the channel configured in hostapd.conf"
This reverts commit 2addd175cc.

Change-Id: I1b4a145bc1b491d65f49dfc0f5990e52de8a4f37
CRs-Fixed: 589261
2013-12-16 13:48:46 +05:30
Mahesh A Saptasagar
d289ef3449 SAP: Make QSAP SDK compatible w.r.t Android framework.
SAP parameter ignore_broadcast_ssid always set to
"broadcast" due to improper handling of SAP parameters
at SAP SDK.

To mitigate this issue update the ignore_broadcast_ssid
parameter based on the value configured in the framework.

Change-Id: Ia1a35a38464710088921b94269b624d8b1910abc
CRs-Fixed: 588560
2013-12-16 11:50:56 +05:30
Linux Build Service Account
396a3fe49d Merge "wlan: Don't overwrite the channel configured in hostapd.conf" 2013-12-05 09:42:26 -08:00
Mahesh A Saptasagar
2addd175cc wlan: Don't overwrite the channel configured in hostapd.conf
When SAP is turned on through GUI, hostapd.conf file
will be overwritten by the framework parameters.Since
in Kit-Kat framework,channel value is hard coded to 6,
same is getting over written whenever we turn on SAP
through GUI, this will cause SAP to come up always on
channel 6.
To mitigate this issue, avoid overwriting the channel
parameter in hostap.conf file by ignoring the channel
parameter from the framework.

Change-Id: I4d87cf70868ad705f63211b2bd10ac2a67646d09
CRs-Fixed: 584112
2013-12-03 13:32:30 -08:00
Linux Build Service Account
fc7138812d Merge "qcom: softap: Fix potential string null termination and buffer overflow" 2013-11-29 13:30:37 -08:00
Linux Build Service Account
4533339d61 Merge "softap: sscanf sanity check for SoftAP service" 2013-11-26 13:29:20 -08:00
Mingcheng Zhu
69b91cc907 qcom: softap: Fix potential string null termination and buffer overflow
Fix potential string null termination and buffer overflow

Change-Id: I05e28b30a4e3134625d20fb5591b239ea4b9f3a4
CRs-fixed: 554078
2013-11-26 12:23:43 -08:00
Shake M Subhani
ff6440b26f softap: sscanf sanity check for SoftAP service
The sscanf return value is verified whether the three channel
variables, i.e. start channel, end channel and channel band,
are properly updated. If malformed input is given to sscanf, then
these variables may not properly updated. To provide validation
of input,  verifying that sscanf returned a correct value of 3.

Change-Id: Ibd185e7a0ffcf5803927990531fc33f0e8977cc9
CRs-fixed: 554349
2013-11-26 12:06:14 +05:30
Linux Build Service Account
31088846f0 Merge "wlan: make qsap compatible w.r.t ndc implementation." 2013-11-21 23:15:12 -08:00
Mahesh A Saptasagar
41f17f12e4 wlan: make qsap compatible w.r.t ndc implementation.
changes to make qsap compatible w.r.t ndc implementation by
correcting argument mismatch.

Change-Id: I6722ce3fdcf2b4bc45c44d82d56f2c5a14435d7c
CRs-Fixed: 436332
2013-11-21 11:27:03 -08:00
Linux Build Service Account
bd4051d8ff Merge "Fix: SIGPIPE issue while querying softap enabled status" 2013-10-18 00:48:18 -07:00
Vinay Krishna Eranna
1c4304379e Fix: SIGPIPE issue while querying softap enabled status
Before downloading commands to driver through softap SDK we are
checking if SoftAP is enabled are not by running ps in popen.
This sometime throws SIGPIPE error (signal) which is not handled,
due to this we were facing application crash. To fix this we modify
to check the operation mode of the driver through ioctl.

Change-Id: Ia0703ff343d401801655d3b666ade66107a4789e
CRs-Fixed: 535340
2013-10-01 20:14:57 +05:30
Chet Lanctot
7a2827f169 wlan: Add support for configuration of AKM suite
Changes to allow setting the configuration item for
AKM suite (wpa_key_mgmt) in hostapd
configuration file.  This is needed for PMF
(802.11w) to add SHA256 to the list when
necessary.

Change-Id: Ia6fd4976241fb11525f4be6c11801b9c471d4427
CRs-Fixed: 523705
2013-09-09 17:48:58 -07:00
7 changed files with 553 additions and 331 deletions

View File

@@ -11,10 +11,10 @@ LOCAL_MODULE := libQWiFiSoftApCfg
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \ LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
$(JNI_H_INCLUDE) $(JNI_H_INCLUDE)
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
LOCAL_SHARED_LIBRARIES := libsysutils libcutils libnetutils libcrypto LOCAL_SHARED_LIBRARIES := libsysutils libcutils libnetutils libcrypto
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View File

@@ -319,7 +319,7 @@ JNIEXPORT jstring JNICALL
char code[32] = {0}; char code[32] = {0};
int connect_retry; int connect_retry;
strncpy(cmd, "softap qccmd ", sizeof(cmd)); strlcpy(cmd, "softap qccmd ", sizeof(cmd));
pcmd = (char *) ((*env)->GetStringUTFChars(env, jcmd, NULL)); pcmd = (char *) ((*env)->GetStringUTFChars(env, jcmd, NULL));
@@ -330,12 +330,12 @@ JNIEXPORT jstring JNICALL
ALOGD("Received Command: %s\n", pcmd); ALOGD("Received Command: %s\n", pcmd);
if ((strlen(cmd) + strlen(pcmd)) > sizeof(cmd)) { if ((strlen(cmd) + strlen(pcmd)) >= sizeof(cmd)) {
UPDATE_ERROR_CODE("Command length is larger than MAX_CMD_SIZE", ""); UPDATE_ERROR_CODE("Command length is larger than MAX_CMD_SIZE", "");
goto end; goto end;
} }
strcat(cmd, pcmd); strlcat(cmd, pcmd, sizeof(cmd));
connect_retry = 0; connect_retry = 0;

View File

@@ -12,6 +12,10 @@ LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\" LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
LOCAL_COPY_HEADERS_TO := sdk/softap/include
LOCAL_COPY_HEADERS := qsap_api.h
LOCAL_COPY_HEADERS += qsap.h
ifdef WIFI_DRIVER_MODULE_PATH ifdef WIFI_DRIVER_MODULE_PATH
LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\" LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\"
endif endif

77
softap/sdk/qsap.c Executable file → Normal file
View File

@@ -54,7 +54,6 @@
#include "qsap_api.h" #include "qsap_api.h"
#include "qsap.h" #include "qsap.h"
#include "libwpa_client/wpa_ctrl.h"
#include <sys/system_properties.h> #include <sys/system_properties.h>
@@ -266,12 +265,12 @@ void qsap_send_module_down_indication(void)
/* Equivalent to: iwpriv wlan0 sendModuleInd */ /* Equivalent to: iwpriv wlan0 sendModuleInd */
if ((s = socket(PF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(PF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.mode = 5; /* WE_MODULE_DOWN_IND sub-command */ wrq.u.mode = 5; /* WE_MODULE_DOWN_IND sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq);
if (ret < 0 ) { if (ret < 0 ) {
strncpy(wrq.ifr_name, "softap.0", IFNAMSIZ); strlcpy(wrq.ifr_name, "softap.0", IFNAMSIZ);
ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 1), &wrq);
if (ret < 0 ) { if (ret < 0 ) {
ALOGE("ioctl failed: %s", strerror(errno)); ALOGE("ioctl failed: %s", strerror(errno));
@@ -295,7 +294,7 @@ s32 qsap_send_init_ap(void)
/* Equivalent to: iwpriv wlan0 initAP */ /* Equivalent to: iwpriv wlan0 initAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 2; /* WE_INIT_AP sub-command */ wrq.u.data.flags = 2; /* WE_INIT_AP sub-command */
ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq); ret = ioctl(s, (SIOCIWFIRSTPRIV + 6), &wrq);
@@ -323,7 +322,7 @@ s32 qsap_send_exit_ap(void)
/* Equivalent to: iwpriv wlan0 exitAP */ /* Equivalent to: iwpriv wlan0 exitAP */
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { if ((s = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
strncpy(wrq.ifr_name, "wlan0", IFNAMSIZ); strlcpy(wrq.ifr_name, "wlan0", IFNAMSIZ);
wrq.u.data.length = 0; /* No Set arguments */ wrq.u.data.length = 0; /* No Set arguments */
wrq.u.data.flags = 3; /*WE_EXIT_AP sub-command */ wrq.u.data.flags = 3; /*WE_EXIT_AP sub-command */
@@ -409,7 +408,7 @@ s32 wifi_qsap_stop_bss(void)
return eERR_STOP_BSS; return eERR_STOP_BSS;
} }
strncpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name)); strlcpy(wrq.ifr_name, iface, sizeof(wrq.ifr_name));
wrq.u.data.length = sizeof(cmd); wrq.u.data.length = sizeof(cmd);
wrq.u.data.pointer = cmd; wrq.u.data.pointer = cmd;
wrq.u.data.flags = 0; wrq.u.data.flags = 0;
@@ -434,26 +433,22 @@ s32 wifi_qsap_stop_bss(void)
s32 is_softap_enabled(void) s32 is_softap_enabled(void)
{ {
FILE *fp; s32 mode = 0;
char buf[1024]; int ret;
fp = popen("ps", "r"); ret = qsap_get_mode(&mode);
if (fp == NULL) { if (eSUCCESS != ret) {
ALOGE("Failed to open file"); ALOGD("Failed to get the mode of operation\n");
return eERR_UNKNOWN; return eERR_UNKNOWN;
} }
while (fgets(buf, sizeof(buf)-1, fp) != NULL) { if (mode == IW_MODE_MASTER) {
if(NULL !=(strstr(buf,"hostapd"))) ALOGD("HOSTAPD Enabled\n");
{ return ENABLE;
pclose(fp);
ALOGD("HOSTAPD enabled\n");
return ENABLE;
}
} }
ALOGD("HOSTAPD disabled\n"); ALOGD("HOSTAPD Disabled\n");
pclose(fp);
return DISABLE; return DISABLE;
} }
@@ -589,3 +584,45 @@ s32 wifi_qsap_reload_softap()
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: %ld\n", __func__, ret);
ret = eERR_SET_TX_POWER;
} else {
ALOGD("%s :IOCTL set tx power issued\n", __func__);
ret = eSUCCESS;
}
return ret;
}

View File

@@ -52,6 +52,8 @@ s32 wifi_qsap_start_softap_in_concurrency(void);
s32 wifi_qsap_stop_softap_in_concurrency(void); s32 wifi_qsap_stop_softap_in_concurrency(void);
#endif #endif
s32 wifi_qsap_set_tx_power(s32);
#if __cplusplus #if __cplusplus
}; // extern "C" }; // extern "C"
#endif #endif

770
softap/sdk/qsap_api.c Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -39,8 +39,8 @@ typedef unsigned char u8;
typedef char s8; typedef char s8;
typedef unsigned short int u16; typedef unsigned short int u16;
typedef signed short int s16; typedef signed short int s16;
typedef unsigned long int u32; typedef unsigned int u32;
typedef signed long int s32; typedef signed int s32;
/** Success and error messages */ /** Success and error messages */
#define SUCCESS "success" #define SUCCESS "success"
@@ -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
@@ -98,19 +99,19 @@ enum error_val {
#define DEFAULT_ACCEPT_LIST_FILE_PATH "/system/etc/hostapd/hostapd.accept" #define DEFAULT_ACCEPT_LIST_FILE_PATH "/system/etc/hostapd/hostapd.accept"
/** Accept list file name */ /** Accept list file name */
#define ACCEPT_LIST_FILE "/data/hostapd/hostapd.accept" #define ACCEPT_LIST_FILE "/data/misc/wifi/hostapd.accept"
/** Default Deny list file name */ /** Default Deny list file name */
#define DEFAULT_DENY_LIST_FILE_PATH "/system/etc/hostapd/hostapd.deny" #define DEFAULT_DENY_LIST_FILE_PATH "/system/etc/hostapd/hostapd.deny"
/** Deny list file name */ /** Deny list file name */
#define DENY_LIST_FILE "/data/hostapd/hostapd.deny" #define DENY_LIST_FILE "/data/misc/wifi/hostapd.deny"
/** Default Ini file */ /** Default Ini file */
#define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini" #define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini"
/** SDK control interface path */ /** SDK control interface path */
#define SDK_CTRL_IF "/data/hostapd/softap_sdk_ctrl" #define SDK_CTRL_IF "/data/misc/wifi/softap_sdk_ctrl"
/** Maximum length of the line in the configuration file */ /** Maximum length of the line in the configuration file */
#define MAX_CONF_LINE_LEN (156) #define MAX_CONF_LINE_LEN (156)
@@ -323,6 +324,12 @@ typedef enum esap_cmd {
eCMD_SET_CHANNEL_RANGE = 62, eCMD_SET_CHANNEL_RANGE = 62,
eCMD_GET_AUTO_CHANNEL = 63, eCMD_GET_AUTO_CHANNEL = 63,
eCMD_IEEE80211W = 64, eCMD_IEEE80211W = 64,
eCMD_WPA_KEY_MGMT = 65,
eCMD_SET_MAX_CLIENTS = 66,
eCMD_IEEE80211AC = 67,
eCMD_VHT_OPER_CH_WIDTH = 68,
eCMD_ACS_CHAN_LIST = 69,
eCMD_HT_CAPAB = 70,
eCMD_LAST /** New command numbers should be added above this */ eCMD_LAST /** New command numbers should be added above this */
} esap_cmd_t; } esap_cmd_t;
@@ -575,6 +582,7 @@ typedef struct sap_auto_channel_info {
#define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE) #define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE)
/** Function declartion */ /** Function declartion */
int qsap_hostd_exec(int argc, char ** argv);
void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen); void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen);
s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen); s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen);
int qsapsetSoftap(int argc, char *argv[]); int qsapsetSoftap(int argc, char *argv[]);
@@ -584,6 +592,7 @@ void check_for_configuration_files(void);
void qsap_set_ini_filename(void); void qsap_set_ini_filename(void);
int qsap_set_channel_range(s8 * cmd); int qsap_set_channel_range(s8 * cmd);
int qsap_get_sap_auto_channel_slection(s32 *pautochan); int qsap_get_sap_auto_channel_slection(s32 *pautochan);
int qsap_get_mode(s32 *pmode);
#if __cplusplus #if __cplusplus
}; // extern "C" }; // extern "C"