xref: /openbmc/linux/drivers/nfc/mei_phy.h (revision 762f99f4f3cb41a775b5157dd761217beba65873)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
24912e2feSEric Lapuyade #ifndef __LOCAL_MEI_PHY_H_
34912e2feSEric Lapuyade #define __LOCAL_MEI_PHY_H_
44912e2feSEric Lapuyade 
54912e2feSEric Lapuyade #include <linux/mei_cl_bus.h>
64912e2feSEric Lapuyade #include <net/nfc/hci.h>
7c93b76b3STomas Winkler #include <linux/uuid.h>
84912e2feSEric Lapuyade 
9b144ce2dSGreg Kroah-Hartman #define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
10c93b76b3STomas Winkler 		0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
114912e2feSEric Lapuyade #define MEI_NFC_HEADER_SIZE 10
124912e2feSEric Lapuyade #define MEI_NFC_MAX_HCI_PAYLOAD 300
134912e2feSEric Lapuyade 
14be9b720aSTomas Winkler /**
15be9b720aSTomas Winkler  * struct nfc_mei_phy
16be9b720aSTomas Winkler  *
1789391382STomas Winkler  * @cldev: mei client device
18be9b720aSTomas Winkler  * @hdev:   nfc hci device
19be9b720aSTomas Winkler 
20be9b720aSTomas Winkler  * @send_wq: send completion wait queue
21be9b720aSTomas Winkler  * @fw_ivn: NFC Interface Version Number
22be9b720aSTomas Winkler  * @vendor_id: NFC manufacturer ID
23be9b720aSTomas Winkler  * @radio_type: NFC radio type
24be9b720aSTomas Winkler  * @reserved: reserved for alignment
25be9b720aSTomas Winkler  * @req_id:  message counter
26be9b720aSTomas Winkler  * @recv_req_id: reception message counter
27be9b720aSTomas Winkler  * @powered: the device is in powered state
28be9b720aSTomas Winkler  * @hard_fault: < 0 if hardware error occurred
29be9b720aSTomas Winkler  *    and prevents normal operation.
30be9b720aSTomas Winkler  */
314912e2feSEric Lapuyade struct nfc_mei_phy {
3289391382STomas Winkler 	struct mei_cl_device *cldev;
334912e2feSEric Lapuyade 	struct nfc_hci_dev *hdev;
344912e2feSEric Lapuyade 
35be9b720aSTomas Winkler 	wait_queue_head_t send_wq;
36be9b720aSTomas Winkler 	u8 fw_ivn;
37be9b720aSTomas Winkler 	u8 vendor_id;
38be9b720aSTomas Winkler 	u8 radio_type;
39be9b720aSTomas Winkler 	u8 reserved;
404912e2feSEric Lapuyade 
41be9b720aSTomas Winkler 	u16 req_id;
42be9b720aSTomas Winkler 	u16 recv_req_id;
43be9b720aSTomas Winkler 
44be9b720aSTomas Winkler 	int powered;
45be9b720aSTomas Winkler 	int hard_fault;
464912e2feSEric Lapuyade };
474912e2feSEric Lapuyade 
48*7a5e98daSKrzysztof Kozlowski extern const struct nfc_phy_ops mei_phy_ops;
494912e2feSEric Lapuyade 
504912e2feSEric Lapuyade struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device);
514912e2feSEric Lapuyade void nfc_mei_phy_free(struct nfc_mei_phy *phy);
524912e2feSEric Lapuyade 
534912e2feSEric Lapuyade #endif /* __LOCAL_MEI_PHY_H_ */
54