2 * NCI based Driver for STMicroelectronics NFC Chip
4 * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef __LOCAL_ST21NFCB_SE_H_
19 #define __LOCAL_ST21NFCB_SE_H_
22 * ref ISO7816-3 chap 8.1. the initial character TS is followed by a
23 * sequence of at most 32 characters.
25 #define ST21NFCB_ESE_MAX_LENGTH 33
26 #define ST21NFCB_HCI_HOST_ID_ESE 0xc0
28 struct st21nfcb_se_info
{
29 u8 atr
[ST21NFCB_ESE_MAX_LENGTH
];
30 struct completion req_completion
;
32 struct timer_list bwi_timer
;
33 int wt_timeout
; /* in msecs */
36 struct timer_list se_active_timer
;
45 int st21nfcb_se_init(struct nci_dev
*ndev
);
46 void st21nfcb_se_deinit(struct nci_dev
*ndev
);
48 int st21nfcb_nci_discover_se(struct nci_dev
*ndev
);
49 int st21nfcb_nci_enable_se(struct nci_dev
*ndev
, u32 se_idx
);
50 int st21nfcb_nci_disable_se(struct nci_dev
*ndev
, u32 se_idx
);
51 int st21nfcb_nci_se_io(struct nci_dev
*ndev
, u32 se_idx
,
52 u8
*apdu
, size_t apdu_length
,
53 se_io_cb_t cb
, void *cb_context
);
54 int st21nfcb_hci_load_session(struct nci_dev
*ndev
);
55 void st21nfcb_hci_event_received(struct nci_dev
*ndev
, u8 pipe
,
56 u8 event
, struct sk_buff
*skb
);
57 void st21nfcb_hci_cmd_received(struct nci_dev
*ndev
, u8 pipe
, u8 cmd
,
61 #endif /* __LOCAL_ST21NFCB_NCI_H_ */