This source file includes following definitions.
- hcd_to_c67x00_hcd
- c67x00_hcd_to_hcd
1
2
3
4
5
6
7
8
9
10 #ifndef _USB_C67X00_HCD_H
11 #define _USB_C67X00_HCD_H
12
13 #include <linux/kernel.h>
14 #include <linux/spinlock.h>
15 #include <linux/list.h>
16 #include <linux/usb.h>
17 #include <linux/usb/hcd.h>
18 #include "c67x00.h"
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 #define TOTAL_FRAME_BW 12000
41 #define DEFAULT_EOT 2250
42
43 #define MAX_FRAME_BW_STD (TOTAL_FRAME_BW - DEFAULT_EOT)
44 #define MAX_FRAME_BW_ISO 2400
45
46
47
48
49
50
51 #define MAX_PERIODIC_BW(full_bw) full_bw
52
53
54
55 struct c67x00_hcd {
56 spinlock_t lock;
57 struct c67x00_sie *sie;
58 unsigned int low_speed_ports;
59 unsigned int urb_count;
60 unsigned int urb_iso_count;
61
62 struct list_head list[4];
63 #if PIPE_BULK != 3
64 #error "Sanity check failed, this code presumes PIPE_... to range from 0 to 3"
65 #endif
66
67
68 int bandwidth_allocated;
69
70 int periodic_bw_allocated;
71 struct list_head td_list;
72 int max_frame_bw;
73
74 u16 td_base_addr;
75 u16 buf_base_addr;
76 u16 next_td_addr;
77 u16 next_buf_addr;
78
79 struct tasklet_struct tasklet;
80
81 struct completion endpoint_disable;
82
83 u16 current_frame;
84 u16 last_frame;
85 };
86
87 static inline struct c67x00_hcd *hcd_to_c67x00_hcd(struct usb_hcd *hcd)
88 {
89 return (struct c67x00_hcd *)(hcd->hcd_priv);
90 }
91
92 static inline struct usb_hcd *c67x00_hcd_to_hcd(struct c67x00_hcd *c67x00)
93 {
94 return container_of((void *)c67x00, struct usb_hcd, hcd_priv);
95 }
96
97
98
99
100
101 int c67x00_hcd_probe(struct c67x00_sie *sie);
102 void c67x00_hcd_remove(struct c67x00_sie *sie);
103
104
105
106
107 int c67x00_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
108 int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
109 void c67x00_endpoint_disable(struct usb_hcd *hcd,
110 struct usb_host_endpoint *ep);
111
112 void c67x00_hcd_msg_received(struct c67x00_sie *sie, u16 msg);
113 void c67x00_sched_kick(struct c67x00_hcd *c67x00);
114 int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00);
115 void c67x00_sched_stop_scheduler(struct c67x00_hcd *c67x00);
116
117 #define c67x00_hcd_dev(x) (c67x00_hcd_to_hcd(x)->self.controller)
118
119 #endif