aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/firewire.h
diff options
context:
space:
mode:
authorChris Boot <bootc@bootc.net>2012-02-01 22:36:02 +0000
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-09 15:25:17 -0700
commitfc5f80b152896c1ffded2a91d11dcb08ffcffebb (patch)
tree4596cd1ee2c896df4259ee2c75ad3b027b6f2469 /include/linux/firewire.h
parentfirewire: Add function to get speed from opaque struct fw_request (diff)
downloadlinux-dev-fc5f80b152896c1ffded2a91d11dcb08ffcffebb.tar.xz
linux-dev-fc5f80b152896c1ffded2a91d11dcb08ffcffebb.zip
firewire: Move fw_card kref functions into linux/firewire.h
When writing a firewire driver that doesn't deal with struct fw_device objects (e.g. it only publishes FireWire units and doesn't subscribe to them), you likely need to keep referenced to struct fw_card objects so that you can send messages to other nodes. This patch moves fw_card_put(), fw_card_get() and fw_card_release() into the public include/linux/firewire.h header instead of drivers/firewire/core.h, and adds EXPORT_SYMBOL_GPL(fw_card_release). The firewire-sbp-target module requires these so it can keep a reference to the fw_card object in order that it can fetch ORBs to execute and read/write related data and status information. Signed-off-by: Chris Boot <bootc@bootc.net> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/linux/firewire.h')
-rw-r--r--include/linux/firewire.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 46831303b0b9..e83c24af358a 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -135,6 +135,20 @@ struct fw_card {
__be32 maint_utility_register;
};
+static inline struct fw_card *fw_card_get(struct fw_card *card)
+{
+ kref_get(&card->kref);
+
+ return card;
+}
+
+void fw_card_release(struct kref *kref);
+
+static inline void fw_card_put(struct fw_card *card)
+{
+ kref_put(&card->kref, fw_card_release);
+}
+
struct fw_attribute_group {
struct attribute_group *groups[2];
struct attribute_group group;