Lines Matching defs:ep

120 	.ep = {
168 static int ast_vhub_hub_dev_status(struct ast_vhub_ep *ep,
173 EPDBG(ep, "GET_STATUS(dev)\n");
185 if (ep->vhub->wakeup_en)
188 return ast_vhub_simple_reply(ep, st0, 0);
191 static int ast_vhub_hub_ep_status(struct ast_vhub_ep *ep,
198 EPDBG(ep, "GET_STATUS(ep%d)\n", ep_num);
202 if (ep->vhub->ep1_stalled)
207 return ast_vhub_simple_reply(ep, st0, 0);
210 static int ast_vhub_hub_dev_feature(struct ast_vhub_ep *ep,
216 EPDBG(ep, "%s_FEATURE(dev val=%02x)\n",
220 ep->vhub->wakeup_en = is_set;
221 EPDBG(ep, "Hub remote wakeup %s\n",
227 val = readl(ep->vhub->regs + AST_VHUB_CTRL);
230 writel(val, ep->vhub->regs + AST_VHUB_CTRL);
238 static int ast_vhub_hub_ep_feature(struct ast_vhub_ep *ep,
246 EPDBG(ep, "%s_FEATURE(ep%d val=%02x)\n",
256 EPDBG(ep, "%s stall on EP 1\n",
259 ep->vhub->ep1_stalled = is_set;
260 reg = readl(ep->vhub->regs + AST_VHUB_EP1_CTRL);
267 writel(reg, ep->vhub->regs + AST_VHUB_EP1_CTRL);
272 static int ast_vhub_rep_desc(struct ast_vhub_ep *ep,
276 struct ast_vhub *vhub = ep->vhub;
278 EPDBG(ep, "GET_DESCRIPTOR(type:%d)\n", desc_type);
292 memcpy(ep->buf, &vhub->vhub_dev_desc, dsize);
299 memcpy(ep->buf, &vhub->vhub_conf_desc, dsize);
300 ((u8 *)ep->buf)[1] = desc_type;
306 memcpy(ep->buf, &vhub->vhub_hub_desc, dsize);
312 memcpy(ep->buf, &vhub->vhub_qual_desc, dsize);
323 return ast_vhub_reply(ep, NULL, len);
373 static int ast_vhub_rep_string(struct ast_vhub_ep *ep,
379 struct ast_vhub *vhub = ep->vhub;
396 memcpy(ep->buf, buf, rc);
397 return ast_vhub_reply(ep, NULL, min_t(u16, rc, len));
400 enum std_req_rc ast_vhub_std_hub_request(struct ast_vhub_ep *ep,
403 struct ast_vhub *vhub = ep->vhub;
424 EPDBG(ep, "SET_ADDRESS: Got address %x\n", wValue);
430 return ast_vhub_hub_dev_status(ep, wIndex, wValue);
432 return ast_vhub_simple_reply(ep, 0, 0);
434 return ast_vhub_hub_ep_status(ep, wIndex, wValue);
438 return ast_vhub_hub_dev_feature(ep, wIndex, wValue, true);
440 return ast_vhub_hub_dev_feature(ep, wIndex, wValue, false);
442 return ast_vhub_hub_ep_feature(ep, wIndex, wValue, true);
444 return ast_vhub_hub_ep_feature(ep, wIndex, wValue, false);
448 return ast_vhub_simple_reply(ep, 1);
461 return ast_vhub_rep_desc(ep, wValue >> 8,
464 return ast_vhub_rep_string(ep, wValue & 0xff,
471 return ast_vhub_simple_reply(ep, 0);
651 static enum std_req_rc ast_vhub_set_port_feature(struct ast_vhub_ep *ep,
654 struct ast_vhub *vhub = ep->vhub;
672 EPDBG(ep, "Port reset !\n");
694 static enum std_req_rc ast_vhub_clr_port_feature(struct ast_vhub_ep *ep,
697 struct ast_vhub *vhub = ep->vhub;
740 static enum std_req_rc ast_vhub_get_port_stat(struct ast_vhub_ep *ep,
743 struct ast_vhub *vhub = ep->vhub;
756 EPDBG(ep, " port status=%04x change=%04x\n", stat, chg);
758 return ast_vhub_simple_reply(ep,
765 enum std_req_rc ast_vhub_class_hub_request(struct ast_vhub_ep *ep,
776 EPDBG(ep, "GetHubStatus\n");
777 return ast_vhub_simple_reply(ep, 0, 0, 0, 0);
779 EPDBG(ep, "GetPortStatus(%d)\n", wIndex & 0xff);
780 return ast_vhub_get_port_stat(ep, wIndex & 0xf);
784 EPDBG(ep, "GetHubDescriptor(%d)\n", wIndex & 0xff);
785 return ast_vhub_rep_desc(ep, USB_DT_HUB, wLength);
788 EPDBG(ep, "Get/SetHubFeature(%d)\n", wValue);
795 EPDBG(ep, "SetPortFeature(%d,%d)\n", wIndex & 0xf, wValue);
796 return ast_vhub_set_port_feature(ep, wIndex & 0xf, wValue);
798 EPDBG(ep, "ClearPortFeature(%d,%d)\n", wIndex & 0xf, wValue);
799 return ast_vhub_clr_port_feature(ep, wIndex & 0xf, wValue);
805 return ast_vhub_simple_reply(ep, 0, 0, 0, 0);
807 EPDBG(ep, "Unknown class request\n");