Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / wireless / ipw2x00 / ipw2200.c
index 2b022571a8595a5dd41c89bdd515d0f1fd0dc70b..b3707dadad15d7b1051d0fff9c641b8802de45ef 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <net/cfg80211-wext.h>
 #include "ipw2200.h"
+#include "ipw.h"
 
 
 #ifndef KBUILD_EXTMOD
@@ -2191,6 +2192,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
 {
        int rc = 0;
        unsigned long flags;
+       unsigned long now, end;
 
        spin_lock_irqsave(&priv->lock, flags);
        if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2232,10 +2234,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
        }
        spin_unlock_irqrestore(&priv->lock, flags);
 
+       now = jiffies;
+       end = now + HOST_COMPLETE_TIMEOUT;
+again:
        rc = wait_event_interruptible_timeout(priv->wait_command_queue,
                                              !(priv->
                                                status & STATUS_HCMD_ACTIVE),
-                                             HOST_COMPLETE_TIMEOUT);
+                                             end - now);
+       if (rc < 0) {
+               now = jiffies;
+               if (time_before(now, end))
+                       goto again;
+               rc = 0;
+       }
+
        if (rc == 0) {
                spin_lock_irqsave(&priv->lock, flags);
                if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -3657,8 +3669,7 @@ static int ipw_load(struct ipw_priv *priv)
                priv->rxq = NULL;
        }
        ipw_tx_queue_free(priv);
-       if (raw)
-               release_firmware(raw);
+       release_firmware(raw);
 #ifdef CONFIG_PM
        fw_loaded = 0;
        raw = NULL;
@@ -7024,7 +7035,7 @@ static int ipw_qos_activate(struct ipw_priv *priv,
                            cpu_to_le16(burst_duration);
        } else if (priv->ieee->iw_mode == IW_MODE_ADHOC) {
                if (type == IEEE_B) {
-                       IPW_DEBUG_QOS("QoS activate IBSS nework mode %d\n",
+                       IPW_DEBUG_QOS("QoS activate IBSS network mode %d\n",
                                      type);
                        if (priv->qos_data.qos_enable == 0)
                                active_one = &def_parameters_CCK;
@@ -11533,6 +11544,9 @@ static int ipw_wdev_init(struct net_device *dev)
                wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band;
        }
 
+       wdev->wiphy->cipher_suites = ipw_cipher_suites;
+       wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites);
+
        set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
 
        /* With that information in place, we can now register the wiphy... */
@@ -11826,10 +11840,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
        net_dev->wireless_data = &priv->wireless_data;
        net_dev->wireless_handlers = &ipw_wx_handler_def;
        net_dev->ethtool_ops = &ipw_ethtool_ops;
-       net_dev->irq = pdev->irq;
-       net_dev->base_addr = (unsigned long)priv->hw_base;
-       net_dev->mem_start = pci_resource_start(pdev, 0);
-       net_dev->mem_end = net_dev->mem_start + pci_resource_len(pdev, 0) - 1;
 
        err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group);
        if (err) {