Fixing following issues:

Editing config values in Qocm_cfg.ini disables "save settings" option on GUI.

After fastboot, when SoftAP turned ON first time beacon shows WMM and Country elements info but SoftAP UI shows these options as disabled

After selecting the save-settings button GUI was always sending the command to change the energy_detect_threshold. Code is updated to send
it only if energy_detect_threshold is changed

Bug fixed to return correct security mode

Error happened after saving the SoftAP configuration

CRs-Fixed: 260651 261515 261401

Change-Id: Ic9454c35eeaa23ccc8b6e340695b4c41bca28b47
This commit is contained in:
Raj Kushwaha
2010-11-14 17:47:11 -08:00
parent 41027215e1
commit ae27f82145
5 changed files with 301 additions and 249 deletions

View File

@@ -348,8 +348,7 @@ JNIEXPORT jstring JNICALL
goto end;
}
LOGW("netd might have crashed, wait for it to "
"start back\n");
LOGW("Unable to connect to netd, retrying ...\n");
sleep(1);
} else {
break;

View File

@@ -8,6 +8,8 @@ LOCAL_C_INCLUDES :=
LOCAL_MODULE:= libqsap_sdk
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
ifdef WIFI_DRIVER_MODULE_PATH
LOCAL_CFLAGS += -DWIFI_DRIVER_MODULE_PATH=\"$(WIFI_DRIVER_MODULE_PATH)\"
endif

View File

@@ -87,6 +87,8 @@
extern int init_module(const char *name, u32, const s8 *);
extern int delete_module(const char *name, int);
extern struct Command qsap_str[];
static s32 check_driver_loaded( const s8 * tag)
{
FILE *proc;
@@ -306,7 +308,7 @@ s32 wifi_qsap_stop_bss(void)
return ret;
}
if(NULL == (iface = qsap_get_config_value(CONFIG_FILE, "interface", interface, (u32*)&len))) {
if(NULL == (iface = qsap_get_config_value(CONFIG_FILE, &qsap_str[STR_INTERFACE], interface, (u32*)&len))) {
LOGE("%s :interface error \n", __func__);
return ret;
}
@@ -384,15 +386,24 @@ s32 commit(void)
s32 wifi_qsap_start_softap()
{
s32 retry = 4;
FILE * fp;
LOGD("Starting Soft AP...\n");
/* Check if configuration files are present, if not create the default files */
check_for_configuration_files();
/* Delete control interface if it was left over because of previous crash */
if ( !is_softap_enabled() ) {
qsap_del_ctrl_iface();
}
while(--retry ) {
while(retry--) {
/* May be the configuration file is corrupted or not available, */
/* copy the default configuration file */
if ( retry == 1 )
wifi_qsap_reset_to_default(CONFIG_FILE, DEFAULT_CONFIG_FILE_PATH);
/** Stop hostapd */
if(0 != property_set("ctl.start", "hostapd")) {
LOGE("failed \n");

File diff suppressed because it is too large Load Diff

View File

@@ -78,15 +78,18 @@ enum error_val {
eERR_LOAD_FAILED_SOFTAP
};
/** Soft AP SDK version */
#define QSAP_SDK_VERSION "1.0"
/** Configuration file name */
#define CONFIG_FILE "/data/hostapd/hostapd.conf"
/** Default configuration file path */
#define DEFAULT_CONFIG_FILE_PATH "/persist/qcom/softap/hostapd_default.conf"
/** Accept list file name */
#define ACCEPT_LIST_FILE "/data/hostapd/hostapd.accept"
/** Deny list file name */
#define DENY_LIST_FILE "/data/hostapd/hostapd.deny"
/** Ini file */
#define INI_FILE "/system/etc/firmware/wlan/qcom_cfg.ini"
@@ -130,12 +133,6 @@ enum error_val {
#define DTIM_PERIOD_MIN (1)
#define DTIM_PERIOD_MAX (255)
/** RTS threshold 1 to 2347 */
#define RTS_THRESHOLD_MAX (2347)
/** Fragmentation threshold 256 to 2346 */
#define FRAG_THRESHOLD_MAX (2346)
/** WEP key lengths in ASCII and hex */
#define WEP_64_KEY_ASCII (5)
#define WEP_64_KEY_HEX (10)
@@ -153,10 +150,12 @@ enum error_val {
#define AUTO_CHANNEL (0)
#define BG_MAX_CHANNEL (11)
/** Fragmentation threshold 256 to 2346 */
#define FRAG_THRESHOLD_MIN (256)
#define FRAG_THRESHOLD_MAX (2346)
#define RTS_THRESHOLD_MIN (0)
/** RTS threshold 1 to 2347 */
#define RTS_THRESHOLD_MIN (1)
#define RTS_THRESHOLD_MAX (2347)
#define MIN_UUID_LEN (1)
@@ -221,7 +220,7 @@ enum error_val {
/** AP shutoff time */
#define AP_ENERGY_DETECT_TH_MIN (0)
#define AP_ENERGY_DETECT_TH_MAX (100)
#define AP_ENERGY_DETECT_TH_MAX (9)
/** command request index - in the array Cmd_req[] */
enum eCmd_req {
@@ -395,6 +394,7 @@ enum ap_reset {
};
enum wmm_state {
WMM_AUTO_IN_INI = 0,
WMM_ENABLED_IN_INI = 1,
WMM_DISABLED_IN_INI = 2
};
@@ -416,6 +416,12 @@ enum eChoose_conf_file {
INI_CONF_FILE = 1
};
struct Command
{
s8 * name;
s8 * default_value;
};
/** Validate enable / disable softap */
#define IS_VALID_SOFTAP_ENABLE(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE)
@@ -448,7 +454,7 @@ enum eChoose_conf_file {
(!strcmp(x, "TKIP CCMP")) || (!strcmp(x, "CCMP TKIP"))) ? TRUE : FALSE)
/** Validate the WMM status */
#define IS_VALID_WMM_STATE(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE)
#define IS_VALID_WMM_STATE(x) (((x >= WMM_AUTO_IN_INI) && (x <= WMM_DISABLED_IN_INI)) ? TRUE: FALSE)
/** Validate the WPS status */
#define IS_VALID_WPS_STATE(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE)
@@ -520,13 +526,15 @@ enum eChoose_conf_file {
#define IS_VALID_APSHUTOFFTIME(x) (((x >= AP_SHUTOFF_MIN) && (x <= AP_SHUTOFF_MAX)) ? TRUE : FALSE)
/** Validate the AP shutoff time */
#define IS_VALID_ENERGY_DETECT_TH(x) (((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ? TRUE : FALSE)
#define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE)
/** Function declartion */
void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen);
s8 *qsap_get_config_value(s8 *pfile, s8 *pcmd, s8 *pbuf, u32 *plen);
s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen);
int qsapsetSoftap(int argc, char *argv[]);
void qsap_del_ctrl_iface(void);
s16 wifi_qsap_reset_to_default(s8 *pcfgfile, s8 *pdefault);
void check_for_configuration_files(void);
#if __cplusplus
}; // extern "C"