qsap: Fix remaining compile errors

Change-Id: I65ff436ad4e02032f6fc1fd5639ce22ebf64a033
This commit is contained in:
Paul Keith
2022-03-21 12:59:12 -05:00
parent b6ab59993e
commit 0a9d93707e
2 changed files with 18 additions and 32 deletions

View File

@@ -196,9 +196,7 @@ static const char DRIVER_CFG80211_MODULE_ARG[] = WIFI_CFG80211_DRIVER_MODULE_A
s32 wifi_qsap_load_driver(void) s32 wifi_qsap_load_driver(void)
{ {
s32 size;
s32 ret = -1; s32 ret = -1;
s32 retry;
if (system(SDIO_POLLING_ON)) { if (system(SDIO_POLLING_ON)) {
@@ -293,7 +291,6 @@ s32 qsap_send_init_ap(void)
int s, ret; int s, ret;
struct iwreq wrq; struct iwreq wrq;
s32 status = eSUCCESS; s32 status = eSUCCESS;
u32 *params = (u32 *)&wrq.u;
/* 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) {
@@ -321,7 +318,6 @@ s32 qsap_send_exit_ap(void)
int s, ret; int s, ret;
struct iwreq wrq; struct iwreq wrq;
s32 status = eSUCCESS; s32 status = eSUCCESS;
u32 *params = (u32 *)&wrq.u;
/* 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) {
@@ -391,7 +387,6 @@ s32 wifi_qsap_stop_bss(void)
s8 *iface; s8 *iface;
s32 len = 128; s32 len = 128;
struct iwreq wrq; struct iwreq wrq;
struct iw_priv_args *priv_ptr;
if(ENABLE != is_softap_enabled()) { if(ENABLE != is_softap_enabled()) {
ret = eERR_BSS_NOT_STARTED; ret = eERR_BSS_NOT_STARTED;
@@ -483,7 +478,6 @@ s32 commit(void)
s32 wifi_qsap_start_softap() s32 wifi_qsap_start_softap()
{ {
s32 retry = 4; s32 retry = 4;
FILE * fp;
ALOGD("Starting Soft AP...\n"); ALOGD("Starting Soft AP...\n");

View File

@@ -71,6 +71,8 @@
#define SKIP_BLANK_SPACE(x) {while(*x != '\0') { if((*x == ' ') || (*x == '\t')) x++; else break; }} #define SKIP_BLANK_SPACE(x) {while(*x != '\0') { if((*x == ' ') || (*x == '\t')) x++; else break; }}
#define UNUSED __attribute__ ((unused))
/** If this variable is enabled, the soft AP is reloaded, after the commit /** If this variable is enabled, the soft AP is reloaded, after the commit
* command is received */ * command is received */
static volatile int gIniUpdated = 0; static volatile int gIniUpdated = 0;
@@ -622,7 +624,7 @@ static void qsap_set_security_mode(s8 *pfile, u32 sec_mode, s8 *presp, u32 *plen
} }
else { else {
/** WPA, WPA2 and mixed-mode security */ /** WPA, WPA2 and mixed-mode security */
u16 wpa_val; u16 wpa_val = 0;
u32 tmp = *plen; u32 tmp = *plen;
wep = DISABLE; wep = DISABLE;
@@ -1037,7 +1039,7 @@ static void qsap_get_mac_list(s8 *fconfile, esap_cmd_t cNum, s8 *presp, u32 *ple
FILE *fp; FILE *fp;
u32 len_remain; u32 len_remain;
s8 *pfile, *pOut; s8 *pfile, *pOut;
esap_cmd_t sNum; esap_str_t sNum;
int cnt = 0; int cnt = 0;
/** Identify the allow or deny file */ /** Identify the allow or deny file */
@@ -1263,7 +1265,6 @@ int qsap_get_sap_auto_channel_selection(s32 *pautochan)
s8 *pif; s8 *pif;
int ret; int ret;
sap_auto_channel_info sap_autochan_info; sap_auto_channel_info sap_autochan_info;
s32 *pchan;
if(ENABLE != is_softap_enabled()) { if(ENABLE != is_softap_enabled()) {
ALOGE("%s :is_softap_enabled() goto error \n", __func__); ALOGE("%s :is_softap_enabled() goto error \n", __func__);
@@ -1428,7 +1429,7 @@ int qsap_set_channel_range(s8 *buf)
u32 len = MAX_CONF_LINE_LEN; u32 len = MAX_CONF_LINE_LEN;
s8 *pif; s8 *pif;
s8 *temp; s8 *temp;
int ret, i; int ret;
sap_channel_info sap_chan_range; sap_channel_info sap_chan_range;
sta_channel_info sta_chan_range; sta_channel_info sta_chan_range;
@@ -1506,9 +1507,8 @@ error:
return eERR_SET_CHAN_RANGE; return eERR_SET_CHAN_RANGE;
} }
int qsap_read_channel(s8 *pfile, struct Command *pcmd, s8 *presp, u32 *plen, s8 *pvar) int qsap_read_channel(UNUSED s8 *pfile, struct Command *pcmd, s8 *presp, u32 *plen, UNUSED s8 *pvar)
{ {
s8 *pval;
s32 chan; s32 chan;
u32 len = *plen; u32 len = *plen;
@@ -1522,12 +1522,10 @@ int qsap_read_channel(s8 *pfile, struct Command *pcmd, s8 *presp, u32 *plen, s8
return eSUCCESS; return eSUCCESS;
} }
int qsap_read_auto_channel(struct Command *pcmd, s8 *presp, u32 *plen) int qsap_read_auto_channel(UNUSED struct Command *pcmd, s8 *presp, u32 *plen)
{ {
s8 *pval, *pautoval;
s32 pautochan; s32 pautochan;
u32 len = *plen; u32 len = *plen;
int autochan;
ALOGE("%s :\n", __func__); ALOGE("%s :\n", __func__);
@@ -1557,7 +1555,7 @@ static int qsap_mac_to_macstr(s8 *pmac, u32 slen, s8 *pmstr, u32 *plen)
} }
if(totlen > 0) { if(totlen > 0) {
*pmstr--; pmstr--;
totlen--; totlen--;
} }
*pmstr = '\0'; *pmstr = '\0';
@@ -1662,7 +1660,7 @@ static void qsap_read_wep_key(s8 *pfile, struct Command *pcmd, s8 *presp, u32 *p
pkey++; pkey++;
pwep++; pwep++;
} }
*pkey--; pkey--;
*pkey = '\0'; *pkey = '\0';
*plen -= 2; *plen -= 2;
} }
@@ -1677,8 +1675,7 @@ void qsap_read_ap_stats(s8 *presp, u32 *plen)
s8 interface[MAX_CONF_LINE_LEN]; s8 interface[MAX_CONF_LINE_LEN];
u32 len = MAX_CONF_LINE_LEN; u32 len = MAX_CONF_LINE_LEN;
s8 *pif; s8 *pif;
s8 *pbuf, *pout; s8 *pbuf;
u32 tlen;
if(ENABLE != is_softap_enabled()) { if(ENABLE != is_softap_enabled()) {
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_SOFTAP_NOT_STARTED); *plen = qsap_scnprintf(presp, *plen, "%s", ERR_SOFTAP_NOT_STARTED);
@@ -1770,7 +1767,6 @@ static void qsap_get_from_config(esap_cmd_t cNum, s8 *presp, u32 *plen)
{ {
u32 len; u32 len;
int status; int status;
s8 * pval;
switch(cNum) { switch(cNum) {
case eCMD_ENABLE_SOFTAP: case eCMD_ENABLE_SOFTAP:
@@ -2486,11 +2482,7 @@ end:
static int qsap_set_operating_mode(s32 mode, s8 *pmode, int pmode_len, s8 *tbuf, u32 *tlen) static int qsap_set_operating_mode(s32 mode, s8 *pmode, int pmode_len, s8 *tbuf, u32 *tlen)
{ {
u32 ulen; u32 ulen;
s8 *pcfgval;
s32 channel;
s8 sconf[MAX_INT_STR+1];
s8 *pcfg = pconffile; s8 *pcfg = pconffile;
s32 rate_idx;
s8 ieee11n_enable[] = "1"; s8 ieee11n_enable[] = "1";
s8 ieee11n_disable[] = "0"; s8 ieee11n_disable[] = "0";
@@ -3041,7 +3033,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
if(TRUE != IS_VALID_PROTECTION(value)) if(TRUE != IS_VALID_PROTECTION(value))
goto error; goto error;
qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value); qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value);
cNum = STR_PROT_FLAG_IN_INI; sNum = STR_PROT_FLAG_IN_INI;
ini = INI_CONF_FILE; ini = INI_CONF_FILE;
break; break;
@@ -3080,7 +3072,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
if(TRUE != IS_VALID_TX_POWER(value)) if(TRUE != IS_VALID_TX_POWER(value))
goto error; goto error;
qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value); qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value);
cNum = STR_TX_POWER_IN_INI; sNum = STR_TX_POWER_IN_INI;
ini = INI_CONF_FILE; ini = INI_CONF_FILE;
break; break;
@@ -3114,7 +3106,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
/* copy a larger value back to pVal. Please pay special care /* copy a larger value back to pVal. Please pay special care
* in caller to make sure that the buffer has sufficient size. */ * in caller to make sure that the buffer has sufficient size. */
qsap_scnprintf(pVal, MAX_INT_STR, "%d", value*60); qsap_scnprintf(pVal, MAX_INT_STR, "%d", value*60);
cNum = STR_AP_AUTOSHUTOFF; sNum = STR_AP_AUTOSHUTOFF;
ini = INI_CONF_FILE; ini = INI_CONF_FILE;
break; break;
@@ -3124,7 +3116,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
goto error; goto error;
qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value); qsap_scnprintf(pVal, strlen(pVal)+1, "%d", value);
cNum = STR_AP_ENERGY_DETECT_TH; sNum = STR_AP_ENERGY_DETECT_TH;
ini = INI_CONF_FILE; ini = INI_CONF_FILE;
break; break;
@@ -3152,8 +3144,8 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
} }
if(ini == INI_CONF_FILE) { if(ini == INI_CONF_FILE) {
ALOGD("WRITE TO INI FILE :%s\n", qsap_str[cNum].name); ALOGD("WRITE TO INI FILE :%s\n", qsap_str[sNum].name);
qsap_write_cfg(fIni, &qsap_str[cNum], pVal, presp, plen, ini); qsap_write_cfg(fIni, &qsap_str[sNum], pVal, presp, plen, ini);
} }
else { else {
qsap_write_cfg(pcfg, &cmd_list[cNum], pVal, presp, plen, ini); qsap_write_cfg(pcfg, &cmd_list[cNum], pVal, presp, plen, ini);
@@ -3181,7 +3173,7 @@ error:
*/ */
void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen) void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen)
{ {
ALOGD("CMD INPUT [%s][%lu]\n", pcmd, *plen); ALOGD("CMD INPUT [%s][%u]\n", pcmd, *plen);
/* Skip any blank spaces */ /* Skip any blank spaces */
SKIP_BLANK_SPACE(pcmd); SKIP_BLANK_SPACE(pcmd);
@@ -3213,7 +3205,7 @@ void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen)
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALIDREQ); *plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALIDREQ);
} }
ALOGD("CMD OUTPUT [%s]\nlen :%lu\n\n", presp, *plen); ALOGD("CMD OUTPUT [%s]\nlen :%u\n\n", presp, *plen);
return; return;
} }