]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ipw2200: generates a scan event after a scan has completed
authorZhu Yi <yi.zhu@intel.com>
Thu, 13 Apr 2006 09:19:25 +0000 (17:19 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Apr 2006 20:15:54 +0000 (16:15 -0400)
The patch make ipw2200 generate the scan event every time a scan has
completed, so that user space know when to get fresh results.
Dan Williams would like to go towards this model in Network Manager
rather than having to poll.

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2200.c

index 0500e8006a147daf7981b7c502ca9f84b3c731f0..61cbf2ec0ab4ac7e05625fa20703760215395e9d 100644 (file)
@@ -4489,6 +4489,24 @@ static void ipw_rx_notification(struct ipw_priv *priv,
                                 && priv->status & STATUS_ASSOCIATED)
                                queue_delayed_work(priv->workqueue,
                                                   &priv->request_scan, HZ);
+
+                       /* Send an empty event to user space.
+                        * We don't send the received data on the event because
+                        * it would require us to do complex transcoding, and
+                        * we want to minimise the work done in the irq handler
+                        * Use a request to extract the data.
+                        * Also, we generate this even for any scan, regardless
+                        * on how the scan was initiated. User space can just
+                        * sync on periodic scan to get fresh data...
+                        * Jean II */
+                       if (x->status == SCAN_COMPLETED_STATUS_COMPLETE) {
+                               union iwreq_data wrqu;
+
+                               wrqu.data.length = 0;
+                               wrqu.data.flags = 0;
+                               wireless_send_event(priv->net_dev, SIOCGIWSCAN,
+                                                   &wrqu, NULL);
+                       }
                        break;
                }
 
@@ -8379,7 +8397,8 @@ static int ipw_wx_get_range(struct net_device *dev,
        /* Event capability (kernel + driver) */
        range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
                                IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) |
-                               IW_EVENT_CAPA_MASK(SIOCGIWAP));
+                               IW_EVENT_CAPA_MASK(SIOCGIWAP) |
+                               IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
        range->event_capa[1] = IW_EVENT_CAPA_K_1;
 
        range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |