1
2
3
4
5
6
7
8 #ifndef __LOCAL_ST_NCI_H_
9 #define __LOCAL_ST_NCI_H_
10
11 #include "ndlc.h"
12
13
14 #define ST_NCI_RUNNING 1
15
16 #define ST_NCI_CORE_PROP 0x01
17 #define ST_NCI_SET_NFC_MODE 0x02
18
19
20
21
22
23 #define ST_NCI_ESE_MAX_LENGTH 33
24
25 #define ST_NCI_DEVICE_MGNT_GATE 0x01
26
27 #define ST_NCI_VENDOR_OUI 0x0080E1
28 #define ST_NCI_FACTORY_MODE 2
29
30 struct nci_mode_set_cmd {
31 u8 cmd_type;
32 u8 mode;
33 } __packed;
34
35 struct nci_mode_set_rsp {
36 u8 status;
37 } __packed;
38
39 struct st_nci_se_status {
40 bool is_ese_present;
41 bool is_uicc_present;
42 };
43
44 struct st_nci_se_info {
45 struct st_nci_se_status *se_status;
46 u8 atr[ST_NCI_ESE_MAX_LENGTH];
47 struct completion req_completion;
48
49 struct timer_list bwi_timer;
50 int wt_timeout;
51 bool bwi_active;
52
53 struct timer_list se_active_timer;
54 bool se_active;
55
56 bool xch_error;
57
58 se_io_cb_t cb;
59 void *cb_context;
60 };
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 enum nfc_vendor_cmds {
96 FACTORY_MODE,
97 HCI_CLEAR_ALL_PIPES,
98 HCI_DM_PUT_DATA,
99 HCI_DM_UPDATE_AID,
100 HCI_DM_GET_INFO,
101 HCI_DM_GET_DATA,
102 HCI_DM_DIRECT_LOAD,
103 HCI_DM_RESET,
104 HCI_GET_PARAM,
105 HCI_DM_FIELD_GENERATOR,
106 LOOPBACK,
107 HCI_DM_FWUPD_START,
108 HCI_DM_FWUPD_END,
109 HCI_DM_VDC_MEASUREMENT_VALUE,
110 HCI_DM_VDC_VALUE_COMPARISON,
111 MANUFACTURER_SPECIFIC,
112 };
113
114 struct st_nci_info {
115 struct llt_ndlc *ndlc;
116 unsigned long flags;
117
118 struct st_nci_se_info se_info;
119 };
120
121 void st_nci_remove(struct nci_dev *ndev);
122 int st_nci_probe(struct llt_ndlc *ndlc, int phy_headroom,
123 int phy_tailroom, struct st_nci_se_status *se_status);
124
125 int st_nci_se_init(struct nci_dev *ndev, struct st_nci_se_status *se_status);
126 void st_nci_se_deinit(struct nci_dev *ndev);
127
128 int st_nci_discover_se(struct nci_dev *ndev);
129 int st_nci_enable_se(struct nci_dev *ndev, u32 se_idx);
130 int st_nci_disable_se(struct nci_dev *ndev, u32 se_idx);
131 int st_nci_se_io(struct nci_dev *ndev, u32 se_idx,
132 u8 *apdu, size_t apdu_length,
133 se_io_cb_t cb, void *cb_context);
134 int st_nci_hci_load_session(struct nci_dev *ndev);
135 void st_nci_hci_event_received(struct nci_dev *ndev, u8 pipe,
136 u8 event, struct sk_buff *skb);
137 void st_nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe, u8 cmd,
138 struct sk_buff *skb);
139
140 int st_nci_vendor_cmds_init(struct nci_dev *ndev);
141
142 #endif