Page MenuHomeFreeBSD

D58872.id184138.diff
No OneTemporary

D58872.id184138.diff

diff --git a/sys/dev/apple_bce/apple_bce_vhci.c b/sys/dev/apple_bce/apple_bce_vhci.c
--- a/sys/dev/apple_bce/apple_bce_vhci.c
+++ b/sys/dev/apple_bce/apple_bce_vhci.c
@@ -1771,6 +1771,109 @@
vhci, tq,
&tq->ctrl_status_msg);
}
+ if (tq->ctrl_state == BCE_VHCI_CTRL_DATA &&
+ tq->ctrl_dir == UE_DIR_IN) {
+ struct bce_vhci_message treq;
+ struct bce_qe_submission *si;
+ struct usb_xfer *xfer;
+ uint32_t dlen;
+
+ dlen = tq->ctrl_data_len;
+ if (dlen > BCE_VHCI_XFER_BUFSZ)
+ dlen = BCE_VHCI_XFER_BUFSZ;
+
+ xfer = tq->active_xfer;
+ tq->ctrl_state =
+ BCE_VHCI_CTRL_STATUS;
+ USB_BUS_UNLOCK(&vhci->sc_bus);
+
+ memset(&treq, 0, sizeof(treq));
+ treq.cmd =
+ BCE_VHCI_CMD_TRANSFER_REQUEST;
+ treq.param1 =
+ ((uint32_t)tq->endp_addr
+ << 8) |
+ tq->dev_addr;
+ treq.param2 = dlen;
+
+ bus_dmamap_sync(tq->dma_tag,
+ tq->dma_map,
+ BUS_DMASYNC_PREREAD);
+
+ mtx_lock_spin(
+ &vhci->sc_async_lock);
+ if (bce_reserve_submission(
+ vhci->msg_asynchronous.sq)
+ != 0) {
+ mtx_unlock_spin(
+ &vhci->sc_async_lock);
+ USB_BUS_LOCK(
+ &vhci->sc_bus);
+ if (tq->active_xfer == xfer) {
+ tq->active_xfer = NULL;
+ tq->dma_inflight = 0;
+ tq->ctrl_state =
+ BCE_VHCI_CTRL_IDLE;
+ usbd_transfer_done(xfer,
+ USB_ERR_IOERROR);
+ }
+ USB_BUS_UNLOCK(
+ &vhci->sc_bus);
+ goto next_compl;
+ }
+ mtx_unlock_spin(
+ &vhci->sc_async_lock);
+
+ mtx_lock_spin(&tq->lock);
+ if (bce_reserve_submission(
+ tq->sq_in) != 0) {
+ mtx_unlock_spin(
+ &tq->lock);
+ mtx_lock_spin(
+ &vhci->sc_async_lock);
+ atomic_add_int(
+ &vhci->
+ msg_asynchronous.sq->
+ available_commands,
+ 1);
+ mtx_unlock_spin(
+ &vhci->sc_async_lock);
+ USB_BUS_LOCK(
+ &vhci->sc_bus);
+ if (tq->active_xfer == xfer) {
+ tq->active_xfer = NULL;
+ tq->dma_inflight = 0;
+ tq->ctrl_state =
+ BCE_VHCI_CTRL_IDLE;
+ usbd_transfer_done(xfer,
+ USB_ERR_IOERROR);
+ }
+ USB_BUS_UNLOCK(
+ &vhci->sc_bus);
+ goto next_compl;
+ }
+ si = bce_next_submission(
+ tq->sq_in);
+ si->addr = tq->dma_addr;
+ si->length = dlen;
+ si->segl_addr = 0;
+ si->segl_length = 0;
+ bce_submit_to_device(
+ vhci->sc_bce,
+ tq->sq_in);
+ mtx_unlock_spin(&tq->lock);
+
+ mtx_lock_spin(
+ &vhci->sc_async_lock);
+ bce_vhci_msg_queue_write(
+ vhci,
+ &vhci->msg_asynchronous,
+ &treq);
+ mtx_unlock_spin(
+ &vhci->sc_async_lock);
+
+ USB_BUS_LOCK(&vhci->sc_bus);
+ }
} else if (tq->ctrl_state ==
BCE_VHCI_CTRL_STATUS &&
tq->ctrl_dir == UE_DIR_OUT) {

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 24, 8:45 AM (1 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36865487
Default Alt Text
D58872.id184138.diff (2 KB)

Event Timeline