2 * The USB Monitor, inspired by Dave Harding's USBMon.
4 * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com)
10 #include <linux/list.h>
11 #include <linux/slab.h>
12 #include <linux/kref.h>
13 /* #include <linux/usb.h> */ /* We use struct pointers only in this header */
18 struct list_head bus_link;
20 struct dentry *dent_s; /* Debugging file */
21 struct dentry *dent_t; /* Text interface file */
22 struct usb_bus *u_bus;
25 int nreaders; /* Under mon_lock AND mbus->lock */
26 struct list_head r_list; /* Chain of readers (usually one) */
27 struct kref ref; /* Under mon_lock */
30 unsigned int cnt_events;
31 unsigned int cnt_text_lost;
35 * An instance of a process which opened a file (but can fork later)
38 struct list_head r_link;
39 struct mon_bus *m_bus;
40 void *r_data; /* Use container_of instead? */
42 void (*rnf_submit)(void *data, struct urb *urb);
43 void (*rnf_error)(void *data, struct urb *urb, int error);
44 void (*rnf_complete)(void *data, struct urb *urb);
47 void mon_reader_add(struct mon_bus *mbus, struct mon_reader *r);
48 void mon_reader_del(struct mon_bus *mbus, struct mon_reader *r);
52 extern char mon_dmapeek(unsigned char *dst, dma_addr_t dma_addr, int len);
54 extern struct mutex mon_lock;
56 extern struct file_operations mon_fops_text;
57 extern struct file_operations mon_fops_stat;
59 #endif /* __USB_MON_H */