diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-10-29 14:52:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-29 14:52:37 -0400 |
commit | e298c79efcf7b88fded994a03375589d8b726ce7 (patch) | |
tree | ca430a7220b7ee30c1a0aa09b5e2c1511c9d0e4c /include | |
parent | d1f10302568221c20628200bc8baa426c55f61c0 (diff) | |
parent | 52feb444a90304eb13c03115bb9758101dbb9254 (diff) |
Merge tag 'nfc-next-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0
This is the first NFC pull request for 3.8
With this one we have:
- pn544 p2p support.
- pn544 physical and HCI layers separation. We are getting the pn544 driver
ready to support non i2c physical layers.
- LLCP SNL (Service Name Lookup). This is the NFC p2p service discovery
protocol.
- LLCP datagram sockets (connection less) support.
- IDR library usage for NFC devices indexes assignement.
- NFC netlink extension for setting and getting LLCP link characteristics.
- Various code style fixes and cleanups spread over the pn533, LLCP, HCI and
pn544 code.
Diffstat (limited to 'include')
-rw-r--r-- | include/net/nfc/hci.h | 18 | ||||
-rw-r--r-- | include/net/nfc/nfc.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/nfc.h | 15 |
3 files changed, 33 insertions, 2 deletions
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index e900072950cb..639f50af42df 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
26 | 26 | ||
27 | struct nfc_phy_ops { | ||
28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
29 | int (*enable)(void *dev_id); | ||
30 | void (*disable)(void *dev_id); | ||
31 | }; | ||
32 | |||
27 | struct nfc_hci_dev; | 33 | struct nfc_hci_dev; |
28 | 34 | ||
29 | struct nfc_hci_ops { | 35 | struct nfc_hci_ops { |
@@ -38,15 +44,21 @@ struct nfc_hci_ops { | |||
38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 44 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
39 | int (*start_poll) (struct nfc_hci_dev *hdev, | 45 | int (*start_poll) (struct nfc_hci_dev *hdev, |
40 | u32 im_protocols, u32 tm_protocols); | 46 | u32 im_protocols, u32 tm_protocols); |
47 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | ||
48 | u8 comm_mode, u8 *gb, size_t gb_len); | ||
49 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | ||
41 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 50 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
42 | struct nfc_target *target); | 51 | struct nfc_target *target); |
43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 52 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
44 | struct nfc_target *target); | 53 | struct nfc_target *target); |
45 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 54 | int (*im_transceive) (struct nfc_hci_dev *hdev, |
46 | struct nfc_target *target, struct sk_buff *skb, | 55 | struct nfc_target *target, struct sk_buff *skb, |
47 | data_exchange_cb_t cb, void *cb_context); | 56 | data_exchange_cb_t cb, void *cb_context); |
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
48 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
49 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
61 | struct sk_buff *skb); | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | /* Pipes */ | 64 | /* Pipes */ |
@@ -114,6 +126,9 @@ struct nfc_hci_dev { | |||
114 | int async_cb_type; | 126 | int async_cb_type; |
115 | data_exchange_cb_t async_cb; | 127 | data_exchange_cb_t async_cb; |
116 | void *async_cb_context; | 128 | void *async_cb_context; |
129 | |||
130 | u8 *gb; | ||
131 | size_t gb_len; | ||
117 | }; | 132 | }; |
118 | 133 | ||
119 | /* hci device allocation */ | 134 | /* hci device allocation */ |
@@ -219,5 +234,6 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
219 | const u8 *param, size_t param_len); | 234 | const u8 *param, size_t param_len); |
220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 235 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
221 | const u8 *param, size_t param_len); | 236 | const u8 *param, size_t param_len); |
237 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | ||
222 | 238 | ||
223 | #endif /* __NET_HCI_H */ | 239 | #endif /* __NET_HCI_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f05b10682c9d..fce80b2f9be7 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -95,7 +95,7 @@ struct nfc_genl_data { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct nfc_dev { | 97 | struct nfc_dev { |
98 | unsigned int idx; | 98 | int idx; |
99 | u32 target_next_idx; | 99 | u32 target_next_idx; |
100 | struct nfc_target *targets; | 100 | struct nfc_target *targets; |
101 | int n_targets; | 101 | int n_targets; |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index d908d17da56d..0e63cee8d810 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -60,6 +60,13 @@ | |||
60 | * target mode. | 60 | * target mode. |
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated |
62 | * from target mode. | 62 | * from target mode. |
63 | * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device | ||
64 | * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for | ||
65 | * a device. LTO must be set before the link is up otherwise -EINPROGRESS | ||
66 | * is returned. RW and MIUX can be set at anytime and will be passed in | ||
67 | * subsequent CONNECT and CC messages. | ||
68 | * If one of the passed parameters is wrong none is set and -EINVAL is | ||
69 | * returned. | ||
63 | */ | 70 | */ |
64 | enum nfc_commands { | 71 | enum nfc_commands { |
65 | NFC_CMD_UNSPEC, | 72 | NFC_CMD_UNSPEC, |
@@ -77,6 +84,8 @@ enum nfc_commands { | |||
77 | NFC_EVENT_TARGET_LOST, | 84 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | 85 | NFC_EVENT_TM_ACTIVATED, |
79 | NFC_EVENT_TM_DEACTIVATED, | 86 | NFC_EVENT_TM_DEACTIVATED, |
87 | NFC_CMD_LLC_GET_PARAMS, | ||
88 | NFC_CMD_LLC_SET_PARAMS, | ||
80 | /* private: internal use only */ | 89 | /* private: internal use only */ |
81 | __NFC_CMD_AFTER_LAST | 90 | __NFC_CMD_AFTER_LAST |
82 | }; | 91 | }; |
@@ -102,6 +111,9 @@ enum nfc_commands { | |||
102 | * @NFC_ATTR_RF_MODE: Initiator or target | 111 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | 112 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for |
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | 113 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for |
114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | ||
115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | ||
116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | ||
105 | */ | 117 | */ |
106 | enum nfc_attrs { | 118 | enum nfc_attrs { |
107 | NFC_ATTR_UNSPEC, | 119 | NFC_ATTR_UNSPEC, |
@@ -119,6 +131,9 @@ enum nfc_attrs { | |||
119 | NFC_ATTR_DEVICE_POWERED, | 131 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | 132 | NFC_ATTR_IM_PROTOCOLS, |
121 | NFC_ATTR_TM_PROTOCOLS, | 133 | NFC_ATTR_TM_PROTOCOLS, |
134 | NFC_ATTR_LLC_PARAM_LTO, | ||
135 | NFC_ATTR_LLC_PARAM_RW, | ||
136 | NFC_ATTR_LLC_PARAM_MIUX, | ||
122 | /* private: internal use only */ | 137 | /* private: internal use only */ |
123 | __NFC_ATTR_AFTER_LAST | 138 | __NFC_ATTR_AFTER_LAST |
124 | }; | 139 | }; |