aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Areskoug <andreas.areskoug@stericsson.com>2010-03-16 11:02:42 +0100
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:44:26 -0600
commit4d10a5ddd564f07ec5bd6e6d0e0b80882a799f1f (patch)
tree868695abf8243fd52d0103d6000333d3d3eecd92 /include
parenta1113d0582381ec61040f22054eb6232eac16355 (diff)
Merged ste_conn driver with Linux_SW_v0.6
Diffstat (limited to 'include')
-rwxr-xr-xinclude/linux/mfd/ste_conn.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/include/linux/mfd/ste_conn.h b/include/linux/mfd/ste_conn.h
new file mode 100755
index 00000000000..c9176422988
--- /dev/null
+++ b/include/linux/mfd/ste_conn.h
@@ -0,0 +1,117 @@
+/*
+ * file ste_conn.h
+ *
+ * Copyright (C) ST-Ericsson AB 2010
+ *
+ * Linux Bluetooth HCI H:4 Driver for ST-Ericsson connectivity controller.
+ * License terms: GNU General Public License (GPL), version 2
+ *
+ * Authors:
+ * Pär-Gunnar Hjälmdahl (par-gunnar.p.hjalmdahl@stericsson.com) for ST-Ericsson.
+ * Henrik Possung (henrik.possung@stericsson.com) for ST-Ericsson.
+ * Josef Kindberg (josef.kindberg@stericsson.com) for ST-Ericsson.
+ * Dariusz Szymszak (dariusz.xd.szymczak@stericsson.com) for ST-Ericsson.
+ * Kjell Andersson (kjell.k.andersson@stericsson.com) for ST-Ericsson.
+ */
+
+#ifndef _STE_CONN_H_
+#define _STE_CONN_H_
+
+#include <linux/skbuff.h>
+#include <mach/ste_conn_devices.h>
+
+struct ste_conn_callbacks;
+
+/**
+ * struct ste_conn_device - Device structure for ste_conn user.
+ * @h4_channel: HCI H:4 channel used by this device.
+ * @callbacks: Callback functions registered by this device.
+ * @logger_enabled: True if HCI logger is enabled for this channel, false otherwise.
+ * @user_data: Arbitrary data used by caller.
+ * @dev: Parent device this driver is connected to.
+ *
+ * Defines data needed to access an HCI channel.
+ */
+struct ste_conn_device {
+ int h4_channel;
+ struct ste_conn_callbacks *callbacks;
+ bool logger_enabled;
+ void *user_data;
+ struct device *dev;
+};
+
+/**
+ * struct ste_conn_callbacks - Callback structure for ste_conn user.
+ * @read_cb: Callback function called when data is received from the connectivity controller.
+ * @reset_cb: Callback function called when the connectivity controller has been reset.
+ *
+ * Defines the callback functions provided from the caller.
+ */
+struct ste_conn_callbacks {
+ void (*read_cb) (struct ste_conn_device *dev, struct sk_buff *skb);
+ void (*reset_cb) (struct ste_conn_device *dev);
+};
+
+/**
+ * ste_conn_register() - Register ste_conn user.
+ * @name: Name of HCI H:4 channel to register to.
+ * @cb: Callback structure to use for the H:4 channel.
+ *
+ * The ste_conn_register() function register ste_conn user.
+ *
+ * Returns:
+ * Pointer to ste_conn device structure if successful.
+ * NULL upon failure.
+ */
+extern struct ste_conn_device *ste_conn_register(char *name, struct ste_conn_callbacks *cb);
+
+/**
+ * ste_conn_deregister() - Remove registration of ste_conn user.
+ * @dev: ste_conn device.
+ *
+ * The ste_conn_deregister() function removes the ste_conn user.
+ */
+extern void ste_conn_deregister(struct ste_conn_device *dev);
+
+/**
+ * ste_conn_reset() - Reset the ste_conn controller.
+ * @dev: ste_conn device.
+ *
+ * The ste_conn_reset() function reset the ste_conn controller.
+ *
+ * Returns:
+ * 0 if there is no error.
+ * -EACCES if driver has not been initialized.
+ */
+extern int ste_conn_reset(struct ste_conn_device *dev);
+
+/**
+ * ste_conn_alloc_skb() - Alloc an sk_buff structure for ste_conn handling.
+ * @size: Size in number of octets.
+ * @priority: Allocation priority, e.g. GFP_KERNEL.
+ *
+ * The ste_conn_alloc_skb() function allocates an sk_buff structure for ste_conn
+ * handling.
+ *
+ * Returns:
+ * Pointer to sk_buff buffer structure if successful.
+ * NULL upon allocation failure.
+ */
+extern struct sk_buff *ste_conn_alloc_skb(unsigned int size, gfp_t priority);
+
+/**
+ * ste_conn_write() - Send data to the connectivity controller.
+ * @dev: ste_conn device.
+ * @skb: Data packet.
+ *
+ * The ste_conn_write() function sends data to the connectivity controller.
+ *
+ * Returns:
+ * 0 if there is no error.
+ * -EACCES if driver has not been initialized or trying to write while driver is not active.
+ * -EINVAL if NULL pointer was supplied.
+ * Error codes returned from cpd_enable_hci_logger.
+ */
+extern int ste_conn_write(struct ste_conn_device *dev, struct sk_buff *skb);
+
+#endif /* _STE_CONN_H_ */