Compare commits
32 Commits
stable/cm-
...
cm-12.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93926aa929 | ||
|
|
5fcbb4f8bd | ||
|
|
3fa0d00f3b | ||
|
|
c5802db587 | ||
|
|
00e8d69b78 | ||
|
|
c4bcc0d420 | ||
|
|
005a67d5ca | ||
|
|
62ada8bd10 | ||
|
|
e42000db1a | ||
|
|
bcc62d3cca | ||
|
|
45c32d6e64 | ||
|
|
124fb55d96 | ||
|
|
1e7bd66054 | ||
|
|
8b0be84bab | ||
|
|
083d51563a | ||
|
|
87d01a1158 | ||
|
|
e976b492fe | ||
|
|
0ecf7a3d93 | ||
|
|
549156b81d | ||
|
|
4a7a459864 | ||
|
|
d289ef3449 | ||
|
|
396a3fe49d | ||
|
|
2addd175cc | ||
|
|
fc7138812d | ||
|
|
4533339d61 | ||
|
|
69b91cc907 | ||
|
|
ff6440b26f | ||
|
|
31088846f0 | ||
|
|
41f17f12e4 | ||
|
|
bd4051d8ff | ||
|
|
1c4304379e | ||
|
|
7a2827f169 |
@@ -11,10 +11,10 @@ LOCAL_MODULE := libQWiFiSoftApCfg
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \
|
||||
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
|
||||
$(JNI_H_INCLUDE)
|
||||
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
|
||||
LOCAL_SHARED_LIBRARIES := libsysutils libcutils libnetutils libcrypto
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ LOCAL_MODULE_TAGS := optional
|
||||
|
||||
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
|
||||
LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\"
|
||||
endif
|
||||
|
||||
1
softap/sdk/qsap.c
Executable file → Normal file
1
softap/sdk/qsap.c
Executable file → Normal file
@@ -54,7 +54,6 @@
|
||||
|
||||
#include "qsap_api.h"
|
||||
#include "qsap.h"
|
||||
#include "libwpa_client/wpa_ctrl.h"
|
||||
|
||||
#include <sys/system_properties.h>
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ static struct Command cmd_list[eCMD_LAST] = {
|
||||
{ "setchannelrange", NULL },
|
||||
{ "autochannel", NULL },
|
||||
{ "ieee80211w", NULL },
|
||||
{ "wpa_key_mgmt", NULL },
|
||||
};
|
||||
|
||||
struct Command qsap_str[eSTR_LAST] = {
|
||||
@@ -1463,6 +1464,7 @@ void qsap_get_associated_sta_mac(s8 *presp, u32 *plen)
|
||||
u32 len = MAX_CONF_LINE_LEN;
|
||||
s8 *pif;
|
||||
s8 *pbuf, *pout;
|
||||
u32 buflen;
|
||||
u32 recvLen;
|
||||
u32 tlen;
|
||||
|
||||
@@ -1482,7 +1484,9 @@ void qsap_get_associated_sta_mac(s8 *presp, u32 *plen)
|
||||
goto error;
|
||||
}
|
||||
|
||||
pbuf = (s8 *)malloc((MAX_STA_ALLOWED * 6) + 8);
|
||||
/* response has length field + 6 bytes per STA */
|
||||
buflen = sizeof(u32) + (MAX_STA_ALLOWED * 6);
|
||||
pbuf = (s8 *)malloc(buflen);
|
||||
if(NULL == pbuf) {
|
||||
ALOGE("%s :No memory \n", __func__);
|
||||
close(sock);
|
||||
@@ -1492,7 +1496,7 @@ void qsap_get_associated_sta_mac(s8 *presp, u32 *plen)
|
||||
|
||||
#define SIZE_OF_MAC_INT (6)
|
||||
strlcpy(wrq.ifr_name, pif, sizeof(wrq.ifr_name));
|
||||
wrq.u.data.length = SIZE_OF_MAC_INT * 8 + 8; /** 8 supported MAC and 7 SPACE separators and a '\0' */
|
||||
wrq.u.data.length = buflen;
|
||||
wrq.u.data.pointer = (void *)pbuf;
|
||||
wrq.u.data.flags = 0;
|
||||
|
||||
@@ -1504,13 +1508,14 @@ void qsap_get_associated_sta_mac(s8 *presp, u32 *plen)
|
||||
goto error;
|
||||
}
|
||||
|
||||
recvLen = *(unsigned long int *)(wrq.u.data.pointer);
|
||||
recvLen = *(u32 *)(wrq.u.data.pointer);
|
||||
recvLen -= sizeof(u32);
|
||||
|
||||
len = qsap_scnprintf(presp, *plen, "%s %s=", SUCCESS, cmd_list[eCMD_ASSOC_STA_MACS].name);
|
||||
pout = presp + len;
|
||||
tlen = *plen - len;
|
||||
|
||||
qsap_mac_to_macstr(pbuf+sizeof(unsigned long int), recvLen, pout, &tlen);
|
||||
qsap_mac_to_macstr(pbuf+sizeof(u32), recvLen, pout, &tlen);
|
||||
|
||||
*plen = len + tlen;
|
||||
|
||||
@@ -1712,7 +1717,7 @@ static void qsap_get_from_config(esap_cmd_t cNum, s8 *presp, u32 *plen)
|
||||
break;
|
||||
|
||||
case eCMD_REGULATORY_DOMAIN:
|
||||
qsap_read_cfg(fIni, &qsap_str[STR_802DOT11D_IN_INI], presp, plen, cmd_list[eCMD_REGULATORY_DOMAIN].name, GET_ENABLED_ONLY);
|
||||
qsap_read_cfg(pconffile, &cmd_list[cNum], presp, plen, NULL, GET_ENABLED_ONLY);
|
||||
break;
|
||||
|
||||
case eCMD_RTS_THRESHOLD:
|
||||
@@ -2301,7 +2306,7 @@ void qsap_disassociate_sta(s8 *pVal, s8 *presp, u32 *plen)
|
||||
goto end;
|
||||
}
|
||||
|
||||
strncpy(wrq.ifr_name, pif, sizeof(wrq.ifr_name));
|
||||
strlcpy(wrq.ifr_name, pif, sizeof(wrq.ifr_name));
|
||||
|
||||
if (TRUE != qsap_get_mac_in_bytes(pVal, (char *) &wrq.u)) {
|
||||
ALOGE("%s: Invalid input \n", __func__);
|
||||
@@ -3065,7 +3070,7 @@ int qsapsetSoftap(int argc, char *argv[])
|
||||
{
|
||||
char cmdbuf[CMD_BUF_LEN];
|
||||
char respbuf[RECV_BUF_LEN];
|
||||
unsigned long int rlen = RECV_BUF_LEN;
|
||||
u32 rlen = RECV_BUF_LEN;
|
||||
int i;
|
||||
int hidden = 0;
|
||||
int sec = SEC_MODE_NONE;
|
||||
@@ -3177,6 +3182,20 @@ int qsapsetSoftap(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int check_for_config_file_size(FILE *fp)
|
||||
{
|
||||
int length = 0;
|
||||
|
||||
if( NULL != fp )
|
||||
{
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
length = ftell(fp);
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
void check_for_configuration_files(void)
|
||||
{
|
||||
FILE * fp;
|
||||
@@ -3189,6 +3208,11 @@ void check_for_configuration_files(void)
|
||||
wifi_qsap_reset_to_default(CONFIG_FILE, DEFAULT_CONFIG_FILE_PATH);
|
||||
}
|
||||
else {
|
||||
|
||||
/* The configuration file could be of 0 byte size, replace with default */
|
||||
if (check_for_config_file_size(fp) <= 0)
|
||||
wifi_qsap_reset_to_default(CONFIG_FILE, DEFAULT_CONFIG_FILE_PATH);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -3197,6 +3221,11 @@ void check_for_configuration_files(void)
|
||||
wifi_qsap_reset_to_default(ACCEPT_LIST_FILE, DEFAULT_ACCEPT_LIST_FILE_PATH);
|
||||
}
|
||||
else {
|
||||
|
||||
/* The configuration file could be of 0 byte size, replace with default */
|
||||
if (check_for_config_file_size(fp) <= 0)
|
||||
wifi_qsap_reset_to_default(ACCEPT_LIST_FILE, DEFAULT_ACCEPT_LIST_FILE_PATH);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -3205,6 +3234,11 @@ void check_for_configuration_files(void)
|
||||
wifi_qsap_reset_to_default(DENY_LIST_FILE, DEFAULT_DENY_LIST_FILE_PATH);
|
||||
}
|
||||
else {
|
||||
|
||||
/* The configuration file could be of 0 byte size, replace with default */
|
||||
if (check_for_config_file_size(fp) <= 0)
|
||||
wifi_qsap_reset_to_default(DENY_LIST_FILE, DEFAULT_DENY_LIST_FILE_PATH);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
@@ -323,6 +323,7 @@ typedef enum esap_cmd {
|
||||
eCMD_SET_CHANNEL_RANGE = 62,
|
||||
eCMD_GET_AUTO_CHANNEL = 63,
|
||||
eCMD_IEEE80211W = 64,
|
||||
eCMD_WPA_KEY_MGMT = 65,
|
||||
|
||||
eCMD_LAST /** New command numbers should be added above this */
|
||||
} esap_cmd_t;
|
||||
|
||||
Reference in New Issue
Block a user