Index: uspace/drv/bus/usb/xhci/hc.c
===================================================================
--- uspace/drv/bus/usb/xhci/hc.c	(revision eadaeae8dacc68cf558028f23cc96b90a08b7361)
+++ uspace/drv/bus/usb/xhci/hc.c	(revision e217228446aaaeda030cdfb8c3d6708255adacbb)
@@ -822,8 +822,12 @@
 	errno_t err;
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
-
-	if ((err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = dev->slot_id))) {
+	xhci_cmd_t cmd;
+
+	xhci_cmd_init(&cmd, XHCI_CMD_DISABLE_SLOT);
+	cmd.slot_id = dev->slot_id;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+	if (err != EOK)
 		return err;
-	}
 
 	/* Free the device context. */
@@ -893,8 +897,11 @@
 
 	/* Issue Address Device command. */
-	if ((err = xhci_cmd_sync_inline(hc, ADDRESS_DEVICE,
-		.slot_id = dev->slot_id,
-		.input_ctx = ictx_dma_buf
-	    )))
+	xhci_cmd_t cmd;
+	xhci_cmd_init(&cmd, XHCI_CMD_ADDRESS_DEVICE);
+	cmd.slot_id = dev->slot_id;
+	cmd.input_ctx = ictx_dma_buf;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+	if (err != EOK)
 		return err;
 
@@ -914,15 +921,19 @@
 {
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
+	xhci_cmd_t cmd;
 
 	/* Issue configure endpoint command (sec 4.3.5). */
 	dma_buffer_t ictx_dma_buf;
-	const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
-	if (err)
+	errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
+	if (err != EOK)
 		return err;
 
-	return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.input_ctx = ictx_dma_buf
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_CONFIGURE_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.input_ctx = ictx_dma_buf;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -935,4 +946,6 @@
 {
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
+	xhci_cmd_t cmd;
+	errno_t err;
 
 	if (hc_is_broken(hc))
@@ -940,8 +953,12 @@
 
 	/* Issue configure endpoint command (sec 4.3.5) with the DC flag. */
-	return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.deconfigure = true
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_CONFIGURE_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.deconfigure = true;
+
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -957,9 +974,10 @@
 	xhci_device_t * const dev = xhci_ep_to_dev(ep);
 	const unsigned dci = endpoint_dci(ep);
+	xhci_cmd_t cmd;
 
 	/* Issue configure endpoint command (sec 4.3.5). */
 	dma_buffer_t ictx_dma_buf;
-	const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
-	if (err)
+	errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
+	if (err != EOK)
 		return err;
 
@@ -972,8 +990,11 @@
 	xhci_setup_endpoint_context(ep, ep_ctx);
 
-	return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.input_ctx = ictx_dma_buf
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_CONFIGURE_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.input_ctx = ictx_dma_buf;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -989,4 +1010,5 @@
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
 	const unsigned dci = endpoint_dci(ep);
+	xhci_cmd_t cmd;
 
 	if (hc_is_broken(hc))
@@ -995,6 +1017,6 @@
 	/* Issue configure endpoint command (sec 4.3.5). */
 	dma_buffer_t ictx_dma_buf;
-	const errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
-	if (err)
+	errno_t err = create_configure_ep_input_ctx(dev, &ictx_dma_buf);
+	if (err != EOK)
 		return err;
 
@@ -1002,8 +1024,11 @@
 	XHCI_INPUT_CTRL_CTX_DROP_SET(*XHCI_GET_CTRL_CTX(ictx, hc), dci);
 
-	return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.input_ctx = ictx_dma_buf
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_CONFIGURE_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.input_ctx = ictx_dma_buf;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -1020,10 +1045,11 @@
 	xhci_device_t * const dev = xhci_ep_to_dev(ep);
 	const unsigned dci = endpoint_dci(ep);
+	xhci_cmd_t cmd;
 
 	dma_buffer_t ictx_dma_buf;
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
 
-	const errno_t err = dma_buffer_alloc(&ictx_dma_buf, XHCI_INPUT_CTX_SIZE(hc));
-	if (err)
+	errno_t err = dma_buffer_alloc(&ictx_dma_buf, XHCI_INPUT_CTX_SIZE(hc));
+	if (err != EOK)
 		return err;
 
@@ -1035,8 +1061,11 @@
 	xhci_setup_endpoint_context(ep, ep_ctx);
 
-	return xhci_cmd_sync_inline(hc, EVALUATE_CONTEXT,
-		.slot_id = dev->slot_id,
-		.input_ctx = ictx_dma_buf
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_EVALUATE_CONTEXT);
+	cmd.slot_id = dev->slot_id;
+	cmd.input_ctx = ictx_dma_buf;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -1052,12 +1081,17 @@
 	const unsigned dci = endpoint_dci(ep);
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
+	xhci_cmd_t cmd;
+	errno_t err;
 
 	if (hc_is_broken(hc))
 		return EOK;
 
-	return xhci_cmd_sync_inline(hc, STOP_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.endpoint_id = dci
-	);
+	xhci_cmd_init(&cmd, XHCI_CMD_STOP_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.endpoint_id = dci;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -1073,8 +1107,14 @@
 	const unsigned dci = endpoint_dci(ep);
 	xhci_hc_t * const hc = bus_to_hc(dev->base.bus);
-	return xhci_cmd_sync_inline(hc, RESET_ENDPOINT,
-		.slot_id = dev->slot_id,
-		.endpoint_id = dci
-	);
+	xhci_cmd_t cmd;
+	errno_t err;
+
+	xhci_cmd_init(&cmd, XHCI_CMD_RESET_ENDPOINT);
+	cmd.slot_id = dev->slot_id;
+	cmd.endpoint_id = dci;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
@@ -1089,4 +1129,6 @@
 	const unsigned dci = endpoint_dci(ep);
 	uintptr_t addr;
+	xhci_cmd_t cmd;
+	errno_t err;
 
 	xhci_trb_ring_t *ring = xhci_endpoint_get_ring(ep, stream_id);
@@ -1094,10 +1136,14 @@
 
 	xhci_hc_t * const hc = bus_to_hc(endpoint_get_bus(&ep->base));
-	return xhci_cmd_sync_inline(hc, SET_TR_DEQUEUE_POINTER,
-		.slot_id = dev->slot_id,
-		.endpoint_id = dci,
-		.stream_id = stream_id,
-		.dequeue_ptr = addr,
-	);
+
+	xhci_cmd_init(&cmd, XHCI_CMD_SET_TR_DEQUEUE_POINTER);
+	cmd.slot_id = dev->slot_id;
+	cmd.endpoint_id = dci;
+	cmd.stream_id = stream_id;
+	cmd.dequeue_ptr = addr;
+	err = xhci_cmd_sync(hc, &cmd);
+	xhci_cmd_fini(&cmd);
+
+	return err;
 }
 
