Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350264
b: refs/heads/master
c: 7c99e0b
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Feb 9, 2013
1 parent 32df3be commit f883ff4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d0315a2bec2dd7fe9cbe31098bb89536648224e
refs/heads/master: 7c99e0bf86fdc1dee238eb6e213b980f887b68f1
31 changes: 8 additions & 23 deletions trunk/drivers/net/wireless/ipw2x00/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2181,28 +2181,17 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
mod_delayed_work(system_wq, &priv->rf_kill, round_jiffies_relative(HZ));
}

static void send_scan_event(void *data)
static void ipw2100_scan_event(struct work_struct *work)
{
struct ipw2100_priv *priv = data;
struct ipw2100_priv *priv = container_of(work, struct ipw2100_priv,
scan_event.work);
union iwreq_data wrqu;

wrqu.data.length = 0;
wrqu.data.flags = 0;
wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
}

static void ipw2100_scan_event_later(struct work_struct *work)
{
send_scan_event(container_of(work, struct ipw2100_priv,
scan_event_later.work));
}

static void ipw2100_scan_event_now(struct work_struct *work)
{
send_scan_event(container_of(work, struct ipw2100_priv,
scan_event_now));
}

static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
{
IPW_DEBUG_SCAN("scan complete\n");
Expand All @@ -2212,13 +2201,11 @@ static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)

/* Only userspace-requested scan completion events go out immediately */
if (!priv->user_requested_scan) {
if (!delayed_work_pending(&priv->scan_event_later))
schedule_delayed_work(&priv->scan_event_later,
round_jiffies_relative(msecs_to_jiffies(4000)));
schedule_delayed_work(&priv->scan_event,
round_jiffies_relative(msecs_to_jiffies(4000)));
} else {
priv->user_requested_scan = 0;
cancel_delayed_work(&priv->scan_event_later);
schedule_work(&priv->scan_event_now);
mod_delayed_work(system_wq, &priv->scan_event, 0);
}
}

Expand Down Expand Up @@ -4459,8 +4446,7 @@ static void ipw2100_kill_works(struct ipw2100_priv *priv)
cancel_delayed_work_sync(&priv->wx_event_work);
cancel_delayed_work_sync(&priv->hang_check);
cancel_delayed_work_sync(&priv->rf_kill);
cancel_work_sync(&priv->scan_event_now);
cancel_delayed_work_sync(&priv->scan_event_later);
cancel_delayed_work_sync(&priv->scan_event);
}

static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
Expand Down Expand Up @@ -6195,8 +6181,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);
INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);

tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
ipw2100_irq_tasklet, (unsigned long)priv);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/ipw2x00/ipw2100.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,7 @@ struct ipw2100_priv {
struct delayed_work wx_event_work;
struct delayed_work hang_check;
struct delayed_work rf_kill;
struct work_struct scan_event_now;
struct delayed_work scan_event_later;
struct delayed_work scan_event;

int user_requested_scan;

Expand Down
13 changes: 3 additions & 10 deletions trunk/drivers/net/wireless/ipw2x00/ipw2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -4480,18 +4480,11 @@ static void handle_scan_event(struct ipw_priv *priv)
{
/* Only userspace-requested scan completion events go out immediately */
if (!priv->user_requested_scan) {
if (!delayed_work_pending(&priv->scan_event))
schedule_delayed_work(&priv->scan_event,
round_jiffies_relative(msecs_to_jiffies(4000)));
schedule_delayed_work(&priv->scan_event,
round_jiffies_relative(msecs_to_jiffies(4000)));
} else {
union iwreq_data wrqu;

priv->user_requested_scan = 0;
cancel_delayed_work(&priv->scan_event);

wrqu.data.length = 0;
wrqu.data.flags = 0;
wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
mod_delayed_work(system_wq, &priv->scan_event, 0);
}
}

Expand Down

0 comments on commit f883ff4

Please sign in to comment.