Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __LOCAL_MEI_PHY_H_
0003 #define __LOCAL_MEI_PHY_H_
0004 
0005 #include <linux/mei_cl_bus.h>
0006 #include <net/nfc/hci.h>
0007 #include <linux/uuid.h>
0008 
0009 #define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
0010         0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
0011 #define MEI_NFC_HEADER_SIZE 10
0012 #define MEI_NFC_MAX_HCI_PAYLOAD 300
0013 
0014 /**
0015  * struct nfc_mei_phy
0016  *
0017  * @cldev: mei client device
0018  * @hdev:   nfc hci device
0019 
0020  * @send_wq: send completion wait queue
0021  * @fw_ivn: NFC Interface Version Number
0022  * @vendor_id: NFC manufacturer ID
0023  * @radio_type: NFC radio type
0024  * @reserved: reserved for alignment
0025  * @req_id:  message counter
0026  * @recv_req_id: reception message counter
0027  * @powered: the device is in powered state
0028  * @hard_fault: < 0 if hardware error occurred
0029  *    and prevents normal operation.
0030  */
0031 struct nfc_mei_phy {
0032     struct mei_cl_device *cldev;
0033     struct nfc_hci_dev *hdev;
0034 
0035     wait_queue_head_t send_wq;
0036     u8 fw_ivn;
0037     u8 vendor_id;
0038     u8 radio_type;
0039     u8 reserved;
0040 
0041     u16 req_id;
0042     u16 recv_req_id;
0043 
0044     int powered;
0045     int hard_fault;
0046 };
0047 
0048 extern const struct nfc_phy_ops mei_phy_ops;
0049 
0050 struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device);
0051 void nfc_mei_phy_free(struct nfc_mei_phy *phy);
0052 
0053 #endif /* __LOCAL_MEI_PHY_H_ */