aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-transaction.h')
-rw-r--r--drivers/firewire/fw-transaction.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 219094e38542..2ae1b0d6cb7b 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -19,14 +19,15 @@
19#ifndef __fw_transaction_h 19#ifndef __fw_transaction_h
20#define __fw_transaction_h 20#define __fw_transaction_h
21 21
22#include <linux/completion.h>
22#include <linux/device.h> 23#include <linux/device.h>
23#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
24#include <linux/firewire-constants.h> 25#include <linux/firewire-constants.h>
26#include <linux/kref.h>
25#include <linux/list.h> 27#include <linux/list.h>
26#include <linux/spinlock_types.h> 28#include <linux/spinlock_types.h>
27#include <linux/timer.h> 29#include <linux/timer.h>
28#include <linux/workqueue.h> 30#include <linux/workqueue.h>
29#include <asm/atomic.h>
30 31
31#define TCODE_IS_READ_REQUEST(tcode) (((tcode) & ~1) == 4) 32#define TCODE_IS_READ_REQUEST(tcode) (((tcode) & ~1) == 4)
32#define TCODE_IS_BLOCK_PACKET(tcode) (((tcode) & 1) != 0) 33#define TCODE_IS_BLOCK_PACKET(tcode) (((tcode) & 1) != 0)
@@ -219,7 +220,8 @@ extern struct bus_type fw_bus_type;
219struct fw_card { 220struct fw_card {
220 const struct fw_card_driver *driver; 221 const struct fw_card_driver *driver;
221 struct device *device; 222 struct device *device;
222 atomic_t device_count; 223 struct kref kref;
224 struct completion done;
223 225
224 int node_id; 226 int node_id;
225 int generation; 227 int generation;
@@ -260,6 +262,20 @@ struct fw_card {
260 int bm_generation; 262 int bm_generation;
261}; 263};
262 264
265static inline struct fw_card *fw_card_get(struct fw_card *card)
266{
267 kref_get(&card->kref);
268
269 return card;
270}
271
272void fw_card_release(struct kref *kref);
273
274static inline void fw_card_put(struct fw_card *card)
275{
276 kref_put(&card->kref, fw_card_release);
277}
278
263/* 279/*
264 * The iso packet format allows for an immediate header/payload part 280 * The iso packet format allows for an immediate header/payload part
265 * stored in 'header' immediately after the packet info plus an 281 * stored in 'header' immediately after the packet info plus an