]> err.no Git - linux-2.6/blobdiff - drivers/firewire/fw-transaction.h
ide: add ->set_irq method
[linux-2.6] / drivers / firewire / fw-transaction.h
index f3a493d596ccc31ada0433394507ddd2cf717d82..2ae1b0d6cb7bdfaa6929ccc06a00d63501acebcf 100644 (file)
 #ifndef __fw_transaction_h
 #define __fw_transaction_h
 
+#include <linux/completion.h>
 #include <linux/device.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/list.h>
-#include <linux/fs.h>
 #include <linux/dma-mapping.h>
 #include <linux/firewire-constants.h>
-#include <asm/atomic.h>
+#include <linux/kref.h>
+#include <linux/list.h>
+#include <linux/spinlock_types.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
 
 #define TCODE_IS_READ_REQUEST(tcode)   (((tcode) & ~1) == 4)
 #define TCODE_IS_BLOCK_PACKET(tcode)   (((tcode) &  1) != 0)
@@ -219,7 +220,8 @@ extern struct bus_type fw_bus_type;
 struct fw_card {
        const struct fw_card_driver *driver;
        struct device *device;
-       atomic_t device_count;
+       struct kref kref;
+       struct completion done;
 
        int node_id;
        int generation;
@@ -260,6 +262,20 @@ struct fw_card {
        int bm_generation;
 };
 
+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);
+}
+
 /*
  * The iso packet format allows for an immediate header/payload part
  * stored in 'header' immediately after the packet info plus an
@@ -352,8 +368,6 @@ int
 fw_iso_context_stop(struct fw_iso_context *ctx);
 
 struct fw_card_driver {
-       const char *name;
-
        /*
         * Enable the given card with the given initial config rom.
         * This function is expected to activate the card, and either