diff options
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index c144e3cdb890..7a7797560a23 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2089,12 +2089,46 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status) | |||
2089 | queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ)); | 2089 | queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ)); |
2090 | } | 2090 | } |
2091 | 2091 | ||
2092 | static void send_scan_event(void *data) | ||
2093 | { | ||
2094 | struct ipw2100_priv *priv = data; | ||
2095 | union iwreq_data wrqu; | ||
2096 | |||
2097 | wrqu.data.length = 0; | ||
2098 | wrqu.data.flags = 0; | ||
2099 | wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL); | ||
2100 | } | ||
2101 | |||
2102 | static void ipw2100_scan_event_later(struct work_struct *work) | ||
2103 | { | ||
2104 | send_scan_event(container_of(work, struct ipw2100_priv, | ||
2105 | scan_event_later.work)); | ||
2106 | } | ||
2107 | |||
2108 | static void ipw2100_scan_event_now(struct work_struct *work) | ||
2109 | { | ||
2110 | send_scan_event(container_of(work, struct ipw2100_priv, | ||
2111 | scan_event_now)); | ||
2112 | } | ||
2113 | |||
2092 | static void isr_scan_complete(struct ipw2100_priv *priv, u32 status) | 2114 | static void isr_scan_complete(struct ipw2100_priv *priv, u32 status) |
2093 | { | 2115 | { |
2094 | IPW_DEBUG_SCAN("scan complete\n"); | 2116 | IPW_DEBUG_SCAN("scan complete\n"); |
2095 | /* Age the scan results... */ | 2117 | /* Age the scan results... */ |
2096 | priv->ieee->scans++; | 2118 | priv->ieee->scans++; |
2097 | priv->status &= ~STATUS_SCANNING; | 2119 | priv->status &= ~STATUS_SCANNING; |
2120 | |||
2121 | /* Only userspace-requested scan completion events go out immediately */ | ||
2122 | if (!priv->user_requested_scan) { | ||
2123 | if (!delayed_work_pending(&priv->scan_event_later)) | ||
2124 | queue_delayed_work(priv->workqueue, | ||
2125 | &priv->scan_event_later, | ||
2126 | round_jiffies(msecs_to_jiffies(4000))); | ||
2127 | } else { | ||
2128 | priv->user_requested_scan = 0; | ||
2129 | cancel_delayed_work(&priv->scan_event_later); | ||
2130 | queue_work(priv->workqueue, &priv->scan_event_now); | ||
2131 | } | ||
2098 | } | 2132 | } |
2099 | 2133 | ||
2100 | #ifdef CONFIG_IPW2100_DEBUG | 2134 | #ifdef CONFIG_IPW2100_DEBUG |
@@ -4349,6 +4383,7 @@ static void ipw2100_kill_workqueue(struct ipw2100_priv *priv) | |||
4349 | cancel_delayed_work(&priv->wx_event_work); | 4383 | cancel_delayed_work(&priv->wx_event_work); |
4350 | cancel_delayed_work(&priv->hang_check); | 4384 | cancel_delayed_work(&priv->hang_check); |
4351 | cancel_delayed_work(&priv->rf_kill); | 4385 | cancel_delayed_work(&priv->rf_kill); |
4386 | cancel_delayed_work(&priv->scan_event_later); | ||
4352 | destroy_workqueue(priv->workqueue); | 4387 | destroy_workqueue(priv->workqueue); |
4353 | priv->workqueue = NULL; | 4388 | priv->workqueue = NULL; |
4354 | } | 4389 | } |
@@ -6092,6 +6127,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, | |||
6092 | INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); | 6127 | INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); |
6093 | INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); | 6128 | INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); |
6094 | INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); | 6129 | INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); |
6130 | INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now); | ||
6131 | INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later); | ||
6095 | 6132 | ||
6096 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | 6133 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) |
6097 | ipw2100_irq_tasklet, (unsigned long)priv); | 6134 | ipw2100_irq_tasklet, (unsigned long)priv); |
@@ -7396,6 +7433,8 @@ static int ipw2100_wx_set_scan(struct net_device *dev, | |||
7396 | } | 7433 | } |
7397 | 7434 | ||
7398 | IPW_DEBUG_WX("Initiating scan...\n"); | 7435 | IPW_DEBUG_WX("Initiating scan...\n"); |
7436 | |||
7437 | priv->user_requested_scan = 1; | ||
7399 | if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) { | 7438 | if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) { |
7400 | IPW_DEBUG_WX("Start scan failed.\n"); | 7439 | IPW_DEBUG_WX("Start scan failed.\n"); |
7401 | 7440 | ||