HelenOS sources

hc                121 uspace/drv/bus/usb/ehci/ehci_bus.c 	hc_enqueue_endpoint(bus->hc, ep);
hc                122 uspace/drv/bus/usb/ehci/ehci_bus.c 	endpoint_set_online(ep, &bus->hc->guard);
hc                130 uspace/drv/bus/usb/ehci/ehci_bus.c 	hc_t *hc = bus->hc;
hc                135 uspace/drv/bus/usb/ehci/ehci_bus.c 	hc_dequeue_endpoint(hc, ep);
hc                143 uspace/drv/bus/usb/ehci/ehci_bus.c 	fibril_mutex_lock(&hc->guard);
hc                148 uspace/drv/bus/usb/ehci/ehci_bus.c 	fibril_mutex_unlock(&hc->guard);
hc                185 uspace/drv/bus/usb/ehci/ehci_bus.c int ehci_bus_init(ehci_bus_t *bus, hc_t *hc)
hc                187 uspace/drv/bus/usb/ehci/ehci_bus.c 	assert(hc);
hc                196 uspace/drv/bus/usb/ehci/ehci_bus.c 	bus->hc = hc;
hc                 63 uspace/drv/bus/usb/ehci/ehci_bus.h typedef struct hc hc_t;
hc                 68 uspace/drv/bus/usb/ehci/ehci_bus.h 	hc_t *hc;
hc                207 uspace/drv/bus/usb/ehci/hc.c 	hc_t *hc = hcd_to_hc(hcd);
hc                208 uspace/drv/bus/usb/ehci/hc.c 	endpoint_list_fini(&hc->async_list);
hc                209 uspace/drv/bus/usb/ehci/hc.c 	endpoint_list_fini(&hc->int_list);
hc                210 uspace/drv/bus/usb/ehci/hc.c 	dma_buffer_free(&hc->dma_buffer);
hc                272 uspace/drv/bus/usb/ehci/hc.c 	hc_t *hc = bus->hc;
hc                273 uspace/drv/bus/usb/ehci/hc.c 	assert(hc);
hc                276 uspace/drv/bus/usb/ehci/hc.c 	if (hc->registers) {
hc                277 uspace/drv/bus/usb/ehci/hc.c 		*status = EHCI_RD(hc->registers->usbsts);
hc                278 uspace/drv/bus/usb/ehci/hc.c 		EHCI_WR(hc->registers->usbsts, *status);
hc                280 uspace/drv/bus/usb/ehci/hc.c 	usb_log_debug2("HC(%p): Read status: %x", hc, *status);
hc                295 uspace/drv/bus/usb/ehci/hc.c 	hc_t *hc = bus->hc;
hc                296 uspace/drv/bus/usb/ehci/hc.c 	assert(hc);
hc                299 uspace/drv/bus/usb/ehci/hc.c 	if (batch->target.address == ehci_rh_get_address(&hc->rh)) {
hc                301 uspace/drv/bus/usb/ehci/hc.c 		    hc, batch, &hc->rh);
hc                302 uspace/drv/bus/usb/ehci/hc.c 		return ehci_rh_schedule(&hc->rh, batch);
hc                314 uspace/drv/bus/usb/ehci/hc.c 	fibril_mutex_lock(&hc->guard);
hc                317 uspace/drv/bus/usb/ehci/hc.c 		fibril_mutex_unlock(&hc->guard);
hc                321 uspace/drv/bus/usb/ehci/hc.c 	usb_log_debug("HC(%p): Committing BATCH(%p)", hc, batch);
hc                325 uspace/drv/bus/usb/ehci/hc.c 	usb_log_debug2("HC(%p): Appending BATCH(%p)", hc, batch);
hc                326 uspace/drv/bus/usb/ehci/hc.c 	list_append(&ehci_ep->pending_link, &hc->pending_endpoints);
hc                328 uspace/drv/bus/usb/ehci/hc.c 	fibril_mutex_unlock(&hc->guard);
hc                342 uspace/drv/bus/usb/ehci/hc.c 	hc_t *hc = bus->hc;
hc                343 uspace/drv/bus/usb/ehci/hc.c 	assert(hc);
hc                345 uspace/drv/bus/usb/ehci/hc.c 	usb_log_debug2("HC(%p): Interrupt: %" PRIx32, hc, status);
hc                347 uspace/drv/bus/usb/ehci/hc.c 		ehci_rh_interrupt(&hc->rh);
hc                351 uspace/drv/bus/usb/ehci/hc.c 		fibril_mutex_lock(&hc->guard);
hc                352 uspace/drv/bus/usb/ehci/hc.c 		usb_log_debug2("HC(%p): Signaling doorbell", hc);
hc                353 uspace/drv/bus/usb/ehci/hc.c 		fibril_condvar_broadcast(&hc->async_doorbell);
hc                354 uspace/drv/bus/usb/ehci/hc.c 		fibril_mutex_unlock(&hc->guard);
hc                358 uspace/drv/bus/usb/ehci/hc.c 		fibril_mutex_lock(&hc->guard);
hc                360 uspace/drv/bus/usb/ehci/hc.c 		usb_log_debug2("HC(%p): Scanning %zu pending endpoints", hc,
hc                361 uspace/drv/bus/usb/ehci/hc.c 		    list_count(&hc->pending_endpoints));
hc                362 uspace/drv/bus/usb/ehci/hc.c 		list_foreach_safe(hc->pending_endpoints, current, next) {
hc                377 uspace/drv/bus/usb/ehci/hc.c 		fibril_mutex_unlock(&hc->guard);
hc                382 uspace/drv/bus/usb/ehci/hc.c 		usb_log_fatal("HCD(%p): HOST SYSTEM ERROR!", hc);
hc                180 uspace/drv/bus/usb/ehci/res.c 	hc_t *hc = hcd_to_hc(hcd);
hc                188 uspace/drv/bus/usb/ehci/res.c 	const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams);
hc                272 uspace/drv/bus/usb/ohci/hc.c 	hc_t *hc = bus->hc;
hc                273 uspace/drv/bus/usb/ohci/hc.c 	assert(hc);
hc                275 uspace/drv/bus/usb/ohci/hc.c 	if (hc->registers) {
hc                276 uspace/drv/bus/usb/ohci/hc.c 		*status = OHCI_RD(hc->registers->interrupt_status);
hc                277 uspace/drv/bus/usb/ohci/hc.c 		OHCI_WR(hc->registers->interrupt_status, *status);
hc                293 uspace/drv/bus/usb/ohci/hc.c 	hc_t *hc = bus->hc;
hc                294 uspace/drv/bus/usb/ohci/hc.c 	assert(hc);
hc                297 uspace/drv/bus/usb/ohci/hc.c 	if (batch->target.address == ohci_rh_get_address(&hc->rh)) {
hc                299 uspace/drv/bus/usb/ohci/hc.c 		return ohci_rh_schedule(&hc->rh, batch);
hc                310 uspace/drv/bus/usb/ohci/hc.c 	fibril_mutex_lock(&hc->guard);
hc                312 uspace/drv/bus/usb/ohci/hc.c 		fibril_mutex_unlock(&hc->guard);
hc                317 uspace/drv/bus/usb/ohci/hc.c 	list_append(&ohci_ep->pending_link, &hc->pending_endpoints);
hc                318 uspace/drv/bus/usb/ohci/hc.c 	fibril_mutex_unlock(&hc->guard);
hc                323 uspace/drv/bus/usb/ohci/hc.c 		OHCI_SET(hc->registers->command_status, CS_CLF);
hc                326 uspace/drv/bus/usb/ohci/hc.c 		OHCI_SET(hc->registers->command_status, CS_BLF);
hc                345 uspace/drv/bus/usb/ohci/hc.c 	hc_t *hc = bus->hc;
hc                346 uspace/drv/bus/usb/ohci/hc.c 	assert(hc);
hc                349 uspace/drv/bus/usb/ohci/hc.c 	assert(hc);
hc                352 uspace/drv/bus/usb/ohci/hc.c 	usb_log_debug2("OHCI(%p) interrupt: %x.", hc, status);
hc                354 uspace/drv/bus/usb/ohci/hc.c 		ohci_rh_interrupt(&hc->rh);
hc                357 uspace/drv/bus/usb/ohci/hc.c 		fibril_mutex_lock(&hc->guard);
hc                358 uspace/drv/bus/usb/ohci/hc.c 		usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p).", hc->hcca,
hc                359 uspace/drv/bus/usb/ohci/hc.c 		    OHCI_RD(hc->registers->hcca),
hc                360 uspace/drv/bus/usb/ohci/hc.c 		    (void *) addr_to_phys(hc->hcca));
hc                362 uspace/drv/bus/usb/ohci/hc.c 		    OHCI_RD(hc->registers->periodic_current));
hc                364 uspace/drv/bus/usb/ohci/hc.c 		list_foreach_safe(hc->pending_endpoints, current, next) {
hc                379 uspace/drv/bus/usb/ohci/hc.c 		fibril_mutex_unlock(&hc->guard);
hc                384 uspace/drv/bus/usb/ohci/hc.c 		hc_start(&hc->base);
hc                127 uspace/drv/bus/usb/ohci/ohci_bus.c 	hc_enqueue_endpoint(bus->hc, ep);
hc                128 uspace/drv/bus/usb/ohci/ohci_bus.c 	endpoint_set_online(ep, &bus->hc->guard);
hc                136 uspace/drv/bus/usb/ohci/ohci_bus.c 	hc_t *const hc = bus->hc;
hc                140 uspace/drv/bus/usb/ohci/ohci_bus.c 	hc_dequeue_endpoint(bus->hc, ep);
hc                149 uspace/drv/bus/usb/ohci/ohci_bus.c 	fibril_mutex_lock(&hc->guard);
hc                154 uspace/drv/bus/usb/ohci/ohci_bus.c 	fibril_mutex_unlock(&hc->guard);
hc                191 uspace/drv/bus/usb/ohci/ohci_bus.c int ohci_bus_init(ohci_bus_t *bus, hc_t *hc)
hc                193 uspace/drv/bus/usb/ohci/ohci_bus.c 	assert(hc);
hc                202 uspace/drv/bus/usb/ohci/ohci_bus.c 	bus->hc = hc;
hc                 71 uspace/drv/bus/usb/ohci/ohci_bus.h typedef struct hc hc_t;
hc                 76 uspace/drv/bus/usb/ohci/ohci_bus.h 	hc_t *hc;
hc                333 uspace/drv/bus/usb/uhci/hc.c 	hc_t *const hc = bus_to_hc(endpoint_get_bus(ep));
hc                335 uspace/drv/bus/usb/uhci/hc.c 	const errno_t err = usb2_bus_endpoint_register(&hc->bus_helper, ep);
hc                339 uspace/drv/bus/usb/uhci/hc.c 	transfer_list_t *list = hc->transfers[ep->device->speed][ep->transfer_type];
hc                355 uspace/drv/bus/usb/uhci/hc.c 	hc_t *const hc = bus_to_hc(endpoint_get_bus(ep));
hc                356 uspace/drv/bus/usb/uhci/hc.c 	usb2_bus_endpoint_unregister(&hc->bus_helper, ep);
hc                359 uspace/drv/bus/usb/uhci/hc.c 	if (ep->device->address == uhci_rh_get_address(&hc->rh)) {
hc                366 uspace/drv/bus/usb/uhci/hc.c 	transfer_list_t *list = hc->transfers[ep->device->speed][ep->transfer_type];
hc                414 uspace/drv/bus/usb/uhci/hc.c 	hc_t *const hc = bus_to_hc(dev->bus);
hc                415 uspace/drv/bus/usb/uhci/hc.c 	return usb2_bus_device_enumerate(&hc->bus_helper, dev);
hc                420 uspace/drv/bus/usb/uhci/hc.c 	hc_t *const hc = bus_to_hc(dev->bus);
hc                421 uspace/drv/bus/usb/uhci/hc.c 	usb2_bus_device_gone(&hc->bus_helper, dev);
hc                580 uspace/drv/bus/usb/uhci/hc.c 	hc_t *hc = bus_to_hc(endpoint_get_bus(ep));
hc                582 uspace/drv/bus/usb/uhci/hc.c 	if (batch->target.address == uhci_rh_get_address(&hc->rh))
hc                583 uspace/drv/bus/usb/uhci/hc.c 		return uhci_rh_schedule(&hc->rh, batch);
hc                586 uspace/drv/bus/usb/uhci/hc.c 	    hc->transfers[ep->device->speed][ep->transfer_type];
hc                 69 uspace/drv/bus/usb/xhci/bus.c errno_t xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc)
hc                 75 uspace/drv/bus/usb/xhci/bus.c 	bus->devices_by_slot = calloc(hc->max_slots, sizeof(xhci_device_t *));
hc                 79 uspace/drv/bus/usb/xhci/bus.c 	bus->hc = hc;
hc                 48 uspace/drv/bus/usb/xhci/bus.h 	xhci_hc_t *hc; /**< Pointer to managing HC (to issue commands) */
hc                 62 uspace/drv/bus/usb/xhci/commands.c static xhci_cmd_ring_t *get_cmd_ring(xhci_hc_t *hc)
hc                 64 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                 65 uspace/drv/bus/usb/xhci/commands.c 	return &hc->cr;
hc                 74 uspace/drv/bus/usb/xhci/commands.c errno_t xhci_init_commands(xhci_hc_t *hc)
hc                 76 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                 95 uspace/drv/bus/usb/xhci/commands.c void xhci_fini_commands(xhci_hc_t *hc)
hc                 97 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                 98 uspace/drv/bus/usb/xhci/commands.c 	xhci_stop_command_ring(hc);
hc                100 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                144 uspace/drv/bus/usb/xhci/commands.c static inline xhci_cmd_t *find_command(xhci_hc_t *hc, uint64_t phys)
hc                146 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                197 uspace/drv/bus/usb/xhci/commands.c static inline errno_t enqueue_command(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                199 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                226 uspace/drv/bus/usb/xhci/commands.c 		hc_ring_doorbell(hc, 0, 0);
hc                237 uspace/drv/bus/usb/xhci/commands.c void xhci_stop_command_ring(xhci_hc_t *hc)
hc                239 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                246 uspace/drv/bus/usb/xhci/commands.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_CS, 1);
hc                248 uspace/drv/bus/usb/xhci/commands.c 	while (XHCI_REG_RD(hc->op_regs, XHCI_OP_CRR))
hc                258 uspace/drv/bus/usb/xhci/commands.c void xhci_nuke_command_ring(xhci_hc_t *hc)
hc                260 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                265 uspace/drv/bus/usb/xhci/commands.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_CS, 1);
hc                272 uspace/drv/bus/usb/xhci/commands.c void xhci_start_command_ring(xhci_hc_t *hc)
hc                274 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                285 uspace/drv/bus/usb/xhci/commands.c static void abort_command_ring(xhci_hc_t *hc)
hc                287 uspace/drv/bus/usb/xhci/commands.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_CA, 1);
hc                350 uspace/drv/bus/usb/xhci/commands.c errno_t xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb)
hc                352 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                380 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_t *command = find_command(hc, phys);
hc                424 uspace/drv/bus/usb/xhci/commands.c static errno_t no_op_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                426 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                432 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                435 uspace/drv/bus/usb/xhci/commands.c static errno_t enable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                437 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                443 uspace/drv/bus/usb/xhci/commands.c 	    host2xhci(32, XHCI_REG_RD(hc->xecp, XHCI_EC_SP_SLOT_TYPE) << 16);
hc                445 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                448 uspace/drv/bus/usb/xhci/commands.c static errno_t disable_slot_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                450 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                458 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                461 uspace/drv/bus/usb/xhci/commands.c static errno_t address_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                463 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                489 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                492 uspace/drv/bus/usb/xhci/commands.c static errno_t configure_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                494 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                511 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                514 uspace/drv/bus/usb/xhci/commands.c static errno_t evaluate_context_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                516 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                534 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                537 uspace/drv/bus/usb/xhci/commands.c static errno_t reset_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                539 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                549 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                552 uspace/drv/bus/usb/xhci/commands.c static errno_t stop_endpoint_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                554 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                564 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                567 uspace/drv/bus/usb/xhci/commands.c static errno_t set_tr_dequeue_pointer_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                569 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                580 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                583 uspace/drv/bus/usb/xhci/commands.c static errno_t reset_device_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                585 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                593 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                596 uspace/drv/bus/usb/xhci/commands.c static errno_t get_port_bandwidth_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                598 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                610 uspace/drv/bus/usb/xhci/commands.c 	return enqueue_command(hc, cmd);
hc                615 uspace/drv/bus/usb/xhci/commands.c typedef errno_t (*cmd_handler) (xhci_hc_t *hc, xhci_cmd_t *cmd);
hc                647 uspace/drv/bus/usb/xhci/commands.c static errno_t try_abort_current_command(xhci_hc_t *hc)
hc                649 uspace/drv/bus/usb/xhci/commands.c 	xhci_cmd_ring_t *cr = get_cmd_ring(hc);
hc                668 uspace/drv/bus/usb/xhci/commands.c 	abort_command_ring(hc);
hc                673 uspace/drv/bus/usb/xhci/commands.c 	if (XHCI_REG_RD(hc->op_regs, XHCI_OP_CRR)) {
hc                695 uspace/drv/bus/usb/xhci/commands.c 	hc_ring_doorbell(hc, 0, 0);
hc                709 uspace/drv/bus/usb/xhci/commands.c static errno_t wait_for_cmd_completion(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                713 uspace/drv/bus/usb/xhci/commands.c 	if (fibril_get_id() == hc->event_handler) {
hc                731 uspace/drv/bus/usb/xhci/commands.c 			rv = try_abort_current_command(hc);
hc                747 uspace/drv/bus/usb/xhci/commands.c errno_t xhci_cmd_sync(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                749 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                759 uspace/drv/bus/usb/xhci/commands.c 	if ((err = cmd_handlers[cmd->_header.cmd](hc, cmd))) {
hc                764 uspace/drv/bus/usb/xhci/commands.c 	if ((err = wait_for_cmd_completion(hc, cmd))) {
hc                789 uspace/drv/bus/usb/xhci/commands.c errno_t xhci_cmd_sync_fini(xhci_hc_t *hc, xhci_cmd_t *cmd)
hc                791 uspace/drv/bus/usb/xhci/commands.c 	const errno_t err = xhci_cmd_sync(hc, cmd);
hc                801 uspace/drv/bus/usb/xhci/commands.c errno_t xhci_cmd_async_fini(xhci_hc_t *hc, xhci_cmd_t *stack_cmd)
hc                803 uspace/drv/bus/usb/xhci/commands.c 	assert(hc);
hc                825 uspace/drv/bus/usb/xhci/commands.c 	if ((err = cmd_handlers[heap_cmd->_header.cmd](hc, heap_cmd))) {
hc                149 uspace/drv/bus/usb/xhci/debug.c void xhci_dump_state(const xhci_hc_t *hc)
hc                153 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_RS);
hc                154 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_HCRST);
hc                155 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_INTE);
hc                156 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_HSEE);
hc                157 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_LHCRST);
hc                158 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CSS);
hc                159 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CRS);
hc                160 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_EWE);
hc                161 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_EU3S);
hc                162 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CME);
hc                163 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_HCH);
hc                164 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_HSE);
hc                165 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_EINT);
hc                166 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_PCD);
hc                167 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_SSS);
hc                168 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_RSS);
hc                169 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_SRE);
hc                170 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CNR);
hc                171 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_HCE);
hc                172 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_PAGESIZE);
hc                173 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_NOTIFICATION);
hc                174 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_RCS);
hc                175 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CS);
hc                176 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CA);
hc                177 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CRR);
hc                178 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_CRCR);
hc                179 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->op_regs, XHCI_OP_DCBAAP);
hc                180 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(hc->rt_regs, XHCI_RT_MFINDEX);
hc                183 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_IP);
hc                184 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_IE);
hc                185 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_IMI);
hc                186 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_IMC);
hc                187 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_ERSTSZ);
hc                188 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_ERSTBA);
hc                189 uspace/drv/bus/usb/xhci/debug.c 	DUMP_REG(&hc->rt_regs->ir[0], XHCI_INTR_ERDP);
hc                195 uspace/drv/bus/usb/xhci/debug.c void xhci_dump_ports(const xhci_hc_t *hc)
hc                197 uspace/drv/bus/usb/xhci/debug.c 	const size_t num_ports = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PORTS);
hc                201 uspace/drv/bus/usb/xhci/debug.c 		xhci_dump_port(&hc->op_regs->portrs[i]);
hc                384 uspace/drv/bus/usb/xhci/debug.c void xhci_dump_input_ctx(const xhci_hc_t *hc, const struct xhci_input_ctx *ictx)
hc                386 uspace/drv/bus/usb/xhci/debug.c 	xhci_device_ctx_t *device_ctx = XHCI_GET_DEVICE_CTX(ictx, hc);
hc                387 uspace/drv/bus/usb/xhci/debug.c 	xhci_slot_ctx_t *slot_ctx = XHCI_GET_SLOT_CTX(device_ctx, hc);
hc                388 uspace/drv/bus/usb/xhci/debug.c 	xhci_input_ctrl_ctx_t *ctrl_ctx = XHCI_GET_CTRL_CTX(ictx, hc);
hc                405 uspace/drv/bus/usb/xhci/debug.c 			xhci_ep_ctx_t *ep_ctx = XHCI_GET_EP_CTX(device_ctx, hc, dci);
hc                117 uspace/drv/bus/usb/xhci/device.c static errno_t setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev)
hc                214 uspace/drv/bus/usb/xhci/device.c 	if ((err = setup_ep0_packet_size(bus->hc, xhci_dev))) {
hc                129 uspace/drv/bus/usb/xhci/endpoint.c 	if (bus->hc->ac64)
hc                 82 uspace/drv/bus/usb/xhci/hc.c static errno_t hc_parse_ec(xhci_hc_t *hc)
hc                 87 uspace/drv/bus/usb/xhci/hc.c 	xhci_port_speed_t *speeds = hc->speeds;
hc                 89 uspace/drv/bus/usb/xhci/hc.c 	for (xhci_extcap_t *ec = hc->xecp; ec; ec = xhci_extcap_next(ec)) {
hc                 93 uspace/drv/bus/usb/xhci/hc.c 			assert(hc->legsup == NULL);
hc                 94 uspace/drv/bus/usb/xhci/hc.c 			hc->legsup = (xhci_legsup_t *) ec;
hc                114 uspace/drv/bus/usb/xhci/hc.c 			xhci_rh_set_ports_protocol(&hc->rh, offset, count, major);
hc                188 uspace/drv/bus/usb/xhci/hc.c errno_t hc_init_mmio(xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res)
hc                197 uspace/drv/bus/usb/xhci/hc.c 	hc->mmio_range = hw_res->mem_ranges.ranges[0];
hc                200 uspace/drv/bus/usb/xhci/hc.c 	    RNGABSPTR(hc->mmio_range), RNGSZ(hc->mmio_range), hw_res->irqs.irqs[0]);
hc                202 uspace/drv/bus/usb/xhci/hc.c 	if (RNGSZ(hc->mmio_range) < sizeof(xhci_cap_regs_t))
hc                206 uspace/drv/bus/usb/xhci/hc.c 	if ((err = pio_enable_range(&hc->mmio_range, &base)))
hc                209 uspace/drv/bus/usb/xhci/hc.c 	hc->reg_base = base;
hc                210 uspace/drv/bus/usb/xhci/hc.c 	hc->cap_regs = (xhci_cap_regs_t *)  base;
hc                211 uspace/drv/bus/usb/xhci/hc.c 	hc->op_regs  = (xhci_op_regs_t *)  (base + XHCI_REG_RD(hc->cap_regs, XHCI_CAP_LENGTH));
hc                212 uspace/drv/bus/usb/xhci/hc.c 	hc->rt_regs  = (xhci_rt_regs_t *)  (base + XHCI_REG_RD(hc->cap_regs, XHCI_CAP_RTSOFF));
hc                213 uspace/drv/bus/usb/xhci/hc.c 	hc->db_arry  = (xhci_doorbell_t *) (base + XHCI_REG_RD(hc->cap_regs, XHCI_CAP_DBOFF));
hc                215 uspace/drv/bus/usb/xhci/hc.c 	uintptr_t xec_offset = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_XECP) * sizeof(xhci_dword_t);
hc                217 uspace/drv/bus/usb/xhci/hc.c 		hc->xecp = (xhci_extcap_t *) (base + xec_offset);
hc                220 uspace/drv/bus/usb/xhci/hc.c 	usb_log_debug("\tCapability regs: %p", hc->cap_regs);
hc                221 uspace/drv/bus/usb/xhci/hc.c 	usb_log_debug("\tOperational regs: %p", hc->op_regs);
hc                222 uspace/drv/bus/usb/xhci/hc.c 	usb_log_debug("\tRuntime regs: %p", hc->rt_regs);
hc                223 uspace/drv/bus/usb/xhci/hc.c 	usb_log_debug("\tDoorbell array base: %p", hc->db_arry);
hc                225 uspace/drv/bus/usb/xhci/hc.c 	xhci_dump_cap_regs(hc->cap_regs);
hc                227 uspace/drv/bus/usb/xhci/hc.c 	hc->ac64 = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_AC64);
hc                228 uspace/drv/bus/usb/xhci/hc.c 	hc->csz = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_CSZ);
hc                229 uspace/drv/bus/usb/xhci/hc.c 	hc->max_slots = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_SLOTS);
hc                233 uspace/drv/bus/usb/xhci/hc.c 	hc->wrap_time = SEC2USEC(ts.tv_sec) + NSEC2USEC(ts.tv_nsec);
hc                234 uspace/drv/bus/usb/xhci/hc.c 	hc->wrap_count = 0;
hc                236 uspace/drv/bus/usb/xhci/hc.c 	unsigned ist = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_IST);
hc                237 uspace/drv/bus/usb/xhci/hc.c 	hc->ist = (ist & 0x10 >> 1) * (ist & 0xf);
hc                239 uspace/drv/bus/usb/xhci/hc.c 	if ((err = xhci_rh_init(&hc->rh, hc)))
hc                242 uspace/drv/bus/usb/xhci/hc.c 	if ((err = hc_parse_ec(hc)))
hc                248 uspace/drv/bus/usb/xhci/hc.c 	xhci_rh_fini(&hc->rh);
hc                250 uspace/drv/bus/usb/xhci/hc.c 	pio_disable(hc->reg_base, RNGSZ(hc->mmio_range));
hc                259 uspace/drv/bus/usb/xhci/hc.c errno_t hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device)
hc                263 uspace/drv/bus/usb/xhci/hc.c 	if (dma_buffer_alloc(&hc->dcbaa_dma, (1 + hc->max_slots) * sizeof(uint64_t)))
hc                265 uspace/drv/bus/usb/xhci/hc.c 	hc->dcbaa = hc->dcbaa_dma.virt;
hc                267 uspace/drv/bus/usb/xhci/hc.c 	hc->event_worker = joinable_fibril_create(&event_worker, hc);
hc                268 uspace/drv/bus/usb/xhci/hc.c 	if (!hc->event_worker)
hc                271 uspace/drv/bus/usb/xhci/hc.c 	if ((err = xhci_event_ring_init(&hc->event_ring, 1)))
hc                274 uspace/drv/bus/usb/xhci/hc.c 	if ((err = xhci_scratchpad_alloc(hc)))
hc                277 uspace/drv/bus/usb/xhci/hc.c 	if ((err = xhci_init_commands(hc)))
hc                280 uspace/drv/bus/usb/xhci/hc.c 	if ((err = xhci_bus_init(&hc->bus, hc)))
hc                283 uspace/drv/bus/usb/xhci/hc.c 	xhci_sw_ring_init(&hc->sw_ring, PAGE_SIZE / sizeof(xhci_trb_t));
hc                288 uspace/drv/bus/usb/xhci/hc.c 	xhci_fini_commands(hc);
hc                290 uspace/drv/bus/usb/xhci/hc.c 	xhci_scratchpad_free(hc);
hc                292 uspace/drv/bus/usb/xhci/hc.c 	xhci_event_ring_fini(&hc->event_ring);
hc                294 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_destroy(hc->event_worker);
hc                296 uspace/drv/bus/usb/xhci/hc.c 	hc->dcbaa = NULL;
hc                297 uspace/drv/bus/usb/xhci/hc.c 	dma_buffer_free(&hc->dcbaa_dma);
hc                363 uspace/drv/bus/usb/xhci/hc.c errno_t hc_irq_code_gen(irq_code_t *code, xhci_hc_t *hc, const hw_res_list_parsed_t *hw_res, int *irq)
hc                385 uspace/drv/bus/usb/xhci/hc.c 		.base = RNGABS(hc->mmio_range),
hc                386 uspace/drv/bus/usb/xhci/hc.c 		.size = RNGSZ(hc->mmio_range),
hc                392 uspace/drv/bus/usb/xhci/hc.c 	void *intr0_iman = RNGABSPTR(hc->mmio_range) +
hc                393 uspace/drv/bus/usb/xhci/hc.c 	    XHCI_REG_RD(hc->cap_regs, XHCI_CAP_RTSOFF) +
hc                395 uspace/drv/bus/usb/xhci/hc.c 	void *usbsts = RNGABSPTR(hc->mmio_range) +
hc                396 uspace/drv/bus/usb/xhci/hc.c 	    XHCI_REG_RD(hc->cap_regs, XHCI_CAP_LENGTH) +
hc                413 uspace/drv/bus/usb/xhci/hc.c errno_t hc_claim(xhci_hc_t *hc, ddf_dev_t *dev)
hc                416 uspace/drv/bus/usb/xhci/hc.c 	if (!hc->legsup)
hc                419 uspace/drv/bus/usb/xhci/hc.c 	if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_CNR), 0))
hc                422 uspace/drv/bus/usb/xhci/hc.c 	usb_log_debug("LEGSUP: bios: %x, os: %x", hc->legsup->sem_bios, hc->legsup->sem_os);
hc                423 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_SET(hc->legsup, XHCI_LEGSUP_SEM_OS, 1);
hc                426 uspace/drv/bus/usb/xhci/hc.c 		    XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_BIOS),
hc                427 uspace/drv/bus/usb/xhci/hc.c 		    XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_OS));
hc                428 uspace/drv/bus/usb/xhci/hc.c 		if (XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_BIOS) == 0) {
hc                429 uspace/drv/bus/usb/xhci/hc.c 			return XHCI_REG_RD(hc->legsup, XHCI_LEGSUP_SEM_OS) == 1 ? EOK : EIO;
hc                441 uspace/drv/bus/usb/xhci/hc.c static errno_t hc_reset(xhci_hc_t *hc)
hc                443 uspace/drv/bus/usb/xhci/hc.c 	if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_CNR), 0))
hc                447 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_CLR(hc->op_regs, XHCI_OP_RS, 1);
hc                450 uspace/drv/bus/usb/xhci/hc.c 	if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_HCH),
hc                455 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_HCRST, 1);
hc                458 uspace/drv/bus/usb/xhci/hc.c 	if (xhci_reg_wait(&hc->op_regs->usbcmd, XHCI_REG_MASK(XHCI_OP_HCRST), 0))
hc                467 uspace/drv/bus/usb/xhci/hc.c errno_t hc_start(xhci_hc_t *hc)
hc                471 uspace/drv/bus/usb/xhci/hc.c 	if ((err = hc_reset(hc)))
hc                474 uspace/drv/bus/usb/xhci/hc.c 	if (xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_CNR), 0))
hc                477 uspace/drv/bus/usb/xhci/hc.c 	uintptr_t dcbaa_phys = dma_buffer_phys_base(&hc->dcbaa_dma);
hc                478 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_WR(hc->op_regs, XHCI_OP_DCBAAP, dcbaa_phys);
hc                479 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_WR(hc->op_regs, XHCI_OP_MAX_SLOTS_EN, hc->max_slots);
hc                482 uspace/drv/bus/usb/xhci/hc.c 	xhci_trb_ring_reset_dequeue_state(&hc->cr.trb_ring, &crcr);
hc                483 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_WR(hc->op_regs, XHCI_OP_CRCR, crcr);
hc                485 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_EWE, 1);
hc                487 uspace/drv/bus/usb/xhci/hc.c 	xhci_event_ring_reset(&hc->event_ring);
hc                489 uspace/drv/bus/usb/xhci/hc.c 	xhci_interrupter_regs_t *intr0 = &hc->rt_regs->ir[0];
hc                490 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_WR(intr0, XHCI_INTR_ERSTSZ, hc->event_ring.segment_count);
hc                491 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_WR(intr0, XHCI_INTR_ERDP, hc->event_ring.dequeue_ptr);
hc                493 uspace/drv/bus/usb/xhci/hc.c 	const uintptr_t erstba_phys = dma_buffer_phys_base(&hc->event_ring.erst);
hc                496 uspace/drv/bus/usb/xhci/hc.c 	if (cap_handle_valid(hc->base.irq_handle)) {
hc                498 uspace/drv/bus/usb/xhci/hc.c 		XHCI_REG_SET(hc->op_regs, XHCI_OP_INTE, 1);
hc                501 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_HSEE, 1);
hc                503 uspace/drv/bus/usb/xhci/hc.c 	xhci_sw_ring_restart(&hc->sw_ring);
hc                504 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_start(hc->event_worker);
hc                506 uspace/drv/bus/usb/xhci/hc.c 	xhci_start_command_ring(hc);
hc                508 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_SET(hc->op_regs, XHCI_OP_RS, 1);
hc                511 uspace/drv/bus/usb/xhci/hc.c 	xhci_rh_start(&hc->rh);
hc                516 uspace/drv/bus/usb/xhci/hc.c static void hc_stop(xhci_hc_t *hc)
hc                519 uspace/drv/bus/usb/xhci/hc.c 	XHCI_REG_CLR(hc->op_regs, XHCI_OP_RS, 1);
hc                525 uspace/drv/bus/usb/xhci/hc.c 	xhci_reg_wait(&hc->op_regs->usbsts, XHCI_REG_MASK(XHCI_OP_HCH),
hc                529 uspace/drv/bus/usb/xhci/hc.c 	xhci_nuke_command_ring(hc);
hc                532 uspace/drv/bus/usb/xhci/hc.c 	xhci_sw_ring_stop(&hc->sw_ring);
hc                533 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_join(hc->event_worker);
hc                539 uspace/drv/bus/usb/xhci/hc.c 	xhci_rh_stop(&hc->rh);
hc                542 uspace/drv/bus/usb/xhci/hc.c static void hc_reinitialize(xhci_hc_t *hc)
hc                545 uspace/drv/bus/usb/xhci/hc.c 	hc_stop(hc);
hc                550 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_recreate(hc->event_worker);
hc                551 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_recreate(hc->rh.event_worker);
hc                554 uspace/drv/bus/usb/xhci/hc.c 	hc_start(hc);
hc                557 uspace/drv/bus/usb/xhci/hc.c static bool hc_is_broken(xhci_hc_t *hc)
hc                559 uspace/drv/bus/usb/xhci/hc.c 	const uint32_t usbcmd = XHCI_REG_RD_FIELD(&hc->op_regs->usbcmd, 32);
hc                560 uspace/drv/bus/usb/xhci/hc.c 	const uint32_t usbsts = XHCI_REG_RD_FIELD(&hc->op_regs->usbsts, 32);
hc                572 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *hc = bus_to_hc(bus);
hc                573 uspace/drv/bus/usb/xhci/hc.c 	int ip = XHCI_REG_RD(hc->rt_regs->ir, XHCI_INTR_IP);
hc                575 uspace/drv/bus/usb/xhci/hc.c 		*status = XHCI_REG_RD(hc->op_regs, XHCI_OP_STATUS);
hc                576 uspace/drv/bus/usb/xhci/hc.c 		XHCI_REG_WR(hc->op_regs, XHCI_OP_STATUS, *status & XHCI_STATUS_ACK_MASK);
hc                577 uspace/drv/bus/usb/xhci/hc.c 		XHCI_REG_WR(hc->rt_regs->ir, XHCI_INTR_IP, 1);
hc                590 uspace/drv/bus/usb/xhci/hc.c static errno_t xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb)
hc                595 uspace/drv/bus/usb/xhci/hc.c 	    ts.tv_sec, NSEC2USEC(ts.tv_nsec), hc->wrap_count);
hc                596 uspace/drv/bus/usb/xhci/hc.c 	hc->wrap_time = SEC2USEC(ts.tv_sec) + NSEC2USEC(ts.tv_nsec);
hc                597 uspace/drv/bus/usb/xhci/hc.c 	++hc->wrap_count;
hc                619 uspace/drv/bus/usb/xhci/hc.c static errno_t hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb)
hc                624 uspace/drv/bus/usb/xhci/hc.c 		return event_handlers_fast[type](hc, trb);
hc                627 uspace/drv/bus/usb/xhci/hc.c 		return xhci_sw_ring_enqueue(&hc->sw_ring, trb);
hc                630 uspace/drv/bus/usb/xhci/hc.c 		return xhci_sw_ring_enqueue(&hc->rh.event_ring, trb);
hc                639 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = arg;
hc                640 uspace/drv/bus/usb/xhci/hc.c 	assert(hc);
hc                642 uspace/drv/bus/usb/xhci/hc.c 	while (xhci_sw_ring_dequeue(&hc->sw_ring, &trb) != EINTR) {
hc                645 uspace/drv/bus/usb/xhci/hc.c 		if ((err = event_handlers[type](hc, &trb)))
hc                658 uspace/drv/bus/usb/xhci/hc.c static void hc_run_event_ring(xhci_hc_t *hc, xhci_event_ring_t *event_ring,
hc                664 uspace/drv/bus/usb/xhci/hc.c 	hc->event_handler = fibril_get_id();
hc                667 uspace/drv/bus/usb/xhci/hc.c 		if ((err = hc_handle_event(hc, &trb)) != EOK) {
hc                671 uspace/drv/bus/usb/xhci/hc.c 		XHCI_REG_WR(intr, XHCI_INTR_ERDP, hc->event_ring.dequeue_ptr);
hc                674 uspace/drv/bus/usb/xhci/hc.c 	hc->event_handler = 0;
hc                676 uspace/drv/bus/usb/xhci/hc.c 	uint64_t erdp = hc->event_ring.dequeue_ptr;
hc                694 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *hc = bus_to_hc(bus);
hc                704 uspace/drv/bus/usb/xhci/hc.c 		hc_reinitialize(hc);
hc                710 uspace/drv/bus/usb/xhci/hc.c 		hc_run_event_ring(hc, &hc->event_ring, &hc->rt_regs->ir[0]);
hc                732 uspace/drv/bus/usb/xhci/hc.c void hc_fini(xhci_hc_t *hc)
hc                734 uspace/drv/bus/usb/xhci/hc.c 	hc_stop(hc);
hc                736 uspace/drv/bus/usb/xhci/hc.c 	xhci_sw_ring_fini(&hc->sw_ring);
hc                737 uspace/drv/bus/usb/xhci/hc.c 	joinable_fibril_destroy(hc->event_worker);
hc                738 uspace/drv/bus/usb/xhci/hc.c 	xhci_bus_fini(&hc->bus);
hc                739 uspace/drv/bus/usb/xhci/hc.c 	xhci_event_ring_fini(&hc->event_ring);
hc                740 uspace/drv/bus/usb/xhci/hc.c 	xhci_scratchpad_free(hc);
hc                741 uspace/drv/bus/usb/xhci/hc.c 	dma_buffer_free(&hc->dcbaa_dma);
hc                742 uspace/drv/bus/usb/xhci/hc.c 	xhci_fini_commands(hc);
hc                743 uspace/drv/bus/usb/xhci/hc.c 	xhci_rh_fini(&hc->rh);
hc                744 uspace/drv/bus/usb/xhci/hc.c 	pio_disable(hc->reg_base, RNGSZ(hc->mmio_range));
hc                757 uspace/drv/bus/usb/xhci/hc.c void hc_ring_doorbell(xhci_hc_t *hc, unsigned doorbell, unsigned target)
hc                759 uspace/drv/bus/usb/xhci/hc.c 	assert(hc);
hc                761 uspace/drv/bus/usb/xhci/hc.c 	pio_write_32(&hc->db_arry[doorbell], v);
hc                778 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                781 uspace/drv/bus/usb/xhci/hc.c 	hc_ring_doorbell(hc, dev->slot_id, target);
hc                791 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                794 uspace/drv/bus/usb/xhci/hc.c 	if ((err = dma_buffer_alloc(&dev->dev_ctx, XHCI_DEVICE_CTX_SIZE(hc))))
hc                796 uspace/drv/bus/usb/xhci/hc.c 	memset(dev->dev_ctx.virt, 0, XHCI_DEVICE_CTX_SIZE(hc));
hc                802 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                807 uspace/drv/bus/usb/xhci/hc.c 		hc->dcbaa[dev->slot_id] =
hc                826 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                831 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                837 uspace/drv/bus/usb/xhci/hc.c 	hc->dcbaa[dev->slot_id] = 0;
hc                851 uspace/drv/bus/usb/xhci/hc.c 	const xhci_hc_t *hc = bus_to_hc(dev->base.bus);
hc                852 uspace/drv/bus/usb/xhci/hc.c 	const errno_t err = dma_buffer_alloc(dma_buf, XHCI_INPUT_CTX_SIZE(hc));
hc                857 uspace/drv/bus/usb/xhci/hc.c 	memset(ictx, 0, XHCI_INPUT_CTX_SIZE(hc));
hc                860 uspace/drv/bus/usb/xhci/hc.c 	XHCI_INPUT_CTRL_CTX_ADD_SET(*XHCI_GET_CTRL_CTX(ictx, hc), 0);
hc                861 uspace/drv/bus/usb/xhci/hc.c 	xhci_slot_ctx_t *slot_ctx = XHCI_GET_SLOT_CTX(XHCI_GET_DEVICE_CTX(ictx, hc), hc);
hc                875 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                895 uspace/drv/bus/usb/xhci/hc.c 	XHCI_INPUT_CTRL_CTX_ADD_SET(*XHCI_GET_CTRL_CTX(ictx, hc), 1);
hc                896 uspace/drv/bus/usb/xhci/hc.c 	xhci_ep_ctx_t *ep_ctx = XHCI_GET_EP_CTX(XHCI_GET_DEVICE_CTX(ictx, hc), hc, 1);
hc                900 uspace/drv/bus/usb/xhci/hc.c 	xhci_slot_ctx_t *slot_ctx = XHCI_GET_SLOT_CTX(XHCI_GET_DEVICE_CTX(ictx, hc), hc);
hc                908 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                914 uspace/drv/bus/usb/xhci/hc.c 	dev->base.address = XHCI_SLOT_DEVICE_ADDRESS(*XHCI_GET_SLOT_CTX(device_ctx, hc));
hc                927 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                939 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                952 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                956 uspace/drv/bus/usb/xhci/hc.c 	if (hc_is_broken(hc))
hc                964 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                991 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc                992 uspace/drv/bus/usb/xhci/hc.c 	XHCI_INPUT_CTRL_CTX_ADD_SET(*XHCI_GET_CTRL_CTX(ictx, hc), dci);
hc                994 uspace/drv/bus/usb/xhci/hc.c 	xhci_ep_ctx_t *ep_ctx = XHCI_GET_EP_CTX(XHCI_GET_DEVICE_CTX(ictx, hc), hc, dci);
hc               1000 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc               1015 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc               1019 uspace/drv/bus/usb/xhci/hc.c 	if (hc_is_broken(hc))
hc               1029 uspace/drv/bus/usb/xhci/hc.c 	XHCI_INPUT_CTRL_CTX_DROP_SET(*XHCI_GET_CTRL_CTX(ictx, hc), dci);
hc               1034 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc               1055 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc               1057 uspace/drv/bus/usb/xhci/hc.c 	errno_t err = dma_buffer_alloc(&ictx_dma_buf, XHCI_INPUT_CTX_SIZE(hc));
hc               1062 uspace/drv/bus/usb/xhci/hc.c 	memset(ictx, 0, XHCI_INPUT_CTX_SIZE(hc));
hc               1064 uspace/drv/bus/usb/xhci/hc.c 	XHCI_INPUT_CTRL_CTX_ADD_SET(*XHCI_GET_CTRL_CTX(ictx, hc), dci);
hc               1065 uspace/drv/bus/usb/xhci/hc.c 	xhci_ep_ctx_t *ep_ctx = XHCI_GET_EP_CTX(XHCI_GET_DEVICE_CTX(ictx, hc), hc, dci);
hc               1071 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc               1087 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc               1091 uspace/drv/bus/usb/xhci/hc.c 	if (hc_is_broken(hc))
hc               1097 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc               1113 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(dev->base.bus);
hc               1120 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc               1142 uspace/drv/bus/usb/xhci/hc.c 	xhci_hc_t *const hc = bus_to_hc(endpoint_get_bus(&ep->base));
hc               1149 uspace/drv/bus/usb/xhci/hc.c 	err = xhci_cmd_sync(hc, &cmd);
hc                178 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_ONE_CTX_SIZE(hc) (XHCI_CTX_SIZE_SMALL << hc->csz)
hc                179 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_GET_CTX_FIELD(type, ctx, hc, ci) \
hc                180 uspace/drv/bus/usb/xhci/hw_struct/context.h     (xhci_##type##_ctx_to_charptr(ctx) + (ci) * XHCI_ONE_CTX_SIZE(hc))
hc                185 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_DEVICE_CTX_SIZE(hc) ((1 + XHCI_EP_COUNT) * XHCI_ONE_CTX_SIZE(hc))
hc                186 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_GET_EP_CTX(dev_ctx, hc, dci) \
hc                187 uspace/drv/bus/usb/xhci/hw_struct/context.h     ((xhci_ep_ctx_t *)   XHCI_GET_CTX_FIELD(device, (dev_ctx), (hc), (dci)))
hc                188 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_GET_SLOT_CTX(dev_ctx, hc) \
hc                189 uspace/drv/bus/usb/xhci/hw_struct/context.h     ((xhci_slot_ctx_t *) XHCI_GET_CTX_FIELD(device, (dev_ctx), (hc), 0))
hc                259 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_INPUT_CTX_SIZE(hc) (XHCI_ONE_CTX_SIZE(hc) + XHCI_DEVICE_CTX_SIZE(hc))
hc                260 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_GET_CTRL_CTX(ictx, hc) \
hc                261 uspace/drv/bus/usb/xhci/hw_struct/context.h     ((xhci_input_ctrl_ctx_t *) XHCI_GET_CTX_FIELD(input, (ictx), (hc), 0))
hc                262 uspace/drv/bus/usb/xhci/hw_struct/context.h #define XHCI_GET_DEVICE_CTX(dev_ctx, hc) \
hc                263 uspace/drv/bus/usb/xhci/hw_struct/context.h     ((xhci_device_ctx_t *) XHCI_GET_CTX_FIELD(input, (ictx), (hc), 1))
hc                 56 uspace/drv/bus/usb/xhci/isoch.c 	const xhci_hc_t *hc = bus_to_xhci_bus(ep->base.device->bus)->hc;
hc                 62 uspace/drv/bus/usb/xhci/isoch.c 	isoch->buffer_count = (2 * hc->ist) / ep->interval;
hc                217 uspace/drv/bus/usb/xhci/isoch.c static inline uint64_t get_current_microframe(const xhci_hc_t *hc)
hc                219 uspace/drv/bus/usb/xhci/isoch.c 	const uint32_t reg_mfindex = XHCI_REG_RD(hc->rt_regs, XHCI_RT_MFINDEX);
hc                225 uspace/drv/bus/usb/xhci/isoch.c 	uint64_t epoch = hc->wrap_count;
hc                227 uspace/drv/bus/usb/xhci/isoch.c 	    get_system_time() - hc->wrap_time > EPOCH_DELAY) {
hc                238 uspace/drv/bus/usb/xhci/isoch.c 		const xhci_hc_t *hc = bus->hc;
hc                245 uspace/drv/bus/usb/xhci/isoch.c 		it->mfindex = get_current_microframe(hc) + 1 + delay + hc->ist;
hc                275 uspace/drv/bus/usb/xhci/isoch.c static inline void window_decide(window_decision_t *res, xhci_hc_t *hc,
hc                278 uspace/drv/bus/usb/xhci/isoch.c 	const uint64_t current_mf = get_current_microframe(hc);
hc                279 uspace/drv/bus/usb/xhci/isoch.c 	const uint64_t start = current_mf + hc->ist + 1;
hc                310 uspace/drv/bus/usb/xhci/isoch.c 	xhci_hc_t *hc = bus->hc;
hc                321 uspace/drv/bus/usb/xhci/isoch.c 		window_decide(&wd, hc, it->mfindex);
hc                396 uspace/drv/bus/usb/xhci/isoch.c 	xhci_hc_t *hc = bus->hc;
hc                412 uspace/drv/bus/usb/xhci/isoch.c 		window_decide(&wd, hc, it->mfindex);
hc                590 uspace/drv/bus/usb/xhci/isoch.c void isoch_handle_transfer_event(xhci_hc_t *hc, xhci_endpoint_t *ep,
hc                 58 uspace/drv/bus/usb/xhci/main.c 	xhci_hc_t *hc = hcd_to_hc(hcd);
hc                 59 uspace/drv/bus/usb/xhci/main.c 	hc_device_setup(hcd, (bus_t *) &hc->bus);
hc                 61 uspace/drv/bus/usb/xhci/main.c 	if ((err = hc_init_mmio(hc, hw_res)))
hc                 64 uspace/drv/bus/usb/xhci/main.c 	if ((err = hc_init_memory(hc, hcd->ddf_dev)))
hc                 73 uspace/drv/bus/usb/xhci/main.c 	xhci_hc_t *hc = hcd_to_hc(hcd);
hc                 74 uspace/drv/bus/usb/xhci/main.c 	return hc_irq_code_gen(code, hc, hw_res, irq);
hc                 79 uspace/drv/bus/usb/xhci/main.c 	xhci_hc_t *hc = hcd_to_hc(hcd);
hc                 80 uspace/drv/bus/usb/xhci/main.c 	return hc_claim(hc, hcd->ddf_dev);
hc                 85 uspace/drv/bus/usb/xhci/main.c 	xhci_hc_t *hc = hcd_to_hc(hcd);
hc                 86 uspace/drv/bus/usb/xhci/main.c 	return hc_start(hc);
hc                 91 uspace/drv/bus/usb/xhci/main.c 	xhci_hc_t *hc = hcd_to_hc(hcd);
hc                 92 uspace/drv/bus/usb/xhci/main.c 	hc_fini(hc);
hc                 81 uspace/drv/bus/usb/xhci/rh.c errno_t xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc)
hc                 84 uspace/drv/bus/usb/xhci/rh.c 	assert(hc);
hc                 86 uspace/drv/bus/usb/xhci/rh.c 	rh->hc = hc;
hc                 87 uspace/drv/bus/usb/xhci/rh.c 	rh->max_ports = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PORTS);
hc                 92 uspace/drv/bus/usb/xhci/rh.c 	const errno_t err = bus_device_init(&rh->device.base, &rh->hc->bus.base);
hc                107 uspace/drv/bus/usb/xhci/rh.c 		rh->ports[i].regs = &rh->hc->op_regs->portrs[i];
hc                171 uspace/drv/bus/usb/xhci/rh.c 	const usb_speed_t speed = port->rh->hc->speeds[psiv].usb_speed;
hc                173 uspace/drv/bus/usb/xhci/rh.c 	device_t *dev = hcd_ddf_fun_create(&port->rh->hc->base, speed);
hc                 66 uspace/drv/bus/usb/xhci/rh.h 	xhci_hc_t *hc;
hc                 46 uspace/drv/bus/usb/xhci/scratchpad.c static inline unsigned xhci_scratchpad_count(xhci_hc_t *hc)
hc                 50 uspace/drv/bus/usb/xhci/scratchpad.c 	lo = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_SPBUF_LO);
hc                 51 uspace/drv/bus/usb/xhci/scratchpad.c 	hi = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_SPBUF_HI);
hc                 59 uspace/drv/bus/usb/xhci/scratchpad.c errno_t xhci_scratchpad_alloc(xhci_hc_t *hc)
hc                 61 uspace/drv/bus/usb/xhci/scratchpad.c 	const unsigned num_bufs = xhci_scratchpad_count(hc);
hc                 69 uspace/drv/bus/usb/xhci/scratchpad.c 	if (dma_buffer_alloc(&hc->scratchpad_array, size))
hc                 72 uspace/drv/bus/usb/xhci/scratchpad.c 	memset(hc->scratchpad_array.virt, 0, size);
hc                 74 uspace/drv/bus/usb/xhci/scratchpad.c 	const char *base = hc->scratchpad_array.virt + array_size;
hc                 75 uspace/drv/bus/usb/xhci/scratchpad.c 	uint64_t *array = hc->scratchpad_array.virt;
hc                 78 uspace/drv/bus/usb/xhci/scratchpad.c 		array[i] = host2xhci(64, dma_buffer_phys(&hc->scratchpad_array,
hc                 82 uspace/drv/bus/usb/xhci/scratchpad.c 	hc->dcbaa[0] = host2xhci(64, dma_buffer_phys_base(&hc->scratchpad_array));
hc                 92 uspace/drv/bus/usb/xhci/scratchpad.c void xhci_scratchpad_free(xhci_hc_t *hc)
hc                 94 uspace/drv/bus/usb/xhci/scratchpad.c 	const unsigned num_bufs = xhci_scratchpad_count(hc);
hc                 99 uspace/drv/bus/usb/xhci/scratchpad.c 	hc->dcbaa[0] = 0;
hc                100 uspace/drv/bus/usb/xhci/scratchpad.c 	dma_buffer_free(&hc->scratchpad_array);
hc                154 uspace/drv/bus/usb/xhci/streams.c static errno_t initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
hc                180 uspace/drv/bus/usb/xhci/streams.c static errno_t initialize_primary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep)
hc                185 uspace/drv/bus/usb/xhci/streams.c 		err = initialize_primary_stream(hc, xhci_ep, index);
hc                207 uspace/drv/bus/usb/xhci/streams.c static errno_t initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
hc                215 uspace/drv/bus/usb/xhci/streams.c 		return initialize_primary_stream(hc, xhci_ep, idx);
hc                296 uspace/drv/bus/usb/xhci/streams.c static errno_t verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,
hc                320 uspace/drv/bus/usb/xhci/streams.c 	uint8_t max_psa_size = 1 << (XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PSA_SIZE) + 1);
hc                347 uspace/drv/bus/usb/xhci/streams.c errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,
hc                375 uspace/drv/bus/usb/xhci/streams.c errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
hc                378 uspace/drv/bus/usb/xhci/streams.c 	errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count);
hc                396 uspace/drv/bus/usb/xhci/streams.c 	err = initialize_primary_streams(hc, xhci_ep);
hc                423 uspace/drv/bus/usb/xhci/streams.c errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
hc                427 uspace/drv/bus/usb/xhci/streams.c 	if (XHCI_REG_RD(hc->cap_regs, XHCI_CAP_NSS)) {
hc                432 uspace/drv/bus/usb/xhci/streams.c 	errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count);
hc                475 uspace/drv/bus/usb/xhci/streams.c 		err = initialize_secondary_streams(hc, xhci_ep, index, *(sizes + index));
hc                185 uspace/drv/bus/usb/xhci/transfers.c static errno_t schedule_control(xhci_hc_t *hc, xhci_transfer_t *transfer)
hc                245 uspace/drv/bus/usb/xhci/transfers.c static errno_t schedule_bulk_intr(xhci_hc_t *hc, xhci_transfer_t *transfer)
hc                293 uspace/drv/bus/usb/xhci/transfers.c errno_t xhci_handle_transfer_event(xhci_hc_t *hc, xhci_trb_t *trb)
hc                299 uspace/drv/bus/usb/xhci/transfers.c 	xhci_device_t *dev = hc->bus.devices_by_slot[slot_id];
hc                332 uspace/drv/bus/usb/xhci/transfers.c 			isoch_handle_transfer_event(hc, ep, trb);
hc                427 uspace/drv/bus/usb/xhci/transfers.c 	xhci_hc_t *hc = bus_to_hc(endpoint_get_bus(batch->ep));
hc                502 uspace/drv/bus/usb/xhci/transfers.c 	if ((err = transfer_handlers[batch->ep->transfer_type](hc, transfer))) {
hc                153 uspace/lib/usbhost/src/ddf_helpers.c 	ddf_dev_t *hc = ddf_fun_get_dev(fun);
hc                154 uspace/lib/usbhost/src/ddf_helpers.c 	assert(hc);
hc                155 uspace/lib/usbhost/src/ddf_helpers.c 	hc_device_t *hcd = dev_to_hcd(hc);
hc                393 uspace/lib/usbhost/src/ddf_helpers.c device_t *hcd_ddf_fun_create(hc_device_t *hc, usb_speed_t speed)
hc                396 uspace/lib/usbhost/src/ddf_helpers.c 	ddf_fun_t *fun = ddf_fun_create(hc->ddf_dev, fun_inner, NULL);
hc                403 uspace/lib/usbhost/src/ddf_helpers.c 	device_t *dev = ddf_fun_data_alloc(fun, hc->bus->device_size);
hc                409 uspace/lib/usbhost/src/ddf_helpers.c 	bus_device_init(dev, hc->bus);
HelenOS homepage, sources at GitHub