iwlwifi: unify 4965 and 5000 scanning code
authorTomas Winkler <tomas.winkler@intel.com>
Fri, 11 Jul 2008 03:53:38 +0000 (11:53 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 14 Jul 2008 18:53:00 +0000 (14:53 -0400)
This patch unifies 4965 and 5000 scanning code.

We increases the version number to 1.3.27. Since new uCode
iwlwifi-4965-2.ucode is required for 4965 cards.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-scan.c

index a20adab6163a678d78ffceb519076f7c1b3b7799..9afecb813716d90817bf180bef80008253dcf7d9 100644 (file)
 static int iwl4965_send_tx_power(struct iwl_priv *priv);
 static int iwl4965_hw_get_temperature(const struct iwl_priv *priv);
 
+/* Change firmware file name, using "-" and incrementing number,
+ *   *only* when uCode interface or architecture changes so that it
+ *   is not compatible with earlier drivers.
+ * This number will also appear in << 8 position of 1st dword of uCode file */
+#define IWL4965_UCODE_API "-2"
+
+
 /* module parameters */
 static struct iwl_mod_params iwl4965_mod_params = {
        .num_of_queues = IWL49_NUM_QUEUES,
@@ -2454,6 +2461,9 @@ struct iwl_cfg iwl4965_agn_cfg = {
        .mod_params = &iwl4965_mod_params,
 };
 
+/* Module firmware */
+MODULE_FIRMWARE("iwlwifi-4965" IWL4965_UCODE_API ".ucode");
+
 module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444);
 MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
 module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
index 3e96df8e810894e647adf135270570e8b816f197..e9bb1de0ce3f344b695b949f37bad7bcc03963bb 100644 (file)
@@ -2099,6 +2099,9 @@ struct iwl_ct_kill_config {
  *
  *****************************************************************************/
 
+#define SCAN_CHANNEL_TYPE_PASSIVE __constant_cpu_to_le32(0)
+#define SCAN_CHANNEL_TYPE_ACTIVE  __constant_cpu_to_le32(1)
+
 /**
  * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
  *
@@ -2122,12 +2125,12 @@ struct iwl_scan_channel {
        /*
         * type is defined as:
         * 0:0 1 = active, 0 = passive
-        * 1:4 SSID direct bit map; if a bit is set, then corresponding
+        * 1:20 SSID direct bit map; if a bit is set, then corresponding
         *     SSID IE is transmitted in probe request.
-        * 5:7 reserved
+        * 21:31 reserved
         */
-       u8 type;
-       u8 channel;     /* band is selected by iwl4965_scan_cmd "flags" field */
+       __le32 type;
+       __le16 channel; /* band is selected by iwl_scan_cmd "flags" field */
        u8 tx_gain;             /* gain for analog radio */
        u8 dsp_atten;           /* gain for DSP */
        __le16 active_dwell;    /* in 1024-uSec TU (time units), typ 5-50 */
@@ -2147,9 +2150,9 @@ struct iwl_ssid_ie {
        u8 ssid[32];
 } __attribute__ ((packed));
 
-#define PROBE_OPTION_MAX        0x4
+#define PROBE_OPTION_MAX               0x14
 #define TX_CMD_LIFE_TIME_INFINITE      __constant_cpu_to_le32(0xFFFFFFFF)
-#define IWL_GOOD_CRC_TH                __constant_cpu_to_le16(1)
+#define IWL_GOOD_CRC_TH                        __constant_cpu_to_le16(1)
 #define IWL_MAX_SCAN_SIZE 1024
 
 /*
index 0293ae91c350160ed40a514cb245c9667deee320..db66114f1e5668e88b565c457c885e4cd88125b7 100644 (file)
@@ -70,7 +70,7 @@ struct iwl_host_cmd;
 struct iwl_cmd;
 
 
-#define IWLWIFI_VERSION "1.2.26k"
+#define IWLWIFI_VERSION "1.3.27k"
 #define DRV_COPYRIGHT  "Copyright(c) 2003-2008 Intel Corporation"
 
 #define IWL_PCI_DEVICE(dev, subdev, cfg) \
index 84a3ecfec484c47934b02e9d45d7c624ca3e309b..4d789e353e3a76ab840f792ea6eb56b57fdc2644 100644 (file)
@@ -54,12 +54,6 @@ extern struct iwl_cfg iwl5350_agn_cfg;
 extern struct iwl_cfg iwl5100_bg_cfg;
 extern struct iwl_cfg iwl5100_abg_cfg;
 
-/* Change firmware file name, using "-" and incrementing number,
- *   *only* when uCode interface or architecture changes so that it
- *   is not compatible with earlier drivers.
- * This number will also appear in << 8 position of 1st dword of uCode file */
-#define IWL4965_UCODE_API "-1"
-
 /* CT-KILL constants */
 #define CT_KILL_THRESHOLD      110 /* in Celsius */
 
index 5b420b43af5cb8b067ed5354eec768e002b65b00..cf24c2703c9bc172fadb29e6c51ee7c273475687 100644 (file)
@@ -375,6 +375,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
        u16 passive_dwell = 0;
        u16 active_dwell = 0;
        int added, i;
+       u16 channel;
 
        sband = iwl_get_hw_mode(priv, band);
        if (!sband)
@@ -389,24 +390,25 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
                if (channels[i].flags & IEEE80211_CHAN_DISABLED)
                        continue;
 
-               scan_ch->channel =
+               channel =
                        ieee80211_frequency_to_channel(channels[i].center_freq);
+               scan_ch->channel = cpu_to_le16(channel);
 
-               ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);
+               ch_info = iwl_get_channel_info(priv, band, channel);
                if (!is_channel_valid(ch_info)) {
                        IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",
-                                      scan_ch->channel);
+                                       channel);
                        continue;
                }
 
                if (!is_active || is_channel_passive(ch_info) ||
                    (channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN))
-                       scan_ch->type = 0;
+                       scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
                else
-                       scan_ch->type = 1;
+                       scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
 
-               if (scan_ch->type & 1)
-                       scan_ch->type |= (direct_mask << 1);
+               if (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE)
+                       scan_ch->type |= cpu_to_le32(direct_mask << 1);
 
                scan_ch->active_dwell = cpu_to_le16(active_dwell);
                scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
@@ -425,9 +427,10 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
                }
 
                IWL_DEBUG_SCAN("Scanning %d [%s %d]\n",
-                              scan_ch->channel,
-                              (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE",
-                              (scan_ch->type & 1) ?
+                              channel,
+                              (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ?
+                               "ACTIVE" : "PASSIVE",
+                              (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ?
                               active_dwell : passive_dwell);
 
                scan_ch++;