mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
xhci: drop XHCITransfer->xhci
Use XHCITransfer->epctx->xhci instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1474965172-30321-6-git-send-email-kraxel@redhat.com
This commit is contained in:
parent
94b037f2a4
commit
5612564ea9
1 changed files with 9 additions and 13 deletions
|
@ -344,7 +344,6 @@ typedef struct XHCIPort {
|
||||||
} XHCIPort;
|
} XHCIPort;
|
||||||
|
|
||||||
typedef struct XHCITransfer {
|
typedef struct XHCITransfer {
|
||||||
XHCIState *xhci;
|
|
||||||
XHCIEPContext *epctx;
|
XHCIEPContext *epctx;
|
||||||
USBPacket packet;
|
USBPacket packet;
|
||||||
QEMUSGList sgl;
|
QEMUSGList sgl;
|
||||||
|
@ -1449,7 +1448,6 @@ static XHCITransfer *xhci_ep_alloc_xfer(XHCIEPContext *epctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
xfer = g_new0(XHCITransfer, 1);
|
xfer = g_new0(XHCITransfer, 1);
|
||||||
xfer->xhci = epctx->xhci;
|
|
||||||
xfer->epctx = epctx;
|
xfer->epctx = epctx;
|
||||||
xfer->slotid = epctx->slotid;
|
xfer->slotid = epctx->slotid;
|
||||||
xfer->epid = epctx->epid;
|
xfer->epid = epctx->epid;
|
||||||
|
@ -1488,10 +1486,9 @@ static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)
|
||||||
killed = 1;
|
killed = 1;
|
||||||
}
|
}
|
||||||
if (t->running_retry) {
|
if (t->running_retry) {
|
||||||
XHCIEPContext *epctx = t->xhci->slots[t->slotid-1].eps[t->epid-1];
|
if (t->epctx) {
|
||||||
if (epctx) {
|
t->epctx->retry = NULL;
|
||||||
epctx->retry = NULL;
|
timer_del(t->epctx->kick_timer);
|
||||||
timer_del(epctx->kick_timer);
|
|
||||||
}
|
}
|
||||||
t->running_retry = 0;
|
t->running_retry = 0;
|
||||||
killed = 1;
|
killed = 1;
|
||||||
|
@ -1721,7 +1718,7 @@ static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid,
|
||||||
|
|
||||||
static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
||||||
{
|
{
|
||||||
XHCIState *xhci = xfer->xhci;
|
XHCIState *xhci = xfer->epctx->xhci;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
xfer->int_req = false;
|
xfer->int_req = false;
|
||||||
|
@ -1780,7 +1777,7 @@ static void xhci_xfer_report(XHCITransfer *xfer)
|
||||||
bool reported = 0;
|
bool reported = 0;
|
||||||
bool shortpkt = 0;
|
bool shortpkt = 0;
|
||||||
XHCIEvent event = {ER_TRANSFER, CC_SUCCESS};
|
XHCIEvent event = {ER_TRANSFER, CC_SUCCESS};
|
||||||
XHCIState *xhci = xfer->xhci;
|
XHCIState *xhci = xfer->epctx->xhci;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
left = xfer->packet.actual_length;
|
left = xfer->packet.actual_length;
|
||||||
|
@ -1854,9 +1851,8 @@ static void xhci_xfer_report(XHCITransfer *xfer)
|
||||||
|
|
||||||
static void xhci_stall_ep(XHCITransfer *xfer)
|
static void xhci_stall_ep(XHCITransfer *xfer)
|
||||||
{
|
{
|
||||||
XHCIState *xhci = xfer->xhci;
|
XHCIEPContext *epctx = xfer->epctx;
|
||||||
XHCISlot *slot = &xhci->slots[xfer->slotid-1];
|
XHCIState *xhci = epctx->xhci;
|
||||||
XHCIEPContext *epctx = slot->eps[xfer->epid-1];
|
|
||||||
uint32_t err;
|
uint32_t err;
|
||||||
XHCIStreamContext *sctx;
|
XHCIStreamContext *sctx;
|
||||||
|
|
||||||
|
@ -1880,7 +1876,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer,
|
||||||
|
|
||||||
static int xhci_setup_packet(XHCITransfer *xfer)
|
static int xhci_setup_packet(XHCITransfer *xfer)
|
||||||
{
|
{
|
||||||
XHCIState *xhci = xfer->xhci;
|
XHCIState *xhci = xfer->epctx->xhci;
|
||||||
USBEndpoint *ep;
|
USBEndpoint *ep;
|
||||||
int dir;
|
int dir;
|
||||||
|
|
||||||
|
@ -3490,7 +3486,7 @@ static void xhci_complete(USBPort *port, USBPacket *packet)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xhci_complete_packet(xfer);
|
xhci_complete_packet(xfer);
|
||||||
xhci_kick_ep(xfer->xhci, xfer->slotid, xfer->epid, xfer->streamid);
|
xhci_kick_ep(xfer->epctx->xhci, xfer->slotid, xfer->epid, xfer->streamid);
|
||||||
if (xfer->complete) {
|
if (xfer->complete) {
|
||||||
xhci_ep_free_xfer(xfer);
|
xhci_ep_free_xfer(xfer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue