Skip to contentSkip to conversation

d80211: add hardware scan callback

PATCH Applied Hong Liu 5 participants 9 messages Aug 25, 2006 – Apr 6, 2009

Subsystems (2)
lore
Share & tools
lore

Hong Liu

author
#0 lore raw

PATCH 2/2 d80211: add hardware scan callback

Add hardware scan callback to support cards like ipw3945 which implements the scan command in firmware.

Thanks,
Hong

include/net/d80211.h +6 -0
index ba5cb4c..b369d12 100644
@@ -595,6 +595,10 @@ struct ieee80211_hw {
         int (*passive_scan)(struct net_device *dev, int state,
                             struct ieee80211_scan_conf *conf);
 
+	/* Ask the hardware to service the scan request, no need to start
+	 * the scan state machine in stack. */
+	int (*hw_scan)(struct net_device *dev, u8 *ssid, size_t len);
+
         /* return low-level statistics */
 	int (*get_stats)(struct net_device *dev,
 			 struct ieee80211_low_level_stats *stats);
@@ -893,6 +897,8 @@ void ieee80211_tx_led(int state, struct 
  */
 void ieee80211_rx_led(int state, struct net_device *dev);
 
+/* set station scan completed */
+void ieee80211_set_scan_completed(struct net_device *dev);
 
 /* IEEE 802.11 defines */
 
net/d80211/ieee80211.c +1 -0
index 60eca90..dc920c1 100644
@@ -4831,6 +4831,7 @@ EXPORT_SYMBOL(sta_info_get);
 EXPORT_SYMBOL(sta_info_put);
 EXPORT_SYMBOL(ieee80211_radar_status);
 EXPORT_SYMBOL(ieee80211_get_mc_list_item);
+EXPORT_SYMBOL(ieee80211_set_scan_completed);
 
 module_init(ieee80211_init);
 module_exit(ieee80211_exit);
net/d80211/ieee80211_sta.c +28 -16

70 lines not on this page · raw message

#1 lore raw

net/d80211/ieee80211_sta.c int ieee80211_sta_req_scan(struct net_de · line 2579

Quoted 4 lines · Hong Liu
net/d80211/ieee80211_sta.c +3 -0
+       local->sta_scanning = 1;
+       if (local->hw->hw_scan)
+               return local->hw->hw_scan(dev, ssid, ssid_len); 

You set sta_scanning even if that returns an error, is that correct?

johannes

#2 lore raw
In reply to Hong Liu
Quoted 2 lines · Hong Liu

Add hardware scan callback to support cards like ipw3945 which implements the scan command in firmware.

How ipw3945 performs scan? From the patch, it looks like it switches channels (and sends probe requests) in the firmware and delivers all received beacons and probe responses through the normal rx path to be handled in a software MAC layer. This is really weird behaviour and doesn't make sense to me. Why isn't channel switching left to the software MAC as well?

include/net/d80211.h void ieee80211_tx_led(int state, struct · line 901

Quoted 2 lines
include/net/d80211.h +2 -0
+/* set station scan completed */
+void ieee80211_set_scan_completed(struct net_device *dev);

Why "set"? "ieee80211_scan_completed" sounds better.

Thanks,

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#3 lore raw

3945 firmware and hardware still do time critical functions like Beaconing and power management. This restrict us once associated to switch channel from the driver. we need to unassociated first before switching to a new channel. Because of this restriction while associated we can only call scan command and the firmware will take of tunning to available channels to listen to beacon and prob_resp.

Quoted 30 lines · Jiri Benc
Quoted 4 lines · Hong Liu

Add hardware scan callback to support cards like ipw3945 which implements the scan command in firmware.

How ipw3945 performs scan? From the patch, it looks like it switches channels (and sends probe requests) in the firmware and delivers all received beacons and probe responses through the normal rx path to be handled in a software MAC layer. This is really weird behaviour and doesn't make sense to me. Why isn't channel switching left to the software MAC as well?

include/net/d80211.h void ieee80211_tx_led(int state, struct · line 901

Quoted 4 lines
include/net/d80211.h +2 -0
+/* set station scan completed */
+void ieee80211_set_scan_completed(struct net_device *dev);

Why "set"? "ieee80211_scan_completed" sounds better.

Thanks,

Jiri

author
#4 lore raw
In reply to Jiri Benc
Quoted 16 lines · Jiri Benc
Quoted 2 lines · Hong Liu

Add hardware scan callback to support cards like ipw3945 which implements the scan command in firmware.

How ipw3945 performs scan? From the patch, it looks like it switches channels (and sends probe requests) in the firmware and delivers all received beacons and probe responses through the normal rx path to be handled in a software MAC layer. This is really weird behaviour and doesn't make sense to me. Why isn't channel switching left to the software MAC as well?

Review

Quoted 2 lines
(quoted diff) +2 -0
+/* set station scan completed */
+void ieee80211_set_scan_completed(struct net_device *dev);

Why "set"? "ieee80211_scan_completed" sounds better.

Quoted 8 lines

Thanks,

Jiri

--
Jiri Benc
SUSE Labs

include/net/d80211.h +6 -0
index 42fdbf7..1caa8a9 100644
@@ -600,6 +600,10 @@ struct ieee80211_hw {
         int (*passive_scan)(struct net_device *dev, int state,
                             struct ieee80211_scan_conf *conf);
 
+	/* Ask the hardware to service the scan request, no need to start
+	 * the scan state machine in stack. */
+	int (*hw_scan)(struct net_device *dev, u8 *ssid, size_t len);
+
         /* return low-level statistics */
 	int (*get_stats)(struct net_device *dev,
 			 struct ieee80211_low_level_stats *stats);
@@ -906,6 +910,8 @@ void ieee80211_tx_led(int state, struct 
  */
 void ieee80211_rx_led(int state, struct net_device *dev);
 
+/* called by driver to notify scan status completed */
+void ieee80211_scan_completed(struct net_device *dev);
 
 /* IEEE 802.11 defines */
 
net/d80211/ieee80211.c +0 -0
net/d80211/ieee80211_sta.c +29 -16

71 lines not on this page · raw message

#5 lore raw

net/d80211/ieee80211_sta.c int ieee80211_sta_req_scan(struct net_de · line 2565

Quoted 5 lines · Hong Liu
net/d80211/ieee80211_sta.c +4 -0
+	local->sta_scanning = 1;
+	if (local->hw->hw_scan)
+		return local->hw->hw_scan(dev, ssid, ssid_len);
+

My question still stands, is it proper to assign sta_scanning to 1 even if the function returns an error?

johannes

author
#6 lore raw
Quoted 7 lines · Johannes Berg

Review

Quoted 5 lines · Hong Liu
(quoted diff) +4 -0
+     local->sta_scanning = 1;
+     if (local->hw->hw_scan)
+             return local->hw->hw_scan(dev, ssid, ssid_len);
+
Quoted 6 lines

My question still stands, is it proper to assign sta_scanning to 1 even if the function returns an error?

johannes

Thanks for point this out!
Change to only set sta_scanning to 1 if hw_scan successes.

include/net/d80211.h +6 -0
index 42fdbf7..1caa8a9 100644
@@ -600,6 +600,10 @@ struct ieee80211_hw {
         int (*passive_scan)(struct net_device *dev, int state,
                             struct ieee80211_scan_conf *conf);
 
+	/* Ask the hardware to service the scan request, no need to start
+	 * the scan state machine in stack. */
+	int (*hw_scan)(struct net_device *dev, u8 *ssid, size_t len);
+
         /* return low-level statistics */
 	int (*get_stats)(struct net_device *dev,
 			 struct ieee80211_low_level_stats *stats);
@@ -906,6 +910,8 @@ void ieee80211_tx_led(int state, struct 
  */
 void ieee80211_rx_led(int state, struct net_device *dev);
 
+/* called by driver to notify scan status completed */
+void ieee80211_scan_completed(struct net_device *dev);
 
 /* IEEE 802.11 defines */
 
net/d80211/ieee80211_sta.c +32 -15

71 lines not on this page · raw message

Applied
#7 lore raw
Quoted 2 lines · Hong Liu

Thanks for point this out!
Change to only set sta_scanning to 1 if hw_scan successes.

Applied to my tree. Thanks for the patch!

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#8 lore raw
In reply to Hong Liu

Hello, pleas I need help, I triying to scan all AP's in a range, but I have a problem, I have depreciate SIOIWAPLIST, and also SIOCIWSCAN always return 0. I dont know If I can put a patch to activate that an wich patch can I use and how. I'm a begginer user of linux. I'm working with debian etch and I have a Intel ipw3945 wirelles chipset. Thanks

Signature · 2 lines
View this message in context: http://www.nabble.com/-PATCH-2-2-d80211%3A-add-hardware-scan-callback-tp5979589p22910800.html
Sent from the netdev mailing list archive at Nabble.com.