xref: /kernel/linux/linux-5.10/drivers/nfc/mei_phy.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __LOCAL_MEI_PHY_H_
38c2ecf20Sopenharmony_ci#define __LOCAL_MEI_PHY_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/mei_cl_bus.h>
68c2ecf20Sopenharmony_ci#include <net/nfc/hci.h>
78c2ecf20Sopenharmony_ci#include <linux/uuid.h>
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
108c2ecf20Sopenharmony_ci		0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
118c2ecf20Sopenharmony_ci#define MEI_NFC_HEADER_SIZE 10
128c2ecf20Sopenharmony_ci#define MEI_NFC_MAX_HCI_PAYLOAD 300
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/**
158c2ecf20Sopenharmony_ci * struct nfc_mei_phy
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * @cldev: mei client device
188c2ecf20Sopenharmony_ci * @hdev:   nfc hci device
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci * @send_wq: send completion wait queue
218c2ecf20Sopenharmony_ci * @fw_ivn: NFC Interface Version Number
228c2ecf20Sopenharmony_ci * @vendor_id: NFC manufacturer ID
238c2ecf20Sopenharmony_ci * @radio_type: NFC radio type
248c2ecf20Sopenharmony_ci * @reserved: reserved for alignment
258c2ecf20Sopenharmony_ci * @req_id:  message counter
268c2ecf20Sopenharmony_ci * @recv_req_id: reception message counter
278c2ecf20Sopenharmony_ci * @powered: the device is in powered state
288c2ecf20Sopenharmony_ci * @hard_fault: < 0 if hardware error occurred
298c2ecf20Sopenharmony_ci *    and prevents normal operation.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_cistruct nfc_mei_phy {
328c2ecf20Sopenharmony_ci	struct mei_cl_device *cldev;
338c2ecf20Sopenharmony_ci	struct nfc_hci_dev *hdev;
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	wait_queue_head_t send_wq;
368c2ecf20Sopenharmony_ci	u8 fw_ivn;
378c2ecf20Sopenharmony_ci	u8 vendor_id;
388c2ecf20Sopenharmony_ci	u8 radio_type;
398c2ecf20Sopenharmony_ci	u8 reserved;
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci	u16 req_id;
428c2ecf20Sopenharmony_ci	u16 recv_req_id;
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci	int powered;
458c2ecf20Sopenharmony_ci	int hard_fault;
468c2ecf20Sopenharmony_ci};
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciextern struct nfc_phy_ops mei_phy_ops;
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_cistruct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device);
518c2ecf20Sopenharmony_civoid nfc_mei_phy_free(struct nfc_mei_phy *phy);
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#endif /* __LOCAL_MEI_PHY_H_ */
54