Compare commits

..

5 Commits

Author SHA1 Message Date
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
3 changed files with 33 additions and 29 deletions

View File

@@ -54,7 +54,6 @@
#include "qsap_api.h"
#include "qsap.h"
#include "libwpa_client/wpa_ctrl.h"
#include <sys/system_properties.h>

View File

@@ -305,7 +305,7 @@ static s32 qsap_write_cfg(s8 *pfile, struct Command * pcmd, s8 *pVal, s8 *presp,
s8 buf[MAX_CONF_LINE_LEN+1];
s16 len, result = FALSE;
ALOGD("cmd=%s, Val:%s, INI:%ld \n", pcmd->name, pVal, inifile);
ALOGV("cmd=%s, Val:%s, INI:%ld \n", pcmd->name, pVal, inifile);
/** Open the configuration file */
fcfg = fopen(pfile, "r");
@@ -340,7 +340,7 @@ static s32 qsap_write_cfg(s8 *pfile, struct Command * pcmd, s8 *pVal, s8 *presp,
if(pline[len] == '=') {
qsap_scnprintf(buf, sizeof(buf), "%s=%s\n", pcmd->name, pVal);
result = TRUE;
ALOGD("Updated:%s\n", buf);
ALOGV("Updated:%s\n", buf);
}
}
@@ -355,7 +355,7 @@ static s32 qsap_write_cfg(s8 *pfile, struct Command * pcmd, s8 *pVal, s8 *presp,
/* Add the new line at the end of file */
qsap_scnprintf(buf, sizeof(buf), "%s=%s\n", pcmd->name, pVal);
fprintf(ftmp, "%s", buf);
ALOGD("Adding a new line in %s file: [%s] \n", inifile ? "inifile" : "hostapd.conf", buf);
ALOGV("Adding a new line in %s file: [%s] \n", inifile ? "inifile" : "hostapd.conf", buf);
}
if(inifile) {
@@ -933,7 +933,7 @@ static void qsap_remove_from_file(s8 *pfile, s8 *pVal, s8 *presp, u32 *plen)
*/
static void qsap_update_mac_list(s8 *pfile, esap_cmd_t cNum, s8 *pVal, s8 *presp, u32 *plen)
{
ALOGD("%s : Updating file %s \n", __func__, pfile);
ALOGV("%s : Updating file %s \n", __func__, pfile);
switch(cNum) {
case eCMD_ADD_TO_ALLOW:
@@ -1088,7 +1088,7 @@ static int qsap_read_mac_address(s8 *presp, u32 *plen)
ptr++;
ALOGD("MAC :%s \n", ptr);
ALOGV("MAC :%s \n", ptr);
if(TRUE == isValid_MAC_address(ptr)) {
nRet = eSUCCESS;
}
@@ -1124,7 +1124,7 @@ static void qsap_read_wps_state(s8 *presp, u32 *plen)
if(NULL == (pstate = qsap_get_config_value(pconffile, &cmd_list[eCMD_WPS_STATE], presp, &tlen))) {
/** unable to read the wps configuration, WPS is disabled !*/
ALOGD("%s :wps_state not in cfg file \n", __func__);
ALOGV("%s :wps_state not in cfg file \n", __func__);
status = DISABLE;
}
else {
@@ -1179,9 +1179,9 @@ int qsap_get_operating_channel(s32 *pchan)
goto error;
}
ALOGE("Recv len :%d \n", wrq.u.data.length);
ALOGV("Recv len :%d \n", wrq.u.data.length);
*pchan = *(int *)(&wrq.u.name[0]);
ALOGE("Operating channel :%ld \n", *pchan);
ALOGV("Operating channel :%ld \n", *pchan);
close(sock);
return eSUCCESS;
@@ -1212,7 +1212,7 @@ int qsap_get_sap_auto_channel_selection(s32 *pautochan)
if(NULL == (pif = qsap_get_config_value(pconffile,
&qsap_str[STR_INTERFACE], interface, &len))) {
ALOGD("%s :interface error \n", __func__);
ALOGV("%s :interface error \n", __func__);
goto error;
}
@@ -1220,7 +1220,7 @@ int qsap_get_sap_auto_channel_selection(s32 *pautochan)
sock = socket(AF_INET, SOCK_DGRAM, 0);
if(sock < 0) {
ALOGD("%s :socket error \n", __func__);
ALOGV("%s :socket error \n", __func__);
goto error;
}
@@ -1243,9 +1243,9 @@ int qsap_get_sap_auto_channel_selection(s32 *pautochan)
goto error;
}
ALOGD("Recv len :%d \n", wrq.u.data.length);
ALOGV("Recv len :%d \n", wrq.u.data.length);
*pautochan = *(int *)(&wrq.u.name[0]);
ALOGD("Sap auto channel selection pautochan=%ld \n", *pautochan);
ALOGV("Sap auto channel selection pautochan=%ld \n", *pautochan);
close(sock);
return eSUCCESS;
@@ -1273,7 +1273,7 @@ int qsap_get_mode(s32 *pmode)
*pmode = -1;
if(NULL == (pif = qsap_get_config_value(pconffile,
&qsap_str[STR_INTERFACE], interface, &len))) {
ALOGD("%s :interface error \n", __func__);
ALOGV("%s :interface error \n", __func__);
goto error;
}
@@ -1281,7 +1281,7 @@ int qsap_get_mode(s32 *pmode)
sock = socket(AF_INET, SOCK_DGRAM, 0);
if(sock < 0) {
ALOGD("%s :socket error \n", __func__);
ALOGV("%s :socket error \n", __func__);
goto error;
}
@@ -1385,7 +1385,7 @@ int qsap_set_channel_range(s8 *buf)
goto error;
}
ALOGE("Recv len :%d\n", wrq.u.data.length);
ALOGV("Recv len :%d\n", wrq.u.data.length);
close(sock);
return eSUCCESS;
@@ -1403,7 +1403,7 @@ int qsap_read_channel(s8 *pfile, struct Command *pcmd, s8 *presp, u32 *plen, s8
if(eSUCCESS == qsap_get_operating_channel(&chan)) {
*plen = qsap_scnprintf(presp, len, "%s %s=%lu", SUCCESS, pcmd->name, chan);
ALOGD("presp :%s\n", presp);
ALOGV("presp :%s\n", presp);
} else {
*plen = qsap_scnprintf(presp, len, "%s", ERR_UNKNOWN);
}
@@ -1889,7 +1889,7 @@ static s16 is_valid_wep_key(s8 *pwep, s8 *pkey, s16 len)
weplen--;
while(weplen--) {
if(0 == isascii(pwep[weplen])) {
ALOGD("%c not ascii \n", pwep[weplen]);
ALOGV("%c not ascii \n", pwep[weplen]);
return FALSE;
}
}
@@ -1948,6 +1948,11 @@ s16 wifi_qsap_reset_to_default(s8 *pcfgfile, s8 *pdefault)
if(eERR_UNKNOWN == rename(buf, pcfgfile))
status = eERR_CONF_FILE;
if (chown(pcfgfile, AID_WIFI, AID_WIFI) < 0) {
ALOGE("Error changing group ownership of %s to %d: %s",
pcfgfile, AID_WIFI, strerror(errno));
}
/** Remove the temporary file. Dont care the return value */
unlink(buf);
@@ -2030,7 +2035,7 @@ static int qsap_send_cmd_to_hostapd(s8 *pcmd)
goto error;
}
ALOGD("Connect to :%s\n", ptr);
ALOGV("Connect to :%s\n", ptr);
sock = socket(PF_UNIX, SOCK_DGRAM, 0);
if(sock < 0) {
@@ -2050,7 +2055,7 @@ static int qsap_send_cmd_to_hostapd(s8 *pcmd)
ser.sun_family = AF_UNIX;
qsap_scnprintf(ser.sun_path, sizeof(ser.sun_path), "%s", ptr);
ALOGD("Connect to: %s,(%d)\n", ser.sun_path, sock);
ALOGV("Connect to: %s,(%d)\n", ser.sun_path, sock);
ret = connect(sock, (struct sockaddr *)&ser, sizeof(ser));
if(ret < 0) {
@@ -2205,7 +2210,7 @@ static void qsap_config_wps_method(s8 *pVal, s8 *presp, u32 *plen)
qsap_scnprintf(buf, sizeof(buf), "WPS_PBC");
else {
if(strlen(ptr) < WPS_KEY_LEN) {
ALOGD("%s :Invalid WPS key length\n", __func__);
ALOGV("%s :Invalid WPS key length\n", __func__);
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALID_PARAM);
return;
}
@@ -2994,7 +2999,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
}
if(ini == INI_CONF_FILE) {
ALOGD("WRITE TO INI FILE :%s\n", qsap_str[cNum].name);
ALOGV("WRITE TO INI FILE :%s\n", qsap_str[cNum].name);
qsap_write_cfg(fIni, &qsap_str[cNum], pVal, presp, plen, ini);
}
else {
@@ -3023,7 +3028,7 @@ error:
*/
void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen)
{
ALOGD("CMD INPUT [%s][%lu]\n", pcmd, *plen);
ALOGV("CMD INPUT [%s][%lu]\n", pcmd, *plen);
/* Skip any blank spaces */
SKIP_BLANK_SPACE(pcmd);
@@ -3041,7 +3046,7 @@ void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen)
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALIDREQ);
}
ALOGD("CMD OUTPUT [%s]\nlen :%lu\n\n", presp, *plen);
ALOGV("CMD OUTPUT [%s]\nlen :%lu\n\n", presp, *plen);
return;
}
@@ -3070,10 +3075,10 @@ int qsapsetSoftap(int argc, char *argv[])
int hidden = 0;
int sec = SEC_MODE_NONE;
ALOGD("%s, %s, %s, %d\n", __FUNCTION__, argv[0], argv[1], argc);
ALOGV("%s, %s, %s, %d\n", __FUNCTION__, argv[0], argv[1], argc);
for ( i=0; i<argc;i++) {
ALOGD("ARG: %d - %s\n", i+1, argv[i]);
ALOGV("ARG: %d - %s\n", i+1, argv[i]);
}
/** set SSID */

View File

@@ -98,19 +98,19 @@ enum error_val {
#define DEFAULT_ACCEPT_LIST_FILE_PATH "/system/etc/hostapd/hostapd.accept"
/** 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 */
#define DEFAULT_DENY_LIST_FILE_PATH "/system/etc/hostapd/hostapd.deny"
/** Deny list file name */
#define DENY_LIST_FILE "/data/hostapd/hostapd.deny"
#define DENY_LIST_FILE "/data/misc/wifi/hostapd.deny"
/** Default Ini file */
#define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini"
/** 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 */
#define MAX_CONF_LINE_LEN (156)