Skip to content

Commit

Permalink
iwlegacy: fix IBSS mode crashes
Browse files Browse the repository at this point in the history
We should not switch to non-IBSS channels when working in IBSS mode,
otherwise there are microcode errors, and after some time system
crashes.

This bug is only observable when software scan is used in IBSS mode,
so should be considered as regression after:

commit 0263aa4
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Tue Mar 29 11:24:21 2011 +0200

    iwl3945: disable hw scan by default

However IBSS mode check, which this patch add again, was removed by

commit b2f30e8
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Jan 21 07:32:20 2010 -0800

    iwlwifi: remove IBSS channel sanity check

That commit claim that mac80211 will not use non-IBSS channel in IBSS
mode, what definitely is not true. Bug probably should be fixed in
mac80211, but that will require more work, so better to apply that patch
temporally, and provide proper mac80211 fix latter.

Resolves:
https://bugzilla.kernel.org/show_bug.cgi?id=34452

Reported-and-tested-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: stable@kernel.org # 2.6.38.5+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed May 10, 2011
1 parent 99aa55b commit eb85de3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/iwlegacy/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,13 @@ int iwl_legacy_mac_config(struct ieee80211_hw *hw, u32 changed)
goto set_ch_out;
}

if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
!iwl_legacy_is_channel_ibss(ch_info)) {
IWL_DEBUG_MAC80211(priv, "leave - not IBSS channel\n");
ret = -EINVAL;
goto set_ch_out;
}

spin_lock_irqsave(&priv->lock, flags);

for_each_context(priv, ctx) {
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/iwlegacy/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,12 @@ iwl_legacy_is_channel_passive(const struct iwl_channel_info *ch)
return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
}

static inline int
iwl_legacy_is_channel_ibss(const struct iwl_channel_info *ch)
{
return (ch->flags & EEPROM_CHANNEL_IBSS) ? 1 : 0;
}

static inline void
__iwl_legacy_free_pages(struct iwl_priv *priv, struct page *page)
{
Expand Down

0 comments on commit eb85de3

Please sign in to comment.