|
@@ -173,9 +173,9 @@ static u8 chk_sta_is_alive(struct sta_info *psta)
|
|
|
|
|
|
void expire_timeout_chk23a(struct rtw_adapter *padapter)
|
|
|
{
|
|
|
- struct list_head *phead, *plist, *ptmp;
|
|
|
+ struct list_head *phead;
|
|
|
u8 updated = 0;
|
|
|
- struct sta_info *psta;
|
|
|
+ struct sta_info *psta, *ptmp;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
u8 chk_alive_num = 0;
|
|
|
struct sta_info *chk_alive_list[NUM_STA];
|
|
@@ -186,8 +186,7 @@ void expire_timeout_chk23a(struct rtw_adapter *padapter)
|
|
|
phead = &pstapriv->auth_list;
|
|
|
|
|
|
/* check auth_queue */
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, auth_list);
|
|
|
+ list_for_each_entry_safe(psta, ptmp, phead, auth_list) {
|
|
|
|
|
|
if (psta->expire_to > 0) {
|
|
|
psta->expire_to--;
|
|
@@ -216,8 +215,7 @@ void expire_timeout_chk23a(struct rtw_adapter *padapter)
|
|
|
phead = &pstapriv->asoc_list;
|
|
|
|
|
|
/* check asoc_queue */
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, asoc_list);
|
|
|
+ list_for_each_entry_safe(psta, ptmp, phead, asoc_list) {
|
|
|
|
|
|
if (chk_sta_is_alive(psta) || !psta->expire_to) {
|
|
|
psta->expire_to = pstapriv->expire_to;
|
|
@@ -1059,7 +1057,7 @@ void rtw_set_macaddr_acl23a(struct rtw_adapter *padapter, int mode)
|
|
|
|
|
|
int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr)
|
|
|
{
|
|
|
- struct list_head *plist, *phead;
|
|
|
+ struct list_head *phead;
|
|
|
u8 added = false;
|
|
|
int i, ret = 0;
|
|
|
struct rtw_wlan_acl_node *paclnode;
|
|
@@ -1076,8 +1074,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr)
|
|
|
|
|
|
phead = get_list_head(pacl_node_q);
|
|
|
|
|
|
- list_for_each(plist, phead) {
|
|
|
- paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
|
|
|
+ list_for_each_entry(paclnode, phead, list) {
|
|
|
|
|
|
if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
|
|
|
if (paclnode->valid == true) {
|
|
@@ -1121,8 +1118,8 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr)
|
|
|
|
|
|
int rtw_acl_remove_sta23a(struct rtw_adapter *padapter, u8 *addr)
|
|
|
{
|
|
|
- struct list_head *plist, *phead, *ptmp;
|
|
|
- struct rtw_wlan_acl_node *paclnode;
|
|
|
+ struct list_head *phead;
|
|
|
+ struct rtw_wlan_acl_node *paclnode, *ptmp;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
|
|
struct rtw_queue *pacl_node_q = &pacl_list->acl_node_q;
|
|
@@ -1133,8 +1130,7 @@ int rtw_acl_remove_sta23a(struct rtw_adapter *padapter, u8 *addr)
|
|
|
|
|
|
phead = get_list_head(pacl_node_q);
|
|
|
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
|
|
|
+ list_for_each_entry_safe(paclnode, ptmp, phead, list) {
|
|
|
|
|
|
if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
|
|
|
if (paclnode->valid) {
|
|
@@ -1354,19 +1350,16 @@ void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated)
|
|
|
{
|
|
|
/* update associated stations cap. */
|
|
|
if (updated == true) {
|
|
|
- struct list_head *phead, *plist, *ptmp;
|
|
|
- struct sta_info *psta;
|
|
|
+ struct list_head *phead;
|
|
|
+ struct sta_info *psta, *ptmp;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
|
|
spin_lock_bh(&pstapriv->asoc_list_lock);
|
|
|
|
|
|
phead = &pstapriv->asoc_list;
|
|
|
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, asoc_list);
|
|
|
-
|
|
|
+ list_for_each_entry_safe(psta, ptmp, phead, asoc_list)
|
|
|
VCS_update23a(padapter, psta);
|
|
|
- }
|
|
|
|
|
|
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
|
|
}
|
|
@@ -1627,7 +1620,7 @@ u8 ap_free_sta23a(struct rtw_adapter *padapter, struct sta_info *psta, bool acti
|
|
|
|
|
|
int rtw_ap_inform_ch_switch23a(struct rtw_adapter *padapter, u8 new_ch, u8 ch_offset)
|
|
|
{
|
|
|
- struct list_head *phead, *plist;
|
|
|
+ struct list_head *phead;
|
|
|
struct sta_info *psta = NULL;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
@@ -1643,8 +1636,7 @@ int rtw_ap_inform_ch_switch23a(struct rtw_adapter *padapter, u8 new_ch, u8 ch_of
|
|
|
spin_lock_bh(&pstapriv->asoc_list_lock);
|
|
|
phead = &pstapriv->asoc_list;
|
|
|
|
|
|
- list_for_each(plist, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, asoc_list);
|
|
|
+ list_for_each_entry(psta, phead, asoc_list) {
|
|
|
|
|
|
issue_action_spct_ch_switch23a(padapter, psta->hwaddr, new_ch, ch_offset);
|
|
|
psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2);
|
|
@@ -1658,8 +1650,8 @@ int rtw_ap_inform_ch_switch23a(struct rtw_adapter *padapter, u8 new_ch, u8 ch_of
|
|
|
|
|
|
int rtw_sta_flush23a(struct rtw_adapter *padapter)
|
|
|
{
|
|
|
- struct list_head *phead, *plist, *ptmp;
|
|
|
- struct sta_info *psta;
|
|
|
+ struct list_head *phead;
|
|
|
+ struct sta_info *psta, *ptmp;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
|
@@ -1676,8 +1668,7 @@ int rtw_sta_flush23a(struct rtw_adapter *padapter)
|
|
|
spin_lock_bh(&pstapriv->asoc_list_lock);
|
|
|
phead = &pstapriv->asoc_list;
|
|
|
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, asoc_list);
|
|
|
+ list_for_each_entry_safe(psta, ptmp, phead, asoc_list) {
|
|
|
|
|
|
/* Remove sta from asoc_list */
|
|
|
list_del_init(&psta->asoc_list);
|
|
@@ -1744,9 +1735,9 @@ void rtw_ap_restore_network(struct rtw_adapter *padapter)
|
|
|
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
|
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
- struct sta_info *psta;
|
|
|
+ struct sta_info *psta, *ptmp;
|
|
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
|
|
- struct list_head *phead, *plist, *ptmp;
|
|
|
+ struct list_head *phead;
|
|
|
u8 chk_alive_num = 0;
|
|
|
struct sta_info *chk_alive_list[NUM_STA];
|
|
|
int i;
|
|
@@ -1778,11 +1769,8 @@ void rtw_ap_restore_network(struct rtw_adapter *padapter)
|
|
|
|
|
|
phead = &pstapriv->asoc_list;
|
|
|
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- psta = container_of(plist, struct sta_info, asoc_list);
|
|
|
-
|
|
|
+ list_for_each_entry_safe(psta, ptmp, phead, asoc_list)
|
|
|
chk_alive_list[chk_alive_num++] = psta;
|
|
|
- }
|
|
|
|
|
|
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
|
|
|
|
@@ -1841,8 +1829,8 @@ void start_ap_mode23a(struct rtw_adapter *padapter)
|
|
|
|
|
|
void stop_ap_mode23a(struct rtw_adapter *padapter)
|
|
|
{
|
|
|
- struct list_head *phead, *plist, *ptmp;
|
|
|
- struct rtw_wlan_acl_node *paclnode;
|
|
|
+ struct list_head *phead;
|
|
|
+ struct rtw_wlan_acl_node *paclnode, *ptmp;
|
|
|
struct sta_info *psta = NULL;
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
@@ -1865,8 +1853,7 @@ void stop_ap_mode23a(struct rtw_adapter *padapter)
|
|
|
spin_lock_bh(&pacl_node_q->lock);
|
|
|
phead = get_list_head(pacl_node_q);
|
|
|
|
|
|
- list_for_each_safe(plist, ptmp, phead) {
|
|
|
- paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
|
|
|
+ list_for_each_entry_safe(paclnode, ptmp, phead, list) {
|
|
|
|
|
|
if (paclnode->valid == true) {
|
|
|
paclnode->valid = false;
|