Marcel Holtmann | 48f0ed1 | 2015-04-06 00:52:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Bluetooth support for Intel devices |
| 4 | * |
| 5 | * Copyright (C) 2015 Intel Corporation |
| 6 | * |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | */ |
| 23 | |
Marcel Holtmann | 59a077c | 2015-04-06 00:52:13 -0700 | [diff] [blame] | 24 | struct intel_version { |
| 25 | u8 status; |
| 26 | u8 hw_platform; |
| 27 | u8 hw_variant; |
| 28 | u8 hw_revision; |
| 29 | u8 fw_variant; |
| 30 | u8 fw_revision; |
| 31 | u8 fw_build_num; |
| 32 | u8 fw_build_ww; |
| 33 | u8 fw_build_yy; |
| 34 | u8 fw_patch_num; |
| 35 | } __packed; |
| 36 | |
| 37 | struct intel_boot_params { |
| 38 | __u8 status; |
| 39 | __u8 otp_format; |
| 40 | __u8 otp_content; |
| 41 | __u8 otp_patch; |
| 42 | __le16 dev_revid; |
| 43 | __u8 secure_boot; |
| 44 | __u8 key_from_hdr; |
| 45 | __u8 key_type; |
| 46 | __u8 otp_lock; |
| 47 | __u8 api_lock; |
| 48 | __u8 debug_lock; |
| 49 | bdaddr_t otp_bdaddr; |
| 50 | __u8 min_fw_build_nn; |
| 51 | __u8 min_fw_build_cw; |
| 52 | __u8 min_fw_build_yy; |
| 53 | __u8 limited_cce; |
| 54 | __u8 unlocked_state; |
| 55 | } __packed; |
| 56 | |
Marcel Holtmann | ccd6da2 | 2015-04-09 00:35:19 -0700 | [diff] [blame] | 57 | struct intel_bootup { |
| 58 | __u8 zero; |
| 59 | __u8 num_cmds; |
| 60 | __u8 source; |
| 61 | __u8 reset_type; |
| 62 | __u8 reset_reason; |
| 63 | __u8 ddc_status; |
| 64 | } __packed; |
| 65 | |
| 66 | struct intel_secure_send_result { |
| 67 | __u8 result; |
| 68 | __le16 opcode; |
| 69 | __u8 status; |
| 70 | } __packed; |
| 71 | |
Marcel Holtmann | 48f0ed1 | 2015-04-06 00:52:11 -0700 | [diff] [blame] | 72 | #if IS_ENABLED(CONFIG_BT_INTEL) |
| 73 | |
| 74 | int btintel_check_bdaddr(struct hci_dev *hdev); |
| 75 | int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); |
Marcel Holtmann | 6d2e50d | 2015-10-09 14:42:08 +0200 | [diff] [blame] | 76 | int btintel_set_diag(struct hci_dev *hdev, bool enable); |
Marcel Holtmann | 3e24767 | 2015-10-17 16:00:28 +0200 | [diff] [blame] | 77 | int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable); |
Marcel Holtmann | 973bb97 | 2015-07-05 14:37:38 +0200 | [diff] [blame] | 78 | void btintel_hw_error(struct hci_dev *hdev, u8 code); |
Marcel Holtmann | 48f0ed1 | 2015-04-06 00:52:11 -0700 | [diff] [blame] | 79 | |
Marcel Holtmann | 7feb99e | 2015-07-05 15:02:07 +0200 | [diff] [blame] | 80 | void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver); |
Marcel Holtmann | 09df123 | 2015-07-05 14:55:36 +0200 | [diff] [blame] | 81 | int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen, |
| 82 | const void *param); |
Loic Poulain | 145f236 | 2015-09-04 17:54:34 +0200 | [diff] [blame] | 83 | int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name); |
Marcel Holtmann | 213445b | 2015-10-21 02:45:19 +0200 | [diff] [blame] | 84 | int btintel_set_event_mask(struct hci_dev *hdev, bool debug); |
| 85 | int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug); |
Marcel Holtmann | 09df123 | 2015-07-05 14:55:36 +0200 | [diff] [blame] | 86 | |
Loic Poulain | d06f107 | 2015-10-01 18:16:21 +0200 | [diff] [blame] | 87 | struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, |
| 88 | u16 opcode_write); |
| 89 | |
Marcel Holtmann | 48f0ed1 | 2015-04-06 00:52:11 -0700 | [diff] [blame] | 90 | #else |
| 91 | |
| 92 | static inline int btintel_check_bdaddr(struct hci_dev *hdev) |
| 93 | { |
| 94 | return -EOPNOTSUPP; |
| 95 | } |
| 96 | |
| 97 | static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) |
| 98 | { |
| 99 | return -EOPNOTSUPP; |
| 100 | } |
| 101 | |
Marcel Holtmann | 6d2e50d | 2015-10-09 14:42:08 +0200 | [diff] [blame] | 102 | static inline int btintel_set_diag(struct hci_dev *hdev, bool enable) |
| 103 | { |
| 104 | return -EOPNOTSUPP; |
| 105 | } |
| 106 | |
Marcel Holtmann | 3e24767 | 2015-10-17 16:00:28 +0200 | [diff] [blame] | 107 | static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable) |
| 108 | { |
| 109 | return -EOPNOTSUPP; |
| 110 | } |
| 111 | |
Marcel Holtmann | 973bb97 | 2015-07-05 14:37:38 +0200 | [diff] [blame] | 112 | static inline void btintel_hw_error(struct hci_dev *hdev, u8 code) |
| 113 | { |
| 114 | } |
| 115 | |
Vincent Stehlé | 0eee53c | 2015-09-03 23:08:45 +0200 | [diff] [blame] | 116 | static inline void btintel_version_info(struct hci_dev *hdev, |
| 117 | struct intel_version *ver) |
Marcel Holtmann | 7feb99e | 2015-07-05 15:02:07 +0200 | [diff] [blame] | 118 | { |
| 119 | } |
| 120 | |
Marcel Holtmann | 09df123 | 2015-07-05 14:55:36 +0200 | [diff] [blame] | 121 | static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, |
| 122 | u32 plen, const void *param) |
| 123 | { |
| 124 | return -EOPNOTSUPP; |
| 125 | } |
| 126 | |
Loic Poulain | 145f236 | 2015-09-04 17:54:34 +0200 | [diff] [blame] | 127 | static inline int btintel_load_ddc_config(struct hci_dev *hdev, |
| 128 | const char *ddc_name) |
| 129 | { |
| 130 | return -EOPNOTSUPP; |
| 131 | } |
| 132 | |
Marcel Holtmann | 213445b | 2015-10-21 02:45:19 +0200 | [diff] [blame] | 133 | static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug) |
| 134 | { |
| 135 | return -EOPNOTSUPP; |
| 136 | } |
| 137 | |
| 138 | static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug) |
| 139 | { |
| 140 | return -EOPNOTSUPP; |
| 141 | } |
| 142 | |
Loic Poulain | d06f107 | 2015-10-01 18:16:21 +0200 | [diff] [blame] | 143 | static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev, |
| 144 | u16 opcode_read, |
| 145 | u16 opcode_write) |
| 146 | { |
| 147 | return ERR_PTR(-EINVAL); |
| 148 | } |
Marcel Holtmann | 48f0ed1 | 2015-04-06 00:52:11 -0700 | [diff] [blame] | 149 | #endif |