ocfs2: fix several issues of append dio
[linux/fpc-iii.git] / drivers / nfc / st21nfca / st21nfca_se.h
blobb172cfcaeb90d6f10780a110e96ffd591d6662f3
1 /*
2 * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #ifndef __ST21NFCA_SE_H
18 #define __ST21NFCA_SE_H
20 #include <linux/skbuff.h>
21 #include <linux/workqueue.h>
24 * ref ISO7816-3 chap 8.1. the initial character TS is followed by a
25 * sequence of at most 32 characters.
27 #define ST21NFCA_ESE_MAX_LENGTH 33
28 #define ST21NFCA_ESE_HOST_ID 0xc0
30 struct st21nfca_se_info {
31 u8 atr[ST21NFCA_ESE_MAX_LENGTH];
32 struct completion req_completion;
34 struct timer_list bwi_timer;
35 int wt_timeout; /* in msecs */
36 bool bwi_active;
38 struct timer_list se_active_timer;
39 bool se_active;
40 int expected_pipes;
41 int count_pipes;
43 bool xch_error;
45 se_io_cb_t cb;
46 void *cb_context;
49 int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
50 u8 event, struct sk_buff *skb);
51 int st21nfca_apdu_reader_event_received(struct nfc_hci_dev *hdev,
52 u8 event, struct sk_buff *skb);
54 int st21nfca_hci_discover_se(struct nfc_hci_dev *hdev);
55 int st21nfca_hci_enable_se(struct nfc_hci_dev *hdev, u32 se_idx);
56 int st21nfca_hci_disable_se(struct nfc_hci_dev *hdev, u32 se_idx);
57 int st21nfca_hci_se_io(struct nfc_hci_dev *hdev, u32 se_idx,
58 u8 *apdu, size_t apdu_length,
59 se_io_cb_t cb, void *cb_context);
61 void st21nfca_se_init(struct nfc_hci_dev *hdev);
62 void st21nfca_se_deinit(struct nfc_hci_dev *hdev);
63 #endif /* __ST21NFCA_SE_H */