]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/ipw2100.c
sky2: fiber pause bits
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / ipw2100.c
index e955db435b30b4ef9e2c87106790ada253582fa6..4e4eaa2a99ca4da6220a2239785f823b50a2825b 100644 (file)
@@ -150,7 +150,6 @@ that only one external action is invoked at a time.
 #include <linux/skbuff.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
-#define __KERNEL_SYSCALLS__
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
@@ -163,6 +162,7 @@ that only one external action is invoked at a time.
 #include <linux/firmware.h>
 #include <linux/acpi.h>
 #include <linux/ctype.h>
+#include <linux/latency.h>
 
 #include "ipw2100.h"
 
@@ -1697,6 +1697,11 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
                return 0;
        }
 
+       /* the ipw2100 hardware really doesn't want power management delays
+        * longer than 175usec
+        */
+       modify_acceptable_latency("ipw2100", 175);
+
        /* If the interrupt is enabled, turn it off... */
        spin_lock_irqsave(&priv->low_lock, flags);
        ipw2100_disable_interrupts(priv);
@@ -1849,6 +1854,8 @@ static void ipw2100_down(struct ipw2100_priv *priv)
        ipw2100_disable_interrupts(priv);
        spin_unlock_irqrestore(&priv->low_lock, flags);
 
+       modify_acceptable_latency("ipw2100", INFINITE_LATENCY);
+
 #ifdef ACPI_CSTATE_LIMIT_DEFINED
        if (priv->config & CFG_C3_DISABLED) {
                IPW_DEBUG_INFO(": Resetting C3 transitions.\n");
@@ -3248,7 +3255,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
        IPW_DEBUG_ISR("exit\n");
 }
 
-static irqreturn_t ipw2100_interrupt(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t ipw2100_interrupt(int irq, void *data)
 {
        struct ipw2100_priv *priv = data;
        u32 inta, inta_mask;
@@ -5911,7 +5918,7 @@ static u32 ipw2100_ethtool_get_link(struct net_device *dev)
        return (priv->status & STATUS_ASSOCIATED) ? 1 : 0;
 }
 
-static struct ethtool_ops ipw2100_ethtool_ops = {
+static const struct ethtool_ops ipw2100_ethtool_ops = {
        .get_link = ipw2100_ethtool_get_link,
        .get_drvinfo = ipw_ethtool_get_drvinfo,
 };
@@ -6254,19 +6261,22 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
         * member to call a function that then just turns and calls ipw2100_up.
         * net_dev->init is called after name allocation but before the
         * notifier chain is called */
-       mutex_lock(&priv->action_mutex);
        err = register_netdev(dev);
        if (err) {
                printk(KERN_WARNING DRV_NAME
                       "Error calling register_netdev.\n");
-               goto fail_unlock;
+               goto fail;
        }
+
+       mutex_lock(&priv->action_mutex);
        registered = 1;
 
        IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev));
 
        /* perform this after register_netdev so that dev->name is set */
-       sysfs_create_group(&pci_dev->dev.kobj, &ipw2100_attribute_group);
+       err = sysfs_create_group(&pci_dev->dev.kobj, &ipw2100_attribute_group);
+       if (err)
+               goto fail_unlock;
 
        /* If the RF Kill switch is disabled, go ahead and complete the
         * startup sequence */
@@ -6531,14 +6541,18 @@ static int __init ipw2100_init(void)
        printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
        printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT);
 
-       ret = pci_module_init(&ipw2100_pci_driver);
+       ret = pci_register_driver(&ipw2100_pci_driver);
+       if (ret)
+               goto out;
 
+       set_acceptable_latency("ipw2100", INFINITE_LATENCY);
 #ifdef CONFIG_IPW2100_DEBUG
        ipw2100_debug_level = debug;
-       driver_create_file(&ipw2100_pci_driver.driver,
-                          &driver_attr_debug_level);
+       ret = driver_create_file(&ipw2100_pci_driver.driver,
+                                &driver_attr_debug_level);
 #endif
 
+out:
        return ret;
 }
 
@@ -6553,6 +6567,7 @@ static void __exit ipw2100_exit(void)
                           &driver_attr_debug_level);
 #endif
        pci_unregister_driver(&ipw2100_pci_driver);
+       remove_acceptable_latency("ipw2100");
 }
 
 module_init(ipw2100_init);
@@ -6957,7 +6972,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
        }
 
        if (wrqu->essid.flags && wrqu->essid.length) {
-               length = wrqu->essid.length - 1;
+               length = wrqu->essid.length;
                essid = extra;
        }
 
@@ -7050,7 +7065,7 @@ static int ipw2100_wx_get_nick(struct net_device *dev,
 
        struct ipw2100_priv *priv = ieee80211_priv(dev);
 
-       wrqu->data.length = strlen(priv->nick) + 1;
+       wrqu->data.length = strlen(priv->nick);
        memcpy(extra, priv->nick, wrqu->data.length);
        wrqu->data.flags = 1;   /* active */
 
@@ -7342,14 +7357,14 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
                goto done;
        }
 
-       if (wrqu->retry.flags & IW_RETRY_MIN) {
+       if (wrqu->retry.flags & IW_RETRY_SHORT) {
                err = ipw2100_set_short_retry(priv, wrqu->retry.value);
                IPW_DEBUG_WX("SET Short Retry Limit -> %d \n",
                             wrqu->retry.value);
                goto done;
        }
 
-       if (wrqu->retry.flags & IW_RETRY_MAX) {
+       if (wrqu->retry.flags & IW_RETRY_LONG) {
                err = ipw2100_set_long_retry(priv, wrqu->retry.value);
                IPW_DEBUG_WX("SET Long Retry Limit -> %d \n",
                             wrqu->retry.value);
@@ -7382,14 +7397,14 @@ static int ipw2100_wx_get_retry(struct net_device *dev,
        if ((wrqu->retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME)
                return -EINVAL;
 
-       if (wrqu->retry.flags & IW_RETRY_MAX) {
-               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
+       if (wrqu->retry.flags & IW_RETRY_LONG) {
+               wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_LONG;
                wrqu->retry.value = priv->long_retry_limit;
        } else {
                wrqu->retry.flags =
                    (priv->short_retry_limit !=
                     priv->long_retry_limit) ?
-                   IW_RETRY_LIMIT | IW_RETRY_MIN : IW_RETRY_LIMIT;
+                   IW_RETRY_LIMIT | IW_RETRY_SHORT : IW_RETRY_LIMIT;
 
                wrqu->retry.value = priv->short_retry_limit;
        }