If hardware shall do scanning, the hw_scan operation must be set. However,
if the driver is for multiple cards that may or may not do hardware
scanning, it'll need a flag.
Similar issues arise with passive_scan().
This patch introduces flags to fix these issues.
Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
--- wireless-dev.orig/include/net/d80211.h 2006-11-19 20:14:02.959275208
+0100
+++ wireless-dev/include/net/d80211.h 2006-11-19 20:14:03.619275208 +0100
@@ -504,6 +504,12 @@ struct ieee80211_hw {
/* do hardware fragmentation */
#define IEEE80211_HW_FRAG (1<<15)
+ /* hardware does scanning instead of software */
+#define IEEE80211_HW_PASSIVE_SCAN (1<<16)
+
+ /* hardware does scanning instead of software */
+#define IEEE80211_HW_SCAN (1<<17)
+
u32 flags; /* hardware flags defined above */
/* Set to the size of a needed device specific skb headroom for TX
skbs. */
@@ -625,7 +631,8 @@ struct ieee80211_ops {
struct ieee80211_scan_conf *conf);
/* Ask the hardware to service the scan request, no need to start
- * the scan state machine in stack. */
+ * the scan state machine in stack.
+ * This callback goes along with the IEEE80211_HW_SCAN flag. */
int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
/* return low-level statistics */
--- wireless-dev.orig/net/d80211/ieee80211_sta.c 2006-11-19
20:13:58.049275208 +0100
+++ wireless-dev/net/d80211/ieee80211_sta.c 2006-11-19 20:14:03.619275208
+0100
@@ -2552,7 +2552,7 @@ int ieee80211_sta_req_scan(struct net_de
printk(KERN_DEBUG "%s: starting scan\n", dev->name);
- if (local->ops->hw_scan) {
+ if (local->ops->hw_scan && (local->hw.flags & IEEE80211_HW_SCAN)) {
int rc = local->ops->hw_scan(local_to_hw(local),
ssid, ssid_len);
if (!rc) {
--- wireless-dev.orig/net/d80211/ieee80211_scan.c 2006-11-19
20:13:58.049275208 +0100
+++ wireless-dev/net/d80211/ieee80211_scan.c 2006-11-19 20:14:03.629275208
+0100
@@ -114,7 +114,8 @@ static void ieee80211_scan_start(struct
struct ieee80211_channel *chan = NULL;
int ret;
- if (!local->ops->passive_scan) {
+ if (!local->ops->passive_scan ||
+ !(local->hw.flags & IEEE80211_HW_PASSIVE_SCAN)) {
printk(KERN_DEBUG "%s: Scan handler called, yet the hardware "
"does not support passive scanning. Disabled.\n",
local->mdev->name);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html