Commit | Line | Data |
---|---|---|
f26e30cc AK |
1 | /** |
2 | * Marvell NFC driver | |
3 | * | |
4 | * Copyright (C) 2014, Marvell International Ltd. | |
5 | * | |
6 | * This software file (the "File") is distributed by Marvell International | |
7 | * Ltd. under the terms of the GNU General Public License Version 2, June 1991 | |
8 | * (the "License"). You may use, redistribute and/or modify this File in | |
9 | * accordance with the terms and conditions of the License, a copy of which | |
10 | * is available on the worldwide web at | |
11 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | |
12 | * | |
13 | * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE | |
14 | * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE | |
15 | * ARE EXPRESSLY DISCLAIMED. The License provides additional details about | |
16 | * this warranty disclaimer. | |
17 | **/ | |
18 | ||
19 | /* Define private flags: */ | |
20 | #define NFCMRVL_NCI_RUNNING 1 | |
21 | ||
15203b4c AK |
22 | #define NFCMRVL_EXT_COEX_ID 0xE0 |
23 | #define NFCMRVL_NOT_ALLOWED_ID 0xE1 | |
24 | #define NFCMRVL_ACTIVE_ID 0xE2 | |
25 | #define NFCMRVL_EXT_COEX_ENABLE 1 | |
26 | #define NFCMRVL_GPIO_PIN_NFC_NOT_ALLOWED 0xA | |
27 | #define NFCMRVL_GPIO_PIN_NFC_ACTIVE 0xB | |
f26e30cc AK |
28 | #define NFCMRVL_NCI_MAX_EVENT_SIZE 260 |
29 | ||
f1f1a7da VC |
30 | /* |
31 | ** HCI defines | |
32 | */ | |
33 | ||
34 | #define NFCMRVL_HCI_EVENT_HEADER_SIZE 0x04 | |
35 | #define NFCMRVL_HCI_EVENT_CODE 0x04 | |
36 | #define NFCMRVL_HCI_NFC_EVENT_CODE 0xFF | |
37 | #define NFCMRVL_HCI_COMMAND_CODE 0x01 | |
38 | #define NFCMRVL_HCI_OGF 0x81 | |
39 | #define NFCMRVL_HCI_OCF 0xFE | |
40 | ||
41 | #define NFCMRVL_DEV_FLAG_HCI_MUXED (1 << 0) | |
42 | ||
f26e30cc | 43 | struct nfcmrvl_private { |
f1f1a7da VC |
44 | |
45 | /* Tell if NCI packets are encapsulated in HCI ones */ | |
46 | int hci_muxed; | |
f26e30cc AK |
47 | struct nci_dev *ndev; |
48 | unsigned long flags; | |
49 | void *drv_data; | |
50 | struct device *dev; | |
51 | struct nfcmrvl_if_ops *if_ops; | |
52 | }; | |
53 | ||
54 | struct nfcmrvl_if_ops { | |
55 | int (*nci_open) (struct nfcmrvl_private *priv); | |
56 | int (*nci_close) (struct nfcmrvl_private *priv); | |
57 | int (*nci_send) (struct nfcmrvl_private *priv, struct sk_buff *skb); | |
58 | }; | |
59 | ||
60 | void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv); | |
61 | int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, void *data, int count); | |
62 | struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data, | |
63 | struct nfcmrvl_if_ops *ops, | |
f1f1a7da VC |
64 | struct device *dev, |
65 | unsigned int flags); |