aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-01-21 14:44:09 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:02:40 -0500
commit5e20c282184fd5794661b6688883231ff5348abc (patch)
treed9ea9b86d5e2bcc4ef4d8def27102a76ac4b05ef
parent95688e97cdf7453cde22eaa73cc2ab6b113c1853 (diff)
firewire: whitespace adjustments
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Kristian Høgsberg <krh@redhat.com>
-rw-r--r--drivers/firewire/fw-card.c41
-rw-r--r--drivers/firewire/fw-device-cdev.h18
-rw-r--r--drivers/firewire/fw-device.c4
-rw-r--r--drivers/firewire/fw-device.h6
-rw-r--r--drivers/firewire/fw-iso.c4
-rw-r--r--drivers/firewire/fw-ohci.c5
-rw-r--r--drivers/firewire/fw-ohci.h44
-rw-r--r--drivers/firewire/fw-topology.c1
-rw-r--r--drivers/firewire/fw-topology.h8
-rw-r--r--drivers/firewire/fw-transaction.c8
-rw-r--r--drivers/firewire/fw-transaction.h174
11 files changed, 144 insertions, 169 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 82a92432bcb7..c560fd5e74fc 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -76,12 +76,12 @@ generate_config_rom (struct fw_card *card, size_t *config_rom_length)
76 static u32 config_rom[256]; 76 static u32 config_rom[256];
77 int i, j, length; 77 int i, j, length;
78 78
79 /* Initialize contents of config rom buffer. On the OHCI 79 /* Initialize contents of config rom buffer. On the OHCI
80 * controller, block reads to the config rom accesses the host 80 * controller, block reads to the config rom accesses the host
81 * memory, but quadlet read access the hardware bus info block 81 * memory, but quadlet read access the hardware bus info block
82 * registers. That's just crack, but it means we should make 82 * registers. That's just crack, but it means we should make
83 * sure the contents of bus info block in host memory mathces 83 * sure the contents of bus info block in host memory mathces
84 * the version stored in the OHCI registers. */ 84 * the version stored in the OHCI registers. */
85 85
86 memset(config_rom, 0, sizeof config_rom); 86 memset(config_rom, 0, sizeof config_rom);
87 config_rom[0] = bib_crc_length(4) | bib_info_length(4) | bib_crc(0); 87 config_rom[0] = bib_crc_length(4) | bib_info_length(4) | bib_crc(0);
@@ -263,13 +263,13 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
263 static int index; 263 static int index;
264 264
265 card->index = index++; 265 card->index = index++;
266 card->driver = driver; 266 card->driver = driver;
267 card->device = device; 267 card->device = device;
268 card->current_tlabel = 0; 268 card->current_tlabel = 0;
269 card->tlabel_mask = 0; 269 card->tlabel_mask = 0;
270 card->color = 0; 270 card->color = 0;
271 271
272 INIT_LIST_HEAD(&card->transaction_list); 272 INIT_LIST_HEAD(&card->transaction_list);
273 spin_lock_init(&card->lock); 273 spin_lock_init(&card->lock);
274 setup_timer(&card->flush_timer, 274 setup_timer(&card->flush_timer,
275 flush_timer_callback, (unsigned long)card); 275 flush_timer_callback, (unsigned long)card);
@@ -307,7 +307,7 @@ fw_card_add(struct fw_card *card,
307 307
308 retval = device_add(&card->card_device); 308 retval = device_add(&card->card_device);
309 if (retval < 0) { 309 if (retval < 0) {
310 fw_error("Failed to register card device."); 310 fw_error("Failed to register card device.");
311 return retval; 311 return retval;
312 } 312 }
313 313
@@ -358,13 +358,13 @@ dummy_set_config_rom(struct fw_card *card,
358static void 358static void
359dummy_send_request(struct fw_card *card, struct fw_packet *packet) 359dummy_send_request(struct fw_card *card, struct fw_packet *packet)
360{ 360{
361 packet->callback(packet, card, -ENODEV); 361 packet->callback(packet, card, -ENODEV);
362} 362}
363 363
364static void 364static void
365dummy_send_response(struct fw_card *card, struct fw_packet *packet) 365dummy_send_response(struct fw_card *card, struct fw_packet *packet)
366{ 366{
367 packet->callback(packet, card, -ENODEV); 367 packet->callback(packet, card, -ENODEV);
368} 368}
369 369
370static int 370static int
@@ -375,12 +375,12 @@ dummy_enable_phys_dma(struct fw_card *card,
375} 375}
376 376
377static struct fw_card_driver dummy_driver = { 377static struct fw_card_driver dummy_driver = {
378 .name = "dummy", 378 .name = "dummy",
379 .enable = dummy_enable, 379 .enable = dummy_enable,
380 .update_phy_reg = dummy_update_phy_reg, 380 .update_phy_reg = dummy_update_phy_reg,
381 .set_config_rom = dummy_set_config_rom, 381 .set_config_rom = dummy_set_config_rom,
382 .send_request = dummy_send_request, 382 .send_request = dummy_send_request,
383 .send_response = dummy_send_response, 383 .send_response = dummy_send_response,
384 .enable_phys_dma = dummy_enable_phys_dma 384 .enable_phys_dma = dummy_enable_phys_dma
385}; 385};
386 386
@@ -428,13 +428,6 @@ EXPORT_SYMBOL(fw_card_put);
428int 428int
429fw_core_initiate_bus_reset(struct fw_card *card, int short_reset) 429fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
430{ 430{
431 u32 address; 431 return card->driver->update_phy_reg(card, short_reset ? 5 : 1, 0, 0x40);
432
433 if (short_reset)
434 address = 5;
435 else
436 address = 1;
437
438 return card->driver->update_phy_reg(card, address, 0, 0x40);
439} 432}
440EXPORT_SYMBOL(fw_core_initiate_bus_reset); 433EXPORT_SYMBOL(fw_core_initiate_bus_reset);
diff --git a/drivers/firewire/fw-device-cdev.h b/drivers/firewire/fw-device-cdev.h
index e2ae93361a55..b934272913e1 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -33,15 +33,15 @@
33#define TCODE_READ_QUADLET_RESPONSE 6 33#define TCODE_READ_QUADLET_RESPONSE 6
34#define TCODE_READ_BLOCK_RESPONSE 7 34#define TCODE_READ_BLOCK_RESPONSE 7
35#define TCODE_CYCLE_START 8 35#define TCODE_CYCLE_START 8
36#define TCODE_LOCK_REQUEST 9 36#define TCODE_LOCK_REQUEST 9
37#define TCODE_STREAM_DATA 10 37#define TCODE_STREAM_DATA 10
38#define TCODE_LOCK_RESPONSE 11 38#define TCODE_LOCK_RESPONSE 11
39 39
40#define RCODE_COMPLETE 0x0 40#define RCODE_COMPLETE 0x0
41#define RCODE_CONFLICT_ERROR 0x4 41#define RCODE_CONFLICT_ERROR 0x4
42#define RCODE_DATA_ERROR 0x5 42#define RCODE_DATA_ERROR 0x5
43#define RCODE_TYPE_ERROR 0x6 43#define RCODE_TYPE_ERROR 0x6
44#define RCODE_ADDRESS_ERROR 0x7 44#define RCODE_ADDRESS_ERROR 0x7
45 45
46#define SCODE_100 0x0 46#define SCODE_100 0x0
47#define SCODE_200 0x1 47#define SCODE_200 0x1
@@ -122,13 +122,13 @@ struct fw_cdev_create_iso_context {
122}; 122};
123 123
124struct fw_cdev_iso_packet { 124struct fw_cdev_iso_packet {
125 __u16 payload_length; /* Length of indirect payload. */ 125 __u16 payload_length; /* Length of indirect payload. */
126 __u32 interrupt : 1; /* Generate interrupt on this packet */ 126 __u32 interrupt : 1; /* Generate interrupt on this packet */
127 __u32 skip : 1; /* Set to not send packet at all. */ 127 __u32 skip : 1; /* Set to not send packet at all. */
128 __u32 tag : 2; 128 __u32 tag : 2;
129 __u32 sy : 4; 129 __u32 sy : 4;
130 __u32 header_length : 8; /* Length of immediate header. */ 130 __u32 header_length : 8; /* Length of immediate header. */
131 __u32 header[0]; 131 __u32 header[0];
132}; 132};
133 133
134struct fw_cdev_queue_iso { 134struct fw_cdev_queue_iso {
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index e541daade0c3..559b9340e8fd 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -34,7 +34,6 @@ void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 * p)
34 ci->p = p + 1; 34 ci->p = p + 1;
35 ci->end = ci->p + (p[0] >> 16); 35 ci->end = ci->p + (p[0] >> 16);
36} 36}
37
38EXPORT_SYMBOL(fw_csr_iterator_init); 37EXPORT_SYMBOL(fw_csr_iterator_init);
39 38
40int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value) 39int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value)
@@ -44,7 +43,6 @@ int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value)
44 43
45 return ci->p++ < ci->end; 44 return ci->p++ < ci->end;
46} 45}
47
48EXPORT_SYMBOL(fw_csr_iterator_next); 46EXPORT_SYMBOL(fw_csr_iterator_next);
49 47
50static int is_fw_unit(struct device *dev); 48static int is_fw_unit(struct device *dev);
@@ -158,7 +156,6 @@ struct bus_type fw_bus_type = {
158 .match = fw_unit_match, 156 .match = fw_unit_match,
159 .uevent = fw_unit_uevent 157 .uevent = fw_unit_uevent
160}; 158};
161
162EXPORT_SYMBOL(fw_bus_type); 159EXPORT_SYMBOL(fw_bus_type);
163 160
164extern struct fw_device *fw_device_get(struct fw_device *device) 161extern struct fw_device *fw_device_get(struct fw_device *device)
@@ -196,7 +193,6 @@ int fw_device_enable_phys_dma(struct fw_device *device)
196 device->node_id, 193 device->node_id,
197 device->generation); 194 device->generation);
198} 195}
199
200EXPORT_SYMBOL(fw_device_enable_phys_dma); 196EXPORT_SYMBOL(fw_device_enable_phys_dma);
201 197
202static ssize_t 198static ssize_t
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index f39cf6ae6253..b150adb42533 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -48,7 +48,7 @@ struct fw_device {
48static inline struct fw_device * 48static inline struct fw_device *
49fw_device(struct device *dev) 49fw_device(struct device *dev)
50{ 50{
51 return container_of(dev, struct fw_device, device); 51 return container_of(dev, struct fw_device, device);
52} 52}
53 53
54struct fw_device *fw_device_get(struct fw_device *device); 54struct fw_device *fw_device_get(struct fw_device *device);
@@ -63,7 +63,7 @@ struct fw_unit {
63static inline struct fw_unit * 63static inline struct fw_unit *
64fw_unit(struct device *dev) 64fw_unit(struct device *dev)
65{ 65{
66 return container_of(dev, struct fw_unit, device); 66 return container_of(dev, struct fw_unit, device);
67} 67}
68 68
69#define CSR_OFFSET 0x40 69#define CSR_OFFSET 0x40
@@ -119,7 +119,7 @@ struct fw_driver {
119static inline struct fw_driver * 119static inline struct fw_driver *
120fw_driver(struct device_driver *drv) 120fw_driver(struct device_driver *drv)
121{ 121{
122 return container_of(drv, struct fw_driver, driver); 122 return container_of(drv, struct fw_driver, driver);
123} 123}
124 124
125extern const struct file_operations fw_device_ops; 125extern const struct file_operations fw_device_ops;
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 6b638568c2c9..024fab4ef998 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -99,7 +99,6 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card *card, int type,
99 99
100 return ctx; 100 return ctx;
101} 101}
102
103EXPORT_SYMBOL(fw_iso_context_create); 102EXPORT_SYMBOL(fw_iso_context_create);
104 103
105void fw_iso_context_destroy(struct fw_iso_context *ctx) 104void fw_iso_context_destroy(struct fw_iso_context *ctx)
@@ -110,7 +109,6 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
110 109
111 card->driver->free_iso_context(ctx); 110 card->driver->free_iso_context(ctx);
112} 111}
113
114EXPORT_SYMBOL(fw_iso_context_destroy); 112EXPORT_SYMBOL(fw_iso_context_destroy);
115 113
116int 114int
@@ -122,7 +120,6 @@ fw_iso_context_send(struct fw_iso_context *ctx,
122 120
123 return ctx->card->driver->send_iso(ctx, cycle); 121 return ctx->card->driver->send_iso(ctx, cycle);
124} 122}
125
126EXPORT_SYMBOL(fw_iso_context_send); 123EXPORT_SYMBOL(fw_iso_context_send);
127 124
128int 125int
@@ -133,5 +130,4 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
133 130
134 return card->driver->queue_iso(ctx, packet, payload); 131 return card->driver->queue_iso(ctx, packet, payload);
135} 132}
136
137EXPORT_SYMBOL(fw_iso_context_queue); 133EXPORT_SYMBOL(fw_iso_context_queue);
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 6eff7996c1a7..1f34bdd95c85 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -963,9 +963,8 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
963 * element so that head == tail means buffer full. */ 963 * element so that head == tail means buffer full. */
964 964
965 memset(ctx->head_descriptor, 0, sizeof *ctx->head_descriptor); 965 memset(ctx->head_descriptor, 0, sizeof *ctx->head_descriptor);
966 ctx->head_descriptor->control = 966 ctx->head_descriptor->control = cpu_to_le16(descriptor_output_last);
967 cpu_to_le16(descriptor_output_last); 967 ctx->head_descriptor->transfer_status = cpu_to_le16(0x8011);
968 ctx->head_descriptor->transfer_status = cpu_to_le16(0x8011);
969 ctx->head_descriptor++; 968 ctx->head_descriptor++;
970 969
971 return &ctx->base; 970 return &ctx->base;
diff --git a/drivers/firewire/fw-ohci.h b/drivers/firewire/fw-ohci.h
index 35e2a759e017..a562305078bb 100644
--- a/drivers/firewire/fw-ohci.h
+++ b/drivers/firewire/fw-ohci.h
@@ -63,7 +63,7 @@
63#define OHCI1394_PhyControl_Read(addr) (((addr) << 8) | 0x00008000) 63#define OHCI1394_PhyControl_Read(addr) (((addr) << 8) | 0x00008000)
64#define OHCI1394_PhyControl_ReadDone 0x80000000 64#define OHCI1394_PhyControl_ReadDone 0x80000000
65#define OHCI1394_PhyControl_ReadData(r) (((r) & 0x00ff0000) >> 16) 65#define OHCI1394_PhyControl_ReadData(r) (((r) & 0x00ff0000) >> 16)
66#define OHCI1394_PhyControl_Write(addr, data) (((addr) << 8) | (data) | 0x00004000) 66#define OHCI1394_PhyControl_Write(addr, data) (((addr) << 8) | (data) | 0x00004000)
67#define OHCI1394_PhyControl_WriteDone 0x00004000 67#define OHCI1394_PhyControl_WriteDone 0x00004000
68#define OHCI1394_IsochronousCycleTimer 0x0F0 68#define OHCI1394_IsochronousCycleTimer 0x0F0
69#define OHCI1394_AsReqFilterHiSet 0x100 69#define OHCI1394_AsReqFilterHiSet 0x100
@@ -109,27 +109,27 @@
109#define OHCI1394_IsoRcvContextMatch(n) (0x410 + 32 * (n)) 109#define OHCI1394_IsoRcvContextMatch(n) (0x410 + 32 * (n))
110 110
111/* Interrupts Mask/Events */ 111/* Interrupts Mask/Events */
112#define OHCI1394_reqTxComplete 0x00000001 112#define OHCI1394_reqTxComplete 0x00000001
113#define OHCI1394_respTxComplete 0x00000002 113#define OHCI1394_respTxComplete 0x00000002
114#define OHCI1394_ARRQ 0x00000004 114#define OHCI1394_ARRQ 0x00000004
115#define OHCI1394_ARRS 0x00000008 115#define OHCI1394_ARRS 0x00000008
116#define OHCI1394_RQPkt 0x00000010 116#define OHCI1394_RQPkt 0x00000010
117#define OHCI1394_RSPkt 0x00000020 117#define OHCI1394_RSPkt 0x00000020
118#define OHCI1394_isochTx 0x00000040 118#define OHCI1394_isochTx 0x00000040
119#define OHCI1394_isochRx 0x00000080 119#define OHCI1394_isochRx 0x00000080
120#define OHCI1394_postedWriteErr 0x00000100 120#define OHCI1394_postedWriteErr 0x00000100
121#define OHCI1394_lockRespErr 0x00000200 121#define OHCI1394_lockRespErr 0x00000200
122#define OHCI1394_selfIDComplete 0x00010000 122#define OHCI1394_selfIDComplete 0x00010000
123#define OHCI1394_busReset 0x00020000 123#define OHCI1394_busReset 0x00020000
124#define OHCI1394_phy 0x00080000 124#define OHCI1394_phy 0x00080000
125#define OHCI1394_cycleSynch 0x00100000 125#define OHCI1394_cycleSynch 0x00100000
126#define OHCI1394_cycle64Seconds 0x00200000 126#define OHCI1394_cycle64Seconds 0x00200000
127#define OHCI1394_cycleLost 0x00400000 127#define OHCI1394_cycleLost 0x00400000
128#define OHCI1394_cycleInconsistent 0x00800000 128#define OHCI1394_cycleInconsistent 0x00800000
129#define OHCI1394_unrecoverableError 0x01000000 129#define OHCI1394_unrecoverableError 0x01000000
130#define OHCI1394_cycleTooLong 0x02000000 130#define OHCI1394_cycleTooLong 0x02000000
131#define OHCI1394_phyRegRcvd 0x04000000 131#define OHCI1394_phyRegRcvd 0x04000000
132#define OHCI1394_masterIntEnable 0x80000000 132#define OHCI1394_masterIntEnable 0x80000000
133 133
134#define OHCI1394_evt_no_status 0x0 134#define OHCI1394_evt_no_status 0x0
135#define OHCI1394_evt_long_packet 0x2 135#define OHCI1394_evt_long_packet 0x2
diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index e111687f5598..1938f36cfaa3 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -444,5 +444,4 @@ fw_core_handle_bus_reset(struct fw_card *card,
444 444
445 spin_unlock_irqrestore(&card->lock, flags); 445 spin_unlock_irqrestore(&card->lock, flags);
446} 446}
447
448EXPORT_SYMBOL(fw_core_handle_bus_reset); 447EXPORT_SYMBOL(fw_core_handle_bus_reset);
diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
index a78c9516ed0f..4311d9f890d3 100644
--- a/drivers/firewire/fw-topology.h
+++ b/drivers/firewire/fw-topology.h
@@ -37,7 +37,7 @@ struct fw_port {
37 37
38struct fw_node { 38struct fw_node {
39 u16 node_id; 39 u16 node_id;
40 u8 color; 40 u8 color;
41 u8 port_count; 41 u8 port_count;
42 unsigned link_on : 1; 42 unsigned link_on : 1;
43 unsigned initiated_reset : 1; 43 unsigned initiated_reset : 1;
@@ -48,19 +48,19 @@ struct fw_node {
48 48
49 atomic_t ref_count; 49 atomic_t ref_count;
50 50
51 /* For serializing node topology into a list. */ 51 /* For serializing node topology into a list. */
52 struct list_head link; 52 struct list_head link;
53 53
54 /* Upper layer specific data. */ 54 /* Upper layer specific data. */
55 void *data; 55 void *data;
56 56
57 struct fw_port ports[0]; 57 struct fw_port ports[0];
58}; 58};
59 59
60static inline struct fw_node * 60static inline struct fw_node *
61fw_node(struct list_head *l) 61fw_node(struct list_head *l)
62{ 62{
63 return list_entry (l, struct fw_node, link); 63 return list_entry (l, struct fw_node, link);
64} 64}
65 65
66static inline struct fw_node * 66static inline struct fw_node *
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index c2473a824316..79563b2848fa 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -341,7 +341,6 @@ const struct fw_address_region fw_csr_region =
341 { 0xfffff0000000ULL, 0xfffff0000800ull }; 341 { 0xfffff0000000ULL, 0xfffff0000800ull };
342const struct fw_address_region fw_unit_space_region = 342const struct fw_address_region fw_unit_space_region =
343 { 0xfffff0000900ull, 0x1000000000000ull }; 343 { 0xfffff0000900ull, 0x1000000000000ull };
344
345EXPORT_SYMBOL(fw_low_memory_region); 344EXPORT_SYMBOL(fw_low_memory_region);
346EXPORT_SYMBOL(fw_high_memory_region); 345EXPORT_SYMBOL(fw_high_memory_region);
347EXPORT_SYMBOL(fw_private_region); 346EXPORT_SYMBOL(fw_private_region);
@@ -355,7 +354,6 @@ EXPORT_SYMBOL(fw_unit_space_region);
355 * parameters passed to the callback give the details of the 354 * parameters passed to the callback give the details of the
356 * particular request 355 * particular request
357 */ 356 */
358
359int 357int
360fw_core_add_address_handler(struct fw_address_handler *handler, 358fw_core_add_address_handler(struct fw_address_handler *handler,
361 const struct fw_address_region *region) 359 const struct fw_address_region *region)
@@ -385,7 +383,6 @@ fw_core_add_address_handler(struct fw_address_handler *handler,
385 383
386 return ret; 384 return ret;
387} 385}
388
389EXPORT_SYMBOL(fw_core_add_address_handler); 386EXPORT_SYMBOL(fw_core_add_address_handler);
390 387
391/** 388/**
@@ -396,7 +393,6 @@ EXPORT_SYMBOL(fw_core_add_address_handler);
396 * length are set to the start and the length respectively for the 393 * length are set to the start and the length respectively for the
397 * deallocated region, payload is set to NULL. 394 * deallocated region, payload is set to NULL.
398 */ 395 */
399
400void fw_core_remove_address_handler(struct fw_address_handler *handler) 396void fw_core_remove_address_handler(struct fw_address_handler *handler)
401{ 397{
402 unsigned long flags; 398 unsigned long flags;
@@ -405,7 +401,6 @@ void fw_core_remove_address_handler(struct fw_address_handler *handler)
405 list_del(&handler->link); 401 list_del(&handler->link);
406 spin_unlock_irqrestore(&address_handler_lock, flags); 402 spin_unlock_irqrestore(&address_handler_lock, flags);
407} 403}
408
409EXPORT_SYMBOL(fw_core_remove_address_handler); 404EXPORT_SYMBOL(fw_core_remove_address_handler);
410 405
411struct fw_request { 406struct fw_request {
@@ -552,7 +547,6 @@ fw_send_response(struct fw_card *card, struct fw_request *request, int rcode)
552 547
553 card->driver->send_response(card, &request->response); 548 card->driver->send_response(card, &request->response);
554} 549}
555
556EXPORT_SYMBOL(fw_send_response); 550EXPORT_SYMBOL(fw_send_response);
557 551
558void 552void
@@ -613,7 +607,6 @@ fw_core_handle_request(struct fw_card *card,
613 request->data, request->length, 607 request->data, request->length,
614 handler->callback_data); 608 handler->callback_data);
615} 609}
616
617EXPORT_SYMBOL(fw_core_handle_request); 610EXPORT_SYMBOL(fw_core_handle_request);
618 611
619void 612void
@@ -677,7 +670,6 @@ fw_core_handle_response(struct fw_card *card,
677 670
678 t->callback(card, rcode, data, data_length, t->callback_data); 671 t->callback(card, rcode, data, data_length, t->callback_data);
679} 672}
680
681EXPORT_SYMBOL(fw_core_handle_response); 673EXPORT_SYMBOL(fw_core_handle_response);
682 674
683MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 675MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index a664fc3380c6..22d2871131b1 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -36,9 +36,9 @@
36#define TCODE_READ_QUADLET_RESPONSE 6 36#define TCODE_READ_QUADLET_RESPONSE 6
37#define TCODE_READ_BLOCK_RESPONSE 7 37#define TCODE_READ_BLOCK_RESPONSE 7
38#define TCODE_CYCLE_START 8 38#define TCODE_CYCLE_START 8
39#define TCODE_LOCK_REQUEST 9 39#define TCODE_LOCK_REQUEST 9
40#define TCODE_STREAM_DATA 10 40#define TCODE_STREAM_DATA 10
41#define TCODE_LOCK_RESPONSE 11 41#define TCODE_LOCK_RESPONSE 11
42 42
43#define TCODE_IS_BLOCK_PACKET(tcode) (((tcode) & 1) != 0) 43#define TCODE_IS_BLOCK_PACKET(tcode) (((tcode) & 1) != 0)
44#define TCODE_IS_REQUEST(tcode) (((tcode) & 2) == 0) 44#define TCODE_IS_REQUEST(tcode) (((tcode) & 2) == 0)
@@ -61,26 +61,26 @@
61#define SCODE_400 0x2 61#define SCODE_400 0x2
62#define SCODE_BETA 0x3 62#define SCODE_BETA 0x3
63 63
64#define EXTCODE_MASK_SWAP 0x1 64#define EXTCODE_MASK_SWAP 0x1
65#define EXTCODE_COMPARE_SWAP 0x2 65#define EXTCODE_COMPARE_SWAP 0x2
66#define EXTCODE_FETCH_ADD 0x3 66#define EXTCODE_FETCH_ADD 0x3
67#define EXTCODE_LITTLE_ADD 0x4 67#define EXTCODE_LITTLE_ADD 0x4
68#define EXTCODE_BOUNDED_ADD 0x5 68#define EXTCODE_BOUNDED_ADD 0x5
69#define EXTCODE_WRAP_ADD 0x6 69#define EXTCODE_WRAP_ADD 0x6
70 70
71#define ACK_COMPLETE 0x1 71#define ACK_COMPLETE 0x1
72#define ACK_PENDING 0x2 72#define ACK_PENDING 0x2
73#define ACK_BUSY_X 0x4 73#define ACK_BUSY_X 0x4
74#define ACK_BUSY_A 0x5 74#define ACK_BUSY_A 0x5
75#define ACK_BUSY_B 0x6 75#define ACK_BUSY_B 0x6
76#define ACK_DATA_ERROR 0xd 76#define ACK_DATA_ERROR 0xd
77#define ACK_TYPE_ERROR 0xe 77#define ACK_TYPE_ERROR 0xe
78 78
79#define RCODE_COMPLETE 0x0 79#define RCODE_COMPLETE 0x0
80#define RCODE_CONFLICT_ERROR 0x4 80#define RCODE_CONFLICT_ERROR 0x4
81#define RCODE_DATA_ERROR 0x5 81#define RCODE_DATA_ERROR 0x5
82#define RCODE_TYPE_ERROR 0x6 82#define RCODE_TYPE_ERROR 0x6
83#define RCODE_ADDRESS_ERROR 0x7 83#define RCODE_ADDRESS_ERROR 0x7
84 84
85/* Juju specific rcodes */ 85/* Juju specific rcodes */
86#define RCODE_SEND_ERROR 0x10 86#define RCODE_SEND_ERROR 0x10
@@ -94,10 +94,10 @@
94 94
95#define LOCAL_BUS 0xffc0 95#define LOCAL_BUS 0xffc0
96 96
97#define SELFID_PORT_CHILD 0x3 97#define SELFID_PORT_CHILD 0x3
98#define SELFID_PORT_PARENT 0x2 98#define SELFID_PORT_PARENT 0x2
99#define SELFID_PORT_NCONN 0x1 99#define SELFID_PORT_NCONN 0x1
100#define SELFID_PORT_NONE 0x0 100#define SELFID_PORT_NONE 0x0
101 101
102#define PHY_PACKET_CONFIG 0x0 102#define PHY_PACKET_CONFIG 0x0
103#define PHY_PACKET_LINK_ON 0x1 103#define PHY_PACKET_LINK_ON 0x1
@@ -162,54 +162,54 @@ typedef void (*fw_bus_reset_callback_t)(struct fw_card *handle,
162 void *callback_data); 162 void *callback_data);
163 163
164struct fw_packet { 164struct fw_packet {
165 int speed; 165 int speed;
166 int generation; 166 int generation;
167 u32 header[4]; 167 u32 header[4];
168 size_t header_length; 168 size_t header_length;
169 void *payload; 169 void *payload;
170 size_t payload_length; 170 size_t payload_length;
171 u32 timestamp; 171 u32 timestamp;
172 172
173 dma_addr_t payload_bus; 173 dma_addr_t payload_bus;
174 174
175 /* This callback is called when the packet transmission has 175 /* This callback is called when the packet transmission has
176 * completed; for successful transmission, the status code is 176 * completed; for successful transmission, the status code is
177 * the ack received from the destination, otherwise it's a 177 * the ack received from the destination, otherwise it's a
178 * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO. 178 * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO.
179 * The callback can be called from tasklet context and thus 179 * The callback can be called from tasklet context and thus
180 * must never block. 180 * must never block.
181 */ 181 */
182 fw_packet_callback_t callback; 182 fw_packet_callback_t callback;
183 int status; 183 int status;
184 struct list_head link; 184 struct list_head link;
185}; 185};
186 186
187struct fw_transaction { 187struct fw_transaction {
188 int node_id; /* The generation is implied; it is always the current. */ 188 int node_id; /* The generation is implied; it is always the current. */
189 int tlabel; 189 int tlabel;
190 int timestamp; 190 int timestamp;
191 struct list_head link; 191 struct list_head link;
192 192
193 struct fw_packet packet; 193 struct fw_packet packet;
194 194
195 /* The data passed to the callback is valid only during the 195 /* The data passed to the callback is valid only during the
196 * callback. */ 196 * callback. */
197 fw_transaction_callback_t callback; 197 fw_transaction_callback_t callback;
198 void *callback_data; 198 void *callback_data;
199}; 199};
200 200
201static inline struct fw_packet * 201static inline struct fw_packet *
202fw_packet(struct list_head *l) 202fw_packet(struct list_head *l)
203{ 203{
204 return list_entry (l, struct fw_packet, link); 204 return list_entry (l, struct fw_packet, link);
205} 205}
206 206
207struct fw_address_handler { 207struct fw_address_handler {
208 u64 offset; 208 u64 offset;
209 size_t length; 209 size_t length;
210 fw_address_callback_t address_callback; 210 fw_address_callback_t address_callback;
211 void *callback_data; 211 void *callback_data;
212 struct list_head link; 212 struct list_head link;
213}; 213};
214 214
215 215
@@ -236,22 +236,22 @@ struct fw_card {
236 const struct fw_card_driver *driver; 236 const struct fw_card_driver *driver;
237 struct device *device; 237 struct device *device;
238 238
239 int node_id; 239 int node_id;
240 int generation; 240 int generation;
241 /* This is the generation used for timestamping incoming requests. */ 241 /* This is the generation used for timestamping incoming requests. */
242 int request_generation; 242 int request_generation;
243 int current_tlabel, tlabel_mask; 243 int current_tlabel, tlabel_mask;
244 struct list_head transaction_list; 244 struct list_head transaction_list;
245 struct timer_list flush_timer; 245 struct timer_list flush_timer;
246 246
247 unsigned long long guid; 247 unsigned long long guid;
248 int max_receive; 248 int max_receive;
249 int link_speed; 249 int link_speed;
250 int config_rom_generation; 250 int config_rom_generation;
251 251
252 /* We need to store up to 4 self ID for a maximum of 63 devices. */ 252 /* We need to store up to 4 self ID for a maximum of 63 devices. */
253 int self_id_count; 253 int self_id_count;
254 u32 self_ids[252]; 254 u32 self_ids[252];
255 255
256 spinlock_t lock; /* Take this lock when handling the lists in 256 spinlock_t lock; /* Take this lock when handling the lists in
257 * this struct. */ 257 * this struct. */
@@ -282,13 +282,13 @@ void fw_card_put(struct fw_card *card);
282 * scatter-gather streaming (e.g. assembling video frame automatically). */ 282 * scatter-gather streaming (e.g. assembling video frame automatically). */
283 283
284struct fw_iso_packet { 284struct fw_iso_packet {
285 u16 payload_length; /* Length of indirect payload. */ 285 u16 payload_length; /* Length of indirect payload. */
286 u32 interrupt : 1; /* Generate interrupt on this packet */ 286 u32 interrupt : 1; /* Generate interrupt on this packet */
287 u32 skip : 1; /* Set to not send packet at all. */ 287 u32 skip : 1; /* Set to not send packet at all. */
288 u32 tag : 2; 288 u32 tag : 2;
289 u32 sy : 4; 289 u32 sy : 4;
290 u32 header_length : 8; /* Length of immediate header. */ 290 u32 header_length : 8; /* Length of immediate header. */
291 u32 header[0]; 291 u32 header[0];
292}; 292};
293 293
294#define FW_ISO_CONTEXT_TRANSMIT 0 294#define FW_ISO_CONTEXT_TRANSMIT 0
@@ -335,25 +335,25 @@ fw_iso_context_send(struct fw_iso_context *ctx,
335 int channel, int speed, int cycle); 335 int channel, int speed, int cycle);
336 336
337struct fw_card_driver { 337struct fw_card_driver {
338 const char *name; 338 const char *name;
339 339
340 /* Enable the given card with the given initial config rom. 340 /* Enable the given card with the given initial config rom.
341 * This function is expected to activate the card, and either 341 * This function is expected to activate the card, and either
342 * enable the PHY or set the link_on bit and initiate a bus 342 * enable the PHY or set the link_on bit and initiate a bus
343 * reset. */ 343 * reset. */
344 int (*enable) (struct fw_card *card, u32 *config_rom, size_t length); 344 int (*enable) (struct fw_card *card, u32 *config_rom, size_t length);
345 345
346 int (*update_phy_reg) (struct fw_card *card, int address, 346 int (*update_phy_reg) (struct fw_card *card, int address,
347 int clear_bits, int set_bits); 347 int clear_bits, int set_bits);
348 348
349 /* Update the config rom for an enabled card. This function 349 /* Update the config rom for an enabled card. This function
350 * should change the config rom that is presented on the bus 350 * should change the config rom that is presented on the bus
351 * an initiate a bus reset. */ 351 * an initiate a bus reset. */
352 int (*set_config_rom) (struct fw_card *card, 352 int (*set_config_rom) (struct fw_card *card,
353 u32 *config_rom, size_t length); 353 u32 *config_rom, size_t length);
354 354
355 void (*send_request) (struct fw_card *card, struct fw_packet *packet); 355 void (*send_request) (struct fw_card *card, struct fw_packet *packet);
356 void (*send_response) (struct fw_card *card, struct fw_packet *packet); 356 void (*send_response) (struct fw_card *card, struct fw_packet *packet);
357 357
358 /* Allow the specified node ID to do direct DMA out and in of 358 /* Allow the specified node ID to do direct DMA out and in of
359 * host memory. The card will disable this for all node when 359 * host memory. The card will disable this for all node when
@@ -419,8 +419,8 @@ fw_core_handle_request(struct fw_card *card,
419 u32 length, u32 *payload); 419 u32 length, u32 *payload);
420void 420void
421fw_core_handle_response(struct fw_card *card, 421fw_core_handle_response(struct fw_card *card,
422 int speed, int ack, int timestamp, 422 int speed, int ack, int timestamp,
423 u32 length, u32 *payload); 423 u32 length, u32 *payload);
424 424
425 425
426#endif /* __fw_transaction_h */ 426#endif /* __fw_transaction_h */