diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-07-03 12:02:28 -0400 |
---|---|---|
committer | Ben Collins <bcollins@ubuntu.com> | 2006-07-03 12:02:28 -0400 |
commit | e1d118f16dca0f54faba3e8dd5b6adbbf7ac68c8 (patch) | |
tree | fffc9d2b1fbe3fe6bb55758e2a6951ad9c581e63 /drivers/ieee1394/iso.h | |
parent | 2b01b80b944b3abf623c8acc2b5537a85b5ebd3c (diff) |
[PATCH] ieee1394: coding style and comment fixes in midlayer header files
Adjust tabulators, line wraps, empty lines, and comment style.
Update comments in ieee1394_transactions.h and highlevel.h.
Fix typo in comment in csr.h.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Diffstat (limited to 'drivers/ieee1394/iso.h')
-rw-r--r-- | drivers/ieee1394/iso.h | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/drivers/ieee1394/iso.h b/drivers/ieee1394/iso.h index 3efc60b33a8..ed639c4c510 100644 --- a/drivers/ieee1394/iso.h +++ b/drivers/ieee1394/iso.h | |||
@@ -17,28 +17,30 @@ | |||
17 | 17 | ||
18 | /* high-level ISO interface */ | 18 | /* high-level ISO interface */ |
19 | 19 | ||
20 | /* This API sends and receives isochronous packets on a large, | 20 | /* |
21 | virtually-contiguous kernel memory buffer. The buffer may be mapped | 21 | * This API sends and receives isochronous packets on a large, |
22 | into a user-space process for zero-copy transmission and reception. | 22 | * virtually-contiguous kernel memory buffer. The buffer may be mapped |
23 | 23 | * into a user-space process for zero-copy transmission and reception. | |
24 | There are no explicit boundaries between packets in the buffer. A | 24 | * |
25 | packet may be transmitted or received at any location. However, | 25 | * There are no explicit boundaries between packets in the buffer. A |
26 | low-level drivers may impose certain restrictions on alignment or | 26 | * packet may be transmitted or received at any location. However, |
27 | size of packets. (e.g. in OHCI no packet may cross a page boundary, | 27 | * low-level drivers may impose certain restrictions on alignment or |
28 | and packets should be quadlet-aligned) | 28 | * size of packets. (e.g. in OHCI no packet may cross a page boundary, |
29 | */ | 29 | * and packets should be quadlet-aligned) |
30 | */ | ||
30 | 31 | ||
31 | /* Packet descriptor - the API maintains a ring buffer of these packet | 32 | /* Packet descriptor - the API maintains a ring buffer of these packet |
32 | descriptors in kernel memory (hpsb_iso.infos[]). */ | 33 | * descriptors in kernel memory (hpsb_iso.infos[]). */ |
33 | |||
34 | struct hpsb_iso_packet_info { | 34 | struct hpsb_iso_packet_info { |
35 | /* offset of data payload relative to the first byte of the buffer */ | 35 | /* offset of data payload relative to the first byte of the buffer */ |
36 | __u32 offset; | 36 | __u32 offset; |
37 | 37 | ||
38 | /* length of the data payload, in bytes (not including the isochronous header) */ | 38 | /* length of the data payload, in bytes (not including the isochronous |
39 | * header) */ | ||
39 | __u16 len; | 40 | __u16 len; |
40 | 41 | ||
41 | /* (recv only) the cycle number (mod 8000) on which the packet was received */ | 42 | /* (recv only) the cycle number (mod 8000) on which the packet was |
43 | * received */ | ||
42 | __u16 cycle; | 44 | __u16 cycle; |
43 | 45 | ||
44 | /* (recv only) channel on which the packet was received */ | 46 | /* (recv only) channel on which the packet was received */ |
@@ -48,12 +50,10 @@ struct hpsb_iso_packet_info { | |||
48 | __u8 tag; | 50 | __u8 tag; |
49 | __u8 sy; | 51 | __u8 sy; |
50 | 52 | ||
51 | /* | 53 | /* length in bytes of the packet including header/trailer. |
52 | * length in bytes of the packet including header/trailer. | 54 | * MUST be at structure end, since the first part of this structure is |
53 | * MUST be at structure end, since the first part of this structure is also | 55 | * also defined in raw1394.h (i.e. struct raw1394_iso_packet_info), is |
54 | * defined in raw1394.h (i.e. struct raw1394_iso_packet_info), is copied to | 56 | * copied to userspace and is accessed there through libraw1394. */ |
55 | * userspace and is accessed there through libraw1394. | ||
56 | */ | ||
57 | __u16 total_len; | 57 | __u16 total_len; |
58 | }; | 58 | }; |
59 | 59 | ||
@@ -75,8 +75,8 @@ struct hpsb_iso { | |||
75 | void *hostdata; | 75 | void *hostdata; |
76 | 76 | ||
77 | /* a function to be called (from interrupt context) after | 77 | /* a function to be called (from interrupt context) after |
78 | outgoing packets have been sent, or incoming packets have | 78 | * outgoing packets have been sent, or incoming packets have |
79 | arrived */ | 79 | * arrived */ |
80 | void (*callback)(struct hpsb_iso*); | 80 | void (*callback)(struct hpsb_iso*); |
81 | 81 | ||
82 | /* wait for buffer space */ | 82 | /* wait for buffer space */ |
@@ -88,7 +88,7 @@ struct hpsb_iso { | |||
88 | 88 | ||
89 | 89 | ||
90 | /* greatest # of packets between interrupts - controls | 90 | /* greatest # of packets between interrupts - controls |
91 | the maximum latency of the buffer */ | 91 | * the maximum latency of the buffer */ |
92 | int irq_interval; | 92 | int irq_interval; |
93 | 93 | ||
94 | /* the buffer for packet data payloads */ | 94 | /* the buffer for packet data payloads */ |
@@ -112,8 +112,8 @@ struct hpsb_iso { | |||
112 | int pkt_dma; | 112 | int pkt_dma; |
113 | 113 | ||
114 | /* how many packets, starting at first_packet: | 114 | /* how many packets, starting at first_packet: |
115 | (transmit) are ready to be filled with data | 115 | * (transmit) are ready to be filled with data |
116 | (receive) contain received data */ | 116 | * (receive) contain received data */ |
117 | int n_ready_packets; | 117 | int n_ready_packets; |
118 | 118 | ||
119 | /* how many times the buffer has overflowed or underflowed */ | 119 | /* how many times the buffer has overflowed or underflowed */ |
@@ -134,7 +134,7 @@ struct hpsb_iso { | |||
134 | int start_cycle; | 134 | int start_cycle; |
135 | 135 | ||
136 | /* cycle at which next packet will be transmitted, | 136 | /* cycle at which next packet will be transmitted, |
137 | -1 if not known */ | 137 | * -1 if not known */ |
138 | int xmit_cycle; | 138 | int xmit_cycle; |
139 | 139 | ||
140 | /* ringbuffer of packet descriptors in regular kernel memory | 140 | /* ringbuffer of packet descriptors in regular kernel memory |
@@ -170,25 +170,30 @@ int hpsb_iso_recv_unlisten_channel(struct hpsb_iso *iso, unsigned char channel); | |||
170 | int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask); | 170 | int hpsb_iso_recv_set_channel_mask(struct hpsb_iso *iso, u64 mask); |
171 | 171 | ||
172 | /* start/stop DMA */ | 172 | /* start/stop DMA */ |
173 | int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, int prebuffer); | 173 | int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, |
174 | int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, int tag_mask, int sync); | 174 | int prebuffer); |
175 | int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, | ||
176 | int tag_mask, int sync); | ||
175 | void hpsb_iso_stop(struct hpsb_iso *iso); | 177 | void hpsb_iso_stop(struct hpsb_iso *iso); |
176 | 178 | ||
177 | /* deallocate buffer and DMA context */ | 179 | /* deallocate buffer and DMA context */ |
178 | void hpsb_iso_shutdown(struct hpsb_iso *iso); | 180 | void hpsb_iso_shutdown(struct hpsb_iso *iso); |
179 | 181 | ||
180 | /* queue a packet for transmission. 'offset' is relative to the beginning of the | 182 | /* queue a packet for transmission. |
181 | DMA buffer, where the packet's data payload should already have been placed */ | 183 | * 'offset' is relative to the beginning of the DMA buffer, where the packet's |
182 | int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, u8 tag, u8 sy); | 184 | * data payload should already have been placed. */ |
185 | int hpsb_iso_xmit_queue_packet(struct hpsb_iso *iso, u32 offset, u16 len, | ||
186 | u8 tag, u8 sy); | ||
183 | 187 | ||
184 | /* wait until all queued packets have been transmitted to the bus */ | 188 | /* wait until all queued packets have been transmitted to the bus */ |
185 | int hpsb_iso_xmit_sync(struct hpsb_iso *iso); | 189 | int hpsb_iso_xmit_sync(struct hpsb_iso *iso); |
186 | 190 | ||
187 | /* N packets have been read out of the buffer, re-use the buffer space */ | 191 | /* N packets have been read out of the buffer, re-use the buffer space */ |
188 | int hpsb_iso_recv_release_packets(struct hpsb_iso *recv, unsigned int n_packets); | 192 | int hpsb_iso_recv_release_packets(struct hpsb_iso *recv, |
193 | unsigned int n_packets); | ||
189 | 194 | ||
190 | /* check for arrival of new packets immediately (even if irq_interval | 195 | /* check for arrival of new packets immediately (even if irq_interval |
191 | has not yet been reached) */ | 196 | * has not yet been reached) */ |
192 | int hpsb_iso_recv_flush(struct hpsb_iso *iso); | 197 | int hpsb_iso_recv_flush(struct hpsb_iso *iso); |
193 | 198 | ||
194 | /* returns # of packets ready to send or receive */ | 199 | /* returns # of packets ready to send or receive */ |
@@ -197,14 +202,15 @@ int hpsb_iso_n_ready(struct hpsb_iso *iso); | |||
197 | /* the following are callbacks available to low-level drivers */ | 202 | /* the following are callbacks available to low-level drivers */ |
198 | 203 | ||
199 | /* call after a packet has been transmitted to the bus (interrupt context is OK) | 204 | /* call after a packet has been transmitted to the bus (interrupt context is OK) |
200 | 'cycle' is the _exact_ cycle the packet was sent on | 205 | * 'cycle' is the _exact_ cycle the packet was sent on |
201 | 'error' should be non-zero if some sort of error occurred when sending the packet | 206 | * 'error' should be non-zero if some sort of error occurred when sending the |
202 | */ | 207 | * packet */ |
203 | void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error); | 208 | void hpsb_iso_packet_sent(struct hpsb_iso *iso, int cycle, int error); |
204 | 209 | ||
205 | /* call after a packet has been received (interrupt context OK) */ | 210 | /* call after a packet has been received (interrupt context OK) */ |
206 | void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, | 211 | void hpsb_iso_packet_received(struct hpsb_iso *iso, u32 offset, u16 len, |
207 | u16 total_len, u16 cycle, u8 channel, u8 tag, u8 sy); | 212 | u16 total_len, u16 cycle, u8 channel, u8 tag, |
213 | u8 sy); | ||
208 | 214 | ||
209 | /* call to wake waiting processes after buffer space has opened up. */ | 215 | /* call to wake waiting processes after buffer space has opened up. */ |
210 | void hpsb_iso_wake(struct hpsb_iso *iso); | 216 | void hpsb_iso_wake(struct hpsb_iso *iso); |