summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-04-19 18:28:34 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-04-19 18:28:34 +0200
commita34a54cd1af371dba7a9ce7b27910d75dfb57384 (patch)
treefd394026d51fab15fc8170d9afc0284fa0258b10 /include
parentcec58ec72d348d701f90219aea5b2e9f2db2028e (diff)
downloadneard-a34a54cd1af371dba7a9ce7b27910d75dfb57384.tar.gz
neard-a34a54cd1af371dba7a9ce7b27910d75dfb57384.tar.bz2
neard-a34a54cd1af371dba7a9ce7b27910d75dfb57384.zip
device: Add device driver definition
Diffstat (limited to 'include')
-rw-r--r--include/device.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h
index 9c380c1..a01f899 100644
--- a/include/device.h
+++ b/include/device.h
@@ -28,7 +28,29 @@
struct near_device;
+typedef void (*near_device_io_cb) (uint32_t adapter_idx, uint32_t target_idx,
+ int status);
+
+struct near_ndef_message;
+
+#define NEAR_DEVICE_PRIORITY_LOW -100
+#define NEAR_DEVICE_PRIORITY_DEFAULT 0
+#define NEAR_DEVICE_PRIORITY_HIGH 100
+
+struct near_device_driver {
+ uint16_t type;
+ int priority;
+
+ int (*listen)(uint32_t adapter_idx, uint32_t target_idx,
+ near_device_io_cb cb);
+ int (*push)(uint32_t adapter_idx, uint32_t target_idx,
+ struct near_ndef_message *ndef,
+ near_device_io_cb cb);
+};
+
struct near_device *near_device_get_device(uint32_t adapter_idx,
uint32_t target_idx);
+int near_device_driver_register(struct near_device_driver *driver);
+void near_device_driver_unregister(struct near_device_driver *driver);
#endif