| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#ifndef __USB_MON_H |
| 9 |
#define __USB_MON_H |
| 10 |
|
| 11 |
#include <linux/list.h> |
| 12 |
#include <linux/slab.h> |
| 13 |
#include <linux/kref.h> |
| 14 |
|
| 15 |
|
| 16 |
#define TAG "usbmon" |
| 17 |
|
| 18 |
struct mon_bus { |
| 19 |
struct list_head bus_link; |
| 20 |
spinlock_t lock; |
| 21 |
struct usb_bus *u_bus; |
| 22 |
|
| 23 |
int text_inited; |
| 24 |
int bin_inited; |
| 25 |
struct dentry *dent_s; |
| 26 |
struct dentry *dent_t; |
| 27 |
struct dentry *dent_u; |
| 28 |
struct device *classdev; |
| 29 |
|
| 30 |
|
| 31 |
int nreaders; |
| 32 |
struct list_head r_list; |
| 33 |
struct kref ref; |
| 34 |
|
| 35 |
|
| 36 |
unsigned int cnt_events; |
| 37 |
unsigned int cnt_text_lost; |
| 38 |
}; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
struct mon_reader { |
| 44 |
struct list_head r_link; |
| 45 |
struct mon_bus *m_bus; |
| 46 |
void *r_data; |
| 47 |
|
| 48 |
void (*rnf_submit)(void *data, struct urb *urb); |
| 49 |
void (*rnf_error)(void *data, struct urb *urb, int error); |
| 50 |
void (*rnf_complete)(void *data, struct urb *urb, int status); |
| 51 |
}; |
| 52 |
|
| 53 |
void mon_reader_add(struct mon_bus *mbus, struct mon_reader *r); |
| 54 |
void mon_reader_del(struct mon_bus *mbus, struct mon_reader *r); |
| 55 |
|
| 56 |
struct mon_bus *mon_bus_lookup(unsigned int num); |
| 57 |
|
| 58 |
int mon_text_add(struct mon_bus *mbus, const struct usb_bus *ubus); |
| 59 |
void mon_text_del(struct mon_bus *mbus); |
| 60 |
int mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus); |
| 61 |
void mon_bin_del(struct mon_bus *mbus); |
| 62 |
|
| 63 |
int __init mon_text_init(void); |
| 64 |
void mon_text_exit(void); |
| 65 |
int __init mon_bin_init(void); |
| 66 |
void mon_bin_exit(void); |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
extern struct mutex mon_lock; |
| 71 |
|
| 72 |
extern const struct file_operations mon_fops_stat; |
| 73 |
|
| 74 |
extern struct mon_bus mon_bus0; |
| 75 |
|
| 76 |
#endif |