diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 5ce562d..78e9bfa 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -54,7 +54,7 @@ void init_mlme_ap_info(struct adapter *padapter) void free_mlme_ap_info(struct adapter *padapter) { unsigned long irqL; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -93,7 +93,7 @@ static void update_BCNTIM(struct adapter *padapter) /* if (pstapriv->tim_bitmap) */ if (true) { - u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL; + u8 *p, *dst_ie, *premainder_ie =NULL, *pbackup_remainder_ie =NULL; __le16 tim_bitmap_le; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; @@ -132,7 +132,7 @@ static void update_BCNTIM(struct adapter *padapter) offset += tmp_len+2; } - /* DS Parameter Set IE, len=3 */ + /* DS Parameter Set IE, len =3 */ offset += 3; premainder_ie = pie + offset; @@ -169,11 +169,11 @@ static void update_BCNTIM(struct adapter *padapter) else *dst_ie++ = 0; - if (tim_ielen==4) + if (tim_ielen ==4) { *dst_ie++ = *(u8*)&tim_bitmap_le; } - else if (tim_ielen==5) + else if (tim_ielen ==5) { memcpy(dst_ie, &tim_bitmap_le, 2); dst_ie+=2; @@ -200,7 +200,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8 struct ndis_802_11_variable_ies * pIE; u8 bmatch = false; u8 *pie = pnetwork->IEs; - u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL; + u8 *p, *dst_ie, *premainder_ie =NULL, *pbackup_remainder_ie =NULL; u32 i, offset, ielen, ie_offset, remainder_ielen = 0; for (i = sizeof(struct ndis_802_11_fixed_ies); i < pnetwork->IELength;) @@ -267,7 +267,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8 void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8 index) { - u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL; + u8 *p, *dst_ie, *premainder_ie =NULL, *pbackup_remainder_ie =NULL; uint offset, ielen, ie_offset, remainder_ielen = 0; u8 *pie = pnetwork->IEs; @@ -329,7 +329,7 @@ void expire_timeout_chk(struct adapter *padapter) unsigned long irqL; struct list_head *phead, *plist; u8 updated; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct sta_priv *pstapriv = &padapter->stapriv; u8 chk_alive_num = 0; char chk_alive_list[NUM_STA]; @@ -355,7 +355,7 @@ void expire_timeout_chk(struct adapter *padapter) pstapriv->auth_list_cnt--; DBG_871X("auth expire %02X%02X%02X%02X%02X%02X\n", - psta->hwaddr[0],psta->hwaddr[1],psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]); + psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2], psta->hwaddr[3], psta->hwaddr[4], psta->hwaddr[5]); spin_unlock_bh(&pstapriv->auth_list_lock); @@ -432,7 +432,7 @@ void expire_timeout_chk(struct adapter *padapter) rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; - DBG_871X("asoc expire "MAC_FMT", state=0x%x\n", MAC_ARG(psta->hwaddr), psta->state); + DBG_871X("asoc expire "MAC_FMT", state =0x%x\n", MAC_ARG(psta->hwaddr), psta->state); updated = ap_free_sta(padapter, psta, false, WLAN_REASON_DEAUTH_LEAVING); } else @@ -452,7 +452,7 @@ void expire_timeout_chk(struct adapter *padapter) spin_unlock_bh(&pstapriv->asoc_list_lock); if (chk_alive_num) { - u8 backup_oper_channel=0; + u8 backup_oper_channel =0; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; /* switch to correct channel of current network before issue keep-alive frames */ if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) { @@ -483,16 +483,16 @@ void expire_timeout_chk(struct adapter *padapter) } else if (psta->keep_alive_trycnt <= 3) { - DBG_871X("ack check for asoc expire, keep_alive_trycnt=%d\n", psta->keep_alive_trycnt); + DBG_871X("ack check for asoc expire, keep_alive_trycnt =%d\n", psta->keep_alive_trycnt); psta->expire_to = 1; continue; } psta->keep_alive_trycnt = 0; - DBG_871X("asoc expire "MAC_FMT", state=0x%x\n", MAC_ARG(psta->hwaddr), psta->state); + DBG_871X("asoc expire "MAC_FMT", state =0x%x\n", MAC_ARG(psta->hwaddr), psta->state); spin_lock_bh(&pstapriv->asoc_list_lock); - if (rtw_is_list_empty(&psta->asoc_list)==false) { + if (rtw_is_list_empty(&psta->asoc_list) ==false) { rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; updated = ap_free_sta(padapter, psta, false, WLAN_REASON_DEAUTH_LEAVING); @@ -511,10 +511,10 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) { int i; u8 rf_type; - u32 init_rate=0; + u32 init_rate =0; unsigned char sta_band = 0, raid, shortGIrate = false; unsigned char limit; - unsigned int tx_ra_bitmap=0; + unsigned int tx_ra_bitmap =0; struct ht_priv *psta_ht = NULL; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct wlan_bssid_ex *pcur_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network; @@ -528,7 +528,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) return; /* b/g mode ra_bitmap */ - for (i=0; ibssrateset); i++) + for (i =0; ibssrateset); i++) { if (psta->bssrateset[i]) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); @@ -538,11 +538,11 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) { rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); if (rf_type == RF_2T2R) - limit=16;/* 2R */ + limit =16;/* 2R */ else - limit=8;/* 1R */ + limit =8;/* 1R */ - for (i=0; iht_cap.mcs.rx_mask[i/8] & BIT(i%8)) tx_ra_bitmap |= BIT(i+12); } @@ -583,13 +583,13 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) arg |= BIT(7);/* support entry 2~31 */ - if (shortGIrate==true) + if (shortGIrate ==true) arg |= BIT(5); tx_ra_bitmap |= ((raid<<28)&0xf0000000); - DBG_871X("%s=> mac_id:%d , raid:%d , bitmap=0x%x, arg=0x%x\n", - __FUNCTION__ , psta->mac_id, raid ,tx_ra_bitmap, arg); + DBG_871X("%s => mac_id:%d , raid:%d , bitmap =0x%x, arg =0x%x\n", + __FUNCTION__ , psta->mac_id, raid , tx_ra_bitmap, arg); /* bitmap[0:27] = tx_rate_bitmap */ /* bitmap[28:31]= Rate Adaptive id */ @@ -598,7 +598,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, rssi_level); - if (shortGIrate==true) + if (shortGIrate ==true) init_rate |= BIT(6); /* set ra_id, init_rate */ @@ -616,10 +616,10 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) void update_bmc_sta(struct adapter *padapter) { unsigned long irqL; - u32 init_rate=0; + u32 init_rate =0; unsigned char network_type, raid; int i, supportRateNum = 0; - unsigned int tx_ra_bitmap=0; + unsigned int tx_ra_bitmap =0; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct wlan_bssid_ex *pcur_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network; struct sta_info *psta = rtw_get_bcmc_stainfo(padapter); @@ -645,7 +645,7 @@ void update_bmc_sta(struct adapter *padapter) psta->bssratelen = supportRateNum; /* b/g mode ra_bitmap */ - for (i=0; ibssrateset[i]) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f); @@ -678,12 +678,12 @@ void update_bmc_sta(struct adapter *padapter) arg |= BIT(7); - /* if (shortGIrate==true) */ + /* if (shortGIrate ==true) */ /* arg |= BIT(5); */ tx_ra_bitmap |= ((raid<<28)&0xf0000000); - DBG_871X("update_bmc_sta, mask=0x%x, arg=0x%x\n", tx_ra_bitmap, arg); + DBG_871X("update_bmc_sta, mask =0x%x, arg =0x%x\n", tx_ra_bitmap, arg); /* bitmap[0:27] = tx_rate_bitmap */ /* bitmap[28:31]= Rate Adaptive id */ @@ -716,7 +716,7 @@ void update_bmc_sta(struct adapter *padapter) /* MAC_ID = AID+1 for sta in ap/adhoc mode */ /* MAC_ID = 1 for bc/mc for sta/ap/adhoc */ /* MAC_ID = 0 for bssid for sta/ap/adhoc */ -/* CAM_ID = 0~3 for default key, cmd_id=macid + 3, macid=aid+1; */ +/* CAM_ID = 0~3 for default key, cmd_id =macid + 3, macid =aid+1; */ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta) { @@ -731,12 +731,12 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta) /* psta->mac_id = psta->aid+4; */ psta->mac_id = psta->aid+1; - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); /* ap mode */ - rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true); + rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true); - if (psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X) + if (psecuritypriv->dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X) psta->ieee8021x_blocked = true; else psta->ieee8021x_blocked = false; @@ -825,7 +825,7 @@ static void update_hw_ht_param(struct adapter *padapter) /* */ pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) - DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__); + DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__); /* */ /* Config current HT Protection mode. */ @@ -843,12 +843,12 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) int ie_len; struct registry_priv *pregpriv = &padapter->registrypriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct security_priv* psecuritypriv=&(padapter->securitypriv); + struct security_priv* psecuritypriv =&(padapter->securitypriv); struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wlan_bssid_ex *pnetwork_mlmeext = &(pmlmeinfo->network); - struct HT_info_element *pht_info=NULL; + struct HT_info_element *pht_info =NULL; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ @@ -959,7 +959,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) /* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */ set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode); - DBG_871X("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset); + DBG_871X("CH =%d, BW =%d, offset =%d\n", cur_channel, cur_bwmode, cur_ch_offset); /* */ pmlmeext->cur_channel = cur_channel; @@ -986,7 +986,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) update_beacon(padapter, _TIM_IE_, NULL, false); /* issue beacon frame */ - if (send_beacon(padapter)==_FAIL) + if (send_beacon(padapter) ==_FAIL) DBG_871X("issue_beacon, fail!\n"); } @@ -996,18 +996,18 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) { - int ret=_SUCCESS; + int ret =_SUCCESS; u8 *p; - u8 *pHT_caps_ie=NULL; - u8 *pHT_info_ie=NULL; + u8 *pHT_caps_ie =NULL; + u8 *pHT_info_ie =NULL; struct sta_info *psta = NULL; - u16 cap, ht_cap=false; + u16 cap, ht_cap =false; uint ie_len = 0; int group_cipher, pairwise_cipher; u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX]; int supportRateNum = 0; - u8 OUI1[] = {0x00, 0x50, 0xf2,0x01}; - u8 wps_oui[4]={0x0,0x50,0xf2,0x04}; + u8 OUI1[] = {0x00, 0x50, 0xf2, 0x01}; + u8 wps_oui[4]={0x0, 0x50, 0xf2, 0x04}; u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct security_priv *psecuritypriv = &padapter->securitypriv; @@ -1028,7 +1028,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) /* ht_capab, ht_oper */ /* WPS IE */ - DBG_871X("%s, len=%d\n", __FUNCTION__, len); + DBG_871X("%s, len =%d\n", __FUNCTION__, len); if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return _FAIL; @@ -1127,7 +1127,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) { if (rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { - psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; + psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */ psecuritypriv->wpa_psk |= BIT(1); @@ -1150,7 +1150,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) { if (rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { - psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X; + psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */ @@ -1209,7 +1209,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p+2); - pHT_caps_ie=p; + pHT_caps_ie =p; ht_cap = true; @@ -1243,7 +1243,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len>0) { - pHT_info_ie=p; + pHT_info_ie =p; } switch (network_type) { @@ -1276,12 +1276,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) } /* ht_cap */ - if (pregistrypriv->ht_enable && ht_cap==true) + if (pregistrypriv->ht_enable && ht_cap ==true) { pmlmepriv->htpriv.ht_option = true; pmlmepriv->qospriv.qos_option = 1; - if (pregistrypriv->ampdu_enable==1) + if (pregistrypriv->ampdu_enable ==1) { pmlmepriv->htpriv.ampdu_enable = true; } @@ -1306,7 +1306,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) return _FAIL; } } - psta->state |= WIFI_AP_STATE; /* Aries, add,fix bug of flush_cam_entry at STOP AP mode , 0724 */ + psta->state |= WIFI_AP_STATE; /* Aries, add, fix bug of flush_cam_entry at STOP AP mode , 0724 */ rtw_indicate_connect( padapter); pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */ @@ -1323,7 +1323,7 @@ void rtw_set_macaddr_acl(struct adapter *padapter, int mode) struct sta_priv *pstapriv = &padapter->stapriv; struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; - DBG_871X("%s, mode=%d\n", __func__, mode); + DBG_871X("%s, mode =%d\n", __func__, mode); pacl_list->mode = mode; } @@ -1333,13 +1333,13 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) unsigned long irqL; struct list_head *plist, *phead; u8 added = false; - int i, ret=0; + int i, ret =0; struct rtw_wlan_acl_node *paclnode; struct sta_priv *pstapriv = &padapter->stapriv; struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; struct __queue *pacl_node_q =&pacl_list->acl_node_q; - DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr)); + DBG_871X("%s(acl_num =%d) =" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr)); if ((NUM_ACL-1) < pacl_list->num) return (-1); @@ -1375,7 +1375,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) spin_lock_bh(&(pacl_node_q->lock)); - for (i=0; i< NUM_ACL; i++) + for (i =0; i< NUM_ACL; i++) { paclnode = &pacl_list->aclnode[i]; @@ -1395,7 +1395,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) } } - DBG_871X("%s, acl_num=%d\n", __func__, pacl_list->num); + DBG_871X("%s, acl_num =%d\n", __func__, pacl_list->num); spin_unlock_bh(&(pacl_node_q->lock)); @@ -1406,13 +1406,13 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) { unsigned long irqL; struct list_head *plist, *phead; - int i, ret=0; + int i, ret =0; struct rtw_wlan_acl_node *paclnode; struct sta_priv *pstapriv = &padapter->stapriv; struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; struct __queue *pacl_node_q =&pacl_list->acl_node_q; - DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr)); + DBG_871X("%s(acl_num =%d) =" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr)); spin_lock_bh(&(pacl_node_q->lock)); @@ -1439,7 +1439,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) spin_unlock_bh(&(pacl_node_q->lock)); - DBG_871X("%s, acl_num=%d\n", __func__, pacl_list->num); + DBG_871X("%s, acl_num =%d\n", __func__, pacl_list->num); return ret; @@ -1460,7 +1460,7 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter) unsigned char *p, *ie = pnetwork->IEs; u32 len = 0; - DBG_871X("%s, ERP_enable=%d\n", __FUNCTION__, pmlmeinfo->ERP_enable); + DBG_871X("%s, ERP_enable =%d\n", __FUNCTION__, pmlmeinfo->ERP_enable); if (!pmlmeinfo->ERP_enable) return; @@ -1518,8 +1518,8 @@ static void update_bcn_wmm_ie(struct adapter *padapter) static void update_bcn_wps_ie(struct adapter *padapter) { - u8 *pwps_ie=NULL, *pwps_ie_src, *premainder_ie, *pbackup_remainder_ie=NULL; - uint wps_ielen=0, wps_offset, remainder_ielen; + u8 *pwps_ie =NULL, *pwps_ie_src, *premainder_ie, *pbackup_remainder_ie =NULL; + uint wps_ielen =0, wps_offset, remainder_ielen; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1532,7 +1532,7 @@ static void update_bcn_wps_ie(struct adapter *padapter) pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen); - if (pwps_ie==NULL || wps_ielen==0) + if (pwps_ie ==NULL || wps_ielen ==0) return; wps_offset = (uint)(pwps_ie-ie); @@ -1707,7 +1707,7 @@ static int rtw_ht_operation_update(struct adapter *padapter) /* if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed) */ /* return 0; */ - DBG_871X("%s current operation mode=0x%X\n", + DBG_871X("%s current operation mode =0x%X\n", __FUNCTION__, pmlmepriv->ht_op_mode); if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT) @@ -1758,7 +1758,7 @@ static int rtw_ht_operation_update(struct adapter *padapter) op_mode_changes++; } - DBG_871X("%s new operation mode=0x%X changes=%d\n", + DBG_871X("%s new operation mode =0x%X changes =%d\n", __FUNCTION__, pmlmepriv->ht_op_mode, op_mode_changes); return op_mode_changes; @@ -1772,7 +1772,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated) { unsigned long irqL; struct list_head *phead, *plist; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct sta_priv *pstapriv = &padapter->stapriv; spin_lock_bh(&pstapriv->asoc_list_lock); @@ -1947,7 +1947,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta) /* update associcated stations cap. */ associated_clients_update(padapter, beacon_updated); - DBG_871X("%s, updated=%d\n", __func__, beacon_updated); + DBG_871X("%s, updated =%d\n", __func__, beacon_updated); } @@ -2013,7 +2013,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta) update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true); } - DBG_871X("%s, updated=%d\n", __func__, beacon_updated); + DBG_871X("%s, updated =%d\n", __func__, beacon_updated); return beacon_updated; @@ -2072,12 +2072,12 @@ int rtw_ap_inform_ch_switch (struct adapter *padapter, u8 new_ch, u8 ch_offset) { unsigned long irqL; struct list_head *phead, *plist; - int ret=0; + int ret =0; struct sta_info *psta = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) return ret; @@ -2109,12 +2109,12 @@ int rtw_sta_flush(struct adapter *padapter) { unsigned long irqL; struct list_head *phead, *plist; - int ret=0; + int ret =0; struct sta_info *psta = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 chk_alive_num = 0; char chk_alive_list[NUM_STA]; int i; @@ -2211,14 +2211,14 @@ void rtw_ap_restore_network(struct adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct sta_priv * pstapriv = &padapter->stapriv; struct sta_info *psta; - struct security_priv* psecuritypriv=&(padapter->securitypriv); + struct security_priv* psecuritypriv =&(padapter->securitypriv); unsigned long irqL; struct list_head *phead, *plist; u8 chk_alive_num = 0; char chk_alive_list[NUM_STA]; int i; - rtw_setopmode_cmd(padapter, Ndis802_11APMode,false); + rtw_setopmode_cmd(padapter, Ndis802_11APMode, false); set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); @@ -2228,7 +2228,7 @@ void rtw_ap_restore_network(struct adapter *padapter) (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { /* restore group key, WEP keys is restored in ips_leave() */ - rtw_set_key(padapter, psecuritypriv, psecuritypriv->dot118021XGrpKeyid, 0,false); + rtw_set_key(padapter, psecuritypriv, psecuritypriv->dot118021XGrpKeyid, 0, false); } spin_lock_bh(&pstapriv->asoc_list_lock); @@ -2264,7 +2264,7 @@ void rtw_ap_restore_network(struct adapter *padapter) if ( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { - rtw_setstakey_cmd(padapter, (unsigned char *)psta, true,false); + rtw_setstakey_cmd(padapter, (unsigned char *)psta, true, false); } } } @@ -2300,7 +2300,7 @@ void start_ap_mode(struct adapter *padapter) pmlmepriv->ht_op_mode = 0; - for (i=0; ista_aid[i] = NULL; pmlmepriv->wps_beacon_ie = NULL; @@ -2328,7 +2328,7 @@ void stop_ap_mode(struct adapter *padapter) unsigned long irqL; struct list_head *phead, *plist; struct rtw_wlan_acl_node *paclnode; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -2362,7 +2362,7 @@ void stop_ap_mode(struct adapter *padapter) } spin_unlock_bh(&(pacl_node_q->lock)); - DBG_871X("%s, free acl_node_queue, num=%d\n", __func__, pacl_list->num); + DBG_871X("%s, free acl_node_queue, num =%d\n", __func__, pacl_list->num); rtw_sta_flush(padapter); diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index 2f58a42..189f982 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -237,8 +237,8 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char mac = scan_tlv(&data[8], len-8, 1, 1); if (mac) { _DEBUG_INFO("Router Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], - replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], + replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); memcpy(mac, replace_mac, 6); return 1; } @@ -249,8 +249,8 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char mac = scan_tlv(&data[16], len-16, 1, 1); if (mac) { _DEBUG_INFO("Router Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], - replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], + replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); memcpy(mac, replace_mac, 6); return 1; } @@ -261,8 +261,8 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char mac = scan_tlv(&data[24], len-24, 1, 1); if (mac) { _DEBUG_INFO("Neighbor Solicitation, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], - replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], + replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); memcpy(mac, replace_mac, 6); return 1; } @@ -273,8 +273,8 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char mac = scan_tlv(&data[24], len-24, 2, 1); if (mac) { _DEBUG_INFO("Neighbor Advertisement, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], - replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], + replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); memcpy(mac, replace_mac, 6); return 1; } @@ -285,8 +285,8 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char mac = scan_tlv(&data[40], len-40, 2, 1); if (mac) { _DEBUG_INFO("Redirect, replace MAC From: %02x:%02x:%02x:%02x:%02x:%02x, To: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0],mac[1],mac[2],mac[3],mac[4],mac[5], - replace_mac[0],replace_mac[1],replace_mac[2],replace_mac[3],replace_mac[4],replace_mac[5]); + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], + replace_mac[0], replace_mac[1], replace_mac[2], replace_mac[3], replace_mac[4], replace_mac[5]); memcpy(mac, replace_mac, 6); return 1; } @@ -303,12 +303,12 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb) /* dst_mac[0] = 0xff; */ /* dst_mac[1] = 0xff; */ - /*modified by qinjunjie,ipv6 multicast address ix 0x33-33-xx-xx-xx-xx*/ + /*modified by qinjunjie, ipv6 multicast address ix 0x33-33-xx-xx-xx-xx*/ dst_mac[0] = 0x33; dst_mac[1] = 0x33; memcpy(&dst_mac[2], &iph->daddr.s6_addr32[3], 4); #if defined(__LINUX_2_6__) - /*modified by qinjunjie,warning:should not remove next line*/ + /*modified by qinjunjie, warning:should not remove next line*/ skb->pkt_type = PACKET_MULTICAST; #endif } @@ -368,7 +368,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr) unsigned long x = 0; int i; - for (i=0; ibr_ext_lock); - for (i=0; inethash[i]; @@ -573,7 +573,7 @@ void nat25_db_expire(struct adapter *priv) /* if (!priv->ethBrExtInfo.nat25_disable) */ { - for (i=0; inethash[i]; @@ -624,7 +624,7 @@ static int checkIPMcAndReplace(struct adapter *priv, struct sk_buff *skb, unsign if (pstat->ipmc_num == 0) continue; - for (i=0; iipmc[i].used && !memcmp(&pstat->ipmc[i].mcmac[3], ((unsigned char *)dst_ip)+1, 3)) { memcpy(skb->data, pstat->ipmc[i].mcmac, ETH_ALEN); return 1; @@ -672,7 +672,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) /* in class A, B, C, host address is all zero or all one is illegal */ if (iph->saddr == 0) return 0; - DEBUG_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); + DEBUG_INFO("NAT25: Insert IP, SA =%08x, DA =%08x\n", iph->saddr, iph->daddr); __nat25_generate_ipv4_network_addr(networkAddr, &tmp); /* record source IP address and , source mac address into db */ __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr); @@ -683,7 +683,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr); + DEBUG_INFO("NAT25: Lookup IP, SA =%08x, DA =%08x\n", iph->saddr, iph->daddr); #ifdef SUPPORT_TX_MCAST2UNI if (priv->pshare->rf_ft_var.mc2u_disable || ((((OPMODE & (WIFI_STATION_STATE|WIFI_ASOC_STATE)) == @@ -704,7 +704,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) /* forward unknow IP packet to upper TCP/IP */ DEBUG_INFO("NAT25: Replace DA with BR's MAC\n"); if ( (*(u32 *)priv->br_mac) == 0 && (*(u16 *)(priv->br_mac+4)) == 0 ) { - printk("Re-init netdev_br_init() due to br_mac==0!\n"); + printk("Re-init netdev_br_init() due to br_mac ==0!\n"); netdev_br_init(priv->pnetdev); } memcpy(skb->data, priv->br_mac, ETH_ALEN); @@ -741,7 +741,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert ARP, MAC=%02x%02x%02x%02x%02x%02x\n", arp_ptr[0], + DEBUG_INFO("NAT25: Insert ARP, MAC =%02x%02x%02x%02x%02x%02x\n", arp_ptr[0], arp_ptr[1], arp_ptr[2], arp_ptr[3], arp_ptr[4], arp_ptr[5]); /* change to ARP sender mac address to wlan STA address */ @@ -797,14 +797,14 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) if (protocol == ETH_P_IPX) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n"); + DEBUG_INFO("NAT25: Protocol =IPX (Ethernet II)\n"); ipx = (struct ipxhdr *)framePtr; } else if (protocol <= ETH_FRAME_LEN) { if (!memcmp(ipx_header, framePtr, 2)) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n"); + DEBUG_INFO("NAT25: Protocol =IPX (Ethernet 802.3)\n"); ipx = (struct ipxhdr *)framePtr; } else @@ -824,7 +824,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) { framePtr += 5; /* eliminate the SNAP header */ - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n"); + DEBUG_INFO("NAT25: Protocol =IPX (Ethernet SNAP)\n"); ipx = (struct ipxhdr *)framePtr; } else if (!memcmp(aarp_snap_id, framePtr, 5)) @@ -841,7 +841,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) } else { - DEBUG_WARN("NAT25: Protocol=Ethernet SNAP %02x%02x%02x%02x%02x\n", framePtr[0], + DEBUG_WARN("NAT25: Protocol =Ethernet SNAP %02x%02x%02x%02x%02x\n", framePtr[0], framePtr[1], framePtr[2], framePtr[3], framePtr[4]); return -1; } @@ -852,7 +852,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) if (!memcmp(ipx_header, framePtr, 2)) { - DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n"); + DEBUG_INFO("NAT25: Protocol =IPX (Ethernet 802.2)\n"); ipx = (struct ipxhdr *)framePtr; } else @@ -880,7 +880,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n", + DEBUG_INFO("NAT25: Insert IPX, Dest =%08x,%02x%02x%02x%02x%02x%02x,%04x Source =%08x,%02x%02x%02x%02x%02x%02x,%04x\n", ipx->ipx_dest.net, ipx->ipx_dest.node[0], ipx->ipx_dest.node[1], @@ -965,7 +965,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) /* change to AARP source mac address to wlan STA address */ memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN); - DEBUG_INFO("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n", + DEBUG_INFO("NAT25: Insert AARP, Source =%d,%d Destination =%d,%d\n", ea->pa_src_net, ea->pa_src_node, ea->pa_dst_net, @@ -981,7 +981,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n", + DEBUG_INFO("NAT25: Lookup AARP, Source =%d,%d Destination =%d,%d\n", ea->pa_src_net, ea->pa_src_node, ea->pa_dst_net, @@ -1011,7 +1011,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n", + DEBUG_INFO("NAT25: Insert DDP, Source =%d,%d Destination =%d,%d\n", ddp->deh_snet, ddp->deh_snode, ddp->deh_dnet, @@ -1027,7 +1027,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_LOOKUP: { - DEBUG_INFO("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n", + DEBUG_INFO("NAT25: Lookup DDP, Source =%d,%d Destination =%d,%d\n", ddp->deh_snet, ddp->deh_snode, ddp->deh_dnet, @@ -1071,7 +1071,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) if (priv->ethBrExtInfo.addPPPoETag) { struct pppoe_tag *tag, *pOldTag; unsigned char tag_buf[40]; - int old_tag_len=0; + int old_tag_len =0; tag = (struct pppoe_tag *)tag_buf; pOldTag = (struct pppoe_tag *)__nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID)); @@ -1147,7 +1147,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) struct pppoe_tag *tag; unsigned char *ptr; unsigned short tagType, tagLen; - int offset=0; + int offset =0; if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == NULL) { DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n"); @@ -1282,12 +1282,12 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) case NAT25_INSERT: { - DEBUG_INFO("NAT25: Insert IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," - " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", - iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3], - iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7], - iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3], - iph->daddr.s6_addr16[4],iph->daddr.s6_addr16[5],iph->daddr.s6_addr16[6],iph->daddr.s6_addr16[7]); + DEBUG_INFO("NAT25: Insert IP, SA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," + " DA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", + iph->saddr.s6_addr16[0], iph->saddr.s6_addr16[1], iph->saddr.s6_addr16[2], iph->saddr.s6_addr16[3], + iph->saddr.s6_addr16[4], iph->saddr.s6_addr16[5], iph->saddr.s6_addr16[6], iph->saddr.s6_addr16[7], + iph->daddr.s6_addr16[0], iph->daddr.s6_addr16[1], iph->daddr.s6_addr16[2], iph->daddr.s6_addr16[3], + iph->daddr.s6_addr16[4], iph->daddr.s6_addr16[5], iph->daddr.s6_addr16[6], iph->daddr.s6_addr16[7]); if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) { __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr); @@ -1311,12 +1311,12 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) return 0; case NAT25_LOOKUP: - DEBUG_INFO("NAT25: Lookup IP, SA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," - " DA=%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", - iph->saddr.s6_addr16[0],iph->saddr.s6_addr16[1],iph->saddr.s6_addr16[2],iph->saddr.s6_addr16[3], - iph->saddr.s6_addr16[4],iph->saddr.s6_addr16[5],iph->saddr.s6_addr16[6],iph->saddr.s6_addr16[7], - iph->daddr.s6_addr16[0],iph->daddr.s6_addr16[1],iph->daddr.s6_addr16[2],iph->daddr.s6_addr16[3], - iph->daddr.s6_addr16[4],iph->daddr.s6_addr16[5],iph->daddr.s6_addr16[6],iph->daddr.s6_addr16[7]); + DEBUG_INFO("NAT25: Lookup IP, SA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x," + " DA =%4x:%4x:%4x:%4x:%4x:%4x:%4x:%4x\n", + iph->saddr.s6_addr16[0], iph->saddr.s6_addr16[1], iph->saddr.s6_addr16[2], iph->saddr.s6_addr16[3], + iph->saddr.s6_addr16[4], iph->saddr.s6_addr16[5], iph->saddr.s6_addr16[6], iph->saddr.s6_addr16[7], + iph->daddr.s6_addr16[0], iph->daddr.s6_addr16[1], iph->daddr.s6_addr16[2], iph->daddr.s6_addr16[3], + iph->daddr.s6_addr16[4], iph->daddr.s6_addr16[5], iph->daddr.s6_addr16[6], iph->daddr.s6_addr16[7]); __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->daddr); @@ -1342,13 +1342,13 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb) { if (!(skb->data[0] & 1)) { - int is_vlan_tag=0, i, retval=0; - unsigned short vlan_hdr=0; + int is_vlan_tag =0, i, retval =0; + unsigned short vlan_hdr =0; if (*((__be16 *)(skb->data+ETH_ALEN*2)) == __constant_htons(ETH_P_8021Q)) { is_vlan_tag = 1; vlan_hdr = *((unsigned short *)(skb->data+ETH_ALEN*2+2)); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((unsigned short *)(skb->data+ETH_ALEN*2+2-i*2)) = *((unsigned short *)(skb->data+ETH_ALEN*2-2-i*2)); skb_pull(skb, 4); } @@ -1387,7 +1387,7 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb) if (is_vlan_tag) { skb_push(skb, 4); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((__be16 *)(skb->data+i*2)) = *((__be16 *)(skb->data+4+i*2)); *((__be16 *)(skb->data+ETH_ALEN*2)) = __constant_htons(ETH_P_8021Q); *((__be16 *)(skb->data+ETH_ALEN*2+2)) = cpu_to_be16(vlan_hdr); diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 30a9e63..ed5e5be 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -40,7 +40,7 @@ No irqsave is necessary. sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) { - sint res=_SUCCESS; + sint res =_SUCCESS; ; @@ -58,7 +58,7 @@ sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) pcmdpriv->cmd_allocated_buf = rtw_zmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ); if (pcmdpriv->cmd_allocated_buf == NULL){ - res= _FAIL; + res = _FAIL; goto exit; } @@ -67,7 +67,7 @@ sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4); if (pcmdpriv->rsp_allocated_buf == NULL){ - res= _FAIL; + res = _FAIL; goto exit; } @@ -88,7 +88,7 @@ static void c2h_wk_callback(struct work_struct *work); #endif sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) { - sint res=_SUCCESS; + sint res =_SUCCESS; #ifdef CONFIG_H2CLBK _rtw_init_sema(&(pevtpriv->lbkevt_done), 0); @@ -112,7 +112,7 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) void _rtw_free_evt_priv (struct evt_priv *pevtpriv) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("+_rtw_free_evt_priv\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+_rtw_free_evt_priv\n")); #ifdef CONFIG_C2H_WK _cancel_workitem_sync(&pevtpriv->c2h_wk); @@ -129,7 +129,7 @@ void _rtw_free_evt_priv (struct evt_priv *pevtpriv) rtw_cbuf_free(pevtpriv->c2h_queue); #endif - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("-_rtw_free_evt_priv\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n")); ; @@ -222,14 +222,14 @@ u32 rtw_init_evt_priv (struct evt_priv *pevtpriv) void rtw_free_evt_priv (struct evt_priv *pevtpriv) { ; - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("rtw_free_evt_priv\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_evt_priv\n")); _rtw_free_evt_priv(pevtpriv); ; } void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("rtw_free_cmd_priv\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_cmd_priv\n")); _rtw_free_cmd_priv(pcmdpriv); } @@ -257,7 +257,7 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) bAllow = true; if ( (pcmdpriv->padapter->hw_init_completed ==false && bAllow == false) - || pcmdpriv->cmdthd_running== false /* com_thread not running */ + || pcmdpriv->cmdthd_running == false /* com_thread not running */ ) { /* DBG_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __FUNCTION__, */ @@ -286,7 +286,7 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) cmd_obj->padapter = padapter; - if ( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) { + if ( _FAIL == (res =rtw_cmd_filter(pcmdpriv, cmd_obj)) ) { rtw_free_cmd_obj(cmd_obj); goto exit; } @@ -375,10 +375,10 @@ int rtw_cmd_thread(void * context) prspbuf = pcmdpriv->rsp_buf; pcmdpriv->stop_req = 0; - pcmdpriv->cmdthd_running=true; + pcmdpriv->cmdthd_running =true; _rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema); - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("start r871x rtw_cmd_thread !!!!\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n")); while (1) { @@ -406,7 +406,7 @@ int rtw_cmd_thread(void * context) } _next: - if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved== true)) + if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved == true)) { DBG_871X_LEVEL(_drv_always_, "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n", __FUNCTION__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__); @@ -456,7 +456,7 @@ post_process: pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback; if (pcmd_callback == NULL) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("mlme_cmd_hdl(): pcmd_callback=0x%p, cmdcode=0x%x\n", pcmd_callback, pcmd->cmdcode)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback =0x%p, cmdcode =0x%x\n", pcmd_callback, pcmd->cmdcode)); rtw_free_cmd_obj(pcmd); } else @@ -467,7 +467,7 @@ post_process: } else { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("%s: cmdcode=0x%x callback not defined!\n", __FUNCTION__, pcmd->cmdcode)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("%s: cmdcode =0x%x callback not defined!\n", __FUNCTION__, pcmd->cmdcode)); rtw_free_cmd_obj(pcmd); } @@ -476,13 +476,13 @@ post_process: goto _next; } - pcmdpriv->cmdthd_running=false; + pcmdpriv->cmdthd_running =false; /* free all cmd_obj resources */ do{ pcmd = rtw_dequeue_cmd(pcmdpriv); - if (pcmd==NULL) { + if (pcmd ==NULL) { break; } @@ -503,7 +503,7 @@ u8 rtw_setstandby_cmd(struct adapter *padapter, uint action) { struct cmd_obj* ph2c; struct usb_suspend_parm* psetusbsuspend; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; u8 ret = _SUCCESS; @@ -549,7 +549,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_P2P - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true){ @@ -584,7 +584,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, /* prepare ssid list */ if (ssid) { int i; - for (i=0; issid[i], &ssid[i], sizeof(struct ndis_802_11_ssid)); psurveyPara->ssid_num++; @@ -595,7 +595,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, /* prepare channel list */ if (ch) { int i; - for (i=0; ich[i], &ch[i], sizeof(struct rtw_ieee80211_channel)); psurveyPara->ch_num++; @@ -664,14 +664,14 @@ u8 rtw_setbasicrate_cmd(struct adapter *padapter, u8 *rateset) { struct cmd_obj* ph2c; struct setbasicrate_parm* pssetbasicratepara; - struct cmd_priv* pcmdpriv=&padapter->cmdpriv; + struct cmd_priv* pcmdpriv =&padapter->cmdpriv; u8 res = _SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { - res= _FAIL; + res = _FAIL; goto exit; } pssetbasicratepara = (struct setbasicrate_parm*)rtw_zmalloc(sizeof(struct setbasicrate_parm)); @@ -706,29 +706,29 @@ u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch) { struct cmd_obj* ph2c; struct setphy_parm* psetphypara; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; /* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */ /* struct registry_priv* pregistry_priv = &padapter->registrypriv; */ - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } psetphypara = (struct setphy_parm*)rtw_zmalloc(sizeof(struct setphy_parm)); - if (psetphypara==NULL){ + if (psetphypara ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetphypara, _SetPhy_CMD_); - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("CH=%d, modem=%d", ch, modem)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("CH =%d, modem =%d", ch, modem)); psetphypara->modem = modem; psetphypara->rfchannel = ch; @@ -743,19 +743,19 @@ u8 rtw_setbbreg_cmd(struct adapter*padapter, u8 offset, u8 val) { struct cmd_obj* ph2c; struct writeBB_parm* pwritebbparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pwritebbparm = (struct writeBB_parm*)rtw_zmalloc(sizeof(struct writeBB_parm)); - if (pwritebbparm==NULL){ + if (pwritebbparm ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -774,13 +774,13 @@ u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval) { struct cmd_obj* ph2c; struct readBB_parm* prdbbparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res=_FAIL; + if (ph2c ==NULL){ + res =_FAIL; goto exit; } prdbbparm = (struct readBB_parm*)rtw_zmalloc(sizeof(struct readBB_parm)); @@ -809,19 +809,19 @@ u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val) { struct cmd_obj* ph2c; struct writeRF_parm* pwriterfparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pwriterfparm = (struct writeRF_parm*)rtw_zmalloc(sizeof(struct writeRF_parm)); - if (pwriterfparm==NULL){ + if (pwriterfparm ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -840,21 +840,21 @@ u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval) { struct cmd_obj* ph2c; struct readRF_parm* prdrfparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } prdrfparm = (struct readRF_parm*)rtw_zmalloc(sizeof(struct readRF_parm)); if (prdrfparm ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -900,24 +900,24 @@ void rtw_readtssi_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *pcm u8 rtw_createbss_cmd(struct adapter *padapter) { struct cmd_obj* pcmd; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_bssid_ex *pdev_network = &padapter->registrypriv.dev_network; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; rtw_led_control(padapter, LED_CTL_START_TO_LINK); if (pmlmepriv->assoc_ssid.SsidLength == 0){ - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,(" createbss for Any SSid:%s\n",pmlmepriv->assoc_ssid.Ssid)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); } else { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,(" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); } pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd==NULL){ - res= _FAIL; + if (pcmd ==NULL){ + res = _FAIL; goto exit; } @@ -942,14 +942,14 @@ exit: u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss, unsigned int sz) { struct cmd_obj* pcmd; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd==NULL){ - res= _FAIL; + if (pcmd ==NULL){ + res = _FAIL; goto exit; } @@ -975,10 +975,10 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) uint t_len = 0; struct wlan_bssid_ex *psecnetwork; struct cmd_obj *pcmd; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv= &pmlmepriv->qospriv; - struct security_priv *psecuritypriv=&padapter->securitypriv; + struct qos_priv *pqospriv = &pmlmepriv->qospriv; + struct security_priv *psecuritypriv =&padapter->securitypriv; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->network.InfrastructureMode; @@ -992,12 +992,12 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) if (pmlmepriv->assoc_ssid.SsidLength == 0){ RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+Join cmd: Any SSid\n")); } else { - RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid=[%s]\n", pmlmepriv->assoc_ssid.Ssid)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid)); } pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd==NULL){ - res=_FAIL; + if (pcmd ==NULL){ + res =_FAIL; RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n")); goto exit; } @@ -1026,15 +1026,15 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) } } - psecnetwork=(struct wlan_bssid_ex *)&psecuritypriv->sec_bss; - if (psecnetwork==NULL) + psecnetwork =(struct wlan_bssid_ex *)&psecuritypriv->sec_bss; + if (psecnetwork ==NULL) { if (pcmd !=NULL) rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj)); - res=_FAIL; + res =_FAIL; - RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd :psecnetwork==NULL!!!\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd :psecnetwork ==NULL!!!\n")); goto exit; } @@ -1043,7 +1043,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network)); - auth=&psecuritypriv->authenticator_ie[0]; + auth =&psecuritypriv->authenticator_ie[0]; psecuritypriv->authenticator_ie[0]=(unsigned char)psecnetwork->IELength; if ((psecnetwork->IELength-12) < (256-1)) { @@ -1107,7 +1107,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork) else adapter_to_pwrctl(padapter)->smart_ps = padapter->registrypriv.smart_ps; - DBG_871X("%s: smart_ps=%d\n", __func__, adapter_to_pwrctl(padapter)->smart_ps); + DBG_871X("%s: smart_ps =%d\n", __func__, adapter_to_pwrctl(padapter)->smart_ps); pcmd->cmdsz = get_wlan_bssid_ex_sz(psecnetwork);/* get cmdsz before endian conversion */ @@ -1174,23 +1174,23 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum NDIS_802_11_NETWORK_INFRAST struct cmd_obj* ph2c; struct setopmode_parm* psetop; - struct cmd_priv *pcmdpriv= &padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv = &padapter->cmdpriv; + u8 res =_SUCCESS; ; psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm)); - if (psetop==NULL){ - res=_FAIL; + if (psetop ==NULL){ + res =_FAIL; goto exit; } psetop->mode = (u8)networktype; if (enqueue){ ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ + if (ph2c ==NULL){ rtw_mfree((u8 *)psetop, sizeof(*psetop)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1212,23 +1212,23 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en { struct cmd_obj* ph2c; struct set_stakey_parm *psetstakey_para; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; struct set_stakey_rsp *psetstakey_rsp = NULL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct sta_info* sta = (struct sta_info* )psta; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm)); - if (psetstakey_para==NULL){ - res=_FAIL; + if (psetstakey_para ==NULL){ + res =_FAIL; goto exit; } - memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN); + memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN); if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)){ psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm; @@ -1244,14 +1244,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en } /* jeff: set this becasue at least sw key is ready */ - padapter->securitypriv.busetkipkey=true; + padapter->securitypriv.busetkipkey =true; if (enqueue) { ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if ( ph2c == NULL){ rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1259,7 +1259,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en if (psetstakey_rsp == NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm)); - res=_FAIL; + res =_FAIL; goto exit; } @@ -1283,12 +1283,12 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) { struct cmd_obj* ph2c; struct set_stakey_parm *psetstakey_para; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; struct set_stakey_rsp *psetstakey_rsp = NULL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct sta_info* sta = (struct sta_info* )psta; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; @@ -1300,14 +1300,14 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) { ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if ( ph2c == NULL){ - res= _FAIL; + res = _FAIL; goto exit; } psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm)); - if (psetstakey_para==NULL){ + if (psetstakey_para ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res=_FAIL; + res =_FAIL; goto exit; } @@ -1315,7 +1315,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) if (psetstakey_rsp == NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm)); - res=_FAIL; + res =_FAIL; goto exit; } @@ -1344,26 +1344,26 @@ u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_tab { struct cmd_obj* ph2c; struct setratable_parm * psetrttblparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } psetrttblparm = (struct setratable_parm*)rtw_zmalloc(sizeof(struct setratable_parm)); - if (psetrttblparm==NULL){ + if (psetrttblparm ==NULL){ rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable)); - memcpy(psetrttblparm,prate_table,sizeof(struct setratable_parm)); + memcpy(psetrttblparm, prate_table, sizeof(struct setratable_parm)); res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1376,20 +1376,20 @@ u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval) { struct cmd_obj* ph2c; struct getratable_parm * pgetrttblparm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pgetrttblparm = (struct getratable_parm*)rtw_zmalloc(sizeof(struct getratable_parm)); - if (pgetrttblparm==NULL){ + if (pgetrttblparm ==NULL){ rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1418,25 +1418,25 @@ u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) struct set_assocsta_parm *psetassocsta_para; struct set_stakey_rsp *psetassocsta_rsp = NULL; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } psetassocsta_para = (struct set_assocsta_parm*)rtw_zmalloc(sizeof(struct set_assocsta_parm)); - if (psetassocsta_para==NULL){ + if (psetassocsta_para ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); - res=_FAIL; + res =_FAIL; goto exit; } psetassocsta_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_assocsta_rsp)); - if (psetassocsta_rsp==NULL){ + if (psetassocsta_rsp ==NULL){ rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj)); rtw_mfree((u8 *) psetassocsta_para, sizeof(struct set_assocsta_parm)); return _FAIL; @@ -1446,7 +1446,7 @@ u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) ph2c->rsp = (u8 *) psetassocsta_rsp; ph2c->rspsz = sizeof(struct set_assocsta_rsp); - memcpy(psetassocsta_para->addr, mac_addr,ETH_ALEN); + memcpy(psetassocsta_para->addr, mac_addr, ETH_ALEN); res = rtw_enqueue_cmd(pcmdpriv, ph2c); @@ -1463,20 +1463,20 @@ u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr) struct cmd_obj* ph2c; struct addBaReq_parm *paddbareq_parm; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } paddbareq_parm = (struct addBaReq_parm*)rtw_zmalloc(sizeof(struct addBaReq_parm)); - if (paddbareq_parm==NULL){ + if (paddbareq_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1485,7 +1485,7 @@ u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr) init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq)); - /* DBG_871X("rtw_addbareq_cmd, tid=%d\n", tid); */ + /* DBG_871X("rtw_addbareq_cmd, tid =%d\n", tid); */ /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); @@ -1501,21 +1501,21 @@ u8 rtw_reset_securitypriv_cmd(struct adapter*padapter) { struct cmd_obj* ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1541,21 +1541,21 @@ u8 rtw_free_assoc_resources_cmd(struct adapter*padapter) { struct cmd_obj* ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1581,19 +1581,19 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter*padapter) { struct cmd_obj* ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; - u8 res=_SUCCESS; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; + u8 res =_SUCCESS; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -1621,7 +1621,7 @@ u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueu struct set_ch_parm *set_ch_parm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; @@ -1633,7 +1633,7 @@ u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueu /* prepare cmd parameter */ set_ch_parm = (struct set_ch_parm *)rtw_zmalloc(sizeof(*set_ch_parm)); if (set_ch_parm == NULL) { - res= _FAIL; + res = _FAIL; goto exit; } set_ch_parm->ch = ch; @@ -1645,7 +1645,7 @@ u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueu pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL){ rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm)); - res=_FAIL; + res =_FAIL; goto exit; } @@ -1676,7 +1676,7 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) struct SetChannelPlan_param *setChannelPlan_param; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; @@ -1691,10 +1691,10 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) /* prepare cmd parameter */ setChannelPlan_param = (struct SetChannelPlan_param *)rtw_zmalloc(sizeof(struct SetChannelPlan_param)); if (setChannelPlan_param == NULL) { - res= _FAIL; + res = _FAIL; goto exit; } - setChannelPlan_param->channel_plan=chplan; + setChannelPlan_param->channel_plan =chplan; if (enqueue) { @@ -1702,7 +1702,7 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue) pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL){ rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param)); - res=_FAIL; + res =_FAIL; goto exit; } @@ -1735,7 +1735,7 @@ u8 rtw_led_blink_cmd(struct adapter*padapter, PLED_871x pLed) struct LedBlink_param *ledBlink_param; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; @@ -1743,18 +1743,18 @@ u8 rtw_led_blink_cmd(struct adapter*padapter, PLED_871x pLed) pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL){ - res=_FAIL; + res =_FAIL; goto exit; } ledBlink_param = (struct LedBlink_param *)rtw_zmalloc(sizeof(struct LedBlink_param)); if (ledBlink_param == NULL) { rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } - ledBlink_param->pLed=pLed; + ledBlink_param->pLed =pLed; init_h2fwcmd_w_parm_no_rsp(pcmdobj, ledBlink_param, GEN_CMD_CODE(_LedBlink)); res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); @@ -1773,7 +1773,7 @@ u8 rtw_set_csa_cmd(struct adapter*padapter, u8 new_ch_no) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res=_SUCCESS; + u8 res =_SUCCESS; ; @@ -1781,18 +1781,18 @@ u8 rtw_set_csa_cmd(struct adapter*padapter, u8 new_ch_no) pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL){ - res=_FAIL; + res =_FAIL; goto exit; } setChannelSwitch_param = (struct SetChannelSwitch_param *)rtw_zmalloc(sizeof(struct SetChannelSwitch_param)); if (setChannelSwitch_param == NULL) { rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } - setChannelSwitch_param->new_ch_no=new_ch_no; + setChannelSwitch_param->new_ch_no =new_ch_no; init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelSwitch_param, GEN_CMD_CODE(_SetChannelSwitch)); res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); @@ -1811,7 +1811,7 @@ u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res=_SUCCESS; + u8 res =_SUCCESS; exit: return res; @@ -1863,7 +1863,7 @@ static void traffic_status_watchdog(struct adapter *padapter) if (link_detect->NumTxOkInPeriod > TX_ACTIVE_TH || link_detect->NumRxUnicastOkInPeriod > RX_ACTIVE_TH) { - DBG_871X_LEVEL(_drv_info_, FUNC_ADPT_FMT" acqiure wake_lock for %u ms(tx:%d,rx_unicast:%d)\n", + DBG_871X_LEVEL(_drv_info_, FUNC_ADPT_FMT" acqiure wake_lock for %u ms(tx:%d, rx_unicast:%d)\n", FUNC_ADPT_ARG(padapter), TRAFFIC_PROTECT_PERIOD_MS, link_detect->NumTxOkInPeriod, @@ -1881,12 +1881,12 @@ static void traffic_status_watchdog(struct adapter *padapter) if ( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) || (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) ) { - /* DBG_871X("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */ - bEnterPS= false; + /* DBG_871X("Tx = %d, Rx = %d\n", pmlmepriv->LinkDetectInfo.NumTxOkInPeriod, pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */ + bEnterPS = false; } else { - bEnterPS= true; + bEnterPS = true; } /* LeisurePS only work in infra mode. */ @@ -2039,15 +2039,15 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue) if (enqueue) { ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2072,7 +2072,7 @@ exit: } -#if (RATE_ADAPTIVE_SUPPORT==1) +#if (RATE_ADAPTIVE_SUPPORT ==1) static void rpt_timer_setting_wk_hdl(struct adapter *padapter, u16 minRptTime) { rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime)); @@ -2088,15 +2088,15 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime) ; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2120,7 +2120,7 @@ static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna) rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_SELECT, (u8 *)(&antenna)); } -u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue) +u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna, u8 enqueue) { struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; @@ -2135,15 +2135,15 @@ u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue) if (true == enqueue) { ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2155,7 +2155,7 @@ u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue) res = rtw_enqueue_cmd(pcmdpriv, ph2c); } else{ - antenna_select_wk_hdl(padapter,antenna ); + antenna_select_wk_hdl(padapter, antenna ); } exit: @@ -2186,7 +2186,7 @@ u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType ) { struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; @@ -2198,15 +2198,15 @@ u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType ) } ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2236,15 +2236,15 @@ u8 rtw_ps_cmd(struct adapter*padapter) u8 res = _SUCCESS; ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ppscmd==NULL){ - res= _FAIL; + if (ppscmd ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ppscmd, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2266,7 +2266,7 @@ exit: static void rtw_chk_hi_queue_hdl(struct adapter *padapter) { - int cnt=0; + int cnt =0; struct sta_info *psta_bmc; struct sta_priv *pstapriv = &padapter->stapriv; @@ -2274,7 +2274,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter) if (!psta_bmc) return; - if (psta_bmc->sleepq_len==0) + if (psta_bmc->sleepq_len ==0) { u8 val = 0; @@ -2319,15 +2319,15 @@ u8 rtw_chk_hi_queue_cmd(struct adapter*padapter) u8 res = _SUCCESS; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -2468,7 +2468,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) case LPS_CTRL_WK_CID: lps_ctrl_wk_hdl(padapter, (u8)pdrvextra_cmd->type_size); break; -#if (RATE_ADAPTIVE_SUPPORT==1) +#if (RATE_ADAPTIVE_SUPPORT ==1) case RTP_TIMER_CFG_WK_CID: rpt_timer_setting_wk_hdl(padapter, pdrvextra_cmd->type_size); break; @@ -2527,7 +2527,7 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd) } else if (pcmd->res != H2C_SUCCESS) { _set_timer(&pmlmepriv->scan_to_timer, 1); - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n.")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n.")); } /* free cmd */ @@ -2548,7 +2548,7 @@ void rtw_disassoc_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd) set_fwstate(pmlmepriv, _FW_LINKED); spin_unlock_bh(&pmlmepriv->lock); - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ***Error: disconnect_cmd_callback Fail ***\n.")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n.")); goto exit; } @@ -2578,7 +2578,7 @@ void rtw_joinbss_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd) } else if (pcmd->res != H2C_SUCCESS) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n")); _set_timer(&pmlmepriv->assoc_timer, 1); } rtw_free_cmd_obj(pcmd); @@ -2598,7 +2598,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) if ((pcmd->res != H2C_SUCCESS)) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n.")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n.")); _set_timer(&pmlmepriv->assoc_timer, 1 ); } @@ -2614,10 +2614,10 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->Configuration.ATIMWindow); /* pnetwork->Configuration.BeaconPeriod = le32_to_cpu(pnetwork->Configuration.BeaconPeriod); */ pnetwork->Configuration.DSConfig =le32_to_cpu(pnetwork->Configuration.DSConfig); - pnetwork->Configuration.FHConfig.DwellTime=le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime); - pnetwork->Configuration.FHConfig.HopPattern=le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern); - pnetwork->Configuration.FHConfig.HopSet=le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet); - pnetwork->Configuration.FHConfig.Length=le32_to_cpu(pnetwork->Configuration.FHConfig.Length); + pnetwork->Configuration.FHConfig.DwellTime =le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime); + pnetwork->Configuration.FHConfig.HopPattern =le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern); + pnetwork->Configuration.FHConfig.HopSet =le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet); + pnetwork->Configuration.FHConfig.Length =le32_to_cpu(pnetwork->Configuration.FHConfig.Length); pnetwork->Configuration.Length = le32_to_cpu(pnetwork->Configuration.Length); pnetwork->InfrastructureMode = le32_to_cpu(pnetwork->InfrastructureMode); pnetwork->IELength = le32_to_cpu(pnetwork->IELength); @@ -2634,7 +2634,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress); if (psta == NULL) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nCan't alloc sta_info when createbss_cmd_callback\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nCan't alloc sta_info when createbss_cmd_callback\n")); goto createbss_cmd_fail ; } } @@ -2652,7 +2652,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue); if ( pwlan == NULL) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n Error: can't get pwlan in rtw_joinbss_event_callback\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error: can't get pwlan in rtw_joinbss_event_callback\n")); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); goto createbss_cmd_fail; } @@ -2698,9 +2698,9 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter* padapter , struct cmd_obj *p ; - if (psta==NULL) + if (psta ==NULL) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n")); goto exit; } @@ -2719,9 +2719,9 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter* padapter, struct cmd_obj * ; - if (psta==NULL) + if (psta ==NULL) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n")); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n")); goto exit; } diff --git a/core/rtw_debug.c b/core/rtw_debug.c index ae5c15a..99442c4 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -97,7 +97,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer, rtw_write32(padapter, addr, val); break; default: - DBG_871X("error write length=%d", len); + DBG_871X("error write length =%d", len); break; } @@ -107,8 +107,8 @@ int proc_set_write_reg(struct file *file, const char __user *buffer, } -static u32 proc_get_read_addr=0xeeeeeeee; -static u32 proc_get_read_len=0x4; +static u32 proc_get_read_addr =0xeeeeeeee; +static u32 proc_get_read_len =0x4; int proc_get_read_reg(char *page, char **start, off_t offset, int count, @@ -119,7 +119,7 @@ int proc_get_read_reg(char *page, char **start, int len = 0; - if (proc_get_read_addr==0xeeeeeeee) + if (proc_get_read_addr ==0xeeeeeeee) { *eof = 1; return len; @@ -128,16 +128,16 @@ int proc_get_read_reg(char *page, char **start, switch (proc_get_read_len) { case 1: - len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr)); + len += snprintf(page + len, count - len, "rtw_read8(0x%x) =0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr)); break; case 2: - len += snprintf(page + len, count - len, "rtw_read16(0x%x)=0x%x\n", proc_get_read_addr, rtw_read16(padapter, proc_get_read_addr)); + len += snprintf(page + len, count - len, "rtw_read16(0x%x) =0x%x\n", proc_get_read_addr, rtw_read16(padapter, proc_get_read_addr)); break; case 4: - len += snprintf(page + len, count - len, "rtw_read32(0x%x)=0x%x\n", proc_get_read_addr, rtw_read32(padapter, proc_get_read_addr)); + len += snprintf(page + len, count - len, "rtw_read32(0x%x) =0x%x\n", proc_get_read_addr, rtw_read32(padapter, proc_get_read_addr)); break; default: - len += snprintf(page + len, count - len, "error read length=%d\n", proc_get_read_len); + len += snprintf(page + len, count - len, "error read length =%d\n", proc_get_read_len); break; } @@ -186,7 +186,7 @@ int proc_get_fwstate(char *page, char **start, int len = 0; - len += snprintf(page + len, count - len, "fwstate=0x%x\n", get_fwstate(pmlmepriv)); + len += snprintf(page + len, count - len, "fwstate =0x%x\n", get_fwstate(pmlmepriv)); *eof = 1; return len; @@ -202,7 +202,7 @@ int proc_get_sec_info(char *page, char **start, int len = 0; - len += snprintf(page + len, count - len, "auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n", + len += snprintf(page + len, count - len, "auth_alg =0x%x, enc_alg =0x%x, auth_type =0x%x, enc_type =0x%x\n", psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm, psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus); @@ -221,7 +221,7 @@ int proc_get_mlmext_state(char *page, char **start, int len = 0; - len += snprintf(page + len, count - len, "pmlmeinfo->state=0x%x\n", pmlmeinfo->state); + len += snprintf(page + len, count - len, "pmlmeinfo->state =0x%x\n", pmlmeinfo->state); *eof = 1; return len; @@ -237,7 +237,7 @@ int proc_get_qos_option(char *page, char **start, int len = 0; - len += snprintf(page + len, count - len, "qos_option=%d\n", pmlmepriv->qospriv.qos_option); + len += snprintf(page + len, count - len, "qos_option =%d\n", pmlmepriv->qospriv.qos_option); *eof = 1; return len; @@ -253,7 +253,7 @@ int proc_get_ht_option(char *page, char **start, struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); int len = 0; - len += snprintf(page + len, count - len, "ht_option=%d\n", pmlmepriv->htpriv.ht_option); + len += snprintf(page + len, count - len, "ht_option =%d\n", pmlmepriv->htpriv.ht_option); *eof = 1; return len; } @@ -267,7 +267,7 @@ int proc_get_rf_info(char *page, char **start, struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int len = 0; - len += snprintf(page + len, count - len, "cur_ch=%d, cur_bw=%d, cur_ch_offet=%d\n", + len += snprintf(page + len, count - len, "cur_ch =%d, cur_bw =%d, cur_ch_offet =%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); @@ -295,22 +295,22 @@ int proc_get_ap_info(char *page, char **start, int i; struct recv_reorder_ctrl *preorder_ctrl; - len += snprintf(page + len, count - len, "SSID=%s\n", cur_network->network.Ssid.Ssid); + len += snprintf(page + len, count - len, "SSID =%s\n", cur_network->network.Ssid.Ssid); len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr)); - len += snprintf(page + len, count - len, "cur_channel=%d, cur_bwmode=%d, cur_ch_offset=%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); - len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self); - len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); - len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); - len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); + len += snprintf(page + len, count - len, "cur_channel =%d, cur_bwmode =%d, cur_ch_offset =%d\n", pmlmeext->cur_channel, pmlmeext->cur_bwmode, pmlmeext->cur_ch_offset); + len += snprintf(page + len, count - len, "rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self); + len += snprintf(page + len, count - len, "state =0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); + len += snprintf(page + len, count - len, "qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); + len += snprintf(page + len, count - len, "bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); - len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); + len += snprintf(page + len, count - len, "agg_enable_bitmap =%x, candidate_tid_bitmap =%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); - for (i=0;i<16;i++) + for (i =0;i<16;i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; if (preorder_ctrl->enable) { - len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq); + len += snprintf(page + len, count - len, "tid =%d, indicate_seq =%d\n", i, preorder_ctrl->indicate_seq); } } @@ -333,7 +333,7 @@ int proc_get_adapter_state(char *page, char **start, struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - len += snprintf(page + len, count - len, "bSurpriseRemoved=%d, bDriverStopped=%d\n", + len += snprintf(page + len, count - len, "bSurpriseRemoved =%d, bDriverStopped =%d\n", padapter->bSurpriseRemoved, padapter->bDriverStopped); *eof = 1; @@ -353,9 +353,9 @@ int proc_get_trx_info(char *page, char **start, struct hw_xmit *phwxmit; int len = 0; - len += snprintf(page + len, count - len, "free_xmitbuf_cnt=%d, free_xmitframe_cnt=%d" - ", free_ext_xmitbuf_cnt=%d, free_xframe_ext_cnt=%d" - ", free_recvframe_cnt=%d\n", + len += snprintf(page + len, count - len, "free_xmitbuf_cnt =%d, free_xmitframe_cnt =%d" + ", free_ext_xmitbuf_cnt =%d, free_xframe_ext_cnt =%d" + ", free_recvframe_cnt =%d\n", pxmitpriv->free_xmitbuf_cnt, pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt, precvpriv->free_recvframe_cnt); @@ -363,10 +363,10 @@ int proc_get_trx_info(char *page, char **start, for (i = 0; i < 4; i++) { phwxmit = pxmitpriv->hwxmits + i; - len += snprintf(page + len, count - len, "%d, hwq.accnt=%d\n", i, phwxmit->accnt); + len += snprintf(page + len, count - len, "%d, hwq.accnt =%d\n", i, phwxmit->accnt); } - len += snprintf(page + len, count - len, "rx_urb_pending_cn=%d\n", precvpriv->rx_pending_cnt); + len += snprintf(page + len, count - len, "rx_urb_pending_cn =%d\n", precvpriv->rx_pending_cnt); *eof = 1; return len; @@ -379,14 +379,14 @@ int proc_get_mac_reg_dump1(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n"); - for (i=0x0;i<0x300;i+=4) + for (i =0x0;i<0x300;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } @@ -402,14 +402,14 @@ int proc_get_mac_reg_dump2(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n"); memset(page, 0, count); - for (i=0x300;i<0x600;i+=4) + for (i =0x300;i<0x600;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } @@ -425,14 +425,14 @@ int proc_get_mac_reg_dump3(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= MAC REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= MAC REG =======\n"); - for (i=0x600;i<0x800;i+=4) + for (i =0x600;i<0x800;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } @@ -448,13 +448,13 @@ int proc_get_bb_reg_dump1(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); - for (i=0x800;i<0xB00;i+=4) + len += snprintf(page + len, count - len, "\n ======= BB REG =======\n"); + for (i =0x800;i<0xB00;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } *eof = 1; @@ -468,13 +468,13 @@ int proc_get_bb_reg_dump2(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); - for (i=0xB00;i<0xE00;i+=4) + len += snprintf(page + len, count - len, "\n ======= BB REG =======\n"); + for (i =0xB00;i<0xE00;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } *eof = 1; @@ -488,13 +488,13 @@ int proc_get_bb_reg_dump3(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1; + int i, j =1; - len += snprintf(page + len, count - len, "\n======= BB REG =======\n"); - for (i=0xE00;i<0x1000;i+=4) + len += snprintf(page + len, count - len, "\n ======= BB REG =======\n"); + for (i =0xE00;i<0x1000;i+=4) { - if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i); - len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i)); + if (j%4 ==1) len += snprintf(page + len, count - len,"0x%02x", i); + len += snprintf(page + len, count - len," 0x%08x ", rtw_read32(padapter, i)); if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n"); } *eof = 1; @@ -508,19 +508,19 @@ int proc_get_rf_reg_dump1(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1,path; + int i, j =1, path; u32 value; - len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= RF REG =======\n"); path = 1; - len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); - for (i=0;i<0xC0;i++) + len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path); + for (i =0;i<0xC0;i++) { - /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); */ + /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */ value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); - if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); - len += snprintf(page + len, count - len, " 0x%08x ",value); - if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); + if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i); + len += snprintf(page + len, count - len, " 0x%08x ", value); + if ((j++)%4 ==0) len += snprintf(page + len, count - len, "\n"); } *eof = 1; @@ -535,19 +535,19 @@ int proc_get_rf_reg_dump2(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1,path; + int i, j =1, path; u32 value; - len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= RF REG =======\n"); path = 1; - len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); - for (i=0xC0;i<0x100;i++) + len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path); + for (i =0xC0;i<0x100;i++) { - /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); */ + /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */ value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); - if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); - len += snprintf(page + len, count - len, " 0x%08x ",value); - if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); + if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i); + len += snprintf(page + len, count - len, " 0x%08x ", value); + if ((j++)%4 ==0) len += snprintf(page + len, count - len, "\n"); } *eof = 1; return len; @@ -561,19 +561,19 @@ int proc_get_rf_reg_dump3(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1,path; + int i, j =1, path; u32 value; - len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= RF REG =======\n"); path = 2; - len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); - for (i=0;i<0xC0;i++) + len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path); + for (i =0;i<0xC0;i++) { - /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); */ + /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */ value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); - if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); - len += snprintf(page + len, count - len, " 0x%08x ",value); - if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); + if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i); + len += snprintf(page + len, count - len, " 0x%08x ", value); + if ((j++)%4 ==0) len += snprintf(page + len, count - len, "\n"); } *eof = 1; @@ -588,19 +588,19 @@ int proc_get_rf_reg_dump4(char *page, char **start, struct net_device *dev = data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); int len = 0; - int i,j=1,path; + int i, j =1, path; u32 value; - len += snprintf(page + len, count - len, "\n======= RF REG =======\n"); + len += snprintf(page + len, count - len, "\n ======= RF REG =======\n"); path = 2; - len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path); - for (i=0xC0;i<0x100;i++) + len += snprintf(page + len, count - len, "\nRF_Path(%x)\n", path); + for (i =0xC0;i<0x100;i++) { - /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord); */ + /* value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path, i, bMaskDWord); */ value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff); - if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i); - len += snprintf(page + len, count - len, " 0x%08x ",value); - if ((j++)%4==0) len += snprintf(page + len, count - len, "\n"); + if (j%4 ==1) len += snprintf(page + len, count - len, "0x%02x ", i); + len += snprintf(page + len, count - len, " 0x%08x ", value); + if ((j++)%4 ==0) len += snprintf(page + len, count - len, "\n"); } *eof = 1; return len; @@ -650,7 +650,7 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer, int num = sscanf(tmp, "%u %u", &is_signal_dbg, &signal_strength); - is_signal_dbg = is_signal_dbg==0?0:1; + is_signal_dbg = is_signal_dbg ==0?0:1; if (is_signal_dbg && num!=2) return count; @@ -658,7 +658,7 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer, signal_strength = signal_strength>100?100:signal_strength; padapter->recvpriv.is_signal_dbg = is_signal_dbg; - padapter->recvpriv.signal_strength_dbg=signal_strength; + padapter->recvpriv.signal_strength_dbg =signal_strength; if (is_signal_dbg) DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength); @@ -709,8 +709,8 @@ int proc_set_ht_enable(struct file *file, const char __user *buffer, if ( pregpriv && mode >= 0 && mode < 2 ) { - pregpriv->ht_enable= mode; - printk("ht_enable=%d\n", pregpriv->ht_enable); + pregpriv->ht_enable = mode; + printk("ht_enable =%d\n", pregpriv->ht_enable); } } @@ -757,8 +757,8 @@ int proc_set_cbw40_enable(struct file *file, const char __user *buffer, if ( pregpriv && mode >= 0 && mode < 2 ) { - pregpriv->cbw40_enable= mode; - printk("cbw40_enable=%d\n", mode); + pregpriv->cbw40_enable = mode; + printk("cbw40_enable =%d\n", mode); } } @@ -805,8 +805,8 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer, if ( pregpriv && mode >= 0 && mode < 3 ) { - pregpriv->ampdu_enable= mode; - printk("ampdu_enable=%d\n", mode); + pregpriv->ampdu_enable = mode; + printk("ampdu_enable =%d\n", mode); } } @@ -873,8 +873,8 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer, if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3)) { - pregpriv->rx_stbc= mode; - printk("rx_stbc=%d\n", mode); + pregpriv->rx_stbc = mode; + printk("rx_stbc =%d\n", mode); } } @@ -896,7 +896,7 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer, struct net_device *dev = (struct net_device *)data; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); char tmp[32]; - u32 enable=0; + u32 enable =0; if (count < 1) { @@ -947,11 +947,11 @@ int proc_get_all_sta_info(char *page, char **start, int len = 0; - len += snprintf(page + len, count - len, "sta_dz_bitmap=0x%x, tim_bitmap=0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); + len += snprintf(page + len, count - len, "sta_dz_bitmap =0x%x, tim_bitmap =0x%x\n", pstapriv->sta_dz_bitmap, pstapriv->tim_bitmap); spin_lock_bh(&pstapriv->sta_hash_lock); - for (i=0; i< NUM_STA; i++) + for (i =0; i< NUM_STA; i++) { phead = &(pstapriv->sta_hash[i]); plist = get_next(phead); @@ -965,27 +965,27 @@ int proc_get_all_sta_info(char *page, char **start, /* if (extra_arg == psta->aid) */ { len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr)); - len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self); - len += snprintf(page + len, count - len, "state=0x%x, aid=%d, macid=%d, raid=%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); - len += snprintf(page + len, count - len, "qos_en=%d, ht_en=%d, init_rate=%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); - len += snprintf(page + len, count - len, "bwmode=%d, ch_offset=%d, sgi=%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); + len += snprintf(page + len, count - len, "rtsen =%d, cts2slef =%d\n", psta->rtsen, psta->cts2self); + len += snprintf(page + len, count - len, "state =0x%x, aid =%d, macid =%d, raid =%d\n", psta->state, psta->aid, psta->mac_id, psta->raid); + len += snprintf(page + len, count - len, "qos_en =%d, ht_en =%d, init_rate =%d\n", psta->qos_option, psta->htpriv.ht_option, psta->init_rate); + len += snprintf(page + len, count - len, "bwmode =%d, ch_offset =%d, sgi =%d\n", psta->htpriv.bwmode, psta->htpriv.ch_offset, psta->htpriv.sgi); len += snprintf(page + len, count - len, "ampdu_enable = %d\n", psta->htpriv.ampdu_enable); - len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); - len += snprintf(page + len, count - len, "sleepq_len=%d\n", psta->sleepq_len); - len += snprintf(page + len, count - len, "capability=0x%x\n", psta->capability); - len += snprintf(page + len, count - len, "flags=0x%x\n", psta->flags); - len += snprintf(page + len, count - len, "wpa_psk=0x%x\n", psta->wpa_psk); - len += snprintf(page + len, count - len, "wpa2_group_cipher=0x%x\n", psta->wpa2_group_cipher); - len += snprintf(page + len, count - len, "wpa2_pairwise_cipher=0x%x\n", psta->wpa2_pairwise_cipher); - len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info); - len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy); + len += snprintf(page + len, count - len, "agg_enable_bitmap =%x, candidate_tid_bitmap =%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap); + len += snprintf(page + len, count - len, "sleepq_len =%d\n", psta->sleepq_len); + len += snprintf(page + len, count - len, "capability =0x%x\n", psta->capability); + len += snprintf(page + len, count - len, "flags =0x%x\n", psta->flags); + len += snprintf(page + len, count - len, "wpa_psk =0x%x\n", psta->wpa_psk); + len += snprintf(page + len, count - len, "wpa2_group_cipher =0x%x\n", psta->wpa2_group_cipher); + len += snprintf(page + len, count - len, "wpa2_pairwise_cipher =0x%x\n", psta->wpa2_pairwise_cipher); + len += snprintf(page + len, count - len, "qos_info =0x%x\n", psta->qos_info); + len += snprintf(page + len, count - len, "dot118021XPrivacy =0x%x\n", psta->dot118021XPrivacy); - for (j=0;j<16;j++) + for (j =0;j<16;j++) { preorder_ctrl = &psta->recvreorder_ctrl[j]; if (preorder_ctrl->enable) { - len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq); + len += snprintf(page + len, count - len, "tid =%d, indicate_seq =%d\n", j, preorder_ctrl->indicate_seq); } } @@ -1015,14 +1015,14 @@ int proc_get_best_channel(char *page, char **start, int len = 0; u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0; - for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { + for (i =0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { if ( pmlmeext->channel_set[i].ChannelNum == 1) index_24G = i; if ( pmlmeext->channel_set[i].ChannelNum == 36) index_5G = i; } - for (i=0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { + for (i =0; pmlmeext->channel_set[i].ChannelNum !=0; i++) { /* 2.4G */ if ( pmlmeext->channel_set[i].ChannelNum == 6 ) { if ( pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_24G].rx_count ) { @@ -1131,8 +1131,8 @@ int proc_set_btcoex_dbg(struct file *file, const char __user *buffer, if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3)) { - BTCoexDbgLevel= mode; - printk("btcoex_dbg=%d\n", BTCoexDbgLevel); + BTCoexDbgLevel = mode; + printk("btcoex_dbg =%d\n", BTCoexDbgLevel); } } diff --git a/core/rtw_efuse.c b/core/rtw_efuse.c index 61aee28..af9274e 100644 --- a/core/rtw_efuse.c +++ b/core/rtw_efuse.c @@ -28,18 +28,18 @@ /*------------------------Define local variable------------------------------*/ -u8 fakeEfuseBank=0; -u32 fakeEfuseUsedBytes=0; +u8 fakeEfuseBank =0; +u32 fakeEfuseUsedBytes =0; u8 fakeEfuseContent[EFUSE_MAX_HW_SIZE]={0}; u8 fakeEfuseInitMap[EFUSE_MAX_MAP_LEN]={0}; u8 fakeEfuseModifiedMap[EFUSE_MAX_MAP_LEN]={0}; -u32 BTEfuseUsedBytes=0; +u32 BTEfuseUsedBytes =0; u8 BTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE]; u8 BTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0}; u8 BTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0}; -u32 fakeBTEfuseUsedBytes=0; +u32 fakeBTEfuseUsedBytes =0; u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE]; u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0}; u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0}; @@ -146,7 +146,7 @@ Efuse_GetCurrentSize( u8 efuseType, bool bPseudoTest) { - u16 ret=0; + u16 ret =0; ret = pAdapter->HalFunc.EfuseGetCurrentSize(pAdapter, efuseType, bPseudoTest); @@ -186,7 +186,7 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - /* u32 start=rtw_get_current_time(); */ + /* u32 start =rtw_get_current_time(); */ if (bPseudoTest) { @@ -221,7 +221,7 @@ ReadEFuseByte( value32 = rtw_read32(Adapter, EFUSE_CTRL); *pbuf = (u8)(value32 & 0xff); - /* DBG_871X("ReadEFuseByte _offset:%08u, in %d ms\n",_offset ,rtw_get_passing_time_ms(start)); */ + /* DBG_871X("ReadEFuseByte _offset:%08u, in %d ms\n", _offset , rtw_get_passing_time_ms(start)); */ } @@ -302,8 +302,8 @@ EFUSE_Read1Byte( u8 data; u8 Bytetemp = {0x00}; u8 temp = {0x00}; - u32 k=0; - u16 contentLen=0; + u32 k =0; + u16 contentLen =0; EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false); @@ -328,13 +328,13 @@ EFUSE_Read1Byte( { Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); k++; - if (k==1000) + if (k ==1000) { - k=0; + k =0; break; } } - data=rtw_read8(Adapter, EFUSE_CTRL); + data =rtw_read8(Adapter, EFUSE_CTRL); return data; } else @@ -372,10 +372,10 @@ EFUSE_Write1Byte( { u8 Bytetemp = {0x00}; u8 temp = {0x00}; - u32 k=0; - u16 contentLen=0; + u32 k =0; + u16 contentLen =0; - /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value)); */ + /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr =%x Data =%x\n", Address, Value)); */ EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false); if ( Address < contentLen) /* E-fuse 512Byte */ @@ -402,9 +402,9 @@ EFUSE_Write1Byte( { Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); k++; - if (k==100) + if (k ==100) { - k=0; + k =0; break; } } @@ -441,7 +441,7 @@ efuse_OneByteRead( } if (tmpidx<100) { - *data=rtw_read8(pAdapter, EFUSE_CTRL); + *data =rtw_read8(pAdapter, EFUSE_CTRL); bResult = true; } else @@ -468,7 +468,7 @@ efuse_OneByteWrite( bResult = Efuse_Write1ByteToFakeContent(pAdapter, addr, data); return bResult; } - /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data=%x\n", addr, data)); */ + /* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr = %x Data =%x\n", addr, data)); */ /* return 0; */ @@ -503,7 +503,7 @@ Efuse_PgPacketRead( struct adapter *pAdapter, u8 *data, bool bPseudoTest) { - int ret=0; + int ret =0; ret = pAdapter->HalFunc.Efuse_PgPacketRead(pAdapter, offset, data, bPseudoTest); @@ -591,7 +591,7 @@ Efuse_WordEnableDataWrite( struct adapter *pAdapter, u8 *data, bool bPseudoTest) { - u8 ret=0; + u8 ret =0; ret = pAdapter->HalFunc.Efuse_WordEnableDataWrite(pAdapter, efuse_addr, word_en, data, bPseudoTest); @@ -600,12 +600,12 @@ Efuse_WordEnableDataWrite( struct adapter *pAdapter, static u8 efuse_read8(struct adapter *padapter, u16 address, u8 *value) { - return efuse_OneByteRead(padapter,address, value, false); + return efuse_OneByteRead(padapter, address, value, false); } static u8 efuse_write8(struct adapter *padapter, u16 address, u8 *value) { - return efuse_OneByteWrite(padapter,address, *value, false); + return efuse_OneByteWrite(padapter, address, *value, false); } /* @@ -667,7 +667,7 @@ u8 efuse_GetCurrentSize(struct adapter *padapter, u16 *size) /* */ u8 rtw_efuse_map_read(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) { - u16 mapLen=0; + u16 mapLen =0; EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, false); @@ -685,7 +685,7 @@ u8 rtw_efuse_map_read(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) u8 rtw_BT_efuse_map_read(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) { - u16 mapLen=0; + u16 mapLen =0; EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, false); @@ -708,7 +708,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) u8 newdata[PGPKT_DATA_SIZE]; s32 i, j, idx; u8 ret = _SUCCESS; - u16 mapLen=0; + u16 mapLen =0; EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, false); @@ -769,12 +769,12 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) if (word_en != 0xF) { ret = Efuse_PgPacketWrite(padapter, offset, word_en, newdata, false); - DBG_871X("offset=%x\n",offset); - DBG_871X("word_en=%x\n",word_en); + DBG_871X("offset =%x\n", offset); + DBG_871X("word_en =%x\n", word_en); - for (i=0;iwireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N)) - && (pregistrypriv->ht_enable==true)) + && (pregistrypriv->ht_enable ==true)) { /* todo: */ } @@ -540,7 +540,7 @@ check_next_ie: unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit) { - return rtw_get_ie(pie, _WPA2_IE_ID_,rsn_ie_len, limit); + return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit); } @@ -579,7 +579,7 @@ int rtw_get_wpa2_cipher_suite(u8 *s) int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x) { - int i, ret=_SUCCESS; + int i, ret =_SUCCESS; int left, count; u8 *pos; u8 SUITE_1X[4] = {0x00, 0x50, 0xf2, 1}; @@ -613,7 +613,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis } else if (left > 0) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie length mismatch, %u too much", __FUNCTION__, left)); return _FAIL; } @@ -628,7 +628,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis left -= 2; if (count == 0 || left < count * WPA_SELECTOR_LEN) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), " + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie count botch (pairwise), " "count %u left %u", __FUNCTION__, count, left)); return _FAIL; } @@ -644,7 +644,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis } else if (left == 1) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie too short (for key mgmt)", __FUNCTION__)); return _FAIL; } @@ -652,7 +652,7 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis if (left >= 6) { pos += 2; if (_rtw_memcmp(pos, SUITE_1X, 4) == 1) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("%s : there has 802.1x auth\n", __FUNCTION__)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s : there has 802.1x auth\n", __FUNCTION__)); *is_8021x = 1; } } @@ -664,10 +664,10 @@ int rtw_parse_wpa_ie(u8* wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x) { - int i, ret=_SUCCESS; + int i, ret =_SUCCESS; int left, count; u8 *pos; - u8 SUITE_1X[4] = {0x00,0x0f, 0xac, 0x01}; + u8 SUITE_1X[4] = {0x00, 0x0f, 0xac, 0x01}; if (rsn_ie_len <= 0) { /* No RSN IE - fail silently */ @@ -693,7 +693,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi left -= RSN_SELECTOR_LEN; } else if (left > 0) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie length mismatch, %u too much", __FUNCTION__, left)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie length mismatch, %u too much", __FUNCTION__, left)); return _FAIL; } @@ -706,7 +706,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi left -= 2; if (count == 0 || left < count * RSN_SELECTOR_LEN) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie count botch (pairwise), " + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie count botch (pairwise), " "count %u left %u", __FUNCTION__, count, left)); return _FAIL; } @@ -722,7 +722,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi } else if (left == 1) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s: ie too short (for key mgmt)", __FUNCTION__)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie too short (for key mgmt)", __FUNCTION__)); return _FAIL; } @@ -731,7 +731,7 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi if (left >= 6) { pos += 2; if (_rtw_memcmp(pos, SUITE_1X, 4) == 1) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("%s (): there has 802.1x auth\n", __FUNCTION__)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s (): there has 802.1x auth\n", __FUNCTION__)); *is_8021x = 1; } } @@ -740,56 +740,56 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi return ret; } -int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16 *wpa_len) +int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len) { u8 authmode, sec_idx, i; - u8 wpa_oui[4]={0x0,0x50,0xf2,0x01}; + u8 wpa_oui[4]={0x0, 0x50, 0xf2, 0x01}; uint cnt; /* Search required WPA or WPA2 IE and copy to sec_ie[ ] */ cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_); - sec_idx=0; + sec_idx =0; while (cnt found WPS_IE.....\n"); */ *wps_ielen = ie_ptr[1]+2; - match=true; + match =true; } return match; } @@ -858,8 +858,8 @@ u8 *rtw_get_wps_ie_from_scan_queue(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) { uint cnt; - u8 *wpsie_ptr=NULL; - u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04}; + u8 *wpsie_ptr =NULL; + u8 eid, wps_oui[4]={0x0, 0x50, 0xf2, 0x04}; if (wps_ielen) *wps_ielen = 0; @@ -873,7 +873,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) { eid = in_ie[cnt]; - if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4)==true)) + if ((eid ==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4) ==true)) { wpsie_ptr = &in_ie[cnt]; @@ -907,11 +907,11 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) * * Returns: the address of the specific WPS attribute found, or NULL */ -u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_attr, u32 *len_attr) +u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_attr, u32 *len_attr) { u8 *attr_ptr = NULL; u8 * target_attr_ptr = NULL; - u8 wps_oui[4]={0x00,0x50,0xF2,0x04}; + u8 wps_oui[4]={0x00, 0x50, 0xF2, 0x04}; if (len_attr) *len_attr = 0; @@ -965,7 +965,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att * * Returns: the address of the specific WPS attribute content found, or NULL */ -u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_content, uint *len_content) +u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_content, uint *len_content) { u8 *attr_ptr; u32 attr_len; @@ -1001,7 +1001,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, if (elen < 4) { if (show_errors) { DBG_871X("short vendor specific " - "information element ignored (len=%lu)\n", + "information element ignored (len =%lu)\n", (unsigned long) elen); } return -1; @@ -1023,7 +1023,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, if (elen < 5) { DBG_871X("short WME " "information element ignored " - "(len=%lu)\n", + "(len =%lu)\n", (unsigned long) elen); return -1; } @@ -1040,7 +1040,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, default: DBG_871X("unknown WME " "information element ignored " - "(subtype=%d len=%lu)\n", + "(subtype =%d len =%lu)\n", pos[4], (unsigned long) elen); return -1; } @@ -1053,7 +1053,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, default: DBG_871X("Unknown Microsoft " "information element ignored " - "(type=%d len=%lu)\n", + "(type =%d len =%lu)\n", pos[3], (unsigned long) elen); return -1; } @@ -1068,7 +1068,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, default: DBG_871X("Unknown Broadcom " "information element ignored " - "(type=%d len=%lu)\n", + "(type =%d len =%lu)\n", pos[3], (unsigned long) elen); return -1; } @@ -1077,7 +1077,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, default: DBG_871X("unknown vendor specific information " "element ignored (vendor OUI %02x:%02x:%02x " - "len=%lu)\n", + "len =%lu)\n", pos[0], pos[1], pos[2], (unsigned long) elen); return -1; } @@ -1114,8 +1114,8 @@ enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, if (elen > left) { if (show_errors) { DBG_871X("IEEE 802.11 element " - "parse failed (id=%d elen=%d " - "left=%lu)\n", + "parse failed (id =%d elen =%d " + "left =%lu)\n", id, elen, (unsigned long) left); } return ParseFailed; @@ -1205,7 +1205,7 @@ enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, if (!show_errors) break; DBG_871X("IEEE 802.11 element parse " - "ignored unknown element (id=%d elen=%d)\n", + "ignored unknown element (id =%d elen =%d)\n", id, elen); break; } @@ -1258,7 +1258,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) if ( rtw_initmac ) { /* Users specify the mac address */ - int jj,kk; + int jj, kk; for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) { @@ -1347,8 +1347,8 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len) { struct ndis_802_11_variable_ies * pIE; u8 OUI[4] = { 0x50, 0x6f, 0x9a, 0x09 }; - int i=0; - int j=0, len=0; + int i =0; + int j =0, len =0; while ( i < in_len) { @@ -1378,7 +1378,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) u8 len = 0; u8 OUI[4] = { 0x50, 0x6f, 0x9a, 0x09 }; u8 ELOUI[6] = { 0xDD, 0x00, 0x50, 0x6f, 0x9a, 0x09 }; /* EID;Len;OUI, Len would copy at the end of function */ - int i=0; + int i =0; if ( merge_ie != NULL) { @@ -1466,7 +1466,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen) { uint cnt = 0; u8 *p2p_ie_ptr; - u8 eid, p2p_oui[4]={0x50,0x6F,0x9A,0x09}; + u8 eid, p2p_oui[4]={0x50, 0x6F, 0x9A, 0x09}; if ( p2p_ielen != NULL ) *p2p_ielen = 0; @@ -1517,11 +1517,11 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen) * * Returns: the address of the specific WPS attribute found, or NULL */ -u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr, u32 *len_attr) +u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_attr, u32 *len_attr) { u8 *attr_ptr = NULL; u8 *target_attr_ptr = NULL; - u8 p2p_oui[4]={0x50,0x6F,0x9A,0x09}; + u8 p2p_oui[4]={0x50, 0x6F, 0x9A, 0x09}; if (len_attr) *len_attr = 0; @@ -1575,7 +1575,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr * * Returns: the address of the specific P2P attribute content found, or NULL */ -u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_content, uint *len_content) +u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_content, uint *len_content) { u8 *attr_ptr; u32 attr_len; @@ -1621,10 +1621,10 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id) u8 *target_attr; u32 target_attr_len; uint ielen = ielen_ori; - int index=0; + int index =0; while (1) { - target_attr=rtw_get_p2p_attr(ie, ielen, attr_id, NULL, &target_attr_len); + target_attr =rtw_get_p2p_attr(ie, ielen, attr_id, NULL, &target_attr_len); if (target_attr && target_attr_len) { u8 *next_attr = target_attr+target_attr_len; @@ -1651,9 +1651,9 @@ void rtw_wlan_bssid_ex_remove_p2p_attr(struct wlan_bssid_ex *bss_ex, u8 attr_id) uint p2p_ielen, p2p_ielen_ori; int cnt; - if ( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) ) + if ( (p2p_ie =rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) ) { - p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id); + p2p_ielen =rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id); if (p2p_ielen != p2p_ielen_ori) { u8 *next_ie_ori = p2p_ie+p2p_ielen_ori; @@ -1697,10 +1697,10 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen) { int match; uint cnt = 0; - u8 eid, wfd_oui[4]={0x50,0x6F,0x9A,0x0A}; + u8 eid, wfd_oui[4]={0x50, 0x6F, 0x9A, 0x0A}; - match=false; + match =false; if ( in_len < 0 ) { @@ -1756,7 +1756,7 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ { int match; - match=false; + match =false; DBG_871X( "[%s] frame_type = %d\n", __FUNCTION__, frame_type ); switch ( frame_type ) @@ -1778,14 +1778,14 @@ int rtw_get_wfd_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ /* attr_content: The output buffer, contains the "body field" of WFD attribute. */ /* attr_contentlen: The data length of the "body field" of WFD attribute. */ -int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen) +int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id , u8 *attr_content, uint *attr_contentlen) { int match; uint cnt = 0; - u8 attr_id, wfd_oui[4]={0x50,0x6F,0x9A,0x0A}; + u8 attr_id, wfd_oui[4]={0x50, 0x6F, 0x9A, 0x0A}; - match=false; + match =false; if ( ( wfd_ie[ 0 ] != _VENDOR_SPECIFIC_IE_ ) || ( _rtw_memcmp( wfd_ie + 2, wfd_oui , 4 ) != true ) ) @@ -1879,13 +1879,13 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); if (pbuf && (wpa_ielen>0)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen)); if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) { pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher; pnetwork->BcnInfo.group_cipher = group_cipher; pnetwork->BcnInfo.is_8021x = is8021x; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("%s: pnetwork->pairwise_cipher: %d, is_8021x is %d", + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: pnetwork->pairwise_cipher: %d, is_8021x is %d", __func__, pnetwork->BcnInfo.pairwise_cipher, pnetwork->BcnInfo.is_8021x)); ret = _SUCCESS; } @@ -1894,15 +1894,15 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12); if (pbuf && (wpa_ielen>0)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n")); if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE OK!!!\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE OK!!!\n")); pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher; pnetwork->BcnInfo.group_cipher = group_cipher; pnetwork->BcnInfo.is_8021x = is8021x; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("%s: pnetwork->pairwise_cipher: %d," + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: pnetwork->pairwise_cipher: %d," "pnetwork->group_cipher is %d, is_8021x is %d", __func__, pnetwork->BcnInfo.pairwise_cipher, - pnetwork->BcnInfo.group_cipher,pnetwork->BcnInfo.is_8021x)); + pnetwork->BcnInfo.group_cipher, pnetwork->BcnInfo.is_8021x)); ret = _SUCCESS; } } @@ -1915,8 +1915,8 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) { unsigned short cap = 0; u8 bencrypt = 0; - /* u8 wpa_ie[255],rsn_ie[255]; */ - u16 wpa_len=0,rsn_len=0; + /* u8 wpa_ie[255], rsn_ie[255]; */ + u16 wpa_len =0, rsn_len =0; struct HT_info_element *pht_info = NULL; struct ieee80211_ht_cap *pht_cap = NULL; unsigned int len; @@ -1931,11 +1931,11 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) } else { pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_OPENSYS; } - rtw_get_sec_ie(pnetwork->network.IEs ,pnetwork->network.IELength,NULL,&rsn_len,NULL,&wpa_len); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: ssid=%s\n",pnetwork->network.Ssid.Ssid)); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len)); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: ssid=%s\n",pnetwork->network.Ssid.Ssid)); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len)); + rtw_get_sec_ie(pnetwork->network.IEs , pnetwork->network.IELength, NULL,&rsn_len, NULL,&wpa_len); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: ssid =%s\n", pnetwork->network.Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: ssid =%s\n", pnetwork->network.Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len)); if (rsn_len > 0) { pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WPA2; @@ -1945,9 +1945,9 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) if (bencrypt) pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WEP; } - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n", + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n", pnetwork->BcnInfo.encryp_protocol)); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n", + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n", pnetwork->BcnInfo.encryp_protocol)); rtw_get_cipher_info(pnetwork); diff --git a/core/rtw_io.c b/core/rtw_io.c index 8622f04..0da746e 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -124,16 +124,16 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val) return RTW_STATUS_CODE(ret); } -int _rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *pdata) +int _rtw_writeN(struct adapter *adapter, u32 addr , u32 length , u8 *pdata) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ struct io_priv *pio_priv = &adapter->iopriv; struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf)); - int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata); + int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata); int ret; _writeN = pintfhdl->io_ops._writeN; - ret = _writeN(pintfhdl, addr,length,pdata); + ret = _writeN(pintfhdl, addr, length, pdata); return RTW_STATUS_CODE(ret); } @@ -304,7 +304,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj) { int ret = false; int value; - if ( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) { + if ( (value =ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) { DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR); ret = true; } else { @@ -408,7 +408,7 @@ int dbg_rtw_write32(struct adapter *adapter, u32 addr, u32 val, const char *call return _rtw_write32(adapter, addr, val); } -int dbg_rtw_writeN(struct adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line) +int dbg_rtw_writeN(struct adapter *adapter, u32 addr , u32 length , u8 *data, const char *caller, const int line) { if (match_write_sniff_ranges(addr, length)) DBG_871X("DBG_IO %s:%d rtw_writeN(0x%04x, %u)\n", caller, line, addr, length); diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 721f3d1..0fbed6e 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -54,13 +54,13 @@ u8 rtw_validate_bssid(u8 *bssid) u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid) { u8 i; - u8 ret=true; + u8 ret =true; ; if (ssid->SsidLength > 32) { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid length >32\n")); - ret= false; + ret = false; goto exit; } @@ -70,7 +70,7 @@ u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid) /* wifi, printable ascii code must be supported */ if (!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n")); - ret= false; + ret = false; break; } } @@ -91,7 +91,7 @@ u8 rtw_do_join(struct adapter * padapter) u8* pibss = NULL; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct __queue *queue = &(pmlmepriv->scanned_queue); - u8 ret=_SUCCESS; + u8 ret =_SUCCESS; ; @@ -99,7 +99,7 @@ u8 rtw_do_join(struct adapter * padapter) phead = get_list_head(queue); plist = get_next(phead); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("\n rtw_do_join: phead = %p; plist = %p\n\n\n", phead, plist)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: phead = %p; plist = %p\n\n\n", phead, plist)); pmlmepriv->cur_network.join_res = -2; @@ -109,7 +109,7 @@ u8 rtw_do_join(struct adapter * padapter) pmlmepriv->to_join = true; - if (_rtw_queue_empty(queue)== true) + if (_rtw_queue_empty(queue) == true) { spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); @@ -121,11 +121,11 @@ u8 rtw_do_join(struct adapter * padapter) || rtw_to_roaming(padapter) > 0 ) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_do_join(): site survey if scanned_queue is empty\n.")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_do_join(): site survey if scanned_queue is empty\n.")); /* submit site_survey_cmd */ - if (_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) { + if (_SUCCESS!=(ret =rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) { pmlmepriv->to_join = false; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n.")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_do_join(): site survey return error\n.")); } } else @@ -140,14 +140,14 @@ u8 rtw_do_join(struct adapter * padapter) { int select_ret; spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); - if ((select_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))==_SUCCESS) + if ((select_ret =rtw_select_and_join_from_scanned_queue(pmlmepriv)) ==_SUCCESS) { pmlmepriv->to_join = false; _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); } else { - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ==true) { /* submit createbss_cmd to change to a ADHOC_MASTER */ @@ -167,14 +167,14 @@ u8 rtw_do_join(struct adapter * padapter) if (rtw_createbss_cmd(padapter)!=_SUCCESS) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL***\n ")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error =>do_goin: rtw_createbss_cmd status FAIL***\n ")); ret = false; goto exit; } pmlmepriv->to_join = false; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("***Error=> rtw_select_and_join_from_scanned_queue FAIL under STA_Mode***\n ")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("***Error => rtw_select_and_join_from_scanned_queue FAIL under STA_Mode***\n ")); } else { /* can't associate ; reset under-linking */ @@ -182,14 +182,14 @@ u8 rtw_do_join(struct adapter * padapter) /* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */ /* we try to issue sitesurvey firstly */ - if (pmlmepriv->LinkDetectInfo.bBusyTraffic==false + if (pmlmepriv->LinkDetectInfo.bBusyTraffic ==false || rtw_to_roaming(padapter) > 0 ) { /* DBG_871X("rtw_do_join() when no desired bss in scanning queue\n"); */ - if ( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){ + if ( _SUCCESS!=(ret =rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){ pmlmepriv->to_join = false; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("do_join(): site survey return error\n.")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("do_join(): site survey return error\n.")); } } else @@ -213,7 +213,7 @@ exit: u8 rtw_set_802_11_bssid(struct adapter* padapter, u8 *bssid) { unsigned long irqL; - u8 status=_SUCCESS; + u8 status =_SUCCESS; u32 cur_time = 0; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -232,7 +232,7 @@ u8 rtw_set_802_11_bssid(struct adapter* padapter, u8 *bssid) spin_lock_bh(&pmlmepriv->lock); - DBG_871X("Set BSSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv)); + DBG_871X("Set BSSID under fw_state =0x%08x\n", get_fwstate(pmlmepriv)); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { goto handle_tkip_countermeasure; } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { @@ -248,9 +248,9 @@ u8 rtw_set_802_11_bssid(struct adapter* padapter, u8 *bssid) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ } else { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("Set BSSID not the same bssid\n")); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_bssid="MAC_FMT"\n", MAC_ARG(bssid) )); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("cur_bssid="MAC_FMT"\n", MAC_ARG(pmlmepriv->cur_network.network.MacAddress) )); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid ="MAC_FMT"\n", MAC_ARG(bssid) )); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("cur_bssid ="MAC_FMT"\n", MAC_ARG(pmlmepriv->cur_network.network.MacAddress) )); rtw_disassoc_cmd(padapter, 0, true); @@ -273,7 +273,7 @@ handle_tkip_countermeasure: } memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); - pmlmepriv->assoc_by_bssid=true; + pmlmepriv->assoc_by_bssid =true; if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { pmlmepriv->to_join = true; @@ -287,7 +287,7 @@ release_mlme_lock: exit: RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("rtw_set_802_11_bssid: status=%d\n", status)); + ("rtw_set_802_11_bssid: status =%d\n", status)); ; @@ -305,19 +305,19 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, struct ndis_802_11_ssid *ssid) ; - DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state=0x%08x\n", + DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state =0x%08x\n", ssid->Ssid, get_fwstate(pmlmepriv)); - if (padapter->hw_init_completed==false){ + if (padapter->hw_init_completed ==false){ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("set_ssid: hw_init_completed==false=>exit!!!\n")); + ("set_ssid: hw_init_completed ==false =>exit!!!\n")); status = _FAIL; goto exit; } spin_lock_bh(&pmlmepriv->lock); - DBG_871X("Set SSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv)); + DBG_871X("Set SSID under fw_state =0x%08x\n", get_fwstate(pmlmepriv)); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { goto handle_tkip_countermeasure; } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { @@ -335,7 +335,7 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, struct ndis_802_11_ssid *ssid) if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) { RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("Set SSID is the same ssid, fw_state=0x%08x\n", + ("Set SSID is the same ssid, fw_state =0x%08x\n", get_fwstate(pmlmepriv))); if (rtw_is_same_ibss(padapter, pnetwork) == false) { @@ -358,9 +358,9 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, struct ndis_802_11_ssid *ssid) rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_JOINBSS, 1); } } else { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("Set SSID not the same ssid\n")); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_ssid=[%s] len=0x%x\n", ssid->Ssid, (unsigned int)ssid->SsidLength)); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("assoc_ssid=[%s] len=0x%x\n", pmlmepriv->assoc_ssid.Ssid, (unsigned int)pmlmepriv->assoc_ssid.SsidLength)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set SSID not the same ssid\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_ssid =[%s] len =0x%x\n", ssid->Ssid, (unsigned int)ssid->SsidLength)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("assoc_ssid =[%s] len =0x%x\n", pmlmepriv->assoc_ssid.Ssid, (unsigned int)pmlmepriv->assoc_ssid.SsidLength)); rtw_disassoc_cmd(padapter, 0, true); @@ -388,7 +388,7 @@ handle_tkip_countermeasure: } memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct ndis_802_11_ssid)); - pmlmepriv->assoc_by_bssid=false; + pmlmepriv->assoc_by_bssid =false; if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { pmlmepriv->to_join = true; @@ -402,7 +402,7 @@ release_mlme_lock: exit: RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("-rtw_set_802_11_ssid: status=%d\n", status)); + ("-rtw_set_802_11_ssid: status =%d\n", status)); ; @@ -434,16 +434,16 @@ u8 rtw_set_802_11_connect(struct adapter* padapter, u8 *bssid, struct ndis_802_1 goto exit; } - if (padapter->hw_init_completed==false){ + if (padapter->hw_init_completed ==false){ RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("set_ssid: hw_init_completed==false=>exit!!!\n")); + ("set_ssid: hw_init_completed ==false =>exit!!!\n")); status = _FAIL; goto exit; } spin_lock_bh(&pmlmepriv->lock); - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" fw_state=0x%08x\n", + DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" fw_state =0x%08x\n", FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { @@ -493,29 +493,29 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, ; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_notice_, - ("+rtw_set_802_11_infrastructure_mode: old=%d new=%d fw_state=0x%08x\n", + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_, + ("+rtw_set_802_11_infrastructure_mode: old =%d new =%d fw_state =0x%08x\n", *pold_state, networktype, get_fwstate(pmlmepriv))); if (*pold_state != networktype) { spin_lock_bh(&pmlmepriv->lock); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!")); - /* DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, (" change mode!")); + /* DBG_871X("change mode, old_mode =%d, new_mode =%d, fw_state =0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ - if (*pold_state==Ndis802_11APMode) { + if (*pold_state ==Ndis802_11APMode) { /* change to other mode from Ndis802_11APMode */ cur_network->join_res = -1; stop_ap_mode(padapter); } - if ((check_fwstate(pmlmepriv, _FW_LINKED)== true) ||(*pold_state==Ndis802_11IBSS)) + if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||(*pold_state ==Ndis802_11IBSS)) rtw_disassoc_cmd(padapter, 0, true); - if ((check_fwstate(pmlmepriv, _FW_LINKED)== true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)== true) ) + if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ) rtw_free_assoc_resources(padapter, 1); if ((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS)) @@ -572,7 +572,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n")); rtw_disassoc_cmd(padapter, 0, true); rtw_indicate_disconnect(padapter); @@ -591,20 +591,20 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) u8 rtw_set_802_11_bssid_list_scan(struct adapter* padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) { unsigned long irqL; - struct mlme_priv *pmlmepriv= &padapter->mlmepriv; - u8 res=true; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + u8 res =true; ; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("+rtw_set_802_11_bssid_list_scan(), fw_state=%x\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("+rtw_set_802_11_bssid_list_scan(), fw_state =%x\n", get_fwstate(pmlmepriv))); if (padapter == NULL) { - res=false; + res =false; goto exit; } - if (padapter->hw_init_completed==false){ + if (padapter->hw_init_completed ==false){ res = false; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n===rtw_set_802_11_bssid_list_scan:hw_init_completed==false===\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n ===rtw_set_802_11_bssid_list_scan:hw_init_completed ==false ===\n")); goto exit; } @@ -612,13 +612,13 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter* padapter, struct ndis_802_11_s (pmlmepriv->LinkDetectInfo.bBusyTraffic == true)) { /* Scan or linking is in progress, do nothing. */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv))); res = true; - if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING))== true){ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n")); + if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)) == true){ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n")); } else { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###pmlmepriv->sitesurveyctrl.traffic_busy==true\n\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###pmlmepriv->sitesurveyctrl.traffic_busy ==true\n\n")); } } else { if (rtw_is_scan_deny(padapter)) { @@ -644,21 +644,21 @@ u8 rtw_set_802_11_authentication_mode(struct adapter* padapter, enum NDIS_802_11 int res; u8 ret; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("set_802_11_auth.mode(): mode=%x\n", authmode)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_802_11_auth.mode(): mode =%x\n", authmode)); - psecuritypriv->ndisauthtype=authmode; + psecuritypriv->ndisauthtype =authmode; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype=%d", psecuritypriv->ndisauthtype)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype =%d", psecuritypriv->ndisauthtype)); if (psecuritypriv->ndisauthtype>3) - psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_8021X; + psecuritypriv->dot11AuthAlgrthm =dot11AuthAlgrthm_8021X; - res=rtw_set_auth(padapter,psecuritypriv); + res =rtw_set_auth(padapter, psecuritypriv); - if (res==_SUCCESS) - ret=true; + if (res ==_SUCCESS) + ret =true; else - ret=false; + ret =false; return ret; } @@ -667,59 +667,59 @@ u8 rtw_set_802_11_add_wep(struct adapter* padapter, struct ndis_802_11_wep *wep) u8 bdefaultkey; u8 btransmitkey; - sint keyid,res; - struct security_priv* psecuritypriv=&(padapter->securitypriv); - u8 ret=_SUCCESS; + sint keyid, res; + struct security_priv* psecuritypriv =&(padapter->securitypriv); + u8 ret =_SUCCESS; ; - bdefaultkey=(wep->KeyIndex & 0x40000000) > 0 ? false : true; /* for ??? */ - btransmitkey= (wep->KeyIndex & 0x80000000) > 0 ? true : false; /* for ??? */ - keyid=wep->KeyIndex & 0x3fffffff; + bdefaultkey =(wep->KeyIndex & 0x40000000) > 0 ? false : true; /* for ??? */ + btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? true : false; /* for ??? */ + keyid =wep->KeyIndex & 0x3fffffff; if (keyid>4) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MgntActrtw_set_802_11_add_wep:keyid>4=>fail\n")); - ret=false; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("MgntActrtw_set_802_11_add_wep:keyid>4 =>fail\n")); + ret =false; goto exit; } switch (wep->KeyLength) { case 5: - psecuritypriv->dot11PrivacyAlgrthm=_WEP40_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=5\n")); + psecuritypriv->dot11PrivacyAlgrthm =_WEP40_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength =5\n")); break; case 13: - psecuritypriv->dot11PrivacyAlgrthm=_WEP104_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength=13\n")); + psecuritypriv->dot11PrivacyAlgrthm =_WEP104_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength =13\n")); break; default: - psecuritypriv->dot11PrivacyAlgrthm=_NO_PRIVACY_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n")); + psecuritypriv->dot11PrivacyAlgrthm =_NO_PRIVACY_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n")); break; } - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_, - ("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength=0x%x wep->KeyIndex=0x%x keyid =%x\n", - wep->KeyLength,wep->KeyIndex,keyid)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, + ("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength =0x%x wep->KeyIndex =0x%x keyid =%x\n", + wep->KeyLength, wep->KeyIndex, keyid)); - memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]),&(wep->KeyMaterial),wep->KeyLength); + memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]),&(wep->KeyMaterial), wep->KeyLength); psecuritypriv->dot11DefKeylen[keyid]=wep->KeyLength; - psecuritypriv->dot11PrivacyKeyIndex=keyid; + psecuritypriv->dot11PrivacyKeyIndex =keyid; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_wep:security key material : %x %x %x %x %x %x %x %x %x %x %x %x %x\n", - psecuritypriv->dot11DefKey[keyid].skey[0],psecuritypriv->dot11DefKey[keyid].skey[1],psecuritypriv->dot11DefKey[keyid].skey[2], - psecuritypriv->dot11DefKey[keyid].skey[3],psecuritypriv->dot11DefKey[keyid].skey[4],psecuritypriv->dot11DefKey[keyid].skey[5], - psecuritypriv->dot11DefKey[keyid].skey[6],psecuritypriv->dot11DefKey[keyid].skey[7],psecuritypriv->dot11DefKey[keyid].skey[8], - psecuritypriv->dot11DefKey[keyid].skey[9],psecuritypriv->dot11DefKey[keyid].skey[10],psecuritypriv->dot11DefKey[keyid].skey[11], + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_add_wep:security key material : %x %x %x %x %x %x %x %x %x %x %x %x %x\n", + psecuritypriv->dot11DefKey[keyid].skey[0], psecuritypriv->dot11DefKey[keyid].skey[1], psecuritypriv->dot11DefKey[keyid].skey[2], + psecuritypriv->dot11DefKey[keyid].skey[3], psecuritypriv->dot11DefKey[keyid].skey[4], psecuritypriv->dot11DefKey[keyid].skey[5], + psecuritypriv->dot11DefKey[keyid].skey[6], psecuritypriv->dot11DefKey[keyid].skey[7], psecuritypriv->dot11DefKey[keyid].skey[8], + psecuritypriv->dot11DefKey[keyid].skey[9], psecuritypriv->dot11DefKey[keyid].skey[10], psecuritypriv->dot11DefKey[keyid].skey[11], psecuritypriv->dot11DefKey[keyid].skey[12])); - res=rtw_set_key(padapter,psecuritypriv, keyid, 1,true); + res =rtw_set_key(padapter, psecuritypriv, keyid, 1, true); - if (res==_FAIL) - ret= false; + if (res ==_FAIL) + ret = false; exit: ; @@ -730,35 +730,35 @@ exit: u8 rtw_set_802_11_remove_wep(struct adapter* padapter, u32 keyindex){ - u8 ret=_SUCCESS; + u8 ret =_SUCCESS; ; if (keyindex >= 0x80000000 || padapter == NULL){ - ret=false; + ret =false; goto exit; } else { int res; - struct security_priv* psecuritypriv=&(padapter->securitypriv); + struct security_priv* psecuritypriv =&(padapter->securitypriv); if ( keyindex < 4 ){ memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16); - res=rtw_set_key(padapter,psecuritypriv,keyindex, 0,true); + res =rtw_set_key(padapter, psecuritypriv, keyindex, 0, true); psecuritypriv->dot11DefKeylen[keyindex]=0; - if (res==_FAIL) - ret=_FAIL; + if (res ==_FAIL) + ret =_FAIL; } else { - ret=_FAIL; + ret =_FAIL; } } @@ -778,7 +778,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) struct sta_info *stainfo; u8 bgroup = false; u8 bgrouptkey = false;/* can be remove later */ - u8 ret=_SUCCESS; + u8 ret =_SUCCESS; ; @@ -786,10 +786,10 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) /* It is invalid to clear bit 31 and set bit 30. If the miniport driver encounters this combination, */ /* it must fail the request and return NDIS_STATUS_INVALID_DATA. */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: ((key->KeyIndex & 0x80000000) == 0)[=%d] ",(int)(key->KeyIndex & 0x80000000) == 0)); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key:((key->KeyIndex & 0x40000000) > 0)[=%d]" , (int)(key->KeyIndex & 0x40000000) > 0)); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_add_key: key->KeyIndex=%d\n" ,(int)key->KeyIndex)); - ret= _FAIL; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_add_key: ((key->KeyIndex & 0x80000000) == 0)[=%d] ", (int)(key->KeyIndex & 0x80000000) == 0)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_add_key:((key->KeyIndex & 0x40000000) > 0)[=%d]" , (int)(key->KeyIndex & 0x40000000) > 0)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_add_key: key->KeyIndex =%d\n" , (int)key->KeyIndex)); + ret = _FAIL; goto exit; } @@ -797,189 +797,189 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) { /* Pairwise key */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Pairwise key +++++\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: +++++ Pairwise key +++++\n")); - pbssid=get_bssid(&padapter->mlmepriv); - stainfo=rtw_get_stainfo(&padapter->stapriv, pbssid); + pbssid =get_bssid(&padapter->mlmepriv); + stainfo =rtw_get_stainfo(&padapter->stapriv, pbssid); - if ((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)){ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY:( stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)\n")); - encryptionalgo=stainfo->dot118021XPrivacy; + if ((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X)){ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY:( stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X)\n")); + encryptionalgo =stainfo->dot118021XPrivacy; } else{ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: stainfo==NULL)||(Adapter->securitypriv.dot11AuthAlgrthm!=dot11AuthAlgrthm_8021X)\n")); - encryptionalgo=padapter->securitypriv.dot11PrivacyAlgrthm; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: stainfo ==NULL)||(Adapter->securitypriv.dot11AuthAlgrthm!=dot11AuthAlgrthm_8021X)\n")); + encryptionalgo =padapter->securitypriv.dot11PrivacyAlgrthm; } - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (encryptionalgo ==%d)!\n",encryptionalgo )); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11PrivacyAlgrthm ==%d)!\n",padapter->securitypriv.dot11PrivacyAlgrthm)); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm ==%d)!\n",padapter->securitypriv.dot11AuthAlgrthm)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_add_key: (encryptionalgo ==%d)!\n", encryptionalgo )); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11PrivacyAlgrthm ==%d)!\n", padapter->securitypriv.dot11PrivacyAlgrthm)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm ==%d)!\n", padapter->securitypriv.dot11AuthAlgrthm)); if ((stainfo!=NULL)){ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy ==%d)!\n", stainfo->dot118021XPrivacy)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy ==%d)!\n", stainfo->dot118021XPrivacy)); } if (key->KeyIndex & 0x000000FF){ /* The key index is specified in the lower 8 bits by values of zero to 255. */ /* The key index should be set to zero for a Pairwise key, and the driver should fail with */ /* NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" key->KeyIndex & 0x000000FF.\n")); - ret= _FAIL; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, (" key->KeyIndex & 0x000000FF.\n")); + ret = _FAIL; goto exit; } /* check BSSID */ if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true){ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MacAddr_isBcst(key->BSSID)\n")); - ret= false; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("MacAddr_isBcst(key->BSSID)\n")); + ret = false; goto exit; } /* Check key length for TKIP. */ /* if (encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32) */ - if ((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("TKIP KeyLength:0x%x != 32\n", key->KeyLength)); - ret=_FAIL; + if ((encryptionalgo == _TKIP_)&& (key->KeyLength != 32)){ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("TKIP KeyLength:0x%x != 32\n", key->KeyLength)); + ret =_FAIL; goto exit; } /* Check key length for AES. */ - if ((encryptionalgo== _AES_)&& (key->KeyLength != 16)) { + if ((encryptionalgo == _AES_)&& (key->KeyLength != 16)) { /* For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case. */ if (key->KeyLength == 32) { key->KeyLength = 16; } else { - ret= _FAIL; + ret = _FAIL; goto exit; } } /* Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. */ if ((encryptionalgo == _WEP40_ && key->KeyLength != 5) || - (encryptionalgo== _WEP104_ && key->KeyLength != 13)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength)); - ret=_FAIL; + (encryptionalgo == _WEP104_ && key->KeyLength != 13)) { + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength)); + ret =_FAIL; goto exit; } bgroup = false; /* Check the pairwise key. Added by Annie, 2005-07-06. */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("[Pairwise Key set]\n")); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key index: 0x%8x(0x%8x)\n", key->KeyIndex,(key->KeyIndex&0x3))); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key Length: %d\n", key->KeyLength)); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("[Pairwise Key set]\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("key index: 0x%8x(0x%8x)\n", key->KeyIndex, (key->KeyIndex&0x3))); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("key Length: %d\n", key->KeyLength)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n")); } else { - /* Group key - KeyIndex(BIT30==0) */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n")); + /* Group key - KeyIndex(BIT30 ==0) */ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: +++++ Group key +++++\n")); /* when add wep key through add key and didn't assigned encryption type before */ - if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0)) + if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy ==0)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("keylen=%d( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength,padapter->securitypriv.dot11PrivacyAlgrthm,padapter->securitypriv.dot118021XGrpPrivacy)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("keylen =%d( Adapter->securitypriv.dot11PrivacyAlgrthm =%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength, padapter->securitypriv.dot11PrivacyAlgrthm, padapter->securitypriv.dot118021XGrpPrivacy)); switch (key->KeyLength) { case 5: - padapter->securitypriv.dot11PrivacyAlgrthm=_WEP40_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("Adapter->securitypriv.dot11PrivacyAlgrthm= %x key->KeyLength=%u\n", padapter->securitypriv.dot11PrivacyAlgrthm,key->KeyLength)); + padapter->securitypriv.dot11PrivacyAlgrthm =_WEP40_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("Adapter->securitypriv.dot11PrivacyAlgrthm = %x key->KeyLength =%u\n", padapter->securitypriv.dot11PrivacyAlgrthm, key->KeyLength)); break; case 13: - padapter->securitypriv.dot11PrivacyAlgrthm=_WEP104_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("Adapter->securitypriv.dot11PrivacyAlgrthm= %x key->KeyLength=%u\n", padapter->securitypriv.dot11PrivacyAlgrthm,key->KeyLength)); + padapter->securitypriv.dot11PrivacyAlgrthm =_WEP104_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("Adapter->securitypriv.dot11PrivacyAlgrthm = %x key->KeyLength =%u\n", padapter->securitypriv.dot11PrivacyAlgrthm, key->KeyLength)); break; default: - padapter->securitypriv.dot11PrivacyAlgrthm=_NO_PRIVACY_; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("Adapter->securitypriv.dot11PrivacyAlgrthm= %x key->KeyLength=%u\n", padapter->securitypriv.dot11PrivacyAlgrthm,key->KeyLength)); + padapter->securitypriv.dot11PrivacyAlgrthm =_NO_PRIVACY_; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("Adapter->securitypriv.dot11PrivacyAlgrthm = %x key->KeyLength =%u\n", padapter->securitypriv.dot11PrivacyAlgrthm, key->KeyLength)); break; } - encryptionalgo=padapter->securitypriv.dot11PrivacyAlgrthm; + encryptionalgo =padapter->securitypriv.dot11PrivacyAlgrthm; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" Adapter->securitypriv.dot11PrivacyAlgrthm=%x\n", padapter->securitypriv.dot11PrivacyAlgrthm)); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, (" Adapter->securitypriv.dot11PrivacyAlgrthm =%x\n", padapter->securitypriv.dot11PrivacyAlgrthm)); } else { - encryptionalgo=padapter->securitypriv.dot118021XGrpPrivacy; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )encryptionalgo(%x)=padapter->securitypriv.dot118021XGrpPrivacy(%x)keylen=%d\n", padapter->securitypriv.dot11PrivacyAlgrthm,encryptionalgo,padapter->securitypriv.dot118021XGrpPrivacy,key->KeyLength)); + encryptionalgo =padapter->securitypriv.dot118021XGrpPrivacy; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("( Adapter->securitypriv.dot11PrivacyAlgrthm =%x )encryptionalgo(%x) =padapter->securitypriv.dot118021XGrpPrivacy(%x)keylen =%d\n", padapter->securitypriv.dot11PrivacyAlgrthm, encryptionalgo, padapter->securitypriv.dot118021XGrpPrivacy, key->KeyLength)); } - if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==true) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" IBSS but BSSID is not Broadcast Address.\n")); - ret= _FAIL; + if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) ==true) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) { + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, (" IBSS but BSSID is not Broadcast Address.\n")); + ret = _FAIL; goto exit; } /* Check key length for TKIP */ - if ((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) { + if ((encryptionalgo == _TKIP_) && (key->KeyLength != 32)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" TKIP GTK KeyLength:%u != 32\n", key->KeyLength)); - ret= _FAIL; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, (" TKIP GTK KeyLength:%u != 32\n", key->KeyLength)); + ret = _FAIL; goto exit; - } else if (encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) { + } else if (encryptionalgo == _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) { /* Check key length for AES */ - /* For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko. */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("<=== SetInfo, OID_802_11_ADD_KEY: AES GTK KeyLength:%u != 16 or 32\n", key->KeyLength)); - ret= _FAIL; + /* For NDTEST, we allow keylen =32 in this case. 2005.01.27, by rcnjko. */ + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("<=== SetInfo, OID_802_11_ADD_KEY: AES GTK KeyLength:%u != 16 or 32\n", key->KeyLength)); + ret = _FAIL; goto exit; } /* Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03. */ - if ((encryptionalgo== _AES_) && (key->KeyLength == 32) ) { + if ((encryptionalgo == _AES_) && (key->KeyLength == 32) ) { key->KeyLength = 16; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) ); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("AES key length changed: %u\n", key->KeyLength) ); } if (key->KeyIndex & 0x8000000) {/* error ??? 0x8000_0000 */ bgrouptkey = true; } - if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==true)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED)==true)) + if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) ==true)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED) ==true)) { bgrouptkey = true; } bgroup = true; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n") ); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("[Group Key set]\n") ); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")) ; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key index: 0x%8x(0x%8x)\n", key->KeyIndex,(key->KeyIndex&0x3))); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("key Length: %d\n", key->KeyLength)) ; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("------------------------------------------\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n") ); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("[Group Key set]\n") ); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n")) ; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("key index: 0x%8x(0x%8x)\n", key->KeyIndex, (key->KeyIndex&0x3))); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("key Length: %d\n", key->KeyLength)) ; + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("------------------------------------------\n")); } /* If WEP encryption algorithm, just call rtw_set_802_11_add_wep(). */ - if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_)) + if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo == _WEP40_ || encryptionalgo == _WEP104_)) { u8 ret; u32 keyindex; u32 len = FIELD_OFFSET(struct ndis_802_11_key, KeyMaterial) + key->KeyLength; struct ndis_802_11_wep *wep = &padapter->securitypriv.ndiswep; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ WEP key +++++\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: +++++ WEP key +++++\n")); wep->Length = len; keyindex = key->KeyIndex&0x7fffffff; wep->KeyIndex = keyindex ; wep->KeyLength = key->KeyLength; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY:Before memcpy\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY:Before memcpy\n")); memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength); memcpy(&(padapter->securitypriv.dot11DefKey[keyindex].skey[0]), key->KeyMaterial, key->KeyLength); padapter->securitypriv.dot11DefKeylen[keyindex]=key->KeyLength; - padapter->securitypriv.dot11PrivacyKeyIndex=keyindex; + padapter->securitypriv.dot11PrivacyKeyIndex =keyindex; ret = rtw_set_802_11_add_wep(padapter, wep); @@ -989,15 +989,15 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) if (key->KeyIndex & 0x20000000){ /* SetRSC */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n")); if (bgroup == true) { - unsigned long long keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL; + unsigned long long keysrc =key->KeyRSC & 0x00FFFFFFFFFFFFULL; memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8); } else { - unsigned long long keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL; + unsigned long long keysrc =key->KeyRSC & 0x00FFFFFFFFFFFFULL; memcpy(&padapter->securitypriv.dot11Grptxpn, &keysrc, 8); } @@ -1011,7 +1011,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) if (bgrouptkey == true) { - padapter->securitypriv.dot118021XGrpKeyid=(u8)key->KeyIndex; + padapter->securitypriv.dot118021XGrpKeyid =(u8)key->KeyIndex; } if ((key->KeyIndex&0x3) == 0){ @@ -1028,12 +1028,12 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8); memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[4],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[5], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[6],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7])); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[4], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[5], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[6], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7])); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n")); } else @@ -1041,30 +1041,30 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8); memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[4],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[5], - padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[6],padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7])); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[0], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[1], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[2], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[3], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[4], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[5], + padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)].skey[6], padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7])); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n")); } /* set group key by index */ memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength); - key->KeyIndex=key->KeyIndex & 0x03; + key->KeyIndex =key->KeyIndex & 0x03; - padapter->securitypriv.binstallGrpkey=true; + padapter->securitypriv.binstallGrpkey =true; - padapter->securitypriv.bcheck_grpkey=false; + padapter->securitypriv.bcheck_grpkey =false; - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("reset group key")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("reset group key")); - res=rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1,true); + res =rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1, true); - if (res==_FAIL) - ret= _FAIL; + if (res ==_FAIL) + ret = _FAIL; goto exit; @@ -1073,8 +1073,8 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) { u8 res; - pbssid=get_bssid(&padapter->mlmepriv); - stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid ); + pbssid =get_bssid(&padapter->mlmepriv); + stainfo =rtw_get_stainfo(&padapter->stapriv , pbssid ); if (stainfo!=NULL) { @@ -1082,13 +1082,13 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16); - if (encryptionalgo== _TKIP_) + if (encryptionalgo == _TKIP_) { - padapter->securitypriv.busetkipkey=false; + padapter->securitypriv.busetkipkey =false; /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n ==========_set_timer\n")); /* if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] */ if ((key->KeyIndex & 0x10000000)){ @@ -1111,16 +1111,16 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key) /* Set key to CAM through H2C command */ if (bgrouptkey)/* never go to here */ { - res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, false, true); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n")); + res =rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, false, true); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n")); } else{ - res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, true, true); - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n")); + res =rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, true, true); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n")); } if (res ==false) - ret= _FAIL; + ret = _FAIL; } @@ -1140,17 +1140,17 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, struct ndis_802_11_remove struct sta_info *stainfo; u8 bgroup = (key->KeyIndex & 0x4000000) > 0 ? false: true; u8 keyIndex = (u8)key->KeyIndex & 0x03; - u8 ret=_SUCCESS; + u8 ret =_SUCCESS; ; if ((key->KeyIndex & 0xbffffffc) > 0) { - ret=_FAIL; + ret =_FAIL; goto exit; } if (bgroup == true) { - encryptionalgo= padapter->securitypriv.dot118021XGrpPrivacy; + encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy; /* clear group key by index */ /* NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN); */ /* Adapter->MgntInfo.SecurityInfo.KeyLen[keyIndex] = 0; */ @@ -1159,17 +1159,17 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, struct ndis_802_11_remove /* \todo Send a H2C Command to Firmware for removing this Key in CAM Entry. */ } else { - pbssid=get_bssid(&padapter->mlmepriv); - stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid ); + pbssid =get_bssid(&padapter->mlmepriv); + stainfo =rtw_get_stainfo(&padapter->stapriv , pbssid ); if (stainfo !=NULL){ - encryptionalgo=stainfo->dot118021XPrivacy; + encryptionalgo =stainfo->dot118021XPrivacy; /* clear key by BSSID */ memset(&stainfo->dot118021x_UncstKey, 0, 16); /* \todo Send a H2C Command to Firmware for disable this Key in CAM Entry. */ } else{ - ret= _FAIL; + ret = _FAIL; goto exit; } } @@ -1196,8 +1196,8 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; struct ieee80211_ht_cap *pht_capie; u8 rf_type = 0; - u8 bw_40MHz=0, short_GI_20=0, short_GI_40=0; - u16 mcs_rate=0; + u8 bw_40MHz =0, short_GI_20 =0, short_GI_40 =0; + u16 mcs_rate =0; u32 ht_ielen = 0; if ((check_fwstate(pmlmepriv, _FW_LINKED) != true) diff --git a/core/rtw_iol.c b/core/rtw_iol.c index 253637e..0d7ccb9 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -37,7 +37,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter) { DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__); rtw_free_xmitframe(pxmitpriv, xmit_frame); - xmit_frame=NULL; + xmit_frame =NULL; goto exit; } @@ -93,7 +93,7 @@ bool rtw_IOL_applied(struct adapter *adapter) int rtw_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt) { - return rtw_hal_iol_cmd(adapter, xmit_frame, max_wating_ms,bndy_cnt); + return rtw_hal_iol_cmd(adapter, xmit_frame, max_wating_ms, bndy_cnt); } int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary) @@ -102,7 +102,7 @@ int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary) } int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask) { - struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {8, IOREG_CMD_WB_REG, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ @@ -116,14 +116,14 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 cmd.mask = cpu_to_le32(mask); } - /* DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); */ + /* DBG_871X("%s addr:0x%04x, value:0x%08x, mask:0x%08x\n", __FUNCTION__, addr, value, mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); } int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask) { - struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {8, IOREG_CMD_WW_REG, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ @@ -137,14 +137,14 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u cmd.mask = cpu_to_le32(mask); } - /* DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask); */ + /* DBG_871X("%s addr:0x%04x, value:0x%08x, mask:0x%08x\n", __FUNCTION__, addr, value, mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); } int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask) { - struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {8, IOREG_CMD_WD_REG, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ @@ -158,7 +158,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u cmd.mask = cpu_to_le32(mask); } - /* DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask); */ + /* DBG_871X("%s addr:0x%04x, value:0x%08x, mask:0x%08x\n", __FU2NCTION__, addr, value, mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -166,7 +166,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask) { - struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {8, IOREG_CMD_W_RF, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, addr); */ /* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */ @@ -180,7 +180,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, cmd.mask = cpu_to_le32(mask); } - /* DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask); */ + /* DBG_871X("%s rf_path:0x%02x addr:0x%04x, value:0x%08x, mask:0x%08x\n", __FU2NCTION__, rf_path, addr, value, mask); */ return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length); @@ -190,7 +190,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) { - struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, us); */ cmd.address = cpu_to_le16(us); @@ -200,7 +200,7 @@ int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us) int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) { - struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0}; + struct ioreg_cfg cmd = {4, IOREG_CMD_DELAY_US, 0x0, 0x0, 0x0}; /* RTW_PUT_LE16((u8*)&cmd.address, ms); */ cmd.address = cpu_to_le16(ms); @@ -210,7 +210,7 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms) } int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame) { - struct ioreg_cfg cmd = {4,IOREG_CMD_END, cpu_to_le16(0xFFFF), + struct ioreg_cfg cmd = {4, IOREG_CMD_END, cpu_to_le16(0xFFFF), cpu_to_le32(0xFF), 0x0}; return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4); @@ -223,24 +223,24 @@ u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame) rtw_IOL_append_END_cmd(pxmit_frame); pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 ); - /* printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen); */ + /* printk("==> %s, pktlen(%d)\n", __FUNCTION__, pxmit_frame->attrib.pktlen); */ pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen; is_cmd_bndy = true; } return is_cmd_bndy; } -void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf) +void rtw_IOL_cmd_buf_dump(struct adapter *Adapter, int buf_len, u8 *pbuf) { int i; - int j=1; + int j =1; - printk("###### %s ######\n",__FUNCTION__); - for (i=0;i< buf_len;i++){ + printk("###### %s ######\n", __FUNCTION__); + for (i =0;i< buf_len;i++){ printk("%02x-",*(pbuf+i)); if (j%32 ==0) printk("\n");j++; } printk("\n"); - printk("============= ioreg_cmd len = %d ===============\n",buf_len); + printk("============= ioreg_cmd len = %d ===============\n", buf_len); } diff --git a/core/rtw_led.c b/core/rtw_led.c index 37a8838..eb9a62e 100644 --- a/core/rtw_led.c +++ b/core/rtw_led.c @@ -126,12 +126,12 @@ static void SwLedBlink(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ( "Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } /* Determine if we shall change LED state again. */ @@ -183,11 +183,11 @@ static void SwLedBlink(PLED_871x pLed) { SwLedOff(padapter, pLed); } - else if ( (check_fwstate(pmlmepriv, _FW_LINKED)== true) && (pLed->bLedOn == false)) + else if ( (check_fwstate(pmlmepriv, _FW_LINKED) == true) && (pLed->bLedOn == false)) { SwLedOn(padapter, pLed); } - else if ( (check_fwstate(pmlmepriv, _FW_LINKED)== true) && pLed->bLedOn == true) + else if ( (check_fwstate(pmlmepriv, _FW_LINKED) == true) && pLed->bLedOn == true) { SwLedOff(padapter, pLed); } @@ -243,12 +243,12 @@ static void SwLedBlink1(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ( "Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on ) @@ -285,7 +285,7 @@ static void SwLedBlink1(PLED_871x pLed) if (bStopBlinking) { - if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; @@ -294,10 +294,10 @@ static void SwLedBlink1(PLED_871x pLed) else pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; @@ -306,7 +306,7 @@ static void SwLedBlink1(PLED_871x pLed) else pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedScanBlinkInProgress = false; } @@ -328,7 +328,7 @@ static void SwLedBlink1(PLED_871x pLed) } if (bStopBlinking) { - if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; @@ -337,9 +337,9 @@ static void SwLedBlink1(PLED_871x pLed) else pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; @@ -348,7 +348,7 @@ static void SwLedBlink1(PLED_871x pLed) else pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } pLed->BlinkTimes = 0; pLed->bLedBlinkInProgress = false; @@ -386,7 +386,7 @@ static void SwLedBlink1(PLED_871x pLed) else pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); pLed->bLedWPSBlinkInProgress = false; } @@ -412,12 +412,12 @@ static void SwLedBlink2(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } switch (pLed->CurrLedState) @@ -435,20 +435,20 @@ static void SwLedBlink2(PLED_871x pLed) { SwLedOff(padapter, pLed); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop scan blink CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop scan blink CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop scan blink CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop scan blink CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedScanBlinkInProgress = false; } @@ -481,20 +481,20 @@ static void SwLedBlink2(PLED_871x pLed) { SwLedOff(padapter, pLed); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedBlinkInProgress = false; } @@ -531,13 +531,13 @@ static void SwLedBlink3(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { if (pLed->CurrLedState != LED_BLINK_WPS_STOP) SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } switch (pLed->CurrLedState) @@ -555,23 +555,23 @@ static void SwLedBlink3(PLED_871x pLed) { SwLedOff(padapter, pLed); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; if ( !pLed->bLedOn ) SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; if ( pLed->bLedOn ) SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedScanBlinkInProgress = false; } @@ -604,7 +604,7 @@ static void SwLedBlink3(PLED_871x pLed) { SwLedOff(padapter, pLed); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== true) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; @@ -612,9 +612,9 @@ static void SwLedBlink3(PLED_871x pLed) if ( !pLed->bLedOn ) SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } - else if (check_fwstate(pmlmepriv, _FW_LINKED)== false) + else if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; @@ -623,7 +623,7 @@ static void SwLedBlink3(PLED_871x pLed) SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedBlinkInProgress = false; } @@ -675,7 +675,7 @@ static void SwLedBlink3(PLED_871x pLed) pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } pLed->bLedWPSBlinkInProgress = false; } @@ -699,12 +699,12 @@ static void SwLedBlink4(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } if (!pLed1->bLedWPSBlinkInProgress && pLed1->BlinkingLedState == LED_UNKNOWN) @@ -878,7 +878,7 @@ static void SwLedBlink4(PLED_871x pLed) break; } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink4 CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("SwLedBlink4 CurrLedState %d\n", pLed->CurrLedState)); } static void SwLedBlink5(PLED_871x pLed) @@ -891,12 +891,12 @@ static void SwLedBlink5(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } switch (pLed->CurrLedState) @@ -991,7 +991,7 @@ static void SwLedBlink5(PLED_871x pLed) break; } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink5 CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("SwLedBlink5 CurrLedState %d\n", pLed->CurrLedState)); } static void SwLedBlink6(PLED_871x pLed) @@ -1004,15 +1004,15 @@ static void SwLedBlink6(PLED_871x pLed) if ( pLed->BlinkingLedState == RTW_LED_ON ) { SwLedOn(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes)); } else { SwLedOff(padapter, pLed); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes)); } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("<==== blink6\n")); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("<==== blink6\n")); } static void @@ -1125,7 +1125,7 @@ SwLedControlMode0( break; } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState)); } @@ -1200,7 +1200,7 @@ SwLedControlMode1( break; case LED_CTL_SITE_SURVEY: - if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== true)) + if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true)) ; else if (pLed->bLedScanBlinkInProgress ==false) { @@ -1393,7 +1393,7 @@ SwLedControlMode1( } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState)); } /* Arcadyan/Sitecom , added by chiyoko, 20090216 */ @@ -1435,7 +1435,7 @@ SwLedControlMode2( case LED_CTL_TX: case LED_CTL_RX: - if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED)== true)) + if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED) == true)) { if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) { @@ -1502,7 +1502,7 @@ SwLedControlMode2( pLed->CurrLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON; _set_timer(&(pLed->BlinkTimer), 0); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } break; @@ -1517,7 +1517,7 @@ SwLedControlMode2( pLed->CurrLedState = RTW_LED_OFF; pLed->BlinkingLedState = RTW_LED_OFF; _set_timer(&(pLed->BlinkTimer), 0); - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } break; @@ -1558,7 +1558,7 @@ SwLedControlMode2( } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } /* COREGA, added by chiyoko, 20090316 */ @@ -1600,7 +1600,7 @@ SwLedControlMode2( case LED_CTL_TX: case LED_CTL_RX: - if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED)== true)) + if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED) == true)) { if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) { @@ -1736,7 +1736,7 @@ SwLedControlMode2( } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState)); } @@ -1840,7 +1840,7 @@ SwLedControlMode4( break; case LED_CTL_SITE_SURVEY: - if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== true)) + if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true)) ; else if (pLed->bLedScanBlinkInProgress ==false) { @@ -2067,7 +2067,7 @@ SwLedControlMode4( } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState)); } @@ -2095,7 +2095,7 @@ SwLedControlMode5( break; case LED_CTL_SITE_SURVEY: - if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== true)) + if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true)) ; else if (pLed->bLedScanBlinkInProgress ==false) { @@ -2152,7 +2152,7 @@ SwLedControlMode5( } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState)); } /* WNC-Corega, added by chiyoko, 20090902 */ @@ -2185,7 +2185,7 @@ SwLedControlMode6( break; } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("ledcontrol 6 Led %d\n", pLed0->CurrLedState)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("ledcontrol 6 Led %d\n", pLed0->CurrLedState)); } /* */ @@ -2198,7 +2198,7 @@ void BlinkHandler(PLED_871x pLed) struct adapter *padapter = pLed->padapter; struct led_priv *ledpriv = &(padapter->ledpriv); - /* DBG_871X("%s (%s:%d)\n",__FUNCTION__, current->comm, current->pid); */ + /* DBG_871X("%s (%s:%d)\n", __FUNCTION__, current->comm, current->pid); */ if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)) { @@ -2302,5 +2302,5 @@ LedControl871x( break; } - RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("LedStrategy:%d, LedAction %d\n", ledpriv->LedStrategy,LedAction)); + RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("LedStrategy:%d, LedAction %d\n", ledpriv->LedStrategy, LedAction)); } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index bfc5385..f87da35 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -57,7 +57,7 @@ sint _rtw_init_mlme_priv (struct adapter* padapter) pmlmepriv->pscanned = NULL; pmlmepriv->fw_state = 0; pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown; - pmlmepriv->scan_mode=SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ + pmlmepriv->scan_mode =SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ spin_lock_init(&(pmlmepriv->lock)); _rtw_init_queue(&(pmlmepriv->free_bss_pool)); @@ -65,12 +65,12 @@ sint _rtw_init_mlme_priv (struct adapter* padapter) set_scanned_network_val(pmlmepriv, 0); - memset(&pmlmepriv->assoc_ssid,0,sizeof(struct ndis_802_11_ssid)); + memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid)); pbuf = rtw_zvmalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); if (pbuf == NULL){ - res=_FAIL; + res =_FAIL; goto exit; } pmlmepriv->free_bss_buf = pbuf; @@ -102,7 +102,7 @@ static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) if (*ppie) { rtw_mfree(*ppie, *plen); *plen = 0; - *ppie=NULL; + *ppie =NULL; } } @@ -205,7 +205,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue * spin_lock_bh(&free_queue->lock); if (_rtw_queue_empty(free_queue) == true) { - pnetwork=NULL; + pnetwork =NULL; goto exit; } plist = get_next(&(free_queue->queue)); @@ -214,12 +214,12 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue * rtw_list_delete(&pnetwork->list); - RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr =%p\n", plist)); pnetwork->network_type = 0; pnetwork->fixed = false; pnetwork->last_scanned = rtw_get_current_time(); - pnetwork->aid=0; - pnetwork->join_res=0; + pnetwork->aid =0; + pnetwork->join_res =0; pmlmepriv->num_of_scanned ++; @@ -231,7 +231,7 @@ exit: return pnetwork; } -void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwork, u8 isfreeall) +void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwork, u8 isfreeall) { u32 curr_time, delta_time; u32 lifetime = SCANQUEUE_LIFETIME; @@ -248,8 +248,8 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwor curr_time = rtw_get_current_time(); - if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==true ) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true ) ) + if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ==true ) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ==true ) ) lifetime = 1; if (!isfreeall) { @@ -268,7 +268,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv ,struct wlan_network *pnetwor pmlmepriv->num_of_scanned --; - /* DBG_871X("_rtw_free_network:SSID=%s\n", pnetwork->network.Ssid.Ssid); */ + /* DBG_871X("_rtw_free_network:SSID =%s\n", pnetwork->network.Ssid.Ssid); */ spin_unlock_bh(&free_queue->lock); @@ -319,12 +319,12 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr) /* unsigned long irqL; */ struct list_head *phead, *plist; struct wlan_network *pnetwork = NULL; - u8 zero_addr[ETH_ALEN] = {0,0,0,0,0,0}; + u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; ; if (_rtw_memcmp(zero_addr, addr, ETH_ALEN)){ - pnetwork=NULL; + pnetwork =NULL; goto exit; } @@ -335,7 +335,7 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr) while (plist != phead) { - pnetwork = LIST_CONTAINOR(plist, struct wlan_network ,list); + pnetwork = LIST_CONTAINOR(plist, struct wlan_network , list); if (_rtw_memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN) == true) break; @@ -380,7 +380,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) plist = get_next(plist); - _rtw_free_network(pmlmepriv,pnetwork, isfreeall); + _rtw_free_network(pmlmepriv, pnetwork, isfreeall); } @@ -399,12 +399,12 @@ sint rtw_if_up(struct adapter *padapter) { ; if ( padapter->bDriverStopped || padapter->bSurpriseRemoved || - (check_fwstate(&padapter->mlmepriv, _FW_LINKED)== false)){ + (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false)){ RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved)); - res=false; + res =false; } else - res= true; + res = true; ; return res; @@ -462,7 +462,7 @@ int rtw_init_mlme_priv (struct adapter *padapter)/* struct mlme_priv *pmlmepriv) void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_mlme_priv\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_mlme_priv\n")); _rtw_free_mlme_priv (pmlmepriv); } @@ -488,7 +488,7 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv )/* _queue *f void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall)/* struct wlan_network *pnetwork, _queue *free_queue) */ { ; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_network ==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); _rtw_free_network(pmlmepriv, pnetwork, is_freeall); ; } @@ -497,7 +497,7 @@ void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *p void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork ) { ; - /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_network==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); */ + /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_network ==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); */ _rtw_free_network_nolock(pmlmepriv, pnetwork); ; } @@ -524,22 +524,22 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr) int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork) { - int ret=true; + int ret =true; struct security_priv *psecuritypriv = &adapter->securitypriv; if ( (psecuritypriv->dot11PrivacyAlgrthm != _NO_PRIVACY_ ) && ( pnetwork->network.Privacy == 0 ) ) { - ret=false; + ret =false; } else if ((psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_ ) && ( pnetwork->network.Privacy == 1 ) ) { - ret=false; + ret =false; } else { - ret=true; + ret =true; } return ret; @@ -548,10 +548,10 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork) inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b) { - /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("(%s,%d)(%s,%d)\n", */ - /* a->Ssid.Ssid,a->Ssid.SsidLength,b->Ssid.Ssid,b->Ssid.SsidLength)); */ + /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("(%s,%d)(%s,%d)\n", */ + /* a->Ssid.Ssid, a->Ssid.SsidLength, b->Ssid.Ssid, b->Ssid.SsidLength)); */ return (a->Ssid.SsidLength == b->Ssid.SsidLength) - && _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength)==true; + && _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength) ==true; } int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feature) @@ -598,10 +598,10 @@ struct wlan_network * rtw_get_oldest_wlan_network(struct __queue *scanned_queue while (1) { - if (rtw_end_of_queue_search(phead,plist)== true) + if (rtw_end_of_queue_search(phead, plist) == true) break; - pwlan= LIST_CONTAINOR(plist, struct wlan_network, list); + pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); if (pwlan->fixed!=true) { @@ -638,8 +638,8 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, DBG_871X(FUNC_ADPT_FMT" %s("MAC_FMT", ch%u) ss_ori:%3u, sq_ori:%3u, rssi_ori:%3ld, ss_smp:%3u, sq_smp:%3u, rssi_smp:%3ld\n" , FUNC_ADPT_ARG(padapter) , src->Ssid.Ssid, MAC_ARG(src->MacAddress), src->Configuration.DSConfig - ,ss_ori, sq_ori, rssi_ori - ,ss_smp, sq_smp, rssi_smp + , ss_ori, sq_ori, rssi_ori + , ss_smp, sq_smp, rssi_smp ); } #endif @@ -694,9 +694,9 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex ; - if ( (check_fwstate(pmlmepriv, _FW_LINKED)== true) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) + if ( (check_fwstate(pmlmepriv, _FW_LINKED) == true) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) { - update_network(&(pmlmepriv->cur_network.network), pnetwork,adapter, true); + update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true); rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof (struct ndis_802_11_fixed_ies), pmlmepriv->cur_network.network.IELength); } @@ -719,7 +719,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t ULONG bssid_ex_sz; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); - struct wifidirect_info *pwdinfo= &(adapter->wdinfo); + struct wifidirect_info *pwdinfo = &(adapter->wdinfo); struct __queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; struct wlan_network *oldest = NULL; @@ -739,7 +739,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t while (1) { - if (rtw_end_of_queue_search(phead,plist)== true) + if (rtw_end_of_queue_search(phead, plist) == true) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -747,7 +747,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t if ((unsigned long)(pnetwork) < 0x7ffffff) { #ifdef PLATFORM_OS_XP - KeBugCheckEx(0x87111c1c, (ULONG_PTR)pnetwork, 0, 0,0); + KeBugCheckEx(0x87111c1c, (ULONG_PTR)pnetwork, 0, 0, 0); #endif } @@ -767,7 +767,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t /* If we didn't find a match, then get a new network slot to initialize * with this beacon's information */ - /* if (rtw_end_of_queue_search(phead,plist)== true) { */ + /* if (rtw_end_of_queue_search(phead, plist) == true) { */ if (!target_find) { if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool)) == true) { @@ -783,8 +783,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t pnetwork->last_scanned = rtw_get_current_time(); pnetwork->network_type = 0; - pnetwork->aid=0; - pnetwork->join_res=0; + pnetwork->aid =0; + pnetwork->join_res =0; /* bss info not receving from the right channel */ if (pnetwork->network.PhyInfo.SignalQuality == 101) @@ -795,8 +795,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */ - if (pnetwork==NULL){ - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n\nsomething wrong here\n\n\n")); + if (pnetwork ==NULL){ + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n")); goto exit; } @@ -835,7 +835,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t update_ie = false; } - update_network(&(pnetwork->network), target,adapter, update_ie); + update_network(&(pnetwork->network), target, adapter, update_ie); } exit: @@ -894,8 +894,8 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor } if (adapter->registrypriv.wifi_spec == 1) /* for correct flow of 8021X to do.... */ { - u8 *p=NULL; - uint ie_len=0; + u8 *p =NULL; + uint ie_len =0; if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0)) bselected = false; @@ -931,7 +931,7 @@ void rtw_atimdone_event_callback(struct adapter *adapter , u8 *pbuf) { ; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("receive atimdone_evet\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("receive atimdone_evet\n")); ; return; } @@ -948,12 +948,12 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) pnetwork = (struct wlan_bssid_ex *)pbuf; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_survey_event_callback, ssid=%s\n", pnetwork->Ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_survey_event_callback, ssid =%s\n", pnetwork->Ssid.Ssid)); len = get_wlan_bssid_ex_sz(pnetwork); if (len > (sizeof(struct wlan_bssid_ex))) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n ****rtw_survey_event_callback: return a wrong bss ***\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n ****rtw_survey_event_callback: return a wrong bss ***\n")); return; } @@ -963,7 +963,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) /* update IBSS_network 's timestamp */ if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) { - /* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,"rtw_survey_event_callback : WIFI_ADHOC_MASTER_STATE\n\n"); */ + /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,"rtw_survey_event_callback : WIFI_ADHOC_MASTER_STATE\n\n"); */ if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) { struct wlan_network* ibss_wlan = NULL; @@ -1026,9 +1026,9 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) pmlmepriv->wps_probe_req_ie = NULL; } - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv))); - if (check_fwstate(pmlmepriv,_FW_UNDER_SURVEY)) + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) { /* u8 timer_cancelled; */ @@ -1039,7 +1039,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) } else { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv))); } spin_unlock_bh(&pmlmepriv->lock); @@ -1053,13 +1053,13 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) if (pmlmepriv->to_join == true) { - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true) ) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ==true) ) { - if (check_fwstate(pmlmepriv, _FW_LINKED)==false) + if (check_fwstate(pmlmepriv, _FW_LINKED) ==false) { set_fwstate(pmlmepriv, _FW_UNDER_LINKING); - if (rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS) + if (rtw_select_and_join_from_scanned_queue(pmlmepriv) ==_SUCCESS) { _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT ); } @@ -1070,7 +1070,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("switching to adhoc master\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("switching to adhoc master\n")); memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid)); memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid)); @@ -1082,7 +1082,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) if (rtw_createbss_cmd(adapter)!=_SUCCESS) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error=>rtw_createbss_cmd status FAIL\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error =>rtw_createbss_cmd status FAIL\n")); } pmlmepriv->to_join = false; @@ -1094,7 +1094,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) int s_ret; set_fwstate(pmlmepriv, _FW_UNDER_LINKING); pmlmepriv->to_join = false; - if (_SUCCESS == (s_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))) + if (_SUCCESS == (s_ret =rtw_select_and_join_from_scanned_queue(pmlmepriv))) { _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); } @@ -1191,7 +1191,7 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) struct wlan_network *tgt_network = &pmlmepriv->cur_network; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n")); - RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress="MAC_FMT" ssid=%s\n", + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress ="MAC_FMT" ssid =%s\n", MAC_ARG(tgt_network->network.MacAddress), tgt_network->network.Ssid.Ssid)); if (check_fwstate( pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE)) { @@ -1228,19 +1228,19 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) pwlan->fixed = false; #ifdef CONFIG_P2P if (!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) { - u32 p2p_ielen=0; + u32 p2p_ielen =0; u8 *p2p_ie; /* u16 capability; */ u8 *pcap = NULL; - u32 capability_len=0; + u32 capability_len =0; /* DBG_871X("free disconnecting network\n"); */ /* rtw_free_network_nolock(pmlmepriv, pwlan); */ - if ((p2p_ie=rtw_get_p2p_ie(pwlan->network.IEs+_FIXED_IE_LENGTH_, pwlan->network.IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen))) + if ((p2p_ie =rtw_get_p2p_ie(pwlan->network.IEs+_FIXED_IE_LENGTH_, pwlan->network.IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen))) { pcap = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, NULL, &capability_len); - if (pcap && capability_len==2) { + if (pcap && capability_len ==2) { u16 cap = *(u16*)pcap ; *(u16*)pcap = cap&0x00ff;/* clear group capability when free this network */ } @@ -1251,11 +1251,11 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) } #endif /* CONFIG_P2P */ } else { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_free_assoc_resources : pwlan== NULL\n\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_assoc_resources : pwlan == NULL\n\n")); } - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count== 1)) + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count == 1)) /*||check_fwstate(pmlmepriv, WIFI_STATION_STATE)*/) { rtw_free_network_nolock(pmlmepriv, pwlan); @@ -1304,7 +1304,7 @@ void rtw_indicate_connect(struct adapter *padapter) rtw_set_roaming(padapter, 0); rtw_set_scan_deny(padapter, 3000); - RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("-rtw_indicate_connect: fw_state=0x%08x\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("-rtw_indicate_connect: fw_state =0x%08x\n", get_fwstate(pmlmepriv))); } /* @@ -1361,7 +1361,7 @@ inline void rtw_indicate_scan_done( struct adapter *padapter, bool aborted) void rtw_scan_abort(struct adapter *adapter) { - u32 cnt=0; + u32 cnt =0; u32 start; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); @@ -1374,7 +1374,7 @@ void rtw_scan_abort(struct adapter *adapter) if (adapter->bDriverStopped || adapter->bSurpriseRemoved) break; - DBG_871X(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev)); + DBG_871X(FUNC_NDEV_FMT"fw_state =_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev)); rtw_msleep_os(20); } @@ -1389,12 +1389,12 @@ void rtw_scan_abort(struct adapter *adapter) static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, struct wlan_network *pnetwork) { int i; - struct sta_info *bmc_sta, *psta=NULL; + struct sta_info *bmc_sta, *psta =NULL; struct recv_reorder_ctrl *preorder_ctrl; struct sta_priv *pstapriv = &padapter->stapriv; psta = rtw_get_stainfo(pstapriv, pnetwork->network.MacAddress); - if (psta==NULL) { + if (psta ==NULL) { psta = rtw_alloc_stainfo(pstapriv, pnetwork->network.MacAddress); } @@ -1403,20 +1403,20 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str DBG_871X("%s\n", __FUNCTION__); psta->aid = pnetwork->join_res; - psta->mac_id=0; + psta->mac_id =0; /* sta mode */ - rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true); + rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true); /* security related */ - if (padapter->securitypriv.dot11AuthAlgrthm== dot11AuthAlgrthm_8021X) + if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { - padapter->securitypriv.binstallGrpkey=false; - padapter->securitypriv.busetkipkey=false; - padapter->securitypriv.bgrpkey_handshake=false; + padapter->securitypriv.binstallGrpkey =false; + padapter->securitypriv.busetkipkey =false; + padapter->securitypriv.bgrpkey_handshake =false; - psta->ieee8021x_blocked=true; - psta->dot118021XPrivacy=padapter->securitypriv.dot11PrivacyAlgrthm; + psta->ieee8021x_blocked =true; + psta->dot118021XPrivacy =padapter->securitypriv.dot11PrivacyAlgrthm; memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof (union Keytype)); @@ -1435,15 +1435,15 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str /* And the Wi-Fi driver shouldn't allow the data packet to be tramsmitted. */ if ( padapter->securitypriv.wps_ie_len != 0 ) { - psta->ieee8021x_blocked=true; + psta->ieee8021x_blocked =true; padapter->securitypriv.wps_ie_len = 0; } /* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */ - /* if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value=0xffff */ + /* if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value =0xffff */ /* todo: check if AP can send A-MPDU packets */ - for (i=0; i < 16 ; i++) + for (i =0; i < 16 ; i++) { /* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */ preorder_ctrl = &psta->recvreorder_ctrl[i]; @@ -1453,15 +1453,15 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u\n", __FUNCTION__, __LINE__, preorder_ctrl->indicate_seq); #endif - preorder_ctrl->wend_b= 0xffff; - preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; ex. 32(kbytes) -> wsize_b=32 */ + preorder_ctrl->wend_b = 0xffff; + preorder_ctrl->wsize_b = 64;/* max_ampdu_sz; ex. 32(kbytes) -> wsize_b =32 */ } bmc_sta = rtw_get_bcmc_stainfo(padapter); if (bmc_sta) { - for (i=0; i < 16 ; i++) + for (i =0; i < 16 ; i++) { /* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */ preorder_ctrl = &bmc_sta->recvreorder_ctrl[i]; @@ -1471,8 +1471,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str DBG_871X("DBG_RX_SEQ %s:%d indicate_seq:%u\n", __FUNCTION__, __LINE__, preorder_ctrl->indicate_seq); #endif - preorder_ctrl->wend_b= 0xffff; - preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b=32 */ + preorder_ctrl->wend_b = 0xffff; + preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */ } } @@ -1495,8 +1495,8 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net DBG_871X("%s\n", __FUNCTION__); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\nfw_state:%x, BSSID:"MAC_FMT"\n" - ,get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\nfw_state:%x, BSSID:"MAC_FMT"\n" + , get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress))); /* why not use ptarget_wlan?? */ @@ -1540,7 +1540,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net break; default: pmlmepriv->fw_state = WIFI_NULL_STATE; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Invalid network_mode\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Invalid network_mode\n")); break; } rtw_update_protection(padapter, (cur_network->network.IEs) + sizeof (struct ndis_802_11_fixed_ies), @@ -1551,17 +1551,17 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net /* Notes: the fucntion could be > passive_level (the same context as Rx tasklet) */ /* pnetwork : returns from rtw_joinbss_event_callback */ /* ptarget_wlan: found from scanned_queue */ -/* if join_res > 0, for (fw_state==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */ -/* if join_res > 0, for (fw_state==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */ +/* if join_res > 0, for (fw_state ==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */ +/* if join_res > 0, for (fw_state ==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */ /* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan !=NULL). */ /* */ /* define REJOIN */ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) { - unsigned long irqL,irqL2; - static u8 retry=0; + unsigned long irqL, irqL2; + static u8 retry =0; u8 timer_cancelled; - struct sta_info *ptarget_sta= NULL, *pcur_sta = NULL; + struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL; struct sta_priv *pstapriv = &adapter->stapriv; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct wlan_network *pnetwork = (struct wlan_network *)pbuf; @@ -1569,32 +1569,32 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL; unsigned int the_same_macaddr = false; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("joinbss event call back received with res=%d\n", pnetwork->join_res)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("joinbss event call back received with res =%d\n", pnetwork->join_res)); rtw_get_encrypt_decrypt_from_registrypriv(adapter); if (pmlmepriv->assoc_ssid.SsidLength == 0) - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ joinbss event call back for Any SSid\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@@@@@ joinbss event call back for Any SSid\n")); else - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("@@@@@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@@@@@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid)); the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN); pnetwork->network.Length = get_wlan_bssid_ex_sz(&pnetwork->network); if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n\n ***joinbss_evt_callback return a wrong bss ***\n\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n ***joinbss_evt_callback return a wrong bss ***\n\n")); goto ignore_joinbss_callback; } spin_lock_bh(&pmlmepriv->lock); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_joinbss_event_callback !! _enter_critical\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_joinbss_event_callback !! _enter_critical\n")); if (pnetwork->join_res > 0) { spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); retry = 0; - if (check_fwstate(pmlmepriv,_FW_UNDER_LINKING) ) { + if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) ) { /* s1. find ptarget_wlan */ if (check_fwstate(pmlmepriv, _FW_LINKED) ) { if (the_same_macaddr == true) { @@ -1629,7 +1629,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) if (ptarget_wlan) { rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork); } else { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't find ptarget_wlan when joinbss_event callback\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't find ptarget_wlan when joinbss_event callback\n")); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); goto exit_unlock; } @@ -1638,8 +1638,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); - if (ptarget_sta==NULL) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't update stainfo when joinbss_event callback\n")); + if (ptarget_sta ==NULL) { + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n")); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); goto exit_unlock; } @@ -1651,15 +1651,15 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) rtw_indicate_connect(adapter); } else { /* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */ - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv))); } /* s5. Cancle assoc_timer */ _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("Cancle assoc_timer\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("Cancle assoc_timer\n")); } else { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv))); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); goto exit_unlock; } @@ -1669,7 +1669,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) _set_timer(&pmlmepriv->assoc_timer, 1); if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("fail! clear _FW_UNDER_LINKING ^^^fw_state =%x\n", get_fwstate(pmlmepriv))); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); } } else { /* if join_res < 0 (join fails), then try again */ @@ -1677,7 +1677,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) res = _FAIL; if (retry < 2) { res = rtw_select_and_join_from_scanned_queue(pmlmepriv); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("rtw_select_and_join_from_scanned_queue again! res:%d\n",res)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_select_and_join_from_scanned_queue again! res:%d\n", res)); } if (res == _SUCCESS) { /* extend time of assoc_timer */ @@ -1687,7 +1687,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); rtw_indicate_connect(adapter); } else { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Set Assoc_Timer = 1; can't find match ssid in scanned_q\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Set Assoc_Timer = 1; can't find match ssid in scanned_q\n")); #endif _set_timer(&pmlmepriv->assoc_timer, 1); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); @@ -1715,7 +1715,7 @@ void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf) static u8 search_max_mac_id(struct adapter *padapter) { u8 mac_id, aid; -#if (RATE_ADAPTIVE_SUPPORT==1) /* for 88E RA */ +#if (RATE_ADAPTIVE_SUPPORT ==1) /* for 88E RA */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -1754,21 +1754,21 @@ static u8 search_max_mac_id(struct adapter *padapter) } -/* FOR STA, AP ,AD-HOC mode */ -void rtw_sta_media_status_rpt(struct adapter *adapter,struct sta_info *psta, u32 mstatus) +/* FOR STA, AP , AD-HOC mode */ +void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u32 mstatus) { u16 media_status_rpt; - if (psta==NULL) return; + if (psta ==NULL) return; - #if (RATE_ADAPTIVE_SUPPORT==1) /* for 88E RA */ + #if (RATE_ADAPTIVE_SUPPORT ==1) /* for 88E RA */ { u8 macid = search_max_mac_id(adapter); - rtw_hal_set_hwreg(adapter,HW_VAR_TX_RPT_MAX_MACID, (u8*)&macid); + rtw_hal_set_hwreg(adapter, HW_VAR_TX_RPT_MAX_MACID, (u8*)&macid); } #endif media_status_rpt = (u16)((psta->mac_id<<8)|mstatus); /* MACID|OPMODE:1 connect */ - rtw_hal_set_hwreg(adapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status_rpt); + rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status_rpt); } void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) @@ -1836,14 +1836,14 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) { /* the sta have been in sta_info_queue => do nothing */ - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue\n")); goto exit; /* between drv has received this event before and fw have not yet to set key to CAM_ENTRY) */ } psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr); if (psta == NULL) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Can't alloc sta_info when rtw_stassoc_event_callback\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't alloc sta_info when rtw_stassoc_event_callback\n")); goto exit; } @@ -1851,13 +1851,13 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) psta->qos_option = 0; psta->mac_id = (uint)pstassoc->cam_id; /* psta->aid = (uint)pstassoc->cam_id; */ - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); /* for ad-hoc mode */ - rtw_hal_set_odm_var(adapter,HAL_ODM_STA_INFO,psta,true); + rtw_hal_set_odm_var(adapter, HAL_ODM_STA_INFO, psta, true); rtw_sta_media_status_rpt(adapter, psta, 1); - if (adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X) + if (adapter->securitypriv.dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X) psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm; @@ -1865,10 +1865,10 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) spin_lock_bh(&pmlmepriv->lock); - if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)==true ) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==true ) ) + if ( (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ==true ) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ==true ) ) { - if (adapter->stapriv.asoc_sta_count== 2) + if (adapter->stapriv.asoc_sta_count == 2) { spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); @@ -1892,11 +1892,11 @@ exit: void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) { - unsigned long irqL,irqL2; - int mac_id=-1; + unsigned long irqL, irqL2; + int mac_id =-1; struct sta_info *psta; struct wlan_network* pwlan = NULL; - struct wlan_bssid_ex *pdev_network=NULL; + struct wlan_bssid_ex *pdev_network =NULL; u8* pibss = NULL; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct stadel_event *pstadel = (struct stadel_event*)pbuf; @@ -1911,12 +1911,12 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) else mac_id = pstadel->mac_id; - DBG_871X("%s(mac_id=%d)=" MAC_FMT "\n", __func__, mac_id, MAC_ARG(pstadel->macaddr)); + DBG_871X("%s(mac_id =%d) =" MAC_FMT "\n", __func__, mac_id, MAC_ARG(pstadel->macaddr)); if (mac_id>=0){ u16 media_status; media_status = (mac_id<<8)|0; /* MACID|OPMODE:0 means disconnect */ - /* for STA,AP,ADHOC mode, report disconnect stauts to FW */ + /* for STA, AP, ADHOC mode, report disconnect stauts to FW */ rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } @@ -1933,7 +1933,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) ) { - if (adapter->registrypriv.wifi_spec==1) + if (adapter->registrypriv.wifi_spec ==1) rtw_set_roaming(adapter, 0); /* don't roam */ else if (rtw_to_roaming(adapter) > 0) pmlmepriv->to_roaming--; /* this stadel_event is caused by roaming, decrease to_roaming */ @@ -1958,15 +1958,15 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) _rtw_roaming(adapter, tgt_network); } - if ( check_fwstate(pmlmepriv,WIFI_ADHOC_MASTER_STATE) || - check_fwstate(pmlmepriv,WIFI_ADHOC_STATE)) + if ( check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { spin_lock_bh(&(pstapriv->sta_hash_lock)); rtw_free_stainfo(adapter, psta); spin_unlock_bh(&(pstapriv->sta_hash_lock)); - if (adapter->stapriv.asoc_sta_count== 1) /* a sta + bc/mc_stainfo (not Ibss_stainfo) */ + if (adapter->stapriv.asoc_sta_count == 1) /* a sta + bc/mc_stainfo (not Ibss_stainfo) */ { spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); /* free old ibss network */ @@ -1990,7 +1990,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) rtw_generate_random_ibss(pibss); - if (check_fwstate(pmlmepriv,WIFI_ADHOC_STATE)) + if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { set_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_STATE); @@ -1999,7 +1999,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) if (rtw_createbss_cmd(adapter)!=_SUCCESS) { - RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL***\n ")); + RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error =>stadel_event_callback: rtw_createbss_cmd status FAIL***\n ")); } @@ -2013,7 +2013,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf) void rtw_cpwm_event_callback(struct adapter *padapter, u8 *pbuf) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("+rtw_cpwm_event_callback !!!\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_cpwm_event_callback !!!\n")); } /* @@ -2027,7 +2027,7 @@ void _rtw_join_timeout_handler (struct adapter *adapter) int do_join_r; ; - DBG_871X("%s, fw_state=%x\n", __FUNCTION__, get_fwstate(pmlmepriv)); + DBG_871X("%s, fw_state =%x\n", __FUNCTION__, get_fwstate(pmlmepriv)); if (adapter->bDriverStopped ||adapter->bSurpriseRemoved) return; @@ -2040,8 +2040,8 @@ void _rtw_join_timeout_handler (struct adapter *adapter) pmlmepriv->to_roaming--; if (rtw_to_roaming(adapter) != 0) { /* try another */ DBG_871X("%s try another roaming\n", __FUNCTION__); - if ( _SUCCESS!=(do_join_r=rtw_do_join(adapter)) ) { - DBG_871X("%s roaming do_join return %d\n", __FUNCTION__ ,do_join_r); + if ( _SUCCESS!=(do_join_r =rtw_do_join(adapter)) ) { + DBG_871X("%s roaming do_join return %d\n", __FUNCTION__ , do_join_r); continue; } break; @@ -2079,7 +2079,7 @@ void rtw_scan_timeout_handler (struct adapter *adapter) unsigned long irqL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - DBG_871X(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); + DBG_871X(FUNC_ADPT_FMT" fw_state =%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv)); spin_lock_bh(&pmlmepriv->lock); @@ -2100,7 +2100,7 @@ static void rtw_auto_scan_handler(struct adapter *padapter) if (pmlmepriv->scan_interval >0) { pmlmepriv->scan_interval--; - if (pmlmepriv->scan_interval==0) + if (pmlmepriv->scan_interval ==0) { DBG_871X("%s\n", __FUNCTION__); @@ -2130,7 +2130,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) if (adapter->hw_init_completed == false) return; - if ((adapter->bDriverStopped == true)||(adapter->bSurpriseRemoved== true)) + if ((adapter->bDriverStopped == true)||(adapter->bSurpriseRemoved == true)) return; if (adapter->net_closed == true) @@ -2138,7 +2138,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter) rtw_dynamic_chk_wk_cmd(adapter); - if (pregistrypriv->wifi_spec==1) + if (pregistrypriv->wifi_spec ==1) { #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &adapter->wdinfo; @@ -2230,7 +2230,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv /* check bssid, if needed */ - if (pmlmepriv->assoc_by_bssid==true) { + if (pmlmepriv->assoc_by_bssid ==true) { if (_rtw_memcmp(competitor->network.MacAddress, pmlmepriv->assoc_bssid, ETH_ALEN) ==false) goto exit; } @@ -2308,8 +2308,8 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv ) while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) { pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); - if (pnetwork==NULL){ - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("%s return _FAIL:(pnetwork==NULL)\n", __FUNCTION__)); + if (pnetwork ==NULL){ + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork ==NULL)\n", __FUNCTION__)); ret = _FAIL; goto exit; } @@ -2346,8 +2346,8 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv ) u8 CurrentAntenna; rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(CurrentAntenna)); DBG_871X("#### Opt_Ant_(%s) , cur_Ant(%s)\n", - (2==candidate->network.PhyInfo.Optimum_antenna)?"A":"B", - (2==CurrentAntenna)?"A":"B" + (2 ==candidate->network.PhyInfo.Optimum_antenna)?"A":"B", + (2 ==CurrentAntenna)?"A":"B" ); } set_fwstate(pmlmepriv, _FW_UNDER_LINKING); @@ -2361,30 +2361,30 @@ exit: return ret; } -sint rtw_set_auth(struct adapter * adapter,struct security_priv *psecuritypriv) +sint rtw_set_auth(struct adapter * adapter, struct security_priv *psecuritypriv) { struct cmd_obj* pcmd; struct setauth_parm *psetauthparm; - struct cmd_priv *pcmdpriv=&(adapter->cmdpriv); - sint res=_SUCCESS; + struct cmd_priv *pcmdpriv =&(adapter->cmdpriv); + sint res =_SUCCESS; ; pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd==NULL){ - res= _FAIL; /* try again */ + if (pcmd ==NULL){ + res = _FAIL; /* try again */ goto exit; } - psetauthparm=(struct setauth_parm*)rtw_zmalloc(sizeof(struct setauth_parm)); - if (psetauthparm==NULL){ + psetauthparm =(struct setauth_parm*)rtw_zmalloc(sizeof(struct setauth_parm)); + if (psetauthparm ==NULL){ rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } memset(psetauthparm, 0, sizeof(struct setauth_parm)); - psetauthparm->mode=(unsigned char)psecuritypriv->dot11AuthAlgrthm; + psetauthparm->mode =(unsigned char)psecuritypriv->dot11AuthAlgrthm; pcmd->cmdcode = _SetAuth_CMD_; pcmd->parmbuf = (unsigned char *)psetauthparm; @@ -2395,7 +2395,7 @@ sint rtw_set_auth(struct adapter * adapter,struct security_priv *psecuritypriv) _rtw_init_listhead(&pcmd->list); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("after enqueue set_auth_cmd, auth_mode=%x\n", psecuritypriv->dot11AuthAlgrthm)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("after enqueue set_auth_cmd, auth_mode =%x\n", psecuritypriv->dot11AuthAlgrthm)); res = rtw_enqueue_cmd(pcmdpriv, pcmd); @@ -2408,31 +2408,31 @@ exit: } -sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,sint keyid, u8 set_tx, bool enqueue) +sint rtw_set_key(struct adapter * adapter, struct security_priv *psecuritypriv, sint keyid, u8 set_tx, bool enqueue) { u8 keylen; struct cmd_obj *pcmd; struct setkey_parm *psetkeyparm; struct cmd_priv *pcmdpriv = &(adapter->cmdpriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); - sint res=_SUCCESS; + sint res =_SUCCESS; ; - psetkeyparm=(struct setkey_parm*)rtw_zmalloc(sizeof(struct setkey_parm)); - if (psetkeyparm==NULL){ - res= _FAIL; + psetkeyparm =(struct setkey_parm*)rtw_zmalloc(sizeof(struct setkey_parm)); + if (psetkeyparm ==NULL){ + res = _FAIL; goto exit; } memset(psetkeyparm, 0, sizeof(struct setkey_parm)); if (psecuritypriv->dot11AuthAlgrthm ==dot11AuthAlgrthm_8021X){ - psetkeyparm->algorithm=(unsigned char)psecuritypriv->dot118021XGrpPrivacy; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=(unsigned char)psecuritypriv->dot118021XGrpPrivacy=%d\n", psetkeyparm->algorithm)); + psetkeyparm->algorithm =(unsigned char)psecuritypriv->dot118021XGrpPrivacy; + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =(unsigned char)psecuritypriv->dot118021XGrpPrivacy =%d\n", psetkeyparm->algorithm)); } else{ - psetkeyparm->algorithm=(u8)psecuritypriv->dot11PrivacyAlgrthm; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=(u8)psecuritypriv->dot11PrivacyAlgrthm=%d\n", psetkeyparm->algorithm)); + psetkeyparm->algorithm =(u8)psecuritypriv->dot11PrivacyAlgrthm; + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =(u8)psecuritypriv->dot11PrivacyAlgrthm =%d\n", psetkeyparm->algorithm)); } psetkeyparm->keyid = (u8)keyid;/* 0~3 */ @@ -2440,32 +2440,32 @@ sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,si if (is_wep_enc(psetkeyparm->algorithm)) psecuritypriv->key_mask |= BIT(psetkeyparm->keyid); - DBG_871X("==> rtw_set_key algorithm(%x),keyid(%x),key_mask(%x)\n",psetkeyparm->algorithm,psetkeyparm->keyid, psecuritypriv->key_mask); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key: psetkeyparm->algorithm=%d psetkeyparm->keyid=(u8)keyid=%d\n",psetkeyparm->algorithm, keyid)); + DBG_871X("==> rtw_set_key algorithm(%x), keyid(%x), key_mask(%x)\n", psetkeyparm->algorithm, psetkeyparm->keyid, psecuritypriv->key_mask); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =%d psetkeyparm->keyid =(u8)keyid =%d\n", psetkeyparm->algorithm, keyid)); switch (psetkeyparm->algorithm){ case _WEP40_: - keylen=5; + keylen =5; memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen); break; case _WEP104_: - keylen=13; + keylen =13; memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen); break; case _TKIP_: - keylen=16; + keylen =16; memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen); - psetkeyparm->grpkey=1; + psetkeyparm->grpkey =1; break; case _AES_: - keylen=16; + keylen =16; memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen); - psetkeyparm->grpkey=1; + psetkeyparm->grpkey =1; break; default: - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("\n rtw_set_key:psecuritypriv->dot11PrivacyAlgrthm = %x (must be 1 or 2 or 4 or 5)\n",psecuritypriv->dot11PrivacyAlgrthm)); - res= _FAIL; + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key:psecuritypriv->dot11PrivacyAlgrthm = %x (must be 1 or 2 or 4 or 5)\n", psecuritypriv->dot11PrivacyAlgrthm)); + res = _FAIL; rtw_mfree((unsigned char *)psetkeyparm, sizeof(struct setkey_parm)); goto exit; } @@ -2473,9 +2473,9 @@ sint rtw_set_key(struct adapter * adapter,struct security_priv *psecuritypriv,si if (enqueue){ pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd==NULL){ + if (pcmd ==NULL){ rtw_mfree((unsigned char *)psetkeyparm, sizeof(struct setkey_parm)); - res= _FAIL; /* try again */ + res = _FAIL; /* try again */ goto exit; } @@ -2505,7 +2505,7 @@ exit: /* adjust IEs for rtw_joinbss_cmd in WMM */ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len) { - unsigned int ielength=0; + unsigned int ielength =0; unsigned int i, j; i = 12; /* after the fixed IE */ @@ -2549,8 +2549,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid) { - struct security_priv *psecuritypriv=&Adapter->securitypriv; - int i=0; + struct security_priv *psecuritypriv =&Adapter->securitypriv; + int i =0; do { @@ -2588,9 +2588,9 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid) /* 13th element in the array is the IE length */ /* */ -static int rtw_append_pmkid(struct adapter *Adapter,int iEntry, u8 *ie, uint ie_len) +static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie_len) { - struct security_priv *psecuritypriv=&Adapter->securitypriv; + struct security_priv *psecuritypriv =&Adapter->securitypriv; if (ie[13]<=20){ /* The RSN IE didn't include the PMK ID, append the PMK information */ @@ -2607,7 +2607,7 @@ static int rtw_append_pmkid(struct adapter *Adapter,int iEntry, u8 *ie, uint ie_ return (ie_len); } -sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_len) +sint rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len) { u8 authmode, securitytype, match; u8 sec_ie[255], uncst_oui[4], bkup_ie[255]; @@ -2616,23 +2616,23 @@ sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_ int iEntry; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - struct security_priv *psecuritypriv=&adapter->securitypriv; - uint ndisauthmode=psecuritypriv->ndisauthtype; + struct security_priv *psecuritypriv =&adapter->securitypriv; + uint ndisauthmode =psecuritypriv->ndisauthtype; uint ndissecuritytype = psecuritypriv->ndisencryptstatus; ; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("+rtw_restruct_sec_ie: ndisauthmode=%d ndissecuritytype=%d\n", + ("+rtw_restruct_sec_ie: ndisauthmode =%d ndissecuritytype =%d\n", ndisauthmode, ndissecuritytype)); /* copy fixed ie only */ - memcpy(out_ie, in_ie,12); - ielength=12; - if ((ndisauthmode==Ndis802_11AuthModeWPA)||(ndisauthmode==Ndis802_11AuthModeWPAPSK)) - authmode=_WPA_IE_ID_; - if ((ndisauthmode==Ndis802_11AuthModeWPA2)||(ndisauthmode==Ndis802_11AuthModeWPA2PSK)) - authmode=_WPA2_IE_ID_; + memcpy(out_ie, in_ie, 12); + ielength =12; + if ((ndisauthmode ==Ndis802_11AuthModeWPA)||(ndisauthmode ==Ndis802_11AuthModeWPAPSK)) + authmode =_WPA_IE_ID_; + if ((ndisauthmode ==Ndis802_11AuthModeWPA2)||(ndisauthmode ==Ndis802_11AuthModeWPA2PSK)) + authmode =_WPA2_IE_ID_; if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { @@ -2640,15 +2640,15 @@ sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_ ielength += psecuritypriv->wps_ie_len; } - else if ((authmode==_WPA_IE_ID_)||(authmode==_WPA2_IE_ID_)) + else if ((authmode ==_WPA_IE_ID_)||(authmode ==_WPA2_IE_ID_)) { /* copy RSN or SSN */ memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2); /* debug for CONFIG_IEEE80211W { int jj; - printk("supplicant_ie_length=%d &&&&&&&&&&&&&&&&&&&\n", psecuritypriv->supplicant_ie[1]+2); - for (jj=0; jj < psecuritypriv->supplicant_ie[1]+2; jj++) + printk("supplicant_ie_length =%d &&&&&&&&&&&&&&&&&&&\n", psecuritypriv->supplicant_ie[1]+2); + for (jj =0; jj < psecuritypriv->supplicant_ie[1]+2; jj++) printk(" %02x ", psecuritypriv->supplicant_ie[jj]); printk("\n"); }*/ @@ -2669,7 +2669,7 @@ sint rtw_restruct_sec_ie(struct adapter *adapter,u8 *in_ie, u8 *out_ie, uint in_ { if (authmode == _WPA2_IE_ID_) { - ielength=rtw_append_pmkid(adapter, iEntry, out_ie, ielength); + ielength =rtw_append_pmkid(adapter, iEntry, out_ie, ielength); } } @@ -2691,7 +2691,7 @@ void rtw_init_registrypriv_dev_network( struct adapter* adapter) memcpy(&pdev_network->Ssid, &pregistrypriv->ssid, sizeof(struct ndis_802_11_ssid)); - pdev_network->Configuration.Length=sizeof(struct ndis_802_11_configuration); + pdev_network->Configuration.Length =sizeof(struct ndis_802_11_configuration); pdev_network->Configuration.BeaconPeriod = 100; pdev_network->Configuration.FHConfig.Length = 0; pdev_network->Configuration.FHConfig.HopPattern = 0; @@ -2705,7 +2705,7 @@ void rtw_init_registrypriv_dev_network( struct adapter* adapter) void rtw_update_registrypriv_dev_network(struct adapter* adapter) { - int sz=0; + int sz =0; struct registry_priv* pregistrypriv = &adapter->registrypriv; struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network; struct security_priv* psecuritypriv = &adapter->securitypriv; @@ -2745,7 +2745,7 @@ void rtw_update_registrypriv_dev_network(struct adapter* adapter) } pdev_network->Configuration.DSConfig = (pregistrypriv->channel); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("pregistrypriv->channel=%d, pdev_network->Configuration.DSConfig=0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("pregistrypriv->channel =%d, pdev_network->Configuration.DSConfig =0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig)); if (cur_network->network.InfrastructureMode == Ndis802_11IBSS) pdev_network->Configuration.ATIMWindow = (0); @@ -2781,11 +2781,11 @@ void rtw_joinbss_reset(struct adapter *padapter) phtpriv->ampdu_enable = false;/* reset to disabled */ - /* TH=1 => means that invalidate usb rx aggregation */ - /* TH=0 => means that validate usb rx aggregation, use init value. */ + /* TH =1 => means that invalidate usb rx aggregation */ + /* TH =0 => means that validate usb rx aggregation, use init value. */ if (phtpriv->ht_option) { - if (padapter->registrypriv.wifi_spec==1) + if (padapter->registrypriv.wifi_spec ==1) threshold = 1; else threshold = 0; @@ -2807,7 +2807,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ struct ieee80211_ht_cap ht_capie; unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv= &pmlmepriv->qospriv; + struct qos_priv *pqospriv = &pmlmepriv->qospriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -2856,7 +2856,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ phtpriv->ht_option = true; p = rtw_get_ie(in_ie+12, _HT_ADD_INFO_IE_, &ielen, in_len-12); - if (p && (ielen==sizeof(struct ieee80211_ht_addt_info))) + if (p && (ielen ==sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; pframe = rtw_set_ie(out_ie+out_len, _HT_ADD_INFO_IE_, ielen, p+2 , pout_len); @@ -2895,9 +2895,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) DBG_871X("+rtw_update_ht_cap()\n"); /* maybe needs check if ap supports rx ampdu. */ - if ((phtpriv->ampdu_enable==false) &&(pregistrypriv->ampdu_enable==1)) + if ((phtpriv->ampdu_enable ==false) &&(pregistrypriv->ampdu_enable ==1)) { - if (pregistrypriv->wifi_spec==1) + if (pregistrypriv->wifi_spec ==1) { phtpriv->ampdu_enable = false; } @@ -2906,7 +2906,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) phtpriv->ampdu_enable = true; } } - else if (pregistrypriv->ampdu_enable==2) + else if (pregistrypriv->ampdu_enable ==2) { phtpriv->ampdu_enable = true; } @@ -2921,13 +2921,13 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR); max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */ - /* DBG_871X("rtw_update_ht_cap(): max_ampdu_sz=%d\n", max_ampdu_sz); */ + /* DBG_871X("rtw_update_ht_cap(): max_ampdu_sz =%d\n", max_ampdu_sz); */ phtpriv->rx_ampdu_maxlen = max_ampdu_sz; } - len=0; + len =0; p = rtw_get_ie(pie+sizeof (struct ndis_802_11_fixed_ies), _HT_ADD_INFO_IE_, &len, ie_len-sizeof (struct ndis_802_11_fixed_ies)); if (p && len>0) { @@ -2976,7 +2976,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len) /* */ pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) { - DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__); + DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __FUNCTION__); } /* */ @@ -2989,7 +2989,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr { u8 issued; int priority; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct ht_priv *phtpriv; struct pkt_attrib *pattrib =&pxmitframe->attrib; s32 bmcst = IS_MCAST(pattrib->ra); @@ -3008,9 +3008,9 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return; } @@ -3023,16 +3023,16 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr phtpriv = &psta->htpriv; - if ((phtpriv->ht_option==true) && (phtpriv->ampdu_enable==true)) + if ((phtpriv->ht_option ==true) && (phtpriv->ampdu_enable ==true)) { issued = (phtpriv->agg_enable_bitmap>>priority)&0x1; issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1; - if (0==issued) + if (0 ==issued) { - DBG_871X("rtw_issue_addbareq_cmd, p=%d\n", priority); + DBG_871X("rtw_issue_addbareq_cmd, p =%d\n", priority); psta->htpriv.candidate_tid_bitmap |= BIT((u8)priority); - rtw_addbareq_cmd(padapter,(u8) priority, pattrib->ra); + rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra); } } @@ -3080,7 +3080,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network) pmlmepriv->assoc_by_bssid = false; while (1) { - if ( _SUCCESS==(do_join_r=rtw_do_join(padapter)) ) { + if ( _SUCCESS ==(do_join_r =rtw_do_join(padapter)) ) { break; } else { DBG_871X("roaming do_join return %d\n", do_join_r); @@ -3089,7 +3089,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network) if (0< rtw_to_roaming(padapter)) { continue; } else { - DBG_871X("%s(%d) -to roaming fail, indicate_disconnect\n", __FUNCTION__,__LINE__); + DBG_871X("%s(%d) -to roaming fail, indicate_disconnect\n", __FUNCTION__, __LINE__); rtw_indicate_disconnect(padapter); break; } @@ -3109,7 +3109,7 @@ sint rtw_linked_check(struct adapter *padapter) } else { /* Station mode */ - if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)== true) + if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true) return true; } return false; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 5677b1b..dc287cb 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -78,7 +78,7 @@ static struct action_handler OnAction_tbl[]={ }; -static u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; +static u8 null_addr[ETH_ALEN]= {0, 0, 0, 0, 0, 0}; /************************************************** OUI definitions for the vendor specific IE @@ -86,8 +86,8 @@ OUI definitions for the vendor specific IE unsigned char RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01}; unsigned char WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02}; unsigned char WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04}; -unsigned char P2P_OUI[] = {0x50,0x6F,0x9A,0x09}; -unsigned char WFD_OUI[] = {0x50,0x6F,0x9A,0x0A}; +unsigned char P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09}; +unsigned char WFD_OUI[] = {0x50, 0x6F, 0x9A, 0x0A}; unsigned char WMM_INFO_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01}; unsigned char WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; @@ -106,111 +106,111 @@ ChannelPlan definitions *********************************************************/ static struct rt_channel_plan_2g RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = { - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, /* 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 */ - {{1,2,3,4,5,6,7,8,9,10,11,12,13},13}, /* 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 */ - {{1,2,3,4,5,6,7,8,9,10,11},11}, /* 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 */ - {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14}, /* 0x03, RT_CHANNEL_DOMAIN_2G_MIKK1 */ - {{10,11,12,13},4}, /* 0x04, RT_CHANNEL_DOMAIN_2G_ETSI2 */ - {{},0}, /* 0x05, RT_CHANNEL_DOMAIN_2G_NULL */ + {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, /* 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 */ + {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, /* 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 */ + {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11}, /* 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 */ + {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}, /* 0x03, RT_CHANNEL_DOMAIN_2G_MIKK1 */ + {{10, 11, 12, 13}, 4}, /* 0x04, RT_CHANNEL_DOMAIN_2G_ETSI2 */ + {{}, 0}, /* 0x05, RT_CHANNEL_DOMAIN_2G_NULL */ }; static struct rt_channel_plan_5g RTW_ChannelPlan5G[RT_CHANNEL_DOMAIN_5G_MAX] = { - {{},0}, /* 0x00, RT_CHANNEL_DOMAIN_5G_NULL */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, /* 0x01, RT_CHANNEL_DOMAIN_5G_ETSI1 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, /* 0x02, RT_CHANNEL_DOMAIN_5G_ETSI2 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,149,153,157,161,165},22}, /* 0x03, RT_CHANNEL_DOMAIN_5G_ETSI3 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165},24}, /* 0x04, RT_CHANNEL_DOMAIN_5G_FCC1 */ - {{36,40,44,48,149,153,157,161,165},9}, /* 0x05, RT_CHANNEL_DOMAIN_5G_FCC2 */ - {{36,40,44,48,52,56,60,64,149,153,157,161,165},13}, /* 0x06, RT_CHANNEL_DOMAIN_5G_FCC3 */ - {{36,40,44,48,52,56,60,64,149,153,157,161},12}, /* 0x07, RT_CHANNEL_DOMAIN_5G_FCC4 */ - {{149,153,157,161,165},5}, /* 0x08, RT_CHANNEL_DOMAIN_5G_FCC5 */ - {{36,40,44,48,52,56,60,64},8}, /* 0x09, RT_CHANNEL_DOMAIN_5G_FCC6 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},20}, /* 0x0A, RT_CHANNEL_DOMAIN_5G_FCC7_IC1 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,149,153,157,161,165},20}, /* 0x0B, RT_CHANNEL_DOMAIN_5G_KCC1 */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140},19}, /* 0x0C, RT_CHANNEL_DOMAIN_5G_MKK1 */ - {{36,40,44,48,52,56,60,64},8}, /* 0x0D, RT_CHANNEL_DOMAIN_5G_MKK2 */ - {{100,104,108,112,116,120,124,128,132,136,140},11}, /* 0x0E, RT_CHANNEL_DOMAIN_5G_MKK3 */ - {{56,60,64,100,104,108,112,116,136,140,149,153,157,161,165},15}, /* 0x0F, RT_CHANNEL_DOMAIN_5G_NCC1 */ - {{56,60,64,149,153,157,161,165},8}, /* 0x10, RT_CHANNEL_DOMAIN_5G_NCC2 */ + {{}, 0}, /* 0x00, RT_CHANNEL_DOMAIN_5G_NULL */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}, 19}, /* 0x01, RT_CHANNEL_DOMAIN_5G_ETSI1 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165}, 24}, /* 0x02, RT_CHANNEL_DOMAIN_5G_ETSI2 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 149, 153, 157, 161, 165}, 22}, /* 0x03, RT_CHANNEL_DOMAIN_5G_ETSI3 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165}, 24}, /* 0x04, RT_CHANNEL_DOMAIN_5G_FCC1 */ + {{36, 40, 44, 48, 149, 153, 157, 161, 165}, 9}, /* 0x05, RT_CHANNEL_DOMAIN_5G_FCC2 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165}, 13}, /* 0x06, RT_CHANNEL_DOMAIN_5G_FCC3 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161}, 12}, /* 0x07, RT_CHANNEL_DOMAIN_5G_FCC4 */ + {{149, 153, 157, 161, 165}, 5}, /* 0x08, RT_CHANNEL_DOMAIN_5G_FCC5 */ + {{36, 40, 44, 48, 52, 56, 60, 64}, 8}, /* 0x09, RT_CHANNEL_DOMAIN_5G_FCC6 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165}, 20}, /* 0x0A, RT_CHANNEL_DOMAIN_5G_FCC7_IC1 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 149, 153, 157, 161, 165}, 20}, /* 0x0B, RT_CHANNEL_DOMAIN_5G_KCC1 */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}, 19}, /* 0x0C, RT_CHANNEL_DOMAIN_5G_MKK1 */ + {{36, 40, 44, 48, 52, 56, 60, 64}, 8}, /* 0x0D, RT_CHANNEL_DOMAIN_5G_MKK2 */ + {{100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}, 11}, /* 0x0E, RT_CHANNEL_DOMAIN_5G_MKK3 */ + {{56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165}, 15}, /* 0x0F, RT_CHANNEL_DOMAIN_5G_NCC1 */ + {{56, 60, 64, 149, 153, 157, 161, 165}, 8}, /* 0x10, RT_CHANNEL_DOMAIN_5G_NCC2 */ - /* Driver self defined for old channel plan Compatible ,Remember to modify if have new channel plan definition ===== */ - {{36,40,44,48,52,56,60,64,100,104,108,112,116,132,136,140,149,153,157,161,165},21}, /* 0x11, RT_CHANNEL_DOMAIN_5G_FCC */ - {{36,40,44,48},4}, /* 0x12, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS */ - {{36,40,44,48,149,153,157,161},8}, /* 0x13, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS */ + /* Driver self defined for old channel plan Compatible , Remember to modify if have new channel plan definition ===== */ + {{36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165}, 21}, /* 0x11, RT_CHANNEL_DOMAIN_5G_FCC */ + {{36, 40, 44, 48}, 4}, /* 0x12, RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS */ + {{36, 40, 44, 48, 149, 153, 157, 161}, 8}, /* 0x13, RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS */ }; static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { /* 0x00 ~ 0x1F , Old Define ===== */ - {0x02,0x11}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */ - {0x02,0x0A}, /* 0x01, RT_CHANNEL_DOMAIN_IC */ - {0x01,0x01}, /* 0x02, RT_CHANNEL_DOMAIN_ETSI */ - {0x01,0x00}, /* 0x03, RT_CHANNEL_DOMAIN_SPAIN */ - {0x01,0x00}, /* 0x04, RT_CHANNEL_DOMAIN_FRANCE */ - {0x03,0x00}, /* 0x05, RT_CHANNEL_DOMAIN_MKK */ - {0x03,0x00}, /* 0x06, RT_CHANNEL_DOMAIN_MKK1 */ - {0x01,0x09}, /* 0x07, RT_CHANNEL_DOMAIN_ISRAEL */ - {0x03,0x09}, /* 0x08, RT_CHANNEL_DOMAIN_TELEC */ - {0x03,0x00}, /* 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN */ - {0x00,0x00}, /* 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 */ - {0x02,0x0F}, /* 0x0B, RT_CHANNEL_DOMAIN_TAIWAN */ - {0x01,0x08}, /* 0x0C, RT_CHANNEL_DOMAIN_CHINA */ - {0x02,0x06}, /* 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO */ - {0x02,0x0B}, /* 0x0E, RT_CHANNEL_DOMAIN_KOREA */ - {0x02,0x09}, /* 0x0F, RT_CHANNEL_DOMAIN_TURKEY */ - {0x01,0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */ - {0x02,0x05}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */ - {0x01,0x12}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ - {0x00,0x04}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */ - {0x02,0x10}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */ - {0x00,0x12}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */ - {0x00,0x13}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */ - {0x03,0x12}, /* 0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ - {0x05,0x08}, /* 0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS */ - {0x02,0x08}, /* 0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS */ - {0x00,0x00}, /* 0x1A, */ - {0x00,0x00}, /* 0x1B, */ - {0x00,0x00}, /* 0x1C, */ - {0x00,0x00}, /* 0x1D, */ - {0x00,0x00}, /* 0x1E, */ - {0x05,0x04}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */ - /* 0x20 ~ 0x7F ,New Define ===== */ - {0x00,0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */ - {0x01,0x00}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */ - {0x02,0x00}, /* 0x22, RT_CHANNEL_DOMAIN_FCC1_NULL */ - {0x03,0x00}, /* 0x23, RT_CHANNEL_DOMAIN_MKK1_NULL */ - {0x04,0x00}, /* 0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL */ - {0x02,0x04}, /* 0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 */ - {0x00,0x01}, /* 0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 */ - {0x03,0x0C}, /* 0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 */ - {0x00,0x0B}, /* 0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 */ - {0x00,0x05}, /* 0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 */ - {0x00,0x00}, /* 0x2A, */ - {0x00,0x00}, /* 0x2B, */ - {0x00,0x00}, /* 0x2C, */ - {0x00,0x00}, /* 0x2D, */ - {0x00,0x00}, /* 0x2E, */ - {0x00,0x00}, /* 0x2F, */ - {0x00,0x06}, /* 0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 */ - {0x00,0x07}, /* 0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 */ - {0x00,0x08}, /* 0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 */ - {0x00,0x09}, /* 0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 */ - {0x02,0x0A}, /* 0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 */ - {0x00,0x02}, /* 0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 */ - {0x00,0x03}, /* 0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 */ - {0x03,0x0D}, /* 0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 */ - {0x03,0x0E}, /* 0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 */ - {0x02,0x0F}, /* 0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 */ - {0x00,0x00}, /* 0x3A, */ - {0x00,0x00}, /* 0x3B, */ - {0x00,0x00}, /* 0x3C, */ - {0x00,0x00}, /* 0x3D, */ - {0x00,0x00}, /* 0x3E, */ - {0x00,0x00}, /* 0x3F, */ - {0x02,0x10}, /* 0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 */ - {0x03,0x00}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ + {0x02, 0x11}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */ + {0x02, 0x0A}, /* 0x01, RT_CHANNEL_DOMAIN_IC */ + {0x01, 0x01}, /* 0x02, RT_CHANNEL_DOMAIN_ETSI */ + {0x01, 0x00}, /* 0x03, RT_CHANNEL_DOMAIN_SPAIN */ + {0x01, 0x00}, /* 0x04, RT_CHANNEL_DOMAIN_FRANCE */ + {0x03, 0x00}, /* 0x05, RT_CHANNEL_DOMAIN_MKK */ + {0x03, 0x00}, /* 0x06, RT_CHANNEL_DOMAIN_MKK1 */ + {0x01, 0x09}, /* 0x07, RT_CHANNEL_DOMAIN_ISRAEL */ + {0x03, 0x09}, /* 0x08, RT_CHANNEL_DOMAIN_TELEC */ + {0x03, 0x00}, /* 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN */ + {0x00, 0x00}, /* 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 */ + {0x02, 0x0F}, /* 0x0B, RT_CHANNEL_DOMAIN_TAIWAN */ + {0x01, 0x08}, /* 0x0C, RT_CHANNEL_DOMAIN_CHINA */ + {0x02, 0x06}, /* 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO */ + {0x02, 0x0B}, /* 0x0E, RT_CHANNEL_DOMAIN_KOREA */ + {0x02, 0x09}, /* 0x0F, RT_CHANNEL_DOMAIN_TURKEY */ + {0x01, 0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */ + {0x02, 0x05}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */ + {0x01, 0x12}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ + {0x00, 0x04}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */ + {0x02, 0x10}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */ + {0x00, 0x12}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */ + {0x00, 0x13}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */ + {0x03, 0x12}, /* 0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */ + {0x05, 0x08}, /* 0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS */ + {0x02, 0x08}, /* 0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS */ + {0x00, 0x00}, /* 0x1A, */ + {0x00, 0x00}, /* 0x1B, */ + {0x00, 0x00}, /* 0x1C, */ + {0x00, 0x00}, /* 0x1D, */ + {0x00, 0x00}, /* 0x1E, */ + {0x05, 0x04}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */ + /* 0x20 ~ 0x7F , New Define ===== */ + {0x00, 0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */ + {0x01, 0x00}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */ + {0x02, 0x00}, /* 0x22, RT_CHANNEL_DOMAIN_FCC1_NULL */ + {0x03, 0x00}, /* 0x23, RT_CHANNEL_DOMAIN_MKK1_NULL */ + {0x04, 0x00}, /* 0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL */ + {0x02, 0x04}, /* 0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 */ + {0x00, 0x01}, /* 0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 */ + {0x03, 0x0C}, /* 0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 */ + {0x00, 0x0B}, /* 0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 */ + {0x00, 0x05}, /* 0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 */ + {0x00, 0x00}, /* 0x2A, */ + {0x00, 0x00}, /* 0x2B, */ + {0x00, 0x00}, /* 0x2C, */ + {0x00, 0x00}, /* 0x2D, */ + {0x00, 0x00}, /* 0x2E, */ + {0x00, 0x00}, /* 0x2F, */ + {0x00, 0x06}, /* 0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 */ + {0x00, 0x07}, /* 0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 */ + {0x00, 0x08}, /* 0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 */ + {0x00, 0x09}, /* 0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 */ + {0x02, 0x0A}, /* 0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 */ + {0x00, 0x02}, /* 0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 */ + {0x00, 0x03}, /* 0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 */ + {0x03, 0x0D}, /* 0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 */ + {0x03, 0x0E}, /* 0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 */ + {0x02, 0x0F}, /* 0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 */ + {0x00, 0x00}, /* 0x3A, */ + {0x00, 0x00}, /* 0x3B, */ + {0x00, 0x00}, /* 0x3C, */ + {0x00, 0x00}, /* 0x3D, */ + {0x00, 0x00}, /* 0x3E, */ + {0x00, 0x00}, /* 0x3F, */ + {0x02, 0x10}, /* 0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 */ + {0x03, 0x00}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ }; -static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03,0x02}; /* use the conbination for max channel numbers */ +static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03, 0x02}; /* use the conbination for max channel numbers */ /* * Search the @param channel_num in given @param channel_set @@ -222,7 +222,7 @@ static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03,0x int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch) { int i; - for (i=0;ch_set[i].ChannelNum!=0;i++){ + for (i =0;ch_set[i].ChannelNum!=0;i++){ if (ch == ch_set[i].ChannelNum) break; } @@ -250,15 +250,15 @@ static void init_mlme_ext_priv_value(struct adapter* padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - unsigned char mixed_datarate[NumRates] = {_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_,_9M_RATE_, _12M_RATE_, _18M_RATE_, _24M_RATE_, _36M_RATE_, _48M_RATE_, _54M_RATE_, 0xff}; + unsigned char mixed_datarate[NumRates] = {_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_, _9M_RATE_, _12M_RATE_, _18M_RATE_, _24M_RATE_, _36M_RATE_, _48M_RATE_, _54M_RATE_, 0xff}; unsigned char mixed_basicrate[NumRates] ={_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_, _12M_RATE_, _24M_RATE_, 0xff,}; ATOMIC_SET(&pmlmeext->event_seq, 0); pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ #ifdef CONFIG_IEEE80211W pmlmeext->sa_query_seq = 0; - pmlmeext->mgnt_80211w_IPN=0; - pmlmeext->mgnt_80211w_IPN_rx=0; + pmlmeext->mgnt_80211w_IPN =0; + pmlmeext->mgnt_80211w_IPN_rx =0; #endif /* CONFIG_IEEE80211W */ pmlmeext->cur_channel = padapter->registrypriv.channel; pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; @@ -374,15 +374,15 @@ static void init_channel_list(struct adapter *padapter, struct rt_channel_info * static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, struct rt_channel_info *channel_set) { - u8 index,chanset_size = 0; + u8 index, chanset_size = 0; u8 b5GBand = false, b2_4GBand = false; - u8 Index2G = 0, Index5G=0; + u8 Index2G = 0, Index5G =0; memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM); if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { - DBG_871X("ChannelPlan ID %x error !!!!!\n",ChannelPlan); + DBG_871X("ChannelPlan ID %x error !!!!!\n", ChannelPlan); return chanset_size; } @@ -406,7 +406,7 @@ static u8 init_channel_set(struct adapter* padapter, u8 ChannelPlan, struct rt_c if (b2_4GBand) { - for (index=0;indexmax_chan_nums = init_channel_set(padapter, pmlmepriv->ChannelPlan,pmlmeext->channel_set); + pmlmeext->max_chan_nums = init_channel_set(padapter, pmlmepriv->ChannelPlan, pmlmeext->channel_set); init_channel_list(padapter, pmlmeext->channel_set, pmlmeext->max_chan_nums, &pmlmeext->channel_list); pmlmeext->chan_scan_time = SURVEY_TO; @@ -527,7 +527,7 @@ void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext) } } -static u8 cmp_pkt_chnl_diff(struct adapter *padapter,u8* pframe,uint packet_len) +static u8 cmp_pkt_chnl_diff(struct adapter *padapter, u8* pframe, uint packet_len) { /* if the channel is same, return 0. else return channel differential */ uint len; u8 channel; @@ -553,7 +553,7 @@ static u8 cmp_pkt_chnl_diff(struct adapter *padapter,u8* pframe,uint packet_len) static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, union recv_frame *precv_frame) { - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 *pframe = precv_frame->u.hdr.rx_data; if (ptable->func) { @@ -573,7 +573,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_AP_MODE struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #endif /* CONFIG_AP_MODE */ - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 *pframe = precv_frame->u.hdr.rx_data; struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe)); @@ -600,7 +600,7 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame) if (index > 13) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Currently we do not support reserved sub-fr-type=%d\n", index)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Currently we do not support reserved sub-fr-type =%d\n", index)); return; } ptable += index; @@ -780,7 +780,7 @@ _continue: } if (check_fwstate(pmlmepriv, _FW_LINKED) == false && - check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)==false) + check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE) ==false) { return _SUCCESS; } @@ -1031,7 +1031,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) u16 algorithm; int status; static struct sta_info stat; - struct sta_info *pstat=NULL; + struct sta_info *pstat =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -1050,7 +1050,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) seq = le16_to_cpu(*(__le16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + 2)); algorithm = le16_to_cpu(*(__le16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN)); - DBG_871X("auth alg=%x, seq=%X\n", algorithm, seq); + DBG_871X("auth alg =%x, seq =%X\n", algorithm, seq); if (auth_mode == 2 && psecuritypriv->dot11PrivacyAlgrthm != _WEP40_ && @@ -1060,7 +1060,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) if ((algorithm > 0 && auth_mode == 0) || /* rx a shared-key auth but shared not enabled */ (algorithm == 0 && auth_mode == 1) ) /* rx a open-system auth but shared-key is enabled */ { - DBG_871X("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n", + DBG_871X("auth rejected due to bad alg [alg =%d, auth_mib =%d] %02X%02X%02X%02X%02X%02X\n", algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]); status = _STATS_NO_SUPP_ALG_; @@ -1077,7 +1077,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) if (pstat == NULL) { /* allocate a new one */ - DBG_871X("going to alloc stainfo for sa="MAC_FMT"\n", MAC_ARG(sa)); + DBG_871X("going to alloc stainfo for sa ="MAC_FMT"\n", MAC_ARG(sa)); pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) { @@ -1095,7 +1095,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) else { spin_lock_bh(&pstapriv->asoc_list_lock); - if (rtw_is_list_empty(&pstat->asoc_list)==false) + if (rtw_is_list_empty(&pstat->asoc_list) ==false) { rtw_list_delete(&pstat->asoc_list); pstapriv->asoc_list_cnt--; @@ -1106,7 +1106,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) } spin_unlock_bh(&pstapriv->asoc_list_lock); - if (seq==1) { + if (seq ==1) { /* TODO: STA re_auth and auth timeout */ } } @@ -1124,13 +1124,13 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) if ((pstat->auth_seq + 1) != seq) { - DBG_871X("(1)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", + DBG_871X("(1)auth rejected because out of seq [rx_seq =%d, exp_seq =%d]!\n", seq, pstat->auth_seq+1); status = _STATS_OUT_OF_AUTH_SEQ_; goto auth_fail; } - if (algorithm==0 && (auth_mode == 0 || auth_mode == 2)) + if (algorithm ==0 && (auth_mode == 0 || auth_mode == 2)) { if (seq == 1) { @@ -1141,7 +1141,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) } else { - DBG_871X("(2)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", + DBG_871X("(2)auth rejected because out of seq [rx_seq =%d, exp_seq =%d]!\n", seq, pstat->auth_seq+1); status = _STATS_OUT_OF_AUTH_SEQ_; goto auth_fail; @@ -1166,7 +1166,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4); - if ((p==NULL) || (ie_len<=0)) + if ((p ==NULL) || (ie_len<=0)) { DBG_871X("auth rejected because challenge failure!(1)\n"); status = _STATS_CHALLENGE_FAIL_; @@ -1189,7 +1189,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) } else { - DBG_871X("(3)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", + DBG_871X("(3)auth rejected because out of seq [rx_seq =%d, exp_seq =%d]!\n", seq, pstat->auth_seq+1); status = _STATS_OUT_OF_AUTH_SEQ_; goto auth_fail; @@ -1307,7 +1307,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram else { /* this is also illegal */ - /* DBG_871X("marc: clnt auth failed due to illegal seq=%x\n", seq); */ + /* DBG_871X("marc: clnt auth failed due to illegal seq =%x\n", seq); */ goto authclnt_fail; } @@ -1339,7 +1339,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) unsigned char supportRate[16]; int supportRateNum; unsigned short status = _STATS_SUCCESSFUL_; - unsigned short frame_type, ie_offset=0; + unsigned short frame_type, ie_offset =0; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -1376,7 +1376,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) { - DBG_871X("handle_assoc(reassoc=%d) - too short payload (len=%lu)" + DBG_871X("handle_assoc(reassoc =%d) - too short payload (len =%lu)" "\n", reassoc, (unsigned long)pkt_len); return _FAIL; } @@ -1499,7 +1499,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie)); if ((psecuritypriv->wpa_psk & BIT(1)) && elems.rsn_ie) { - int group_cipher=0, pairwise_cipher=0; + int group_cipher =0, pairwise_cipher =0; wpa_ie = elems.rsn_ie; wpa_ie_len = elems.rsn_ie_len; @@ -1525,7 +1525,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) } else if ((psecuritypriv->wpa_psk & BIT(0)) && elems.wpa_ie) { - int group_cipher=0, pairwise_cipher=0; + int group_cipher =0, pairwise_cipher =0; wpa_ie = elems.wpa_ie; wpa_ie_len = elems.wpa_ie_len; @@ -1619,7 +1619,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) "(Re)Association Request - WPS is " "used\n"); pstat->flags |= WLAN_STA_WPS; - copy_len=0; + copy_len =0; } else { @@ -1752,10 +1752,10 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) pstat->is_p2p_device = false; if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - if ( (p2pie=rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + ie_offset , pkt_len - WLAN_HDR_A3_LEN - ie_offset , NULL, &p2pielen))) + if ( (p2pie =rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + ie_offset , pkt_len - WLAN_HDR_A3_LEN - ie_offset , NULL, &p2pielen))) { pstat->is_p2p_device = true; - if ((p2p_status_code=(u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat))>0) + if ((p2p_status_code =(u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat))>0) { pstat->p2p_status_code = p2p_status_code; status = _STATS_CAP_FAIL_; @@ -1996,7 +1996,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; #ifdef CONFIG_P2P - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ /* check A3 */ @@ -2013,7 +2013,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); - DBG_871X("%s Reason code(%d)\n", __FUNCTION__,reason); + DBG_871X("%s Reason code(%d)\n", __FUNCTION__, reason); #ifdef CONFIG_AP_MODE if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) @@ -2035,7 +2035,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) u8 updated; spin_lock_bh(&pstapriv->asoc_list_lock); - if (rtw_is_list_empty(&psta->asoc_list)==false) + if (rtw_is_list_empty(&psta->asoc_list) ==false) { rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; @@ -2077,7 +2077,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) if ( 0 == ignore_received_deauth ) { - receive_disconnect(padapter, GetAddr3Ptr(pframe) ,reason); + receive_disconnect(padapter, GetAddr3Ptr(pframe) , reason); } } pmlmepriv->LinkDetectInfo.bBusyTraffic = false; @@ -2093,7 +2093,7 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; #ifdef CONFIG_P2P - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ /* check A3 */ @@ -2109,7 +2109,7 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); - DBG_871X("%s Reason code(%d)\n", __FUNCTION__,reason); + DBG_871X("%s Reason code(%d)\n", __FUNCTION__, reason); #ifdef CONFIG_AP_MODE if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { @@ -2130,7 +2130,7 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) u8 updated; spin_lock_bh(&pstapriv->asoc_list_lock); - if (rtw_is_list_empty(&psta->asoc_list)==false) + if (rtw_is_list_empty(&psta->asoc_list) ==false) { rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; @@ -2277,7 +2277,7 @@ unsigned int OnAction_dls(struct adapter *padapter, union recv_frame *precv_fram unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame) { u8 *addr; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; struct recv_reorder_ctrl *preorder_ctrl; unsigned char *frame_body; unsigned char category, action; @@ -2299,7 +2299,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra addr = GetAddr2Ptr(pframe); psta = rtw_get_stainfo(pstapriv, addr); - if (psta==NULL) + if (psta ==NULL) return _SUCCESS; frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -2313,7 +2313,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra } action = frame_body[1]; - DBG_871X("%s, action=%d\n", __FUNCTION__, action); + DBG_871X("%s, action =%d\n", __FUNCTION__, action); switch (action) { case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ @@ -2338,7 +2338,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra if (status == 0) { /* successful */ - DBG_871X("agg_enable for TID=%d\n", tid); + DBG_871X("agg_enable for TID =%d\n", tid); psta->htpriv.agg_enable_bitmap |= 1 << tid; psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); } @@ -2372,7 +2372,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra #endif } - DBG_871X("%s(): DELBA: %x(%x)\n", __FUNCTION__,pmlmeinfo->agg_enable_bitmap, reason_code); + DBG_871X("%s(): DELBA: %x(%x)\n", __FUNCTION__, pmlmeinfo->agg_enable_bitmap, reason_code); /* todo: how to notify the host while receiving DELETE BA */ break; @@ -2686,7 +2686,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8* raddr) /* Channel Entry List */ { - int i,j; + int i, j; for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { /* Operating Class */ p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; @@ -2807,7 +2807,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8* raddr) } -static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame_body,uint len, u8 result) +static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame_body, uint len, u8 result) { unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; @@ -4093,12 +4093,12 @@ static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profi u8 i, match_result = 0; DBG_871X( "[%s] peermac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__, - peermacaddr[0], peermacaddr[1],peermacaddr[2],peermacaddr[3],peermacaddr[4],peermacaddr[5]); + peermacaddr[0], peermacaddr[1], peermacaddr[2], peermacaddr[3], peermacaddr[4], peermacaddr[5]); for ( i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++ ) { DBG_871X( "[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__, - profileinfo->peermac[0], profileinfo->peermac[1],profileinfo->peermac[2],profileinfo->peermac[3],profileinfo->peermac[4],profileinfo->peermac[5]); + profileinfo->peermac[0], profileinfo->peermac[1], profileinfo->peermac[2], profileinfo->peermac[3], profileinfo->peermac[4], profileinfo->peermac[5]); if ( _rtw_memcmp( peermacaddr, profileinfo->peermac, ETH_ALEN ) ) { match_result = 1; DBG_871X( "[%s] Match!\n", __FUNCTION__ ); @@ -4738,7 +4738,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) pattrib->last_txcmdsz = pattrib->pktlen; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("issuing probe_req, tx_len =%d\n", pattrib->last_txcmdsz)); if (wait_ack) { ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); @@ -4771,10 +4771,10 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait if (adapter->bDriverStopped || adapter->bSurpriseRemoved) break; - if (i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret ==_FAIL) rtw_msleep_os(wait_ms); - }while ((iaction_public_rxseq) && (token == mlmeext->action_public_dialog_token)) { - DBG_871X(FUNC_ADPT_FMT" seq_ctrl=0x%x, rxseq=0x%x, token:%d\n", + DBG_871X(FUNC_ADPT_FMT" seq_ctrl =0x%x, rxseq =0x%x, token:%d\n", FUNC_ADPT_ARG(adapter), seq_ctrl, mlmeext->action_public_rxseq, token); return _FAIL; } } else { if (seq_ctrl == mlmeext->action_public_rxseq) { - DBG_871X(FUNC_ADPT_FMT" seq_ctrl=0x%x, rxseq=0x%x\n", + DBG_871X(FUNC_ADPT_FMT" seq_ctrl =0x%x, rxseq =0x%x\n", FUNC_ADPT_ARG(adapter), seq_ctrl, mlmeext->action_public_rxseq); return _FAIL; } @@ -4840,7 +4840,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; u8 *frame_body; - u8 dialogToken=0; + u8 dialogToken =0; u8 *merged_p2pie = NULL; u32 merged_p2p_ielen = 0; #ifdef CONFIG_P2P @@ -4975,7 +4975,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) /* Received the P2P Invite Request frame. */ DBG_871X( "[%s] Got invite request frame!\n", __FUNCTION__ ); - if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) + if ( (p2p_ie =rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) { /* Parse the necessary information from the P2P Invitation Request frame. */ /* For example: The MAC address of sending this P2P Invitation Request frame. */ @@ -5143,7 +5143,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame) DBG_871X( "[%s] Got invite response frame!\n", __FUNCTION__ ); _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); - if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) + if ( (p2p_ie =rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) { rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen); @@ -5329,13 +5329,13 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv { case 0: /* SA Query req */ memcpy(&tid, &pframe[WLAN_HDR_A3_LEN+2], sizeof(unsigned short)); - DBG_871X("OnAction_sa_query request,action=%d, tid=%04x\n", pframe[WLAN_HDR_A3_LEN+1], tid); + DBG_871X("OnAction_sa_query request, action =%d, tid =%04x\n", pframe[WLAN_HDR_A3_LEN+1], tid); issue_action_SA_Query(padapter, GetAddr2Ptr(pframe), 1, tid); break; case 1: /* SA Query rsp */ _cancel_timer_ex(&pmlmeext->sa_query_timer); - DBG_871X("OnAction_sa_query response,action=%d, tid=%04x, cahcel timer\n", pframe[WLAN_HDR_A3_LEN+1], pframe[WLAN_HDR_A3_LEN+2]); + DBG_871X("OnAction_sa_query response, action =%d, tid =%04x, cahcel timer\n", pframe[WLAN_HDR_A3_LEN+1], pframe[WLAN_HDR_A3_LEN+2]); break; default: break; @@ -5344,7 +5344,7 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv { int pp; printk("pattrib->pktlen = %d =>", pattrib->pkt_len); - for (pp=0;pp< pattrib->pkt_len; pp++) + for (pp =0;pp< pattrib->pkt_len; pp++) printk(" %02x ", pframe[pp]); printk("\n"); } @@ -5362,7 +5362,7 @@ unsigned int OnAction_p2p(struct adapter *padapter, union recv_frame *precv_fram { #ifdef CONFIG_P2P u8 *frame_body; - u8 category, OUI_Subtype, dialogToken=0; + u8 category, OUI_Subtype, dialogToken =0; u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); @@ -5509,7 +5509,7 @@ void update_mgnt_tx_rate(struct adapter *padapter, u8 rate) struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); pmlmeext->tx_rate = rate; - DBG_871X("%s(): rate = %x\n",__FUNCTION__, rate); + DBG_871X("%s(): rate = %x\n", __FUNCTION__, rate); } void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib) @@ -5714,11 +5714,11 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) if ( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { - /* DBG_871X("ie len=%d\n", cur_network->IELength); */ + /* DBG_871X("ie len =%d\n", cur_network->IELength); */ #ifdef CONFIG_P2P /* for P2P : Primary Device Type & Device Name */ - u32 wpsielen=0, insert_len=0; - u8 *wpsie=NULL; + u32 wpsielen =0, insert_len =0; + u8 *wpsie =NULL; wpsie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wpsielen); if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && wpsie && wpsielen>0) @@ -5909,7 +5909,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) /* if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { - u8 erpinfo=0; + u8 erpinfo =0; u32 ATIMWindow; /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ @@ -5946,7 +5946,7 @@ _issue_bcn: pattrib->last_txcmdsz = pattrib->pktlen; - /* DBG_871X("issue bcn_sz=%d\n", pattrib->last_txcmdsz); */ + /* DBG_871X("issue bcn_sz =%d\n", pattrib->last_txcmdsz); */ if (timeout_ms > 0) dump_mgntframe_and_wait(padapter, pmgntframe, timeout_ms); else @@ -6131,7 +6131,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) { - u8 erpinfo=0; + u8 erpinfo =0; u32 ATIMWindow; /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ @@ -6219,7 +6219,7 @@ static int _issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps int bssrate_len = 0; u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_notice_,("+issue_probereq\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n")); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -6290,7 +6290,7 @@ static int _issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps pattrib->last_txcmdsz = pattrib->pktlen; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_notice_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("issuing probe_req, tx_len =%d\n", pattrib->last_txcmdsz)); if (wait_ack) { ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); @@ -6324,10 +6324,10 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, if (padapter->bDriverStopped || padapter->bSurpriseRemoved) break; - if (i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret ==_FAIL) rtw_msleep_os(wait_ms); - }while ((ipktlen)); /* added challenging text... */ - if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) + if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key ==1)) pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); } else { __le32 le_tmp32; @@ -6456,7 +6456,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&le_tmp16, &(pattrib->pktlen)); /* then checking to see if sending challenging text... */ - if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) { + if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key ==1)) { pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); SetPrivacy(fctrl); @@ -6558,7 +6558,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i } if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) { - uint ie_len=0; + uint ie_len =0; /* FILL HT CAP INFO IE */ /* p = hostapd_eid_ht_capabilities_info(hapd, p); */ @@ -6582,7 +6582,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i /* FILL WMM IE */ if ((pstat->flags & WLAN_STA_WME) && (pmlmepriv->qospriv.qos_option)) { - uint ie_len=0; + uint ie_len =0; unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; for (pbuf = ie + _BEACON_IE_OFFSET_; ;pbuf+= (ie_len + 2)) { @@ -6650,7 +6650,7 @@ void issue_assocreq(struct adapter *padapter) struct rtw_ieee80211_hdr *pwlanhdr; __le16 *fctrl; __le16 val16; - unsigned int i, j, ie_len, index=0; + unsigned int i, j, ie_len, index =0; unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates]; struct ndis_802_11_variable_ies * pIE; struct registry_priv *pregpriv = &padapter->registrypriv; @@ -6714,7 +6714,7 @@ void issue_assocreq(struct adapter *padapter) /* listen interval */ /* todo: listen interval for power saving */ val16 = cpu_to_le16(3); - memcpy(pframe ,(unsigned char *)&val16, 2); + memcpy(pframe , (unsigned char *)&val16, 2); pframe += 2; pattrib->pktlen += 2; @@ -6724,7 +6724,7 @@ void issue_assocreq(struct adapter *padapter) /* supported rate & extended supported rate */ get_rate_set(padapter, sta_bssrate, &sta_bssrate_len); - /* DBG_871X("sta_bssrate_len=%d\n", sta_bssrate_len); */ + /* DBG_871X("sta_bssrate_len =%d\n", sta_bssrate_len); */ if (pmlmeext->cur_channel == 14)/* for JAPAN, channel 14 can only uses B Mode(CCK) */ { @@ -6747,11 +6747,11 @@ void issue_assocreq(struct adapter *padapter) /* Check if the AP's supported rates are also supported by STA. */ - for (j=0; j < sta_bssrate_len; j++) { + for (j =0; j < sta_bssrate_len; j++) { /* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */ if ( (pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK) == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) { - /* DBG_871X("match i = %d, j=%d\n", i, j); */ + /* DBG_871X("match i = %d, j =%d\n", i, j); */ break; } else { /* DBG_871X("not match: %02X != %02X\n", (pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK), (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)); */ @@ -6760,7 +6760,7 @@ void issue_assocreq(struct adapter *padapter) if (j == sta_bssrate_len) { /* the rate is not supported by STA */ - DBG_871X("%s(): the rate[%d]=%02X is not supported by STA!\n",__FUNCTION__, i, pmlmeinfo->network.SupportedRates[i]); + DBG_871X("%s(): the rate[%d]=%02X is not supported by STA!\n", __FUNCTION__, i, pmlmeinfo->network.SupportedRates[i]); } else { /* the rate is supported by STA */ bssrate[index++] = pmlmeinfo->network.SupportedRates[i]; @@ -6790,7 +6790,7 @@ void issue_assocreq(struct adapter *padapter) pframe = rtw_set_ie(pframe, _RSN_IE_2_, ie_len, (p + 2), &(pattrib->pktlen)); /* HT caps */ - if (padapter->mlmepriv.htpriv.ht_option==true) { + if (padapter->mlmepriv.htpriv.ht_option ==true) { p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ies)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ies))); if (p && (!is_ap_in_tkip(padapter))) { memcpy(&(pmlmeinfo->HT_caps), (p + 2), sizeof(struct HT_caps_element)); @@ -6819,7 +6819,7 @@ void issue_assocreq(struct adapter *padapter) if ((pregpriv->rx_stbc == 0x3) ||/* enable for 2.4/5 GHz */ ((pmlmeext->cur_wireless_mode & WIRELESS_11_24N) && (pregpriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */ ((pmlmeext->cur_wireless_mode & WIRELESS_11_5N) && (pregpriv->rx_stbc == 0x2)) || /* enable for 5GHz */ - (pregpriv->wifi_spec==1)) { + (pregpriv->wifi_spec ==1)) { DBG_871X("declare supporting RX STBC\n"); pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0200);/* RX STBC two spatial stream */ } @@ -6857,7 +6857,7 @@ void issue_assocreq(struct adapter *padapter) /* In some older APs, WPS handshake */ /* would be fail if we append vender extensions informations to AP */ if (_rtw_memcmp(pIE->data, WPS_OUI, 4)){ - pIE->Length=14; + pIE->Length =14; } } pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, pIE->Length, pIE->data, &(pattrib->pktlen)); @@ -7161,10 +7161,10 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow if (padapter->bDriverStopped || padapter->bSurpriseRemoved) break; - if (i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret ==_FAIL) rtw_msleep_os(wait_ms); - }while ((ibDriverStopped || padapter->bSurpriseRemoved) break; - if (i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret ==_FAIL) rtw_msleep_os(wait_ms); - }while ((iwdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P */ /* DBG_871X("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); */ @@ -7419,10 +7419,10 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int if (padapter->bDriverStopped || padapter->bSurpriseRemoved) break; - if (i < try_cnt && wait_ms > 0 && ret==_FAIL) + if (i < try_cnt && wait_ms > 0 && ret ==_FAIL) rtw_msleep_os(wait_ms); - }while ((imlmext_info); - DBG_871X(FUNC_NDEV_FMT" ra="MAC_FMT", ch:%u, offset:%u\n", + DBG_871X(FUNC_NDEV_FMT" ra ="MAC_FMT", ch:%u, offset:%u\n", FUNC_NDEV_ARG(padapter->pnetdev), MAC_ARG(ra), new_ch, ch_offset); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) @@ -7613,7 +7613,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 tendaAPMac[] = {0xC8, 0x3A, 0x35}; #endif - DBG_871X("%s, category=%d, action=%d, status=%d\n", __FUNCTION__, category, action, status); + DBG_871X("%s, category =%d, action =%d, status =%d\n", __FUNCTION__, category, action, status); if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { @@ -7683,7 +7683,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, if ((psta = rtw_get_stainfo(pstapriv, raddr)) != NULL) { start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; - DBG_871X("BA_starting_seqctrl = %d for TID=%d\n", start_seq, status & 0x07); + DBG_871X("BA_starting_seqctrl = %d for TID =%d\n", start_seq, status & 0x07); psta->BA_starting_seqctrl[status & 0x07] = start_seq; @@ -7719,9 +7719,9 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, } #endif - if (pregpriv->ampdu_amsdu==0)/* disabled */ + if (pregpriv->ampdu_amsdu ==0)/* disabled */ le_tmp = cpu_to_le16(BA_para_set & ~BIT(0)); - else if (pregpriv->ampdu_amsdu==1)/* enabled */ + else if (pregpriv->ampdu_amsdu ==1)/* enabled */ le_tmp = cpu_to_le16(BA_para_set | BIT(0)); else /* auto */ le_tmp = cpu_to_le16(BA_para_set); @@ -7766,7 +7766,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) struct __queue *queue = &(pmlmepriv->scanned_queue); u8 InfoContent[16] = {0}; u8 ICS[8][15]; - if ((pmlmepriv->num_FortyMHzIntolerant==0) || (pmlmepriv->num_sta_no_ht==0)) + if ((pmlmepriv->num_FortyMHzIntolerant ==0) || (pmlmepriv->num_sta_no_ht ==0)) return; if (true == pmlmeinfo->bwmode_updated) @@ -7814,7 +7814,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) /* */ if (pmlmepriv->num_FortyMHzIntolerant>0) { - u8 iedata=0; + u8 iedata =0; iedata |= BIT(2);/* 20 MHz BSS Width Request */ @@ -7840,7 +7840,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) u8 *p; struct wlan_bssid_ex *pbss_network; - if (rtw_end_of_queue_search(phead,plist)== true) + if (rtw_end_of_queue_search(phead, plist) == true) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -7850,7 +7850,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) pbss_network = (struct wlan_bssid_ex *)&pnetwork->network; p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); - if ((p==NULL) || (len==0))/* non-HT */ + if ((p ==NULL) || (len ==0))/* non-HT */ { if ((pbss_network->Configuration.DSConfig<=0) || (pbss_network->Configuration.DSConfig>14)) continue; @@ -7863,17 +7863,17 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); - for (i= 0;i<8;i++) + for (i = 0;i<8;i++) { if (ICS[i][0] == 1) { int j, k = 0; InfoContent[k] = i; - /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent,i); */ + /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ k++; - for (j=1;j<=14;j++) + for (j =1;j<=14;j++) { if (ICS[i][j]==1) { @@ -7908,18 +7908,18 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) return _SUCCESS; psta = rtw_get_stainfo(pstapriv, addr); - if (psta==NULL) + if (psta ==NULL) return _SUCCESS; - /* DBG_871X("%s:%s\n", __FUNCTION__, (initiator==0)?"RX_DIR":"TX_DIR"); */ + /* DBG_871X("%s:%s\n", __FUNCTION__, (initiator ==0)?"RX_DIR":"TX_DIR"); */ - if (initiator==0) /* recipient */ + if (initiator ==0) /* recipient */ { for (tid = 0;tidrecvreorder_ctrl[tid].enable == true) { - DBG_871X("rx agg disable tid(%d)\n",tid); + DBG_871X("rx agg disable tid(%d)\n", tid); issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); psta->recvreorder_ctrl[tid].enable = false; @@ -7938,7 +7938,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) { if (psta->htpriv.agg_enable_bitmap & BIT(tid)) { - DBG_871X("tx agg disable tid(%d)\n",tid); + DBG_871X("tx agg disable tid(%d)\n", tid); issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid <<1) |initiator)&0x1F)); psta->htpriv.agg_enable_bitmap &= ~BIT(tid); @@ -7953,7 +7953,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) unsigned int send_beacon(struct adapter *padapter) { u8 bxmitok = false; - int issue=0; + int issue =0; int poll = 0; u32 start = rtw_get_current_time(); @@ -8004,12 +8004,12 @@ bool IsLegal5GChannel( u8 channel) { - int i=0; - u8 Channel_5G[45] = {36,38,40,42,44,46,48,50,52,54,56,58, - 60,62,64,100,102,104,106,108,110,112,114,116,118,120,122, - 124,126,128,130,132,134,136,138,140,149,151,153,155,157,159, - 161,163,165}; - for (i=0;imlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u32 initialgain = 0; - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #ifdef CONFIG_P2P static unsigned char prev_survey_channel = 0; static unsigned int p2p_scan_count = 0; @@ -8063,7 +8063,7 @@ void site_survey(struct adapter *padapter) } if (0){ - DBG_871X(FUNC_ADPT_FMT" ch:%u (cnt:%u,idx:%d) at %dms, %c%c%c\n" + DBG_871X(FUNC_ADPT_FMT" ch:%u (cnt:%u, idx:%d) at %dms, %c%c%c\n" , FUNC_ADPT_ARG(padapter) , survey_channel , pwdinfo->find_phase_state_exchange_cnt, pmlmeext->sitesurvey_res.channel_idx @@ -8116,7 +8116,7 @@ void site_survey(struct adapter *padapter) #endif /* CONFIG_P2P */ { int i; - for (i=0;isitesurvey_res.ssid[i].SsidLength) { /* todo: to issue two probe req??? */ issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); @@ -8267,7 +8267,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str subtype = GetFrameSubType(pframe); - if (subtype==WIFI_BEACON) { + if (subtype ==WIFI_BEACON) { bssid->Reserved[0] = 1; ie_offset = _BEACON_IE_OFFSET_; } else { @@ -8422,7 +8422,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str bssid->Configuration.ATIMWindow = 0; /* 20/40 BSS Coexistence check */ - if ((pregistrypriv->wifi_spec==1) && (false == pmlmeinfo->bwmode_updated)) + if ((pregistrypriv->wifi_spec ==1) && (false == pmlmeinfo->bwmode_updated)) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset); @@ -8450,7 +8450,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str /* mark bss info receving from nearby channel as SignalQuality 101 */ if (bssid->Configuration.DSConfig != rtw_get_oper_ch(padapter)) { - bssid->PhyInfo.SignalQuality= 101; + bssid->PhyInfo.SignalQuality = 101; } return _SUCCESS; @@ -8489,9 +8489,9 @@ void start_create_ibss(struct adapter* padapter) Set_MSR(padapter, (pmlmeinfo->state & 0x3)); /* issue beacon */ - if (send_beacon(padapter)==_FAIL) + if (send_beacon(padapter) ==_FAIL) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("issuing beacon frame fail....\n")); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("issuing beacon frame fail....\n")); report_join_res(padapter, -1); pmlmeinfo->state = WIFI_FW_NULL_STATE; @@ -8561,7 +8561,7 @@ void start_clnt_join(struct adapter* padapter) for (pos = get_next(head);!rtw_end_of_queue_search(head, pos); pos = get_next(pos)) { scanned = LIST_CONTAINOR(pos, struct wlan_network, list); - if (scanned==NULL) { + if (scanned ==NULL) { spin_unlock_bh(&(padapter->mlmepriv.scanned_queue.lock)); rtw_warn_on(1); return; @@ -8597,7 +8597,7 @@ void start_clnt_join(struct adapter* padapter) u8 mac_id = 0; media_status = (mac_id<<8)|1; /* MACID|OPMODE:1 connect */ - rtw_hal_set_hwreg(padapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); + rtw_hal_set_hwreg(padapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } } else if (caps&cap_IBSS) /* adhoc client */ @@ -8728,7 +8728,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid memcpy(country, p, 3); p += 3; RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, - ("%s: 802.11d country=%s\n", __FUNCTION__, country)); + ("%s: 802.11d country =%s\n", __FUNCTION__, country)); i = 0; while ((ie - p) >= 3) @@ -9136,7 +9136,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char* MacAddr, unsi pdel_sta_evt = (struct stadel_event*)(pevtcmd + sizeof(struct C2HEvent_Header)); memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); - memcpy((unsigned char *)(pdel_sta_evt->rsvd),(unsigned char *)(&reason),2); + memcpy((unsigned char *)(pdel_sta_evt->rsvd), (unsigned char *)(&reason), 2); psta = rtw_get_stainfo(&padapter->stapriv, MacAddr); @@ -9147,7 +9147,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char* MacAddr, unsi pdel_sta_evt->mac_id = mac_id; - DBG_871X("report_del_sta_event: delete STA, mac_id=%d\n", mac_id); + DBG_871X("report_del_sta_event: delete STA, mac_id =%d\n", mac_id); rtw_enqueue_cmd(pcmdpriv, pcmd_obj); @@ -9279,7 +9279,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) if (psta){/* only for STA mode */ media_status = (psta->mac_id<<8)|0; /* MACID|OPMODE:1 connect */ - rtw_hal_set_hwreg(padapter,HW_VAR_H2C_MEDIA_STATUS_RPT,(u8 *)&media_status); + rtw_hal_set_hwreg(padapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status); } goto exit_mlmeext_joinbss_event_callback; @@ -9377,7 +9377,7 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p correct_TSF(padapter, pmlmeext); /* start beacon */ - if (send_beacon(padapter)==_FAIL) + if (send_beacon(padapter) ==_FAIL) { pmlmeinfo->FW_sta_info[psta->mac_id].status = 0; @@ -9452,11 +9452,11 @@ static void _linked_rx_signal_strehgth_display(struct adapter *padapter) int UndecoratedSmoothedPWDB; if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) { - mac_id=0; + mac_id =0; } else if ((pmlmeinfo->state&0x03) == _HW_STATE_AP_) { - mac_id=2; + mac_id =2; } rtw_hal_get_def_var(padapter, HW_DEF_RA_INFO_DUMP,&mac_id); @@ -9525,7 +9525,7 @@ void linked_status_chk(struct adapter *padapter) tx_chk = _FAIL; if (pmlmeext->active_keep_alive_check && (rx_chk == _FAIL || tx_chk == _FAIL)) { - u8 backup_oper_channel=0; + u8 backup_oper_channel =0; /* switch to correct channel of current network before issue keep-alive frames */ if (rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) { @@ -9592,7 +9592,7 @@ void linked_status_chk(struct adapter *padapter) { psta = pmlmeinfo->FW_sta_info[i].psta; - if (NULL==psta) continue; + if (NULL ==psta) continue; if (pmlmeinfo->FW_sta_info[i].rx_pkt == sta_rx_pkts(psta)) { @@ -9628,10 +9628,10 @@ void survey_timer_hdl(struct adapter *padapter) { struct cmd_obj *ph2c; struct sitesurvey_parm *psurveyPara; - struct cmd_priv *pcmdpriv=&padapter->cmdpriv; + struct cmd_priv *pcmdpriv =&padapter->cmdpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; #ifdef CONFIG_P2P - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* issue rtw_sitesurvey_cmd */ @@ -9746,10 +9746,10 @@ void addba_timer_hdl(struct sta_info *psta) phtpriv = &psta->htpriv; - if ((phtpriv->ht_option==true) && (phtpriv->ampdu_enable==true)) + if ((phtpriv->ht_option ==true) && (phtpriv->ampdu_enable ==true)) { if (phtpriv->candidate_tid_bitmap) - phtpriv->candidate_tid_bitmap=0x0; + phtpriv->candidate_tid_bitmap =0x0; } } @@ -9841,7 +9841,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf) rtw_joinbss_reset(padapter); pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; - pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; + pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; pmlmeinfo->ERP_enable = 0; pmlmeinfo->WMM_enable = 0; pmlmeinfo->HT_enable = 0; @@ -9919,7 +9919,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) rtw_joinbss_reset(padapter); pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; - pmlmeext->cur_ch_offset= HAL_PRIME_CHNL_OFFSET_DONT_CARE; + pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; pmlmeinfo->ERP_enable = 0; pmlmeinfo->WMM_enable = 0; pmlmeinfo->HT_enable = 0; @@ -10092,9 +10092,9 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c /* acquire channels from in */ j = 0; - for (i=0;ichannel_set, in[i].hw_value)) >=0 + && (set_idx =rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value)) >=0 ) { memcpy(&out[j], &in[i], sizeof(struct rtw_ieee80211_channel)); @@ -10110,7 +10110,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c /* if out is empty, use channel_set as default */ if (j == 0) { - for (i=0;imax_chan_nums;i++) { + for (i =0;imax_chan_nums;i++) { out[i].hw_value = pmlmeext->channel_set[i].ChannelNum; if (pmlmeext->channel_set[i].ScanType == SCAN_PASSIVE) @@ -10121,7 +10121,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c } if (padapter->setband == GHZ_24) { /* 2.4G */ - for (i=0; i < j ; i++) { + for (i =0; i < j ; i++) { if (out[i].hw_value > 35) memset(&out[i], 0 , sizeof(struct rtw_ieee80211_channel)); else @@ -10129,7 +10129,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c } j = scan_ch_num; } else if (padapter->setband == GHZ_50) { /* 5G */ - for (i=0; i < j ; i++) { + for (i =0; i < j ; i++) { if (out[i].hw_value > 35) { memcpy(&out[scan_ch_num++], &out[i], sizeof(struct rtw_ieee80211_channel)); } @@ -10160,12 +10160,12 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) pmlmeext->sitesurvey_res.bss_cnt = 0; pmlmeext->sitesurvey_res.channel_idx = 0; - for (i=0;issid[i].SsidLength) { memcpy(pmlmeext->sitesurvey_res.ssid[i].Ssid, pparm->ssid[i].Ssid, IW_ESSID_MAX_SIZE); - pmlmeext->sitesurvey_res.ssid[i].SsidLength= pparm->ssid[i].SsidLength; + pmlmeext->sitesurvey_res.ssid[i].SsidLength = pparm->ssid[i].SsidLength; } else { - pmlmeext->sitesurvey_res.ssid[i].SsidLength= 0; + pmlmeext->sitesurvey_res.ssid[i].SsidLength = 0; } } @@ -10273,7 +10273,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf) u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) { - u16 ctrl=0; + u16 ctrl =0; u8 cam_id;/* cam_entry */ struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -10284,13 +10284,13 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) /* for concurrent mode (ap+sta): */ /* default key is disable, using sw encrypt/decrypt */ - /* cam_entry = 4 for sta mode (macid=0) */ - /* cam_entry(macid+3) = 5 ~ N for ap mode (aid=1~N, macid=2 ~N) */ + /* cam_entry = 4 for sta mode (macid =0) */ + /* cam_entry(macid+3) = 5 ~ N for ap mode (aid =1~N, macid =2 ~N) */ /* for concurrent mode (sta+sta): */ /* default key is disable, using sw encrypt/decrypt */ - /* cam_entry = 4 mapping to macid=0 */ - /* cam_entry = 5 mapping to macid=2 */ + /* cam_entry = 4 mapping to macid =0 */ + /* cam_entry = 5 mapping to macid =2 */ cam_id = 4; @@ -10313,17 +10313,17 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) { ctrl = (BIT(15) | ((pparm->algorithm) << 2)); - DBG_871X("r871x_set_stakey_hdl(): enc_algorithm=%d\n", pparm->algorithm); + DBG_871X("r871x_set_stakey_hdl(): enc_algorithm =%d\n", pparm->algorithm); if ((psta->mac_id<1) || (psta->mac_id>(NUM_STA-4))) { - DBG_871X("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid)=%d\n", psta->mac_id); + DBG_871X("r871x_set_stakey_hdl():set_stakey failed, mac_id(aid) =%d\n", psta->mac_id); return H2C_REJECTED; } - cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id=macid + 3, macid=aid+1; */ + cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id =macid + 3, macid =aid+1; */ - DBG_871X("Write CAM, mac_addr=%x:%x:%x:%x:%x:%x, cam_entry=%d\n", pparm->addr[0], + DBG_871X("Write CAM, mac_addr =%x:%x:%x:%x:%x:%x, cam_entry =%d\n", pparm->addr[0], pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4], pparm->addr[5], cam_id); @@ -10398,14 +10398,14 @@ u8 set_tx_beacon_cmd(struct adapter* padapter) if ((ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj))) == NULL) { - res= _FAIL; + res = _FAIL; goto exit; } if ((ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param))) == NULL) { rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -10449,7 +10449,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) /* checking event sequence... */ if (evt_seq != (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f) ) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("Evetn Seq Error! %d vs %d\n", (evt_seq & 0x7f), (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f))); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("Evetn Seq Error! %d vs %d\n", (evt_seq & 0x7f), (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f))); pevt_priv->event_seq = (evt_seq+1)&0x7f; @@ -10460,7 +10460,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) /* checking if event code is valid */ if (evt_code >= MAX_C2HEVT) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nEvent Code(%d) mismatch!\n", evt_code)); + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nEvent Code(%d) mismatch!\n", evt_code)); goto _abort_event_; } @@ -10469,7 +10469,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) (wlanevents[evt_code].parmsize != evt_sz)) { - RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nEvent(%d) Parm Size mismatch (%d vs %d)!\n", + RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nEvent(%d) Parm Size mismatch (%d vs %d)!\n", evt_code, wlanevents[evt_code].parmsize, evt_sz)); goto _abort_event_; @@ -10500,7 +10500,7 @@ u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf) u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) { - if (send_beacon(padapter)==_FAIL) + if (send_beacon(padapter) ==_FAIL) { DBG_871X("issue_beacon, fail!\n"); return H2C_PARAMETERS_ERROR; @@ -10511,7 +10511,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) unsigned long irqL; struct sta_info *psta_bmc; struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; + struct xmit_frame *pxmitframe =NULL; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct sta_priv *pstapriv = &padapter->stapriv; @@ -10542,7 +10542,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) else pxmitframe->attrib.mdata = 0; - pxmitframe->attrib.triggered=1; + pxmitframe->attrib.triggered =1; pxmitframe->attrib.qsel = 0x11;/* HIQ */ @@ -10575,7 +10575,7 @@ int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset } if (connect_allow == true) { - DBG_871X("start_join_set_ch_bw: ch=%d, bwmode=%d, ch_offset=%d\n", cur_ch, cur_bw, cur_ch_offset); + DBG_871X("start_join_set_ch_bw: ch =%d, bwmode =%d, ch_offset =%d\n", cur_ch, cur_bw, cur_ch_offset); *ch = cur_ch; *bw = cur_bw; *offset = cur_ch_offset; diff --git a/core/rtw_odm.c b/core/rtw_odm.c index b747b16..d22aacf 100644 --- a/core/rtw_odm.c +++ b/core/rtw_odm.c @@ -111,7 +111,7 @@ int _rtw_odm_dbg_comp_msg(struct adapter *adapter, char *buf, int len) rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp); cnt += snprintf(buf+cnt, len-cnt, "odm.DebugComponents = 0x%016llx\n", dbg_comp); - for (i=0;ipadapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -623,7 +623,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -736,7 +736,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunneled) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -909,7 +909,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = NULL; struct mlme_priv *pmlmepriv = NULL; struct wifi_display_info *pwfd_info = NULL; @@ -1016,7 +1016,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1114,7 +1114,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1212,7 +1212,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1311,7 +1311,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1410,7 +1410,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1523,7 +1523,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1636,7 +1636,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1735,7 +1735,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; + u32 len =0, wfdielen = 0; struct adapter *padapter = pwdinfo->padapter; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; @@ -1836,7 +1836,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; - u32 len=0, p2pielen = 0; + u32 len =0, p2pielen = 0; /* P2P OUI */ p2pielen = 0; @@ -1988,7 +1988,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8* pssid, u8 ussidlen, u8* pdev_raddr ) { u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; - u32 len=0, p2pielen = 0; + u32 len =0, p2pielen = 0; /* P2P OUI */ p2pielen = 0; @@ -2122,7 +2122,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status_code) { u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; - u32 len=0, p2pielen = 0; + u32 len =0, p2pielen = 0; /* P2P OUI */ p2pielen = 0; @@ -2154,7 +2154,7 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status u32 build_deauth_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { - u32 len=0; + u32 len =0; return len; } @@ -2162,10 +2162,10 @@ u32 build_deauth_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len) { u8 *p; - u32 ret=false; + u32 ret =false; u8 *p2pie; u32 p2pielen = 0; - int ssid_len=0, rate_cnt = 0; + int ssid_len =0, rate_cnt = 0; p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SUPPORTEDRATES_IE_, (int *)&rate_cnt, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); @@ -2213,7 +2213,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l ssid_len &= 0xff; /* Just last 1 byte is valid for ssid len of the probe request */ if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - if ((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen))) + if ((p2pie =rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen))) { if ( (p != NULL) && _rtw_memcmp( ( void * ) ( p+2 ), ( void * ) pwdinfo->p2p_wildcard_ssid , 7 )) { @@ -2243,10 +2243,10 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len, struct sta_info *psta) { u8 status_code = P2P_STATUS_SUCCESS; - u8 *pbuf, *pattr_content=NULL; + u8 *pbuf, *pattr_content =NULL; u32 attr_contentlen = 0; - u16 cap_attr=0; - unsigned short frame_type, ie_offset=0; + u16 cap_attr =0; + unsigned short frame_type, ie_offset =0; u8 * ies; u32 ies_len; u8 * p2p_ie; @@ -2322,7 +2322,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l num_of_secdev_type = *pattr_content; pattr_content += 1; - if (num_of_secdev_type==0) + if (num_of_secdev_type ==0) { psta->num_of_secdev_type = 0; } @@ -2341,7 +2341,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l /* dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8); */ - psta->dev_name_len=0; + psta->dev_name_len =0; if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16*)pattr_content)) { dev_name_len = be16_to_cpu(*(__be16*)(pattr_content+2)); @@ -2381,7 +2381,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le dialogToken = frame_body[7]; status = P2P_STATUS_FAIL_UNKNOWN_P2PGROUP; - if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) + if ( (p2p_ie =rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)) ) { u8 groupid[ 38 ] = { 0x00 }; u8 dev_addr[ETH_ALEN] = { 0x00 }; @@ -2392,7 +2392,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le if (_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) && _rtw_memcmp(pwdinfo->p2p_group_ssid, groupid+ETH_ALEN, pwdinfo->p2p_group_ssid_len)) { - attr_contentlen=0; + attr_contentlen =0; if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) { unsigned long irqL; @@ -2451,7 +2451,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le issue_p2p_devdisc_resp(pwdinfo, GetAddr2Ptr(pframe), status, dialogToken); - return (status==P2P_STATUS_SUCCESS) ? true:false; + return (status ==P2P_STATUS_SUCCESS) ? true:false; } @@ -2470,7 +2470,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l frame_body = (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); - if ( (wpsie=rtw_get_wps_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) + if ( (wpsie =rtw_get_wps_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) { if ( rtw_get_wps_attr_content( wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , ( u8 *)&be_tmp, &attr_contentlen) ) { @@ -2590,7 +2590,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe #endif /* CONFIG_P2P */ __be16 be_tmp; - if ( (wpsie=rtw_get_wps_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) + if ( (wpsie =rtw_get_wps_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) { /* Commented by Kurt 20120113 */ /* If some device wants to do p2p handshake without sending prov_disc_req */ @@ -3117,7 +3117,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint len) { u8 *frame_body; - u8 dialogToken=0; + u8 dialogToken =0; u8 status = P2P_STATUS_SUCCESS; frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); @@ -3233,7 +3233,7 @@ static void ro_ch_handler(struct adapter *padapter) rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); #ifdef CONFIG_DEBUG_CFG80211 - DBG_871X("%s, role=%d, p2p_state=%d\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo)); + DBG_871X("%s, role =%d, p2p_state =%d\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo)); #endif pcfg80211_wdinfo->is_ro_ch = false; @@ -3301,7 +3301,7 @@ static void rtw_change_p2pie_ch_list(struct adapter *padapter, const u8 *frame_b u8 *pattr = NULL; /* Check P2P_ATTR_CH_LIST */ - if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL) { + if ((pattr =rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL) { int i; u32 num_of_ch; u8 *pattr_temp = pattr + 3 ; @@ -3311,7 +3311,7 @@ static void rtw_change_p2pie_ch_list(struct adapter *padapter, const u8 *frame_b while (attr_contentlen>0) { num_of_ch = *(pattr_temp+1); - for (i=0; irtw_wdev); @@ -3423,7 +3423,7 @@ void rtw_append_wfd_ie(struct adapter *padapter, u8 *buf, u32* len) dialogToken = frame_body[6]; #ifdef CONFIG_DEBUG_CFG80211 - DBG_871X("ACTION_CATEGORY_P2P: OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n", + DBG_871X("ACTION_CATEGORY_P2P: OUI =0x%x, OUI_Subtype =%d, dialogToken =%d\n", cpu_to_be32( *( ( u32* ) ( frame_body + 1 ) ) ), OUI_Subtype, dialogToken); #endif @@ -3449,7 +3449,7 @@ void rtw_append_wfd_ie(struct adapter *padapter, u8 *buf, u32* len) } else { - DBG_871X("%s, action frame category=%d\n", __func__, category); + DBG_871X("%s, action frame category =%d\n", __func__, category); /* is_p2p_frame = (-1); */ } @@ -3466,7 +3466,7 @@ static u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_le u8 ch_list[40]; bool continuous = false; - if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, &attr_contentlen))!=NULL) { + if ((pattr =rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, &attr_contentlen))!=NULL) { int i, j; u32 num_of_ch; u8 *pattr_temp = pattr + 3 ; @@ -3478,8 +3478,8 @@ static u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_le while (attr_contentlen>0) { num_of_ch = *(pattr_temp+1); - for (i=0; irtw_wdev); @@ -3548,7 +3548,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx dialogToken = frame_body[7]; is_p2p_frame = OUI_Subtype; #ifdef CONFIG_DEBUG_CFG80211 - DBG_871X("ACTION_CATEGORY_PUBLIC: ACT_PUBLIC_VENDOR, OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n", + DBG_871X("ACTION_CATEGORY_PUBLIC: ACT_PUBLIC_VENDOR, OUI =0x%x, OUI_Subtype =%d, dialogToken =%d\n", cpu_to_be32( *( ( u32* ) ( frame_body + 2 ) ) ), OUI_Subtype, dialogToken); #endif @@ -3591,8 +3591,8 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx nego_info->state = 0; dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); - DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s\n", - (tx==true)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", listen_ch, op_ch, ch_list_buf); + DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken =%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s\n", + (tx ==true)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", listen_ch, op_ch, ch_list_buf); break; } case P2P_GO_NEGO_RESP: @@ -3609,8 +3609,8 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx if (nego_info->token == dialogToken && nego_info->state == 0 && _rtw_memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : GetAddr2Ptr(buf), ETH_ALEN) == true ) { - nego_info->status = (status==-1) ? 0xff : status; - nego_info->rsp_op_ch= op_ch; + nego_info->status = (status ==-1) ? 0xff : status; + nego_info->rsp_op_ch = op_ch; nego_info->rsp_intent = intent; nego_info->state = 1; if (status != 0) @@ -3618,8 +3618,8 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx } dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); - DBG_871X("RTW_%s:P2P_GO_NEGO_RESP, dialogToken=%d, intent:%u%s, status:%d, op_ch:%d, ch_list:%s\n", - (tx==true)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", status, op_ch, ch_list_buf); + DBG_871X("RTW_%s:P2P_GO_NEGO_RESP, dialogToken =%d, intent:%u%s, status:%d, op_ch:%d, ch_list:%s\n", + (tx ==true)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", status, op_ch, ch_list_buf); if (!tx) { pwdev_priv->provdisc_req_issued = false; @@ -3640,8 +3640,8 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx if (nego_info->token == dialogToken && nego_info->state == 1 && _rtw_memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : GetAddr2Ptr(buf), ETH_ALEN) == true ) { - nego_info->status = (status==-1) ? 0xff : status; - nego_info->conf_op_ch = (op_ch==-1) ? 0 : op_ch; + nego_info->status = (status ==-1) ? 0xff : status; + nego_info->conf_op_ch = (op_ch ==-1) ? 0 : op_ch; nego_info->state = 2; if (status == 0) { @@ -3653,8 +3653,8 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx } dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); - DBG_871X("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s\n", - (tx==true)?"Tx":"Rx", dialogToken, status, op_ch, ch_list_buf); + DBG_871X("RTW_%s:P2P_GO_NEGO_CONF, dialogToken =%d, status:%d, op_ch:%d, ch_list:%s\n", + (tx ==true)?"Tx":"Rx", dialogToken, status, op_ch, ch_list_buf); break; } case P2P_INVIT_REQ: @@ -3673,13 +3673,13 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx memcpy(invit_info->peer_mac, tx ? GetAddr1Ptr(buf) : GetAddr2Ptr(buf), ETH_ALEN); invit_info->active = tx ? 1 : 0; invit_info->token = dialogToken; - invit_info->flags = (flags==-1) ? 0x0 : flags; - invit_info->req_op_ch= op_ch; + invit_info->flags = (flags ==-1) ? 0x0 : flags; + invit_info->req_op_ch = op_ch; invit_info->state = 0; dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); - DBG_871X("RTW_%s:P2P_INVIT_REQ, dialogToken=%d, flags:0x%02x, op_ch:%d, ch_list:%s\n", - (tx==true)?"Tx":"Rx", dialogToken, flags, op_ch, ch_list_buf); + DBG_871X("RTW_%s:P2P_INVIT_REQ, dialogToken =%d, flags:0x%02x, op_ch:%d, ch_list:%s\n", + (tx ==true)?"Tx":"Rx", dialogToken, flags, op_ch, ch_list_buf); break; } @@ -3690,7 +3690,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len))) { #ifdef CONFIG_P2P_INVITE_IOT - if (tx && *cont==7) + if (tx && *cont ==7) { DBG_871X("TX_P2P_INVITE_RESP, status is no common channel, change to unknown group\n"); *cont = 8; /* unknow group status */ @@ -3704,15 +3704,15 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx if (invit_info->token == dialogToken && invit_info->state == 0 && _rtw_memcmp(invit_info->peer_mac, tx ? GetAddr1Ptr(buf) : GetAddr2Ptr(buf), ETH_ALEN) == true ) { - invit_info->status = (status==-1) ? 0xff : status; - invit_info->rsp_op_ch= op_ch; + invit_info->status = (status ==-1) ? 0xff : status; + invit_info->rsp_op_ch = op_ch; invit_info->state = 1; invit_info->token = 0; /* init */ } dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); - DBG_871X("RTW_%s:P2P_INVIT_RESP, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s\n", - (tx==true)?"Tx":"Rx", dialogToken, status, op_ch, ch_list_buf); + DBG_871X("RTW_%s:P2P_INVIT_RESP, dialogToken =%d, status:%d, op_ch:%d, ch_list:%s\n", + (tx ==true)?"Tx":"Rx", dialogToken, status, op_ch, ch_list_buf); if (!tx) { } @@ -3720,11 +3720,11 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx break; } case P2P_DEVDISC_REQ: - DBG_871X("RTW_%s:P2P_DEVDISC_REQ, dialogToken=%d\n", (tx==true)?"Tx":"Rx", dialogToken); + DBG_871X("RTW_%s:P2P_DEVDISC_REQ, dialogToken =%d\n", (tx ==true)?"Tx":"Rx", dialogToken); break; case P2P_DEVDISC_RESP: cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len); - DBG_871X("RTW_%s:P2P_DEVDISC_RESP, dialogToken=%d, status:%d\n", (tx==true)?"Tx":"Rx", dialogToken, cont?*cont:-1); + DBG_871X("RTW_%s:P2P_DEVDISC_RESP, dialogToken =%d, status:%d\n", (tx ==true)?"Tx":"Rx", dialogToken, cont?*cont:-1); break; case P2P_PROVISION_DISC_REQ: { @@ -3733,13 +3733,13 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx uint p2p_ielen = 0; uint contentlen = 0; - DBG_871X("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx==true)?"Tx":"Rx", dialogToken); + DBG_871X("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken =%d\n", (tx ==true)?"Tx":"Rx", dialogToken); /* if (tx) */ { pwdev_priv->provdisc_req_issued = false; - if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen))) + if ( (p2p_ie =rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen))) { if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen)) @@ -3759,10 +3759,10 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx } break; case P2P_PROVISION_DISC_RESP: - DBG_871X("RTW_%s:P2P_PROVISION_DISC_RESP, dialogToken=%d\n", (tx==true)?"Tx":"Rx", dialogToken); + DBG_871X("RTW_%s:P2P_PROVISION_DISC_RESP, dialogToken =%d\n", (tx ==true)?"Tx":"Rx", dialogToken); break; default: - DBG_871X("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx==true)?"Tx":"Rx", OUI_Subtype, dialogToken); + DBG_871X("RTW_%s:OUI_Subtype =%d, dialogToken =%d\n", (tx ==true)?"Tx":"Rx", OUI_Subtype, dialogToken); break; } @@ -3775,7 +3775,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx dialogToken = frame_body[6]; #ifdef CONFIG_DEBUG_CFG80211 - DBG_871X("ACTION_CATEGORY_P2P: OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n", + DBG_871X("ACTION_CATEGORY_P2P: OUI =0x%x, OUI_Subtype =%d, dialogToken =%d\n", cpu_to_be32( *( ( u32* ) ( frame_body + 1 ) ) ), OUI_Subtype, dialogToken); #endif @@ -3784,26 +3784,26 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx switch (OUI_Subtype) { case P2P_NOTICE_OF_ABSENCE: - DBG_871X("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken=%d\n", (tx==true)?"TX":"RX", dialogToken); + DBG_871X("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken =%d\n", (tx ==true)?"TX":"RX", dialogToken); break; case P2P_PRESENCE_REQUEST: - DBG_871X("RTW_%s:P2P_PRESENCE_REQUEST, dialogToken=%d\n", (tx==true)?"TX":"RX", dialogToken); + DBG_871X("RTW_%s:P2P_PRESENCE_REQUEST, dialogToken =%d\n", (tx ==true)?"TX":"RX", dialogToken); break; case P2P_PRESENCE_RESPONSE: - DBG_871X("RTW_%s:P2P_PRESENCE_RESPONSE, dialogToken=%d\n", (tx==true)?"TX":"RX", dialogToken); + DBG_871X("RTW_%s:P2P_PRESENCE_RESPONSE, dialogToken =%d\n", (tx ==true)?"TX":"RX", dialogToken); break; case P2P_GO_DISC_REQUEST: - DBG_871X("RTW_%s:P2P_GO_DISC_REQUEST, dialogToken=%d\n", (tx==true)?"TX":"RX", dialogToken); + DBG_871X("RTW_%s:P2P_GO_DISC_REQUEST, dialogToken =%d\n", (tx ==true)?"TX":"RX", dialogToken); break; default: - DBG_871X("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx==true)?"TX":"RX", OUI_Subtype, dialogToken); + DBG_871X("RTW_%s:OUI_Subtype =%d, dialogToken =%d\n", (tx ==true)?"TX":"RX", OUI_Subtype, dialogToken); break; } } else { - DBG_871X("RTW_%s:action frame category=%d\n", (tx==true)?"TX":"RX", category); + DBG_871X("RTW_%s:action frame category =%d\n", (tx ==true)?"TX":"RX", category); } return is_p2p_frame; @@ -3820,7 +3820,7 @@ void rtw_init_cfg80211_wifidirect_info( struct adapter* padapter) void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType) { - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); switch (intCmdType) @@ -3962,7 +3962,7 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) void p2p_ps_wk_hdl(struct adapter *padapter, u8 p2p_ps_state) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); /* Pre action for p2p state */ @@ -4021,7 +4021,7 @@ u8 p2p_ps_wk_cmd(struct adapter*padapter, u8 p2p_ps_state, u8 enqueue) { struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; @@ -4032,15 +4032,15 @@ u8 p2p_ps_wk_cmd(struct adapter*padapter, u8 p2p_ps_state, u8 enqueue) if (enqueue) { ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if (ph2c==NULL){ - res= _FAIL; + if (ph2c ==NULL){ + res = _FAIL; goto exit; } pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); - if (pdrvextra_cmd_parm==NULL){ + if (pdrvextra_cmd_parm ==NULL){ rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj)); - res= _FAIL; + res = _FAIL; goto exit; } @@ -4479,7 +4479,7 @@ void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, co int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) { int ret = _SUCCESS; - struct wifidirect_info *pwdinfo= &(padapter->wdinfo); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); if (role == P2P_ROLE_DEVICE || role == P2P_ROLE_CLIENT|| role == P2P_ROLE_GO) { @@ -4500,9 +4500,9 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) /* Enable P2P function */ init_wifidirect_info(padapter, role); - rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,true); + rtw_hal_set_odm_var(padapter, HAL_ODM_P2P_STATE, NULL, true); #ifdef CONFIG_P2P - rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,true); + rtw_hal_set_odm_var(padapter, HAL_ODM_WIFI_DISPLAY_STATE, NULL, true); #endif } @@ -4532,9 +4532,9 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info)); } - rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,false); + rtw_hal_set_odm_var(padapter, HAL_ODM_P2P_STATE, NULL, false); #ifdef CONFIG_P2P - rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,false); + rtw_hal_set_odm_var(padapter, HAL_ODM_WIFI_DISPLAY_STATE, NULL, false); #endif /* Restore to initial setting. */ diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index a6faf03..aae1009 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -45,7 +45,7 @@ void _ips_enter(struct adapter * padapter) pwrpriv->ips_mode = pwrpriv->ips_mode_req; pwrpriv->ips_enter_cnts++; - DBG_871X("==>ips_enter cnts:%d\n",pwrpriv->ips_enter_cnts); + DBG_871X("==>ips_enter cnts:%d\n", pwrpriv->ips_enter_cnts); #ifdef CONFIG_BT_COEXIST BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter); #endif @@ -83,14 +83,14 @@ int _ips_leave(struct adapter * padapter) pwrpriv->bips_processing = true; pwrpriv->change_rfpwrstate = rf_on; pwrpriv->ips_leave_cnts++; - DBG_871X("==>ips_leave cnts:%d\n",pwrpriv->ips_leave_cnts); + DBG_871X("==>ips_leave cnts:%d\n", pwrpriv->ips_leave_cnts); if ((result = rtw_ips_pwr_up(padapter)) == _SUCCESS) { pwrpriv->rf_pwrstate = rf_on; } DBG_871X_LEVEL(_drv_always_, "nolinked power save leave\n"); - DBG_871X("==> ips_leave.....LED(0x%08x)...\n",rtw_read32(padapter,0x4c)); + DBG_871X("==> ips_leave.....LED(0x%08x)...\n", rtw_read32(padapter, 0x4c)); pwrpriv->bips_processing = false; pwrpriv->bkeepfwalive = false; @@ -175,7 +175,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter) #endif #ifdef CONFIG_INTEL_PROXIM - if (adapter->proximity.proxim_on==true){ + if (adapter->proximity.proxim_on ==true){ return; } #endif @@ -208,7 +208,7 @@ void rtw_ps_processor(struct adapter*padapter) if (pwrpriv->bips_processing == true) goto exit; - /* DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca)); */ + /* DBG_871X("==> fw report state(0x%x)\n", rtw_read8(padapter, 0x1ca)); */ if (pwrpriv->bHWPwrPindetect) { #ifdef CONFIG_AUTOSUSPEND @@ -220,7 +220,7 @@ void rtw_ps_processor(struct adapter*padapter) pwrpriv->ps_flag = true; rfpwrstate = RfOnOffDetect(padapter); - DBG_871X("@@@@- #1 %s==> rfstate:%s\n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off"); + DBG_871X("@@@@- #1 %s ==> rfstate:%s\n", __FUNCTION__, (rfpwrstate ==rf_on)?"rf_on":"rf_off"); if (rfpwrstate!= pwrpriv->rf_pwrstate) { if (rfpwrstate == rf_off) @@ -239,7 +239,7 @@ void rtw_ps_processor(struct adapter*padapter) #endif /* CONFIG_AUTOSUSPEND */ { rfpwrstate = RfOnOffDetect(padapter); - DBG_871X("@@@@- #2 %s==> rfstate:%s\n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off"); + DBG_871X("@@@@- #2 %s ==> rfstate:%s\n", __FUNCTION__, (rfpwrstate ==rf_on)?"rf_on":"rf_off"); if (rfpwrstate!= pwrpriv->rf_pwrstate) { @@ -255,7 +255,7 @@ void rtw_ps_processor(struct adapter*padapter) pwrpriv->change_rfpwrstate = rf_on; rtw_hw_resume(padapter ); } - DBG_871X("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on"); + DBG_871X("current rf_pwrstate(%s)\n", (pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on"); } } pwrpriv->pwr_state_check_cnts ++; @@ -267,9 +267,9 @@ void rtw_ps_processor(struct adapter*padapter) if (rtw_pwr_unassociated_idle(padapter) == false) goto exit; - if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0)) + if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) ==0)) { - DBG_871X("==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv)); + DBG_871X("==>%s .fw_state(%x)\n", __FUNCTION__, get_fwstate(pmlmepriv)); #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) #else pwrpriv->change_rfpwrstate = rf_off; @@ -284,12 +284,12 @@ void rtw_ps_processor(struct adapter*padapter) pwrpriv->ps_flag = true; #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) - if (true==pwrpriv->bInternalAutoSuspend) { - DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend); + if (true ==pwrpriv->bInternalAutoSuspend) { + DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n", __FUNCTION__, pwrpriv->bInternalAutoSuspend); } else { pwrpriv->change_rfpwrstate = rf_off; padapter->bCardDisableWOHSM = true; - DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend); + DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n", __FUNCTION__, pwrpriv->bInternalAutoSuspend); autosuspend_enter(padapter); } #else @@ -352,8 +352,8 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) } if ((pwrpriv->rpwm == pslv)) { - RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_, - ("%s: Already set rpwm[0x%02X], new=0x%02X!\n", __FUNCTION__, pwrpriv->rpwm, pslv)); + RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_, + ("%s: Already set rpwm[0x%02X], new =0x%02X!\n", __FUNCTION__, pwrpriv->rpwm, pslv)); return; } @@ -383,7 +383,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) rpwm = pslv | pwrpriv->tog; RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_, - ("rtw_set_rpwm: rpwm=0x%02x cpwm=0x%02x\n", rpwm, pwrpriv->cpwm)); + ("rtw_set_rpwm: rpwm =0x%02x cpwm =0x%02x\n", rpwm, pwrpriv->cpwm)); pwrpriv->rpwm = pslv; @@ -471,11 +471,11 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a #endif /* CONFIG_P2P */ RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_, - ("%s: PowerMode=%d Smart_PS=%d\n", + ("%s: PowerMode =%d Smart_PS =%d\n", __FUNCTION__, ps_mode, smart_ps)); if (ps_mode > PM_Card_Disable) { - RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_,("ps_mode:%d error\n", ps_mode)); + RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_, ("ps_mode:%d error\n", ps_mode)); return; } @@ -634,7 +634,7 @@ void LeaveAllPowerSaveMode(struct adapter *Adapter) ; - /* DBG_871X("%s.....\n",__FUNCTION__); */ + /* DBG_871X("%s.....\n", __FUNCTION__); */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { /* connect */ #ifdef CONFIG_P2P @@ -643,14 +643,14 @@ void LeaveAllPowerSaveMode(struct adapter *Adapter) rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue); } else { - if (adapter_to_pwrctl(Adapter)->rf_pwrstate== rf_off) + if (adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off) { #ifdef CONFIG_AUTOSUSPEND if (Adapter->registrypriv.usbss_enable) { - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35)) + #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2, 6, 35)) usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev); - #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,34)) + #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2, 6, 22) && LINUX_VERSION_CODE<=KERNEL_VERSION(2, 6, 34)) adapter_to_dvobj(Adapter)->pusbdev->autosuspend_disabled = Adapter->bDisableAutosuspend;/* autosuspend disabled by the user */ #endif } @@ -667,8 +667,8 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) _init_pwrlock(&pwrctrlpriv->lock); pwrctrlpriv->rf_pwrstate = rf_on; - pwrctrlpriv->ips_enter_cnts=0; - pwrctrlpriv->ips_leave_cnts=0; + pwrctrlpriv->ips_enter_cnts =0; + pwrctrlpriv->ips_leave_cnts =0; pwrctrlpriv->bips_processing = false; pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode; @@ -750,7 +750,7 @@ extern int rtw_resume_process(struct adapter *padapter); static void rtw_early_suspend(struct early_suspend *h) { struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); rtw_set_do_late_resume(pwrpriv, false); } @@ -761,7 +761,7 @@ static void rtw_late_resume(struct early_suspend *h) struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv); struct adapter *adapter = dvobj->if1; - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); if (pwrpriv->do_late_resume) { rtw_set_do_late_resume(pwrpriv, false); rtw_resume_process(adapter); @@ -798,7 +798,7 @@ extern int rtw_resume_process(struct adapter *padapter); static void rtw_early_suspend(android_early_suspend_t *h) { struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); rtw_set_do_late_resume(pwrpriv, false); } @@ -809,7 +809,7 @@ static void rtw_late_resume(android_early_suspend_t *h) struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv); struct adapter *adapter = dvobj->if1; - DBG_871X("%s\n",__FUNCTION__); + DBG_871X("%s\n", __FUNCTION__); if (pwrpriv->do_late_resume) { rtw_set_do_late_resume(pwrpriv, false); rtw_resume_process(adapter); @@ -841,10 +841,10 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) } #endif /* CONFIG_ANDROID_POWER */ -u8 rtw_interface_ps_func(struct adapter *padapter, enum HAL_INTF_PS_FUNC efunc_id,u8* val) +u8 rtw_interface_ps_func(struct adapter *padapter, enum HAL_INTF_PS_FUNC efunc_id, u8* val) { u8 bResult = true; - rtw_hal_intf_ps_func(padapter,efunc_id,val); + rtw_hal_intf_ps_func(padapter, efunc_id, val); return bResult; } @@ -923,14 +923,14 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { #if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) - if (true==pwrpriv->bInternalAutoSuspend){ - if (0==pwrpriv->autopm_cnt){ - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33)) + if (true ==pwrpriv->bInternalAutoSuspend){ + if (0 ==pwrpriv->autopm_cnt){ + #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2, 6, 33)) if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0) { DBG_871X( "can't get autopm:\n"); } - #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20)) + #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2, 6, 20)) usb_autopm_disable(adapter_to_dvobj(padapter)->pusbintf); #else usb_autoresume_device(adapter_to_dvobj(padapter)->pusbdev, 1); @@ -948,7 +948,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal if (rf_off == pwrpriv->rf_pwrstate ) { #ifdef CONFIG_AUTOSUSPEND - if (pwrpriv->brfoffbyhw==true) + if (pwrpriv->brfoffbyhw ==true) { DBG_8192C("hw still in rf_off state ...........\n"); ret = _FAIL; @@ -956,7 +956,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal } else if (padapter->registrypriv.usbss_enable) { - DBG_8192C("%s call autoresume_enter....\n",__FUNCTION__); + DBG_8192C("%s call autoresume_enter....\n", __FUNCTION__); if (_FAIL == autoresume_enter(padapter)) { DBG_8192C("======> autoresume fail.............\n"); @@ -967,7 +967,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal else #endif { - DBG_8192C("%s call ips_leave....\n",__FUNCTION__); + DBG_8192C("%s call ips_leave....\n", __FUNCTION__); if (_FAIL == ips_leave(padapter)) { DBG_8192C("======> ips_leave fail.............\n"); @@ -982,12 +982,12 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal || !padapter->bup || !padapter->hw_init_completed ){ - DBG_8192C("%s: bDriverStopped=%d, bup=%d, hw_init_completed=%u\n" + DBG_8192C("%s: bDriverStopped =%d, bup =%d, hw_init_completed =%u\n" , caller , padapter->bDriverStopped , padapter->bup , padapter->hw_init_completed); - ret= false; + ret = false; goto exit; } diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 9d36fa7..79e4327 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -61,7 +61,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) union recv_frame *precvframe; - sint res=_SUCCESS; + sint res =_SUCCESS; ; @@ -82,8 +82,8 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->pallocated_frame_buf = rtw_zvmalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); - if (precvpriv->pallocated_frame_buf==NULL){ - res= _FAIL; + if (precvpriv->pallocated_frame_buf ==NULL){ + res = _FAIL; goto exit; } /* memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */ @@ -95,7 +95,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvframe = (union recv_frame*) precvpriv->precv_frame_buf; - for (i=0; i < NR_RECVFRAME ; i++) + for (i =0; i < NR_RECVFRAME ; i++) { _rtw_init_listhead(&(precvframe->u.list)); @@ -109,7 +109,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvframe++; } - precvpriv->rx_pending_cnt=1; + precvpriv->rx_pending_cnt =1; _rtw_init_sema(&precvpriv->allrxreturnevt, 0); res = rtw_hal_init_recv_priv(padapter); @@ -164,9 +164,9 @@ union recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue) precvframe = LIST_CONTAINOR(plist, union recv_frame, u); rtw_list_delete(&precvframe->u.hdr.list); - padapter=precvframe->u.hdr.adapter; + padapter =precvframe->u.hdr.adapter; if (padapter !=NULL){ - precvpriv=&padapter->recvpriv; + precvpriv =&padapter->recvpriv; if (pfree_recv_queue == &precvpriv->free_recv_queue) precvpriv->free_recvframe_cnt--; } @@ -197,13 +197,13 @@ void rtw_init_recvframe(union recv_frame *precvframe, struct recv_priv *precvpri /* Perry: This can be removed */ _rtw_init_listhead(&precvframe->u.hdr.list); - precvframe->u.hdr.len=0; + precvframe->u.hdr.len =0; } int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue) { unsigned long irqL; - struct adapter *padapter=precvframe->u.hdr.adapter; + struct adapter *padapter =precvframe->u.hdr.adapter; struct recv_priv *precvpriv = &padapter->recvpriv; if (precvframe->u.hdr.pkt) { @@ -231,7 +231,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv sint _rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue) { - struct adapter *padapter=precvframe->u.hdr.adapter; + struct adapter *padapter =precvframe->u.hdr.adapter; struct recv_priv *precvpriv = &padapter->recvpriv; ; @@ -302,7 +302,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter) { u32 cnt = 0; union recv_frame *pending_frame; - while ((pending_frame=rtw_alloc_recvframe(&adapter->recvpriv.uc_swdec_pending_queue))) { + while ((pending_frame =rtw_alloc_recvframe(&adapter->recvpriv.uc_swdec_pending_queue))) { rtw_free_recvframe(pending_frame, &adapter->recvpriv.free_recv_queue); cnt++; } @@ -374,133 +374,133 @@ struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue) sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe); sint recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe){ - sint i,res=_SUCCESS; + sint i, res =_SUCCESS; u32 datalen; u8 miccode[8]; - u8 bmic_err=false,brpt_micerror = true; + u8 bmic_err =false, brpt_micerror = true; u8 *pframe, *payload,*pframemic; u8 *mickey; - /* u8 *iv,rxdata_key_idx=0; */ + /* u8 *iv, rxdata_key_idx =0; */ struct sta_info *stainfo; - struct rx_pkt_attrib *prxattrib=&precvframe->u.hdr.attrib; - struct security_priv *psecuritypriv=&adapter->securitypriv; + struct rx_pkt_attrib *prxattrib =&precvframe->u.hdr.attrib; + struct security_priv *psecuritypriv =&adapter->securitypriv; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); ; - stainfo=rtw_get_stainfo(&adapter->stapriv ,&prxattrib->ta[0]); + stainfo =rtw_get_stainfo(&adapter->stapriv ,&prxattrib->ta[0]); if (prxattrib->encrypt ==_TKIP_) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic:prxattrib->encrypt ==_TKIP_\n")); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic:da=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", - prxattrib->ra[0],prxattrib->ra[1],prxattrib->ra[2],prxattrib->ra[3],prxattrib->ra[4],prxattrib->ra[5])); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:prxattrib->encrypt ==_TKIP_\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:da =0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", + prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2], prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5])); /* calculate mic code */ if (stainfo!= NULL) { if (IS_MCAST(prxattrib->ra)) { - /* mickey=&psecuritypriv->dot118021XGrprxmickey.skey[0]; */ + /* mickey =&psecuritypriv->dot118021XGrprxmickey.skey[0]; */ /* iv = precvframe->u.hdr.rx_data+prxattrib->hdrlen; */ /* rxdata_key_idx =( ((iv[3])>>6)&0x3) ; */ - mickey=&psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0]; + mickey =&psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0]; - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n recvframe_chkmic: bcmc key\n")); - /* DBG_871X("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d),pmlmeinfo->key_index(%d) ,recv key_id(%d)\n", */ - /* psecuritypriv->dot118021XGrpKeyid,pmlmeinfo->key_index,rxdata_key_idx); */ + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic: bcmc key\n")); + /* DBG_871X("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d), pmlmeinfo->key_index(%d) , recv key_id(%d)\n", */ + /* psecuritypriv->dot118021XGrpKeyid, pmlmeinfo->key_index, rxdata_key_idx); */ - if (psecuritypriv->binstallGrpkey==false) + if (psecuritypriv->binstallGrpkey ==false) { - res=_FAIL; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n")); + res =_FAIL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n")); DBG_871X("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n"); goto exit; } } else{ - mickey=&stainfo->dot11tkiprxmickey.skey[0]; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n recvframe_chkmic: unicast key\n")); + mickey =&stainfo->dot11tkiprxmickey.skey[0]; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic: unicast key\n")); } - datalen=precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-prxattrib->icv_len-8;/* icv_len included the mic code */ - pframe=precvframe->u.hdr.rx_data; - payload=pframe+prxattrib->hdrlen+prxattrib->iv_len; + datalen =precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-prxattrib->icv_len-8;/* icv_len included the mic code */ + pframe =precvframe->u.hdr.rx_data; + payload =pframe+prxattrib->hdrlen+prxattrib->iv_len; - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n prxattrib->iv_len=%d prxattrib->icv_len=%d\n",prxattrib->iv_len,prxattrib->icv_len)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n prxattrib->iv_len =%d prxattrib->icv_len =%d\n", prxattrib->iv_len, prxattrib->icv_len)); - rtw_seccalctkipmic(mickey,pframe,payload, datalen ,&miccode[0],(unsigned char)prxattrib->priority); /* care the length of the data */ + rtw_seccalctkipmic(mickey, pframe, payload, datalen ,&miccode[0], (unsigned char)prxattrib->priority); /* care the length of the data */ - pframemic=payload+datalen; + pframemic =payload+datalen; - bmic_err=false; + bmic_err =false; - for (i=0;i<8;i++){ + for (i =0;i<8;i++){ if (miccode[i] != *(pframemic+i)){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chkmic:miccode[%d](%02x) != *(pframemic+%d)(%02x) ",i,miccode[i],i,*(pframemic+i))); - bmic_err=true; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic:miccode[%d](%02x) != *(pframemic+%d)(%02x) ", i, miccode[i], i,*(pframemic+i))); + bmic_err =true; } } - if (bmic_err==true){ + if (bmic_err ==true){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n *(pframemic-8)-*(pframemic-1)=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n *(pframemic-8)-*(pframemic-1) =0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", *(pframemic-8),*(pframemic-7),*(pframemic-6),*(pframemic-5),*(pframemic-4),*(pframemic-3),*(pframemic-2),*(pframemic-1))); - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n *(pframemic-16)-*(pframemic-9)=0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n *(pframemic-16)-*(pframemic-9) =0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n", *(pframemic-16),*(pframemic-15),*(pframemic-14),*(pframemic-13),*(pframemic-12),*(pframemic-11),*(pframemic-10),*(pframemic-9))); { uint i; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n ======demp packet (len=%d)======\n",precvframe->u.hdr.len)); - for (i=0;iu.hdr.len;i=i+8){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x", + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n ======demp packet (len =%d) ======\n", precvframe->u.hdr.len)); + for (i =0;iu.hdr.len;i =i+8){ + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x", *(precvframe->u.hdr.rx_data+i),*(precvframe->u.hdr.rx_data+i+1), *(precvframe->u.hdr.rx_data+i+2),*(precvframe->u.hdr.rx_data+i+3), *(precvframe->u.hdr.rx_data+i+4),*(precvframe->u.hdr.rx_data+i+5), *(precvframe->u.hdr.rx_data+i+6),*(precvframe->u.hdr.rx_data+i+7))); } - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n ======demp packet end [len=%d]======\n",precvframe->u.hdr.len)); - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("\n hrdlen=%d,\n",prxattrib->hdrlen)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n ======demp packet end [len =%d]======\n", precvframe->u.hdr.len)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n hrdlen =%d,\n", prxattrib->hdrlen)); } - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("ra=0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x psecuritypriv->binstallGrpkey=%d ", - prxattrib->ra[0],prxattrib->ra[1],prxattrib->ra[2], - prxattrib->ra[3],prxattrib->ra[4],prxattrib->ra[5],psecuritypriv->binstallGrpkey)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ra =0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x psecuritypriv->binstallGrpkey =%d ", + prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2], + prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5], psecuritypriv->binstallGrpkey)); /* double check key_index for some timing issue , */ /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */ - if ((IS_MCAST(prxattrib->ra)==true) && (prxattrib->key_index != pmlmeinfo->key_index )) + if ((IS_MCAST(prxattrib->ra) ==true) && (prxattrib->key_index != pmlmeinfo->key_index )) brpt_micerror = false; if ((prxattrib->bdecrypted ==true)&& (brpt_micerror == true)) { - rtw_handle_tkip_mic_err(adapter,(u8)IS_MCAST(prxattrib->ra)); - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" mic error :prxattrib->bdecrypted=%d ",prxattrib->bdecrypted)); - DBG_871X(" mic error :prxattrib->bdecrypted=%d\n",prxattrib->bdecrypted); + rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted =%d ", prxattrib->bdecrypted)); + DBG_871X(" mic error :prxattrib->bdecrypted =%d\n", prxattrib->bdecrypted); } else { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" mic error :prxattrib->bdecrypted=%d ",prxattrib->bdecrypted)); - DBG_871X(" mic error :prxattrib->bdecrypted=%d\n",prxattrib->bdecrypted); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted =%d ", prxattrib->bdecrypted)); + DBG_871X(" mic error :prxattrib->bdecrypted =%d\n", prxattrib->bdecrypted); } - res=_FAIL; + res =_FAIL; } else{ /* mic checked ok */ - if ((psecuritypriv->bcheck_grpkey ==false)&&(IS_MCAST(prxattrib->ra)==true)){ + if ((psecuritypriv->bcheck_grpkey ==false)&&(IS_MCAST(prxattrib->ra) ==true)){ psecuritypriv->bcheck_grpkey =true; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("psecuritypriv->bcheck_grpkey =true")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("psecuritypriv->bcheck_grpkey =true")); } } } else { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chkmic: rtw_get_stainfo==NULL!!!\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic: rtw_get_stainfo ==NULL!!!\n")); } recvframe_pull_tail(precvframe, 8); @@ -515,15 +515,15 @@ exit: } -/* decrypt and set the ivlen,icvlen of the recv_frame */ -static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *precv_frame) +/* decrypt and set the ivlen, icvlen of the recv_frame */ +static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *precv_frame) { struct rx_pkt_attrib *prxattrib = &precv_frame->u.hdr.attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - union recv_frame *return_packet=precv_frame; - u32 res=_SUCCESS; + struct security_priv *psecuritypriv =&padapter->securitypriv; + union recv_frame *return_packet =precv_frame; + u32 res =_SUCCESS; - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("prxstat->decrypted=%x prxattrib->encrypt = 0x%03x\n",prxattrib->bdecrypted,prxattrib->encrypt)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("prxstat->decrypted =%x prxattrib->encrypt = 0x%03x\n", prxattrib->bdecrypted, prxattrib->encrypt)); if (prxattrib->encrypt>0) { u8 *iv = precv_frame->u.hdr.rx_data+prxattrib->hdrlen; @@ -547,13 +547,13 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr } } - if ((prxattrib->encrypt>0) && ((prxattrib->bdecrypted==0) ||(psecuritypriv->sw_decrypt==true))) + if ((prxattrib->encrypt>0) && ((prxattrib->bdecrypted ==0) ||(psecuritypriv->sw_decrypt ==true))) { - psecuritypriv->hw_decrypted=false; + psecuritypriv->hw_decrypted =false; #ifdef DBG_RX_DECRYPTOR DBG_871X("prxstat->bdecrypted:%d, prxattrib->encrypt:%d, Setting psecuritypriv->hw_decrypted = %d\n" - , prxattrib->bdecrypted ,prxattrib->encrypt, psecuritypriv->hw_decrypted); + , prxattrib->bdecrypted , prxattrib->encrypt, psecuritypriv->hw_decrypted); #endif switch (prxattrib->encrypt){ @@ -571,20 +571,20 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr break; } } - else if (prxattrib->bdecrypted==1 + else if (prxattrib->bdecrypted ==1 && prxattrib->encrypt >0 - && (psecuritypriv->busetkipkey==1 || prxattrib->encrypt !=_TKIP_ ) + && (psecuritypriv->busetkipkey ==1 || prxattrib->encrypt !=_TKIP_ ) ) { - psecuritypriv->hw_decrypted=true; + psecuritypriv->hw_decrypted =true; #ifdef DBG_RX_DECRYPTOR DBG_871X("prxstat->bdecrypted:%d, prxattrib->encrypt:%d, Setting psecuritypriv->hw_decrypted = %d\n" - , prxattrib->bdecrypted ,prxattrib->encrypt, psecuritypriv->hw_decrypted); + , prxattrib->bdecrypted , prxattrib->encrypt, psecuritypriv->hw_decrypted); #endif } else { #ifdef DBG_RX_DECRYPTOR DBG_871X("prxstat->bdecrypted:%d, prxattrib->encrypt:%d, psecuritypriv->hw_decrypted:%d\n" - , prxattrib->bdecrypted ,prxattrib->encrypt, psecuritypriv->hw_decrypted); + , prxattrib->bdecrypted , prxattrib->encrypt, psecuritypriv->hw_decrypted); #endif } @@ -601,7 +601,7 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr } /* set the security information in the recv_frame */ -static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * precv_frame) +static union recv_frame * portctrl(struct adapter *adapter, union recv_frame * precv_frame) { u8 *psta_addr, *ptr; uint auth_alg; @@ -609,7 +609,7 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr struct sta_info *psta; struct sta_priv *pstapriv ; union recv_frame *prtnframe; - u16 ether_type=0; + u16 ether_type =0; u16 eapol_type = 0x888e;/* for Funia BD's WPA issue */ struct rx_pkt_attrib *pattrib; __be16 be_tmp; @@ -628,61 +628,61 @@ static union recv_frame * portctrl(struct adapter *adapter,union recv_frame * pr psta = rtw_get_stainfo(pstapriv, psta_addr); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:adapter->securitypriv.dot11AuthAlgrthm=%d\n",adapter->securitypriv.dot11AuthAlgrthm)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:adapter->securitypriv.dot11AuthAlgrthm =%d\n", adapter->securitypriv.dot11AuthAlgrthm)); - if (auth_alg==2) + if (auth_alg ==2) { if ((psta!=NULL) && (psta->ieee8021x_blocked)) { /* blocked */ /* only accept EAPOL frame */ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:psta->ieee8021x_blocked==1\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked ==1\n")); - prtnframe=precv_frame; + prtnframe =precv_frame; /* get ether_type */ - ptr=ptr+pfhdr->attrib.hdrlen+pfhdr->attrib.iv_len+LLC_HEADER_SIZE; + ptr =ptr+pfhdr->attrib.hdrlen+pfhdr->attrib.iv_len+LLC_HEADER_SIZE; memcpy(&be_tmp, ptr, 2); - ether_type= ntohs(be_tmp); + ether_type = ntohs(be_tmp); if (ether_type == eapol_type) { - prtnframe=precv_frame; + prtnframe =precv_frame; } else { /* free this frame */ rtw_free_recvframe(precv_frame, &adapter->recvpriv.free_recv_queue); - prtnframe=NULL; + prtnframe =NULL; } } else { /* allowed */ /* check decryption status, and decrypt the frame if needed */ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:psta->ieee8021x_blocked==0\n")); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("portctrl:precv_frame->hdr.attrib.privacy=%x\n",precv_frame->u.hdr.attrib.privacy)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked ==0\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("portctrl:precv_frame->hdr.attrib.privacy =%x\n", precv_frame->u.hdr.attrib.privacy)); if (pattrib->bdecrypted == 0) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("portctrl:prxstat->decrypted=%x\n", pattrib->bdecrypted)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("portctrl:prxstat->decrypted =%x\n", pattrib->bdecrypted)); } - prtnframe=precv_frame; + prtnframe =precv_frame; /* check is the EAPOL frame or not (Rekey) */ if (ether_type == eapol_type){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_notice_,("########portctrl:ether_type == 0x888e\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("########portctrl:ether_type == 0x888e\n")); /* check Rekey */ - prtnframe=precv_frame; + prtnframe =precv_frame; } else{ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("########portctrl:ether_type=0x%04x\n", ether_type)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:ether_type =0x%04x\n", ether_type)); } } } else { - prtnframe=precv_frame; + prtnframe =precv_frame; } ; @@ -703,7 +703,7 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac if (tid>15) { - RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, (tid>15)! seq_ctrl=0x%x, tid=0x%x\n", seq_ctrl, tid)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, (tid>15)! seq_ctrl =0x%x, tid =0x%x\n", seq_ctrl, tid)); return _FAIL; } @@ -712,7 +712,7 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac { if (seq_ctrl == prxcache->tid_rxseq[tid]) { - RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, seq_ctrl=0x%x, tid=0x%x, tid_rxseq=0x%x\n", seq_ctrl, tid, prxcache->tid_rxseq[tid])); + RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, seq_ctrl =0x%x, tid =0x%x, tid_rxseq =0x%x\n", seq_ctrl, tid, prxcache->tid_rxseq[tid])); return _FAIL; } @@ -734,7 +734,7 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame u8 *ptr = precv_frame->u.hdr.rx_data; struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &padapter->stapriv; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; psta = rtw_get_stainfo(pstapriv, pattrib->src); @@ -751,7 +751,7 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame stop_sta_xmit(padapter, psta); - /* DBG_871X("to sleep, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); */ + /* DBG_871X("to sleep, sta_dz_bitmap =%x\n", pstapriv->sta_dz_bitmap); */ } } else @@ -763,7 +763,7 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame wakeup_sta_to_xmit(padapter, psta); - /* DBG_871X("to wakeup, sta_dz_bitmap=%x\n", pstapriv->sta_dz_bitmap); */ + /* DBG_871X("to wakeup, sta_dz_bitmap =%x\n", pstapriv->sta_dz_bitmap); */ } } @@ -778,7 +778,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_AP_MODE struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct sta_priv *pstapriv = &padapter->stapriv; - struct sta_info *psta=NULL; + struct sta_info *psta =NULL; psta = rtw_get_stainfo(pstapriv, pattrib->src); @@ -792,7 +792,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame) if (psta->state&WIFI_SLEEP_STATE) { - u8 wmmps_ac=0; + u8 wmmps_ac =0; switch (pattrib->priority) { @@ -895,20 +895,20 @@ sint sta2sta_data_frame( /* filter packets that SA is myself or multicast or broadcast */ if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" SA==myself\n")); - ret= _FAIL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA ==myself\n")); + ret = _FAIL; goto exit; } if ( (!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast) ){ - ret= _FAIL; + ret = _FAIL; goto exit; } if ( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || _rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) ) { - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -921,8 +921,8 @@ sint sta2sta_data_frame( /* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */ if (!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN) ) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n")); - ret= _FAIL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("bssid != TA under STATION_MODE; drop pkt\n")); + ret = _FAIL; goto exit; } sta_addr = pattrib->bssid; @@ -935,7 +935,7 @@ sint sta2sta_data_frame( { /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ if (!IS_MCAST(pattrib->bssid)){ - ret= _FAIL; + ret = _FAIL; goto exit; } } @@ -943,7 +943,7 @@ sint sta2sta_data_frame( { /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ if (!_rtw_memcmp(pattrib->bssid, pattrib->dst, ETH_ALEN)) { - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -974,8 +974,8 @@ sint sta2sta_data_frame( *psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */ if (*psta == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under sta2sta_data_frame ; drop pkt\n")); - ret= _FAIL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under sta2sta_data_frame ; drop pkt\n")); + ret = _FAIL; goto exit; } @@ -1013,24 +1013,24 @@ sint ap2sta_data_frame( /* filter packets that SA is myself or multicast or broadcast */ if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" SA==myself\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA ==myself\n")); #ifdef DBG_RX_DROP_FRAME - DBG_871X("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n", + DBG_871X("DBG_RX_DROP_FRAME %s SA ="MAC_FMT", myhwaddr ="MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr)); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } /* da should be for me */ if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast)) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_, - (" ap2sta_data_frame: compare DA fail; DA="MAC_FMT"\n", MAC_ARG(pattrib->dst))); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, + (" ap2sta_data_frame: compare DA fail; DA ="MAC_FMT"\n", MAC_ARG(pattrib->dst))); #ifdef DBG_RX_DROP_FRAME - DBG_871X("DBG_RX_DROP_FRAME %s DA="MAC_FMT"\n", __func__, MAC_ARG(pattrib->dst)); + DBG_871X("DBG_RX_DROP_FRAME %s DA ="MAC_FMT"\n", __func__, MAC_ARG(pattrib->dst)); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -1040,22 +1040,22 @@ sint ap2sta_data_frame( _rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) ) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_, - (" ap2sta_data_frame: compare BSSID fail ; BSSID="MAC_FMT"\n", MAC_ARG(pattrib->bssid))); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("mybssid="MAC_FMT"\n", MAC_ARG(mybssid))); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, + (" ap2sta_data_frame: compare BSSID fail ; BSSID ="MAC_FMT"\n", MAC_ARG(pattrib->bssid))); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("mybssid ="MAC_FMT"\n", MAC_ARG(mybssid))); #ifdef DBG_RX_DROP_FRAME - DBG_871X("DBG_RX_DROP_FRAME %s BSSID="MAC_FMT", mybssid="MAC_FMT"\n", + DBG_871X("DBG_RX_DROP_FRAME %s BSSID ="MAC_FMT", mybssid ="MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->bssid), MAC_ARG(mybssid)); DBG_871X( "this adapter = %d, buddy adapter = %d\n", adapter->adapter_type, adapter->pbuddy_adapter->adapter_type ); #endif if (!bmcast) { - DBG_871X("issue_deauth to the nonassociated ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); + DBG_871X("issue_deauth to the nonassociated ap =" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); } - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -1065,11 +1065,11 @@ sint ap2sta_data_frame( *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get ap_info */ if (*psta == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("ap2sta: can't get psta under STATION_MODE ; drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ap2sta: can't get psta under STATION_MODE ; drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under STATION_MODE ; drop pkt\n", __FUNCTION__); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -1099,11 +1099,11 @@ sint ap2sta_data_frame( *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */ if (*psta == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under MP_MODE ; drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under MP_MODE ; drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under WIFI_MP_STATE ; drop pkt\n", __FUNCTION__); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -1122,7 +1122,7 @@ sint ap2sta_data_frame( *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */ if (*psta == NULL) { - DBG_871X("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); + DBG_871X("issue_deauth to the ap =" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); } @@ -1156,24 +1156,24 @@ sint sta2ap_data_frame( struct sta_priv *pstapriv = &adapter->stapriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; unsigned char *mybssid = get_bssid(pmlmepriv); - sint ret=_SUCCESS; + sint ret =_SUCCESS; ; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { - /* For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */ + /* For AP mode, RA =BSSID, TX =STA(SRC_ADDR), A3 =DST_ADDR */ if (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { - ret= _FAIL; + ret = _FAIL; goto exit; } *psta = rtw_get_stainfo(pstapriv, pattrib->src); if (*psta == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under AP_MODE; drop pkt\n")); - DBG_871X("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under AP_MODE; drop pkt\n")); + DBG_871X("issue_deauth to sta =" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src)); issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); @@ -1200,7 +1200,7 @@ sint sta2ap_data_frame( ret = RTW_RX_HANDLED; goto exit; } - DBG_871X("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src)); + DBG_871X("issue_deauth to sta =" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src)); issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); ret = RTW_RX_HANDLED; goto exit; @@ -1240,13 +1240,13 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ if (GetFrameSubType(pframe) == WIFI_PSPOLL) { u16 aid; - u8 wmmps_ac=0; - struct sta_info *psta=NULL; + u8 wmmps_ac =0; + struct sta_info *psta =NULL; aid = GetAid(pframe); psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); - if ((psta==NULL) || (psta->aid!=aid)) + if ((psta ==NULL) || (psta->aid!=aid)) { return _FAIL; } @@ -1289,7 +1289,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ { unsigned long irqL; struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; + struct xmit_frame *pxmitframe =NULL; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; /* spin_lock_bh(&psta->sleep_q.lock); */ @@ -1315,11 +1315,11 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ pxmitframe->attrib.triggered = 1; - /* DBG_871X("handling ps-poll, q_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ + /* DBG_871X("handling ps-poll, q_len =%d, tim =%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ rtw_hal_xmitframe_enqueue(padapter, pxmitframe); - if (psta->sleepq_len==0) + if (psta->sleepq_len ==0) { pstapriv->tim_bitmap &= ~BIT(psta->aid); @@ -1340,7 +1340,7 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ /* DBG_871X("no buffered packets to xmit\n"); */ if (pstapriv->tim_bitmap&BIT(psta->aid)) { - if (psta->sleepq_len==0) + if (psta->sleepq_len ==0) { DBG_871X("no buffered packets to xmit\n"); @@ -1349,8 +1349,8 @@ sint validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_ } else { - DBG_871X("error!psta->sleepq_len=%d\n", psta->sleepq_len); - psta->sleepq_len=0; + DBG_871X("error!psta->sleepq_len =%d\n", psta->sleepq_len); + psta->sleepq_len =0; } pstapriv->tim_bitmap &= ~BIT(psta->aid); @@ -1382,7 +1382,7 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_ precv_frame = recvframe_chk_defrag(padapter, precv_frame); if (precv_frame == NULL) { - RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,("%s: fragment packet\n",__FUNCTION__)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("%s: fragment packet\n", __FUNCTION__)); return _SUCCESS; } @@ -1408,12 +1408,12 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_ } #ifdef CONFIG_INTEL_PROXIM - if (padapter->proximity.proxim_on==true) + if (padapter->proximity.proxim_on ==true) { - struct rx_pkt_attrib * pattrib=&precv_frame->u.hdr.attrib; - struct recv_stat* prxstat=( struct recv_stat * ) precv_frame->u.hdr.rx_head ; + struct rx_pkt_attrib * pattrib =&precv_frame->u.hdr.attrib; + struct recv_stat* prxstat =( struct recv_stat * ) precv_frame->u.hdr.rx_head ; u8 * pda,*psa,*pbssid,*ptr; - ptr=precv_frame->u.hdr.rx_data; + ptr =precv_frame->u.hdr.rx_data; pda = get_da(ptr); psa = get_sa(ptr); pbssid = get_hdr_bssid(ptr); @@ -1444,17 +1444,17 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_ case 3: memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN); - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" case 3\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" case 3\n")); break; default: break; } - pattrib->priority=0; - pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24; + pattrib->priority =0; + pattrib->hdrlen = pattrib->to_fr_ds ==3 ? 30 : 24; - padapter->proximity.proxim_rx(padapter,precv_frame); + padapter->proximity.proxim_rx(padapter, precv_frame); } #endif mgt_dispatcher(padapter, precv_frame); @@ -1484,7 +1484,7 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s pbssid == NULL\n", __func__); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } @@ -1517,7 +1517,7 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN); ret =_FAIL; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" case 3\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" case 3\n")); break; default: @@ -1536,21 +1536,21 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f } - if (psta==NULL){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" after to_fr_ds_chk; psta==NULL\n")); + if (psta ==NULL){ + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" after to_fr_ds_chk; psta ==NULL\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s psta == NULL\n", __func__); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } /* psta->rssi = prxcmd->rssi; */ - /* psta->signal_quality= prxcmd->sq; */ + /* psta->signal_quality = prxcmd->sq; */ precv_frame->u.hdr.psta = psta; - pattrib->amsdu=0; + pattrib->amsdu =0; pattrib->ack_policy = 0; /* parsing QC field */ if (pattrib->qos == 1) @@ -1558,7 +1558,7 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f pattrib->priority = GetPriority((ptr + 24)); pattrib->ack_policy = GetAckpolicy((ptr + 24)); pattrib->amsdu = GetAMsdu((ptr + 24)); - pattrib->hdrlen = pattrib->to_fr_ds==3 ? 32 : 26; + pattrib->hdrlen = pattrib->to_fr_ds ==3 ? 32 : 26; if (pattrib->priority!=0 && pattrib->priority!=3) { @@ -1567,8 +1567,8 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f } else { - pattrib->priority=0; - pattrib->hdrlen = pattrib->to_fr_ds==3 ? 30 : 24; + pattrib->priority =0; + pattrib->hdrlen = pattrib->to_fr_ds ==3 ? 30 : 24; } @@ -1582,21 +1582,21 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f /* decache, drop duplicate recv packets */ if (recv_decache(precv_frame, bretry, &psta->sta_recvpriv.rxcache) == _FAIL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("decache : drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("decache : drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s recv_decache return _FAIL\n", __func__); #endif - ret= _FAIL; + ret = _FAIL; goto exit; } if (pattrib->privacy){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy)); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x))=%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0],IS_MCAST(pattrib->ra))); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("validate_recv_data_frame:pattrib->privacy =%x\n", pattrib->privacy)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x)) =%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0], IS_MCAST(pattrib->ra))); GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra)); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n pattrib->encrypt=%d\n",pattrib->encrypt)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n pattrib->encrypt =%d\n", pattrib->encrypt)); SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt); } @@ -1634,7 +1634,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) { u8 *ppp, *mgmt_DATA; - u32 data_len=0; + u32 data_len =0; ppp = GetAddr2Ptr(ptr); pattrib->bdecrypted = 0; @@ -1656,7 +1656,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec { int pp; printk("pattrib->pktlen = %d =>", pattrib->pkt_len); - for (pp=0;pp< pattrib->pkt_len; pp++) + for (pp =0;pp< pattrib->pkt_len; pp++) printk(" %02x ", ptr[pp]); printk("\n"); }*/ @@ -1673,7 +1673,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec { int pp; printk("after decryption pattrib->pktlen = %d @@=>", pattrib->pkt_len); - for (pp=0;pp< pattrib->pkt_len; pp++) + for (pp =0;pp< pattrib->pkt_len; pp++) printk(" %02x ", ptr[pp]); printk("\n"); }*/ @@ -1713,7 +1713,7 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_SELF_PROTECTED && ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_P2P) { - DBG_871X("action frame category=%d should robust\n", ptr[WLAN_HDR_A3_LEN]); + DBG_871X("action frame category =%d should robust\n", ptr[WLAN_HDR_A3_LEN]); goto validate_80211w_fail; } } @@ -1762,8 +1762,8 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) /* add version chk */ if (ver!=0){ - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n")); - retval= _FAIL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail! (ver!=0)\n")); + retval = _FAIL; goto exit; } @@ -1786,28 +1786,28 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) int i; DBG_871X("#############################\n"); - for (i=0; i<64;i=i+8) + for (i =0; i<64;i =i+8) DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_871X("#############################\n"); } else if (bDumpRxPkt ==2){ - if (type== WIFI_MGT_TYPE){ + if (type == WIFI_MGT_TYPE){ int i; DBG_871X("#############################\n"); - for (i=0; i<64;i=i+8) + for (i =0; i<64;i =i+8) DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_871X("#############################\n"); } } else if (bDumpRxPkt ==3){ - if (type== WIFI_DATA_TYPE){ + if (type == WIFI_DATA_TYPE){ int i; DBG_871X("#############################\n"); - for (i=0; i<64;i=i+8) + for (i =0; i<64;i =i+8) DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_871X("#############################\n"); @@ -1827,7 +1827,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) retval = validate_recv_mgnt_frame(adapter, precv_frame); if (retval == _FAIL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_mgnt_frame fail\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_mgnt_frame fail\n")); } retval = _FAIL; /* only data frame return _SUCCESS */ break; @@ -1835,7 +1835,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) retval = validate_recv_ctrl_frame(adapter, precv_frame); if (retval == _FAIL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_ctrl_frame fail\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_ctrl_frame fail\n")); } retval = _FAIL; /* only data frame return _SUCCESS */ break; @@ -1846,14 +1846,14 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) if (retval == _FAIL) { struct recv_priv *precvpriv = &adapter->recvpriv; - /* RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail\n")); */ + /* RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail\n")); */ precvpriv->rx_drop++; } break; default: - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! type=0x%x\n", type)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail! type =0x%x\n", type)); #ifdef DBG_RX_DROP_FRAME - DBG_871X("DBG_RX_DROP_FRAME validate_recv_data_frame fail! type=0x%x\n", type); + DBG_871X("DBG_RX_DROP_FRAME validate_recv_data_frame fail! type =0x%x\n", type); #endif retval = _FAIL; break; @@ -1877,7 +1877,7 @@ static sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) u8 *psnap_type; struct ieee80211_snap_hdr *psnap; __be16 be_tmp; - sint ret=_SUCCESS; + sint ret =_SUCCESS; struct adapter *adapter =precvframe->u.hdr.adapter; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -1890,13 +1890,13 @@ static sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) recvframe_pull_tail(precvframe, pattrib->icv_len); } - psnap=(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len); - psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; + psnap =(struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len); + psnap_type =ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE; /* convert hdr + possible LLC headers into Ethernet header */ /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */ if ((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) && - (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2)==false) )|| + (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) ==false) )|| /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */ _rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)){ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ @@ -1910,10 +1910,10 @@ static sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) rmv_len = pattrib->hdrlen + pattrib->iv_len +(bsnaphdr?SNAP_SIZE:0); len = precvframe->u.hdr.len - rmv_len; - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len)); memcpy(&be_tmp, ptr+rmv_len, 2); - eth_type= ntohs(be_tmp); /* pattrib->ether_type */ + eth_type = ntohs(be_tmp); /* pattrib->ether_type */ pattrib->eth_type = eth_type; if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) @@ -1949,19 +1949,19 @@ static sint wlanhdr_to_ethhdr ( union recv_frame *precvframe) static union recv_frame * recvframe_defrag(struct adapter *adapter, struct __queue *defrag_q) { struct list_head *plist, *phead; - u8 *data,wlanhdr_offset; + u8 *data, wlanhdr_offset; u8 curfragnum; struct recv_frame_hdr *pfhdr,*pnfhdr; union recv_frame* prframe, *pnextrframe; struct __queue *pfree_recv_queue; - curfragnum=0; - pfree_recv_queue=&adapter->recvpriv.free_recv_queue; + curfragnum =0; + pfree_recv_queue =&adapter->recvpriv.free_recv_queue; phead = get_list_head(defrag_q); plist = get_next(phead); prframe = LIST_CONTAINOR(plist, union recv_frame, u); - pfhdr=&prframe->u.hdr; + pfhdr =&prframe->u.hdr; rtw_list_delete(&(prframe->u.list)); if (curfragnum!=pfhdr->attrib.frag_num) @@ -1976,16 +1976,16 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter, struct __qu curfragnum++; - plist= get_list_head(defrag_q); + plist = get_list_head(defrag_q); plist = get_next(plist); - data=get_recvframe_data(prframe); + data =get_recvframe_data(prframe); while (rtw_end_of_queue_search(phead, plist) == false) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame , u); - pnfhdr=&pnextrframe->u.hdr; + pnfhdr =&pnextrframe->u.hdr; /* check the fragment sequence (2nd ~n fragment frame) */ @@ -2016,7 +2016,7 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter, struct __qu recvframe_put(prframe, pnfhdr->len); - pfhdr->attrib.icv_len=pnfhdr->attrib.icv_len; + pfhdr->attrib.icv_len =pnfhdr->attrib.icv_len; plist = get_next(plist); }; @@ -2024,7 +2024,7 @@ static union recv_frame * recvframe_defrag(struct adapter *adapter, struct __qu /* free the defrag_q queue and return the prframe */ rtw_free_recvframe_queue(defrag_q, pfree_recv_queue); - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Performance defrag!!!!!\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("Performance defrag!!!!!\n")); ; @@ -2068,18 +2068,18 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram else pdefrag_q = &psta->sta_recvpriv.defrag_q; - if ((ismfrag==0) && (fragnum==0)) + if ((ismfrag ==0) && (fragnum ==0)) { prtnframe = precv_frame;/* isn't a fragment frame */ } - if (ismfrag==1) + if (ismfrag ==1) { /* 0~(n-1) fragment frame */ /* enqueue to defraf_g */ if (pdefrag_q != NULL) { - if (fragnum==0) + if (fragnum ==0) { /* the first fragment */ if (_rtw_queue_empty(pdefrag_q) == false) @@ -2097,22 +2097,22 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram rtw_list_insert_tail(&pfhdr->list, phead); /* _rtw_spinunlock(&pdefrag_q->lock); */ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Enqueuq: ismfrag = %d, fragnum= %d\n", ismfrag,fragnum)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("Enqueuq: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum)); - prtnframe=NULL; + prtnframe =NULL; } else { /* can't find this ta's defrag_queue, so free this recv_frame */ rtw_free_recvframe(precv_frame, pfree_recv_queue); - prtnframe=NULL; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum= %d\n", ismfrag, fragnum)); + prtnframe =NULL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum)); } } - if ((ismfrag==0)&&(fragnum!=0)) + if ((ismfrag ==0)&&(fragnum!=0)) { /* the last fragment frame */ /* enqueue the last fragment */ @@ -2120,21 +2120,21 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram { /* _rtw_spinlock(&pdefrag_q->lock); */ phead = get_list_head(pdefrag_q); - rtw_list_insert_tail(&pfhdr->list,phead); + rtw_list_insert_tail(&pfhdr->list, phead); /* _rtw_spinunlock(&pdefrag_q->lock); */ /* call recvframe_defrag to defrag */ - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("defrag: ismfrag = %d, fragnum= %d\n", ismfrag, fragnum)); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("defrag: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum)); precv_frame = recvframe_defrag(padapter, pdefrag_q); - prtnframe=precv_frame; + prtnframe =precv_frame; } else { /* can't find this ta's defrag_queue, so free this recv_frame */ rtw_free_recvframe(precv_frame, pfree_recv_queue); - prtnframe=NULL; - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum= %d\n", ismfrag,fragnum)); + prtnframe =NULL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q ==NULL: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum)); } } @@ -2143,11 +2143,11 @@ union recv_frame* recvframe_chk_defrag(struct adapter *padapter, union recv_fram if ((prtnframe!=NULL)&&(prtnframe->u.hdr.attrib.privacy)) { /* after defrag we must check tkip mic code */ - if (recvframe_chkmic(padapter, prtnframe)==_FAIL) + if (recvframe_chkmic(padapter, prtnframe) ==_FAIL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chkmic(padapter, prtnframe)==_FAIL\n")); - rtw_free_recvframe(prtnframe,pfree_recv_queue); - prtnframe=NULL; + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic(padapter, prtnframe) ==_FAIL\n")); + rtw_free_recvframe(prtnframe, pfree_recv_queue); + prtnframe =NULL; } } @@ -2194,13 +2194,13 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) nSubframe_Length = RTW_GET_BE16(pdata + 12); #else /* ENDIAN_FREE */ nSubframe_Length = *((u16*)(pdata + 12)); - /* m==>change the length order */ + /* m ==>change the length order */ nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); /* ntohs(nSubframe_Length); */ #endif /* ENDIAN_FREE */ if ( a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length) ) { - DBG_871X("nRemain_Length is %d and nSubframe_Length is : %d\n",a_len,nSubframe_Length); + DBG_871X("nRemain_Length is %d and nSubframe_Length is : %d\n", a_len, nSubframe_Length); goto exit; } @@ -2224,7 +2224,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) } else { - DBG_871X("rtw_skb_clone() Fail!!! , nr_subframes = %d\n",nr_subframes); + DBG_871X("rtw_skb_clone() Fail!!! , nr_subframes = %d\n", nr_subframes); break; } } @@ -2253,7 +2253,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) } } - for (i=0; iu.hdr.len=0; + prframe->u.hdr.len =0; rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ return ret; @@ -2340,7 +2340,7 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n preorder_ctrl->indicate_seq, seq_num); #endif - /* DbgPrint("check_indicate_seq, 1st->indicate_seq=%d\n", precvpriv->indicate_seq); */ + /* DbgPrint("check_indicate_seq, 1st->indicate_seq =%d\n", precvpriv->indicate_seq); */ } /* DbgPrint("enter->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ @@ -2455,7 +2455,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr plist = get_next(phead); /* Handling some condition for forced indicate case. */ - if (bforced==true) + if (bforced ==true) { if (rtw_is_list_empty(phead)) { @@ -2484,7 +2484,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, - ("recv_indicatepkts_in_order: indicate=%d seq=%d amsdu=%d\n", + ("recv_indicatepkts_in_order: indicate =%d seq =%d amsdu =%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num, pattrib->amsdu)); plist = get_next(plist); rtw_list_delete(&(prframe->u.hdr.list)); @@ -2506,10 +2506,10 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr /* indicate this recv_frame */ - /* DbgPrint("recv_indicatepkts_in_order, indicate_seq=%d, seq_num=%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ + /* DbgPrint("recv_indicatepkts_in_order, indicate_seq =%d, seq_num =%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ if (!pattrib->amsdu) { - /* DBG_871X("recv_indicatepkts_in_order, amsdu!=1, indicate_seq=%d, seq_num=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num); */ + /* DBG_871X("recv_indicatepkts_in_order, amsdu!=1, indicate_seq =%d, seq_num =%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num); */ if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) @@ -2519,7 +2519,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr } } - else if (pattrib->amsdu==1) + else if (pattrib->amsdu ==1) { if (amsdu_to_msdu(padapter, prframe)!=_SUCCESS) { @@ -2593,7 +2593,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * return _SUCCESS; } - } else if (pattrib->amsdu==1) { /* temp filter -> means didn't support A-MSDUs in a A-MPDU */ + } else if (pattrib->amsdu ==1) { /* temp filter -> means didn't support A-MSDUs in a A-MPDU */ if (preorder_ctrl->enable == false) { preorder_ctrl->indicate_seq = pattrib->seq_num; #ifdef DBG_RX_SEQ @@ -2622,7 +2622,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * spin_lock_bh(&ppending_recvframe_queue->lock); RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, - ("recv_indicatepkt_reorder: indicate=%d seq=%d\n", + ("recv_indicatepkt_reorder: indicate =%d seq =%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num)); /* s2. check if winstart_b(indicate_seq) needs to been updated */ @@ -2678,7 +2678,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext) spin_lock_bh(&ppending_recvframe_queue->lock); - if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true)==true) + if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) ==true) _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); spin_unlock_bh(&ppending_recvframe_queue->lock); @@ -2690,7 +2690,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; - if (phtpriv->ht_option==true) /* B/G/N Mode */ + if (phtpriv->ht_option ==true) /* B/G/N Mode */ { if (recv_indicatepkt_reorder(padapter, prframe)!=_SUCCESS)/* including perform A-MPDU Rx Ordering Buffer Control */ { @@ -2708,17 +2708,17 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame } else /* B/G mode */ { - retval=wlanhdr_to_ethhdr (prframe); + retval =wlanhdr_to_ethhdr (prframe); if (retval != _SUCCESS) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("wlanhdr_to_ethhdr: drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("wlanhdr_to_ethhdr: drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr error!\n", __FUNCTION__); #endif return retval; } - if ((padapter->bDriverStopped ==false)&&( padapter->bSurpriseRemoved==false)) + if ((padapter->bDriverStopped ==false)&&( padapter->bSurpriseRemoved ==false)) { /* indicate this recv_frame */ RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func recv_indicatepkt\n" )); @@ -2775,7 +2775,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr prframe = decryptor(padapter, prframe); if (prframe == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("decryptor: drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("decryptor: drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s decryptor: drop pkt\n", __FUNCTION__); #endif @@ -2784,17 +2784,17 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr } prframe = recvframe_chk_defrag(padapter, prframe); - if (prframe==NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chk_defrag: drop pkt\n")); + if (prframe ==NULL) { + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chk_defrag: drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __FUNCTION__); #endif goto _recv_data_drop; } - prframe=portctrl(padapter, prframe); + prframe =portctrl(padapter, prframe); if (prframe == NULL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("portctrl: drop pkt\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("portctrl: drop pkt\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s portctrl: drop pkt\n", __FUNCTION__); #endif @@ -2806,7 +2806,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr ret = process_recv_indicatepkts(padapter, prframe); if (ret != _SUCCESS) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recv_func: process_recv_indicatepkts fail!\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recv_func: process_recv_indicatepkts fail!\n")); #ifdef DBG_RX_DROP_FRAME DBG_871X("DBG_RX_DROP_FRAME %s process_recv_indicatepkts fail!\n", __FUNCTION__); #endif @@ -2828,7 +2828,7 @@ int recv_func(struct adapter *padapter, union recv_frame *rframe) int ret; struct rx_pkt_attrib *prxattrib = &rframe->u.hdr.attrib; struct recv_priv *recvpriv = &padapter->recvpriv; - struct security_priv *psecuritypriv=&padapter->securitypriv; + struct security_priv *psecuritypriv =&padapter->securitypriv; struct mlme_priv *mlmepriv = &padapter->mlmepriv; /* check if need to handle uc_swdec_pending_queue*/ @@ -2837,7 +2837,7 @@ int recv_func(struct adapter *padapter, union recv_frame *rframe) union recv_frame *pending_frame; int cnt = 0; - while ((pending_frame=rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) { + while ((pending_frame =rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) { cnt++; recv_func_posthandle(padapter, pending_frame); } @@ -2883,11 +2883,11 @@ s32 rtw_recv_entry(union recv_frame *precvframe) { struct adapter *padapter; struct recv_priv *precvpriv; - s32 ret=_SUCCESS; + s32 ret =_SUCCESS; ; -/* RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("+rtw_recv_entry\n")); */ +/* RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+rtw_recv_entry\n")); */ padapter = precvframe->u.hdr.adapter; @@ -2896,7 +2896,7 @@ s32 rtw_recv_entry(union recv_frame *precvframe) if ((ret = recv_func(padapter, precvframe)) == _FAIL) { - RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("rtw_recv_entry: recv_func return fail!!!\n")); + RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("rtw_recv_entry: recv_func return fail!!!\n")); goto _recv_entry_drop; } @@ -2927,8 +2927,8 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){ if (adapter->recvpriv.is_signal_dbg) { /* update the user specific value, signal_strength_dbg, to signal_strength, rssi */ - adapter->recvpriv.signal_strength= adapter->recvpriv.signal_strength_dbg; - adapter->recvpriv.rssi=(s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg); + adapter->recvpriv.signal_strength = adapter->recvpriv.signal_strength_dbg; + adapter->recvpriv.rssi =(s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg); } else { if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ diff --git a/core/rtw_security.c b/core/rtw_security.c index 57db291..3b1fec1 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -26,7 +26,7 @@ #include -/* WEP related===== */ +/* WEP related ===== */ #define CRC32_POLY 0x04c11db7 @@ -38,7 +38,7 @@ struct arc4context }; -static void arcfour_init(struct arc4context *parc4ctx, u8 * key,u32 key_len) +static void arcfour_init(struct arc4context *parc4ctx, u8 * key, u32 key_len) { u32 t, u; u32 keyindex; @@ -115,7 +115,7 @@ static void crc32_init(void) else{ sint i, j; u32 c; - u8 *p=(u8 *)&c, *p1; + u8 *p =(u8 *)&c, *p1; u8 k; c = 0x12340000; @@ -133,7 +133,7 @@ static void crc32_init(void) p1[2] = crc32_reverseBit(p[1]); p1[3] = crc32_reverseBit(p[0]); } - bcrc32initialized= 1; + bcrc32initialized = 1; } exit: ; @@ -166,20 +166,20 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) unsigned char crc[4]; struct arc4context mycontext; - sint curfragnum,length; + sint curfragnum, length; u32 keylength; u8 *pframe, *payload,*iv; /* wepkey */ u8 wepkey[16]; - u8 hw_hdr_offset=0; + u8 hw_hdr_offset =0; struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - struct xmit_priv *pxmitpriv=&padapter->xmitpriv; + struct security_priv *psecuritypriv =&padapter->securitypriv; + struct xmit_priv *pxmitpriv =&padapter->xmitpriv; ; - if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL) + if (((struct xmit_frame*)pxmitframe)->buf_addr ==NULL) return; hw_hdr_offset = TXDESC_SIZE + @@ -188,36 +188,36 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; /* start to encrypt each fragment */ - if ((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_)) + if ((pattrib->encrypt ==_WEP40_)||(pattrib->encrypt ==_WEP104_)) { - keylength=psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex]; + keylength =psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex]; - for (curfragnum=0;curfragnumnr_frags;curfragnum++) + for (curfragnum =0;curfragnumnr_frags;curfragnum++) { - iv=pframe+pattrib->hdrlen; + iv =pframe+pattrib->hdrlen; memcpy(&wepkey[0], iv, 3); - memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength); - payload=pframe+pattrib->iv_len+pattrib->hdrlen; + memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); + payload =pframe+pattrib->iv_len+pattrib->hdrlen; - if ((curfragnum+1)==pattrib->nr_frags) + if ((curfragnum+1) ==pattrib->nr_frags) { /* the last fragment */ - length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; + length =pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; - *((__le32 *)crc)=getcrc32(payload,length); + *((__le32 *)crc) =getcrc32(payload, length); - arcfour_init(&mycontext, wepkey,3+keylength); + arcfour_init(&mycontext, wepkey, 3+keylength); arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload+length, crc, 4); } else { - length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; - *((__le32 *)crc)=getcrc32(payload,length); - arcfour_init(&mycontext, wepkey,3+keylength); + length =pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; + *((__le32 *)crc) =getcrc32(payload, length); + arcfour_init(&mycontext, wepkey, 3+keylength); arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload+length, crc, 4); pframe+=pxmitpriv->frag_len; - pframe=(u8 *)RND4((SIZE_PTR)(pframe)); + pframe =(u8 *)RND4((SIZE_PTR)(pframe)); } } } @@ -230,40 +230,40 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) struct arc4context mycontext; sint length; u32 keylength; - u8 *pframe, *payload,*iv,wepkey[16]; + u8 *pframe, *payload,*iv, wepkey[16]; u8 keyindex; struct rx_pkt_attrib *prxattrib = &(((union recv_frame*)precvframe)->u.hdr.attrib); - struct security_priv *psecuritypriv=&padapter->securitypriv; + struct security_priv *psecuritypriv =&padapter->securitypriv; ; - pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; + pframe =(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; /* start to decrypt recvframe */ - if ((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_)) + if ((prxattrib->encrypt ==_WEP40_)||(prxattrib->encrypt ==_WEP104_)) { - iv=pframe+prxattrib->hdrlen; - /* keyindex=(iv[3]&0x3); */ + iv =pframe+prxattrib->hdrlen; + /* keyindex =(iv[3]&0x3); */ keyindex = prxattrib->key_index; - keylength=psecuritypriv->dot11DefKeylen[keyindex]; + keylength =psecuritypriv->dot11DefKeylen[keyindex]; memcpy(&wepkey[0], iv, 3); - /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength); */ - memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0],keylength); - length= ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; + /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */ + memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength); + length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; - payload=pframe+prxattrib->iv_len+prxattrib->hdrlen; + payload =pframe+prxattrib->iv_len+prxattrib->hdrlen; /* decrypt payload include icv */ - arcfour_init(&mycontext, wepkey,3+keylength); + arcfour_init(&mycontext, wepkey, 3+keylength); arcfour_encrypt(&mycontext, payload, payload, length); /* calculate icv and compare the icv */ - *((__le32 *)crc)=getcrc32(payload,length-4); + *((__le32 *)crc) =getcrc32(payload, length-4); if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4]) { - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n", - crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4])); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n", + crc[3], payload[length-1], crc[2], payload[length-2], crc[1], payload[length-3], crc[0], payload[length-4])); } } @@ -274,7 +274,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) } -/* 3 =====TKIP related===== */ +/* 3 =====TKIP related ===== */ static u32 secmicgetuint32( u8 * p ) /* Convert from Byte[] to Us3232 in a portable way */ @@ -282,7 +282,7 @@ static u32 secmicgetuint32( u8 * p ) s32 i; u32 res = 0; ; - for ( i=0; i<4; i++ ) + for ( i =0; i<4; i++ ) { res |= ((u32)(*p++)) << (8*i); } @@ -295,7 +295,7 @@ static void secmicputuint32( u8 * p, u32 val ) { long i; ; - for ( i=0; i<4; i++ ) + for ( i =0; i<4; i++ ) { *p++ = (u8) (val & 0xff); val >>= 8; @@ -380,25 +380,25 @@ void rtw_secgetmic(struct mic_data *pmicdata, u8 * dst ) secmicclear(pmicdata); } -void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code, u8 pri) +void rtw_seccalctkipmic(u8 * key, u8 *header, u8 *data, u32 data_len, u8 *mic_code, u8 pri) { struct mic_data micdata; - u8 priority[4]={0x0,0x0,0x0,0x0}; + u8 priority[4]={0x0, 0x0, 0x0, 0x0}; rtw_secmicsetkey(&micdata, key); priority[0]=pri; /* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */ - if (header[1]&1){ /* ToDS==1 */ + if (header[1]&1){ /* ToDS ==1 */ rtw_secmicappend(&micdata, &header[16], 6); /* DA */ - if (header[1]&2) /* From Ds==1 */ + if (header[1]&2) /* From Ds ==1 */ rtw_secmicappend(&micdata, &header[24], 6); else rtw_secmicappend(&micdata, &header[10], 6); - } else{ /* ToDS==0 */ + } else{ /* ToDS ==0 */ rtw_secmicappend(&micdata, &header[4], 6); /* DA */ - if (header[1]&2) /* From Ds==1 */ + if (header[1]&2) /* From Ds ==1 */ rtw_secmicappend(&micdata, &header[16], 6); else rtw_secmicappend(&micdata, &header[10], 6); @@ -409,7 +409,7 @@ void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code, rtw_secmicappend(&micdata, data, data_len); - rtw_secgetmic(&micdata,mic_code); + rtw_secgetmic(&micdata, mic_code); } @@ -421,10 +421,10 @@ void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code, #define Hi8(v16) ((u8)(((v16) >> 8) & 0x00FF)) #define Lo16(v32) ((u16)( (v32) & 0xFFFF)) #define Hi16(v32) ((u16)(((v32) >>16) & 0xFFFF)) -#define Mk16(hi,lo) ((lo) ^ (((u16)(hi)) << 8)) +#define Mk16(hi, lo) ((lo) ^ (((u16)(hi)) << 8)) /* select the Nth 16-bit word of the temporal key unsigned char array TK[] */ -#define TK16(N) Mk16(tk[2*(N)+1],tk[2*(N)]) +#define TK16(N) Mk16(tk[2*(N)+1], tk[2*(N)]) /* S-box lookup: 16 bits --> 16 bits */ #define _S_(v16) (Sbox1[0][Lo8(v16)] ^ Sbox1[1][Hi8(v16)]) @@ -440,74 +440,74 @@ void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code, /* 2-unsigned char by 2-unsigned char subset of the full AES S-box table */ static const unsigned short Sbox1[2][256]= /* Sbox for hash (can be in ROM) */ { { - 0xC6A5,0xF884,0xEE99,0xF68D,0xFF0D,0xD6BD,0xDEB1,0x9154, - 0x6050,0x0203,0xCEA9,0x567D,0xE719,0xB562,0x4DE6,0xEC9A, - 0x8F45,0x1F9D,0x8940,0xFA87,0xEF15,0xB2EB,0x8EC9,0xFB0B, - 0x41EC,0xB367,0x5FFD,0x45EA,0x23BF,0x53F7,0xE496,0x9B5B, - 0x75C2,0xE11C,0x3DAE,0x4C6A,0x6C5A,0x7E41,0xF502,0x834F, - 0x685C,0x51F4,0xD134,0xF908,0xE293,0xAB73,0x6253,0x2A3F, - 0x080C,0x9552,0x4665,0x9D5E,0x3028,0x37A1,0x0A0F,0x2FB5, - 0x0E09,0x2436,0x1B9B,0xDF3D,0xCD26,0x4E69,0x7FCD,0xEA9F, - 0x121B,0x1D9E,0x5874,0x342E,0x362D,0xDCB2,0xB4EE,0x5BFB, - 0xA4F6,0x764D,0xB761,0x7DCE,0x527B,0xDD3E,0x5E71,0x1397, - 0xA6F5,0xB968,0x0000,0xC12C,0x4060,0xE31F,0x79C8,0xB6ED, - 0xD4BE,0x8D46,0x67D9,0x724B,0x94DE,0x98D4,0xB0E8,0x854A, - 0xBB6B,0xC52A,0x4FE5,0xED16,0x86C5,0x9AD7,0x6655,0x1194, - 0x8ACF,0xE910,0x0406,0xFE81,0xA0F0,0x7844,0x25BA,0x4BE3, - 0xA2F3,0x5DFE,0x80C0,0x058A,0x3FAD,0x21BC,0x7048,0xF104, - 0x63DF,0x77C1,0xAF75,0x4263,0x2030,0xE51A,0xFD0E,0xBF6D, - 0x814C,0x1814,0x2635,0xC32F,0xBEE1,0x35A2,0x88CC,0x2E39, - 0x9357,0x55F2,0xFC82,0x7A47,0xC8AC,0xBAE7,0x322B,0xE695, - 0xC0A0,0x1998,0x9ED1,0xA37F,0x4466,0x547E,0x3BAB,0x0B83, - 0x8CCA,0xC729,0x6BD3,0x283C,0xA779,0xBCE2,0x161D,0xAD76, - 0xDB3B,0x6456,0x744E,0x141E,0x92DB,0x0C0A,0x486C,0xB8E4, - 0x9F5D,0xBD6E,0x43EF,0xC4A6,0x39A8,0x31A4,0xD337,0xF28B, - 0xD532,0x8B43,0x6E59,0xDAB7,0x018C,0xB164,0x9CD2,0x49E0, - 0xD8B4,0xACFA,0xF307,0xCF25,0xCAAF,0xF48E,0x47E9,0x1018, - 0x6FD5,0xF088,0x4A6F,0x5C72,0x3824,0x57F1,0x73C7,0x9751, - 0xCB23,0xA17C,0xE89C,0x3E21,0x96DD,0x61DC,0x0D86,0x0F85, - 0xE090,0x7C42,0x71C4,0xCCAA,0x90D8,0x0605,0xF701,0x1C12, - 0xC2A3,0x6A5F,0xAEF9,0x69D0,0x1791,0x9958,0x3A27,0x27B9, - 0xD938,0xEB13,0x2BB3,0x2233,0xD2BB,0xA970,0x0789,0x33A7, - 0x2DB6,0x3C22,0x1592,0xC920,0x8749,0xAAFF,0x5078,0xA57A, - 0x038F,0x59F8,0x0980,0x1A17,0x65DA,0xD731,0x84C6,0xD0B8, - 0x82C3,0x29B0,0x5A77,0x1E11,0x7BCB,0xA8FC,0x6DD6,0x2C3A, + 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, + 0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A, + 0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B, + 0x41EC, 0xB367, 0x5FFD, 0x45EA, 0x23BF, 0x53F7, 0xE496, 0x9B5B, + 0x75C2, 0xE11C, 0x3DAE, 0x4C6A, 0x6C5A, 0x7E41, 0xF502, 0x834F, + 0x685C, 0x51F4, 0xD134, 0xF908, 0xE293, 0xAB73, 0x6253, 0x2A3F, + 0x080C, 0x9552, 0x4665, 0x9D5E, 0x3028, 0x37A1, 0x0A0F, 0x2FB5, + 0x0E09, 0x2436, 0x1B9B, 0xDF3D, 0xCD26, 0x4E69, 0x7FCD, 0xEA9F, + 0x121B, 0x1D9E, 0x5874, 0x342E, 0x362D, 0xDCB2, 0xB4EE, 0x5BFB, + 0xA4F6, 0x764D, 0xB761, 0x7DCE, 0x527B, 0xDD3E, 0x5E71, 0x1397, + 0xA6F5, 0xB968, 0x0000, 0xC12C, 0x4060, 0xE31F, 0x79C8, 0xB6ED, + 0xD4BE, 0x8D46, 0x67D9, 0x724B, 0x94DE, 0x98D4, 0xB0E8, 0x854A, + 0xBB6B, 0xC52A, 0x4FE5, 0xED16, 0x86C5, 0x9AD7, 0x6655, 0x1194, + 0x8ACF, 0xE910, 0x0406, 0xFE81, 0xA0F0, 0x7844, 0x25BA, 0x4BE3, + 0xA2F3, 0x5DFE, 0x80C0, 0x058A, 0x3FAD, 0x21BC, 0x7048, 0xF104, + 0x63DF, 0x77C1, 0xAF75, 0x4263, 0x2030, 0xE51A, 0xFD0E, 0xBF6D, + 0x814C, 0x1814, 0x2635, 0xC32F, 0xBEE1, 0x35A2, 0x88CC, 0x2E39, + 0x9357, 0x55F2, 0xFC82, 0x7A47, 0xC8AC, 0xBAE7, 0x322B, 0xE695, + 0xC0A0, 0x1998, 0x9ED1, 0xA37F, 0x4466, 0x547E, 0x3BAB, 0x0B83, + 0x8CCA, 0xC729, 0x6BD3, 0x283C, 0xA779, 0xBCE2, 0x161D, 0xAD76, + 0xDB3B, 0x6456, 0x744E, 0x141E, 0x92DB, 0x0C0A, 0x486C, 0xB8E4, + 0x9F5D, 0xBD6E, 0x43EF, 0xC4A6, 0x39A8, 0x31A4, 0xD337, 0xF28B, + 0xD532, 0x8B43, 0x6E59, 0xDAB7, 0x018C, 0xB164, 0x9CD2, 0x49E0, + 0xD8B4, 0xACFA, 0xF307, 0xCF25, 0xCAAF, 0xF48E, 0x47E9, 0x1018, + 0x6FD5, 0xF088, 0x4A6F, 0x5C72, 0x3824, 0x57F1, 0x73C7, 0x9751, + 0xCB23, 0xA17C, 0xE89C, 0x3E21, 0x96DD, 0x61DC, 0x0D86, 0x0F85, + 0xE090, 0x7C42, 0x71C4, 0xCCAA, 0x90D8, 0x0605, 0xF701, 0x1C12, + 0xC2A3, 0x6A5F, 0xAEF9, 0x69D0, 0x1791, 0x9958, 0x3A27, 0x27B9, + 0xD938, 0xEB13, 0x2BB3, 0x2233, 0xD2BB, 0xA970, 0x0789, 0x33A7, + 0x2DB6, 0x3C22, 0x1592, 0xC920, 0x8749, 0xAAFF, 0x5078, 0xA57A, + 0x038F, 0x59F8, 0x0980, 0x1A17, 0x65DA, 0xD731, 0x84C6, 0xD0B8, + 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, }, { /* second half of table is unsigned char-reversed version of first! */ - 0xA5C6,0x84F8,0x99EE,0x8DF6,0x0DFF,0xBDD6,0xB1DE,0x5491, - 0x5060,0x0302,0xA9CE,0x7D56,0x19E7,0x62B5,0xE64D,0x9AEC, - 0x458F,0x9D1F,0x4089,0x87FA,0x15EF,0xEBB2,0xC98E,0x0BFB, - 0xEC41,0x67B3,0xFD5F,0xEA45,0xBF23,0xF753,0x96E4,0x5B9B, - 0xC275,0x1CE1,0xAE3D,0x6A4C,0x5A6C,0x417E,0x02F5,0x4F83, - 0x5C68,0xF451,0x34D1,0x08F9,0x93E2,0x73AB,0x5362,0x3F2A, - 0x0C08,0x5295,0x6546,0x5E9D,0x2830,0xA137,0x0F0A,0xB52F, - 0x090E,0x3624,0x9B1B,0x3DDF,0x26CD,0x694E,0xCD7F,0x9FEA, - 0x1B12,0x9E1D,0x7458,0x2E34,0x2D36,0xB2DC,0xEEB4,0xFB5B, - 0xF6A4,0x4D76,0x61B7,0xCE7D,0x7B52,0x3EDD,0x715E,0x9713, - 0xF5A6,0x68B9,0x0000,0x2CC1,0x6040,0x1FE3,0xC879,0xEDB6, - 0xBED4,0x468D,0xD967,0x4B72,0xDE94,0xD498,0xE8B0,0x4A85, - 0x6BBB,0x2AC5,0xE54F,0x16ED,0xC586,0xD79A,0x5566,0x9411, - 0xCF8A,0x10E9,0x0604,0x81FE,0xF0A0,0x4478,0xBA25,0xE34B, - 0xF3A2,0xFE5D,0xC080,0x8A05,0xAD3F,0xBC21,0x4870,0x04F1, - 0xDF63,0xC177,0x75AF,0x6342,0x3020,0x1AE5,0x0EFD,0x6DBF, - 0x4C81,0x1418,0x3526,0x2FC3,0xE1BE,0xA235,0xCC88,0x392E, - 0x5793,0xF255,0x82FC,0x477A,0xACC8,0xE7BA,0x2B32,0x95E6, - 0xA0C0,0x9819,0xD19E,0x7FA3,0x6644,0x7E54,0xAB3B,0x830B, - 0xCA8C,0x29C7,0xD36B,0x3C28,0x79A7,0xE2BC,0x1D16,0x76AD, - 0x3BDB,0x5664,0x4E74,0x1E14,0xDB92,0x0A0C,0x6C48,0xE4B8, - 0x5D9F,0x6EBD,0xEF43,0xA6C4,0xA839,0xA431,0x37D3,0x8BF2, - 0x32D5,0x438B,0x596E,0xB7DA,0x8C01,0x64B1,0xD29C,0xE049, - 0xB4D8,0xFAAC,0x07F3,0x25CF,0xAFCA,0x8EF4,0xE947,0x1810, - 0xD56F,0x88F0,0x6F4A,0x725C,0x2438,0xF157,0xC773,0x5197, - 0x23CB,0x7CA1,0x9CE8,0x213E,0xDD96,0xDC61,0x860D,0x850F, - 0x90E0,0x427C,0xC471,0xAACC,0xD890,0x0506,0x01F7,0x121C, - 0xA3C2,0x5F6A,0xF9AE,0xD069,0x9117,0x5899,0x273A,0xB927, - 0x38D9,0x13EB,0xB32B,0x3322,0xBBD2,0x70A9,0x8907,0xA733, - 0xB62D,0x223C,0x9215,0x20C9,0x4987,0xFFAA,0x7850,0x7AA5, - 0x8F03,0xF859,0x8009,0x171A,0xDA65,0x31D7,0xC684,0xB8D0, - 0xC382,0xB029,0x775A,0x111E,0xCB7B,0xFCA8,0xD66D,0x3A2C, + 0xA5C6, 0x84F8, 0x99EE, 0x8DF6, 0x0DFF, 0xBDD6, 0xB1DE, 0x5491, + 0x5060, 0x0302, 0xA9CE, 0x7D56, 0x19E7, 0x62B5, 0xE64D, 0x9AEC, + 0x458F, 0x9D1F, 0x4089, 0x87FA, 0x15EF, 0xEBB2, 0xC98E, 0x0BFB, + 0xEC41, 0x67B3, 0xFD5F, 0xEA45, 0xBF23, 0xF753, 0x96E4, 0x5B9B, + 0xC275, 0x1CE1, 0xAE3D, 0x6A4C, 0x5A6C, 0x417E, 0x02F5, 0x4F83, + 0x5C68, 0xF451, 0x34D1, 0x08F9, 0x93E2, 0x73AB, 0x5362, 0x3F2A, + 0x0C08, 0x5295, 0x6546, 0x5E9D, 0x2830, 0xA137, 0x0F0A, 0xB52F, + 0x090E, 0x3624, 0x9B1B, 0x3DDF, 0x26CD, 0x694E, 0xCD7F, 0x9FEA, + 0x1B12, 0x9E1D, 0x7458, 0x2E34, 0x2D36, 0xB2DC, 0xEEB4, 0xFB5B, + 0xF6A4, 0x4D76, 0x61B7, 0xCE7D, 0x7B52, 0x3EDD, 0x715E, 0x9713, + 0xF5A6, 0x68B9, 0x0000, 0x2CC1, 0x6040, 0x1FE3, 0xC879, 0xEDB6, + 0xBED4, 0x468D, 0xD967, 0x4B72, 0xDE94, 0xD498, 0xE8B0, 0x4A85, + 0x6BBB, 0x2AC5, 0xE54F, 0x16ED, 0xC586, 0xD79A, 0x5566, 0x9411, + 0xCF8A, 0x10E9, 0x0604, 0x81FE, 0xF0A0, 0x4478, 0xBA25, 0xE34B, + 0xF3A2, 0xFE5D, 0xC080, 0x8A05, 0xAD3F, 0xBC21, 0x4870, 0x04F1, + 0xDF63, 0xC177, 0x75AF, 0x6342, 0x3020, 0x1AE5, 0x0EFD, 0x6DBF, + 0x4C81, 0x1418, 0x3526, 0x2FC3, 0xE1BE, 0xA235, 0xCC88, 0x392E, + 0x5793, 0xF255, 0x82FC, 0x477A, 0xACC8, 0xE7BA, 0x2B32, 0x95E6, + 0xA0C0, 0x9819, 0xD19E, 0x7FA3, 0x6644, 0x7E54, 0xAB3B, 0x830B, + 0xCA8C, 0x29C7, 0xD36B, 0x3C28, 0x79A7, 0xE2BC, 0x1D16, 0x76AD, + 0x3BDB, 0x5664, 0x4E74, 0x1E14, 0xDB92, 0x0A0C, 0x6C48, 0xE4B8, + 0x5D9F, 0x6EBD, 0xEF43, 0xA6C4, 0xA839, 0xA431, 0x37D3, 0x8BF2, + 0x32D5, 0x438B, 0x596E, 0xB7DA, 0x8C01, 0x64B1, 0xD29C, 0xE049, + 0xB4D8, 0xFAAC, 0x07F3, 0x25CF, 0xAFCA, 0x8EF4, 0xE947, 0x1810, + 0xD56F, 0x88F0, 0x6F4A, 0x725C, 0x2438, 0xF157, 0xC773, 0x5197, + 0x23CB, 0x7CA1, 0x9CE8, 0x213E, 0xDD96, 0xDC61, 0x860D, 0x850F, + 0x90E0, 0x427C, 0xC471, 0xAACC, 0xD890, 0x0506, 0x01F7, 0x121C, + 0xA3C2, 0x5F6A, 0xF9AE, 0xD069, 0x9117, 0x5899, 0x273A, 0xB927, + 0x38D9, 0x13EB, 0xB32B, 0x3322, 0xBBD2, 0x70A9, 0x8907, 0xA733, + 0xB62D, 0x223C, 0x9215, 0x20C9, 0x4987, 0xFFAA, 0x7850, 0x7AA5, + 0x8F03, 0xF859, 0x8009, 0x171A, 0xDA65, 0x31D7, 0xC684, 0xB8D0, + 0xC382, 0xB029, 0x775A, 0x111E, 0xCB7B, 0xFCA8, 0xD66D, 0x3A2C, } }; @@ -528,20 +528,20 @@ static const unsigned short Sbox1[2][256]= /* Sbox for hash (can be in ROM * ********************************************************************** */ -static void phase1(u16 *p1k,const u8 *tk,const u8 *ta,u32 iv32) +static void phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32) { sint i; ; /* Initialize the 80 bits of P1K[] from IV32 and TA[0..5] */ p1k[0] = Lo16(iv32); p1k[1] = Hi16(iv32); - p1k[2] = Mk16(ta[1],ta[0]); /* use TA[] as little-endian */ - p1k[3] = Mk16(ta[3],ta[2]); - p1k[4] = Mk16(ta[5],ta[4]); + p1k[2] = Mk16(ta[1], ta[0]); /* use TA[] as little-endian */ + p1k[3] = Mk16(ta[3], ta[2]); + p1k[4] = Mk16(ta[5], ta[4]); /* Now compute an unbalanced Feistel cipher with 80-bit block */ /* size on the 80-bit block P1K[], using the 128-bit key TK[] */ - for (i=0; i < PHASE1_LOOP_CNT ;i++) + for (i =0; i < PHASE1_LOOP_CNT ;i++) { /* Each add operation here is mod 2**16 */ p1k[0] += _S_(p1k[4] ^ TK16((i&1)+0)); p1k[1] += _S_(p1k[0] ^ TK16((i&1)+2)); @@ -566,7 +566,7 @@ static void phase1(u16 *p1k,const u8 *tk,const u8 *ta,u32 iv32) * rc4key[] = the key used to encrypt the packet [128 bits] * * Note: -* The value {TA,IV32,IV16} for Phase1/Phase2 must be unique +* The value {TA, IV32, IV16} for Phase1/Phase2 must be unique * across all packets using the same key TK value. Then, for a * given value of TK[], this TKIP48 construction guarantees that * the final RC4KEY value is unique across all packets. @@ -577,13 +577,13 @@ static void phase1(u16 *p1k,const u8 *tk,const u8 *ta,u32 iv32) * ********************************************************************** */ -static void phase2(u8 *rc4key,const u8 *tk,const u16 *p1k,u16 iv16) +static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16) { sint i; u16 PPK[6]; /* temporary key for mixing */ ; /* Note: all adds in the PPK[] equations below are mod 2**16 */ - for (i=0;i<5;i++) + for (i =0;i<5;i++) PPK[i]=p1k[i]; /* first, copy P1K to PPK */ PPK[5] = p1k[4] +iv16; /* next, add in IV16 */ @@ -604,8 +604,8 @@ static void phase2(u8 *rc4key,const u8 *tk,const u16 *p1k,u16 iv16) PPK[5] += RotR1(PPK[4]); /* Note: At this point, for a given key TK[0..15], the 96-bit output */ /* value PPK[0..5] is guaranteed to be unique, as a function */ - /* of the 96-bit "input" value {TA,IV32,IV16}. That is, P1K */ - /* is now a keyed permutation of {TA,IV32,IV16}. */ + /* of the 96-bit "input" value {TA, IV32, IV16}. That is, P1K */ + /* is now a keyed permutation of {TA, IV32, IV16}. */ /* Set RC4KEY[0..3], which includes "cleartext" portion of RC4 key */ rc4key[0] = Hi8(iv16); /* RC4KEY[0..2] is the WEP IV */ @@ -615,7 +615,7 @@ static void phase2(u8 *rc4key,const u8 *tk,const u16 *p1k,u16 iv16) /* Copy 96 bits of PPK[0..5] to RC4KEY[4..15] (little-endian) */ - for (i=0;i<6;i++) + for (i =0;i<6;i++) { rc4key[4+2*i] = Lo8(PPK[i]); rc4key[5+2*i] = Hi8(PPK[i]); @@ -634,19 +634,19 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) u8 crc[4]; u8 hw_hdr_offset = 0; struct arc4context mycontext; - sint curfragnum,length; + sint curfragnum, length; u32 prwskeylen; u8 *pframe, *payload,*iv,*prwskey; union pn48 dot11txpn; struct sta_info *stainfo; struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - struct xmit_priv *pxmitpriv=&padapter->xmitpriv; - u32 res=_SUCCESS; + struct security_priv *psecuritypriv =&padapter->securitypriv; + struct xmit_priv *pxmitpriv =&padapter->xmitpriv; + u32 res =_SUCCESS; ; - if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL) + if (((struct xmit_frame*)pxmitframe)->buf_addr ==NULL) return _FAIL; hw_hdr_offset = TXDESC_SIZE + @@ -654,7 +654,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; /* 4 start to encrypt each fragment */ - if (pattrib->encrypt==_TKIP_){ + if (pattrib->encrypt ==_TKIP_){ if (pattrib->psta) { @@ -663,7 +663,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - stainfo=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); + stainfo =rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); } if (stainfo!=NULL){ @@ -674,50 +674,50 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) return _FAIL; } - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_encrypt: stainfo!=NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt: stainfo!=NULL!!!\n")); if (IS_MCAST(pattrib->ra)) { - prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; + prwskey =psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; } else { - prwskey=&stainfo->dot118021x_UncstKey.skey[0]; + prwskey =&stainfo->dot118021x_UncstKey.skey[0]; } - prwskeylen=16; + prwskeylen =16; - for (curfragnum=0;curfragnumnr_frags;curfragnum++){ - iv=pframe+pattrib->hdrlen; - payload=pframe+pattrib->iv_len+pattrib->hdrlen; + for (curfragnum =0;curfragnumnr_frags;curfragnum++){ + iv =pframe+pattrib->hdrlen; + payload =pframe+pattrib->iv_len+pattrib->hdrlen; GET_TKIP_PN(iv, dot11txpn); - pnl=(u16)(dot11txpn.val); - pnh=(u32)(dot11txpn.val>>16); + pnl =(u16)(dot11txpn.val); + pnh =(u32)(dot11txpn.val>>16); - phase1((u16 *)&ttkey[0],prwskey,&pattrib->ta[0],pnh); + phase1((u16 *)&ttkey[0], prwskey,&pattrib->ta[0], pnh); - phase2(&rc4key[0],prwskey,(u16 *)&ttkey[0],pnl); + phase2(&rc4key[0], prwskey, (u16 *)&ttkey[0], pnl); - if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */ - length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; - RT_TRACE(_module_rtl871x_security_c_,_drv_info_,("pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len,pattrib->icv_len)); - *((__le32 *)crc)=getcrc32(payload,length);/* modified by Amy*/ + if ((curfragnum+1) ==pattrib->nr_frags){ /* 4 the last fragment */ + length =pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; + RT_TRACE(_module_rtl871x_security_c_, _drv_info_, ("pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len, pattrib->icv_len)); + *((__le32 *)crc) =getcrc32(payload, length);/* modified by Amy*/ - arcfour_init(&mycontext, rc4key,16); + arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload+length, crc, 4); } else{ - length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; - *((__le32 *)crc)=getcrc32(payload,length);/* modified by Amy*/ - arcfour_init(&mycontext,rc4key,16); + length =pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; + *((__le32 *)crc) =getcrc32(payload, length);/* modified by Amy*/ + arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload+length, crc, 4); pframe+=pxmitpriv->frag_len; - pframe=(u8 *)RND4((SIZE_PTR)(pframe)); + pframe =(u8 *)RND4((SIZE_PTR)(pframe)); } } @@ -725,9 +725,9 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) } else{ - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_encrypt: stainfo==NULL!!!\n")); - DBG_871X("%s, psta==NUL\n", __func__); - res=_FAIL; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt: stainfo ==NULL!!!\n")); + DBG_871X("%s, psta ==NUL\n", __func__); + res =_FAIL; } } @@ -753,18 +753,18 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) union pn48 dot11txpn; struct sta_info *stainfo; struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; -/* struct recv_priv *precvpriv=&padapter->recvpriv; */ - u32 res=_SUCCESS; + struct security_priv *psecuritypriv =&padapter->securitypriv; +/* struct recv_priv *precvpriv =&padapter->recvpriv; */ + u32 res =_SUCCESS; ; - pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; + pframe =(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; /* 4 start to decrypt recvframe */ - if (prxattrib->encrypt==_TKIP_){ + if (prxattrib->encrypt ==_TKIP_){ - stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); + stainfo =rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); if (stainfo!=NULL){ if (IS_MCAST(prxattrib->ra)) @@ -773,9 +773,9 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) static u32 no_gkey_bc_cnt = 0; static u32 no_gkey_mc_cnt = 0; - if (psecuritypriv->binstallGrpkey==false) + if (psecuritypriv->binstallGrpkey ==false) { - res=_FAIL; + res =_FAIL; if (start == 0) start = rtw_get_current_time(); @@ -808,46 +808,46 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) /* DBG_871X("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */ /* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */ prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; - prwskeylen=16; + prwskeylen =16; } else { - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo!=NULL!!!\n")); - prwskey=&stainfo->dot118021x_UncstKey.skey[0]; - prwskeylen=16; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt: stainfo!=NULL!!!\n")); + prwskey =&stainfo->dot118021x_UncstKey.skey[0]; + prwskeylen =16; } - iv=pframe+prxattrib->hdrlen; - payload=pframe+prxattrib->iv_len+prxattrib->hdrlen; - length= ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; + iv =pframe+prxattrib->hdrlen; + payload =pframe+prxattrib->iv_len+prxattrib->hdrlen; + length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; GET_TKIP_PN(iv, dot11txpn); - pnl=(u16)(dot11txpn.val); - pnh=(u32)(dot11txpn.val>>16); + pnl =(u16)(dot11txpn.val); + pnh =(u32)(dot11txpn.val>>16); - phase1((u16 *)&ttkey[0],prwskey,&prxattrib->ta[0],pnh); - phase2(&rc4key[0],prwskey,(unsigned short *)&ttkey[0],pnl); + phase1((u16 *)&ttkey[0], prwskey,&prxattrib->ta[0], pnh); + phase2(&rc4key[0], prwskey, (unsigned short *)&ttkey[0], pnl); /* 4 decrypt payload include icv */ - arcfour_init(&mycontext, rc4key,16); + arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); - *((__le32 *)crc)=getcrc32(payload,length-4); + *((__le32 *)crc) =getcrc32(payload, length-4); if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4]) { - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n", - crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4])); - res=_FAIL; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n", + crc[3], payload[length-1], crc[2], payload[length-2], crc[1], payload[length-3], crc[0], payload[length-4])); + res =_FAIL; } } else{ - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_decrypt: stainfo==NULL!!!\n")); - res=_FAIL; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt: stainfo ==NULL!!!\n")); + res =_FAIL; } } @@ -858,7 +858,7 @@ exit: } -/* 3 =====AES related===== */ +/* 3 =====AES related ===== */ @@ -958,7 +958,7 @@ static void xor_128(u8 *a, u8 *b, u8 *out) { sint i; ; - for (i=0;i<16; i++) + for (i =0;i<16; i++) { out[i] = a[i] ^ b[i]; } @@ -970,7 +970,7 @@ static void xor_32(u8 *a, u8 *b, u8 *out) { sint i; ; - for (i=0;i<4; i++) + for (i =0;i<4; i++) { out[i] = a[i] ^ b[i]; } @@ -1015,7 +1015,7 @@ static void byte_sub(u8 *in, u8 *out) { sint i; ; - for (i=0; i< 16; i++) + for (i =0; i< 16; i++) { out[i] = sbox(in[i]); } @@ -1058,9 +1058,9 @@ static void mix_column(u8 *in, u8 *out) u8 temp[4]; u8 tempb[4]; ; - for (i=0 ; i<4; i++) + for (i =0 ; i<4; i++) { - if ((in[i] & 0x80)== 0x80) + if ((in[i] & 0x80) == 0x80) add1b[i] = 0x1b; else add1b[i] = 0x00; @@ -1103,7 +1103,7 @@ static void mix_column(u8 *in, u8 *out) rotr[3] = temp[0]; xor_32(add1bf7, rotr, temp); - xor_32(swap_halfs, rotl,tempb); + xor_32(swap_halfs, rotl, tempb); xor_32(temp, tempb, out); ; } @@ -1117,7 +1117,7 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext) u8 intermediateb[16]; u8 round_key[16]; ; - for (i=0; i<16; i++) round_key[i] = key[i]; + for (i =0; i<16; i++) round_key[i] = key[i]; for (round = 0; round < 11; round++) { @@ -1192,7 +1192,7 @@ static void construct_mic_iv( /* construct_mic_header1() */ /* Builds the first MIC header block from */ /* header fields. */ -/* Build AAD SC,A1,A2 */ +/* Build AAD SC, A1, A2 */ /************************************************/ static void construct_mic_header1( u8 *mic_header1, @@ -1205,7 +1205,7 @@ static void construct_mic_header1( mic_header1[0] = (u8)((header_length - 2) / 256); mic_header1[1] = (u8)((header_length - 2) % 256); #ifdef CONFIG_IEEE80211W - /* 802.11w management frame don't AND subtype bits 4,5,6 of frame control field */ + /* 802.11w management frame don't AND subtype bits 4, 5, 6 of frame control field */ if (frtype == WIFI_MGT_TYPE) mic_header1[2] = mpdu[0]; /* Mute CF poll & CF ack bits */ else @@ -1258,7 +1258,7 @@ static void construct_mic_header2( if (!qc_exists && a4_exists) { - for (i=0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */ + for (i =0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */ } @@ -1270,7 +1270,7 @@ static void construct_mic_header2( if (qc_exists && a4_exists) { - for (i=0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */ + for (i =0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */ mic_header2[14] = mpdu[30] & 0x0f; mic_header2[15] = mpdu[31] & 0x00; @@ -1299,7 +1299,7 @@ static void construct_ctr_preload( { sint i = 0; ; - for (i=0; i<16; i++) + for (i =0; i<16; i++) ctr_preload[i] = 0x00; i = 0; @@ -1335,7 +1335,7 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) { sint i; ; - for (i=0; i<16; i++) + for (i =0; i<16; i++) { out[i] = ina[i] ^ inb[i]; } @@ -1363,7 +1363,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, uint frtype = GetFrameType(pframe); uint frsubtype = GetFrameSubType(pframe); - frsubtype=frsubtype>>4; + frsubtype =frsubtype>>4; memset((void *)mic_iv, 0, 16); memset((void *)mic_header1, 0, 16); memset((void *)mic_header2, 0, 16); @@ -1466,7 +1466,7 @@ static sint aes_cipher(u8 *key, uint hdrlen, pframe[payload_index+j] = mic[j]; /* message[payload_index+j] = mic[j]; */ payload_index = hdrlen + 8; - for (i=0; i< num_blocks; i++) { + for (i =0; i< num_blocks; i++) { construct_ctr_preload( ctr_preload, a4_exists, @@ -1477,8 +1477,8 @@ static sint aes_cipher(u8 *key, uint hdrlen, frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */ aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);/* bitwise_xor(aes_out, &message[payload_index], chain_buffer); */ - for (j=0; j<16;j++) - pframe[payload_index++] = chain_buffer[j];/* for (j=0; j<16;j++) message[payload_index++] = chain_buffer[j]; */ + for (j =0; j<16;j++) + pframe[payload_index++] = chain_buffer[j];/* for (j =0; j<16;j++) message[payload_index++] = chain_buffer[j]; */ } if (payload_remainder > 0) /* If there is a short final block, then pad it,*/ @@ -1498,8 +1498,8 @@ static sint aes_cipher(u8 *key, uint hdrlen, padded_buffer[j] = pframe[payload_index+j];/* padded_buffer[j] = message[payload_index+j]; */ aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); - for (j=0; jattrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - struct xmit_priv *pxmitpriv=&padapter->xmitpriv; - u32 res=_SUCCESS; + struct security_priv *psecuritypriv =&padapter->securitypriv; + struct xmit_priv *pxmitpriv =&padapter->xmitpriv; + u32 res =_SUCCESS; - if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL) + if (((struct xmit_frame*)pxmitframe)->buf_addr ==NULL) return _FAIL; hw_hdr_offset = TXDESC_SIZE + @@ -1552,12 +1552,12 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset; /* 4 start to encrypt each fragment */ - if ((pattrib->encrypt==_AES_)){ + if ((pattrib->encrypt ==_AES_)){ if (pattrib->psta) { stainfo = pattrib->psta; } else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - stainfo=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); + stainfo =rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); } if (stainfo!=NULL){ @@ -1566,32 +1566,32 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) return _FAIL; } - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo!=NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo!=NULL!!!\n")); if (IS_MCAST(pattrib->ra)) - prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; + prwskey =psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; else - prwskey=&stainfo->dot118021x_UncstKey.skey[0]; - prwskeylen=16; + prwskey =&stainfo->dot118021x_UncstKey.skey[0]; + prwskeylen =16; - for (curfragnum=0;curfragnumnr_frags;curfragnum++){ + for (curfragnum =0;curfragnumnr_frags;curfragnum++){ - if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */ - length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; + if ((curfragnum+1) ==pattrib->nr_frags){ /* 4 the last fragment */ + length =pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len; - aes_cipher(prwskey,pattrib->hdrlen,pframe, length); + aes_cipher(prwskey, pattrib->hdrlen, pframe, length); } else { - length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; + length =pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len ; - aes_cipher(prwskey,pattrib->hdrlen,pframe, length); + aes_cipher(prwskey, pattrib->hdrlen, pframe, length); pframe+=pxmitpriv->frag_len; - pframe=(u8*)RND4((SIZE_PTR)(pframe)); + pframe =(u8*)RND4((SIZE_PTR)(pframe)); } } } else{ - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo==NULL!!!\n")); - DBG_871X("%s, psta==NUL\n", __func__); - res=_FAIL; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo ==NULL!!!\n")); + DBG_871X("%s, psta ==NUL\n", __func__); + res =_FAIL; } } @@ -1625,7 +1625,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, uint frtype = GetFrameType(pframe); uint frsubtype = GetFrameSubType(pframe); - frsubtype=frsubtype>>4; + frsubtype =frsubtype>>4; memset((void *)mic_iv, 0, 16); memset((void *)mic_header1, 0, 16); memset((void *)mic_header2, 0, 16); @@ -1677,7 +1677,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, payload_index = hdrlen + 8; /* 8 is for extiv */ - for (i=0; i< num_blocks; i++) { + for (i =0; i< num_blocks; i++) { construct_ctr_preload( ctr_preload, a4_exists, @@ -1691,7 +1691,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, &pframe[payload_index], chain_buffer); - for (j=0; j<16;j++) + for (j =0; j<16;j++) pframe[payload_index++] = chain_buffer[j]; } @@ -1715,7 +1715,7 @@ static sint aes_decipher(u8 *key, uint hdrlen, } aes128k128d(key, ctr_preload, aes_out); bitwise_xor(aes_out, padded_buffer, chain_buffer); - for (j=0; ju.hdr.attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - u32 res=_SUCCESS; + struct security_priv *psecuritypriv =&padapter->securitypriv; + u32 res =_SUCCESS; ; - pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; + pframe =(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; /* 4 start to encrypt each fragment */ - if ((prxattrib->encrypt==_AES_)){ - stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); + if ((prxattrib->encrypt ==_AES_)){ + stainfo =rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] ); if (stainfo!=NULL){ - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo!=NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_decrypt: stainfo!=NULL!!!\n")); if (IS_MCAST(prxattrib->ra)) { static u32 start = 0; @@ -1885,7 +1885,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) /* in concurrent we should use sw descrypt in group key, so we remove this message */ if (!psecuritypriv->binstallGrpkey) { - res=_FAIL; + res =_FAIL; if (start == 0) start = rtw_get_current_time(); @@ -1918,21 +1918,21 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; if (psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index) { - DBG_871X("not match packet_index=%d, install_index=%d\n" + DBG_871X("not match packet_index =%d, install_index =%d\n" , prxattrib->key_index, psecuritypriv->dot118021XGrpKeyid); - res=_FAIL; + res =_FAIL; goto exit; } } else { - prwskey=&stainfo->dot118021x_UncstKey.skey[0]; + prwskey =&stainfo->dot118021x_UncstKey.skey[0]; } - length= ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; + length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; - res= aes_decipher(prwskey,prxattrib->hdrlen,pframe, length); + res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length); } else { - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo==NULL!!!\n")); - res=_FAIL; + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo ==NULL!!!\n")); + res =_FAIL; } } @@ -1946,7 +1946,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) struct rx_pkt_attrib *pattrib = &((union recv_frame *)precvframe)->u.hdr.attrib; u8 *pframe; u8 *BIP_AAD, *p; - u32 res=_FAIL; + u32 res =_FAIL; uint len, ori_len; struct rtw_ieee80211_hdr *pwlanhdr; u8 mic[16]; @@ -1960,7 +1960,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) return _FAIL; } /* PKT start */ - pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; + pframe =(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data; /* mapping to wlan header */ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; /* save the frame body + MME */ @@ -1970,8 +1970,8 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) /* Baron */ if (p) { - u16 keyid=0; - u64 temp_ipn=0; + u16 keyid =0; + u64 temp_ipn =0; /* save packet number */ memcpy(&temp_ipn, p+4, 6); temp_ipn = le64_to_cpu(temp_ipn); @@ -2008,17 +2008,17 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) { int pp; DBG_871X("pkt: "); - for (pp=0;pp< pattrib->pkt_len; pp++) + for (pp =0;pp< pattrib->pkt_len; pp++) printk(" %02x ", pframe[pp]); DBG_871X("\n"); /* BIP AAD + management frame body + MME(MIC is zero) */ DBG_871X("AAD+PKT: "); - for (pp=0;pp< ori_len; pp++) + for (pp =0;pp< ori_len; pp++) DBG_871X(" %02x ", BIP_AAD[pp]); DBG_871X("\n"); /* show the MIC result */ DBG_871X("mic: "); - for (pp=0;pp<16; pp++) + for (pp =0;pp<16; pp++) DBG_871X(" %02x ", mic[pp]); DBG_871X("\n"); } @@ -2027,7 +2027,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe) if (_rtw_memcmp(mic, pframe+pattrib->pkt_len-8, 8)) { pmlmeext->mgnt_80211w_IPN_rx = temp_ipn; - res=_SUCCESS; + res =_SUCCESS; } else DBG_871X("BIP MIC error!\n"); @@ -2065,7 +2065,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf) } /* Compress */ -#define RND(a,b,c,d,e,f,g,h,i) \ +#define RND(a, b, c, d, e, f, g, h, i) \ t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ t1 = Sigma0(a) + Maj(a, b, c); \ d += t0; \ @@ -2573,7 +2573,7 @@ static void rijndaelEncrypt(u32 rk[/*44*/], u8 pt[16], u8 ct[16]) s2 = GETU32(pt + 8) ^ rk[2]; s3 = GETU32(pt + 12) ^ rk[3]; -#define ROUND(i,d,s) \ +#define ROUND(i, d, s) \ d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \ d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \ d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \ @@ -2581,15 +2581,15 @@ d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3] #ifdef FULL_UNROLL - ROUND(1,t,s); - ROUND(2,s,t); - ROUND(3,t,s); - ROUND(4,s,t); - ROUND(5,t,s); - ROUND(6,s,t); - ROUND(7,t,s); - ROUND(8,s,t); - ROUND(9,t,s); + ROUND(1, t, s); + ROUND(2, s, t); + ROUND(3, t, s); + ROUND(4, s, t); + ROUND(5, t, s); + ROUND(6, s, t); + ROUND(7, t, s); + ROUND(8, s, t); + ROUND(9, t, s); rk += Nr << 2; @@ -2598,11 +2598,11 @@ d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3] /* Nr - 1 full rounds: */ r = Nr >> 1; for (;;) { - ROUND(1,t,s); + ROUND(1, t, s); rk += 8; if (--r == 0) break; - ROUND(0,s,t); + ROUND(0, s, t); } #endif /* ?FULL_UNROLL */ @@ -2755,26 +2755,26 @@ void rtw_use_tkipkey_handler(void *FunctionContext) { struct adapter *padapter = (struct adapter *)FunctionContext; - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler ^^^\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler ^^^\n")); - padapter->securitypriv.busetkipkey=true; + padapter->securitypriv.busetkipkey =true; - RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler padapter->securitypriv.busetkipkey=%d^^^\n",padapter->securitypriv.busetkipkey)); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler padapter->securitypriv.busetkipkey =%d^^^\n", padapter->securitypriv.busetkipkey)); } /* Restore HW wep key setting according to key_mask */ void rtw_sec_restore_wep_key(struct adapter *adapter) { - struct security_priv* securitypriv=&(adapter->securitypriv); + struct security_priv* securitypriv =&(adapter->securitypriv); sint keyid; if ((_WEP40_ == securitypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == securitypriv->dot11PrivacyAlgrthm)) { - for (keyid=0;keyid<4;keyid++){ + for (keyid =0;keyid<4;keyid++){ if (securitypriv->key_mask & BIT(keyid)){ if (keyid == securitypriv->dot11PrivacyKeyIndex) - rtw_set_key(adapter,securitypriv, keyid, 1, true); + rtw_set_key(adapter, securitypriv, keyid, 1, true); else - rtw_set_key(adapter,securitypriv, keyid, 0, true); + rtw_set_key(adapter, securitypriv, keyid, 0, true); } } } @@ -2782,7 +2782,7 @@ void rtw_sec_restore_wep_key(struct adapter *adapter) u8 rtw_handle_tkip_countermeasure(struct adapter* adapter, const char *caller) { - struct security_priv* securitypriv=&(adapter->securitypriv); + struct security_priv* securitypriv =&(adapter->securitypriv); u8 status = _SUCCESS; if (securitypriv->btkip_countermeasure == true) { diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 654bcd3..a86863a 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -54,21 +54,21 @@ u8 sreset_get_wifi_status(struct adapter *padapter) { return status; } - val32 =rtw_read32(padapter,REG_TXDMA_STATUS); - if (val32==0xeaeaeaea){ + val32 =rtw_read32(padapter, REG_TXDMA_STATUS); + if (val32 ==0xeaeaeaea){ psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST; } else if (val32!=0){ - DBG_8192C("txdmastatu(%x)\n",val32); + DBG_8192C("txdmastatu(%x)\n", val32); psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR; } if (WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status) { - DBG_8192C("==>%s error_status(0x%x)\n",__FUNCTION__,psrtpriv->Wifi_Error_Status); + DBG_8192C("==>%s error_status(0x%x)\n", __FUNCTION__, psrtpriv->Wifi_Error_Status); status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL))); } - DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status); + DBG_8192C("==> %s wifi_status(0x%x)\n", __FUNCTION__, status); /* status restore */ psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS; @@ -101,7 +101,7 @@ static void sreset_restore_security_station(struct adapter *padapter) struct mlme_priv *mlmepriv = &padapter->mlmepriv; struct sta_priv * pstapriv = &padapter->stapriv; struct sta_info *psta; - struct security_priv* psecuritypriv=&(padapter->securitypriv); + struct security_priv* psecuritypriv =&(padapter->securitypriv); struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info; { @@ -125,9 +125,9 @@ static void sreset_restore_security_station(struct adapter *padapter) else { /* pairwise key */ - rtw_setstakey_cmd(padapter, (unsigned char *)psta, true,false); + rtw_setstakey_cmd(padapter, (unsigned char *)psta, true, false); /* group key */ - rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,false); + rtw_set_key(padapter,&padapter->securitypriv, padapter->securitypriv.dot118021XGrpKeyid, 0, false); } } } @@ -138,14 +138,14 @@ static void sreset_restore_network_station(struct adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,false); + rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure, false); { u8 threshold; - /* TH=1 => means that invalidate usb rx aggregation */ - /* TH=0 => means that validate usb rx aggregation, use init value. */ + /* TH =1 => means that invalidate usb rx aggregation */ + /* TH =0 => means that validate usb rx aggregation, use init value. */ if (mlmepriv->htpriv.ht_option) { - if (padapter->registrypriv.wifi_spec==1) + if (padapter->registrypriv.wifi_spec ==1) threshold = 1; else threshold = 0; @@ -172,7 +172,7 @@ static void sreset_restore_network_station(struct adapter *padapter) mlmeext_joinbss_event_callback(padapter, 1); /* restore Sequence No. */ - rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn); + rtw_write8(padapter, 0x4dc, padapter->xmitpriv.nqos_ssn); sreset_restore_security_station(padapter); } diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 8382ae1..68c4a2b 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -179,7 +179,7 @@ static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv ) while ((rtw_end_of_queue_search(phead, plist)) == false) { - psta = LIST_CONTAINOR(plist, struct sta_info ,list); + psta = LIST_CONTAINOR(plist, struct sta_info , list); plist = get_next(plist); } @@ -218,10 +218,10 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) while ((rtw_end_of_queue_search(phead, plist)) == false) { int i; - psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list); + psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); plist = get_next(plist); - for (i=0; i < 16 ; i++) + for (i =0; i < 16 ; i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer); @@ -276,11 +276,11 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) index = wifi_mac_hash(hwaddr); - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index)); + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("rtw_alloc_stainfo: index = %x", index)); if (index >= NUM_STA){ - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA")); - psta= NULL; + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("ERROR => rtw_alloc_stainfo: index >= NUM_STA")); + psta = NULL; goto exit; } phash_list = &(pstapriv->sta_hash[index]); @@ -297,13 +297,13 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) for ( i = 0; i < 16; i++ ) memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 ); - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n", - pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5])); + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n", + pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5])); init_addba_retry_timer(pstapriv->padapter, psta); /* for A-MPDU Rx reordering buffer control */ - for (i=0; i < 16 ; i++) { + for (i =0; i < 16 ; i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; preorder_ctrl->padapter = pstapriv->padapter; @@ -315,7 +315,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__, preorder_ctrl->indicate_seq); #endif - preorder_ctrl->wend_b= 0xffff; + preorder_ctrl->wend_b = 0xffff; /* preorder_ctrl->wsize_b = (NR_RECVBUFF-2); */ preorder_ctrl->wsize_b = 64;/* 64; */ @@ -345,7 +345,7 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) struct __queue *pfree_sta_queue; struct recv_reorder_ctrl *preorder_ctrl; struct sta_xmit_priv *pstaxmitpriv; - struct xmit_priv *pxmitpriv= &padapter->xmitpriv; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct sta_priv *pstapriv = &padapter->stapriv; struct hw_xmit *phwxmit; @@ -409,12 +409,12 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) spin_unlock_bh(&pxmitpriv->lock); rtw_list_delete(&psta->hash_list); - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5])); + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n", pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2], psta->hwaddr[3], psta->hwaddr[4], psta->hwaddr[5])); pstapriv->asoc_sta_count --; _cancel_timer_ex(&psta->addba_retry_timer); /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */ - for (i=0; i < 16 ; i++) + for (i =0; i < 16 ; i++) { unsigned long irqL; struct list_head *phead, *plist; @@ -505,19 +505,19 @@ void rtw_free_all_stainfo(struct adapter *padapter) ; - if (pstapriv->asoc_sta_count==1) + if (pstapriv->asoc_sta_count ==1) goto exit; spin_lock_bh(&pstapriv->sta_hash_lock); - for (index=0; index< NUM_STA; index++) + for (index =0; index< NUM_STA; index++) { phead = &(pstapriv->sta_hash[index]); plist = get_next(phead); while ((rtw_end_of_queue_search(phead, plist)) == false) { - psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list); + psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); plist = get_next(plist); @@ -549,11 +549,11 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u8 *addr; - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ; - if (hwaddr==NULL) + if (hwaddr ==NULL) return NULL; if (IS_MCAST(hwaddr)) @@ -578,11 +578,11 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); - if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== true) + if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN)) == true) { /* if found the matched address */ break; } - psta=NULL; + psta =NULL; plist = get_next(plist); } @@ -597,8 +597,8 @@ u32 rtw_init_bcmc_stainfo(struct adapter* padapter) struct sta_info *psta; struct tx_servq *ptxservq; - u32 res=_SUCCESS; - u8 bcast_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u32 res =_SUCCESS; + u8 bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct sta_priv *pstapriv = &padapter->stapriv; @@ -606,16 +606,16 @@ u32 rtw_init_bcmc_stainfo(struct adapter* padapter) psta = rtw_alloc_stainfo(pstapriv, bcast_addr); - if (psta==NULL){ - res=_FAIL; - RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail")); + if (psta ==NULL){ + res =_FAIL; + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); goto exit; } /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; - ptxservq= &(psta->sta_xmitpriv.be_q); + ptxservq = &(psta->sta_xmitpriv.be_q); exit: return _SUCCESS; @@ -624,7 +624,7 @@ exit: struct sta_info* rtw_get_bcmc_stainfo(struct adapter* padapter) { struct sta_priv *pstapriv = &padapter->stapriv; - u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; return rtw_get_stainfo(pstapriv, bc_addr); } diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index ba7c2f0..433c577 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -310,7 +310,7 @@ void UpdateBrateTbl( u8 rate; /* 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. */ - for (i=0;i 0x%08x\n",addr+j,cam_val[0]); + DBG_8192C("offset:0x%02x => 0x%08x\n", addr+j, cam_val[0]); } DBG_8192C("*********************************\n"); } @@ -669,7 +669,7 @@ void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) void clear_cam_entry(struct adapter *padapter, u8 entry) { unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00}; + unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; write_cam(padapter, entry, 0, null_sta, null_key); } @@ -743,7 +743,7 @@ int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_variable_ies struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if (pmlmepriv->qospriv.qos_option==0) + if (pmlmepriv->qospriv.qos_option ==0) { pmlmeinfo->WMM_enable = 0; return _FAIL; @@ -830,14 +830,14 @@ void WMMOnAssocRsp(struct adapter *padapter) inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; - if (pregpriv->wifi_spec==1) + if (pregpriv->wifi_spec ==1) { u32 j, tmp, change_inx; /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ - for (i=0; i<4; i++) + for (i =0; i<4; i++) { - for (j=i+1; j<4; j++) + for (j =i+1; j<4; j++) { /* compare CW and AIFS */ if ((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF)) @@ -867,7 +867,7 @@ void WMMOnAssocRsp(struct adapter *padapter) } } - for (i=0; i<4; i++) { + for (i =0; i<4; i++) { pxmitpriv->wmm_para_seq[i] = inx[i]; DBG_871X("wmm_para_seq(%d): %d\n", i, pxmitpriv->wmm_para_seq[i]); } @@ -981,7 +981,7 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_variable_ies * struct ht_priv *phtpriv = &pmlmepriv->htpriv; struct registry_priv *pregistrypriv = &padapter->registrypriv; - if (pIE==NULL) return; + if (pIE ==NULL) return; if (phtpriv->ht_option == false) return; @@ -1044,7 +1044,7 @@ void HT_info_handler(struct adapter *padapter, struct ndis_802_11_variable_ies * struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; - if (pIE==NULL) return; + if (pIE ==NULL) return; if (phtpriv->ht_option == false) return; @@ -1159,8 +1159,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) unsigned char *p; unsigned short val16, subtype; struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network); - /* u8 wpa_ie[255],rsn_ie[255]; */ - u16 wpa_len=0,rsn_len=0; + /* u8 wpa_ie[255], rsn_ie[255]; */ + u16 wpa_len =0, rsn_len =0; u8 encryp_protocol = 0; struct wlan_bssid_ex *bssid; int group_cipher = 0, pairwise_cipher = 0, is_8021x = 0; @@ -1168,7 +1168,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) u32 wpa_ielen = 0; u8 *pbssid = GetAddr3Ptr(pframe); u32 hidden_ssid = 0; - u8 cur_network_type, network_type=0; + u8 cur_network_type, network_type =0; struct HT_info_element *pht_info = NULL; struct ieee80211_ht_cap *pht_cap = NULL; u32 bcn_channel; @@ -1197,7 +1197,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) subtype = GetFrameSubType(pframe) >> 4; - if (subtype==WIFI_BEACON) + if (subtype ==WIFI_BEACON) bssid->Reserved[0] = 1; bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; @@ -1274,7 +1274,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) bssid->Ssid.Ssid[0] = '\0'; } - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("%s bssid.Ssid.Ssid:%s bssid.Ssid.SsidLength:%d " + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s bssid.Ssid.Ssid:%s bssid.Ssid.SsidLength:%d " "cur_network->network.Ssid.Ssid:%s len:%d\n", __func__, bssid->Ssid.Ssid, bssid->Ssid.SsidLength, cur_network->network.Ssid.Ssid, cur_network->network.Ssid.SsidLength)); @@ -1295,15 +1295,15 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) else bssid->Privacy = 0; - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_, + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s(): cur_network->network.Privacy is %d, bssid.Privacy is %d\n", - __func__, cur_network->network.Privacy,bssid->Privacy)); + __func__, cur_network->network.Privacy, bssid->Privacy)); if (cur_network->network.Privacy != bssid->Privacy) { - DBG_871X("%s(), privacy is not match return FAIL\n",__func__); + DBG_871X("%s(), privacy is not match return FAIL\n", __func__); goto _mismatch; } - rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL,&rsn_len,NULL,&wpa_len); + rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL,&rsn_len, NULL,&wpa_len); if (rsn_len > 0) { encryp_protocol = ENCRYP_PROTOCOL_WPA2; @@ -1315,7 +1315,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) } if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) { - DBG_871X("%s(): enctyp is not match ,return FAIL\n",__func__); + DBG_871X("%s(): enctyp is not match , return FAIL\n", __func__); goto _mismatch; } @@ -1323,7 +1323,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12); if (pbuf && (wpa_ielen>0)) { if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_, + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s pnetwork->pairwise_cipher: %d, group_cipher is %d, is_8021x is %d\n", __func__, pairwise_cipher, group_cipher, is_8021x)); } @@ -1332,24 +1332,24 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) if (pbuf && (wpa_ielen>0)) { if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) { - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_, + RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_802x is %d\n", __func__, pairwise_cipher, group_cipher, is_8021x)); } } } - RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_, - ("%s cur_network->group_cipher is %d: %d\n",__func__, cur_network->BcnInfo.group_cipher, group_cipher)); + RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, + ("%s cur_network->group_cipher is %d: %d\n", __func__, cur_network->BcnInfo.group_cipher, group_cipher)); if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) { - DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match ,return FAIL\n",__func__, + DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match , return FAIL\n", __func__, pairwise_cipher, cur_network->BcnInfo.pairwise_cipher, group_cipher, cur_network->BcnInfo.group_cipher); goto _mismatch; } if (is_8021x != cur_network->BcnInfo.is_8021x) { - DBG_871X("%s authentication is not match ,return FAIL\n", __func__); + DBG_871X("%s authentication is not match , return FAIL\n", __func__); goto _mismatch; } } @@ -1668,9 +1668,9 @@ int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps) unsigned char get_highest_rate_idx(u32 mask) { int i; - unsigned char rate_idx=0; + unsigned char rate_idx =0; - for (i=27; i>=0; i--) + for (i =27; i>=0; i--) { if (mask & BIT(i)) { @@ -1800,7 +1800,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) DBG_871X("link to Realtek 96B\n"); return HT_IOT_PEER_REALTEK; } - else if (_rtw_memcmp(pIE->data, AIRGOCAP_OUI,3)) + else if (_rtw_memcmp(pIE->data, AIRGOCAP_OUI, 3)) { DBG_871X("link to Airgo Cap\n"); return HT_IOT_PEER_AIRGO; @@ -2099,13 +2099,13 @@ int rtw_handle_dualmac(struct adapter *adapter, bool init) if (init) { if (pbuddy_padapter == NULL) { pbuddy_padapter = adapter; - DBG_871X("%s(): pbuddy_padapter == NULL, Set pbuddy_padapter\n",__FUNCTION__); + DBG_871X("%s(): pbuddy_padapter == NULL, Set pbuddy_padapter\n", __FUNCTION__); } else { adapter->pbuddy_adapter = pbuddy_padapter; pbuddy_padapter->pbuddy_adapter = adapter; /* clear global value */ pbuddy_padapter = NULL; - DBG_871X("%s(): pbuddy_padapter exist, Exchange Information\n",__FUNCTION__); + DBG_871X("%s(): pbuddy_padapter exist, Exchange Information\n", __FUNCTION__); } }else { pbuddy_padapter = NULL; diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 7295ff1..9040427 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -71,7 +71,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) int i; struct xmit_buf *pxmitbuf; struct xmit_frame *pxframe; - sint res=_SUCCESS; + sint res =_SUCCESS; u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; @@ -115,8 +115,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) if (pxmitpriv->pallocated_frame_buf == NULL){ pxmitpriv->pxmit_frame_buf =NULL; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xmit_frame fail!\n")); - res= _FAIL; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame fail!\n")); + res = _FAIL; goto exit; } pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4); @@ -154,8 +154,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->pallocated_xmitbuf = rtw_zvmalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4); if (pxmitpriv->pallocated_xmitbuf == NULL){ - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xmit_buf fail!\n")); - res= _FAIL; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_buf fail!\n")); + res = _FAIL; goto exit; } @@ -174,9 +174,9 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->ext_tag = false; /* Tx buf allocation may fail sometimes, so sleep and retry. */ - if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) == _FAIL) { + if ((res =rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) == _FAIL) { rtw_msleep_os(10); - res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); + res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); if (res == _FAIL) { goto exit; } @@ -186,7 +186,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmitbuf_queue.queue)); #ifdef DBG_XMIT_BUF - pxmitbuf->no=i; + pxmitbuf->no =i; #endif pxmitbuf++; @@ -202,8 +202,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) if (pxmitpriv->xframe_ext_alloc_addr == NULL){ pxmitpriv->xframe_ext = NULL; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xframe_ext fail!\n")); - res= _FAIL; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xframe_ext fail!\n")); + res = _FAIL; goto exit; } pxmitpriv->xframe_ext = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->xframe_ext_alloc_addr), 4); @@ -234,8 +234,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); if (pxmitpriv->pallocated_xmit_extbuf == NULL){ - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("alloc xmit_extbuf fail!\n")); - res= _FAIL; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_extbuf fail!\n")); + res = _FAIL; goto exit; } @@ -262,14 +262,14 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4); */ - if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) { - res= _FAIL; + if ((res =rtw_os_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) { + res = _FAIL; goto exit; } rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmit_extbuf_queue.queue)); #ifdef DBG_XMIT_BUF_EXT - pxmitbuf->no=i; + pxmitbuf->no =i; #endif pxmitbuf++; @@ -285,7 +285,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->wmm_para_seq[i] = i; } - pxmitpriv->txirp_cnt=1; + pxmitpriv->txirp_cnt =1; _rtw_init_sema(&(pxmitpriv->tx_retevt), 0); @@ -329,19 +329,19 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) rtw_mfree_xmit_priv_lock(pxmitpriv); - if (pxmitpriv->pxmit_frame_buf==NULL) + if (pxmitpriv->pxmit_frame_buf ==NULL) goto out; - for (i=0; ipallocated_buf) */ /* rtw_mfree(pxmitbuf->pallocated_buf, MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ); */ @@ -360,7 +360,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv) /* free xframe_ext queue, the same count as extbuf */ if ((pxmitframe = (struct xmit_frame*)pxmitpriv->xframe_ext)) { - for (i=0; ipxmit_extbuf; - for (i=0; ipallocated_buf) */ /* rtw_mfree(pxmitbuf->pallocated_buf, max_xmit_extbuf_size); */ @@ -409,12 +409,12 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - psta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); + psta =rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] ); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return; } @@ -458,7 +458,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * while (true) { /* IOT action */ - if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en==true) && + if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en ==true) && (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ )) { pattrib->vcs_mode = CTS_TO_SELF; @@ -499,7 +499,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame * /* to do list: check MIMO power save condition. */ /* check AMPDU aggregation for TXOP */ - if (pattrib->ampdu_en==true) + if (pattrib->ampdu_en ==true) { pattrib->vcs_mode = RTS_CTS; break; @@ -522,16 +522,16 @@ static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info * pattrib->mdata = 0; pattrib->eosp = 0; - pattrib->triggered=0; + pattrib->triggered =0; - /* qos_en, ht_en, init rate, ,bw, ch_offset, sgi */ + /* qos_en, ht_en, init rate, , bw, ch_offset, sgi */ pattrib->qos_en = psta->qos_option; pattrib->raid = psta->raid; pattrib->ht_en = psta->htpriv.ht_option; pattrib->bwmode = psta->htpriv.bwmode; pattrib->ch_offset = psta->htpriv.ch_offset; - pattrib->sgi= psta->htpriv.sgi; + pattrib->sgi = psta->htpriv.sgi; pattrib->ampdu_en = false; pattrib->retry_ctrl = false; } @@ -605,7 +605,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p struct sta_priv *pstapriv = &padapter->stapriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv= &pmlmepriv->qospriv; + struct qos_priv *pqospriv = &pmlmepriv->qospriv; sint res = _SUCCESS; ; @@ -650,7 +650,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p ((tmp[21] == 67) && (tmp[23] == 68))) { /* 68 : UDP BOOTP client */ /* 67 : UDP BOOTP server */ - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("======================update_attrib: get DHCP Packet\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("======================update_attrib: get DHCP Packet\n")); /* Use low rate to send DHCP packet. */ pattrib->dhcp_pkt = 1; } @@ -684,7 +684,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p res =_FAIL; goto exit; } - else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)==true)&&(!(psta->state & _FW_LINKED))) + else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) ==true)&&(!(psta->state & _FW_LINKED))) { res =_FAIL; goto exit; @@ -694,7 +694,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p if (psta) { pattrib->mac_id = psta->mac_id; - /* DBG_8192C("%s ==> mac_id(%d)\n",__FUNCTION__,pattrib->mac_id ); */ + /* DBG_8192C("%s ==> mac_id(%d)\n", __FUNCTION__, pattrib->mac_id ); */ pattrib->psta = psta; } else @@ -734,15 +734,15 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p } } if (psta->ieee8021x_blocked == true) { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\n psta->ieee8021x_blocked == true\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\n psta->ieee8021x_blocked == true\n")); pattrib->encrypt = 0; if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n",pattrib->ether_type)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n", pattrib->ether_type)); #ifdef DBG_TX_DROP_FRAME - DBG_871X("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked == true, pattrib->ether_type(%04x) != 0x888e\n", __FUNCTION__,pattrib->ether_type); + DBG_871X("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked == true, pattrib->ether_type(%04x) != 0x888e\n", __FUNCTION__, pattrib->ether_type); #endif res = _FAIL; goto exit; @@ -785,11 +785,11 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p pattrib->iv_len = 8; pattrib->icv_len = 4; - if (padapter->securitypriv.busetkipkey==_FAIL) + if (padapter->securitypriv.busetkipkey ==_FAIL) { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\npadapter->securitypriv.busetkipkey(%d)==_FAIL drop packet\n", padapter->securitypriv.busetkipkey)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npadapter->securitypriv.busetkipkey(%d) ==_FAIL drop packet\n", padapter->securitypriv.busetkipkey)); #ifdef DBG_TX_DROP_FRAME - DBG_871X("DBG_TX_DROP_FRAME %s padapter->securitypriv.busetkipkey(%d)==_FAIL drop packet\n", __FUNCTION__, padapter->securitypriv.busetkipkey); + DBG_871X("DBG_TX_DROP_FRAME %s padapter->securitypriv.busetkipkey(%d) ==_FAIL drop packet\n", __FUNCTION__, padapter->securitypriv.busetkipkey); #endif res =_FAIL; goto exit; @@ -797,7 +797,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p break; case _AES_: - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("pattrib->encrypt=%d (_AES_)\n",pattrib->encrypt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("pattrib->encrypt =%d (_AES_)\n", pattrib->encrypt)); pattrib->iv_len = 8; pattrib->icv_len = 8; break; @@ -808,19 +808,19 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p } RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, - ("update_attrib: encrypt=%d securitypriv.sw_encrypt=%d\n", + ("update_attrib: encrypt =%d securitypriv.sw_encrypt =%d\n", pattrib->encrypt, padapter->securitypriv.sw_encrypt)); if (pattrib->encrypt && ((padapter->securitypriv.sw_encrypt == true) || (psecuritypriv->hw_decrypted == false))) { pattrib->bswenc = true; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_, - ("update_attrib: encrypt=%d securitypriv.hw_decrypted=%d bswenc=true\n", + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, + ("update_attrib: encrypt =%d securitypriv.hw_decrypted =%d bswenc =true\n", pattrib->encrypt, padapter->securitypriv.sw_encrypt)); } else { pattrib->bswenc = false; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=false\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("update_attrib: bswenc =false\n")); } update_attrib_phy_info(pattrib, psta); @@ -829,15 +829,15 @@ exit: } static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe){ - sint curfragnum,length; - u8 *pframe, *payload,mic[8]; + sint curfragnum, length; + u8 *pframe, *payload, mic[8]; struct mic_data micdata; struct sta_info *stainfo; - struct qos_priv *pqospriv= &(padapter->mlmepriv.qospriv); + struct qos_priv *pqospriv = &(padapter->mlmepriv.qospriv); struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct security_priv *psecuritypriv=&padapter->securitypriv; - struct xmit_priv *pxmitpriv=&padapter->xmitpriv; - u8 priority[4]={0x0,0x0,0x0,0x0}; + struct security_priv *psecuritypriv =&padapter->securitypriv; + struct xmit_priv *pxmitpriv =&padapter->xmitpriv; + u8 priority[4]={0x0, 0x0, 0x0, 0x0}; u8 hw_hdr_offset = 0; sint bmcst = IS_MCAST(pattrib->ra); @@ -848,12 +848,12 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - stainfo=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]); + stainfo =rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]); } - if (stainfo==NULL) + if (stainfo ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return _FAIL; } @@ -867,18 +867,18 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr hw_hdr_offset = TXDESC_SIZE + (pxmitframe->pkt_offset * PACKET_OFFSET_SZ);; - if (pattrib->encrypt ==_TKIP_)/* if (psecuritypriv->dot11PrivacyAlgrthm==_TKIP_PRIVACY_) */ + if (pattrib->encrypt ==_TKIP_)/* if (psecuritypriv->dot11PrivacyAlgrthm ==_TKIP_PRIVACY_) */ { /* encode mic code */ if (stainfo!= NULL){ - u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + u8 null_key[16]={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; pframe = pxmitframe->buf_addr + hw_hdr_offset; if (bmcst) { - if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16)==true){ - /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ + if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16) ==true){ + /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey ==0\n"); */ /* rtw_msleep_os(10); */ return _FAIL; } @@ -887,8 +887,8 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr } else { - if (_rtw_memcmp(&stainfo->dot11tkiptxmickey.skey[0],null_key, 16)==true){ - /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ + if (_rtw_memcmp(&stainfo->dot11tkiptxmickey.skey[0], null_key, 16) ==true){ + /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey ==0\n"); */ /* rtw_msleep_os(10); */ return _FAIL; } @@ -896,69 +896,69 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr rtw_secmicsetkey(&micdata, &stainfo->dot11tkiptxmickey.skey[0]); } - if (pframe[1]&1){ /* ToDS==1 */ + if (pframe[1]&1){ /* ToDS ==1 */ rtw_secmicappend(&micdata, &pframe[16], 6); /* DA */ - if (pframe[1]&2) /* From Ds==1 */ + if (pframe[1]&2) /* From Ds ==1 */ rtw_secmicappend(&micdata, &pframe[24], 6); else rtw_secmicappend(&micdata, &pframe[10], 6); - } else{ /* ToDS==0 */ + } else{ /* ToDS ==0 */ rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */ - if (pframe[1]&2) /* From Ds==1 */ + if (pframe[1]&2) /* From Ds ==1 */ rtw_secmicappend(&micdata, &pframe[16], 6); else rtw_secmicappend(&micdata, &pframe[10], 6); } - /* if (pqospriv->qos_option==1) */ + /* if (pqospriv->qos_option ==1) */ if (pattrib->qos_en) priority[0]=(u8)pxmitframe->attrib.priority; rtw_secmicappend(&micdata, &priority[0], 4); - payload=pframe; + payload =pframe; - for (curfragnum=0;curfragnumnr_frags;curfragnum++){ - payload=(u8 *)RND4((SIZE_PTR)(payload)); - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("===curfragnum=%d, pframe= 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n", + for (curfragnum =0;curfragnumnr_frags;curfragnum++){ + payload =(u8 *)RND4((SIZE_PTR)(payload)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("===curfragnum =%d, pframe = 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n", curfragnum,*payload, *(payload+1),*(payload+2),*(payload+3),*(payload+4),*(payload+5),*(payload+6),*(payload+7))); - payload=payload+pattrib->hdrlen+pattrib->iv_len; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("curfragnum=%d pattrib->hdrlen=%d pattrib->iv_len=%d",curfragnum,pattrib->hdrlen,pattrib->iv_len)); - if ((curfragnum+1)==pattrib->nr_frags){ - length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-( (pattrib->bswenc) ? pattrib->icv_len : 0); - rtw_secmicappend(&micdata, payload,length); - payload=payload+length; + payload =payload+pattrib->hdrlen+pattrib->iv_len; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("curfragnum =%d pattrib->hdrlen =%d pattrib->iv_len =%d", curfragnum, pattrib->hdrlen, pattrib->iv_len)); + if ((curfragnum+1) ==pattrib->nr_frags){ + length =pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-( (pattrib->bswenc) ? pattrib->icv_len : 0); + rtw_secmicappend(&micdata, payload, length); + payload =payload+length; } else{ - length=pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-( (pattrib->bswenc) ? pattrib->icv_len : 0); + length =pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-( (pattrib->bswenc) ? pattrib->icv_len : 0); rtw_secmicappend(&micdata, payload, length); - payload=payload+length+pattrib->icv_len; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("curfragnum=%d length=%d pattrib->icv_len=%d",curfragnum,length,pattrib->icv_len)); + payload =payload+length+pattrib->icv_len; + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("curfragnum =%d length =%d pattrib->icv_len =%d", curfragnum, length, pattrib->icv_len)); } } rtw_secgetmic(&micdata,&(mic[0])); - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("xmitframe_addmic: before add mic code!!!\n")); - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("xmitframe_addmic: pattrib->last_txcmdsz=%d!!!\n",pattrib->last_txcmdsz)); - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("xmitframe_addmic: mic[0]=0x%.2x ,mic[1]=0x%.2x ,mic[2]=0x%.2x ,mic[3]=0x%.2x\n\ - mic[4]=0x%.2x ,mic[5]=0x%.2x ,mic[6]=0x%.2x ,mic[7]=0x%.2x !!!!\n", - mic[0],mic[1],mic[2],mic[3],mic[4],mic[5],mic[6],mic[7])); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: before add mic code!!!\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: pattrib->last_txcmdsz =%d!!!\n", pattrib->last_txcmdsz)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: mic[0]=0x%.2x , mic[1]=0x%.2x , mic[2]=0x%.2x , mic[3]=0x%.2x\n\ + mic[4]=0x%.2x , mic[5]=0x%.2x , mic[6]=0x%.2x , mic[7]=0x%.2x !!!!\n", + mic[0], mic[1], mic[2], mic[3], mic[4], mic[5], mic[6], mic[7])); /* add mic code and add the mic code length in last_txcmdsz */ - memcpy(payload, &(mic[0]),8); + memcpy(payload, &(mic[0]), 8); pattrib->last_txcmdsz+=8; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("\n ========last pkt========\n")); - payload=payload-pattrib->last_txcmdsz+8; - for (curfragnum=0;curfragnumlast_txcmdsz;curfragnum=curfragnum+8) - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,(" %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x ", + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("\n ========last pkt ========\n")); + payload =payload-pattrib->last_txcmdsz+8; + for (curfragnum =0;curfragnumlast_txcmdsz;curfragnum =curfragnum+8) + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, (" %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x ", *(payload+curfragnum), *(payload+curfragnum+1), *(payload+curfragnum+2),*(payload+curfragnum+3), *(payload+curfragnum+4),*(payload+curfragnum+5),*(payload+curfragnum+6),*(payload+curfragnum+7))); } else{ - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("xmitframe_addmic: rtw_get_stainfo==NULL!!!\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: rtw_get_stainfo ==NULL!!!\n")); } } @@ -970,7 +970,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe){ struct pkt_attrib *pattrib = &pxmitframe->attrib; - /* struct security_priv *psecuritypriv=&padapter->securitypriv; */ + /* struct security_priv *psecuritypriv =&padapter->securitypriv; */ ; @@ -978,7 +978,7 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi if (pattrib->bswenc) { /* DBG_871X("start xmitframe_swencrypt\n"); */ - RT_TRACE(_module_rtl871x_xmit_c_,_drv_alert_,("### xmitframe_swencrypt\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("### xmitframe_swencrypt\n")); switch (pattrib->encrypt){ case _WEP40_: case _WEP104_: @@ -995,7 +995,7 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi } } else { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_notice_,("### xmitframe_hwencrypt\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_, ("### xmitframe_hwencrypt\n")); } ; @@ -1032,9 +1032,9 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat } } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return _FAIL; } @@ -1082,7 +1082,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat qos_option = true; } else { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("fw_state:%x is not allowed to xmit frame\n", get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("fw_state:%x is not allowed to xmit frame\n", get_fwstate(pmlmepriv))); res = _FAIL; goto exit; } @@ -1191,12 +1191,12 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pat else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - psta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]); + psta =rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return 0; } @@ -1294,10 +1294,10 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return _FAIL; } @@ -1309,7 +1309,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct } if (pxmitframe->buf_addr == NULL){ - DBG_8192C("==> %s buf_addr==NULL\n",__FUNCTION__); + DBG_8192C("==> %s buf_addr ==NULL\n", __FUNCTION__); return _FAIL; } @@ -1379,7 +1379,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct memcpy(pframe, pattrib->iv, pattrib->iv_len); RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_, - ("rtw_xmitframe_coalesce: keyid=%d pattrib->iv[3]=%.2x pframe=%.2x %.2x %.2x %.2x\n", + ("rtw_xmitframe_coalesce: keyid =%d pattrib->iv[3]=%.2x pframe =%.2x %.2x %.2x %.2x\n", padapter->securitypriv.dot11PrivacyKeyIndex, pattrib->iv[3], *pframe, *(pframe+1), *(pframe+2), *(pframe+3))); pframe += pattrib->iv_len; @@ -1418,7 +1418,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct { pattrib->nr_frags = frg_inx; - pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags==1)? llc_sz:0) + + pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags ==1)? llc_sz:0) + ((pattrib->bswenc) ? pattrib->icv_len : 0) + mem_sz; ClearMFrag(mem_start); @@ -1437,8 +1437,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) { - RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic(padapter, pxmitframe)==_FAIL\n")); - DBG_8192C("xmitframe_addmic(padapter, pxmitframe)==_FAIL\n"); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic(padapter, pxmitframe) ==_FAIL\n")); + DBG_8192C("xmitframe_addmic(padapter, pxmitframe) ==_FAIL\n"); res = _FAIL; goto exit; } @@ -1464,7 +1464,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s struct pkt_file pktfile; s32 frg_inx, frg_len, mpdu_len, llc_sz, mem_sz; SIZE_PTR addr; - u8 *pframe, *mem_start = NULL, *tmp_buf=NULL; + u8 *pframe, *mem_start = NULL, *tmp_buf =NULL; u8 hw_hdr_offset, subtype ; struct sta_info *psta = NULL; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -1473,7 +1473,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s s32 bmcst = IS_MCAST(pattrib->ra); s32 res = _FAIL; u8 *BIP_AAD; - u8 *MGMT_body=NULL; + u8 *MGMT_body =NULL; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1520,7 +1520,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pattrib->pktlen; - /* octent 0 and 1 is key index ,BIP keyid is 4 or 5, LSB only need octent 0 */ + /* octent 0 and 1 is key index , BIP keyid is 4 or 5, LSB only need octent 0 */ MME[0]=padapter->securitypriv.dot11wBIPKeyid; /* copy packet number */ memcpy(&MME[2], &pmlmeext->mgnt_80211w_IPN, 6); @@ -1546,7 +1546,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int i; printk("Total packet: "); - for (i=0; i < BIP_AAD_SIZE+frame_body_len; i++) + for (i =0; i < BIP_AAD_SIZE+frame_body_len; i++) printk(" %02x ", BIP_AAD[i]); printk("\n"); }*/ @@ -1559,7 +1559,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int i; printk("Calculated mic result: "); - for (i=0; i<16; i++) + for (i =0; i<16; i++) printk(" %02x ", mic[i]); printk("\n"); }*/ @@ -1569,7 +1569,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int pp; printk("pattrib->pktlen = %d\n", pattrib->pktlen); - for (pp=0;pp< pattrib->pktlen; pp++) + for (pp =0;pp< pattrib->pktlen; pp++) printk(" %02x ", mem_start[pp]); printk("\n"); }*/ @@ -1587,20 +1587,20 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); goto xmitframe_coalesce_fail; } - if (!(psta->state & _FW_LINKED) || pxmitframe->buf_addr==NULL) + if (!(psta->state & _FW_LINKED) || pxmitframe->buf_addr ==NULL) { DBG_871X("%s, not _FW_LINKED or addr null\n", __func__); goto xmitframe_coalesce_fail; } - /* DBG_871X("%s, action frame category=%d\n", __func__, pframe[WLAN_HDR_A3_LEN]); */ + /* DBG_871X("%s, action frame category =%d\n", __func__, pframe[WLAN_HDR_A3_LEN]); */ /* according 802.11-2012 standard, these five types are not robust types */ if (subtype == WIFI_ACTION && (pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_PUBLIC || @@ -1613,7 +1613,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int i; printk("Management pkt: "); - for (i=0; ipktlen; i++) + for (i =0; ipktlen; i++) printk(" %02x ", pframe[i]); printk("=======\n"); }*/ @@ -1650,7 +1650,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int i; printk("Management pkt + IV: "); - /* for (i=0; ipktlen; i++) */ + /* for (i =0; ipktlen; i++) */ /* printk(" %02x ", mem_start[i]); */ printk("@@@@@@@@@@@@@\n"); }*/ @@ -1670,7 +1670,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s { int i; printk("prepare to enc Management pkt + IV: "); - for (i=0; ipktlen; i++) + for (i =0; ipktlen; i++) printk(" %02x ", mem_start[i]); printk("@@@@@@@@@@@@@\n"); }*/ @@ -1821,7 +1821,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) { pxmitpriv->free_xmit_extbuf_cnt--; #ifdef DBG_XMIT_BUF_EXT - DBG_871X("DBG_XMIT_BUF_EXT ALLOC no=%d, free_xmit_extbuf_cnt=%d\n",pxmitbuf->no, pxmitpriv->free_xmit_extbuf_cnt); + DBG_871X("DBG_XMIT_BUF_EXT ALLOC no =%d, free_xmit_extbuf_cnt =%d\n", pxmitbuf->no, pxmitpriv->free_xmit_extbuf_cnt); #endif @@ -1845,7 +1845,7 @@ s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue; unsigned long flags; - if (pxmitbuf==NULL) + if (pxmitbuf ==NULL) return _FAIL; spin_lock_irqsave(&pfree_queue->lock, flags); @@ -1855,7 +1855,7 @@ s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_queue)); pxmitpriv->free_xmit_extbuf_cnt++; #ifdef DBG_XMIT_BUF_EXT - DBG_871X("DBG_XMIT_BUF_EXT FREE no=%d, free_xmit_extbuf_cnt=%d\n",pxmitbuf->no ,pxmitpriv->free_xmit_extbuf_cnt); + DBG_871X("DBG_XMIT_BUF_EXT FREE no =%d, free_xmit_extbuf_cnt =%d\n", pxmitbuf->no , pxmitpriv->free_xmit_extbuf_cnt); #endif spin_unlock_irqrestore(&pfree_queue->lock, flags); @@ -1893,9 +1893,9 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) { pxmitpriv->free_xmitbuf_cnt--; #ifdef DBG_XMIT_BUF - DBG_871X("DBG_XMIT_BUF ALLOC no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no, pxmitpriv->free_xmitbuf_cnt); + DBG_871X("DBG_XMIT_BUF ALLOC no =%d, free_xmitbuf_cnt =%d\n", pxmitbuf->no, pxmitpriv->free_xmitbuf_cnt); #endif - /* DBG_871X("alloc, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ + /* DBG_871X("alloc, free_xmitbuf_cnt =%d\n", pxmitpriv->free_xmitbuf_cnt); */ pxmitbuf->priv_data = NULL; /* pxmitbuf->ext_tag = false; */ @@ -1921,7 +1921,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; unsigned long flags; - if (pxmitbuf==NULL) + if (pxmitbuf ==NULL) return _FAIL; if (pxmitbuf->sctx) { @@ -1939,9 +1939,9 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue)); pxmitpriv->free_xmitbuf_cnt++; - /* DBG_871X("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt); */ + /* DBG_871X("FREE, free_xmitbuf_cnt =%d\n", pxmitpriv->free_xmitbuf_cnt); */ #ifdef DBG_XMIT_BUF - DBG_871X("DBG_XMIT_BUF FREE no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no ,pxmitpriv->free_xmitbuf_cnt); + DBG_871X("DBG_XMIT_BUF FREE no =%d, free_xmitbuf_cnt =%d\n", pxmitbuf->no , pxmitpriv->free_xmitbuf_cnt); #endif spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, flags); } @@ -2000,7 +2000,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf spin_lock_bh(&pfree_xmit_queue->lock); if (_rtw_queue_empty(pfree_xmit_queue) == true) { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt)); pxframe = NULL; } else { phead = get_list_head(pfree_xmit_queue); @@ -2011,7 +2011,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf rtw_list_delete(&(pxframe->list)); pxmitpriv->free_xmitframe_cnt--; - RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe():free_xmitframe_cnt =%d\n", pxmitpriv->free_xmitframe_cnt)); } spin_unlock_bh(&pfree_xmit_queue->lock); @@ -2034,7 +2034,7 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv) spin_lock_bh(&queue->lock); if (_rtw_queue_empty(queue) == true) { - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_alloc_xmitframe_ext:%d\n", pxmitpriv->free_xframe_ext_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe_ext:%d\n", pxmitpriv->free_xframe_ext_cnt)); pxframe = NULL; } else { phead = get_list_head(queue); @@ -2043,7 +2043,7 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv) rtw_list_delete(&(pxframe->list)); pxmitpriv->free_xframe_ext_cnt--; - RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe_ext():free_xmitframe_cnt=%d\n", pxmitpriv->free_xframe_ext_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe_ext():free_xmitframe_cnt =%d\n", pxmitpriv->free_xframe_ext_cnt)); } spin_unlock_bh(&queue->lock); @@ -2093,7 +2093,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram ; if (pxmitframe == NULL) { - RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("======rtw_free_xmitframe():pxmitframe==NULL!!!!!!!!!!\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("======rtw_free_xmitframe():pxmitframe ==NULL!!!!!!!!!!\n")); goto exit; } @@ -2121,10 +2121,10 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram rtw_list_insert_tail(&pxmitframe->list, get_list_head(queue)); if (pxmitframe->ext_tag == 0) { pxmitpriv->free_xmitframe_cnt++; - RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt =%d\n", pxmitpriv->free_xmitframe_cnt)); } else if (pxmitframe->ext_tag == 1) { pxmitpriv->free_xframe_ext_cnt++; - RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xframe_ext_cnt=%d\n", pxmitpriv->free_xframe_ext_cnt)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xframe_ext_cnt =%d\n", pxmitpriv->free_xframe_ext_cnt)); } else { } @@ -2161,7 +2161,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfra plist = get_next(plist); - rtw_free_xmitframe(pxmitpriv,pxmitframe); + rtw_free_xmitframe(pxmitpriv, pxmitframe); } spin_unlock_bh(&(pframequeue->lock)); @@ -2185,7 +2185,7 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit, struct tx_servq *ptxservq, struct __queue *pframe_queue) { struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; + struct xmit_frame *pxmitframe =NULL; xmitframe_phead = get_list_head(pframe_queue); xmitframe_plist = get_next(xmitframe_phead); @@ -2220,10 +2220,10 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; - if (pregpriv->wifi_spec==1) + if (pregpriv->wifi_spec ==1) { int j, tmp, acirp_cnt[4]; - for (j=0; j<4; j++) + for (j =0; j<4; j++) inx[j] = pxmitpriv->wmm_para_seq[j]; } @@ -2239,7 +2239,7 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi while ((rtw_end_of_queue_search(sta_phead, sta_plist)) == false) { - ptxservq= LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending); + ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending); pframe_queue = &ptxservq->sta_pending; @@ -2270,7 +2270,7 @@ exit: struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info *psta, sint up, u8 *ac) { - struct tx_servq *ptxservq=NULL; + struct tx_servq *ptxservq =NULL; ; @@ -2280,21 +2280,21 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info * case 2: ptxservq = &(psta->sta_xmitpriv.bk_q); *(ac) = 3; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_get_sta_pending : BK\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : BK\n")); break; case 4: case 5: ptxservq = &(psta->sta_xmitpriv.vi_q); *(ac) = 1; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_get_sta_pending : VI\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : VI\n")); break; case 6: case 7: ptxservq = &(psta->sta_xmitpriv.vo_q); *(ac) = 0; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_get_sta_pending : VO\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : VO\n")); break; case 0: @@ -2302,7 +2302,7 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info * default: ptxservq = &(psta->sta_xmitpriv.be_q); *(ac) = 2; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("rtw_get_sta_pending : BE\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : BE\n")); break; } @@ -2338,7 +2338,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) if (psta == NULL) { res = _FAIL; DBG_8192C("rtw_xmit_classifier: psta == NULL\n"); - RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("rtw_xmit_classifier: psta == NULL\n")); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("rtw_xmit_classifier: psta == NULL\n")); goto exit; } @@ -2456,8 +2456,8 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) struct xmit_priv *pxmitpriv = &padapter->xmitpriv; /* if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) */ { - int res, is_vlan_tag=0, i, do_nat25=1; - unsigned short vlan_hdr=0; + int res, is_vlan_tag =0, i, do_nat25 =1; + unsigned short vlan_hdr =0; void *br_port = NULL; /* mac_clone_handle_frame(priv, skb); */ @@ -2485,11 +2485,11 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) if (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_8021Q)) { is_vlan_tag = 1; vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN*2+2)); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((unsigned short *)(skb->data+MACADDRLEN*2+2-i*2)) = *((unsigned short *)(skb->data+MACADDRLEN*2-2-i*2)); skb_pull(skb, 4); } - /* if SA == br_mac && skb== IP => copy SIP to br_ip ?? why */ + /* if SA == br_mac && skb == IP => copy SIP to br_ip ?? why */ if (!memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) && (*((__be16 *)(skb->data+MACADDRLEN*2)) == __constant_htons(ETH_P_IP))) memcpy(padapter->br_ip, skb->data+WLAN_ETHHDR_LEN+12, 4); @@ -2523,7 +2523,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) if (is_vlan_tag) { skb_push(skb, 4); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2)); *((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q); *((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr; @@ -2541,7 +2541,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) *pskb = skb = newskb; if (is_vlan_tag) { vlan_hdr = *((unsigned short *)(skb->data+MACADDRLEN*2+2)); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((unsigned short *)(skb->data+MACADDRLEN*2+2-i*2)) = *((unsigned short *)(skb->data+MACADDRLEN*2-2-i*2)); skb_pull(skb, 4); } @@ -2584,7 +2584,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) if (is_vlan_tag) { skb_push(skb, 4); - for (i=0; i<6; i++) + for (i =0; i<6; i++) *((unsigned short *)(skb->data+i*2)) = *((unsigned short *)(skb->data+4+i*2)); *((__be16 *)(skb->data+MACADDRLEN*2)) = __constant_htons(ETH_P_8021Q); *((unsigned short *)(skb->data+MACADDRLEN*2+2)) = vlan_hdr; @@ -2594,7 +2594,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) if (memcmp(skb->data+MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN)) { /* priv->ext_stats.tx_drops++; */ DEBUG_ERR("TX DROP: untransformed frame SA:%02X%02X%02X%02X%02X%02X!\n", - skb->data[6],skb->data[7],skb->data[8],skb->data[9],skb->data[10],skb->data[11]); + skb->data[6], skb->data[7], skb->data[8], skb->data[9], skb->data[10], skb->data[11]); /* goto free_and_stop; */ return -1; } @@ -2648,7 +2648,7 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib u8 qsel; qsel = pattrib->priority; - RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("### do_queue_select priority=%d ,qsel = %d\n",pattrib->priority ,qsel)); + RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("### do_queue_select priority =%d , qsel = %d\n", pattrib->priority , qsel)); pattrib->qsel = qsel; } @@ -2750,8 +2750,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe) { - sint ret=false; - struct sta_info *psta=NULL; + sint ret =false; + struct sta_info *psta =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct pkt_attrib *pattrib = &pxmitframe->attrib; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -2767,12 +2767,12 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr else { DBG_871X("%s, call rtw_get_stainfo()\n", __func__); - psta=rtw_get_stainfo(pstapriv, pattrib->ra); + psta =rtw_get_stainfo(pstapriv, pattrib->ra); } - if (psta==NULL) + if (psta ==NULL) { - DBG_871X("%s, psta==NUL\n", __func__); + DBG_871X("%s, psta ==NUL\n", __func__); return false; } @@ -2782,11 +2782,11 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr return false; } - if (pattrib->triggered==1) + if (pattrib->triggered ==1) { /* DBG_871X("directly xmit pspoll_triggered packet\n"); */ - /* pattrib->triggered=0; */ + /* pattrib->triggered =0; */ if (bmcst) pattrib->qsel = 0x11;/* HIQ */ @@ -2826,7 +2826,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr if (psta->state&WIFI_SLEEP_STATE) { - u8 wmmps_ac=0; + u8 wmmps_ac =0; if (pstapriv->sta_dz_bitmap&BIT(psta->aid)) { @@ -2866,11 +2866,11 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr { pstapriv->tim_bitmap |= BIT(psta->aid); - /* DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ + /* DBG_871X("enqueue, sq_len =%d, tim =%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ - if (psta->sleepq_len==1) + if (psta->sleepq_len ==1) { - /* DBG_871X("sleepq_len==1, update BCNTIM\n"); */ + /* DBG_871X("sleepq_len ==1, update BCNTIM\n"); */ /* upate BCN for TIM IE */ update_beacon(padapter, _TIM_IE_, NULL, false); } @@ -2979,10 +2979,10 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta) void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) { - u8 update_mask=0, wmmps_ac=0; + u8 update_mask =0, wmmps_ac =0; struct sta_info *psta_bmc; struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; + struct xmit_frame *pxmitframe =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -3096,12 +3096,12 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) } - if (psta_bmc->sleepq_len==0) + if (psta_bmc->sleepq_len ==0) { pstapriv->tim_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0); - /* DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */ + /* DBG_871X("wakeup to xmit, qlen ==0, update_BCNTIM, tim =%x\n", pstapriv->tim_bitmap); */ /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ update_mask |= BIT(1); @@ -3109,11 +3109,11 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) } - if (psta->sleepq_len==0) + if (psta->sleepq_len ==0) { pstapriv->tim_bitmap &= ~BIT(psta->aid); - /* DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */ + /* DBG_871X("wakeup to xmit, qlen ==0, update_BCNTIM, tim =%x\n", pstapriv->tim_bitmap); */ /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ update_mask = BIT(0); @@ -3138,7 +3138,7 @@ _exit: if (update_mask) { /* update_BCNTIM(padapter); */ - /* printk("%s => call update_beacon\n",__FUNCTION__); */ + /* printk("%s => call update_beacon\n", __FUNCTION__); */ update_beacon(padapter, _TIM_IE_, NULL, false); } @@ -3146,9 +3146,9 @@ _exit: void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta) { - u8 wmmps_ac=0; + u8 wmmps_ac =0; struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe=NULL; + struct xmit_frame *pxmitframe =NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; @@ -3205,7 +3205,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst rtw_hal_xmitframe_enqueue(padapter, pxmitframe); - if ((psta->sleepq_ac_len==0) && (!psta->has_legacy_ac) && (wmmps_ac)) + if ((psta->sleepq_ac_len ==0) && (!psta->has_legacy_ac) && (wmmps_ac)) { pstapriv->tim_bitmap &= ~BIT(psta->aid); @@ -3223,7 +3223,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) { sctx->timeout_ms = timeout_ms; - sctx->submit_time= rtw_get_current_time(); + sctx->submit_time = rtw_get_current_time(); init_completion(&sctx->done); sctx->status = RTW_SCTX_SUBMITTED; } @@ -3234,7 +3234,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx) unsigned long expire; int status = 0; - expire= sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; + expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; if (!wait_for_completion_timeout(&sctx->done, expire)) { /* timeout, do something?? */ status = RTW_SCTX_DONE_TIMEOUT;