iwlwifi: add new TLV capability flag for BT PLCR
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 12 Feb 2015 10:33:09 +0000 (12:33 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 2 Mar 2015 06:20:26 +0000 (08:20 +0200)
Packet Level Co-Running is a BT Coex feature which is
supported on certain devices only, hence the need for
a TLV flag for it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-fw-file.h
drivers/net/wireless/iwlwifi/mvm/coex.c
drivers/net/wireless/iwlwifi/mvm/coex_legacy.c
drivers/net/wireless/iwlwifi/mvm/mvm.h

index 3ec32e8a3cc48c254283408195698020383f4ff3..59706821830f7fe7e97c3d2367094f6995c5051f 100644 (file)
@@ -289,6 +289,7 @@ enum iwl_ucode_tlv_api {
  * @IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH: supports TDLS channel switching
  * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command
  * @IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS: support radio and beacon statistics
+ * @IWL_UCODE_TLV_CAPA_BT_COEX_PLCR: enabled BT Coex packet level co-running
  */
 enum iwl_ucode_tlv_capa {
        IWL_UCODE_TLV_CAPA_D0I3_SUPPORT                 = BIT(0),
@@ -304,6 +305,7 @@ enum iwl_ucode_tlv_capa {
        IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH          = BIT(13),
        IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT              = BIT(18),
        IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS           = BIT(22),
+       IWL_UCODE_TLV_CAPA_BT_COEX_PLCR                 = BIT(28),
 };
 
 /* The default calibrate table size if not specified by firmware file */
index 1ec4d55155f7d72fecdbe19db62dd36546bb05e0..ce99572a982d66382e012f47792f7624c4b9ae26 100644 (file)
@@ -611,7 +611,7 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm)
                bt_cmd->enabled_modules |=
                        cpu_to_le32(BT_COEX_SYNC2SCO_ENABLED);
 
-       if (IWL_MVM_BT_COEX_CORUNNING)
+       if (iwl_mvm_bt_is_plcr_supported(mvm))
                bt_cmd->enabled_modules |= cpu_to_le32(BT_COEX_CORUN_ENABLED);
 
        if (IWL_MVM_BT_COEX_MPLUT) {
@@ -1234,7 +1234,7 @@ int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm,
        if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BT_COEX_SPLIT))
                return iwl_mvm_rx_ant_coupling_notif_old(mvm, rxb, dev_cmd);
 
-       if (!IWL_MVM_BT_COEX_CORUNNING)
+       if (!iwl_mvm_bt_is_plcr_supported(mvm))
                return 0;
 
        lockdep_assert_held(&mvm->mutex);
index adfd1eceb6bbdb20617229474f7e6bb06cdc9bb5..9717ee61928cccdf78eefaee7c1a6f91ac736243 100644 (file)
@@ -619,7 +619,7 @@ int iwl_send_bt_init_conf_old(struct iwl_mvm *mvm)
        if (IWL_MVM_BT_COEX_SYNC2SCO)
                bt_cmd->flags |= cpu_to_le32(BT_COEX_SYNC2SCO);
 
-       if (IWL_MVM_BT_COEX_CORUNNING) {
+       if (iwl_mvm_bt_is_plcr_supported(mvm)) {
                bt_cmd->valid_bit_msk |= cpu_to_le32(BT_VALID_CORUN_LUT_20 |
                                                     BT_VALID_CORUN_LUT_40);
                bt_cmd->flags |= cpu_to_le32(BT_COEX_CORUNNING);
@@ -1207,7 +1207,7 @@ int iwl_mvm_rx_ant_coupling_notif_old(struct iwl_mvm *mvm,
                .dataflags = { IWL_HCMD_DFL_NOCOPY, },
        };
 
-       if (!IWL_MVM_BT_COEX_CORUNNING)
+       if (!iwl_mvm_bt_is_plcr_supported(mvm))
                return 0;
 
        lockdep_assert_held(&mvm->mutex);
index 5e383dbf25943204a7839d7e13cec6ef5eac25bd..f78a006df0e91d7ae40eec281b36760aff3ab2b4 100644 (file)
@@ -898,6 +898,12 @@ static inline bool iwl_mvm_is_scd_cfg_supported(struct iwl_mvm *mvm)
        return mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_SCD_CFG;
 }
 
+static inline bool iwl_mvm_bt_is_plcr_supported(struct iwl_mvm *mvm)
+{
+       return (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BT_COEX_PLCR) &&
+               IWL_MVM_BT_COEX_CORUNNING;
+}
+
 extern const u8 iwl_mvm_ac_to_tx_fifo[];
 
 struct iwl_rate_info {