uint loadparam(struct rtl_priv *rtlpriv, struct net_device *ndev) { uint status = _SUCCESS; struct registry_priv *registry_par = &rtlpriv->registrypriv; memcpy(registry_par->ssid.Ssid, "ANY", 3); registry_par->ssid.SsidLength = 3; registry_par->channel = (uint8_t)rtw_channel; if (IsSupported24G(WIRELESS_MODE_MAX) && (!IsSupported5G(WIRELESS_MODE_MAX)) && (registry_par->channel > 14)) { registry_par->channel = 1; } else if (IsSupported5G(WIRELESS_MODE_MAX) && (!IsSupported24G(WIRELESS_MODE_MAX)) && (registry_par->channel <= 14)) { registry_par->channel = 36; } registry_par->rts_thresh = (u16)rtw_rts_thresh; registry_par->preamble = (uint8_t)rtw_preamble; registry_par->adhoc_tx_pwr = (uint8_t)rtw_adhoc_tx_pwr; registry_par->soft_ap = (uint8_t)rtw_soft_ap; registry_par->smart_ps = (uint8_t)rtw_smart_ps; registry_par->power_mgnt = (uint8_t)rtw_power_mgnt; registry_par->long_retry_lmt = (uint8_t)rtw_long_retry_lmt; registry_par->short_retry_lmt = (uint8_t)rtw_short_retry_lmt; registry_par->busy_thresh = (u16)rtw_busy_thresh; /* registry_par->qos_enable = (uint8_t)rtw_qos_enable; */ registry_par->ack_policy = (uint8_t)rtw_ack_policy; registry_par->acm_method = (uint8_t)rtw_acm_method; /* UAPSD */ registry_par->wmm_enable = (uint8_t)rtw_wmm_enable; registry_par->uapsd_enable = (uint8_t)rtw_uapsd_enable; registry_par->rx_stbc = (uint8_t)rtw_rx_stbc; registry_par->ampdu_amsdu = (uint8_t)rtw_ampdu_amsdu; registry_par->beamform_cap = (uint8_t)rtw_beamform_cap; registry_par->low_power = (uint8_t)rtw_low_power; registry_par->bAcceptAddbaReq = (uint8_t)rtw_AcceptAddbaReq; #ifdef CONFIG_AUTOSUSPEND registry_par->usbss_enable = (uint8_t)rtw_enusbss; /* 0:disable,1:enable */ #endif registry_par->hw_wps_pbc = (uint8_t)rtw_hw_wps_pbc; return status; }
bool HAL_IsLegalChannel(struct adapter *Adapter, u32 Channel) { bool bLegalChannel = true; if (Channel > 14) { bLegalChannel = false; DBG_871X("Channel > 14 but wireless_mode do not support 5G\n"); } else if ((Channel <= 14) && (Channel >= 1)) { if (IsSupported24G(Adapter->registrypriv.wireless_mode) == false) { bLegalChannel = false; DBG_871X("(Channel <= 14) && (Channel >= 1) but wireless_mode do not support 2.4G\n"); } } else { bLegalChannel = false; DBG_871X("Channel is Invalid !!!\n"); } return bLegalChannel; }
uint loadparam(struct rtl_priv *rtlpriv, struct net_device *ndev) { uint status = _SUCCESS; struct registry_priv *registry_par = &rtlpriv->registrypriv; registry_par->chip_version = (uint8_t)rtw_chip_version; registry_par->rfintfs = (uint8_t)rtw_rfintfs; registry_par->lbkmode = (uint8_t)rtw_lbkmode; /* registry_par->hci = (uint8_t)hci; */ registry_par->network_mode = (uint8_t)rtw_network_mode; memcpy(registry_par->ssid.Ssid, "ANY", 3); registry_par->ssid.SsidLength = 3; registry_par->channel = (uint8_t)rtw_channel; registry_par->wireless_mode = (uint8_t)rtw_wireless_mode; if (IsSupported24G(registry_par->wireless_mode) && (!IsSupported5G(registry_par->wireless_mode)) && (registry_par->channel > 14)) { registry_par->channel = 1; } else if (IsSupported5G(registry_par->wireless_mode) && (!IsSupported24G(registry_par->wireless_mode)) && (registry_par->channel <= 14)) { registry_par->channel = 36; } registry_par->vrtl_carrier_sense = (uint8_t)rtw_vrtl_carrier_sense; registry_par->vcs_type = (uint8_t)rtw_vcs_type; registry_par->rts_thresh = (u16)rtw_rts_thresh; registry_par->frag_thresh = (u16)rtw_frag_thresh; registry_par->preamble = (uint8_t)rtw_preamble; registry_par->scan_mode = (uint8_t)rtw_scan_mode; registry_par->adhoc_tx_pwr = (uint8_t)rtw_adhoc_tx_pwr; registry_par->soft_ap = (uint8_t)rtw_soft_ap; registry_par->smart_ps = (uint8_t)rtw_smart_ps; registry_par->power_mgnt = (uint8_t)rtw_power_mgnt; registry_par->ips_mode = (uint8_t)rtw_ips_mode; registry_par->radio_enable = (uint8_t)rtw_radio_enable; registry_par->long_retry_lmt = (uint8_t)rtw_long_retry_lmt; registry_par->short_retry_lmt = (uint8_t)rtw_short_retry_lmt; registry_par->busy_thresh = (u16)rtw_busy_thresh; /* registry_par->qos_enable = (uint8_t)rtw_qos_enable; */ registry_par->ack_policy = (uint8_t)rtw_ack_policy; registry_par->software_encrypt = (uint8_t)rtw_software_encrypt; registry_par->software_decrypt = (uint8_t)rtw_software_decrypt; registry_par->acm_method = (uint8_t)rtw_acm_method; /* UAPSD */ registry_par->wmm_enable = (uint8_t)rtw_wmm_enable; registry_par->uapsd_enable = (uint8_t)rtw_uapsd_enable; registry_par->uapsd_max_sp = (uint8_t)rtw_uapsd_max_sp; registry_par->uapsd_acbk_en = (uint8_t)rtw_uapsd_acbk_en; registry_par->uapsd_acbe_en = (uint8_t)rtw_uapsd_acbe_en; registry_par->uapsd_acvi_en = (uint8_t)rtw_uapsd_acvi_en; registry_par->uapsd_acvo_en = (uint8_t)rtw_uapsd_acvo_en; #ifdef CONFIG_80211N_HT registry_par->ht_enable = (uint8_t)rtw_ht_enable; registry_par->bw_mode = (uint8_t)rtw_bw_mode; registry_par->ampdu_enable = (uint8_t)rtw_ampdu_enable; registry_par->rx_stbc = (uint8_t)rtw_rx_stbc; registry_par->ampdu_amsdu = (uint8_t)rtw_ampdu_amsdu; registry_par->short_gi = (uint8_t)rtw_short_gi; #endif #ifdef CONFIG_80211AC_VHT registry_par->vht_enable = (uint8_t)rtw_vht_enable; registry_par->ampdu_factor = (uint8_t)rtw_ampdu_factor; registry_par->vht_rate_sel = (uint8_t)rtw_vht_rate_sel; registry_par->ldpc_cap = (uint8_t)rtw_ldpc_cap; registry_par->stbc_cap = (uint8_t)rtw_stbc_cap; registry_par->beamform_cap = (uint8_t)rtw_beamform_cap; #endif registry_par->lowrate_two_xmit = (uint8_t)rtw_lowrate_two_xmit; registry_par->rf_config = (uint8_t)rtw_rf_config; registry_par->low_power = (uint8_t)rtw_low_power; registry_par->channel_plan = (uint8_t)rtw_channel_plan; registry_par->bAcceptAddbaReq = (uint8_t)rtw_AcceptAddbaReq; registry_par->antdiv_cfg = (uint8_t)rtw_antdiv_cfg; registry_par->antdiv_type = (uint8_t)rtw_antdiv_type; #ifdef CONFIG_AUTOSUSPEND registry_par->usbss_enable = (uint8_t)rtw_enusbss; /* 0:disable,1:enable */ #endif registry_par->hw_wps_pbc = (uint8_t)rtw_hw_wps_pbc; #ifdef CONFIG_80211D registry_par->enable80211d = (uint8_t)rtw_80211d; #endif registry_par->notch_filter = (uint8_t)rtw_notch_filter; registry_par->regulatory_tid = (uint8_t)rtw_regulatory_id; return status; }