- XHCI fixes
This commit is contained in:
Tom Rini 2021-04-06 14:11:21 -04:00
commit 2e216be8cf
3 changed files with 10 additions and 12 deletions

View File

@ -144,7 +144,8 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data)
if (!usb_hub_is_root_hub(dev->dev) && usb_hub_is_superspeed(dev)) { if (!usb_hub_is_root_hub(dev->dev) && usb_hub_is_superspeed(dev)) {
struct usb_port_status *status = (struct usb_port_status *)data; struct usb_port_status *status = (struct usb_port_status *)data;
u16 tmp = (status->wPortStatus) & USB_SS_PORT_STAT_MASK; u16 tmp = le16_to_cpu(status->wPortStatus) &
USB_SS_PORT_STAT_MASK;
if (status->wPortStatus & USB_SS_PORT_STAT_POWER) if (status->wPortStatus & USB_SS_PORT_STAT_POWER)
tmp |= USB_PORT_STAT_POWER; tmp |= USB_PORT_STAT_POWER;
@ -152,7 +153,7 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data)
USB_SS_PORT_STAT_SPEED_5GBPS) USB_SS_PORT_STAT_SPEED_5GBPS)
tmp |= USB_PORT_STAT_SUPER_SPEED; tmp |= USB_PORT_STAT_SUPER_SPEED;
status->wPortStatus = tmp; status->wPortStatus = cpu_to_le16(tmp);
} }
#endif #endif

View File

@ -434,9 +434,9 @@ static struct xhci_container_ctx
BUG_ON((type != XHCI_CTX_TYPE_DEVICE) && (type != XHCI_CTX_TYPE_INPUT)); BUG_ON((type != XHCI_CTX_TYPE_DEVICE) && (type != XHCI_CTX_TYPE_INPUT));
ctx->type = type; ctx->type = type;
ctx->size = (MAX_EP_CTX_NUM + 1) * ctx->size = (MAX_EP_CTX_NUM + 1) *
CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)); CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams));
if (type == XHCI_CTX_TYPE_INPUT) if (type == XHCI_CTX_TYPE_INPUT)
ctx->size += CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)); ctx->size += CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams));
ctx->bytes = xhci_malloc(ctx->size); ctx->bytes = xhci_malloc(ctx->size);
@ -636,7 +636,7 @@ struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_ctrl *ctrl,
return (struct xhci_slot_ctx *)ctx->bytes; return (struct xhci_slot_ctx *)ctx->bytes;
return (struct xhci_slot_ctx *) return (struct xhci_slot_ctx *)
(ctx->bytes + CTX_SIZE(readl(&ctrl->hccr->cr_hccparams))); (ctx->bytes + CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams)));
} }
/** /**
@ -658,7 +658,7 @@ struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_ctrl *ctrl,
return (struct xhci_ep_ctx *) return (struct xhci_ep_ctx *)
(ctx->bytes + (ctx->bytes +
(ep_index * CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)))); (ep_index * CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams))));
} }
/** /**

View File

@ -849,12 +849,9 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe,
} }
} }
debug("req->requesttype = %d, req->request = %d," debug("req->requesttype = %d, req->request = %d, req->value = %d, req->index = %d, req->length = %d\n",
"le16_to_cpu(req->value) = %d," req->requesttype, req->request, le16_to_cpu(req->value),
"le16_to_cpu(req->index) = %d," le16_to_cpu(req->index), le16_to_cpu(req->length));
"le16_to_cpu(req->length) = %d\n",
req->requesttype, req->request, le16_to_cpu(req->value),
le16_to_cpu(req->index), le16_to_cpu(req->length));
trb_fields[0] = req->requesttype | req->request << 8 | trb_fields[0] = req->requesttype | req->request << 8 |
le16_to_cpu(req->value) << 16; le16_to_cpu(req->value) << 16;