]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 20 Oct 2007 03:35:20 +0000 (20:35 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 20 Oct 2007 03:35:20 +0000 (20:35 -0700)
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (21 commits)
  Fix build break in tsi108.c
  qeth: remove header_ops bug
  ir-functions.c:(.text+0xbce18): undefined reference to `input_event'
  NAPI: kconfig prompt and deleted doc file
  phy/bitbang: missing MODULE_LICENSE
  DM9000 initialization fix
  [PATCH] rt2x00: Add new rt73usb USB ID
  [PATCH] rt2x00: Fix residual check in PLCP calculations.
  [PATCH] iwlwifi: Fix rate setting in probe request for HW sacn
  [PATCH] b43: Make b43_stop() static
  [PATCH] drivers/net/wireless/b43/main.c: fix an uninitialized variable
  [PATCH] iwlwifi: set correct base rate for A band in rs_dbgfs_set_mcs
  [PATCH] zd1211rw, fix oops when ejecting install media
  [PATCH] b43legacy: Fix potential return of uninitialized variable
  [PATCH] iwl4965-base.c: fix off-by-one errors
  [PATCH] p54: Make filter configuration atomic
  [PATCH] rtl8187: remove NICMAC setting in configure_filters callback
  [PATCH] janitorial: fix all double includes in drivers/net/wireless
  [PATCH] rtl8187: Fix more frag bit checking, rts duration calc
  [PATCH] ipw2100: send WEXT scan events
  ...

1  2 
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2100.h

index c144e3cdb890f9ef9d7210d93b1dce3064aa48ed,2fa8eed86dc1f021938b08ec0f82e0b9a7e5fa87..7a7797560a234164e10c3c32a469569908ce188d
@@@ -1858,6 -1858,14 +1858,6 @@@ static void ipw2100_down(struct ipw2100
  
        modify_acceptable_latency("ipw2100", INFINITE_LATENCY);
  
 -#ifdef ACPI_CSTATE_LIMIT_DEFINED
 -      if (priv->config & CFG_C3_DISABLED) {
 -              IPW_DEBUG_INFO(": Resetting C3 transitions.\n");
 -              acpi_set_cstate_limit(priv->cstate_limit);
 -              priv->config &= ~CFG_C3_DISABLED;
 -      }
 -#endif
 -
        /* We have to signal any supplicant if we are disassociating */
        if (associated)
                wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
@@@ -2083,18 -2091,60 +2083,52 @@@ static void isr_indicate_rf_kill(struc
        /* RF_KILL is now enabled (else we wouldn't be here) */
        priv->status |= STATUS_RF_KILL_HW;
  
 -#ifdef ACPI_CSTATE_LIMIT_DEFINED
 -      if (priv->config & CFG_C3_DISABLED) {
 -              IPW_DEBUG_INFO(": Resetting C3 transitions.\n");
 -              acpi_set_cstate_limit(priv->cstate_limit);
 -              priv->config &= ~CFG_C3_DISABLED;
 -      }
 -#endif
 -
        /* Make sure the RF Kill check timer is running */
        priv->stop_rf_kill = 0;
        cancel_delayed_work(&priv->rf_kill);
        queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
  }
  
+ static void send_scan_event(void *data)
+ {
+       struct ipw2100_priv *priv = data;
+       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");
        /* Age the scan results... */
        priv->ieee->scans++;
        priv->status &= ~STATUS_SCANNING;
+       /* Only userspace-requested scan completion events go out immediately */
+       if (!priv->user_requested_scan) {
+               if (!delayed_work_pending(&priv->scan_event_later))
+                       queue_delayed_work(priv->workqueue,
+                                       &priv->scan_event_later,
+                                       round_jiffies(msecs_to_jiffies(4000)));
+       } else {
+               priv->user_requested_scan = 0;
+               cancel_delayed_work(&priv->scan_event_later);
+               queue_work(priv->workqueue, &priv->scan_event_now);
+       }
  }
  
  #ifdef CONFIG_IPW2100_DEBUG
@@@ -2313,10 -2363,23 +2347,10 @@@ static void ipw2100_corruption_detected
        u32 match, reg;
        int j;
  #endif
 -#ifdef ACPI_CSTATE_LIMIT_DEFINED
 -      int limit;
 -#endif
  
        IPW_DEBUG_INFO(": PCI latency error detected at 0x%04zX.\n",
                       i * sizeof(struct ipw2100_status));
  
 -#ifdef ACPI_CSTATE_LIMIT_DEFINED
 -      IPW_DEBUG_INFO(": Disabling C3 transitions.\n");
 -      limit = acpi_get_cstate_limit();
 -      if (limit > 2) {
 -              priv->cstate_limit = limit;
 -              acpi_set_cstate_limit(2);
 -              priv->config |= CFG_C3_DISABLED;
 -      }
 -#endif
 -
  #ifdef IPW2100_DEBUG_C3
        /* Halt the fimrware so we can get a good image */
        write_register(priv->net_dev, IPW_REG_RESET_REG,
@@@ -4349,6 -4412,7 +4383,7 @@@ static void ipw2100_kill_workqueue(stru
                cancel_delayed_work(&priv->wx_event_work);
                cancel_delayed_work(&priv->hang_check);
                cancel_delayed_work(&priv->rf_kill);
+               cancel_delayed_work(&priv->scan_event_later);
                destroy_workqueue(priv->workqueue);
                priv->workqueue = NULL;
        }
@@@ -6092,6 -6156,8 +6127,8 @@@ static struct net_device *ipw2100_alloc
        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);
  
        tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
                     ipw2100_irq_tasklet, (unsigned long)priv);
@@@ -7396,6 -7462,8 +7433,8 @@@ static int ipw2100_wx_set_scan(struct n
        }
  
        IPW_DEBUG_WX("Initiating scan...\n");
+       priv->user_requested_scan = 1;
        if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
                IPW_DEBUG_WX("Start scan failed.\n");
  
index 2b8be2418fa772e93ac8c6dc53bac5137f93d9af,1ee3348aedd9a5e6c9e952253cc51ed26e78d789..bbf1ddcafba8f6249f900b51dc8e660f7b043f8b
@@@ -479,6 -479,7 +479,6 @@@ enum 
  #define CFG_ASSOCIATE           (1<<6)
  #define CFG_FIXED_RATE          (1<<7)
  #define CFG_ADHOC_CREATE        (1<<8)
 -#define CFG_C3_DISABLED         (1<<9)
  #define CFG_PASSIVE_SCAN        (1<<10)
  #ifdef CONFIG_IPW2100_MONITOR
  #define CFG_CRC_CHECK           (1<<11)
@@@ -507,6 -508,7 +507,6 @@@ struct ipw2100_priv 
        u8 bssid[ETH_ALEN];
        u8 channel;
        int last_mode;
 -      int cstate_limit;
  
        unsigned long connect_start;
        unsigned long last_reset;
        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;
+       int user_requested_scan;
  
        u32 interrupts;
        int tx_interrupts;