2019-05-27 13:55:05 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2015-04-06 14:52:11 +07:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Bluetooth support for Intel devices
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
2015-04-06 14:52:13 +07:00
|
|
|
struct intel_version {
|
|
|
|
u8 status;
|
|
|
|
u8 hw_platform;
|
|
|
|
u8 hw_variant;
|
|
|
|
u8 hw_revision;
|
|
|
|
u8 fw_variant;
|
|
|
|
u8 fw_revision;
|
|
|
|
u8 fw_build_num;
|
|
|
|
u8 fw_build_ww;
|
|
|
|
u8 fw_build_yy;
|
|
|
|
u8 fw_patch_num;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct intel_boot_params {
|
|
|
|
__u8 status;
|
|
|
|
__u8 otp_format;
|
|
|
|
__u8 otp_content;
|
|
|
|
__u8 otp_patch;
|
|
|
|
__le16 dev_revid;
|
|
|
|
__u8 secure_boot;
|
|
|
|
__u8 key_from_hdr;
|
|
|
|
__u8 key_type;
|
|
|
|
__u8 otp_lock;
|
|
|
|
__u8 api_lock;
|
|
|
|
__u8 debug_lock;
|
|
|
|
bdaddr_t otp_bdaddr;
|
|
|
|
__u8 min_fw_build_nn;
|
|
|
|
__u8 min_fw_build_cw;
|
|
|
|
__u8 min_fw_build_yy;
|
|
|
|
__u8 limited_cce;
|
|
|
|
__u8 unlocked_state;
|
|
|
|
} __packed;
|
|
|
|
|
2015-04-09 14:35:19 +07:00
|
|
|
struct intel_bootup {
|
|
|
|
__u8 zero;
|
|
|
|
__u8 num_cmds;
|
|
|
|
__u8 source;
|
|
|
|
__u8 reset_type;
|
|
|
|
__u8 reset_reason;
|
|
|
|
__u8 ddc_status;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct intel_secure_send_result {
|
|
|
|
__u8 result;
|
|
|
|
__le16 opcode;
|
|
|
|
__u8 status;
|
|
|
|
} __packed;
|
|
|
|
|
2018-01-25 00:19:18 +07:00
|
|
|
struct intel_reset {
|
|
|
|
__u8 reset_type;
|
|
|
|
__u8 patch_enable;
|
|
|
|
__u8 ddc_reload;
|
|
|
|
__u8 boot_option;
|
|
|
|
__le32 boot_param;
|
|
|
|
} __packed;
|
|
|
|
|
2015-04-06 14:52:11 +07:00
|
|
|
#if IS_ENABLED(CONFIG_BT_INTEL)
|
|
|
|
|
|
|
|
int btintel_check_bdaddr(struct hci_dev *hdev);
|
2015-12-03 22:10:22 +07:00
|
|
|
int btintel_enter_mfg(struct hci_dev *hdev);
|
|
|
|
int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched);
|
2015-04-06 14:52:11 +07:00
|
|
|
int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
|
2015-10-09 19:42:08 +07:00
|
|
|
int btintel_set_diag(struct hci_dev *hdev, bool enable);
|
2015-10-17 21:00:28 +07:00
|
|
|
int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable);
|
2015-07-05 19:37:38 +07:00
|
|
|
void btintel_hw_error(struct hci_dev *hdev, u8 code);
|
2015-04-06 14:52:11 +07:00
|
|
|
|
2015-07-05 20:02:07 +07:00
|
|
|
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
|
2015-07-05 19:55:36 +07:00
|
|
|
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
|
|
|
|
const void *param);
|
2015-09-04 22:54:34 +07:00
|
|
|
int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name);
|
2015-10-21 07:45:19 +07:00
|
|
|
int btintel_set_event_mask(struct hci_dev *hdev, bool debug);
|
|
|
|
int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug);
|
2015-12-06 22:18:34 +07:00
|
|
|
int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver);
|
2015-07-05 19:55:36 +07:00
|
|
|
|
2015-10-01 23:16:21 +07:00
|
|
|
struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read,
|
|
|
|
u16 opcode_write);
|
2018-01-25 00:19:18 +07:00
|
|
|
int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param);
|
2018-01-25 00:19:20 +07:00
|
|
|
int btintel_read_boot_params(struct hci_dev *hdev,
|
|
|
|
struct intel_boot_params *params);
|
2018-01-25 00:19:21 +07:00
|
|
|
int btintel_download_firmware(struct hci_dev *dev, const struct firmware *fw,
|
|
|
|
u32 *boot_param);
|
2015-04-06 14:52:11 +07:00
|
|
|
#else
|
|
|
|
|
|
|
|
static inline int btintel_check_bdaddr(struct hci_dev *hdev)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-12-03 22:10:22 +07:00
|
|
|
static inline int btintel_enter_mfg(struct hci_dev *hdev)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-04-06 14:52:11 +07:00
|
|
|
static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-10-09 19:42:08 +07:00
|
|
|
static inline int btintel_set_diag(struct hci_dev *hdev, bool enable)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-10-17 21:00:28 +07:00
|
|
|
static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-07-05 19:37:38 +07:00
|
|
|
static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-09-04 04:08:45 +07:00
|
|
|
static inline void btintel_version_info(struct hci_dev *hdev,
|
|
|
|
struct intel_version *ver)
|
2015-07-05 20:02:07 +07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-07-05 19:55:36 +07:00
|
|
|
static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type,
|
|
|
|
u32 plen, const void *param)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-09-04 22:54:34 +07:00
|
|
|
static inline int btintel_load_ddc_config(struct hci_dev *hdev,
|
|
|
|
const char *ddc_name)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-10-21 07:45:19 +07:00
|
|
|
static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-12-06 22:18:34 +07:00
|
|
|
static inline int btintel_read_version(struct hci_dev *hdev,
|
|
|
|
struct intel_version *ver)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2015-10-01 23:16:21 +07:00
|
|
|
static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev,
|
|
|
|
u16 opcode_read,
|
|
|
|
u16 opcode_write)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-EINVAL);
|
|
|
|
}
|
2018-01-25 00:19:18 +07:00
|
|
|
|
|
|
|
static inline int btintel_send_intel_reset(struct hci_dev *hdev,
|
|
|
|
u32 reset_param)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2018-01-25 00:19:20 +07:00
|
|
|
|
|
|
|
static inline int btintel_read_boot_params(struct hci_dev *hdev,
|
|
|
|
struct intel_boot_params *params)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2018-01-25 00:19:21 +07:00
|
|
|
|
|
|
|
static inline int btintel_download_firmware(struct hci_dev *dev,
|
|
|
|
const struct firmware *fw,
|
|
|
|
u32 *boot_param)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2015-04-06 14:52:11 +07:00
|
|
|
#endif
|