aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-04 21:06:23 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-04-29 18:00:28 -0400
commitafd6546d8d2d8ba1dbe1d2508baf81eebdca3d79 (patch)
treec6f5d115d7cb7eb6daad6c8a27b4854809e5ed50 /drivers/ieee1394
parentef8153348f82688af87e19d594162ca81741fe6a (diff)
ieee1394: move some comments from declaration to definition
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/config_roms.c7
-rw-r--r--drivers/ieee1394/config_roms.h10
-rw-r--r--drivers/ieee1394/dma.c24
-rw-r--r--drivers/ieee1394/dma.h22
-rw-r--r--drivers/ieee1394/highlevel.c89
-rw-r--r--drivers/ieee1394/highlevel.h46
-rw-r--r--drivers/ieee1394/hosts.c8
-rw-r--r--drivers/ieee1394/hosts.h6
-rw-r--r--drivers/ieee1394/ieee1394_core.c77
-rw-r--r--drivers/ieee1394/ieee1394_core.h73
-rw-r--r--drivers/ieee1394/ieee1394_transactions.c29
-rw-r--r--drivers/ieee1394/ieee1394_transactions.h20
-rw-r--r--drivers/ieee1394/iso.c84
-rw-r--r--drivers/ieee1394/iso.h35
-rw-r--r--drivers/ieee1394/nodemgr.c32
-rw-r--r--drivers/ieee1394/nodemgr.h20
-rw-r--r--drivers/ieee1394/ohci1394.c1
-rw-r--r--drivers/ieee1394/ohci1394.h4
18 files changed, 348 insertions, 239 deletions
diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c
index e2de6fa0c9fe..6a87a2700c9d 100644
--- a/drivers/ieee1394/config_roms.c
+++ b/drivers/ieee1394/config_roms.c
@@ -39,7 +39,7 @@ struct hpsb_config_rom_entry {
39 unsigned int flag; 39 unsigned int flag;
40}; 40};
41 41
42 42/* The default host entry. This must succeed. */
43int hpsb_default_host_entry(struct hpsb_host *host) 43int hpsb_default_host_entry(struct hpsb_host *host)
44{ 44{
45 struct csr1212_keyval *root; 45 struct csr1212_keyval *root;
@@ -170,7 +170,7 @@ static struct hpsb_config_rom_entry *const config_rom_entries[] = {
170 NULL, 170 NULL,
171}; 171};
172 172
173 173/* Initialize all config roms */
174int hpsb_init_config_roms(void) 174int hpsb_init_config_roms(void)
175{ 175{
176 int i, error = 0; 176 int i, error = 0;
@@ -191,6 +191,7 @@ int hpsb_init_config_roms(void)
191 return error; 191 return error;
192} 192}
193 193
194/* Cleanup all config roms */
194void hpsb_cleanup_config_roms(void) 195void hpsb_cleanup_config_roms(void)
195{ 196{
196 int i; 197 int i;
@@ -201,6 +202,7 @@ void hpsb_cleanup_config_roms(void)
201 } 202 }
202} 203}
203 204
205/* Add extra config roms to specified host */
204int hpsb_add_extra_config_roms(struct hpsb_host *host) 206int hpsb_add_extra_config_roms(struct hpsb_host *host)
205{ 207{
206 int i, error = 0; 208 int i, error = 0;
@@ -219,6 +221,7 @@ int hpsb_add_extra_config_roms(struct hpsb_host *host)
219 return error; 221 return error;
220} 222}
221 223
224/* Remove extra config roms from specified host */
222void hpsb_remove_extra_config_roms(struct hpsb_host *host) 225void hpsb_remove_extra_config_roms(struct hpsb_host *host)
223{ 226{
224 int i; 227 int i;
diff --git a/drivers/ieee1394/config_roms.h b/drivers/ieee1394/config_roms.h
index 0a70544cfe65..e6cdb5e385a8 100644
--- a/drivers/ieee1394/config_roms.h
+++ b/drivers/ieee1394/config_roms.h
@@ -4,22 +4,12 @@
4#include "ieee1394_types.h" 4#include "ieee1394_types.h"
5#include "hosts.h" 5#include "hosts.h"
6 6
7/* The default host entry. This must succeed. */
8int hpsb_default_host_entry(struct hpsb_host *host); 7int hpsb_default_host_entry(struct hpsb_host *host);
9
10/* Initialize all config roms */
11int hpsb_init_config_roms(void); 8int hpsb_init_config_roms(void);
12
13/* Cleanup all config roms */
14void hpsb_cleanup_config_roms(void); 9void hpsb_cleanup_config_roms(void);
15
16/* Add extra config roms to specified host */
17int hpsb_add_extra_config_roms(struct hpsb_host *host); 10int hpsb_add_extra_config_roms(struct hpsb_host *host);
18
19/* Remove extra config roms from specified host */
20void hpsb_remove_extra_config_roms(struct hpsb_host *host); 11void hpsb_remove_extra_config_roms(struct hpsb_host *host);
21 12
22
23/* List of flags to check if a host contains a certain extra config rom 13/* List of flags to check if a host contains a certain extra config rom
24 * entry. Available in the host->config_roms member. */ 14 * entry. Available in the host->config_roms member. */
25#define HPSB_CONFIG_ROM_ENTRY_IP1394 0x00000001 15#define HPSB_CONFIG_ROM_ENTRY_IP1394 0x00000001
diff --git a/drivers/ieee1394/dma.c b/drivers/ieee1394/dma.c
index c68f328e1a29..45d605581922 100644
--- a/drivers/ieee1394/dma.c
+++ b/drivers/ieee1394/dma.c
@@ -62,6 +62,9 @@ void dma_prog_region_free(struct dma_prog_region *prog)
62 62
63/* dma_region */ 63/* dma_region */
64 64
65/**
66 * dma_region_init - clear out all fields but do not allocate anything
67 */
65void dma_region_init(struct dma_region *dma) 68void dma_region_init(struct dma_region *dma)
66{ 69{
67 dma->kvirt = NULL; 70 dma->kvirt = NULL;
@@ -71,6 +74,9 @@ void dma_region_init(struct dma_region *dma)
71 dma->sglist = NULL; 74 dma->sglist = NULL;
72} 75}
73 76
77/**
78 * dma_region_alloc - allocate the buffer and map it to the IOMMU
79 */
74int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, 80int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
75 struct pci_dev *dev, int direction) 81 struct pci_dev *dev, int direction)
76{ 82{
@@ -128,6 +134,9 @@ int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
128 return -ENOMEM; 134 return -ENOMEM;
129} 135}
130 136
137/**
138 * dma_region_free - unmap and free the buffer
139 */
131void dma_region_free(struct dma_region *dma) 140void dma_region_free(struct dma_region *dma)
132{ 141{
133 if (dma->n_dma_pages) { 142 if (dma->n_dma_pages) {
@@ -167,6 +176,12 @@ static inline int dma_region_find(struct dma_region *dma, unsigned long offset,
167 return i; 176 return i;
168} 177}
169 178
179/**
180 * dma_region_offset_to_bus - get bus address of an offset within a DMA region
181 *
182 * Returns the DMA bus address of the byte with the given @offset relative to
183 * the beginning of the @dma.
184 */
170dma_addr_t dma_region_offset_to_bus(struct dma_region * dma, 185dma_addr_t dma_region_offset_to_bus(struct dma_region * dma,
171 unsigned long offset) 186 unsigned long offset)
172{ 187{
@@ -177,6 +192,9 @@ dma_addr_t dma_region_offset_to_bus(struct dma_region * dma,
177 return sg_dma_address(sg) + rem; 192 return sg_dma_address(sg) + rem;
178} 193}
179 194
195/**
196 * dma_region_sync_for_cpu - sync the CPU's view of the buffer
197 */
180void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, 198void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
181 unsigned long len) 199 unsigned long len)
182{ 200{
@@ -193,6 +211,9 @@ void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
193 dma->direction); 211 dma->direction);
194} 212}
195 213
214/**
215 * dma_region_sync_for_device - sync the IO bus' view of the buffer
216 */
196void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, 217void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
197 unsigned long len) 218 unsigned long len)
198{ 219{
@@ -244,6 +265,9 @@ static struct vm_operations_struct dma_region_vm_ops = {
244 .nopage = dma_region_pagefault, 265 .nopage = dma_region_pagefault,
245}; 266};
246 267
268/**
269 * dma_region_mmap - map the buffer into a user space process
270 */
247int dma_region_mmap(struct dma_region *dma, struct file *file, 271int dma_region_mmap(struct dma_region *dma, struct file *file,
248 struct vm_area_struct *vma) 272 struct vm_area_struct *vma)
249{ 273{
diff --git a/drivers/ieee1394/dma.h b/drivers/ieee1394/dma.h
index a1682aba71c7..2727bcd24194 100644
--- a/drivers/ieee1394/dma.h
+++ b/drivers/ieee1394/dma.h
@@ -66,35 +66,23 @@ struct dma_region {
66 int direction; 66 int direction;
67}; 67};
68 68
69/* clear out all fields but do not allocate anything */
70void dma_region_init(struct dma_region *dma); 69void dma_region_init(struct dma_region *dma);
71
72/* allocate the buffer and map it to the IOMMU */
73int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, 70int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
74 struct pci_dev *dev, int direction); 71 struct pci_dev *dev, int direction);
75
76/* unmap and free the buffer */
77void dma_region_free(struct dma_region *dma); 72void dma_region_free(struct dma_region *dma);
78
79/* sync the CPU's view of the buffer */
80void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, 73void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
81 unsigned long len); 74 unsigned long len);
82
83/* sync the IO bus' view of the buffer */
84void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, 75void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
85 unsigned long len); 76 unsigned long len);
86
87/* map the buffer into a user space process */
88int dma_region_mmap(struct dma_region *dma, struct file *file, 77int dma_region_mmap(struct dma_region *dma, struct file *file,
89 struct vm_area_struct *vma); 78 struct vm_area_struct *vma);
79dma_addr_t dma_region_offset_to_bus(struct dma_region *dma,
80 unsigned long offset);
90 81
91/* macro to index into a DMA region (or dma_prog_region) */ 82/**
83 * dma_region_i - macro to index into a DMA region (or dma_prog_region)
84 */
92#define dma_region_i(_dma, _type, _index) \ 85#define dma_region_i(_dma, _type, _index) \
93 ( ((_type*) ((_dma)->kvirt)) + (_index) ) 86 ( ((_type*) ((_dma)->kvirt)) + (_index) )
94 87
95/* return the DMA bus address of the byte with the given offset
96 * relative to the beginning of the dma_region */
97dma_addr_t dma_region_offset_to_bus(struct dma_region *dma,
98 unsigned long offset);
99
100#endif /* IEEE1394_DMA_H */ 88#endif /* IEEE1394_DMA_H */
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
index 694da82d820b..83a493312751 100644
--- a/drivers/ieee1394/highlevel.c
+++ b/drivers/ieee1394/highlevel.c
@@ -70,8 +70,12 @@ static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl,
70 return NULL; 70 return NULL;
71} 71}
72 72
73/* Returns a per host/driver data structure that was previously stored by 73/**
74 * hpsb_create_hostinfo. */ 74 * hpsb_get_hostinfo - retrieve a hostinfo pointer bound to this driver/host
75 *
76 * Returns a per @host and @hl driver data structure that was previously stored
77 * by hpsb_create_hostinfo.
78 */
75void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host) 79void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host)
76{ 80{
77 struct hl_host_info *hi = hl_get_hostinfo(hl, host); 81 struct hl_host_info *hi = hl_get_hostinfo(hl, host);
@@ -79,7 +83,13 @@ void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host)
79 return hi ? hi->data : NULL; 83 return hi ? hi->data : NULL;
80} 84}
81 85
82/* If size is zero, then the return here is only valid for error checking */ 86/**
87 * hpsb_create_hostinfo - allocate a hostinfo pointer bound to this driver/host
88 *
89 * Allocate a hostinfo pointer backed by memory with @data_size and bind it to
90 * to this @hl driver and @host. If @data_size is zero, then the return here is
91 * only valid for error checking.
92 */
83void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, 93void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
84 size_t data_size) 94 size_t data_size)
85{ 95{
@@ -113,6 +123,11 @@ void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
113 return data; 123 return data;
114} 124}
115 125
126/**
127 * hpsb_set_hostinfo - set the hostinfo pointer to something useful
128 *
129 * Usually follows a call to hpsb_create_hostinfo, where the size is 0.
130 */
116int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, 131int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
117 void *data) 132 void *data)
118{ 133{
@@ -132,6 +147,11 @@ int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
132 return -EINVAL; 147 return -EINVAL;
133} 148}
134 149
150/**
151 * hpsb_destroy_hostinfo - free and remove a hostinfo pointer
152 *
153 * Free and remove the hostinfo pointer bound to this @hl driver and @host.
154 */
135void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host) 155void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host)
136{ 156{
137 struct hl_host_info *hi; 157 struct hl_host_info *hi;
@@ -147,6 +167,12 @@ void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host)
147 return; 167 return;
148} 168}
149 169
170/**
171 * hpsb_set_hostinfo_key - set an alternate lookup key for an hostinfo
172 *
173 * Sets an alternate lookup key for the hostinfo bound to this @hl driver and
174 * @host.
175 */
150void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, 176void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host,
151 unsigned long key) 177 unsigned long key)
152{ 178{
@@ -158,6 +184,9 @@ void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host,
158 return; 184 return;
159} 185}
160 186
187/**
188 * hpsb_get_hostinfo_bykey - retrieve a hostinfo pointer by its alternate key
189 */
161void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key) 190void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
162{ 191{
163 struct hl_host_info *hi; 192 struct hl_host_info *hi;
@@ -189,6 +218,12 @@ static int highlevel_for_each_host_reg(struct hpsb_host *host, void *__data)
189 return 0; 218 return 0;
190} 219}
191 220
221/**
222 * hpsb_register_highlevel - register highlevel driver
223 *
224 * The name pointer in @hl has to stay valid at all times because the string is
225 * not copied.
226 */
192void hpsb_register_highlevel(struct hpsb_highlevel *hl) 227void hpsb_register_highlevel(struct hpsb_highlevel *hl)
193{ 228{
194 unsigned long flags; 229 unsigned long flags;
@@ -258,6 +293,9 @@ static int highlevel_for_each_host_unreg(struct hpsb_host *host, void *__data)
258 return 0; 293 return 0;
259} 294}
260 295
296/**
297 * hpsb_unregister_highlevel - unregister highlevel driver
298 */
261void hpsb_unregister_highlevel(struct hpsb_highlevel *hl) 299void hpsb_unregister_highlevel(struct hpsb_highlevel *hl)
262{ 300{
263 unsigned long flags; 301 unsigned long flags;
@@ -273,6 +311,19 @@ void hpsb_unregister_highlevel(struct hpsb_highlevel *hl)
273 nodemgr_for_each_host(hl, highlevel_for_each_host_unreg); 311 nodemgr_for_each_host(hl, highlevel_for_each_host_unreg);
274} 312}
275 313
314/**
315 * hpsb_allocate_and_register_addrspace - alloc' and reg' a host address space
316 *
317 * @start and @end are 48 bit pointers and have to be quadlet aligned.
318 * @end points to the first address behind the handled addresses. This
319 * function can be called multiple times for a single hpsb_highlevel @hl to
320 * implement sparse register sets. The requested region must not overlap any
321 * previously allocated region, otherwise registering will fail.
322 *
323 * It returns true for successful allocation. Address spaces can be
324 * unregistered with hpsb_unregister_addrspace. All remaining address spaces
325 * are automatically deallocated together with the hpsb_highlevel @hl.
326 */
276u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, 327u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
277 struct hpsb_host *host, 328 struct hpsb_host *host,
278 struct hpsb_address_ops *ops, 329 struct hpsb_address_ops *ops,
@@ -348,6 +399,19 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
348 return retval; 399 return retval;
349} 400}
350 401
402/**
403 * hpsb_register_addrspace - register a host address space
404 *
405 * @start and @end are 48 bit pointers and have to be quadlet aligned.
406 * @end points to the first address behind the handled addresses. This
407 * function can be called multiple times for a single hpsb_highlevel @hl to
408 * implement sparse register sets. The requested region must not overlap any
409 * previously allocated region, otherwise registering will fail.
410 *
411 * It returns true for successful allocation. Address spaces can be
412 * unregistered with hpsb_unregister_addrspace. All remaining address spaces
413 * are automatically deallocated together with the hpsb_highlevel @hl.
414 */
351int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, 415int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
352 struct hpsb_address_ops *ops, u64 start, u64 end) 416 struct hpsb_address_ops *ops, u64 start, u64 end)
353{ 417{
@@ -419,6 +483,11 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
419 return retval; 483 return retval;
420} 484}
421 485
486/**
487 * hpsb_listen_channel - enable receving a certain isochronous channel
488 *
489 * Reception is handled through the @hl's iso_receive op.
490 */
422int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 491int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
423 unsigned int channel) 492 unsigned int channel)
424{ 493{
@@ -431,6 +500,9 @@ int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
431 return 0; 500 return 0;
432} 501}
433 502
503/**
504 * hpsb_unlisten_channel - disable receving a certain isochronous channel
505 */
434void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 506void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
435 unsigned int channel) 507 unsigned int channel)
436{ 508{
@@ -528,6 +600,17 @@ void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction,
528 read_unlock_irqrestore(&hl_irqs_lock, flags); 600 read_unlock_irqrestore(&hl_irqs_lock, flags);
529} 601}
530 602
603/*
604 * highlevel_read, highlevel_write, highlevel_lock, highlevel_lock64:
605 *
606 * These functions are called to handle transactions. They are called when a
607 * packet arrives. The flags argument contains the second word of the first
608 * header quadlet of the incoming packet (containing transaction label, retry
609 * code, transaction code and priority). These functions either return a
610 * response code or a negative number. In the first case a response will be
611 * generated. In the latter case, no response will be sent and the driver which
612 * handled the request will send the response itself.
613 */
531int highlevel_read(struct hpsb_host *host, int nodeid, void *data, u64 addr, 614int highlevel_read(struct hpsb_host *host, int nodeid, void *data, u64 addr,
532 unsigned int length, u16 flags) 615 unsigned int length, u16 flags)
533{ 616{
diff --git a/drivers/ieee1394/highlevel.h b/drivers/ieee1394/highlevel.h
index 55548368b190..63474f7ee69d 100644
--- a/drivers/ieee1394/highlevel.h
+++ b/drivers/ieee1394/highlevel.h
@@ -99,16 +99,6 @@ struct hpsb_address_ops {
99void highlevel_add_host(struct hpsb_host *host); 99void highlevel_add_host(struct hpsb_host *host);
100void highlevel_remove_host(struct hpsb_host *host); 100void highlevel_remove_host(struct hpsb_host *host);
101void highlevel_host_reset(struct hpsb_host *host); 101void highlevel_host_reset(struct hpsb_host *host);
102
103/*
104 * These functions are called to handle transactions. They are called when a
105 * packet arrives. The flags argument contains the second word of the first
106 * header quadlet of the incoming packet (containing transaction label, retry
107 * code, transaction code and priority). These functions either return a
108 * response code or a negative number. In the first case a response will be
109 * generated. In the latter case, no response will be sent and the driver which
110 * handled the request will send the response itself.
111 */
112int highlevel_read(struct hpsb_host *host, int nodeid, void *data, u64 addr, 102int highlevel_read(struct hpsb_host *host, int nodeid, void *data, u64 addr,
113 unsigned int length, u16 flags); 103 unsigned int length, u16 flags);
114int highlevel_write(struct hpsb_host *host, int nodeid, int destid, void *data, 104int highlevel_write(struct hpsb_host *host, int nodeid, int destid, void *data,
@@ -119,30 +109,13 @@ int highlevel_lock(struct hpsb_host *host, int nodeid, quadlet_t *store,
119int highlevel_lock64(struct hpsb_host *host, int nodeid, octlet_t *store, 109int highlevel_lock64(struct hpsb_host *host, int nodeid, octlet_t *store,
120 u64 addr, octlet_t data, octlet_t arg, int ext_tcode, 110 u64 addr, octlet_t data, octlet_t arg, int ext_tcode,
121 u16 flags); 111 u16 flags);
122
123void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length); 112void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length);
124void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction, 113void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction,
125 void *data, size_t length); 114 void *data, size_t length);
126 115
127/*
128 * Register highlevel driver. The name pointer has to stay valid at all times
129 * because the string is not copied.
130 */
131void hpsb_register_highlevel(struct hpsb_highlevel *hl); 116void hpsb_register_highlevel(struct hpsb_highlevel *hl);
132void hpsb_unregister_highlevel(struct hpsb_highlevel *hl); 117void hpsb_unregister_highlevel(struct hpsb_highlevel *hl);
133 118
134/*
135 * Register handlers for host address spaces. Start and end are 48 bit pointers
136 * and have to be quadlet aligned. Argument "end" points to the first address
137 * behind the handled addresses. This function can be called multiple times for
138 * a single hpsb_highlevel to implement sparse register sets. The requested
139 * region must not overlap any previously allocated region, otherwise
140 * registering will fail.
141 *
142 * It returns true for successful allocation. Address spaces can be
143 * unregistered with hpsb_unregister_addrspace. All remaining address spaces
144 * are automatically deallocated together with the hpsb_highlevel.
145 */
146u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, 119u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
147 struct hpsb_host *host, 120 struct hpsb_host *host,
148 struct hpsb_address_ops *ops, 121 struct hpsb_address_ops *ops,
@@ -152,35 +125,18 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
152 struct hpsb_address_ops *ops, u64 start, u64 end); 125 struct hpsb_address_ops *ops, u64 start, u64 end);
153int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, 126int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
154 u64 start); 127 u64 start);
155
156/*
157 * Enable or disable receving a certain isochronous channel through the
158 * iso_receive op.
159 */
160int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 128int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
161 unsigned int channel); 129 unsigned int channel);
162void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 130void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
163 unsigned int channel); 131 unsigned int channel);
164 132
165/* Retrieve a hostinfo pointer bound to this driver/host */
166void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); 133void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host);
167
168/* Allocate a hostinfo pointer of data_size bound to this driver/host */
169void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, 134void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
170 size_t data_size); 135 size_t data_size);
171
172/* Free and remove the hostinfo pointer bound to this driver/host */
173void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); 136void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host);
174
175/* Set an alternate lookup key for the hostinfo bound to this driver/host */
176void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, 137void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host,
177 unsigned long key); 138 unsigned long key);
178
179/* Retrieve a hostinfo pointer bound to this driver using its alternate key */
180void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key); 139void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key);
181
182/* Set the hostinfo pointer to something useful. Usually follows a call to
183 * hpsb_create_hostinfo, where the size is 0. */
184int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, 140int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
185 void *data); 141 void *data);
186 142
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index 32a130921938..615ba6208013 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -218,6 +218,14 @@ void hpsb_remove_host(struct hpsb_host *host)
218 device_unregister(&host->device); 218 device_unregister(&host->device);
219} 219}
220 220
221/**
222 * hpsb_update_config_rom_image - updates configuration ROM image of a host
223 *
224 * Updates the configuration ROM image of a host. rom_version must be the
225 * current version, otherwise it will fail with return value -1. If this
226 * host does not support config-rom-update, it will return -%EINVAL.
227 * Return value 0 indicates success.
228 */
221int hpsb_update_config_rom_image(struct hpsb_host *host) 229int hpsb_update_config_rom_image(struct hpsb_host *host)
222{ 230{
223 unsigned long reset_delay; 231 unsigned long reset_delay;
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
index 4bf4fb7f67b7..6b4e22507966 100644
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@ -202,12 +202,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
202int hpsb_add_host(struct hpsb_host *host); 202int hpsb_add_host(struct hpsb_host *host);
203void hpsb_resume_host(struct hpsb_host *host); 203void hpsb_resume_host(struct hpsb_host *host);
204void hpsb_remove_host(struct hpsb_host *host); 204void hpsb_remove_host(struct hpsb_host *host);
205
206/* Updates the configuration rom image of a host. rom_version must be the
207 * current version, otherwise it will fail with return value -1. If this
208 * host does not support config-rom-update, it will return -EINVAL.
209 * Return value 0 indicates success.
210 */
211int hpsb_update_config_rom_image(struct hpsb_host *host); 205int hpsb_update_config_rom_image(struct hpsb_host *host);
212 206
213#endif /* _IEEE1394_HOSTS_H */ 207#endif /* _IEEE1394_HOSTS_H */
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index d791d08c743c..857e46c6e386 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -96,13 +96,13 @@ static void queue_packet_complete(struct hpsb_packet *packet);
96 96
97 97
98/** 98/**
99 * hpsb_set_packet_complete_task - set the task that runs when a packet 99 * hpsb_set_packet_complete_task - set task that runs when a packet completes
100 * completes. You cannot call this more than once on a single packet
101 * before it is sent.
102 *
103 * @packet: the packet whose completion we want the task added to 100 * @packet: the packet whose completion we want the task added to
104 * @routine: function to call 101 * @routine: function to call
105 * @data: data (if any) to pass to the above function 102 * @data: data (if any) to pass to the above function
103 *
104 * Set the task that runs when a packet completes. You cannot call this more
105 * than once on a single packet before it is sent.
106 */ 106 */
107void hpsb_set_packet_complete_task(struct hpsb_packet *packet, 107void hpsb_set_packet_complete_task(struct hpsb_packet *packet,
108 void (*routine)(void *), void *data) 108 void (*routine)(void *), void *data)
@@ -179,6 +179,13 @@ void hpsb_free_packet(struct hpsb_packet *packet)
179} 179}
180 180
181 181
182/**
183 * hpsb_reset_bus - initiate bus reset on the given host
184 * @host: host controller whose bus to reset
185 * @type: one of enum reset_types
186 *
187 * Returns 1 if bus reset already in progress, 0 otherwise.
188 */
182int hpsb_reset_bus(struct hpsb_host *host, int type) 189int hpsb_reset_bus(struct hpsb_host *host, int type)
183{ 190{
184 if (!host->in_bus_reset) { 191 if (!host->in_bus_reset) {
@@ -229,6 +236,14 @@ int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer,
229 return 0; 236 return 0;
230} 237}
231 238
239/**
240 * hpsb_bus_reset - notify a bus reset to the core
241 *
242 * For host driver module usage. Safe to use in interrupt context, although
243 * quite complex; so you may want to run it in the bottom rather than top half.
244 *
245 * Returns 1 if bus reset already in progress, 0 otherwise.
246 */
232int hpsb_bus_reset(struct hpsb_host *host) 247int hpsb_bus_reset(struct hpsb_host *host)
233{ 248{
234 if (host->in_bus_reset) { 249 if (host->in_bus_reset) {
@@ -405,6 +420,14 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
405} 420}
406 421
407 422
423/**
424 * hpsb_selfid_received - hand over received selfid packet to the core
425 *
426 * For host driver module usage. Safe to use in interrupt context.
427 *
428 * The host driver should have done a successful complement check (second
429 * quadlet is complement of first) beforehand.
430 */
408void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid) 431void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid)
409{ 432{
410 if (host->in_bus_reset) { 433 if (host->in_bus_reset) {
@@ -416,6 +439,15 @@ void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid)
416 } 439 }
417} 440}
418 441
442/**
443 * hpsb_selfid_complete - notify completion of SelfID stage to the core
444 *
445 * For host driver module usage. Safe to use in interrupt context, although
446 * quite complex; so you may want to run it in the bottom rather than top half.
447 *
448 * Notify completion of SelfID stage to the core and report new physical ID
449 * and whether host is root now.
450 */
419void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot) 451void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
420{ 452{
421 if (!host->in_bus_reset) 453 if (!host->in_bus_reset)
@@ -462,7 +494,16 @@ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
462 highlevel_host_reset(host); 494 highlevel_host_reset(host);
463} 495}
464 496
465 497/**
498 * hpsb_packet_sent - notify core of sending a packet
499 *
500 * For host driver module usage. Safe to call from within a transmit packet
501 * routine.
502 *
503 * Notify core of sending a packet. Ackcode is the ack code returned for async
504 * transmits or ACKX_SEND_ERROR if the transmission failed completely; ACKX_NONE
505 * for other cases (internal errors that don't justify a panic).
506 */
466void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, 507void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
467 int ackcode) 508 int ackcode)
468{ 509{
@@ -504,9 +545,10 @@ void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
504 * @rootid: root whose force_root bit should get set (-1 = don't set force_root) 545 * @rootid: root whose force_root bit should get set (-1 = don't set force_root)
505 * @gapcnt: gap count value to set (-1 = don't set gap count) 546 * @gapcnt: gap count value to set (-1 = don't set gap count)
506 * 547 *
507 * This function sends a PHY config packet on the bus through the specified host. 548 * This function sends a PHY config packet on the bus through the specified
549 * host.
508 * 550 *
509 * Return value: 0 for success or error number otherwise. 551 * Return value: 0 for success or negative error number otherwise.
510 */ 552 */
511int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt) 553int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt)
512{ 554{
@@ -621,6 +663,12 @@ static void complete_packet(void *data)
621 complete((struct completion *) data); 663 complete((struct completion *) data);
622} 664}
623 665
666/**
667 * hpsb_send_packet_and_wait - enqueue packet, block until transaction completes
668 * @packet: packet to send
669 *
670 * Return value: 0 on success, negative errno on failure.
671 */
624int hpsb_send_packet_and_wait(struct hpsb_packet *packet) 672int hpsb_send_packet_and_wait(struct hpsb_packet *packet)
625{ 673{
626 struct completion done; 674 struct completion done;
@@ -935,7 +983,20 @@ static void handle_incoming_packet(struct hpsb_host *host, int tcode,
935} 983}
936#undef PREP_REPLY_PACKET 984#undef PREP_REPLY_PACKET
937 985
938 986/**
987 * hpsb_packet_received - hand over received packet to the core
988 *
989 * For host driver module usage.
990 *
991 * The contents of data are expected to be the full packet but with the CRCs
992 * left out (data block follows header immediately), with the header (i.e. the
993 * first four quadlets) in machine byte order and the data block in big endian.
994 * *@data can be safely overwritten after this call.
995 *
996 * If the packet is a write request, @write_acked is to be set to true if it was
997 * ack_complete'd already, false otherwise. This argument is ignored for any
998 * other packet type.
999 */
939void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, 1000void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
940 int write_acked) 1001 int write_acked)
941{ 1002{
diff --git a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
index bd29d8ef5bbd..11b46d2db577 100644
--- a/drivers/ieee1394/ieee1394_core.h
+++ b/drivers/ieee1394/ieee1394_core.h
@@ -80,103 +80,42 @@ struct hpsb_packet {
80 quadlet_t embedded_header[5]; 80 quadlet_t embedded_header[5];
81}; 81};
82 82
83/* Set a task for when a packet completes */
84void hpsb_set_packet_complete_task(struct hpsb_packet *packet, 83void hpsb_set_packet_complete_task(struct hpsb_packet *packet,
85 void (*routine)(void *), void *data); 84 void (*routine)(void *), void *data);
86
87static inline struct hpsb_packet *driver_packet(struct list_head *l) 85static inline struct hpsb_packet *driver_packet(struct list_head *l)
88{ 86{
89 return list_entry(l, struct hpsb_packet, driver_list); 87 return list_entry(l, struct hpsb_packet, driver_list);
90} 88}
91
92void abort_timedouts(unsigned long __opaque); 89void abort_timedouts(unsigned long __opaque);
93
94struct hpsb_packet *hpsb_alloc_packet(size_t data_size); 90struct hpsb_packet *hpsb_alloc_packet(size_t data_size);
95void hpsb_free_packet(struct hpsb_packet *packet); 91void hpsb_free_packet(struct hpsb_packet *packet);
96 92
97/* 93/**
98 * Generation counter for the complete 1394 subsystem. Generation gets 94 * get_hpsb_generation - generation counter for the complete 1394 subsystem
99 * incremented on every change in the subsystem (e.g. bus reset).
100 * 95 *
101 * Use the functions, not the variable. 96 * Generation gets incremented on every change in the subsystem (notably on bus
97 * resets). Use the functions, not the variable.
102 */ 98 */
103static inline unsigned int get_hpsb_generation(struct hpsb_host *host) 99static inline unsigned int get_hpsb_generation(struct hpsb_host *host)
104{ 100{
105 return atomic_read(&host->generation); 101 return atomic_read(&host->generation);
106} 102}
107 103
108/*
109 * Send a PHY configuration packet, return 0 on success, negative
110 * errno on failure.
111 */
112int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt); 104int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt);
113
114/*
115 * Queue packet for transmitting, return 0 on success, negative errno
116 * on failure.
117 */
118int hpsb_send_packet(struct hpsb_packet *packet); 105int hpsb_send_packet(struct hpsb_packet *packet);
119
120/*
121 * Queue packet for transmitting, and block until the transaction
122 * completes. Return 0 on success, negative errno on failure.
123 */
124int hpsb_send_packet_and_wait(struct hpsb_packet *packet); 106int hpsb_send_packet_and_wait(struct hpsb_packet *packet);
125
126/* Initiate bus reset on the given host. Returns 1 if bus reset already in
127 * progress, 0 otherwise. */
128int hpsb_reset_bus(struct hpsb_host *host, int type); 107int hpsb_reset_bus(struct hpsb_host *host, int type);
129
130int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer, 108int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer,
131 u64 *local_time); 109 u64 *local_time);
132 110
133/*
134 * The following functions are exported for host driver module usage. All of
135 * them are safe to use in interrupt contexts, although some are quite
136 * complicated so you may want to run them in bottom halves instead of calling
137 * them directly.
138 */
139
140/* Notify a bus reset to the core. Returns 1 if bus reset already in progress,
141 * 0 otherwise. */
142int hpsb_bus_reset(struct hpsb_host *host); 111int hpsb_bus_reset(struct hpsb_host *host);
143
144/*
145 * Hand over received selfid packet to the core. Complement check (second
146 * quadlet is complement of first) is expected to be done and successful.
147 */
148void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid); 112void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid);
149
150/*
151 * Notify completion of SelfID stage to the core and report new physical ID
152 * and whether host is root now.
153 */
154void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot); 113void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot);
155
156/*
157 * Notify core of sending a packet. Ackcode is the ack code returned for async
158 * transmits or ACKX_SEND_ERROR if the transmission failed completely; ACKX_NONE
159 * for other cases (internal errors that don't justify a panic). Safe to call
160 * from within a transmit packet routine.
161 */
162void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, 114void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
163 int ackcode); 115 int ackcode);
164
165/*
166 * Hand over received packet to the core. The contents of data are expected to
167 * be the full packet but with the CRCs left out (data block follows header
168 * immediately), with the header (i.e. the first four quadlets) in machine byte
169 * order and the data block in big endian. *data can be safely overwritten
170 * after this call.
171 *
172 * If the packet is a write request, write_acked is to be set to true if it was
173 * ack_complete'd already, false otherwise. This arg is ignored for any other
174 * packet type.
175 */
176void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, 116void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
177 int write_acked); 117 int write_acked);
178 118
179
180/* 119/*
181 * CHARACTER DEVICE DISPATCHING 120 * CHARACTER DEVICE DISPATCHING
182 * 121 *
@@ -217,7 +156,9 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
217#define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, \ 156#define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, \
218 IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16) 157 IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16)
219 158
220/* return the index (within a minor number block) of a file */ 159/**
160 * ieee1394_file_to_instance - get the index within a minor number block
161 */
221static inline unsigned char ieee1394_file_to_instance(struct file *file) 162static inline unsigned char ieee1394_file_to_instance(struct file *file)
222{ 163{
223 return file->f_path.dentry->d_inode->i_cindex; 164 return file->f_path.dentry->d_inode->i_cindex;
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c
index 0833fc9f50c4..6f07cd8835a3 100644
--- a/drivers/ieee1394/ieee1394_transactions.c
+++ b/drivers/ieee1394/ieee1394_transactions.c
@@ -212,6 +212,15 @@ void hpsb_free_tlabel(struct hpsb_packet *packet)
212 wake_up_interruptible(&tlabel_wq); 212 wake_up_interruptible(&tlabel_wq);
213} 213}
214 214
215/**
216 * hpsb_packet_success - Make sense of the ack and reply codes
217 *
218 * Make sense of the ack and reply codes and return more convenient error codes:
219 * 0 = success. -%EBUSY = node is busy, try again. -%EAGAIN = error which can
220 * probably resolved by retry. -%EREMOTEIO = node suffers from an internal
221 * error. -%EACCES = this transaction is not allowed on requested address.
222 * -%EINVAL = invalid address at node.
223 */
215int hpsb_packet_success(struct hpsb_packet *packet) 224int hpsb_packet_success(struct hpsb_packet *packet)
216{ 225{
217 switch (packet->ack_code) { 226 switch (packet->ack_code) {
@@ -493,6 +502,16 @@ struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host,
493 * avoid in kernel buffers for user space callers 502 * avoid in kernel buffers for user space callers
494 */ 503 */
495 504
505/**
506 * hpsb_read - generic read function
507 *
508 * Recognizes the local node ID and act accordingly. Automatically uses a
509 * quadlet read request if @length == 4 and and a block read request otherwise.
510 * It does not yet support lengths that are not a multiple of 4.
511 *
512 * You must explicitly specifiy the @generation for which the node ID is valid,
513 * to avoid sending packets to the wrong nodes when we race with a bus reset.
514 */
496int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation, 515int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
497 u64 addr, quadlet_t * buffer, size_t length) 516 u64 addr, quadlet_t * buffer, size_t length)
498{ 517{
@@ -532,6 +551,16 @@ int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
532 return retval; 551 return retval;
533} 552}
534 553
554/**
555 * hpsb_write - generic write function
556 *
557 * Recognizes the local node ID and act accordingly. Automatically uses a
558 * quadlet write request if @length == 4 and and a block write request
559 * otherwise. It does not yet support lengths that are not a multiple of 4.
560 *
561 * You must explicitly specifiy the @generation for which the node ID is valid,
562 * to avoid sending packets to the wrong nodes when we race with a bus reset.
563 */
535int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, 564int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
536 u64 addr, quadlet_t * buffer, size_t length) 565 u64 addr, quadlet_t * buffer, size_t length)
537{ 566{
diff --git a/drivers/ieee1394/ieee1394_transactions.h b/drivers/ieee1394/ieee1394_transactions.h
index c1369c41469b..86b8ee692ea7 100644
--- a/drivers/ieee1394/ieee1394_transactions.h
+++ b/drivers/ieee1394/ieee1394_transactions.h
@@ -27,27 +27,7 @@ struct hpsb_packet *hpsb_make_writepacket(struct hpsb_host *host,
27struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, 27struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer,
28 int length, int channel, int tag, 28 int length, int channel, int tag,
29 int sync); 29 int sync);
30
31/*
32 * hpsb_packet_success - Make sense of the ack and reply codes and
33 * return more convenient error codes:
34 * 0 success
35 * -EBUSY node is busy, try again
36 * -EAGAIN error which can probably resolved by retry
37 * -EREMOTEIO node suffers from an internal error
38 * -EACCES this transaction is not allowed on requested address
39 * -EINVAL invalid address at node
40 */
41int hpsb_packet_success(struct hpsb_packet *packet); 30int hpsb_packet_success(struct hpsb_packet *packet);
42
43/*
44 * The generic read and write functions. All recognize the local node ID
45 * and act accordingly. Read and write automatically use quadlet commands if
46 * length == 4 and and block commands otherwise (however, they do not yet
47 * support lengths that are not a multiple of 4). You must explicitly specifiy
48 * the generation for which the node ID is valid, to avoid sending packets to
49 * the wrong nodes when we race with a bus reset.
50 */
51int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation, 31int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
52 u64 addr, quadlet_t *buffer, size_t length); 32 u64 addr, quadlet_t *buffer, size_t length);
53int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, 33int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
diff --git a/drivers/ieee1394/iso.c b/drivers/ieee1394/iso.c
index c6227e51136d..f223f347d180 100644
--- a/drivers/ieee1394/iso.c
+++ b/drivers/ieee1394/iso.c
@@ -15,6 +15,9 @@
15#include "hosts.h" 15#include "hosts.h"
16#include "iso.h" 16#include "iso.h"
17 17
18/**
19 * hpsb_iso_stop - stop DMA
20 */
18void hpsb_iso_stop(struct hpsb_iso *iso) 21void hpsb_iso_stop(struct hpsb_iso *iso)
19{ 22{
20 if (!(iso->flags & HPSB_ISO_DRIVER_STARTED)) 23 if (!(iso->flags & HPSB_ISO_DRIVER_STARTED))
@@ -25,6 +28,9 @@ void hpsb_iso_stop(struct hpsb_iso *iso)
25 iso->flags &= ~HPSB_ISO_DRIVER_STARTED; 28 iso->flags &= ~HPSB_ISO_DRIVER_STARTED;
26} 29}
27 30
31/**
32 * hpsb_iso_shutdown - deallocate buffer and DMA context
33 */
28void hpsb_iso_shutdown(struct hpsb_iso *iso) 34void hpsb_iso_shutdown(struct hpsb_iso *iso)
29{ 35{
30 if (iso->flags & HPSB_ISO_DRIVER_INIT) { 36 if (iso->flags & HPSB_ISO_DRIVER_INIT) {
@@ -130,6 +136,9 @@ static struct hpsb_iso *hpsb_iso_common_init(struct hpsb_host *host,
130 return NULL; 136 return NULL;
131} 137}
132 138
139/**
140 * hpsb_iso_n_ready - returns number of packets ready to send or receive
141 */
133int hpsb_iso_n_ready(struct hpsb_iso *iso) 142int hpsb_iso_n_ready(struct hpsb_iso *iso)
134{ 143{
135 unsigned long flags; 144 unsigned long flags;
@@ -142,6 +151,9 @@ int hpsb_iso_n_ready(struct hpsb_iso *iso)
142 return val; 151 return val;
143} 152}
144 153
154/**
155 * hpsb_iso_xmit_init - allocate the buffer and DMA context
156 */
145struct hpsb_iso *hpsb_iso_xmit_init(struct hpsb_host *host, 157struct hpsb_iso *hpsb_iso_xmit_init(struct hpsb_host *host,
146 unsigned int data_buf_size, 158 unsigned int data_buf_size,
147 unsigned int buf_packets, 159 unsigned int buf_packets,
@@ -172,6 +184,11 @@ struct hpsb_iso *hpsb_iso_xmit_init(struct hpsb_host *host,
172 return NULL; 184 return NULL;
173} 185}
174 186
187/**
188 * hpsb_iso_recv_init - allocate the buffer and DMA context
189 *
190 * Note, if channel = -1, multi-channel receive is enabled.
191 */
175struct hpsb_iso *hpsb_iso_recv_init(struct hpsb_host *host, 192struct hpsb_iso *hpsb_iso_recv_init(struct hpsb_host *host,
176 unsigned int data_buf_size, 193 unsigned int data_buf_size,
177 unsigned int buf_packets, 194 unsigned int buf_packets,
@@ -199,6 +216,11 @@ struct hpsb_iso *hpsb_iso_recv_init(struct hpsb_host *host,
199 return NULL; 216 return NULL;
200} 217}
201 218
219/**
220 * hpsb_iso_recv_listen_channel
221 *
222 * multi-channel only
223 */
202int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel) 224int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel)
203{ 225{
204 if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64) 226 if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
@@ -206,6 +228,11 @@ int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel)
206 return iso->host->driver->isoctl(iso, RECV_LISTEN_CHANNEL, channel); 228 return iso->host->driver->isoctl(iso, RECV_LISTEN_CHANNEL, channel);
207} 229}
208 230
231/**
232 * hpsb_iso_recv_unlisten_channel
233 *
234 * multi-channel only
235 */
209int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel) 236int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel)
210{ 237{
211 if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64) 238 if (iso->type != HPSB_ISO_RECV || iso->channel != -1 || channel >= 64)
@@ -213,6 +240,11 @@ int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel)
213 return iso->host->driver->isoctl(iso, RECV_UNLISTEN_CHANNEL, channel); 240 return iso->host->driver->isoctl(iso, RECV_UNLISTEN_CHANNEL, channel);
214} 241}
215 242
243/**
244 * hpsb_iso_recv_set_channel_mask
245 *
246 * multi-channel only
247 */
216int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask) 248int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask)
217{ 249{
218 if (iso->type != HPSB_ISO_RECV || iso->channel != -1) 250 if (iso->type != HPSB_ISO_RECV || iso->channel != -1)
@@ -221,6 +253,12 @@ int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask)
221 (unsigned long)&mask); 253 (unsigned long)&mask);
222} 254}
223 255
256/**
257 * hpsb_iso_recv_flush - check for arrival of new packets
258 *
259 * check for arrival of new packets immediately (even if irq_interval
260 * has not yet been reached)
261 */
224int hpsb_iso_recv_flush(struct hpsb_iso *iso) 262int hpsb_iso_recv_flush(struct hpsb_iso *iso)
225{ 263{
226 if (iso->type != HPSB_ISO_RECV) 264 if (iso->type != HPSB_ISO_RECV)
@@ -238,6 +276,9 @@ static int do_iso_xmit_start(struct hpsb_iso *iso, int cycle)
238 return retval; 276 return retval;
239} 277}
240 278
279/**
280 * hpsb_iso_xmit_start - start DMA
281 */
241int hpsb_iso_xmit_start(struct hpsb_iso *iso, int cycle, int prebuffer) 282int hpsb_iso_xmit_start(struct hpsb_iso *iso, int cycle, int prebuffer)
242{ 283{
243 if (iso->type != HPSB_ISO_XMIT) 284 if (iso->type != HPSB_ISO_XMIT)
@@ -270,6 +311,9 @@ int hpsb_iso_xmit_start(struct hpsb_iso *iso, int cycle, int prebuffer)
270 return 0; 311 return 0;
271} 312}
272 313
314/**
315 * hpsb_iso_recv_start - start DMA
316 */
273int hpsb_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask, int sync) 317int hpsb_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask, int sync)
274{ 318{
275 int retval = 0; 319 int retval = 0;
@@ -306,8 +350,7 @@ int hpsb_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask, int sync)
306} 350}
307 351
308/* check to make sure the user has not supplied bogus values of offset/len 352/* check to make sure the user has not supplied bogus values of offset/len
309 that would cause the kernel to access memory outside the buffer */ 353 * that would cause the kernel to access memory outside the buffer */
310
311static int hpsb_iso_check_offset_len(struct hpsb_iso *iso, 354static int hpsb_iso_check_offset_len(struct hpsb_iso *iso,
312 unsigned int offset, unsigned short len, 355 unsigned int offset, unsigned short len,
313 unsigned int *out_offset, 356 unsigned int *out_offset,
@@ -331,6 +374,12 @@ static int hpsb_iso_check_offset_len(struct hpsb_iso *iso,
331 return 0; 374 return 0;
332} 375}
333 376
377/**
378 * hpsb_iso_xmit_queue_packet - queue a packet for transmission.
379 *
380 * @offset is relative to the beginning of the DMA buffer, where the packet's
381 * data payload should already have been placed.
382 */
334int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, 383int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len,
335 u8 tag, u8 sy) 384 u8 tag, u8 sy)
336{ 385{
@@ -380,6 +429,9 @@ int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len,
380 return rv; 429 return rv;
381} 430}
382 431
432/**
433 * hpsb_iso_xmit_sync - wait until all queued packets have been transmitted
434 */
383int hpsb_iso_xmit_sync(struct hpsb_iso *iso) 435int hpsb_iso_xmit_sync(struct hpsb_iso *iso)
384{ 436{
385 if (iso->type != HPSB_ISO_XMIT) 437 if (iso->type != HPSB_ISO_XMIT)
@@ -390,6 +442,15 @@ int hpsb_iso_xmit_sync(struct hpsb_iso *iso)
390 iso->buf_packets); 442 iso->buf_packets);
391} 443}
392 444
445/**
446 * hpsb_iso_packet_sent
447 *
448 * Available to low-level drivers.
449 *
450 * Call after a packet has been transmitted to the bus (interrupt context is
451 * OK). @cycle is the _exact_ cycle the packet was sent on. @error should be
452 * non-zero if some sort of error occurred when sending the packet.
453 */
393void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error) 454void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error)
394{ 455{
395 unsigned long flags; 456 unsigned long flags;
@@ -413,6 +474,13 @@ void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error)
413 spin_unlock_irqrestore(&iso->lock, flags); 474 spin_unlock_irqrestore(&iso->lock, flags);
414} 475}
415 476
477/**
478 * hpsb_iso_packet_received
479 *
480 * Available to low-level drivers.
481 *
482 * Call after a packet has been received (interrupt context is OK).
483 */
416void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, 484void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len,
417 u16 total_len, u16 cycle, u8 channel, u8 tag, 485 u16 total_len, u16 cycle, u8 channel, u8 tag,
418 u8 sy) 486 u8 sy)
@@ -442,6 +510,11 @@ void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len,
442 spin_unlock_irqrestore(&iso->lock, flags); 510 spin_unlock_irqrestore(&iso->lock, flags);
443} 511}
444 512
513/**
514 * hpsb_iso_recv_release_packets - release packets, reuse buffer
515 *
516 * @n_packets have been read out of the buffer, re-use the buffer space
517 */
445int hpsb_iso_recv_release_packets(struct hpsb_iso *iso, unsigned int n_packets) 518int hpsb_iso_recv_release_packets(struct hpsb_iso *iso, unsigned int n_packets)
446{ 519{
447 unsigned long flags; 520 unsigned long flags;
@@ -477,6 +550,13 @@ int hpsb_iso_recv_release_packets(struct hpsb_iso *iso, unsigned int n_packets)
477 return rv; 550 return rv;
478} 551}
479 552
553/**
554 * hpsb_iso_wake
555 *
556 * Available to low-level drivers.
557 *
558 * Call to wake waiting processes after buffer space has opened up.
559 */
480void hpsb_iso_wake(struct hpsb_iso *iso) 560void hpsb_iso_wake(struct hpsb_iso *iso)
481{ 561{
482 wake_up_interruptible(&iso->waitq); 562 wake_up_interruptible(&iso->waitq);
diff --git a/drivers/ieee1394/iso.h b/drivers/ieee1394/iso.h
index 1210a97e8685..b94e55e6eaa5 100644
--- a/drivers/ieee1394/iso.h
+++ b/drivers/ieee1394/iso.h
@@ -150,8 +150,6 @@ struct hpsb_iso {
150 150
151/* functions available to high-level drivers (e.g. raw1394) */ 151/* functions available to high-level drivers (e.g. raw1394) */
152 152
153/* allocate the buffer and DMA context */
154
155struct hpsb_iso* hpsb_iso_xmit_init(struct hpsb_host *host, 153struct hpsb_iso* hpsb_iso_xmit_init(struct hpsb_host *host,
156 unsigned int data_buf_size, 154 unsigned int data_buf_size,
157 unsigned int buf_packets, 155 unsigned int buf_packets,
@@ -159,8 +157,6 @@ struct hpsb_iso* hpsb_iso_xmit_init(struct hpsb_host *host,
159 int speed, 157 int speed,
160 int irq_interval, 158 int irq_interval,
161 void (*callback)(struct hpsb_iso*)); 159 void (*callback)(struct hpsb_iso*));
162
163/* note: if channel = -1, multi-channel receive is enabled */
164struct hpsb_iso* hpsb_iso_recv_init(struct hpsb_host *host, 160struct hpsb_iso* hpsb_iso_recv_init(struct hpsb_host *host,
165 unsigned int data_buf_size, 161 unsigned int data_buf_size,
166 unsigned int buf_packets, 162 unsigned int buf_packets,
@@ -168,56 +164,29 @@ struct hpsb_iso* hpsb_iso_recv_init(struct hpsb_host *host,
168 int dma_mode, 164 int dma_mode,
169 int irq_interval, 165 int irq_interval,
170 void (*callback)(struct hpsb_iso*)); 166 void (*callback)(struct hpsb_iso*));
171
172/* multi-channel only */
173int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel); 167int hpsb_iso_recv_listen_channel(struct hpsb_iso *iso, unsigned char channel);
174int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel); 168int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel);
175int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask); 169int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask);
176
177/* start/stop DMA */
178int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, 170int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle,
179 int prebuffer); 171 int prebuffer);
180int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, 172int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle,
181 int tag_mask, int sync); 173 int tag_mask, int sync);
182void hpsb_iso_stop(struct hpsb_iso *iso); 174void hpsb_iso_stop(struct hpsb_iso *iso);
183
184/* deallocate buffer and DMA context */
185void hpsb_iso_shutdown(struct hpsb_iso *iso); 175void hpsb_iso_shutdown(struct hpsb_iso *iso);
186
187/* queue a packet for transmission.
188 * 'offset' is relative to the beginning of the DMA buffer, where the packet's
189 * data payload should already have been placed. */
190int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, 176int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len,
191 u8 tag, u8 sy); 177 u8 tag, u8 sy);
192
193/* wait until all queued packets have been transmitted to the bus */
194int hpsb_iso_xmit_sync(struct hpsb_iso *iso); 178int hpsb_iso_xmit_sync(struct hpsb_iso *iso);
195 179int hpsb_iso_recv_release_packets(struct hpsb_iso *recv,
196/* N packets have been read out of the buffer, re-use the buffer space */ 180 unsigned int n_packets);
197int hpsb_iso_recv_release_packets(struct hpsb_iso *recv,
198 unsigned int n_packets);
199
200/* check for arrival of new packets immediately (even if irq_interval
201 * has not yet been reached) */
202int hpsb_iso_recv_flush(struct hpsb_iso *iso); 181int hpsb_iso_recv_flush(struct hpsb_iso *iso);
203
204/* returns # of packets ready to send or receive */
205int hpsb_iso_n_ready(struct hpsb_iso *iso); 182int hpsb_iso_n_ready(struct hpsb_iso *iso);
206 183
207/* the following are callbacks available to low-level drivers */ 184/* the following are callbacks available to low-level drivers */
208 185
209/* call after a packet has been transmitted to the bus (interrupt context is OK)
210 * 'cycle' is the _exact_ cycle the packet was sent on
211 * 'error' should be non-zero if some sort of error occurred when sending the
212 * packet */
213void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error); 186void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error);
214
215/* call after a packet has been received (interrupt context OK) */
216void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, 187void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len,
217 u16 total_len, u16 cycle, u8 channel, u8 tag, 188 u16 total_len, u16 cycle, u8 channel, u8 tag,
218 u8 sy); 189 u8 sy);
219
220/* call to wake waiting processes after buffer space has opened up. */
221void hpsb_iso_wake(struct hpsb_iso *iso); 190void hpsb_iso_wake(struct hpsb_iso *iso);
222 191
223#endif /* IEEE1394_ISO_H */ 192#endif /* IEEE1394_ISO_H */
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 874d4d47a19c..629a9d88a0da 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1738,7 +1738,19 @@ exit:
1738 return 0; 1738 return 0;
1739} 1739}
1740 1740
1741int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *)) 1741/**
1742 * nodemgr_for_each_host - call a function for each IEEE 1394 host
1743 * @data: an address to supply to the callback
1744 * @cb: function to call for each host
1745 *
1746 * Iterate the hosts, calling a given function with supplied data for each host.
1747 * If the callback fails on a host, i.e. if it returns a non-zero value, the
1748 * iteration is stopped.
1749 *
1750 * Return value: 0 on success, non-zero on failure (same as returned by last run
1751 * of the callback).
1752 */
1753int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *))
1742{ 1754{
1743 struct class_device *cdev; 1755 struct class_device *cdev;
1744 struct hpsb_host *host; 1756 struct hpsb_host *host;
@@ -1748,7 +1760,7 @@ int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *))
1748 list_for_each_entry(cdev, &hpsb_host_class.children, node) { 1760 list_for_each_entry(cdev, &hpsb_host_class.children, node) {
1749 host = container_of(cdev, struct hpsb_host, class_dev); 1761 host = container_of(cdev, struct hpsb_host, class_dev);
1750 1762
1751 if ((error = cb(host, __data))) 1763 if ((error = cb(host, data)))
1752 break; 1764 break;
1753 } 1765 }
1754 up(&hpsb_host_class.sem); 1766 up(&hpsb_host_class.sem);
@@ -1771,12 +1783,20 @@ int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *))
1771 * ID's. 1783 * ID's.
1772 */ 1784 */
1773 1785
1774void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *pkt) 1786/**
1787 * hpsb_node_fill_packet - fill some destination information into a packet
1788 * @ne: destination node
1789 * @packet: packet to fill in
1790 *
1791 * This will fill in the given, pre-initialised hpsb_packet with the current
1792 * information from the node entry (host, node ID, bus generation number).
1793 */
1794void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet)
1775{ 1795{
1776 pkt->host = ne->host; 1796 packet->host = ne->host;
1777 pkt->generation = ne->generation; 1797 packet->generation = ne->generation;
1778 barrier(); 1798 barrier();
1779 pkt->node_id = ne->nodeid; 1799 packet->node_id = ne->nodeid;
1780} 1800}
1781 1801
1782int hpsb_node_write(struct node_entry *ne, u64 addr, 1802int hpsb_node_write(struct node_entry *ne, u64 addr,
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index a31405ff6eeb..e7ac683c72c7 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -153,26 +153,10 @@ static inline int hpsb_node_entry_valid(struct node_entry *ne)
153{ 153{
154 return ne->generation == get_hpsb_generation(ne->host); 154 return ne->generation == get_hpsb_generation(ne->host);
155} 155}
156 156void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet);
157/*
158 * This will fill in the given, pre-initialised hpsb_packet with the current
159 * information from the node entry (host, node ID, generation number). It will
160 * return false if the node owning the GUID is not accessible (and not modify
161 * the hpsb_packet) and return true otherwise.
162 *
163 * Note that packet sending may still fail in hpsb_send_packet if a bus reset
164 * happens while you are trying to set up the packet (due to obsolete generation
165 * number). It will at least reliably fail so that you don't accidentally and
166 * unknowingly send your packet to the wrong node.
167 */
168void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *pkt);
169
170int hpsb_node_write(struct node_entry *ne, u64 addr, 157int hpsb_node_write(struct node_entry *ne, u64 addr,
171 quadlet_t *buffer, size_t length); 158 quadlet_t *buffer, size_t length);
172 159int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *));
173/* Iterate the hosts, calling a given function with supplied data for each
174 * host. */
175int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *));
176 160
177int init_ieee1394_nodemgr(void); 161int init_ieee1394_nodemgr(void);
178void cleanup_ieee1394_nodemgr(void); 162void cleanup_ieee1394_nodemgr(void);
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 06fac0d21264..6833b9801b87 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -3658,6 +3658,7 @@ static struct pci_driver ohci1394_pci_driver = {
3658/* essentially the only purpose of this code is to allow another 3658/* essentially the only purpose of this code is to allow another
3659 module to hook into ohci's interrupt handler */ 3659 module to hook into ohci's interrupt handler */
3660 3660
3661/* returns zero if successful, one if DMA context is locked up */
3661int ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg) 3662int ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg)
3662{ 3663{
3663 int i=0; 3664 int i=0;
diff --git a/drivers/ieee1394/ohci1394.h b/drivers/ieee1394/ohci1394.h
index fa05f113f7f0..f1ad539e7c1b 100644
--- a/drivers/ieee1394/ohci1394.h
+++ b/drivers/ieee1394/ohci1394.h
@@ -461,9 +461,7 @@ int ohci1394_register_iso_tasklet(struct ti_ohci *ohci,
461 struct ohci1394_iso_tasklet *tasklet); 461 struct ohci1394_iso_tasklet *tasklet);
462void ohci1394_unregister_iso_tasklet(struct ti_ohci *ohci, 462void ohci1394_unregister_iso_tasklet(struct ti_ohci *ohci,
463 struct ohci1394_iso_tasklet *tasklet); 463 struct ohci1394_iso_tasklet *tasklet);
464 464int ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg);
465/* returns zero if successful, one if DMA context is locked up */
466int ohci1394_stop_context (struct ti_ohci *ohci, int reg, char *msg);
467struct ti_ohci *ohci1394_get_struct(int card_num); 465struct ti_ohci *ohci1394_get_struct(int card_num);
468 466
469#endif 467#endif