Lines Matching defs:pstat

684 	struct	sta_info *pstat = NULL;
739 pstat = rtw_get_stainfo(pstapriv, sa);
740 if (!pstat) {
743 pstat = rtw_alloc_stainfo(pstapriv, sa);
744 if (!pstat) {
749 pstat->state = WIFI_FW_AUTH_NULL;
750 pstat->auth_seq = 0;
752 /* pstat->flags = 0; */
753 /* pstat->capability = 0; */
757 if (list_empty(&pstat->asoc_list) == false) {
758 list_del_init(&pstat->asoc_list);
760 if (pstat->expire_to > 0) {
772 if (list_empty(&pstat->auth_list)) {
774 list_add_tail(&pstat->auth_list, &pstapriv->auth_list);
779 if (pstat->auth_seq == 0)
780 pstat->expire_to = pstapriv->auth_to;
783 if ((pstat->auth_seq + 1) != seq) {
790 pstat->state &= ~WIFI_FW_AUTH_NULL;
791 pstat->state |= WIFI_FW_AUTH_SUCCESS;
792 pstat->expire_to = pstapriv->assoc_to;
793 pstat->authalg = algorithm;
801 memset((void *)pstat->chg_txt, 78, 128);
803 pstat->state &= ~WIFI_FW_AUTH_NULL;
804 pstat->state |= WIFI_FW_AUTH_STATE;
805 pstat->authalg = algorithm;
816 if (!memcmp((void *)(p + 2), pstat->chg_txt, 128)) {
817 pstat->state &= (~WIFI_FW_AUTH_STATE);
818 pstat->state |= WIFI_FW_AUTH_SUCCESS;
820 pstat->expire_to = pstapriv->assoc_to;
833 pstat->auth_seq = seq + 1;
835 issue_auth(padapter, pstat, (unsigned short)(WLAN_STATUS_SUCCESS));
837 if (pstat->state & WIFI_FW_AUTH_SUCCESS)
838 pstat->auth_seq = 0;
845 if (pstat)
846 rtw_free_stainfo(padapter, pstat);
848 pstat = &stat;
849 memset((char *)pstat, '\0', sizeof(stat));
850 pstat->auth_seq = 2;
851 memcpy(pstat->hwaddr, sa, 6);
853 issue_auth(padapter, pstat, (unsigned short)status);
940 struct sta_info *pstat;
970 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
971 if (!pstat) {
983 if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) {
984 if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) {
988 pstat->state &= (~WIFI_FW_ASSOC_SUCCESS);
989 pstat->state |= WIFI_FW_ASSOC_STATE;
992 pstat->state &= (~WIFI_FW_AUTH_SUCCESS);
993 pstat->state |= WIFI_FW_ASSOC_STATE;
997 pstat->capability = capab_info;
1055 pstat->bssratelen = supportRateNum;
1056 memcpy(pstat->bssrateset, supportRate, supportRateNum);
1057 UpdateBrateTblForSoftAP(pstat->bssrateset, pstat->bssratelen);
1060 pstat->dot8021xalg = 0;
1061 pstat->wpa_psk = 0;
1062 pstat->wpa_group_cipher = 0;
1063 pstat->wpa2_group_cipher = 0;
1064 pstat->wpa_pairwise_cipher = 0;
1065 pstat->wpa2_pairwise_cipher = 0;
1066 memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie));
1075 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
1076 pstat->wpa_psk |= BIT(1);
1078 pstat->wpa2_group_cipher = group_cipher&psecuritypriv->wpa2_group_cipher;
1079 pstat->wpa2_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa2_pairwise_cipher;
1081 if (!pstat->wpa2_group_cipher)
1084 if (!pstat->wpa2_pairwise_cipher)
1098 pstat->dot8021xalg = 1;/* psk, todo:802.1x */
1099 pstat->wpa_psk |= BIT(0);
1101 pstat->wpa_group_cipher = group_cipher&psecuritypriv->wpa_group_cipher;
1102 pstat->wpa_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa_pairwise_cipher;
1104 if (!pstat->wpa_group_cipher)
1107 if (!pstat->wpa_pairwise_cipher)
1122 pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
1125 pstat->flags |= WLAN_STA_WPS;
1130 pstat->flags |= WLAN_STA_MAYBE_WPS;
1137 && (pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS))) {
1162 pstat->flags |= WLAN_STA_WPS;
1165 copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)):(wpa_ie_len+2);
1170 memcpy(pstat->wpa_ie, wpa_ie-2, copy_len);
1176 pstat->flags &= ~WLAN_STA_WME;
1177 pstat->qos_option = 0;
1178 pstat->qos_info = 0;
1179 pstat->has_legacy_ac = true;
1180 pstat->uapsd_vo = 0;
1181 pstat->uapsd_vi = 0;
1182 pstat->uapsd_be = 0;
1183 pstat->uapsd_bk = 0;
1191 pstat->flags |= WLAN_STA_WME;
1193 pstat->qos_option = 1;
1194 pstat->qos_info = *(p+8);
1196 pstat->max_sp_len = (pstat->qos_info>>5)&0x3;
1198 if ((pstat->qos_info&0xf) != 0xf)
1199 pstat->has_legacy_ac = true;
1201 pstat->has_legacy_ac = false;
1203 if (pstat->qos_info&0xf) {
1204 if (pstat->qos_info&BIT(0))
1205 pstat->uapsd_vo = BIT(0)|BIT(1);
1207 pstat->uapsd_vo = 0;
1209 if (pstat->qos_info&BIT(1))
1210 pstat->uapsd_vi = BIT(0)|BIT(1);
1212 pstat->uapsd_vi = 0;
1214 if (pstat->qos_info&BIT(2))
1215 pstat->uapsd_bk = BIT(0)|BIT(1);
1217 pstat->uapsd_bk = 0;
1219 if (pstat->qos_info&BIT(3))
1220 pstat->uapsd_be = BIT(0)|BIT(1);
1222 pstat->uapsd_be = 0;
1236 memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
1238 pstat->flags |= WLAN_STA_HT;
1240 pstat->flags |= WLAN_STA_WME;
1242 memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
1245 pstat->flags &= ~WLAN_STA_HT;
1248 if ((pmlmepriv->htpriv.ht_option == false) && (pstat->flags&WLAN_STA_HT)) {
1254 if ((pstat->flags & WLAN_STA_HT) &&
1255 ((pstat->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
1256 (pstat->wpa_pairwise_cipher&WPA_CIPHER_TKIP))) {
1260 pstat->flags |= WLAN_STA_NONERP;
1261 for (i = 0; i < pstat->bssratelen; i++) {
1262 if ((pstat->bssrateset[i] & 0x7f) > 22) {
1263 pstat->flags &= ~WLAN_STA_NONERP;
1268 if (pstat->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
1269 pstat->flags |= WLAN_STA_SHORT_PREAMBLE;
1271 pstat->flags &= ~WLAN_STA_SHORT_PREAMBLE;
1287 if (pstat->aid == 0) {
1288 for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++)
1289 if (!pstapriv->sta_aid[pstat->aid - 1])
1292 /* if (pstat->aid > NUM_STA) { */
1293 if (pstat->aid > pstapriv->max_num_sta) {
1295 pstat->aid = 0;
1303 pstapriv->sta_aid[pstat->aid - 1] = pstat;
1308 pstat->state &= (~WIFI_FW_ASSOC_STATE);
1309 pstat->state |= WIFI_FW_ASSOC_SUCCESS;
1312 if (!list_empty(&pstat->auth_list)) {
1313 list_del_init(&pstat->auth_list);
1319 if (list_empty(&pstat->asoc_list)) {
1320 pstat->expire_to = pstapriv->expire_to;
1321 list_add_tail(&pstat->asoc_list, &pstapriv->asoc_list);
1327 if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (status == WLAN_STATUS_SUCCESS)) {
1329 bss_cap_update_on_sta_join(padapter, pstat);
1330 sta_info_update(padapter, pstat);
1334 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
1336 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
1338 spin_lock_bh(&pstat->lock);
1339 kfree(pstat->passoc_req);
1340 pstat->assoc_req_len = 0;
1341 pstat->passoc_req = rtw_zmalloc(pkt_len);
1342 if (pstat->passoc_req) {
1343 memcpy(pstat->passoc_req, pframe, pkt_len);
1344 pstat->assoc_req_len = pkt_len;
1346 spin_unlock_bh(&pstat->lock);
1349 report_add_sta_event(padapter, pstat->hwaddr, pstat->aid);
1362 pstat->aid = 0;
1364 issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP);
1366 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
2713 void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type)
2746 memcpy((void *)GetAddr1Ptr(pwlanhdr), pstat->hwaddr, ETH_ALEN);
2770 le_tmp = cpu_to_le16(pstat->aid | BIT(14) | BIT(15));
2773 if (pstat->bssratelen <= 8) {
2774 pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen));
2776 pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pstat->bssrateset, &(pattrib->pktlen));
2777 pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (pstat->bssratelen-8), pstat->bssrateset+8, &(pattrib->pktlen));
2780 if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) {
2804 if ((pstat->flags & WLAN_STA_WME) && (pmlmepriv->qospriv.qos_option)) {