From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net
Subject: [PATCH 4/24] rt2x00: Don't allow configuration calls when uninitialized
Date: Sun, 16 Sep 2007 14:18:05 +0200 [thread overview]
Message-ID: <200709161418.06645.IvDoorn@gmail.com> (raw)
In-Reply-To: <200709161403.11332.IvDoorn@gmail.com>
When a device is being hot-unplugged or during suspend/resume
rt2x00 is not able to handle configuration calls from mac80211.
Check for the DEVICE_INITIALIZED flag to determine if a
configuration call from mac80211 is welcome or not.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00mac.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index f25cf38..0001b79 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -245,6 +245,15 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
struct rt2x00_dev *rt2x00dev = hw->priv;
/*
+ * If the device is not initialized we shouldn't accept
+ * any configuration changes. Mac80211 might be calling
+ * this function while we are trying to remove the device
+ * or perhaps suspending it.
+ */
+ if (!test_bit(DEVICE_INITIALIZED, &rt2x00dev->flags))
+ return 0;
+
+ /*
* Check if we need to disable the radio,
* if this is not the case, at least the RX must be disabled.
*/
@@ -285,6 +294,15 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw, int if_id,
int status;
/*
+ * If the device is not initialized we shouldn't accept
+ * any configuration changes. Mac80211 might be calling
+ * this function while we are trying to remove the device
+ * or perhaps suspending it.
+ */
+ if (!test_bit(DEVICE_INITIALIZED, &rt2x00dev->flags))
+ return 0;
+
+ /*
* Monitor mode does not need configuring.
* If the given type does not match the configured type,
* there has been a problem.
--
1.5.3
next prev parent reply other threads:[~2007-09-16 12:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200709161403.11332.IvDoorn@gmail.com>
2007-09-16 12:17 ` [PATCH 1/24] rt2x00: Remove firmware not-NULL check Ivo van Doorn
2007-09-16 12:17 ` [PATCH 2/24] rt2x00: Don't check for IEEE80211_TXCTL_REQ_TX_STATUS Ivo van Doorn
2007-09-16 12:18 ` [PATCH 3/24] rt2x00: Cleanup rxdone Ivo van Doorn
2007-09-16 12:18 ` Ivo van Doorn [this message]
2007-09-16 12:18 ` [PATCH 5/24] rt2x00: Fix rt61pci and rt73usb beacon handling Ivo van Doorn
2007-09-16 12:18 ` [PATCH 6/24] rt2x00: Recalculate link quality Ivo van Doorn
2007-09-16 12:18 ` [PATCH 7/24] rt2x00: Cleanup entry->flags Ivo van Doorn
2007-09-16 12:18 ` [PATCH 8/24] rt2x00: Reduce LNA flags Ivo van Doorn
2007-09-16 12:18 ` [PATCH 9/24] rt2x00: Rework RT61 and RT73 Antenna handling Ivo van Doorn
2007-09-16 12:18 ` [PATCH 10/24] rt2x00: Rename DEVICE_SUPPORT_ATIM to REQUIRE_BEACON_RING Ivo van Doorn
2007-09-16 12:18 ` [PATCH 11/24] rt2x00: Remove rt2x00mac_reset() Ivo van Doorn
2007-09-16 12:18 ` [PATCH 12/24] rt2x00: Fix system freeze on device removal Ivo van Doorn
2007-09-16 12:18 ` [PATCH 13/24] rt2x00: Reduce magic value writing to device Ivo van Doorn
2007-09-16 12:19 ` [PATCH 14/24] rt2x00: New USB ID's for rt73usb and rt2500usb Ivo van Doorn
2007-09-16 12:19 ` [PATCH 15/24] rt2x00: Beacon ring entries should have QID_MGMT Ivo van Doorn
2007-09-16 12:19 ` [PATCH 16/24] rt2x00: Fix DEV_RATEBIT_ definitions Ivo van Doorn
2007-09-16 12:19 ` [PATCH 17/24] rt2x00: Fix rfkill handling Ivo van Doorn
2007-09-16 12:19 ` [PATCH 18/24] rt2x00: Merge allocation/free register components Ivo van Doorn
2007-09-16 12:19 ` [PATCH 19/24] rt2x00: macro's shouldn't use hidden arguments Ivo van Doorn
2007-09-16 12:19 ` [PATCH 20/24] rt2x00: Fix channel initialization Ivo van Doorn
2007-09-16 12:19 ` [PATCH 21/24] rt2x00: Add better CONFIG_PM checks Ivo van Doorn
2007-09-16 12:19 ` [PATCH 22/24] rt2x00: Add start/stop handlers Ivo van Doorn
2007-09-16 12:19 ` [PATCH 23/24] rt2x00: Add additional bit to MAX_FRAME_UNIT Ivo van Doorn
2007-09-16 12:19 ` [PATCH 24/24] rt2x00: Release rt2x00 2.0.8 Ivo van Doorn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200709161418.06645.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=rt2400-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).