Commit b6e116e8 authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville

iwlagn: generic bt coex functions

Move bt coex functions to iwl-agn-lib.c, so those functions
can be shared by multiple wifi/bt combo devices
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent da5dbb97
This diff is collapsed.
...@@ -277,6 +277,14 @@ struct iwl_hcmd_ops iwlagn_hcmd = { ...@@ -277,6 +277,14 @@ struct iwl_hcmd_ops iwlagn_hcmd = {
.send_bt_config = iwl_send_bt_config, .send_bt_config = iwl_send_bt_config,
}; };
struct iwl_hcmd_ops iwlagn_bt_hcmd = {
.rxon_assoc = iwlagn_send_rxon_assoc,
.commit_rxon = iwl_commit_rxon,
.set_rxon_chain = iwl_set_rxon_chain,
.set_tx_ant = iwlagn_send_tx_ant_config,
.send_bt_config = iwlagn_send_advance_bt_config,
};
struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = { struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = {
.get_hcmd_size = iwlagn_get_hcmd_size, .get_hcmd_size = iwlagn_get_hcmd_size,
.build_addsta_hcmd = iwlagn_build_addsta_hcmd, .build_addsta_hcmd = iwlagn_build_addsta_hcmd,
......
This diff is collapsed.
...@@ -464,11 +464,11 @@ int iwlagn_alive_notify(struct iwl_priv *priv) ...@@ -464,11 +464,11 @@ int iwlagn_alive_notify(struct iwl_priv *priv)
if (priv->cfg->advanced_bt_coexist) { if (priv->cfg->advanced_bt_coexist) {
/* Configure Bluetooth device coexistence support */ /* Configure Bluetooth device coexistence support */
/* need to perform this before any calibration */ /* need to perform this before any calibration */
priv->bt_valid = IWL6000G2B_BT_ALL_VALID_MSK; priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
priv->kill_ack_mask = IWL6000G2B_BT_KILL_ACK_MASK_DEFAULT; priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
priv->kill_cts_mask = IWL6000G2B_BT_KILL_CTS_MASK_DEFAULT; priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
priv->cfg->ops->hcmd->send_bt_config(priv); priv->cfg->ops->hcmd->send_bt_config(priv);
priv->bt_valid = IWL6000G2B_BT_VALID_ENABLE_FLAGS; priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS;
if (bt_coex_active && priv->iw_mode != NL80211_IFTYPE_ADHOC) { if (bt_coex_active && priv->iw_mode != NL80211_IFTYPE_ADHOC) {
iwlagn_send_prio_tbl(priv); iwlagn_send_prio_tbl(priv);
......
...@@ -4024,9 +4024,9 @@ static int iwl_init_drv(struct iwl_priv *priv) ...@@ -4024,9 +4024,9 @@ static int iwl_init_drv(struct iwl_priv *priv)
/* init bt coex */ /* init bt coex */
if (priv->cfg->advanced_bt_coexist) { if (priv->cfg->advanced_bt_coexist) {
priv->kill_ack_mask = IWL6000G2B_BT_KILL_ACK_MASK_DEFAULT; priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
priv->kill_cts_mask = IWL6000G2B_BT_KILL_CTS_MASK_DEFAULT; priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
priv->bt_valid = IWL6000G2B_BT_ALL_VALID_MSK; priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
priv->bt_on_thresh = BT_ON_THRESHOLD_DEF; priv->bt_on_thresh = BT_ON_THRESHOLD_DEF;
priv->bt_duration = BT_DURATION_LIMIT_DEF; priv->bt_duration = BT_DURATION_LIMIT_DEF;
priv->dynamic_frag_thresh = BT_FRAG_THRESHOLD_DEF; priv->dynamic_frag_thresh = BT_FRAG_THRESHOLD_DEF;
......
...@@ -95,6 +95,7 @@ extern struct iwl_cfg iwl1000_bg_cfg; ...@@ -95,6 +95,7 @@ extern struct iwl_cfg iwl1000_bg_cfg;
extern struct iwl_mod_params iwlagn_mod_params; extern struct iwl_mod_params iwlagn_mod_params;
extern struct iwl_hcmd_ops iwlagn_hcmd; extern struct iwl_hcmd_ops iwlagn_hcmd;
extern struct iwl_hcmd_ops iwlagn_bt_hcmd;
extern struct iwl_hcmd_utils_ops iwlagn_hcmd_utils; extern struct iwl_hcmd_utils_ops iwlagn_hcmd_utils;
int iwl_reset_ict(struct iwl_priv *priv); int iwl_reset_ict(struct iwl_priv *priv);
...@@ -226,4 +227,12 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv, ...@@ -226,4 +227,12 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv,
int iwlagn_send_rxon_assoc(struct iwl_priv *priv); int iwlagn_send_rxon_assoc(struct iwl_priv *priv);
int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant); int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant);
/* bt coex */
void iwlagn_send_advance_bt_config(struct iwl_priv *priv);
void iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb);
void iwlagn_bt_rx_handler_setup(struct iwl_priv *priv);
void iwlagn_bt_setup_deferred_work(struct iwl_priv *priv);
void iwlagn_bt_cancel_deferred_work(struct iwl_priv *priv);
#endif /* __iwl_agn_h__ */ #endif /* __iwl_agn_h__ */
...@@ -2411,52 +2411,52 @@ struct iwl_bt_cmd { ...@@ -2411,52 +2411,52 @@ struct iwl_bt_cmd {
__le32 kill_cts_mask; __le32 kill_cts_mask;
} __packed; } __packed;
#define IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION BIT(0) #define IWLAGN_BT_FLAG_CHANNEL_INHIBITION BIT(0)
#define IWL6000G2B_BT_FLAG_COEX_MODE_MASK (BIT(3)|BIT(4)|BIT(5)) #define IWLAGN_BT_FLAG_COEX_MODE_MASK (BIT(3)|BIT(4)|BIT(5))
#define IWL6000G2B_BT_FLAG_COEX_MODE_SHIFT 3 #define IWLAGN_BT_FLAG_COEX_MODE_SHIFT 3
#define IWL6000G2B_BT_FLAG_COEX_MODE_DISABLED 0 #define IWLAGN_BT_FLAG_COEX_MODE_DISABLED 0
#define IWL6000G2B_BT_FLAG_COEX_MODE_LEGACY_2W 1 #define IWLAGN_BT_FLAG_COEX_MODE_LEGACY_2W 1
#define IWL6000G2B_BT_FLAG_COEX_MODE_3W 2 #define IWLAGN_BT_FLAG_COEX_MODE_3W 2
#define IWL6000G2B_BT_FLAG_COEX_MODE_4W 3 #define IWLAGN_BT_FLAG_COEX_MODE_4W 3
#define IWL6000G2B_BT_FLAG_UCODE_DEFAULT BIT(6) #define IWLAGN_BT_FLAG_UCODE_DEFAULT BIT(6)
#define IWL6000G2B_BT_FLAG_NOCOEX_NOTIF BIT(7) #define IWLAGN_BT_FLAG_NOCOEX_NOTIF BIT(7)
#define IWL6000G2B_BT_PRIO_BOOST_MAX 0xFF #define IWLAGN_BT_PRIO_BOOST_MAX 0xFF
#define IWL6000G2B_BT_PRIO_BOOST_MIN 0x00 #define IWLAGN_BT_PRIO_BOOST_MIN 0x00
#define IWL6000G2B_BT_PRIO_BOOST_DEFAULT 0xF0 #define IWLAGN_BT_PRIO_BOOST_DEFAULT 0xF0
#define IWL6000G2B_BT_MAX_KILL_DEFAULT 5 #define IWLAGN_BT_MAX_KILL_DEFAULT 5
#define IWL6000G2B_BT3_T7_DEFAULT 1 #define IWLAGN_BT3_T7_DEFAULT 1
#define IWL6000G2B_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffffffff) #define IWLAGN_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffffffff)
#define IWL6000G2B_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffffffff) #define IWLAGN_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffffffff)
#define IWL6000G2B_BT3_PRIO_SAMPLE_DEFAULT 2 #define IWLAGN_BT3_PRIO_SAMPLE_DEFAULT 2
#define IWL6000G2B_BT3_T2_DEFAULT 0xc #define IWLAGN_BT3_T2_DEFAULT 0xc
#define IWL6000G2B_BT_VALID_ENABLE_FLAGS cpu_to_le16(BIT(0)) #define IWLAGN_BT_VALID_ENABLE_FLAGS cpu_to_le16(BIT(0))
#define IWL6000G2B_BT_VALID_BOOST cpu_to_le16(BIT(1)) #define IWLAGN_BT_VALID_BOOST cpu_to_le16(BIT(1))
#define IWL6000G2B_BT_VALID_MAX_KILL cpu_to_le16(BIT(2)) #define IWLAGN_BT_VALID_MAX_KILL cpu_to_le16(BIT(2))
#define IWL6000G2B_BT_VALID_3W_TIMERS cpu_to_le16(BIT(3)) #define IWLAGN_BT_VALID_3W_TIMERS cpu_to_le16(BIT(3))
#define IWL6000G2B_BT_VALID_KILL_ACK_MASK cpu_to_le16(BIT(4)) #define IWLAGN_BT_VALID_KILL_ACK_MASK cpu_to_le16(BIT(4))
#define IWL6000G2B_BT_VALID_KILL_CTS_MASK cpu_to_le16(BIT(5)) #define IWLAGN_BT_VALID_KILL_CTS_MASK cpu_to_le16(BIT(5))
#define IWL6000G2B_BT_VALID_BT4_TIMES cpu_to_le16(BIT(6)) #define IWLAGN_BT_VALID_BT4_TIMES cpu_to_le16(BIT(6))
#define IWL6000G2B_BT_VALID_3W_LUT cpu_to_le16(BIT(7)) #define IWLAGN_BT_VALID_3W_LUT cpu_to_le16(BIT(7))
#define IWL6000G2B_BT_ALL_VALID_MSK (IWL6000G2B_BT_VALID_ENABLE_FLAGS | \ #define IWLAGN_BT_ALL_VALID_MSK (IWLAGN_BT_VALID_ENABLE_FLAGS | \
IWL6000G2B_BT_VALID_BOOST | \ IWLAGN_BT_VALID_BOOST | \
IWL6000G2B_BT_VALID_MAX_KILL | \ IWLAGN_BT_VALID_MAX_KILL | \
IWL6000G2B_BT_VALID_3W_TIMERS | \ IWLAGN_BT_VALID_3W_TIMERS | \
IWL6000G2B_BT_VALID_KILL_ACK_MASK | \ IWLAGN_BT_VALID_KILL_ACK_MASK | \
IWL6000G2B_BT_VALID_KILL_CTS_MASK | \ IWLAGN_BT_VALID_KILL_CTS_MASK | \
IWL6000G2B_BT_VALID_BT4_TIMES | \ IWLAGN_BT_VALID_BT4_TIMES | \
IWL6000G2B_BT_VALID_3W_LUT) IWLAGN_BT_VALID_3W_LUT)
struct iwl6000g2b_bt_cmd { struct iwlagn_bt_cmd {
u8 flags; u8 flags;
u8 ledtime; /* unused */ u8 ledtime; /* unused */
u8 max_kill; u8 max_kill;
...@@ -2473,9 +2473,9 @@ struct iwl6000g2b_bt_cmd { ...@@ -2473,9 +2473,9 @@ struct iwl6000g2b_bt_cmd {
u8 reserved[3]; u8 reserved[3];
}; };
#define IWL6000G2B_BT_SCO_ACTIVE cpu_to_le32(BIT(0)) #define IWLAGN_BT_SCO_ACTIVE cpu_to_le32(BIT(0))
struct iwl6000g2b_bt_sco_cmd { struct iwlagn_bt_sco_cmd {
__le32 flags; __le32 flags;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment