iwlwifi: correct API command overlap
authorJay Sternberg <jay.e.sternberg@linux.intel.com>
Thu, 29 Jan 2009 19:09:14 +0000 (11:09 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Feb 2009 20:03:42 +0000 (15:03 -0500)
Correct the API commands where same command id used for two different
commands. Update max api versions for affected devices.

TX_ANT_CONFIGURATION_CMD was already using id 0x98, so
REPLY_TX_POWER_DBM_CMD moved to 0x95

Older API interfaces may used original value so V1 defines provided.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-100.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-commands.h

index a5df93154d21f539e318290cea202a5d4ef4c606..11d206abb7100c82621be5bdf0ef204902127427 100644 (file)
@@ -46,7 +46,7 @@
 #include "iwl-5000-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL100_UCODE_API_MAX 1
+#define IWL100_UCODE_API_MAX 2
 
 /* Lowest firmware API version supported */
 #define IWL100_UCODE_API_MIN 1
index f8158edf6ebf0d91cbe7951bc2255e7c6a9d2dfd..17aaca8dad1f2082b5ea774db4275e3b42c1086e 100644 (file)
@@ -1411,12 +1411,19 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)
 static int  iwl5000_send_tx_power(struct iwl_priv *priv)
 {
        struct iwl5000_tx_power_dbm_cmd tx_power_cmd;
+       u8 tx_ant_cfg_cmd;
 
        /* half dBm need to multiply */
        tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
        tx_power_cmd.flags = IWL50_TX_POWER_NO_CLOSED;
        tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO;
-       return  iwl_send_cmd_pdu_async(priv, REPLY_TX_POWER_DBM_CMD,
+
+       if (IWL_UCODE_API(priv->ucode_ver) == 1)
+               tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1;
+       else
+               tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
+
+       return  iwl_send_cmd_pdu_async(priv, tx_ant_cfg_cmd,
                                       sizeof(tx_power_cmd), &tx_power_cmd,
                                       NULL);
 }
index 1672a988424a31eaff24f97a73343a246eccea12..af700707cb73b6e028c84b8f67a83656d73e831a 100644 (file)
@@ -46,8 +46,8 @@
 #include "iwl-5000-hw.h"
 
 /* Highest firmware API version supported */
-#define IWL6000_UCODE_API_MAX 1
-#define IWL6050_UCODE_API_MAX 1
+#define IWL6000_UCODE_API_MAX 2
+#define IWL6050_UCODE_API_MAX 2
 
 /* Lowest firmware API version supported */
 #define IWL6000_UCODE_API_MIN 1
index e49415c7fb2abbe33fc260f014b3152e0639ddae..77f32ad3de0b2c4d24ff68ee4bf569c1f1954b5c 100644 (file)
@@ -144,9 +144,11 @@ enum {
        WHO_IS_AWAKE_NOTIFICATION = 0x94,       /* not used */
 
        /* Miscellaneous commands */
+       REPLY_TX_POWER_DBM_CMD = 0x95,
        QUIET_NOTIFICATION = 0x96,              /* not used */
        REPLY_TX_PWR_TABLE_CMD = 0x97,
-       REPLY_TX_POWER_DBM_CMD = 0x98,
+       REPLY_TX_POWER_DBM_CMD_V1 = 0x98,       /* old version of API */
+       TX_ANT_CONFIGURATION_CMD = 0x98,        /* not used */
        MEASURE_ABORT_NOTIFICATION = 0x99,      /* not used */
 
        /* Bluetooth device coexistence config command */