• Home
  • Raw
  • Download

Lines Matching refs:qh

168 static void musb_ep_set_qh(struct musb_hw_ep *ep, int is_in, struct musb_qh *qh)  in musb_ep_set_qh()  argument
171 ep->in_qh = qh; in musb_ep_set_qh()
173 ep->out_qh = qh; in musb_ep_set_qh()
188 musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) in musb_start_urb() argument
193 struct urb *urb = next_urb(qh); in musb_start_urb()
196 struct musb_hw_ep *hw_ep = qh->hw_ep; in musb_start_urb()
202 qh->offset = 0; in musb_start_urb()
203 qh->segsize = 0; in musb_start_urb()
206 switch (qh->type) { in musb_start_urb()
216 qh->iso_idx = 0; in musb_start_urb()
217 qh->frame = 0; in musb_start_urb()
229 qh, urb, address, qh->epnum, in musb_start_urb()
231 ({char *s; switch (qh->type) { in musb_start_urb()
242 musb_ep_set_qh(hw_ep, is_in, qh); in musb_start_urb()
250 switch (qh->type) { in musb_start_urb()
266 qh->frame = 0; in musb_start_urb()
270 qh->frame = urb->start_frame; in musb_start_urb()
313 static inline void musb_save_toggle(struct musb_qh *qh, int is_in, in musb_save_toggle() argument
316 void __iomem *epio = qh->hw_ep->regs; in musb_save_toggle()
329 usb_settoggle(urb->dev, qh->epnum, !is_in, csr ? 1 : 0); in musb_save_toggle()
342 struct musb_qh *qh = musb_ep_get_qh(hw_ep, is_in); in musb_advance_schedule() local
343 struct musb_hw_ep *ep = qh->hw_ep; in musb_advance_schedule()
344 int ready = qh->is_ready; in musb_advance_schedule()
350 switch (qh->type) { in musb_advance_schedule()
353 musb_save_toggle(qh, is_in, urb); in musb_advance_schedule()
363 qh->is_ready = 0; in musb_advance_schedule()
365 qh->is_ready = ready; in musb_advance_schedule()
370 if (list_empty(&qh->hep->urb_list)) { in musb_advance_schedule()
390 qh->hep->hcpriv = NULL; in musb_advance_schedule()
392 switch (qh->type) { in musb_advance_schedule()
399 if (qh->mux == 1) { in musb_advance_schedule()
400 head = qh->ring.prev; in musb_advance_schedule()
401 list_del(&qh->ring); in musb_advance_schedule()
402 kfree(qh); in musb_advance_schedule()
403 qh = first_qh(head); in musb_advance_schedule()
413 kfree(qh); in musb_advance_schedule()
414 qh = NULL; in musb_advance_schedule()
419 if (qh != NULL && qh->is_ready) { in musb_advance_schedule()
421 hw_ep->epnum, is_in ? 'R' : 'T', next_urb(qh)); in musb_advance_schedule()
422 musb_start_urb(musb, is_in, qh); in musb_advance_schedule()
459 struct musb_qh *qh = hw_ep->in_qh; in musb_host_packet_rx() local
466 urb->transfer_buffer, qh->offset, in musb_host_packet_rx()
480 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_packet_rx()
498 done = (++qh->iso_idx >= urb->number_of_packets); in musb_host_packet_rx()
502 buf = buffer + qh->offset; in musb_host_packet_rx()
503 length = urb->transfer_buffer_length - qh->offset; in musb_host_packet_rx()
512 qh->offset += length; in musb_host_packet_rx()
516 || (rx_count < qh->maxpacket) in musb_host_packet_rx()
554 musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) in musb_rx_reinit() argument
593 musb_write_rxfunaddr(ep->target_regs, qh->addr_reg); in musb_rx_reinit()
594 musb_write_rxhubaddr(ep->target_regs, qh->h_addr_reg); in musb_rx_reinit()
595 musb_write_rxhubport(ep->target_regs, qh->h_port_reg); in musb_rx_reinit()
598 musb_writeb(musb->mregs, MUSB_FADDR, qh->addr_reg); in musb_rx_reinit()
601 musb_writeb(ep->regs, MUSB_RXTYPE, qh->type_reg); in musb_rx_reinit()
602 musb_writeb(ep->regs, MUSB_RXINTERVAL, qh->intv_reg); in musb_rx_reinit()
611 qh->maxpacket | ((qh->hb_mult - 1) << 11)); in musb_rx_reinit()
617 struct musb_hw_ep *hw_ep, struct musb_qh *qh, in musb_tx_dma_program() argument
622 u16 pkt_size = qh->maxpacket; in musb_tx_dma_program()
635 if (qh->hb_mult == 1) in musb_tx_dma_program()
657 qh->segsize = length; in musb_tx_dma_program()
692 struct musb_qh *qh = musb_ep_get_qh(hw_ep, !is_out); in musb_ep_program() local
693 u16 packet_sz = qh->maxpacket; in musb_ep_program()
699 qh->addr_reg, qh->epnum, is_out ? "out" : "in", in musb_ep_program()
700 qh->h_addr_reg, qh->h_port_reg, in musb_ep_program()
754 if (usb_gettoggle(urb->dev, qh->epnum, 1)) in musb_ep_program()
772 musb_write_txfunaddr(mbase, epnum, qh->addr_reg); in musb_ep_program()
773 musb_write_txhubaddr(mbase, epnum, qh->h_addr_reg); in musb_ep_program()
774 musb_write_txhubport(mbase, epnum, qh->h_port_reg); in musb_ep_program()
777 musb_writeb(mbase, MUSB_FADDR, qh->addr_reg); in musb_ep_program()
781 musb_writeb(epio, MUSB_TXTYPE, qh->type_reg); in musb_ep_program()
785 else if (can_bulk_split(musb, qh->type)) in musb_ep_program()
791 qh->maxpacket | in musb_ep_program()
792 ((qh->hb_mult - 1) << 11)); in musb_ep_program()
793 musb_writeb(epio, MUSB_TXINTERVAL, qh->intv_reg); in musb_ep_program()
795 musb_writeb(epio, MUSB_NAKLIMIT0, qh->intv_reg); in musb_ep_program()
798 qh->type_reg); in musb_ep_program()
801 if (can_bulk_split(musb, qh->type)) in musb_ep_program()
808 hw_ep, qh, urb, offset, len)) in musb_ep_program()
813 qh->segsize = load_count; in musb_ep_program()
825 musb_rx_reinit(musb, qh, hw_ep); in musb_ep_program()
828 if (usb_gettoggle(urb->dev, qh->epnum, 0)) in musb_ep_program()
833 if (qh->type == USB_ENDPOINT_XFER_INT) in musb_ep_program()
854 qh->segsize = len; in musb_ep_program()
868 qh->segsize); in musb_ep_program()
894 struct musb_qh *qh = hw_ep->in_qh; in musb_h_ep0_continue() local
908 if (len < qh->maxpacket) { in musb_h_ep0_continue()
934 fifo_count = min_t(size_t, qh->maxpacket, in musb_h_ep0_continue()
972 struct musb_qh *qh = hw_ep->in_qh; in musb_h_ep0_irq() local
977 urb = next_urb(qh); in musb_h_ep0_irq()
986 csr, qh, len, urb, musb->ep0_stage); in musb_h_ep0_irq()
1111 struct musb_qh *qh = hw_ep->out_qh; in musb_host_tx() local
1112 struct urb *urb = next_urb(qh); in musb_host_tx()
1261 length = qh->segsize; in musb_host_tx()
1262 qh->offset += length; in musb_host_tx()
1268 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_tx()
1271 if (++qh->iso_idx >= urb->number_of_packets) { in musb_host_tx()
1279 } else if (dma && urb->transfer_buffer_length == qh->offset) { in musb_host_tx()
1283 if (qh->segsize < qh->maxpacket) in musb_host_tx()
1285 else if (qh->offset == urb->transfer_buffer_length in musb_host_tx()
1290 offset = qh->offset; in musb_host_tx()
1309 urb->actual_length = qh->offset; in musb_host_tx()
1313 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, in musb_host_tx()
1331 if (length > qh->maxpacket) in musb_host_tx()
1332 length = qh->maxpacket; in musb_host_tx()
1336 qh->segsize = length; in musb_host_tx()
1436 struct musb_qh *qh = hw_ep->in_qh; in musb_host_rx() local
1448 urb = next_urb(qh); in musb_host_rx()
1489 if (USB_ENDPOINT_XFER_ISOC != qh->type) { in musb_host_rx()
1501 && qh->mux == 1 in musb_host_rx()
1586 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_rx()
1595 if (++qh->iso_idx >= urb->number_of_packets) in musb_host_rx()
1604 || dma->actual_len < qh->maxpacket); in musb_host_rx()
1651 qh->offset, in musb_host_rx()
1660 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_rx()
1694 > qh->maxpacket) in musb_host_rx()
1731 if (qh->hb_mult == 1) in musb_host_rx()
1742 dma, qh->maxpacket, in musb_host_rx()
1769 qh->offset += xfer_len; in musb_host_rx()
1784 struct musb_qh *qh, in musb_schedule() argument
1794 struct urb *urb = next_urb(qh); in musb_schedule()
1797 if (qh->type == USB_ENDPOINT_XFER_CONTROL) { in musb_schedule()
1830 diff -= (qh->maxpacket * qh->hb_mult); in musb_schedule()
1847 toggle = usb_gettoggle(urb->dev, qh->epnum, !is_in); in musb_schedule()
1850 if (!is_in && (qh->type == USB_ENDPOINT_XFER_BULK) && in musb_schedule()
1859 if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) { in musb_schedule()
1873 if (is_in && qh->dev) in musb_schedule()
1874 qh->intv_reg = in musb_schedule()
1875 (USB_SPEED_HIGH == qh->dev->speed) ? 8 : 4; in musb_schedule()
1882 qh->mux = 0; in musb_schedule()
1884 dev_dbg(musb->controller, "qh %p periodic slot %d\n", qh, best_end); in musb_schedule()
1888 list_add_tail(&qh->ring, head); in musb_schedule()
1889 qh->mux = 1; in musb_schedule()
1891 qh->hw_ep = hw_ep; in musb_schedule()
1892 qh->hep->hcpriv = qh; in musb_schedule()
1894 musb_start_urb(musb, is_in, qh); in musb_schedule()
1921 struct musb_qh *qh; local
1933 qh = ret ? NULL : hep->hcpriv;
1934 if (qh)
1935 urb->hcpriv = qh;
1946 if (qh || ret)
1955 qh = kzalloc(sizeof *qh, mem_flags);
1956 if (!qh) {
1963 qh->hep = hep;
1964 qh->dev = urb->dev;
1965 INIT_LIST_HEAD(&qh->ring);
1966 qh->is_ready = 1;
1968 qh->maxpacket = usb_endpoint_maxp(epd);
1969 qh->type = usb_endpoint_type(epd);
1975 qh->hb_mult = 1 + ((qh->maxpacket >> 11) & 0x03);
1976 if (qh->hb_mult > 1) {
1977 int ok = (qh->type == USB_ENDPOINT_XFER_ISOC);
1986 qh->maxpacket &= 0x7ff;
1989 qh->epnum = usb_endpoint_num(epd);
1992 qh->addr_reg = (u8) usb_pipedevice(urb->pipe);
1995 type_reg = (qh->type << 4) | qh->epnum;
2006 qh->type_reg = type_reg;
2009 switch (qh->type) {
2041 qh->intv_reg = interval;
2056 qh->h_addr_reg = (u8) parent->devnum;
2061 qh->h_port_reg = (u8) urb->dev->ttport;
2063 qh->h_addr_reg =
2066 qh->h_addr_reg |= 0x80;
2075 qh->h_addr_reg = hubaddr;
2076 qh->h_port_reg = portnr;
2091 kfree(qh);
2092 qh = NULL;
2095 ret = musb_schedule(musb, qh,
2099 urb->hcpriv = qh;
2111 kfree(qh);
2121 static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh) argument
2123 struct musb_hw_ep *ep = qh->hw_ep;
2189 struct musb_qh *qh; local
2204 qh = urb->hcpriv;
2205 if (!qh)
2220 if (!qh->is_ready
2221 || urb->urb_list.prev != &qh->hep->urb_list
2222 || musb_ep_get_qh(qh->hw_ep, is_in) != qh) {
2223 int ready = qh->is_ready;
2225 qh->is_ready = 0;
2227 qh->is_ready = ready;
2232 if (ready && list_empty(&qh->hep->urb_list)) {
2233 qh->hep->hcpriv = NULL;
2234 list_del(&qh->ring);
2235 kfree(qh);
2238 ret = musb_cleanup_urb(urb, qh);
2252 struct musb_qh *qh; local
2257 qh = hep->hcpriv;
2258 if (qh == NULL)
2264 qh->is_ready = 0;
2265 if (musb_ep_get_qh(qh->hw_ep, is_in) == qh) {
2266 urb = next_urb(qh);
2273 musb_cleanup_urb(urb, qh);
2279 urb = next_urb(qh);
2281 musb_advance_schedule(musb, urb, qh->hw_ep, is_in);
2289 musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
2292 list_del(&qh->ring);
2293 kfree(qh);