diff options
Diffstat (limited to 'drivers/staging/rtl8188eu/core')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_ap.c | 43 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_efuse.c | 5 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 167 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 26 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_xmit.c | 4 |
8 files changed, 123 insertions, 132 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 51a5b71f8c25..88e42cc1d837 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -440,15 +440,9 @@ static void update_bmc_sta(struct adapter *padapter) tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i] & 0x7f); } - if (pcur_network->Configuration.DSConfig > 14) { - /* force to A mode. 5G doesn't support CCK rates */ - network_type = WIRELESS_11A; - tx_ra_bitmap = 0x150; /* 6, 12, 24 Mbps */ - } else { - /* force to b mode */ - network_type = WIRELESS_11B; - tx_ra_bitmap = 0xf; - } + /* force to b mode */ + network_type = WIRELESS_11B; + tx_ra_bitmap = 0xf; raid = networktype_to_raid(network_type); init_rate = get_highest_rate_idx(tx_ra_bitmap & 0x0fffffff) & 0x3f; @@ -560,29 +554,24 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta) static void update_hw_ht_param(struct adapter *padapter) { - unsigned char max_AMPDU_len; - unsigned char min_MPDU_spacing; - struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; + u8 max_ampdu_len; + u8 min_mpdu_spacing; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; DBG_88E("%s\n", __func__); - /* handle A-MPDU parameter field */ - /* - ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k - ampdu_params_info [4:2]:Min MPDU Start Spacing - */ - max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03; - - min_MPDU_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2; - - rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing)); + /* handle A-MPDU parameter field + * ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k + * ampdu_params_info [4:2]:Min MPDU Start Spacing + */ + max_ampdu_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03; + min_mpdu_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2; - rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); + rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, &min_mpdu_spacing); + rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, &max_ampdu_len); - /* */ - /* Config SM Power Save setting */ - /* */ + /* Config SM Power Save setting */ pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & 0x0C) >> 2; if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __func__); diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c index 02c476f45b33..d9b0f9e6235c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_efuse.c +++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c @@ -25,7 +25,7 @@ enum{ * When we want to enable write operation, we should change to pwr on state. * When we stop write, we should switch to 500k mode and disable LDO 2.5V. */ -void efuse_power_switch(struct adapter *pAdapter, u8 write, u8 pwrstate) +static void efuse_power_switch(struct adapter *pAdapter, u8 write, u8 pwrstate) { u8 tempval; u16 tmpv16; @@ -615,10 +615,9 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt) { u16 efuse_addr = *pAddr; - u8 badworden = 0; + u8 badworden; u32 PgWriteSuccess = 0; - badworden = 0x0f; badworden = Efuse_WordEnableDataWrite(pAdapter, efuse_addr + 1, pTargetPkt->word_en, pTargetPkt->data); if (badworden == 0x0F) { /* write ok */ diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 1ec3b237212e..e764436e120f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -2045,9 +2045,9 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network) while (1) { do_join_r = rtw_do_join(padapter); - if (do_join_r == _SUCCESS) { + if (do_join_r == _SUCCESS) break; - } + DBG_88E("roaming do_join return %d\n", do_join_r); pmlmepriv->to_roaming--; diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 18dc9fc1c04a..e984b4605e91 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -507,7 +507,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da) pwps_ie = rtw_get_wps_ie(cur_network->ies+_FIXED_IE_LENGTH_, cur_network->ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen); /* inerset & update wps_probe_resp_ie */ - if ((pmlmepriv->wps_probe_resp_ie != NULL) && pwps_ie && (wps_ielen > 0)) { + if (pmlmepriv->wps_probe_resp_ie && pwps_ie && wps_ielen > 0) { uint wps_offset, remainder_ielen; u8 *premainder_ie; diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c index 7b16632048b7..03dc7e5fcc38 100644 --- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c @@ -514,7 +514,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->power_mgnt = PS_MODE_ACTIVE; else pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */ - pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false; + pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE); pwrctrlpriv->bFwCurrentInPSMode = false; @@ -621,7 +621,7 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode) else pwrctrlpriv->LpsIdleCount = 2; pwrctrlpriv->power_mgnt = mode; - pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false; + pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE); } } else { ret = -EINVAL; diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 91a30142c567..73f2cb5ebaa6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -83,7 +83,8 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) INIT_LIST_HEAD(&pstapriv->sta_hash[i]); - list_add_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue)); + list_add_tail(&psta->list, + get_list_head(&pstapriv->free_sta_queue)); psta++; } @@ -134,31 +135,30 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) struct recv_reorder_ctrl *preorder_ctrl; int index; - if (pstapriv) { - /* delete all reordering_ctrl_timer */ - spin_lock_bh(&pstapriv->sta_hash_lock); - for (index = 0; index < NUM_STA; index++) { - phead = &pstapriv->sta_hash[index]; - plist = phead->next; + if (!pstapriv) + return _SUCCESS; - while (phead != plist) { - int i; + /* delete all reordering_ctrl_timer */ + spin_lock_bh(&pstapriv->sta_hash_lock); + for (index = 0; index < NUM_STA; index++) { + phead = &pstapriv->sta_hash[index]; + plist = phead->next; - psta = container_of(plist, struct sta_info, - hash_list); - plist = plist->next; + while (phead != plist) { + int i; - for (i = 0; i < 16; i++) { - preorder_ctrl = &psta->recvreorder_ctrl[i]; - del_timer_sync(&preorder_ctrl->reordering_ctrl_timer); - } + psta = container_of(plist, struct sta_info, hash_list); + plist = plist->next; + + for (i = 0; i < 16; i++) { + preorder_ctrl = &psta->recvreorder_ctrl[i]; + del_timer_sync(&preorder_ctrl->reordering_ctrl_timer); } } - spin_unlock_bh(&pstapriv->sta_hash_lock); - /*===============================*/ - - vfree(pstapriv->pallocated_stainfo_buf); } + spin_unlock_bh(&pstapriv->sta_hash_lock); + + vfree(pstapriv->pallocated_stainfo_buf); return _SUCCESS; } @@ -167,7 +167,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) { s32 index; struct list_head *phash_list; - struct sta_info *psta; + struct sta_info *psta; struct __queue *pfree_sta_queue; struct recv_reorder_ctrl *preorder_ctrl; int i = 0; @@ -180,65 +180,70 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) struct sta_info, list); if (!psta) { spin_unlock_bh(&pfree_sta_queue->lock); - } else { - list_del_init(&psta->list); - spin_unlock_bh(&pfree_sta_queue->lock); - _rtw_init_stainfo(psta); - memcpy(psta->hwaddr, hwaddr, ETH_ALEN); - index = wifi_mac_hash(hwaddr); - RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("%s: index=%x", __func__, index)); - if (index >= NUM_STA) { - RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("ERROR => %s: index >= NUM_STA", __func__)); - psta = NULL; - goto exit; - } - phash_list = &pstapriv->sta_hash[index]; - - spin_lock_bh(&pstapriv->sta_hash_lock); - list_add_tail(&psta->hash_list, phash_list); - pstapriv->asoc_sta_count++; - spin_unlock_bh(&pstapriv->sta_hash_lock); + return NULL; + } -/* Commented by Albert 2009/08/13 */ -/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */ -/* In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */ -/* So, we initialize the tid_rxseq variable as the 0xffff. */ + list_del_init(&psta->list); + spin_unlock_bh(&pfree_sta_queue->lock); + _rtw_init_stainfo(psta); + memcpy(psta->hwaddr, hwaddr, ETH_ALEN); + index = wifi_mac_hash(hwaddr); + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, + ("%s: index=%x", __func__, index)); + if (index >= NUM_STA) { + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, + ("ERROR => %s: index >= NUM_STA", __func__)); + return NULL; + } + phash_list = &pstapriv->sta_hash[index]; - for (i = 0; i < 16; i++) - memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2); + spin_lock_bh(&pstapriv->sta_hash_lock); + list_add_tail(&psta->hash_list, phash_list); + pstapriv->asoc_sta_count++; + spin_unlock_bh(&pstapriv->sta_hash_lock); - RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, - ("alloc number_%d stainfo with hwaddr = %pM\n", - pstapriv->asoc_sta_count, hwaddr)); + /* Commented by Albert 2009/08/13 + * For the SMC router, the sequence number of first packet of + * WPS handshake will be 0. In this case, this packet will be + * dropped by recv_decache function if we use the 0x00 as the + * default value for tid_rxseq variable. So, we initialize the + * tid_rxseq variable as the 0xffff. + */ - init_addba_retry_timer(pstapriv->padapter, psta); + for (i = 0; i < 16; i++) + memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], + &wRxSeqInitialValue, 2); - /* for A-MPDU Rx reordering buffer control */ - for (i = 0; i < 16; i++) { - preorder_ctrl = &psta->recvreorder_ctrl[i]; + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, + ("alloc number_%d stainfo with hwaddr = %pM\n", + pstapriv->asoc_sta_count, hwaddr)); - preorder_ctrl->padapter = pstapriv->padapter; + init_addba_retry_timer(pstapriv->padapter, psta); - preorder_ctrl->enable = false; + /* for A-MPDU Rx reordering buffer control */ + for (i = 0; i < 16; i++) { + preorder_ctrl = &psta->recvreorder_ctrl[i]; - preorder_ctrl->indicate_seq = 0xffff; - preorder_ctrl->wend_b = 0xffff; - preorder_ctrl->wsize_b = 64;/* 64; */ + preorder_ctrl->padapter = pstapriv->padapter; - _rtw_init_queue(&preorder_ctrl->pending_recvframe_queue); + preorder_ctrl->enable = false; - rtw_init_recv_timer(preorder_ctrl); - } + preorder_ctrl->indicate_seq = 0xffff; + preorder_ctrl->wend_b = 0xffff; + preorder_ctrl->wsize_b = 64;/* 64; */ - /* init for DM */ - psta->rssi_stat.UndecoratedSmoothedPWDB = -1; - psta->rssi_stat.UndecoratedSmoothedCCK = -1; + _rtw_init_queue(&preorder_ctrl->pending_recvframe_queue); - /* init for the sequence number of received management frame */ - psta->RxMgmtFrameSeqNum = 0xffff; + rtw_init_recv_timer(preorder_ctrl); } -exit: + /* init for DM */ + psta->rssi_stat.UndecoratedSmoothedPWDB = -1; + psta->rssi_stat.UndecoratedSmoothedCCK = -1; + + /* init for the sequence number of received management frame */ + psta->RxMgmtFrameSeqNum = 0xffff; + return psta; } @@ -296,7 +301,9 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) del_timer_sync(&psta->addba_retry_timer); - /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */ + /* for A-MPDU Rx reordering buffer control, cancel + * reordering_ctrl_timer + */ for (i = 0; i < 16; i++) { struct list_head *phead, *plist; struct recv_frame *prframe; @@ -311,7 +318,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(&ppending_recvframe_queue->lock); - phead = get_list_head(ppending_recvframe_queue); + phead = get_list_head(ppending_recvframe_queue); plist = phead->next; while (!list_empty(phead)) { @@ -444,23 +451,21 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u32 rtw_init_bcmc_stainfo(struct adapter *padapter) { struct sta_info *psta; - u32 res = _SUCCESS; - unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct sta_priv *pstapriv = &padapter->stapriv; - psta = rtw_alloc_stainfo(pstapriv, bcast_addr); + psta = rtw_alloc_stainfo(pstapriv, bc_addr); if (!psta) { - res = _FAIL; - RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); - goto exit; + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, + ("rtw_alloc_stainfo fail")); + return _FAIL; } /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; -exit: - return res; + return _SUCCESS; } struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter) @@ -471,13 +476,13 @@ struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter) return rtw_get_stainfo(pstapriv, bc_addr); } -u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) +bool rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) { - u8 res = true; + bool res = true; #ifdef CONFIG_88EU_AP_MODE struct list_head *plist, *phead; struct rtw_wlan_acl_node *paclnode; - u8 match = false; + bool match = false; 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; @@ -499,9 +504,9 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) spin_unlock_bh(&pacl_node_q->lock); if (pacl_list->mode == 1)/* accept unless in deny list */ - res = (match) ? false : true; + res = !match; else if (pacl_list->mode == 2)/* deny unless in accept list */ - res = (match) ? true : false; + res = match; else res = true; diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index c985b1468d41..af8a79ce8736 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -667,7 +667,7 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE) { unsigned int i; - u8 max_AMPDU_len, min_MPDU_spacing; + u8 max_ampdu_len, min_mpdu_spacing; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -689,16 +689,16 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE) } else { /* modify from fw by Thomas 2010/11/17 */ if ((pmlmeinfo->HT_caps.ampdu_params_info & 0x3) > (pIE->data[i] & 0x3)) - max_AMPDU_len = pIE->data[i] & 0x3; + max_ampdu_len = pIE->data[i] & 0x3; else - max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x3; + max_ampdu_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x3; if ((pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) > (pIE->data[i] & 0x1c)) - min_MPDU_spacing = pmlmeinfo->HT_caps.ampdu_params_info & 0x1c; + min_mpdu_spacing = pmlmeinfo->HT_caps.ampdu_params_info & 0x1c; else - min_MPDU_spacing = pIE->data[i] & 0x1c; + min_mpdu_spacing = pIE->data[i] & 0x1c; - pmlmeinfo->HT_caps.ampdu_params_info = max_AMPDU_len | min_MPDU_spacing; + pmlmeinfo->HT_caps.ampdu_params_info = max_ampdu_len | min_mpdu_spacing; } } @@ -729,8 +729,8 @@ void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE) void HTOnAssocRsp(struct adapter *padapter) { - unsigned char max_AMPDU_len; - unsigned char min_MPDU_spacing; + u8 max_ampdu_len; + u8 min_mpdu_spacing; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; @@ -748,13 +748,11 @@ void HTOnAssocRsp(struct adapter *padapter) * AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k * AMPDU_para [4:2]:Min MPDU Start Spacing */ - max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03; + max_ampdu_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03; + min_mpdu_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2; - min_MPDU_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2; - - rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing)); - - rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); + rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, &min_mpdu_spacing); + rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, &max_ampdu_len); } void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE) diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index 952f2ab51347..c37591657bac 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -776,7 +776,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - if (psta->qos_option) + if (psta && psta->qos_option) qos_option = true; } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { @@ -784,7 +784,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); - if (psta->qos_option) + if (psta && psta->qos_option) 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))); |