Commit 36cbb5d2 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: simplify wfx_set_tim_impl()



Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and
there is no reason to provide another argument.

Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new
behavior.

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-50-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0014901
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -895,7 +895,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id);
}

static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set)
static int wfx_update_tim(struct wfx_vif *wvif)
{
	struct sk_buff *skb;
	u16 tim_offset, tim_length;
@@ -916,7 +916,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set)
		tim_ptr[2] = 0;

		/* Set/reset aid0 bit */
		if (aid0_bit_set)
		if (wvif->aid0_bit_set)
			tim_ptr[4] |= 1;
		else
			tim_ptr[4] &= ~1;
@@ -928,11 +928,11 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set)
	return 0;
}

static void wfx_set_tim_work(struct work_struct *work)
static void wfx_update_tim_work(struct work_struct *work)
{
	struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_tim_work);
	struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_tim_work);

	wfx_set_tim_impl(wvif, wvif->aid0_bit_set);
	wfx_update_tim(wvif);
}

int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
@@ -941,7 +941,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
	struct wfx_sta_priv *sta_dev = (struct wfx_sta_priv *) &sta->drv_priv;
	struct wfx_vif *wvif = wdev_to_wvif(wdev, sta_dev->vif_id);

	schedule_work(&wvif->set_tim_work);
	schedule_work(&wvif->update_tim_work);
	return 0;
}

@@ -955,8 +955,8 @@ static void wfx_mcast_start_work(struct work_struct *work)
	cancel_work_sync(&wvif->mcast_stop_work);
	if (!wvif->aid0_bit_set) {
		wfx_tx_lock_flush(wvif->wdev);
		wfx_set_tim_impl(wvif, true);
		wvif->aid0_bit_set = true;
		wfx_update_tim(wvif);
		mod_timer(&wvif->mcast_timeout, jiffies + tmo);
		wfx_tx_unlock(wvif->wdev);
	}
@@ -971,7 +971,7 @@ static void wfx_mcast_stop_work(struct work_struct *work)
		del_timer_sync(&wvif->mcast_timeout);
		wfx_tx_lock_flush(wvif->wdev);
		wvif->aid0_bit_set = false;
		wfx_set_tim_impl(wvif, false);
		wfx_update_tim(wvif);
		wfx_tx_unlock(wvif->wdev);
	}
}
@@ -1118,7 +1118,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
	INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work);

	spin_lock_init(&wvif->ps_state_lock);
	INIT_WORK(&wvif->set_tim_work, wfx_set_tim_work);
	INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work);

	INIT_WORK(&wvif->mcast_start_work, wfx_mcast_start_work);
	INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work);
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ struct wfx_vif {
	u32			sta_asleep_mask;
	u32			pspoll_mask;
	spinlock_t		ps_state_lock;
	struct work_struct	set_tim_work;
	struct work_struct	update_tim_work;

	int			beacon_int;
	bool			filter_bssid;