Lines Matching defs:ept
58 struct usb_endpoint *ept;
61 ept = alloc(sizeof(*ept));
63 ept->num = num;
64 ept->in = !!in;
65 ept->req = 0;
69 if(ept->in) {
70 ept->bit = EPT_TX(ept->num);
72 ept->bit = EPT_RX(ept->num);
77 ept->head = epts + (num * 2) + (ept->in);
78 ept->head->config = cfg;
80 ept->next = ept_list;
81 ept_list = ept;
83 DBG("ept%d %s @%p/%p max=%d bit=%x\n",
84 num, in ? "in":"out", ept, ept->head, max_pkt, ept->bit);
86 return ept;
89 static void endpoint_enable(struct usb_endpoint *ept, unsigned yes)
91 unsigned n = readl(USB_ENDPTCTRL(ept->num));
94 if(ept->in) {
100 if(ept->num != 0) {
103 ept->head->config = CONFIG_MAX_PKT(512) | CONFIG_ZLT;
105 ept->head->config = CONFIG_MAX_PKT(64) | CONFIG_ZLT;
109 writel(n, USB_ENDPTCTRL(ept->num));
121 int usb_queue_req(struct usb_endpoint *ept, struct usb_request *req)
131 ept->head->next = (unsigned) item;
132 ept->head->info = 0;
133 ept->req = req;
135 DBG("ept%d %s queue req=%p\n",
136 ept->num, ept->in ? "in" : "out", req);
138 writel(ept->bit, USB_ENDPTPRIME);
142 static void handle_ept_complete(struct usb_endpoint *ept)
149 DBG("ept%d %s complete req=%p\n",
150 ept->num, ept->in ? "in" : "out", ept->req);
152 req = ept->req;
154 ept->req = 0;
162 ept->num, ept->in ? "in" : "out", item->info, item->page0);
222 static void handle_setup(struct usb_endpoint *ept)
226 memcpy(&s, ept->head->setup_data, sizeof(s));
227 writel(ept->bit, USB_ENDPTSETUPSTAT);
265 struct usb_endpoint *ept;
267 for(ept = ept_list; ept; ept = ept->next){
268 if(ept->num == 0)
270 endpoint_enable(ept, s.value);
293 struct usb_endpoint *ept;
299 for(ept = ept_list; ept; ept = ept->next) {
300 if((ept->num == num) && (ept->in == in)) {
301 endpoint_enable(ept, 1);
316 writel((1<<16) | (1 << 0), USB_ENDPTCTRL(ept->num));
387 struct usb_endpoint *ept;
405 for(ept = ept_list; ept; ept = ept->next) {
406 ept->head->info = INFO_ACTIVE;
407 handle_ept_complete(ept);
444 for(ept = ept_list; ept; ept = ept->next){
445 if(n & ept->bit) {
446 handle_ept_complete(ept);