]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iwlwifi: use #define instead of hard coded value
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 8 May 2009 20:44:42 +0000 (13:44 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 May 2009 19:24:02 +0000 (15:24 -0400)
Instead of hard coded value, use the define in iwl-commands.h for
better code maintenance

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-scan.c

index 112bfa50b8fa0bcae355b604bceaa8a02f2602ff..597d9552fe4b07b4dfac8d42c2c4df50d654b3c0 100644 (file)
@@ -960,10 +960,10 @@ void iwl_set_rxon_chain(struct iwl_priv *priv)
        if (iwl_is_monitor_mode(priv) &&
            !(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) &&
            ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)) {
-               rx_chain = 0x07 << RXON_RX_CHAIN_VALID_POS;
-               rx_chain |= 0x06 << RXON_RX_CHAIN_FORCE_SEL_POS;
-               rx_chain |= 0x07 << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
-               rx_chain |= 0x01 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
+               rx_chain = ANT_ABC << RXON_RX_CHAIN_VALID_POS;
+               rx_chain |= ANT_BC << RXON_RX_CHAIN_FORCE_SEL_POS;
+               rx_chain |= ANT_ABC << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
+               rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
        }
 
        priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain);
index dd8766b80b34eaee47b5eb17b6bd2fd8ddf6fe42..065214b55895a432ff075f4f62dd17a0e6fc9afe 100644 (file)
@@ -580,9 +580,10 @@ static void iwl_bg_request_scan(struct work_struct *data)
        int ret = 0;
        u32 rate_flags = 0;
        u16 cmd_len;
+       u16 rx_chain = 0;
        enum ieee80211_band band;
        u8 n_probes = 0;
-       u8 rx_chain = priv->hw_params.valid_rx_ant;
+       u8 rx_ant = priv->hw_params.valid_rx_ant;
        u8 rate;
        bool is_active = false;
 
@@ -723,7 +724,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                 * Avoid A (0x1) because of its off-channel reception on A-band.
                 */
                if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)
-                       rx_chain = 0x6;
+                       rx_ant = ANT_BC;
        } else {
                IWL_WARN(priv, "Invalid scan band count\n");
                goto done;
@@ -735,10 +736,11 @@ static void iwl_bg_request_scan(struct work_struct *data)
        scan->tx_cmd.rate_n_flags = iwl_hw_set_rate_n_flags(rate, rate_flags);
 
        /* MIMO is not used here, but value is required */
-       scan->rx_chain = RXON_RX_CHAIN_DRIVER_FORCE_MSK |
-                               cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) |
-                               (rx_chain << RXON_RX_CHAIN_FORCE_SEL_POS) |
-                               (0x7 << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS));
+       rx_chain |= ANT_ABC << RXON_RX_CHAIN_VALID_POS;
+       rx_chain |= ANT_ABC << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
+       rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS;
+       rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
+       scan->rx_chain = cpu_to_le16(rx_chain);
        cmd_len = iwl_fill_probe_req(priv,
                                (struct ieee80211_mgmt *)scan->data,
                                priv->scan_request->ie,