Compare commits

...

9 Commits

Author SHA1 Message Date
Steve Kondik
c54aba9422 qsap: Kill more logspam
Change-Id: I0a32abbf783ffb1534051fd89708d2a49014c6c3
2014-05-13 01:27:12 -07:00
Steve Kondik
b980ab07f5 qsap: Put files in a sane location
* And set their perms

Change-Id: Ifc61a3504433f6b7e1602432ecea70c37785c895
2014-05-11 04:01:05 -07:00
Steve Kondik
6cf22dc84c qsap: Don't log sensitive information
Change-Id: I3ab6d73051d4647941de6eee41c2b5507c5eddc6
2014-05-11 01:36:32 -07:00
Hanumantha Reddy Pothula
f510e31bcd Updated string banned functions strncpy and memcpy
Banned call strncpy has been updated
with strlcpy

Change-Id: I992c2d3580dce24981a4ec9fd9d50ecca109c044
CRs-Fixed: 554334
2014-03-22 04:43:12 +01:00
Mahesh A Saptasagar
b30ed9569f 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
2014-01-02 21:32:41 +00:00
Mingcheng Zhu
70700a0773 qcom: softap: Fix potential string null termination and buffer overflow
Fix potential string null termination and buffer overflow

Change-Id: I05e28b30a4e3134625d20fb5591b239ea4b9f3a4
CRs-fixed: 554078
2014-01-02 21:32:20 +00:00
Shake M Subhani
5d5650caf1 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-12-06 14:35:34 +01:00
Vinay Krishna Eranna
52fd77178b 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-11-27 01:43:15 +00:00
Mahesh A Saptasagar
fe07ff9ee2 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-25 17:48:14 +01:00
3 changed files with 374 additions and 305 deletions

View File

@@ -266,12 +266,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 +295,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 +323,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 +409,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 +434,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;
} }

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

File diff suppressed because it is too large Load Diff

View File

@@ -98,19 +98,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)
@@ -584,6 +584,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"