mutex_lock(&hif_drv->cfg_values_lock);
- if (param->flag & BSS_TYPE) {
- u8 bss_type = param->bss_type;
-
- if (bss_type < 6) {
- wid_list[i].id = WID_BSS_TYPE;
- wid_list[i].val = (s8 *)¶m->bss_type;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.bss_type = bss_type;
- } else {
- netdev_err(vif->ndev, "check value 6 over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & AUTH_TYPE) {
- u8 auth_type = param->auth_type;
-
- if (auth_type == 1 || auth_type == 2 || auth_type == 5) {
- wid_list[i].id = WID_AUTH_TYPE;
- wid_list[i].val = (s8 *)¶m->auth_type;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.auth_type = auth_type;
- } else {
- netdev_err(vif->ndev, "Impossible value\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & AUTHEN_TIMEOUT) {
- if (param->auth_timeout > 0) {
- wid_list[i].id = WID_AUTH_TIMEOUT;
- wid_list[i].val = (s8 *)¶m->auth_timeout;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.auth_timeout = param->auth_timeout;
- } else {
- netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & POWER_MANAGEMENT) {
- u8 pm_mode = param->power_mgmt_mode;
-
- if (pm_mode < 5) {
- wid_list[i].id = WID_POWER_MANAGEMENT;
- wid_list[i].val = (s8 *)¶m->power_mgmt_mode;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.power_mgmt_mode = pm_mode;
- } else {
- netdev_err(vif->ndev, "Invalid power mode\n");
- goto unlock;
- }
- i++;
- }
if (param->flag & RETRY_SHORT) {
u16 retry_limit = param->short_retry_limit;
}
i++;
}
- if (param->flag & PREAMBLE) {
- u16 preamble_type = param->preamble_type;
-
- if (param->preamble_type < 3) {
- wid_list[i].id = WID_PREAMBLE;
- wid_list[i].val = (s8 *)¶m->preamble_type;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.preamble_type = preamble_type;
- } else {
- netdev_err(vif->ndev, "Preamble Range(0~2) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & SHORT_SLOT_ALLOWED) {
- u8 slot_allowed = param->short_slot_allowed;
-
- if (slot_allowed < 2) {
- wid_list[i].id = WID_SHORT_SLOT_ALLOWED;
- wid_list[i].val = (s8 *)¶m->short_slot_allowed;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.short_slot_allowed = slot_allowed;
- } else {
- netdev_err(vif->ndev, "Short slot(2) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & TXOP_PROT_DISABLE) {
- u8 prot_disabled = param->txop_prot_disabled;
-
- if (param->txop_prot_disabled < 2) {
- wid_list[i].id = WID_11N_TXOP_PROT_DISABLE;
- wid_list[i].val = (s8 *)¶m->txop_prot_disabled;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.txop_prot_disabled = prot_disabled;
- } else {
- netdev_err(vif->ndev, "TXOP prot disable\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & BEACON_INTERVAL) {
- u16 beacon_interval = param->beacon_interval;
-
- if (beacon_interval > 0) {
- wid_list[i].id = WID_BEACON_INTERVAL;
- wid_list[i].val = (s8 *)¶m->beacon_interval;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.beacon_interval = beacon_interval;
- } else {
- netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & DTIM_PERIOD) {
- if (param->dtim_period > 0 && param->dtim_period < 256) {
- wid_list[i].id = WID_DTIM_PERIOD;
- wid_list[i].val = (s8 *)¶m->dtim_period;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.dtim_period = param->dtim_period;
- } else {
- netdev_err(vif->ndev, "DTIM range(1~255) fail\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & SITE_SURVEY) {
- enum site_survey enabled = param->site_survey_enabled;
-
- if (enabled < 3) {
- wid_list[i].id = WID_SITE_SURVEY;
- wid_list[i].val = (s8 *)¶m->site_survey_enabled;
- wid_list[i].type = WID_CHAR;
- wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.site_survey_enabled = enabled;
- } else {
- netdev_err(vif->ndev, "Site survey disable\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & SITE_SURVEY_SCAN_TIME) {
- u16 scan_time = param->site_survey_scan_time;
-
- if (scan_time > 0) {
- wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME;
- wid_list[i].val = (s8 *)¶m->site_survey_scan_time;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.site_survey_scan_time = scan_time;
- } else {
- netdev_err(vif->ndev, "Site scan time(1~65535) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & ACTIVE_SCANTIME) {
- u16 active_scan_time = param->active_scan_time;
-
- if (active_scan_time > 0) {
- wid_list[i].id = WID_ACTIVE_SCAN_TIME;
- wid_list[i].val = (s8 *)¶m->active_scan_time;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.active_scan_time = active_scan_time;
- } else {
- netdev_err(vif->ndev, "Active time(1~65535) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & PASSIVE_SCANTIME) {
- u16 time = param->passive_scan_time;
-
- if (time > 0) {
- wid_list[i].id = WID_PASSIVE_SCAN_TIME;
- wid_list[i].val = (s8 *)¶m->passive_scan_time;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.passive_scan_time = time;
- } else {
- netdev_err(vif->ndev, "Passive time(1~65535) over\n");
- goto unlock;
- }
- i++;
- }
- if (param->flag & CURRENT_TX_RATE) {
- enum current_tx_rate curr_tx_rate = param->curr_tx_rate;
-
- if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 ||
- curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 ||
- curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 ||
- curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 ||
- curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 ||
- curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 ||
- curr_tx_rate == MBPS_54) {
- wid_list[i].id = WID_CURRENT_TX_RATE;
- wid_list[i].val = (s8 *)&curr_tx_rate;
- wid_list[i].type = WID_SHORT;
- wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate;
- } else {
- netdev_err(vif->ndev, "out of TX rate\n");
- goto unlock;
- }
- i++;
- }
ret = wilc_send_config_pkt(vif, SET_CFG, wid_list,
i, wilc_get_vif_idx(vif));
mutex_lock(&hif_drv->cfg_values_lock);
hif_drv->hif_state = HOST_IF_IDLE;
- hif_drv->cfg_values.site_survey_enabled = SITE_SURVEY_OFF;
hif_drv->cfg_values.scan_source = DEFAULT_SCAN;
- hif_drv->cfg_values.active_scan_time = ACTIVE_SCAN_TIME;
- hif_drv->cfg_values.passive_scan_time = PASSIVE_SCAN_TIME;
- hif_drv->cfg_values.curr_tx_rate = AUTORATE;
hif_drv->p2p_timeout = 0;
WID_LONG_RETRY_LIMIT = 0x1003,
WID_BEACON_INTERVAL = 0x1006,
WID_MEMORY_ACCESS_16BIT = 0x1008,
- WID_RX_SENSE = 0x100B,
- WID_ACTIVE_SCAN_TIME = 0x100C,
- WID_PASSIVE_SCAN_TIME = 0x100D,
- WID_SITE_SURVEY_SCAN_TIME = 0x100E,
WID_JOIN_START_TIMEOUT = 0x100F,
- WID_AUTH_TIMEOUT = 0x1010,
WID_ASOC_TIMEOUT = 0x1011,
WID_11I_PROTOCOL_TIMEOUT = 0x1012,
WID_EAPOL_RESPONSE_TIMEOUT = 0x1013,
WID_HW_RX_COUNT = 0x2015,
WID_MEMORY_ADDRESS = 0x201E,
WID_MEMORY_ACCESS_32BIT = 0x201F,
- WID_RF_REG_VAL = 0x2021,
/* NMAC Integer WID list */
- WID_11N_PHY_ACTIVE_REG_VAL = 0x2080,
-
/* Custom Integer WID list */
WID_GET_INACTIVE_TIME = 0x2084,
WID_SET_OPERATION_MODE = 0X2086,
WID_SUPP_PASSWORD = 0x3011,
WID_SITE_SURVEY_RESULTS = 0x3012,
WID_RX_POWER_LEVEL = 0x3013,
- WID_DEL_ALL_RX_BA = 0x3014,
WID_SET_STA_MAC_INACTIVE_TIME = 0x3017,
WID_ADD_WEP_KEY = 0x3019,
WID_REMOVE_WEP_KEY = 0x301A,