diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-06-06 07:16:41 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-06-08 18:34:21 -0400 |
commit | 759afb8d288ffbe9a1cdb20af037b5c072dc38b2 (patch) | |
tree | dbe0ef72823dab2803d8968068f7757160d734a4 /net/nfc | |
parent | c39daeee50eb0b95d3b91bda21b77955a459ee5f (diff) |
NFC: nci: Add nci_prop_cmd allowing to send proprietary nci cmd
Handle allowing to send proprietary nci commands anywhere in the nci
state machine.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/nci/core.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 458e58bb9cb1..b5dc15044466 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -324,6 +324,32 @@ static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt) | |||
324 | sizeof(struct nci_rf_deactivate_cmd), &cmd); | 324 | sizeof(struct nci_rf_deactivate_cmd), &cmd); |
325 | } | 325 | } |
326 | 326 | ||
327 | struct nci_prop_cmd_param { | ||
328 | __u16 opcode; | ||
329 | size_t len; | ||
330 | __u8 *payload; | ||
331 | }; | ||
332 | |||
333 | static void nci_prop_cmd_req(struct nci_dev *ndev, unsigned long opt) | ||
334 | { | ||
335 | struct nci_prop_cmd_param *param = (struct nci_prop_cmd_param *)opt; | ||
336 | |||
337 | nci_send_cmd(ndev, param->opcode, param->len, param->payload); | ||
338 | } | ||
339 | |||
340 | int nci_prop_cmd(struct nci_dev *ndev, __u8 oid, size_t len, __u8 *payload) | ||
341 | { | ||
342 | struct nci_prop_cmd_param param; | ||
343 | |||
344 | param.opcode = nci_opcode_pack(NCI_GID_PROPRIETARY, oid); | ||
345 | param.len = len; | ||
346 | param.payload = payload; | ||
347 | |||
348 | return __nci_request(ndev, nci_prop_cmd_req, (unsigned long)¶m, | ||
349 | msecs_to_jiffies(NCI_CMD_TIMEOUT)); | ||
350 | } | ||
351 | EXPORT_SYMBOL(nci_prop_cmd); | ||
352 | |||
327 | static int nci_open_device(struct nci_dev *ndev) | 353 | static int nci_open_device(struct nci_dev *ndev) |
328 | { | 354 | { |
329 | int rc = 0; | 355 | int rc = 0; |