aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-device.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-device.h')
-rw-r--r--drivers/firewire/fw-device.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 8ef6ec2ca21c..97588937c018 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -19,10 +19,17 @@
19#ifndef __fw_device_h 19#ifndef __fw_device_h
20#define __fw_device_h 20#define __fw_device_h
21 21
22#include <linux/device.h>
22#include <linux/fs.h> 23#include <linux/fs.h>
23#include <linux/cdev.h>
24#include <linux/idr.h> 24#include <linux/idr.h>
25#include <linux/kernel.h>
26#include <linux/list.h>
27#include <linux/mutex.h>
25#include <linux/rwsem.h> 28#include <linux/rwsem.h>
29#include <linux/sysfs.h>
30#include <linux/types.h>
31#include <linux/workqueue.h>
32
26#include <asm/atomic.h> 33#include <asm/atomic.h>
27 34
28enum fw_device_state { 35enum fw_device_state {
@@ -38,6 +45,9 @@ struct fw_attribute_group {
38 struct attribute *attrs[11]; 45 struct attribute *attrs[11];
39}; 46};
40 47
48struct fw_node;
49struct fw_card;
50
41/* 51/*
42 * Note, fw_device.generation always has to be read before fw_device.node_id. 52 * Note, fw_device.generation always has to be read before fw_device.node_id.
43 * Use SMP memory barriers to ensure this. Otherwise requests will be sent 53 * Use SMP memory barriers to ensure this. Otherwise requests will be sent
@@ -61,13 +71,18 @@ struct fw_device {
61 int node_id; 71 int node_id;
62 int generation; 72 int generation;
63 unsigned max_speed; 73 unsigned max_speed;
64 bool cmc;
65 struct fw_card *card; 74 struct fw_card *card;
66 struct device device; 75 struct device device;
76
77 struct mutex client_list_mutex;
67 struct list_head client_list; 78 struct list_head client_list;
79
68 u32 *config_rom; 80 u32 *config_rom;
69 size_t config_rom_length; 81 size_t config_rom_length;
70 int config_rom_retries; 82 int config_rom_retries;
83 unsigned cmc:1;
84 unsigned bc_implemented:2;
85
71 struct delayed_work work; 86 struct delayed_work work;
72 struct fw_attribute_group attribute_group; 87 struct fw_attribute_group attribute_group;
73}; 88};
@@ -96,6 +111,7 @@ static inline void fw_device_put(struct fw_device *device)
96 111
97struct fw_device *fw_device_get_by_devt(dev_t devt); 112struct fw_device *fw_device_get_by_devt(dev_t devt);
98int fw_device_enable_phys_dma(struct fw_device *device); 113int fw_device_enable_phys_dma(struct fw_device *device);
114void fw_device_set_broadcast_channel(struct fw_device *device, int generation);
99 115
100void fw_device_cdev_update(struct fw_device *device); 116void fw_device_cdev_update(struct fw_device *device);
101void fw_device_cdev_remove(struct fw_device *device); 117void fw_device_cdev_remove(struct fw_device *device);
@@ -176,8 +192,7 @@ struct fw_driver {
176 const struct fw_device_id *id_table; 192 const struct fw_device_id *id_table;
177}; 193};
178 194
179static inline struct fw_driver * 195static inline struct fw_driver *fw_driver(struct device_driver *drv)
180fw_driver(struct device_driver *drv)
181{ 196{
182 return container_of(drv, struct fw_driver, driver); 197 return container_of(drv, struct fw_driver, driver);
183} 198}