psta->expire_to--;
}
- if (psta->expire_to <= 0)
- {
+ if (psta->expire_to <= 0) {
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
- if (padapter->registrypriv.wifi_spec == 1)
- {
+ if (padapter->registrypriv.wifi_spec == 1) {
psta->expire_to = pstapriv->expire_to;
continue;
}
ret = issue_nulldata23a(padapter, psta->hwaddr, 0, 3, 50);
psta->keep_alive_trycnt++;
- if (ret == _SUCCESS)
- {
+ if (ret == _SUCCESS) {
DBG_8723A("asoc check, sta(" MAC_FMT ") is alive\n", MAC_ARG(psta->hwaddr));
psta->expire_to = pstapriv->expire_to;
psta->keep_alive_trycnt = 0;
continue;
- }
- else if (psta->keep_alive_trycnt <= 3)
- {
+ } else if (psta->keep_alive_trycnt <= 3) {
DBG_8723A("ack check for asoc expire, keep_alive_trycnt =%d\n", psta->keep_alive_trycnt);
psta->expire_to = 1;
continue;
return;
/* b/g mode ra_bitmap */
- for (i = 0; i < sizeof(psta->bssrateset); i++)
- {
+ for (i = 0; i < sizeof(psta->bssrateset); i++) {
if (psta->bssrateset[i])
tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value23a(psta->bssrateset[i]&0x7f);
}
raid = networktype_to_raid23a(sta_band);
init_rate = get_highest_rate_idx23a(tx_ra_bitmap&0x0fffffff)&0x3f;
- if (psta->aid < NUM_STA)
- {
+ if (psta->aid < NUM_STA) {
u8 arg = 0;
arg = psta->mac_id&0x1f;
psta->raid = raid;
psta->init_rate = init_rate;
- }
- else
- {
+ } else
DBG_8723A("station aid %d exceed the max number\n", psta->aid);
- }
}
static void update_bmc_sta(struct rtw_adapter *padapter)
struct wlan_bssid_ex *pcur_network = &pmlmepriv->cur_network.network;
struct sta_info *psta = rtw_get_bcmc_stainfo23a(padapter);
- if (psta)
- {
+ if (psta) {
psta->aid = 0;/* default set to 0 */
psta->mac_id = psta->aid + 1;
psta->bssratelen = supportRateNum;
/* b/g mode ra_bitmap */
- for (i = 0; i < supportRateNum; i++)
- {
+ for (i = 0; i < supportRateNum; i++) {
if (psta->bssrateset[i])
tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value23a(psta->bssrateset[i]&0x7f);
}
psta->state = _FW_LINKED;
spin_unlock_bh(&psta->lock);
- }
- else
- {
+ } else
DBG_8723A("add_RATid23a_bmc_sta error!\n");
- }
}
/* notes: */
/* ERP */
VCS_update23a(padapter, psta);
/* HT related cap */
- if (phtpriv_sta->ht_option)
- {
+ if (phtpriv_sta->ht_option) {
/* check if sta supports rx ampdu */
phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
psta->qos_option = true;
- }
- else
- {
+ } else {
phtpriv_sta->ampdu_enable = false;
phtpriv_sta->sgi = false;
spin_lock_bh(&pmlmepriv->bcn_update_lock);
- switch (ie_id)
- {
+ switch (ie_id) {
case 0xFF:
/* 8: TimeStamp, 2: Beacon Interval 2:Capability */
update_bcn_fixed_ie(padapter);
void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated)
{
/* update associated stations cap. */
- if (updated == true)
- {
+ if (updated == true) {
struct list_head *phead, *plist, *ptmp;
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
- if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
- {
- if (!psta->no_short_preamble_set)
- {
+ if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE)) {
+ if (!psta->no_short_preamble_set) {
psta->no_short_preamble_set = 1;
pmlmepriv->num_sta_no_short_preamble++;
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
- (pmlmepriv->num_sta_no_short_preamble == 1))
- {
+ (pmlmepriv->num_sta_no_short_preamble == 1)) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
}
- }
- else
- {
- if (psta->no_short_preamble_set)
- {
+ } else {
+ if (psta->no_short_preamble_set) {
psta->no_short_preamble_set = 0;
pmlmepriv->num_sta_no_short_preamble--;
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
- (pmlmepriv->num_sta_no_short_preamble == 0))
- {
+ (pmlmepriv->num_sta_no_short_preamble == 0)) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
}
}
- if (psta->flags & WLAN_STA_NONERP)
- {
- if (!psta->nonerp_set)
- {
+ if (psta->flags & WLAN_STA_NONERP) {
+ if (!psta->nonerp_set) {
psta->nonerp_set = 1;
pmlmepriv->num_sta_non_erp++;
- if (pmlmepriv->num_sta_non_erp == 1)
- {
+ if (pmlmepriv->num_sta_non_erp == 1) {
beacon_updated = true;
update_beacon23a(padapter, WLAN_EID_ERP_INFO, NULL, true);
}
}
- }
- else
- {
- if (psta->nonerp_set)
- {
+ } else {
+ if (psta->nonerp_set) {
psta->nonerp_set = 0;
pmlmepriv->num_sta_non_erp--;
- if (pmlmepriv->num_sta_non_erp == 0)
- {
+ if (pmlmepriv->num_sta_non_erp == 0) {
beacon_updated = true;
update_beacon23a(padapter, WLAN_EID_ERP_INFO, NULL, true);
}
}
- if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME))
- {
- if (!psta->no_short_slot_time_set)
- {
+ if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) {
+ if (!psta->no_short_slot_time_set) {
psta->no_short_slot_time_set = 1;
pmlmepriv->num_sta_no_short_slot_time++;
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
- (pmlmepriv->num_sta_no_short_slot_time == 1))
- {
+ (pmlmepriv->num_sta_no_short_slot_time == 1)) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
}
- }
- else
- {
- if (psta->no_short_slot_time_set)
- {
+ } else {
+ if (psta->no_short_slot_time_set) {
psta->no_short_slot_time_set = 0;
pmlmepriv->num_sta_no_short_slot_time--;
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
- (pmlmepriv->num_sta_no_short_slot_time == 0))
- {
+ (pmlmepriv->num_sta_no_short_slot_time == 0)) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
}
}
- if (psta->flags & WLAN_STA_HT)
- {
+ if (psta->flags & WLAN_STA_HT) {
u16 ht_capab = le16_to_cpu(psta->htpriv.ht_cap.cap_info);
DBG_8723A("HT: STA " MAC_FMT " HT Capabilities "
pmlmepriv->num_sta_ht_20mhz);
}
- }
- else
- {
+ } else {
if (!psta->no_ht_set) {
psta->no_ht_set = 1;
pmlmepriv->num_sta_no_ht++;
}
}
- if (rtw_ht_operation_update(padapter) > 0)
- {
+ if (rtw_ht_operation_update(padapter) > 0) {
update_beacon23a(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
update_beacon23a(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
psta->no_short_preamble_set = 0;
pmlmepriv->num_sta_no_short_preamble--;
if (pmlmeext->cur_wireless_mode > WIRELESS_11B
- && pmlmepriv->num_sta_no_short_preamble == 0)
- {
+ && pmlmepriv->num_sta_no_short_preamble == 0) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
if (psta->nonerp_set) {
psta->nonerp_set = 0;
pmlmepriv->num_sta_non_erp--;
- if (pmlmepriv->num_sta_non_erp == 0)
- {
+ if (pmlmepriv->num_sta_non_erp == 0) {
beacon_updated = true;
update_beacon23a(padapter, WLAN_EID_ERP_INFO,
NULL, true);
psta->no_short_slot_time_set = 0;
pmlmepriv->num_sta_no_short_slot_time--;
if (pmlmeext->cur_wireless_mode > WIRELESS_11B
- && pmlmepriv->num_sta_no_short_slot_time == 0)
- {
+ && pmlmepriv->num_sta_no_short_slot_time == 0) {
beacon_updated = true;
update_beacon23a(padapter, 0xFF, NULL, true);
}
pmlmepriv->num_sta_ht_20mhz--;
}
- if (rtw_ht_operation_update(padapter) > 0)
- {
+ if (rtw_ht_operation_update(padapter) > 0) {
update_beacon23a(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
update_beacon23a(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
if (!psta)
return beacon_updated;
- if (active == true)
- {
+ if (active == true) {
/* tear down Rx AMPDU */
send_delba23a(padapter, 0, psta->hwaddr);/* recipient */
psta->qos_option = 0;
/* update 802.11n ht cap. */
- if (WLAN_STA_HT&flags)
- {
+ if (WLAN_STA_HT&flags) {
psta->htpriv.ht_option = true;
psta->qos_option = 1;
- }
- else
- {
+ } else {
psta->htpriv.ht_option = false;
}
/* called >= TSR LEVEL for USB or SDIO Interface*/
void ap_sta_info_defer_update23a(struct rtw_adapter *padapter, struct sta_info *psta)
{
- if (psta->state & _FW_LINKED)
- {
+ if (psta->state & _FW_LINKED) {
/* add ratid */
add_RATid23a(padapter, psta, 0);/* DM_RATR_STA_INIT */
}
u8 bStopBlinking = false;
/* Change LED according to BlinkingLedState specified. */
- if (pLed->BlinkingLedState == RTW_LED_ON)
- {
+ if (pLed->BlinkingLedState == RTW_LED_ON) {
SwLedOn23a(padapter, pLed);
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
- }
- else
- {
+ } else {
if (pLed->CurrLedState != LED_BLINK_WPS_STOP)
SwLedOff23a(padapter, pLed);
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
}
- switch (pLed->CurrLedState)
- {
+ switch (pLed->CurrLedState) {
case LED_BLINK_SCAN:
pLed->BlinkTimes--;
- if (pLed->BlinkTimes == 0)
- {
+ if (pLed->BlinkTimes == 0) {
bStopBlinking = true;
}
- if (bStopBlinking)
- {
+ if (bStopBlinking) {
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{
SwLedOff23a(padapter, pLed);
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
}
pLed->bLedScanBlinkInProgress = false;
- }
- else
- {
+ } else {
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{
SwLedOff23a(padapter, pLed);
- }
- else
- {
+ } else {
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
else
case LED_BLINK_TXRX:
pLed->BlinkTimes--;
- if (pLed->BlinkTimes == 0)
- {
+ if (pLed->BlinkTimes == 0) {
bStopBlinking = true;
}
- if (bStopBlinking)
- {
+ if (bStopBlinking) {
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{
SwLedOff23a(padapter, pLed);
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
}
pLed->bLedBlinkInProgress = false;
- }
- else
- {
+ } else {
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{
SwLedOff23a(padapter, pLed);
- }
- else
- {
+ } else {
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
else
break;
case LED_BLINK_WPS_STOP: /* WPS success */
- if (pLed->BlinkingLedState == RTW_LED_ON)
- {
+ if (pLed->BlinkingLedState == RTW_LED_ON) {
pLed->BlinkingLedState = RTW_LED_OFF;
mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
bStopBlinking = true;
}
- if (bStopBlinking)
- {
+ if (bStopBlinking) {
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{
SwLedOff23a(padapter, pLed);
unsigned long delay = 0;
/* Change LED according to BlinkingLedState specified. */
- if (pLed->BlinkingLedState == RTW_LED_ON)
- {
+ if (pLed->BlinkingLedState == RTW_LED_ON) {
SwLedOn23a(padapter, pLed);
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
} else {
SwLedOff23a(padapter, pLed1);
}
- switch (pLed->CurrLedState)
- {
+ switch (pLed->CurrLedState) {
case LED_BLINK_SLOWLY:
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
}
- switch (pLed->CurrLedState)
- {
+ switch (pLed->CurrLedState) {
case LED_BLINK_SCAN:
pLed->BlinkTimes--;
if (pLed->BlinkTimes == 0) {
long delay = -1;
- switch (LedAction)
- {
+ switch (LedAction) {
case LED_CTL_POWER_ON:
case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK:
break;
case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK:
- if (!IS_LED_BLINKING(pLed))
- {
+ if (!IS_LED_BLINKING(pLed)) {
pLed->CurrLedState = RTW_LED_OFF;
pLed->BlinkingLedState = RTW_LED_OFF;
delay = 0;
struct led_8723a *pLed = &ledpriv->SwLed0;
long delay = -1;
- switch (LedAction)
- {
+ switch (LedAction) {
case LED_CTL_SITE_SURVEY:
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
;
case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK:
- if (!IS_LED_BLINKING(pLed))
- {
+ if (!IS_LED_BLINKING(pLed)) {
pLed->CurrLedState = RTW_LED_OFF;
pLed->BlinkingLedState = RTW_LED_OFF;
delay = 0;
struct led_8723a *pLed = &ledpriv->SwLed0;
struct led_8723a *pLed1 = &ledpriv->SwLed1;
- switch (LedAction)
- {
+ switch (LedAction) {
case LED_CTL_START_TO_LINK:
if (pLed1->bLedWPSBlinkInProgress) {
pLed1->bLedWPSBlinkInProgress = false;
}
pLed->bLedWPSBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_WPS;
- if (pLed->bLedOn)
- {
+ if (pLed->bLedOn) {
pLed->BlinkingLedState = RTW_LED_OFF;
mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_SLOWLY_INTERVAL));
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct led_8723a *pLed = &ledpriv->SwLed0;
- switch (LedAction)
- {
+ switch (LedAction) {
case LED_CTL_POWER_ON:
case LED_CTL_NO_LINK:
case LED_CTL_LINK: /* solid blue */
if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
check_fwstate(pmlmepriv, _FW_LINKED))
;
- else if (pLed->bLedScanBlinkInProgress == false)
- {
- if (pLed->bLedBlinkInProgress == true)
- {
+ else if (pLed->bLedScanBlinkInProgress == false) {
+ if (pLed->bLedBlinkInProgress == true) {
del_timer_sync(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false;
}