diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 23:39:13 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 23:39:13 +0400 |
commit | 849c529f57020cc47085400edd5e641d95cd4faf (patch) | |
tree | 5f2d1add9f98995bf8c22cdfc6ade3e02869e1ac /drivers/firewire/fw-transaction.h | |
parent | b9d2252c1e44fa83a4e65fdc9eb93db6297c55af (diff) | |
parent | a7ea67823af4a7e442e92064b0fab46603a588f6 (diff) | |
download | linux-849c529f57020cc47085400edd5e641d95cd4faf.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
firewire: don't respond to broadcast write requests
firewire: clean up fw_card reference counting
firewire: clean up some includes
firewire: remove unused struct members
firewire: implement broadcast_channel CSR for 1394a compliance
ieee1394: dump mmapped iso buffers in core files
ieee1394: raw1394: Push the BKL down into the driver ioctls
ieee1394: video1394: reorder module init, prepare BKL removal
ieee1394: reduce log noise about config ROM CRC errors
Diffstat (limited to 'drivers/firewire/fw-transaction.h')
-rw-r--r-- | drivers/firewire/fw-transaction.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h index 04d3854f6560..2ae1b0d6cb7b 100644 --- a/drivers/firewire/fw-transaction.h +++ b/drivers/firewire/fw-transaction.h @@ -19,14 +19,15 @@ #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) @@ -80,6 +81,9 @@ #define CSR_SPEED_MAP 0x2000 #define CSR_SPEED_MAP_END 0x3000 +#define BROADCAST_CHANNEL_INITIAL (1 << 31 | 31) +#define BROADCAST_CHANNEL_VALID (1 << 30) + #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) @@ -216,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; @@ -236,6 +241,7 @@ struct fw_card { */ int self_id_count; u32 topology_map[252 + 3]; + u32 broadcast_channel; spinlock_t lock; /* Take this lock when handling the lists in * this struct. */ @@ -256,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 @@ -348,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 |