iwlwifi: more generic name for bluetooth command
Instead of hardcode 6000 and 2000, use more generic name Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
This commit is contained in:
parent
8fb96d6e17
commit
8347deb3d7
2 changed files with 20 additions and 14 deletions
|
@ -307,24 +307,30 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
|
||||||
.bt3_prio_sample_time = IWLAGN_BT3_PRIO_SAMPLE_DEFAULT,
|
.bt3_prio_sample_time = IWLAGN_BT3_PRIO_SAMPLE_DEFAULT,
|
||||||
.bt3_timer_t2_value = IWLAGN_BT3_T2_DEFAULT,
|
.bt3_timer_t2_value = IWLAGN_BT3_T2_DEFAULT,
|
||||||
};
|
};
|
||||||
struct iwl6000_bt_cmd bt_cmd_6000;
|
struct iwl_bt_cmd_v1 bt_cmd_v1;
|
||||||
struct iwl2000_bt_cmd bt_cmd_2000;
|
struct iwl_bt_cmd_v2 bt_cmd_v2;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
|
BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
|
||||||
sizeof(basic.bt3_lookup_table));
|
sizeof(basic.bt3_lookup_table));
|
||||||
|
|
||||||
if (cfg(priv)->bt_params) {
|
if (cfg(priv)->bt_params) {
|
||||||
|
/*
|
||||||
|
* newer generation of devices (2000 series and newer)
|
||||||
|
* use the version 2 of the bt command
|
||||||
|
* we need to make sure sending the host command
|
||||||
|
* with correct data structure to avoid uCode assert
|
||||||
|
*/
|
||||||
if (cfg(priv)->bt_params->bt_session_2) {
|
if (cfg(priv)->bt_params->bt_session_2) {
|
||||||
bt_cmd_2000.prio_boost = cpu_to_le32(
|
bt_cmd_v2.prio_boost = cpu_to_le32(
|
||||||
cfg(priv)->bt_params->bt_prio_boost);
|
cfg(priv)->bt_params->bt_prio_boost);
|
||||||
bt_cmd_2000.tx_prio_boost = 0;
|
bt_cmd_v2.tx_prio_boost = 0;
|
||||||
bt_cmd_2000.rx_prio_boost = 0;
|
bt_cmd_v2.rx_prio_boost = 0;
|
||||||
} else {
|
} else {
|
||||||
bt_cmd_6000.prio_boost =
|
bt_cmd_v1.prio_boost =
|
||||||
cfg(priv)->bt_params->bt_prio_boost;
|
cfg(priv)->bt_params->bt_prio_boost;
|
||||||
bt_cmd_6000.tx_prio_boost = 0;
|
bt_cmd_v1.tx_prio_boost = 0;
|
||||||
bt_cmd_6000.rx_prio_boost = 0;
|
bt_cmd_v1.rx_prio_boost = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
IWL_ERR(priv, "failed to construct BT Coex Config\n");
|
IWL_ERR(priv, "failed to construct BT Coex Config\n");
|
||||||
|
@ -371,15 +377,15 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
|
||||||
"full concurrency" : "3-wire");
|
"full concurrency" : "3-wire");
|
||||||
|
|
||||||
if (cfg(priv)->bt_params->bt_session_2) {
|
if (cfg(priv)->bt_params->bt_session_2) {
|
||||||
memcpy(&bt_cmd_2000.basic, &basic,
|
memcpy(&bt_cmd_v2.basic, &basic,
|
||||||
sizeof(basic));
|
sizeof(basic));
|
||||||
ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
|
ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
|
||||||
CMD_SYNC, sizeof(bt_cmd_2000), &bt_cmd_2000);
|
CMD_SYNC, sizeof(bt_cmd_v2), &bt_cmd_v2);
|
||||||
} else {
|
} else {
|
||||||
memcpy(&bt_cmd_6000.basic, &basic,
|
memcpy(&bt_cmd_v1.basic, &basic,
|
||||||
sizeof(basic));
|
sizeof(basic));
|
||||||
ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
|
ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
|
||||||
CMD_SYNC, sizeof(bt_cmd_6000), &bt_cmd_6000);
|
CMD_SYNC, sizeof(bt_cmd_v1), &bt_cmd_v1);
|
||||||
}
|
}
|
||||||
if (ret)
|
if (ret)
|
||||||
IWL_ERR(priv, "failed to send BT Coex Config\n");
|
IWL_ERR(priv, "failed to send BT Coex Config\n");
|
||||||
|
|
|
@ -1918,7 +1918,7 @@ struct iwl_basic_bt_cmd {
|
||||||
__le16 valid;
|
__le16 valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iwl6000_bt_cmd {
|
struct iwl_bt_cmd_v1 {
|
||||||
struct iwl_basic_bt_cmd basic;
|
struct iwl_basic_bt_cmd basic;
|
||||||
u8 prio_boost;
|
u8 prio_boost;
|
||||||
/*
|
/*
|
||||||
|
@ -1929,7 +1929,7 @@ struct iwl6000_bt_cmd {
|
||||||
__le16 rx_prio_boost; /* SW boost of WiFi rx priority */
|
__le16 rx_prio_boost; /* SW boost of WiFi rx priority */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct iwl2000_bt_cmd {
|
struct iwl_bt_cmd_v2 {
|
||||||
struct iwl_basic_bt_cmd basic;
|
struct iwl_basic_bt_cmd basic;
|
||||||
__le32 prio_boost;
|
__le32 prio_boost;
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue