From 8b3fe7b591b3c50061a8701f8eda14033420577b Mon Sep 17 00:00:00 2001 From: Ilan Elias Date: Sun, 18 Sep 2011 11:19:33 +0300 Subject: NFC: Add dev_up and dev_down control operations Add 2 new nfc control operations: dev_up to turn on the nfc device dev_down to turn off the nfc device Signed-off-by: Ilan Elias Signed-off-by: John W. Linville --- include/linux/nfc.h | 6 ++++++ include/net/nfc.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/linux/nfc.h b/include/linux/nfc.h index c525e0b5876..36cb955b05c 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h @@ -39,6 +39,10 @@ * * @NFC_CMD_GET_DEVICE: request information about a device (requires * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices + * @NFC_CMD_DEV_UP: turn on the nfc device + * (requires %NFC_ATTR_DEVICE_INDEX) + * @NFC_CMD_DEV_DOWN: turn off the nfc device + * (requires %NFC_ATTR_DEVICE_INDEX) * @NFC_CMD_START_POLL: start polling for targets using the given protocols * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS) * @NFC_CMD_STOP_POLL: stop polling for targets (requires @@ -56,6 +60,8 @@ enum nfc_commands { NFC_CMD_UNSPEC, NFC_CMD_GET_DEVICE, + NFC_CMD_DEV_UP, + NFC_CMD_DEV_DOWN, NFC_CMD_START_POLL, NFC_CMD_STOP_POLL, NFC_CMD_GET_TARGET, diff --git a/include/net/nfc.h b/include/net/nfc.h index 87b51fe15b7..6a7f602aa84 100644 --- a/include/net/nfc.h +++ b/include/net/nfc.h @@ -48,6 +48,8 @@ typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, int err); struct nfc_ops { + int (*dev_up)(struct nfc_dev *dev); + int (*dev_down)(struct nfc_dev *dev); int (*start_poll)(struct nfc_dev *dev, u32 protocols); void (*stop_poll)(struct nfc_dev *dev); int (*activate_target)(struct nfc_dev *dev, u32 target_idx, @@ -78,7 +80,9 @@ struct nfc_dev { int targets_generation; spinlock_t targets_lock; struct device dev; + bool dev_up; bool polling; + bool remote_activated; struct nfc_genl_data genl_data; u32 supported_protocols; -- cgit v1.2.3