Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c10bb9c authored by Saravanan Dhanabal's avatar Saravanan Dhanabal Committed by John W. Linville
Browse files

wl1271: Fix mac80211 configuration requests during WL1271_STATE_OFF



mac80211 sends configuration requests even if the wl1271 interface
state is WL1271_STATE_OFF. This creates warnings from mac80211.

This patch leaves the configuration functions, if the interface is
going down.

Signed-off-by: default avatarSaravanan Dhanabal <ext-saravanan.dhanabal@nokia.com>
Reviewed-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bd9dc49c
Loading
Loading
Loading
Loading
+11 −3
Original line number Original line Diff line number Diff line
@@ -1223,6 +1223,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)


	mutex_lock(&wl->mutex);
	mutex_lock(&wl->mutex);


	if (unlikely(wl->state == WL1271_STATE_OFF))
		goto out;

	ret = wl1271_ps_elp_wakeup(wl, false);
	ret = wl1271_ps_elp_wakeup(wl, false);
	if (ret < 0)
	if (ret < 0)
		goto out;
		goto out;
@@ -1324,8 +1327,12 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
				       struct dev_addr_list *mc_list)
				       struct dev_addr_list *mc_list)
{
{
	struct wl1271_filter_params *fp;
	struct wl1271_filter_params *fp;
	struct wl1271 *wl = hw->priv;
	int i;
	int i;


	if (unlikely(wl->state == WL1271_STATE_OFF))
		return 0;

	fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
	fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
	if (!fp) {
	if (!fp) {
		wl1271_error("Out of memory setting filters.");
		wl1271_error("Out of memory setting filters.");
@@ -1372,15 +1379,16 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,


	mutex_lock(&wl->mutex);
	mutex_lock(&wl->mutex);


	if (wl->state == WL1271_STATE_OFF)
	*total &= WL1271_SUPPORTED_FILTERS;
	changed &= WL1271_SUPPORTED_FILTERS;

	if (unlikely(wl->state == WL1271_STATE_OFF))
		goto out;
		goto out;


	ret = wl1271_ps_elp_wakeup(wl, false);
	ret = wl1271_ps_elp_wakeup(wl, false);
	if (ret < 0)
	if (ret < 0)
		goto out;
		goto out;


	*total &= WL1271_SUPPORTED_FILTERS;
	changed &= WL1271_SUPPORTED_FILTERS;


	if (*total & FIF_ALLMULTI)
	if (*total & FIF_ALLMULTI)
		ret = wl1271_acx_group_address_tbl(wl, false, NULL, 0);
		ret = wl1271_acx_group_address_tbl(wl, false, NULL, 0);