Lines Matching +full:no +full:- +full:temp +full:- +full:support
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
100 #define OBARR(sc) bus_space_barrier((sc)->sc_io_tag, (sc)->sc_io_hdl, 0, (sc)->sc_io_size, \
103 do { OBARR(sc); bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
105 do { OBARR(sc); bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
107 do { OBARR(sc); bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r), (x)); } while (0)
108 #define OREAD1(sc, r) (OBARR(sc), bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
109 #define OREAD2(sc, r) (OBARR(sc), bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
110 #define OREAD4(sc, r) (OBARR(sc), bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (r)))
142 usb_pc_cpu_invalidate(&sc->sc_hw.hcca_pc); in ohci_get_hcca()
143 return (sc->sc_hcca_p); in ohci_get_hcca()
152 cb(bus, &sc->sc_hw.hcca_pc, &sc->sc_hw.hcca_pg, in ohci_iterate_hw_softc()
155 cb(bus, &sc->sc_hw.ctrl_start_pc, &sc->sc_hw.ctrl_start_pg, in ohci_iterate_hw_softc()
158 cb(bus, &sc->sc_hw.bulk_start_pc, &sc->sc_hw.bulk_start_pg, in ohci_iterate_hw_softc()
161 cb(bus, &sc->sc_hw.isoc_start_pc, &sc->sc_hw.isoc_start_pg, in ohci_iterate_hw_softc()
165 cb(bus, sc->sc_hw.intr_start_pc + i, sc->sc_hw.intr_start_pg + i, in ohci_iterate_hw_softc()
193 device_printf(sc->sc_bus.bdev, in ohci_controller_init()
210 DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); in ohci_controller_init()
229 device_printf(sc->sc_bus.bdev, "reset timeout\n"); in ohci_controller_init()
246 usbd_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res); in ohci_controller_init()
249 usbd_get_page(&sc->sc_hw.ctrl_start_pc, 0, &buf_res); in ohci_controller_init()
252 usbd_get_page(&sc->sc_hw.bulk_start_pc, 0, &buf_res); in ohci_controller_init()
257 OWRITE4(sc, OHCI_INTERRUPT_ENABLE, sc->sc_eintrs | OHCI_MIE); in ohci_controller_init()
277 /* Fiddle the No OverCurrent Protection bit to avoid chip bug. */ in ohci_controller_init()
286 * The AMD756 requires a delay before re-reading the register, in ohci_controller_init()
289 sc->sc_noport = 0; in ohci_controller_init()
290 for (i = 0; (i < 10) && (sc->sc_noport == 0); i++) { in ohci_controller_init()
293 sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A)); in ohci_controller_init()
314 ed->ed_self = htole32(buf_res.physaddr); in ohci_init_ed()
315 ed->ed_flags = htole32(OHCI_ED_SKIP); in ohci_init_ed()
316 ed->page_cache = pc; in ohci_init_ed()
332 sc->sc_eintrs = OHCI_NORMAL_INTRS; in ohci_init()
338 sc->sc_ctrl_p_last = in ohci_init()
339 ohci_init_ed(&sc->sc_hw.ctrl_start_pc); in ohci_init()
341 sc->sc_bulk_p_last = in ohci_init()
342 ohci_init_ed(&sc->sc_hw.bulk_start_pc); in ohci_init()
344 sc->sc_isoc_p_last = in ohci_init()
345 ohci_init_ed(&sc->sc_hw.isoc_start_pc); in ohci_init()
348 sc->sc_intr_p_last[i] = in ohci_init()
349 ohci_init_ed(sc->sc_hw.intr_start_pc + i); in ohci_init()
368 ed_x = sc->sc_intr_p_last[x]; in ohci_init()
369 ed_y = sc->sc_intr_p_last[y]; in ohci_init()
371 ed_x->next = NULL; in ohci_init()
372 ed_x->ed_next = ed_y->ed_self; in ohci_init()
383 ed_int = sc->sc_intr_p_last[0]; in ohci_init()
384 ed_isc = sc->sc_isoc_p_last; in ohci_init()
387 ed_int->next = ed_isc; in ohci_init()
388 ed_int->ed_next = ed_isc->ed_self; in ohci_init()
390 usbd_get_page(&sc->sc_hw.hcca_pc, 0, &buf_res); in ohci_init()
392 sc->sc_hcca_p = buf_res.buffer; in ohci_init()
399 sc->sc_hcca_p->hcca_interrupt_table[i] = in ohci_init()
400 sc->sc_intr_p_last[i | (OHCI_NO_EDS / 2)]->ed_self; in ohci_init()
404 usb_bus_mem_flush_all(&sc->sc_bus, &ohci_iterate_hw_softc); in ohci_init()
407 sc->sc_bus.methods = &ohci_bus_methods; in ohci_init()
409 usb_callout_init_mtx(&sc->sc_tmo_rhsc, &sc->sc_bus.bus_mtx, 0); in ohci_init()
415 ohci_dump_ed(sc->sc_intr_p_last[i]); in ohci_init()
418 ohci_dump_ed(sc->sc_isoc_p_last); in ohci_init()
422 sc->sc_bus.usbrev = USB_REV_1_0; in ohci_init()
428 ohci_do_poll(&sc->sc_bus); in ohci_init()
438 USB_BUS_LOCK(&sc->sc_bus); in ohci_detach()
440 usb_callout_stop(&sc->sc_tmo_rhsc); in ohci_detach()
445 USB_BUS_UNLOCK(&sc->sc_bus); in ohci_detach()
450 usb_callout_drain(&sc->sc_tmo_rhsc); in ohci_detach()
481 ohci_do_poll(&sc->sc_bus); in ohci_resume()
525 le32toh(hcca->hcca_frame_number), in ohci_dumpregs()
526 le32toh(hcca->hcca_done_head)); in ohci_dumpregs()
531 for (; std; std = std->obj_next) { in ohci_dump_tds()
542 uint8_t temp; in ohci_dump_td() local
544 usb_pc_cpu_invalidate(std->page_cache); in ohci_dump_td()
546 td_flags = le32toh(std->td_flags); in ohci_dump_td()
547 temp = (std->td_next == 0); in ohci_dump_td()
551 std, le32toh(std->td_self), in ohci_dump_td()
552 (td_flags & OHCI_TD_R) ? "-R" : "", in ohci_dump_td()
553 (td_flags & OHCI_TD_OUT) ? "-OUT" : "", in ohci_dump_td()
554 (td_flags & OHCI_TD_IN) ? "-IN" : "", in ohci_dump_td()
555 ((td_flags & OHCI_TD_TOGGLE_MASK) == OHCI_TD_TOGGLE_1) ? "-TOG1" : "", in ohci_dump_td()
556 ((td_flags & OHCI_TD_TOGGLE_MASK) == OHCI_TD_TOGGLE_0) ? "-TOG0" : "", in ohci_dump_td()
560 le32toh(std->td_cbp), in ohci_dump_td()
561 le32toh(std->td_next), in ohci_dump_td()
562 le32toh(std->td_be)); in ohci_dump_td()
564 return (temp); in ohci_dump_td()
572 uint8_t temp; in ohci_dump_itd() local
574 usb_pc_cpu_invalidate(sitd->page_cache); in ohci_dump_itd()
576 itd_flags = le32toh(sitd->itd_flags); in ohci_dump_itd()
577 temp = (sitd->itd_next == 0); in ohci_dump_itd()
581 sitd, le32toh(sitd->itd_self), in ohci_dump_itd()
586 le32toh(sitd->itd_bp0), in ohci_dump_itd()
587 le32toh(sitd->itd_next), in ohci_dump_itd()
588 le32toh(sitd->itd_be)); in ohci_dump_itd()
591 (uint32_t)le16toh(sitd->itd_offset[i])); in ohci_dump_itd()
595 return (temp); in ohci_dump_itd()
601 for (; sitd; sitd = sitd->obj_next) { in ohci_dump_itds()
614 usb_pc_cpu_invalidate(sed->page_cache); in ohci_dump_ed()
616 ed_flags = le32toh(sed->ed_flags); in ohci_dump_ed()
617 ed_headp = le32toh(sed->ed_headp); in ohci_dump_ed()
621 sed, le32toh(sed->ed_self), in ohci_dump_ed()
625 (ed_flags & OHCI_ED_DIR_OUT) ? "-OUT" : "", in ohci_dump_ed()
626 (ed_flags & OHCI_ED_DIR_IN) ? "-IN" : "", in ohci_dump_ed()
627 (ed_flags & OHCI_ED_SPEED) ? "-LOWSPEED" : "", in ohci_dump_ed()
628 (ed_flags & OHCI_ED_SKIP) ? "-SKIP" : "", in ohci_dump_ed()
629 (ed_flags & OHCI_ED_FORMAT_ISO) ? "-ISO" : "", in ohci_dump_ed()
630 le32toh(sed->ed_tailp), in ohci_dump_ed()
631 (ed_headp & OHCI_HALTED) ? "-HALTED" : "", in ohci_dump_ed()
632 (ed_headp & OHCI_TOGGLECARRY) ? "-CARRY" : "", in ohci_dump_ed()
633 le32toh(sed->ed_headp), in ohci_dump_ed()
634 le32toh(sed->ed_next)); in ohci_dump_ed()
647 usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); in ohci_transfer_intr_enqueue()
650 if (xfer->timeout != 0) { in ohci_transfer_intr_enqueue()
651 usbd_transfer_timeout_ms(xfer, &ohci_timeout, xfer->timeout); in ohci_transfer_intr_enqueue()
661 if (sed->prev != NULL) { in _ohci_append_qh()
666 /* (sc->sc_bus.bus_mtx) must be locked */ in _ohci_append_qh()
668 sed->next = last->next; in _ohci_append_qh()
669 sed->ed_next = last->ed_next; in _ohci_append_qh()
670 sed->ed_tailp = 0; in _ohci_append_qh()
672 sed->prev = last; in _ohci_append_qh()
674 usb_pc_cpu_flush(sed->page_cache); in _ohci_append_qh()
677 * the last->next->prev is never followed: sed->next->prev = sed; in _ohci_append_qh()
680 last->next = sed; in _ohci_append_qh()
681 last->ed_next = sed->ed_self; in _ohci_append_qh()
683 usb_pc_cpu_flush(last->page_cache); in _ohci_append_qh()
694 /* (sc->sc_bus.bus_mtx) must be locked */ in _ohci_remove_qh()
697 if (sed->prev) { in _ohci_remove_qh()
698 sed->prev->next = sed->next; in _ohci_remove_qh()
699 sed->prev->ed_next = sed->ed_next; in _ohci_remove_qh()
701 usb_pc_cpu_flush(sed->prev->page_cache); in _ohci_remove_qh()
703 if (sed->next) { in _ohci_remove_qh()
704 sed->next->prev = sed->prev; in _ohci_remove_qh()
705 usb_pc_cpu_flush(sed->next->page_cache); in _ohci_remove_qh()
707 last = ((last == sed) ? sed->prev : last); in _ohci_remove_qh()
709 sed->prev = 0; in _ohci_remove_qh()
711 usb_pc_cpu_flush(sed->page_cache); in _ohci_remove_qh()
720 uint32_t *plen = xfer->frlengths; in ohci_isoc_done()
723 ohci_itd_t *td = xfer->td_transfer_first; in ohci_isoc_done()
736 usb_pc_cpu_invalidate(td->page_cache); in ohci_isoc_done()
738 nframes = td->frames; in ohci_isoc_done()
739 olen = &td->itd_offset[0]; in ohci_isoc_done()
744 while (nframes--) { in ohci_isoc_done()
750 len &= ((1 << 12) - 1); in ohci_isoc_done()
761 if (((void *)td) == xfer->td_transfer_last) { in ohci_isoc_done()
764 td = td->obj_next; in ohci_isoc_done()
767 xfer->aframes = xfer->nframes; in ohci_isoc_done()
803 uint32_t temp; in ohci_non_isoc_done_sub() local
809 td = xfer->td_transfer_cache; in ohci_non_isoc_done_sub()
810 td_alt_next = td->alt_next; in ohci_non_isoc_done_sub()
813 if (xfer->aframes != xfer->nframes) { in ohci_non_isoc_done_sub()
814 usbd_xfer_set_frame_len(xfer, xfer->aframes, 0); in ohci_non_isoc_done_sub()
817 usb_pc_cpu_invalidate(td->page_cache); in ohci_non_isoc_done_sub()
818 phy_start = le32toh(td->td_cbp); in ohci_non_isoc_done_sub()
819 td_flags = le32toh(td->td_flags); in ohci_non_isoc_done_sub()
824 * short transfer - compute the number of remaining in ohci_non_isoc_done_sub()
827 phy_end = le32toh(td->td_be); in ohci_non_isoc_done_sub()
828 temp = (OHCI_PAGE(phy_start ^ phy_end) ? in ohci_non_isoc_done_sub()
830 temp += OHCI_PAGE_OFFSET(phy_end); in ohci_non_isoc_done_sub()
831 temp -= OHCI_PAGE_OFFSET(phy_start); in ohci_non_isoc_done_sub()
833 if (temp > td->len) { in ohci_non_isoc_done_sub()
836 } else if (xfer->aframes != xfer->nframes) { in ohci_non_isoc_done_sub()
841 xfer->frlengths[xfer->aframes] += td->len - temp; in ohci_non_isoc_done_sub()
844 if (xfer->aframes != xfer->nframes) { in ohci_non_isoc_done_sub()
846 xfer->frlengths[xfer->aframes] += td->len; in ohci_non_isoc_done_sub()
850 if (((void *)td) == xfer->td_transfer_last) { in ohci_non_isoc_done_sub()
862 if (xfer->flags_int.short_frames_ok) { in ohci_non_isoc_done_sub()
864 td = td->alt_next; in ohci_non_isoc_done_sub()
871 td = td->obj_next; in ohci_non_isoc_done_sub()
873 if (td->alt_next != td_alt_next) { in ohci_non_isoc_done_sub()
881 xfer->td_transfer_cache = td; in ohci_non_isoc_done_sub()
896 xfer, xfer->endpoint); in ohci_non_isoc_done()
900 ohci_dump_tds(xfer->td_transfer_first); in ohci_non_isoc_done()
906 xfer->td_transfer_cache = xfer->td_transfer_first; in ohci_non_isoc_done()
908 if (xfer->flags_int.control_xfr) { in ohci_non_isoc_done()
909 if (xfer->flags_int.control_hdr) { in ohci_non_isoc_done()
912 xfer->aframes = 1; in ohci_non_isoc_done()
914 if (xfer->td_transfer_cache == NULL) { in ohci_non_isoc_done()
918 while (xfer->aframes != xfer->nframes) { in ohci_non_isoc_done()
920 xfer->aframes++; in ohci_non_isoc_done()
922 if (xfer->td_transfer_cache == NULL) { in ohci_non_isoc_done()
927 if (xfer->flags_int.control_xfr && in ohci_non_isoc_done()
928 !xfer->flags_int.control_act) { in ohci_non_isoc_done()
935 /*------------------------------------------------------------------------*
937 *------------------------------------------------------------------------*/
948 td = xfer->td_transfer_cache; in ohci_check_transfer_sub()
951 usb_pc_cpu_invalidate(td->page_cache); in ohci_check_transfer_sub()
952 phy_start = le32toh(td->td_cbp); in ohci_check_transfer_sub()
953 td_flags = le32toh(td->td_flags); in ohci_check_transfer_sub()
954 td_next = le32toh(td->td_next); in ohci_check_transfer_sub()
957 if (((void *)td) == xfer->td_transfer_last) { in ohci_check_transfer_sub()
976 td = td->alt_next; in ohci_check_transfer_sub()
979 td = td->obj_next; in ohci_check_transfer_sub()
984 xfer->td_transfer_cache = td; in ohci_check_transfer_sub()
987 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_check_transfer_sub()
989 ed->ed_headp = td->td_self; in ohci_check_transfer_sub()
990 usb_pc_cpu_flush(ed->page_cache); in ohci_check_transfer_sub()
995 * Make sure that the OHCI re-scans the schedule by in ohci_check_transfer_sub()
999 if (xfer->xroot->udev->flags.self_suspended) { in ohci_check_transfer_sub()
1001 } else if (xfer->endpoint->methods == &ohci_device_bulk_methods) { in ohci_check_transfer_sub()
1002 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_check_transfer_sub()
1005 } else if (xfer->endpoint->methods == &ohci_device_ctrl_methods) { in ohci_check_transfer_sub()
1006 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_check_transfer_sub()
1013 /*------------------------------------------------------------------------*
1019 *------------------------------------------------------------------------*/
1029 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_check_transfer()
1031 usb_pc_cpu_invalidate(ed->page_cache); in ohci_check_transfer()
1032 ed_headp = le32toh(ed->ed_headp); in ohci_check_transfer()
1033 ed_tailp = le32toh(ed->ed_tailp); in ohci_check_transfer()
1037 if (xfer->endpoint->methods == &ohci_device_isoc_methods) { in ohci_check_transfer()
1041 if (xfer->flags_int.short_frames_ok) { in ohci_check_transfer()
1043 if (xfer->td_transfer_cache) { in ohci_check_transfer()
1048 /* store data-toggle */ in ohci_check_transfer()
1050 xfer->endpoint->toggle_next = 1; in ohci_check_transfer()
1052 xfer->endpoint->toggle_next = 0; in ohci_check_transfer()
1055 /* non-isochronous transfer */ in ohci_check_transfer()
1069 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); in ohci_rhsc_enable()
1071 sc->sc_eintrs |= OHCI_RHSC; in ohci_rhsc_enable()
1086 TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { in ohci_interrupt_poll()
1097 /*------------------------------------------------------------------------*
1098 * ohci_interrupt - OHCI interrupt handler
1100 * NOTE: Do not access "sc->sc_bus.bdev" inside the interrupt handler,
1101 * hence the interrupt handler will be setup before "sc->sc_bus.bdev"
1103 *------------------------------------------------------------------------*/
1111 USB_BUS_LOCK(&sc->sc_bus); in ohci_interrupt()
1123 done = le32toh(hcca->hcca_done_head); in ohci_interrupt()
1146 hcca->hcca_done_head = 0; in ohci_interrupt()
1148 usb_pc_cpu_flush(&sc->sc_hw.hcca_pc); in ohci_interrupt()
1163 status &= sc->sc_eintrs; in ohci_interrupt()
1188 sc->sc_eintrs &= ~OHCI_RHSC; in ohci_interrupt()
1194 usb_callout_reset(&sc->sc_tmo_rhsc, hz, in ohci_interrupt()
1202 sc->sc_eintrs &= ~status; in ohci_interrupt()
1210 USB_BUS_UNLOCK(&sc->sc_bus); in ohci_interrupt()
1223 USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); in ohci_timeout()
1234 USB_BUS_LOCK(&sc->sc_bus); in ohci_do_poll()
1236 USB_BUS_UNLOCK(&sc->sc_bus); in ohci_do_poll()
1240 ohci_setup_standard_chain_sub(struct ohci_std_temp *temp) in ohci_setup_standard_chain_sub() argument
1254 shortpkt_old = temp->shortpkt; in ohci_setup_standard_chain_sub()
1255 len_old = temp->len; in ohci_setup_standard_chain_sub()
1260 if ((temp->td_flags & htole32(OHCI_TD_DP_MASK)) == htole32(OHCI_TD_IN)) { in ohci_setup_standard_chain_sub()
1261 temp->td_flags |= htole32(OHCI_TD_R); in ohci_setup_standard_chain_sub()
1263 temp->td_flags &= ~htole32(OHCI_TD_R); in ohci_setup_standard_chain_sub()
1268 td = temp->td; in ohci_setup_standard_chain_sub()
1269 td_next = temp->td_next; in ohci_setup_standard_chain_sub()
1272 if (temp->len == 0) { in ohci_setup_standard_chain_sub()
1273 if (temp->shortpkt) { in ohci_setup_standard_chain_sub()
1278 temp->shortpkt = 1; in ohci_setup_standard_chain_sub()
1282 average = temp->average; in ohci_setup_standard_chain_sub()
1284 if (temp->len < average) { in ohci_setup_standard_chain_sub()
1285 if (temp->len % temp->max_frame_size) { in ohci_setup_standard_chain_sub()
1286 temp->shortpkt = 1; in ohci_setup_standard_chain_sub()
1288 average = temp->len; in ohci_setup_standard_chain_sub()
1298 td_next = td->obj_next; in ohci_setup_standard_chain_sub()
1300 /* check if we are pre-computing */ in ohci_setup_standard_chain_sub()
1305 temp->len -= average; in ohci_setup_standard_chain_sub()
1310 td->td_flags = temp->td_flags; in ohci_setup_standard_chain_sub()
1313 temp->td_flags &= ~htole32(OHCI_TD_TOGGLE_MASK); in ohci_setup_standard_chain_sub()
1320 td->td_cbp = 0; in ohci_setup_standard_chain_sub()
1321 td->td_be = 0; in ohci_setup_standard_chain_sub()
1322 td->len = 0; in ohci_setup_standard_chain_sub()
1325 usbd_get_page(temp->pc, buf_offset, &buf_res); in ohci_setup_standard_chain_sub()
1326 td->td_cbp = htole32(buf_res.physaddr); in ohci_setup_standard_chain_sub()
1327 buf_offset += (average - 1); in ohci_setup_standard_chain_sub()
1329 usbd_get_page(temp->pc, buf_offset, &buf_res); in ohci_setup_standard_chain_sub()
1330 td->td_be = htole32(buf_res.physaddr); in ohci_setup_standard_chain_sub()
1333 td->len = average; in ohci_setup_standard_chain_sub()
1337 temp->len -= average; in ohci_setup_standard_chain_sub()
1340 if ((td_next == td_alt_next) && temp->setup_alt_next) { in ohci_setup_standard_chain_sub()
1342 td->td_flags &= htole32(~OHCI_TD_INTR_MASK); in ohci_setup_standard_chain_sub()
1343 td->td_flags |= htole32(OHCI_TD_SET_DI(1)); in ohci_setup_standard_chain_sub()
1344 td->td_next = htole32(OHCI_TD_NEXT_END); in ohci_setup_standard_chain_sub()
1348 td->td_next = td_next->td_self; in ohci_setup_standard_chain_sub()
1352 td->alt_next = td_alt_next; in ohci_setup_standard_chain_sub()
1354 usb_pc_cpu_flush(td->page_cache); in ohci_setup_standard_chain_sub()
1361 if (temp->last_frame) { in ohci_setup_standard_chain_sub()
1362 /* no alternate next */ in ohci_setup_standard_chain_sub()
1370 temp->shortpkt = shortpkt_old; in ohci_setup_standard_chain_sub()
1371 temp->len = len_old; in ohci_setup_standard_chain_sub()
1374 temp->td = td; in ohci_setup_standard_chain_sub()
1375 temp->td_next = td_next; in ohci_setup_standard_chain_sub()
1381 struct ohci_std_temp temp; in ohci_setup_standard_chain() local
1389 xfer->address, UE_GET_ADDR(xfer->endpointno), in ohci_setup_standard_chain()
1390 xfer->sumlen, usbd_get_speed(xfer->xroot->udev)); in ohci_setup_standard_chain()
1392 temp.average = xfer->max_hc_frame_size; in ohci_setup_standard_chain()
1393 temp.max_frame_size = xfer->max_frame_size; in ohci_setup_standard_chain()
1396 xfer->flags_int.curr_dma_set ^= 1; in ohci_setup_standard_chain()
1399 td = xfer->td_start[xfer->flags_int.curr_dma_set]; in ohci_setup_standard_chain()
1401 xfer->td_transfer_first = td; in ohci_setup_standard_chain()
1402 xfer->td_transfer_cache = td; in ohci_setup_standard_chain()
1404 temp.td = NULL; in ohci_setup_standard_chain()
1405 temp.td_next = td; in ohci_setup_standard_chain()
1406 temp.last_frame = 0; in ohci_setup_standard_chain()
1407 temp.setup_alt_next = xfer->flags_int.short_frames_ok; in ohci_setup_standard_chain()
1409 methods = xfer->endpoint->methods; in ohci_setup_standard_chain()
1413 if (xfer->flags_int.control_xfr) { in ohci_setup_standard_chain()
1414 if (xfer->flags_int.control_hdr) { in ohci_setup_standard_chain()
1415 temp.td_flags = htole32(OHCI_TD_SETUP | OHCI_TD_NOCC | in ohci_setup_standard_chain()
1418 temp.len = xfer->frlengths[0]; in ohci_setup_standard_chain()
1419 temp.pc = xfer->frbuffers + 0; in ohci_setup_standard_chain()
1420 temp.shortpkt = temp.len ? 1 : 0; in ohci_setup_standard_chain()
1422 if (xfer->nframes == 1) { in ohci_setup_standard_chain()
1423 /* no STATUS stage yet, SETUP is last */ in ohci_setup_standard_chain()
1424 if (xfer->flags_int.control_act) { in ohci_setup_standard_chain()
1425 temp.last_frame = 1; in ohci_setup_standard_chain()
1426 temp.setup_alt_next = 0; in ohci_setup_standard_chain()
1429 ohci_setup_standard_chain_sub(&temp); in ohci_setup_standard_chain()
1435 xfer->endpoint->toggle_next = 1; in ohci_setup_standard_chain()
1441 temp.td_flags = htole32(OHCI_TD_NOCC | OHCI_TD_NOINTR); in ohci_setup_standard_chain()
1445 if (xfer->endpoint->toggle_next) { in ohci_setup_standard_chain()
1446 temp.td_flags |= htole32(OHCI_TD_TOGGLE_1); in ohci_setup_standard_chain()
1448 temp.td_flags |= htole32(OHCI_TD_TOGGLE_0); in ohci_setup_standard_chain()
1453 if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) { in ohci_setup_standard_chain()
1454 temp.td_flags |= htole32(OHCI_TD_IN); in ohci_setup_standard_chain()
1456 temp.td_flags |= htole32(OHCI_TD_OUT); in ohci_setup_standard_chain()
1459 while (x != xfer->nframes) { in ohci_setup_standard_chain()
1462 temp.len = xfer->frlengths[x]; in ohci_setup_standard_chain()
1463 temp.pc = xfer->frbuffers + x; in ohci_setup_standard_chain()
1467 if (x == xfer->nframes) { in ohci_setup_standard_chain()
1468 if (xfer->flags_int.control_xfr) { in ohci_setup_standard_chain()
1469 /* no STATUS stage yet, DATA is last */ in ohci_setup_standard_chain()
1470 if (xfer->flags_int.control_act) { in ohci_setup_standard_chain()
1471 temp.last_frame = 1; in ohci_setup_standard_chain()
1472 temp.setup_alt_next = 0; in ohci_setup_standard_chain()
1475 temp.last_frame = 1; in ohci_setup_standard_chain()
1476 temp.setup_alt_next = 0; in ohci_setup_standard_chain()
1479 if (temp.len == 0) { in ohci_setup_standard_chain()
1482 temp.shortpkt = 0; in ohci_setup_standard_chain()
1487 temp.shortpkt = (xfer->flags.force_short_xfer) ? 0 : 1; in ohci_setup_standard_chain()
1490 ohci_setup_standard_chain_sub(&temp); in ohci_setup_standard_chain()
1495 if (xfer->flags_int.control_xfr && in ohci_setup_standard_chain()
1496 !xfer->flags_int.control_act) { in ohci_setup_standard_chain()
1504 if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) { in ohci_setup_standard_chain()
1505 temp.td_flags = htole32(OHCI_TD_OUT | in ohci_setup_standard_chain()
1508 temp.td_flags = htole32(OHCI_TD_IN | in ohci_setup_standard_chain()
1512 temp.len = 0; in ohci_setup_standard_chain()
1513 temp.pc = NULL; in ohci_setup_standard_chain()
1514 temp.shortpkt = 0; in ohci_setup_standard_chain()
1515 temp.last_frame = 1; in ohci_setup_standard_chain()
1516 temp.setup_alt_next = 0; in ohci_setup_standard_chain()
1518 ohci_setup_standard_chain_sub(&temp); in ohci_setup_standard_chain()
1520 td = temp.td; in ohci_setup_standard_chain()
1523 td->td_next = htole32(OHCI_TD_NEXT_END); in ohci_setup_standard_chain()
1524 td->td_flags &= ~htole32(OHCI_TD_INTR_MASK); in ohci_setup_standard_chain()
1525 td->td_flags |= htole32(OHCI_TD_SET_DI(1)); in ohci_setup_standard_chain()
1527 usb_pc_cpu_flush(td->page_cache); in ohci_setup_standard_chain()
1531 xfer->td_transfer_last = td; in ohci_setup_standard_chain()
1536 xfer->endpoint->toggle_next); in ohci_setup_standard_chain()
1537 ohci_dump_tds(xfer->td_transfer_first); in ohci_setup_standard_chain()
1541 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_setup_standard_chain()
1543 ed_flags = (OHCI_ED_SET_FA(xfer->address) | in ohci_setup_standard_chain()
1544 OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpointno)) | in ohci_setup_standard_chain()
1545 OHCI_ED_SET_MAXP(xfer->max_frame_size)); in ohci_setup_standard_chain()
1549 if (xfer->xroot->udev->speed == USB_SPEED_LOW) { in ohci_setup_standard_chain()
1552 ed->ed_flags = htole32(ed_flags); in ohci_setup_standard_chain()
1554 td = xfer->td_transfer_first; in ohci_setup_standard_chain()
1556 ed->ed_headp = td->td_self; in ohci_setup_standard_chain()
1558 if (xfer->xroot->udev->flags.self_suspended == 0) { in ohci_setup_standard_chain()
1563 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_setup_standard_chain()
1568 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_setup_standard_chain()
1573 usb_pc_cpu_flush(ed->page_cache); in ohci_setup_standard_chain()
1584 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); in ohci_root_intr()
1587 memset(sc->sc_hub_idata, 0, sizeof(sc->sc_hub_idata)); in ohci_root_intr()
1594 m = (sc->sc_noport + 1); in ohci_root_intr()
1595 if (m > (8 * sizeof(sc->sc_hub_idata))) { in ohci_root_intr()
1596 m = (8 * sizeof(sc->sc_hub_idata)); in ohci_root_intr()
1601 sc->sc_hub_idata[i / 8] |= 1 << (i % 8); in ohci_root_intr()
1606 uhub_root_intr(&sc->sc_bus, sc->sc_hub_idata, in ohci_root_intr()
1607 sizeof(sc->sc_hub_idata)); in ohci_root_intr()
1616 const struct usb_pipe_methods *methods = xfer->endpoint->methods; in ohci_device_done()
1617 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_done()
1620 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); in ohci_device_done()
1623 xfer, xfer->endpoint, error); in ohci_device_done()
1625 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_device_done()
1627 usb_pc_cpu_invalidate(ed->page_cache); in ohci_device_done()
1630 OHCI_REMOVE_QH(ed, sc->sc_bulk_p_last); in ohci_device_done()
1633 OHCI_REMOVE_QH(ed, sc->sc_ctrl_p_last); in ohci_device_done()
1636 OHCI_REMOVE_QH(ed, sc->sc_intr_p_last[xfer->qh_pos]); in ohci_device_done()
1639 OHCI_REMOVE_QH(ed, sc->sc_isoc_p_last); in ohci_device_done()
1641 xfer->td_transfer_first = NULL; in ohci_device_done()
1642 xfer->td_transfer_last = NULL; in ohci_device_done()
1648 /*------------------------------------------------------------------------*
1649 * ohci bulk support
1650 *------------------------------------------------------------------------*/
1672 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_bulk_start()
1675 ohci_setup_standard_chain(xfer, &sc->sc_bulk_p_last); in ohci_device_bulk_start()
1689 /*------------------------------------------------------------------------*
1690 * ohci control support
1691 *------------------------------------------------------------------------*/
1713 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_ctrl_start()
1716 ohci_setup_standard_chain(xfer, &sc->sc_ctrl_p_last); in ohci_device_ctrl_start()
1730 /*------------------------------------------------------------------------*
1731 * ohci interrupt support
1732 *------------------------------------------------------------------------*/
1736 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_intr_open()
1744 if (xfer->interval >= bit) { in ohci_device_intr_open()
1748 if (sc->sc_intr_stat[x] < in ohci_device_intr_open()
1749 sc->sc_intr_stat[best]) { in ohci_device_intr_open()
1759 sc->sc_intr_stat[best]++; in ohci_device_intr_open()
1760 xfer->qh_pos = best; in ohci_device_intr_open()
1763 best, xfer->interval); in ohci_device_intr_open()
1769 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_intr_close()
1771 sc->sc_intr_stat[xfer->qh_pos]--; in ohci_device_intr_close()
1785 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_intr_start()
1788 ohci_setup_standard_chain(xfer, &sc->sc_intr_p_last[xfer->qh_pos]); in ohci_device_intr_start()
1802 /*------------------------------------------------------------------------*
1803 * ohci isochronous support
1804 *------------------------------------------------------------------------*/
1822 ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); in ohci_device_isoc_enter()
1838 nframes = le32toh(hcca->hcca_frame_number); in ohci_device_isoc_enter()
1841 xfer, xfer->endpoint->isoc_next, xfer->nframes, nframes); in ohci_device_isoc_enter()
1849 nframes = xfer->nframes; in ohci_device_isoc_enter()
1853 plen = xfer->frlengths; in ohci_device_isoc_enter()
1856 xfer->flags_int.curr_dma_set ^= 1; in ohci_device_isoc_enter()
1859 td = xfer->td_start[xfer->flags_int.curr_dma_set]; in ohci_device_isoc_enter()
1861 xfer->td_transfer_first = td; in ohci_device_isoc_enter()
1866 while (nframes--) { in ohci_device_isoc_enter()
1884 td->itd_flags = htole32( in ohci_device_isoc_enter()
1890 td->frames = ncur; in ohci_device_isoc_enter()
1895 td->itd_bp0 = 0; in ohci_device_isoc_enter()
1896 td->itd_be = ~0; in ohci_device_isoc_enter()
1898 while (ncur--) { in ohci_device_isoc_enter()
1899 td->itd_offset[ncur] = in ohci_device_isoc_enter()
1903 usbd_get_page(xfer->frbuffers, buf_offset - length, &buf_res); in ohci_device_isoc_enter()
1907 td->itd_bp0 = htole32(buf_res.physaddr); in ohci_device_isoc_enter()
1908 usbd_get_page(xfer->frbuffers, buf_offset - 1, &buf_res); in ohci_device_isoc_enter()
1909 td->itd_be = htole32(buf_res.physaddr); in ohci_device_isoc_enter()
1911 while (ncur--) { in ohci_device_isoc_enter()
1915 td->itd_offset[ncur] = in ohci_device_isoc_enter()
1922 td = td->obj_next; in ohci_device_isoc_enter()
1926 td_last->itd_next = td->itd_self; in ohci_device_isoc_enter()
1928 usb_pc_cpu_flush(td_last->page_cache); in ohci_device_isoc_enter()
1933 td_last->itd_flags &= ~htole32(OHCI_ITD_NOINTR); in ohci_device_isoc_enter()
1934 td_last->itd_flags |= htole32(OHCI_ITD_SET_DI(0)); in ohci_device_isoc_enter()
1935 td_last->itd_next = 0; in ohci_device_isoc_enter()
1937 usb_pc_cpu_flush(td_last->page_cache); in ohci_device_isoc_enter()
1939 xfer->td_transfer_last = td_last; in ohci_device_isoc_enter()
1944 ohci_dump_itds(xfer->td_transfer_first); in ohci_device_isoc_enter()
1947 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_device_isoc_enter()
1949 if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) in ohci_device_isoc_enter()
1954 ed_flags |= (OHCI_ED_SET_FA(xfer->address) | in ohci_device_isoc_enter()
1955 OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpointno)) | in ohci_device_isoc_enter()
1956 OHCI_ED_SET_MAXP(xfer->max_frame_size)); in ohci_device_isoc_enter()
1958 if (xfer->xroot->udev->speed == USB_SPEED_LOW) { in ohci_device_isoc_enter()
1961 ed->ed_flags = htole32(ed_flags); in ohci_device_isoc_enter()
1963 td = xfer->td_transfer_first; in ohci_device_isoc_enter()
1965 ed->ed_headp = td->itd_self; in ohci_device_isoc_enter()
1970 OHCI_APPEND_QH(ed, sc->sc_isoc_p_last); in ohci_device_isoc_enter()
1988 /*------------------------------------------------------------------------*
1989 * ohci root control support
1990 *------------------------------------------------------------------------*
1992 *------------------------------------------------------------------------*/
2051 ohci_softc_t *sc = OHCI_BUS2SC(udev->bus); in ohci_roothub_exec()
2062 USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); in ohci_roothub_exec()
2065 ptr = (const void *)&sc->sc_hub_desc.temp; in ohci_roothub_exec()
2069 value = UGETW(req->wValue); in ohci_roothub_exec()
2070 index = UGETW(req->wIndex); in ohci_roothub_exec()
2074 req->bmRequestType, req->bRequest, in ohci_roothub_exec()
2075 UGETW(req->wLength), value, index); in ohci_roothub_exec()
2078 switch (C(req->bRequest, req->bmRequestType)) { in ohci_roothub_exec()
2083 * DEVICE_REMOTE_WAKEUP and ENDPOINT_HALT are no-ops in ohci_roothub_exec()
2089 sc->sc_hub_desc.temp[0] = sc->sc_conf; in ohci_roothub_exec()
2118 str_ptr = sc->sc_vendor; in ohci_roothub_exec()
2131 sc->sc_hub_desc.temp, in ohci_roothub_exec()
2132 sizeof(sc->sc_hub_desc.temp), in ohci_roothub_exec()
2143 sc->sc_hub_desc.temp[0] = 0; in ohci_roothub_exec()
2147 USETW(sc->sc_hub_desc.stat.wStatus, UDS_SELF_POWERED); in ohci_roothub_exec()
2152 USETW(sc->sc_hub_desc.stat.wStatus, 0); in ohci_roothub_exec()
2159 sc->sc_addr = value; in ohci_roothub_exec()
2166 sc->sc_conf = value; in ohci_roothub_exec()
2187 (index > sc->sc_noport)) { in ohci_roothub_exec()
2243 sc->sc_hub_desc.hubd = ohci_hubd; in ohci_roothub_exec()
2244 sc->sc_hub_desc.hubd.bNbrPorts = sc->sc_noport; in ohci_roothub_exec()
2245 USETW(sc->sc_hub_desc.hubd.wHubCharacteristics, in ohci_roothub_exec()
2250 sc->sc_hub_desc.hubd.bPwrOn2PwrGood = OHCI_GET_POTPGT(v); in ohci_roothub_exec()
2253 for (l = 0; l < sc->sc_noport; l++) { in ohci_roothub_exec()
2255 sc->sc_hub_desc.hubd.DeviceRemovable[l / 8] |= (1 << (l % 8)); in ohci_roothub_exec()
2259 sc->sc_hub_desc.hubd.bDescLength = in ohci_roothub_exec()
2260 8 + ((sc->sc_noport + 7) / 8); in ohci_roothub_exec()
2261 len = sc->sc_hub_desc.hubd.bDescLength; in ohci_roothub_exec()
2266 memset(sc->sc_hub_desc.temp, 0, 16); in ohci_roothub_exec()
2272 (index > sc->sc_noport)) { in ohci_roothub_exec()
2279 USETW(sc->sc_hub_desc.ps.wPortStatus, v); in ohci_roothub_exec()
2280 USETW(sc->sc_hub_desc.ps.wPortChange, v >> 16); in ohci_roothub_exec()
2281 len = sizeof(sc->sc_hub_desc.ps); in ohci_roothub_exec()
2290 (index > sc->sc_noport)) { in ohci_roothub_exec()
2307 usb_pause_mtx(&sc->sc_bus.bus_mtx, in ohci_roothub_exec()
2352 xfer = parm->curr_xfer; in ohci_xfer_setup()
2354 parm->hc_max_packet_size = 0x500; in ohci_xfer_setup()
2355 parm->hc_max_packet_count = 1; in ohci_xfer_setup()
2356 parm->hc_max_frame_size = OHCI_PAGE_SIZE; in ohci_xfer_setup()
2361 if (parm->methods == &ohci_device_ctrl_methods) { in ohci_xfer_setup()
2362 xfer->flags_int.bdma_enable = 1; in ohci_xfer_setup()
2367 ntd = ((2 * xfer->nframes) + 1 /* STATUS */ in ohci_xfer_setup()
2368 + (xfer->max_data_length / xfer->max_hc_frame_size)); in ohci_xfer_setup()
2371 } else if (parm->methods == &ohci_device_bulk_methods) { in ohci_xfer_setup()
2372 xfer->flags_int.bdma_enable = 1; in ohci_xfer_setup()
2377 ntd = ((2 * xfer->nframes) in ohci_xfer_setup()
2378 + (xfer->max_data_length / xfer->max_hc_frame_size)); in ohci_xfer_setup()
2381 } else if (parm->methods == &ohci_device_intr_methods) { in ohci_xfer_setup()
2382 xfer->flags_int.bdma_enable = 1; in ohci_xfer_setup()
2387 ntd = ((2 * xfer->nframes) in ohci_xfer_setup()
2388 + (xfer->max_data_length / xfer->max_hc_frame_size)); in ohci_xfer_setup()
2391 } else if (parm->methods == &ohci_device_isoc_methods) { in ohci_xfer_setup()
2392 xfer->flags_int.bdma_enable = 1; in ohci_xfer_setup()
2396 nitd = ((xfer->max_data_length / OHCI_PAGE_SIZE) + in ohci_xfer_setup()
2397 howmany(xfer->nframes, OHCI_ITD_NOFFSET) + in ohci_xfer_setup()
2412 if (parm->err) { in ohci_xfer_setup()
2420 parm->err = USB_ERR_NOMEM; in ohci_xfer_setup()
2423 if (parm->buf) { in ohci_xfer_setup()
2432 td->td_self = htole32(page_info.physaddr); in ohci_xfer_setup()
2433 td->obj_next = last_obj; in ohci_xfer_setup()
2434 td->page_cache = pc + n; in ohci_xfer_setup()
2444 parm->err = USB_ERR_NOMEM; in ohci_xfer_setup()
2447 if (parm->buf) { in ohci_xfer_setup()
2456 itd->itd_self = htole32(page_info.physaddr); in ohci_xfer_setup()
2457 itd->obj_next = last_obj; in ohci_xfer_setup()
2458 itd->page_cache = pc + n; in ohci_xfer_setup()
2465 xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj; in ohci_xfer_setup()
2472 parm->err = USB_ERR_NOMEM; in ohci_xfer_setup()
2475 if (parm->buf) { in ohci_xfer_setup()
2484 ed->ed_self = htole32(page_info.physaddr); in ohci_xfer_setup()
2485 ed->obj_next = last_obj; in ohci_xfer_setup()
2486 ed->page_cache = pc + n; in ohci_xfer_setup()
2493 xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj; in ohci_xfer_setup()
2495 if (!xfer->flags_int.curr_dma_set) { in ohci_xfer_setup()
2496 xfer->flags_int.curr_dma_set = 1; in ohci_xfer_setup()
2505 ohci_softc_t *sc = OHCI_BUS2SC(udev->bus); in ohci_ep_init()
2508 ep, udev->address, in ohci_ep_init()
2509 edesc->bEndpointAddress, udev->flags.usb_mode, in ohci_ep_init()
2510 sc->sc_addr); in ohci_ep_init()
2512 if (udev->device_index != sc->sc_addr) { in ohci_ep_init()
2513 switch (edesc->bmAttributes & UE_XFERTYPE) { in ohci_ep_init()
2515 ep->methods = &ohci_device_ctrl_methods; in ohci_ep_init()
2518 ep->methods = &ohci_device_intr_methods; in ohci_ep_init()
2521 if (udev->speed == USB_SPEED_FULL) { in ohci_ep_init()
2522 ep->methods = &ohci_device_isoc_methods; in ohci_ep_init()
2526 ep->methods = &ohci_device_bulk_methods; in ohci_ep_init()
2554 struct ohci_softc *sc = OHCI_BUS2SC(udev->bus); in ohci_device_resume()
2561 USB_BUS_LOCK(udev->bus); in ohci_device_resume()
2563 TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { in ohci_device_resume()
2564 if (xfer->xroot->udev == udev) { in ohci_device_resume()
2565 methods = xfer->endpoint->methods; in ohci_device_resume()
2566 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_device_resume()
2569 OHCI_APPEND_QH(ed, sc->sc_bulk_p_last); in ohci_device_resume()
2573 OHCI_APPEND_QH(ed, sc->sc_ctrl_p_last); in ohci_device_resume()
2577 OHCI_APPEND_QH(ed, sc->sc_intr_p_last[xfer->qh_pos]); in ohci_device_resume()
2582 USB_BUS_UNLOCK(udev->bus); in ohci_device_resume()
2590 struct ohci_softc *sc = OHCI_BUS2SC(udev->bus); in ohci_device_suspend()
2597 USB_BUS_LOCK(udev->bus); in ohci_device_suspend()
2599 TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { in ohci_device_suspend()
2600 if (xfer->xroot->udev == udev) { in ohci_device_suspend()
2601 methods = xfer->endpoint->methods; in ohci_device_suspend()
2602 ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; in ohci_device_suspend()
2605 OHCI_REMOVE_QH(ed, sc->sc_bulk_p_last); in ohci_device_suspend()
2608 OHCI_REMOVE_QH(ed, sc->sc_ctrl_p_last); in ohci_device_suspend()
2611 OHCI_REMOVE_QH(ed, sc->sc_intr_p_last[xfer->qh_pos]); in ohci_device_suspend()
2616 USB_BUS_UNLOCK(udev->bus); in ohci_device_suspend()
2643 uint32_t temp; in ohci_set_hw_power() local
2650 flags = bus->hw_power_state; in ohci_set_hw_power()
2652 temp = OREAD4(sc, OHCI_CONTROL); in ohci_set_hw_power()
2653 temp &= ~(OHCI_PLE | OHCI_IE | OHCI_CLE | OHCI_BLE); in ohci_set_hw_power()
2656 temp |= OHCI_CLE; in ohci_set_hw_power()
2659 temp |= OHCI_BLE; in ohci_set_hw_power()
2662 temp |= OHCI_PLE; in ohci_set_hw_power()
2665 temp |= OHCI_IE | OHCI_PLE; in ohci_set_hw_power()
2667 OWRITE4(sc, OHCI_CONTROL, temp); in ohci_set_hw_power()