Lines 33-39
Link Here
|
33 |
#include <linux/skbuff.h> |
33 |
#include <linux/skbuff.h> |
34 |
#include <linux/suspend.h> |
34 |
#include <linux/suspend.h> |
35 |
#include <linux/kthread.h> |
35 |
#include <linux/kthread.h> |
|
|
36 |
#include <linux/preempt.h> |
37 |
#include <linux/time.h> |
36 |
|
38 |
|
|
|
39 |
#include <asm/system.h> |
37 |
#include <asm/byteorder.h> |
40 |
#include <asm/byteorder.h> |
38 |
|
41 |
|
39 |
#include "ieee1394_types.h" |
42 |
#include "ieee1394_types.h" |
Lines 186-191
int hpsb_reset_bus(struct hpsb_host *hos
Link Here
|
186 |
} |
189 |
} |
187 |
} |
190 |
} |
188 |
|
191 |
|
|
|
192 |
/** |
193 |
* hpsb_read_cycle_timer - read cycle timer register and system time |
194 |
* @host: host whose isochronous cycle timer register is read |
195 |
* @cycle_timer: address of bitfield to return the register contents |
196 |
* @local_time: address to return the system time |
197 |
* |
198 |
* The format of * @cycle_timer, is described in OHCI 1.1 clause 5.13. This |
199 |
* format is also read from non-OHCI controllers. * @local_time contains the |
200 |
* system time in microseconds since the Epoch, read at the moment when the |
201 |
* cycle timer was read. |
202 |
* |
203 |
* Return value: 0 for success or error number otherwise. |
204 |
*/ |
205 |
int hpsb_read_cycle_timer(struct hpsb_host *host, u32 *cycle_timer, |
206 |
u64 *local_time) |
207 |
{ |
208 |
int ctr; |
209 |
struct timeval tv; |
210 |
unsigned long flags; |
211 |
|
212 |
if (!host || !cycle_timer || !local_time) |
213 |
return -EINVAL; |
214 |
|
215 |
preempt_disable(); |
216 |
local_irq_save(flags); |
217 |
|
218 |
ctr = host->driver->devctl(host, GET_CYCLE_COUNTER, 0); |
219 |
if (ctr) |
220 |
do_gettimeofday(&tv); |
221 |
|
222 |
local_irq_restore(flags); |
223 |
preempt_enable(); |
224 |
|
225 |
if (!ctr) |
226 |
return -EIO; |
227 |
*cycle_timer = ctr; |
228 |
*local_time = tv.tv_sec * 1000000ULL + tv.tv_usec; |
229 |
return 0; |
230 |
} |
189 |
|
231 |
|
190 |
int hpsb_bus_reset(struct hpsb_host *host) |
232 |
int hpsb_bus_reset(struct hpsb_host *host) |
191 |
{ |
233 |
{ |
Lines 1190-1195
EXPORT_SYMBOL(hpsb_alloc_packet);
Link Here
|
1190 |
EXPORT_SYMBOL(hpsb_free_packet); |
1232 |
EXPORT_SYMBOL(hpsb_free_packet); |
1191 |
EXPORT_SYMBOL(hpsb_send_packet); |
1233 |
EXPORT_SYMBOL(hpsb_send_packet); |
1192 |
EXPORT_SYMBOL(hpsb_reset_bus); |
1234 |
EXPORT_SYMBOL(hpsb_reset_bus); |
|
|
1235 |
EXPORT_SYMBOL(hpsb_read_cycle_timer); |
1193 |
EXPORT_SYMBOL(hpsb_bus_reset); |
1236 |
EXPORT_SYMBOL(hpsb_bus_reset); |
1194 |
EXPORT_SYMBOL(hpsb_selfid_received); |
1237 |
EXPORT_SYMBOL(hpsb_selfid_received); |
1195 |
EXPORT_SYMBOL(hpsb_selfid_complete); |
1238 |
EXPORT_SYMBOL(hpsb_selfid_complete); |