diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 |
4 files changed, 35 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 75fa55db330e..68d97f50fd00 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -1450,6 +1450,24 @@ int iwl5000_calc_rssi(struct iwl_priv *priv, | |||
1450 | return max_rssi - agc - IWL49_RSSI_OFFSET; | 1450 | return max_rssi - agc - IWL49_RSSI_OFFSET; |
1451 | } | 1451 | } |
1452 | 1452 | ||
1453 | static int iwl5000_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant) | ||
1454 | { | ||
1455 | struct iwl_tx_ant_config_cmd tx_ant_cmd = { | ||
1456 | .valid = cpu_to_le32(valid_tx_ant), | ||
1457 | }; | ||
1458 | |||
1459 | if (IWL_UCODE_API(priv->ucode_ver) > 1) { | ||
1460 | IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant); | ||
1461 | return iwl_send_cmd_pdu(priv, TX_ANT_CONFIGURATION_CMD, | ||
1462 | sizeof(struct iwl_tx_ant_config_cmd), | ||
1463 | &tx_ant_cmd); | ||
1464 | } else { | ||
1465 | IWL_DEBUG_HC(priv, "TX_ANT_CONFIGURATION_CMD not supported\n"); | ||
1466 | return -EOPNOTSUPP; | ||
1467 | } | ||
1468 | } | ||
1469 | |||
1470 | |||
1453 | #define IWL5000_UCODE_GET(item) \ | 1471 | #define IWL5000_UCODE_GET(item) \ |
1454 | static u32 iwl5000_ucode_get_##item(const struct iwl_ucode_header *ucode,\ | 1472 | static u32 iwl5000_ucode_get_##item(const struct iwl_ucode_header *ucode,\ |
1455 | u32 api_ver) \ | 1473 | u32 api_ver) \ |
@@ -1492,6 +1510,7 @@ struct iwl_hcmd_ops iwl5000_hcmd = { | |||
1492 | .rxon_assoc = iwl5000_send_rxon_assoc, | 1510 | .rxon_assoc = iwl5000_send_rxon_assoc, |
1493 | .commit_rxon = iwl_commit_rxon, | 1511 | .commit_rxon = iwl_commit_rxon, |
1494 | .set_rxon_chain = iwl_set_rxon_chain, | 1512 | .set_rxon_chain = iwl_set_rxon_chain, |
1513 | .set_tx_ant = iwl5000_send_tx_ant_config, | ||
1495 | }; | 1514 | }; |
1496 | 1515 | ||
1497 | struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { | 1516 | struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index cf2b481dca6d..5505878dcaf7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1762,6 +1762,10 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
1762 | priv->active_rate = priv->rates_mask; | 1762 | priv->active_rate = priv->rates_mask; |
1763 | priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; | 1763 | priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; |
1764 | 1764 | ||
1765 | /* Configure Tx antenna selection based on H/W config */ | ||
1766 | if (priv->cfg->ops->hcmd->set_tx_ant) | ||
1767 | priv->cfg->ops->hcmd->set_tx_ant(priv, priv->cfg->valid_tx_ant); | ||
1768 | |||
1765 | if (iwl_is_associated(priv)) { | 1769 | if (iwl_is_associated(priv)) { |
1766 | struct iwl_rxon_cmd *active_rxon = | 1770 | struct iwl_rxon_cmd *active_rxon = |
1767 | (struct iwl_rxon_cmd *)&priv->active_rxon; | 1771 | (struct iwl_rxon_cmd *)&priv->active_rxon; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 2c5c88fc38f5..e5f40f35dc3f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -148,7 +148,7 @@ enum { | |||
148 | QUIET_NOTIFICATION = 0x96, /* not used */ | 148 | QUIET_NOTIFICATION = 0x96, /* not used */ |
149 | REPLY_TX_PWR_TABLE_CMD = 0x97, | 149 | REPLY_TX_PWR_TABLE_CMD = 0x97, |
150 | REPLY_TX_POWER_DBM_CMD_V1 = 0x98, /* old version of API */ | 150 | REPLY_TX_POWER_DBM_CMD_V1 = 0x98, /* old version of API */ |
151 | TX_ANT_CONFIGURATION_CMD = 0x98, /* not used */ | 151 | TX_ANT_CONFIGURATION_CMD = 0x98, |
152 | MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */ | 152 | MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */ |
153 | 153 | ||
154 | /* Bluetooth device coexistence config command */ | 154 | /* Bluetooth device coexistence config command */ |
@@ -411,6 +411,16 @@ struct iwl5000_tx_power_dbm_cmd { | |||
411 | u8 reserved; | 411 | u8 reserved; |
412 | } __attribute__ ((packed)); | 412 | } __attribute__ ((packed)); |
413 | 413 | ||
414 | /** | ||
415 | * Command TX_ANT_CONFIGURATION_CMD = 0x98 | ||
416 | * This command is used to configure valid Tx antenna. | ||
417 | * By default uCode concludes the valid antenna according to the radio flavor. | ||
418 | * This command enables the driver to override/modify this conclusion. | ||
419 | */ | ||
420 | struct iwl_tx_ant_config_cmd { | ||
421 | __le32 valid; | ||
422 | } __attribute__ ((packed)); | ||
423 | |||
414 | /****************************************************************************** | 424 | /****************************************************************************** |
415 | * (0a) | 425 | * (0a) |
416 | * Alive and Error Commands & Responses: | 426 | * Alive and Error Commands & Responses: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index c7675c387140..f094cd9de443 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -89,6 +89,7 @@ struct iwl_hcmd_ops { | |||
89 | int (*rxon_assoc)(struct iwl_priv *priv); | 89 | int (*rxon_assoc)(struct iwl_priv *priv); |
90 | int (*commit_rxon)(struct iwl_priv *priv); | 90 | int (*commit_rxon)(struct iwl_priv *priv); |
91 | void (*set_rxon_chain)(struct iwl_priv *priv); | 91 | void (*set_rxon_chain)(struct iwl_priv *priv); |
92 | int (*set_tx_ant)(struct iwl_priv *priv, u8 valid_tx_ant); | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | struct iwl_hcmd_utils_ops { | 95 | struct iwl_hcmd_utils_ops { |