Compare commits
6 Commits
lineage-15
...
lineage-15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dae032155 | ||
|
|
a0d762d22f | ||
|
|
d55eb82100 | ||
|
|
4d42a1d281 | ||
|
|
a7f0080a40 | ||
|
|
80064989b2 |
@@ -12,6 +12,8 @@ LOCAL_MODULE_TAGS := optional
|
|||||||
|
|
||||||
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
|
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
|
||||||
|
|
||||||
|
LOCAL_USE_VNDK := true
|
||||||
|
|
||||||
LOCAL_COPY_HEADERS_TO := sdk/softap/include
|
LOCAL_COPY_HEADERS_TO := sdk/softap/include
|
||||||
LOCAL_COPY_HEADERS := qsap_api.h
|
LOCAL_COPY_HEADERS := qsap_api.h
|
||||||
LOCAL_COPY_HEADERS += qsap.h
|
LOCAL_COPY_HEADERS += qsap.h
|
||||||
@@ -63,5 +65,7 @@ LOCAL_PRELINK_MODULE := false
|
|||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := libnetutils libutils libbinder libcutils libhardware_legacy libnl liblog
|
LOCAL_SHARED_LIBRARIES := libnetutils libutils libbinder libcutils libhardware_legacy libnl liblog
|
||||||
|
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <sched.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -46,11 +47,11 @@
|
|||||||
|
|
||||||
#define LOG_TAG "QCLDR-"
|
#define LOG_TAG "QCLDR-"
|
||||||
|
|
||||||
#include "cutils/log.h"
|
#include "log/log.h"
|
||||||
#include "cutils/memory.h"
|
#include "cutils/memory.h"
|
||||||
#include "cutils/misc.h"
|
#include "cutils/misc.h"
|
||||||
#include "cutils/properties.h"
|
#include "cutils/properties.h"
|
||||||
#include "private/android_filesystem_config.h"
|
#include "cutils/android_filesystem_config.h"
|
||||||
|
|
||||||
#include "qsap_api.h"
|
#include "qsap_api.h"
|
||||||
#include "qsap.h"
|
#include "qsap.h"
|
||||||
|
|||||||
17
softap/sdk/qsap_api.c
Executable file → Normal file
17
softap/sdk/qsap_api.c
Executable file → Normal file
@@ -43,7 +43,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <private/android_filesystem_config.h>
|
#include <cutils/android_filesystem_config.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <netlink/netlink.h>
|
#include <netlink/netlink.h>
|
||||||
@@ -260,6 +260,9 @@ static s32 qsap_read_cfg(s8 *pfile, struct Command * pcmd, s8 *presp, u32 *plen,
|
|||||||
while(NULL != fgets(buf, MAX_CONF_LINE_LEN, fcfg)) {
|
while(NULL != fgets(buf, MAX_CONF_LINE_LEN, fcfg)) {
|
||||||
s8 *pline = buf;
|
s8 *pline = buf;
|
||||||
|
|
||||||
|
if (strlen(buf) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
/** Skip the commented lines */
|
/** Skip the commented lines */
|
||||||
if(buf[0] == '#') {
|
if(buf[0] == '#') {
|
||||||
if (ignore_comment) {
|
if (ignore_comment) {
|
||||||
@@ -2544,7 +2547,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
|
|||||||
pVal = pcmd + strlen(cmd_list[cNum].name);
|
pVal = pcmd + strlen(cmd_list[cNum].name);
|
||||||
if( (cNum != eCMD_COMMIT) &&
|
if( (cNum != eCMD_COMMIT) &&
|
||||||
(cNum != eCMD_RESET_TO_DEFAULT) &&
|
(cNum != eCMD_RESET_TO_DEFAULT) &&
|
||||||
((*pVal != '=') || (strlen(pVal) < 2)) ) {
|
((*pVal != '=') || (((eCMD_PASSPHRASE != cNum)) && (strlen(pVal) < 2)))) {
|
||||||
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALID_ARG);
|
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALID_ARG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3157,7 +3160,7 @@ int qsapsetSoftap(int argc, char *argv[])
|
|||||||
int i;
|
int i;
|
||||||
int hidden = 0;
|
int hidden = 0;
|
||||||
int sec = SEC_MODE_NONE;
|
int sec = SEC_MODE_NONE;
|
||||||
char setCmd[SET_BUF_LEN];
|
char setCmd[SET_BUF_LEN] = "set";
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
ALOGD("%s, %s, %s, %d\n", __FUNCTION__, argv[0], argv[1], argc);
|
ALOGD("%s, %s, %s, %d\n", __FUNCTION__, argv[0], argv[1], argc);
|
||||||
@@ -3167,16 +3170,10 @@ int qsapsetSoftap(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if 2nd arg is dual2g/dual5g
|
// check if 2nd arg is dual2g/dual5g
|
||||||
if (argc > 2) {
|
if (argc > 2 && (strncmp(argv[2], Conf_req[CONF_2g], 4) == 0)) {
|
||||||
// just match 'dual'
|
|
||||||
if (strncmp(argv[2], Conf_req[CONF_2g], 4) == 0) {
|
|
||||||
snprintf(setCmd, SET_BUF_LEN, "set %s", argv[2]);
|
snprintf(setCmd, SET_BUF_LEN, "set %s", argv[2]);
|
||||||
offset = 1;
|
offset = 1;
|
||||||
argc--;
|
argc--;
|
||||||
} else {
|
|
||||||
snprintf(setCmd, SET_BUF_LEN, "set");
|
|
||||||
offset = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set interface */
|
/* set interface */
|
||||||
|
|||||||
2
softap/sdk/qsap_api.h
Executable file → Normal file
2
softap/sdk/qsap_api.h
Executable file → Normal file
@@ -509,7 +509,7 @@ typedef struct sap_auto_channel_info {
|
|||||||
#define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE)
|
#define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE)
|
||||||
|
|
||||||
/** Validate the length of the passphrase */
|
/** Validate the length of the passphrase */
|
||||||
#define IS_VALID_PASSPHRASE_LEN(x) (((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) ? TRUE: FALSE)
|
#define IS_VALID_PASSPHRASE_LEN(x) ((((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) || (x == 0)) ? TRUE: FALSE)
|
||||||
|
|
||||||
/** Validate the beacon interval */
|
/** Validate the beacon interval */
|
||||||
#define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE)
|
#define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user