Changeset View
Standalone View
usr.sbin/bhyve/pci_xhci.c
/*- | /*- | ||||
* Copyright (c) 2014 Leon Dang <ldang@nahannisys.com> | * Copyright (c) 2014 Leon Dang <ldang@nahannisys.com> | ||||
* Copyright 2018 Joyent, Inc. | |||||
grehan: In general the FreeBSD project doesn't like having copyright added unless > 25% of the file has… | |||||
mike.gerdts_joyent.comAuthorUnsubmitted Not Done Inline ActionsPer Joyent management: It's our policy that any change that isn't de minimus must bear a Joyent copyright. mike.gerdts_joyent.com: Per Joyent management:
It's our policy that any change that isn't de minimus must bear a… | |||||
rgrimesUnsubmitted Not Done Inline ActionsMoving 2 lines of code to inside an if statement is pretty "minimus"? rgrimes: Moving 2 lines of code to inside an if statement is pretty "minimus"?
| |||||
mike.gerdts_joyent.comAuthorUnsubmitted Not Done Inline ActionsNot including a copyright statement in this change would require an exception to our policy, which may involve an unbounded amount of time and potential legal review. Is it worth holding up this change for that? It is unlikely that most of the individual changes that Joyent will contribute will change 25% of most files that are touched. This does not negate the fact that we are contributing significant engineering resources into diagnosing, fixing, and testing our fixes. We want to be in sync with FreeBSD, but a contribution policy that runs counter to our own policies will make that very difficult. Is the policy related to attribution via copyright documented somewhere? mike.gerdts_joyent.com: Not including a copyright statement in this change would require an exception to our policy… | |||||
jhbUnsubmitted Not Done Inline ActionsAsserting copyright for this small of a change is highly unusual in the current practice of the project. We don't currently have a formally documented policy. I believe the 25% rule is a kind of common de facto practice in the industry however. Writing up a formal policy will require legal review on our end so it won't happen anytime soon. There are lots of companies (and individual developers) who contribute changes larger than this on a regular basis without asserting copyrights. jhb: Asserting copyright for this small of a change is highly unusual in the current practice of the… | |||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | ||||
▲ Show 20 Lines • Show All 1,645 Lines • ▼ Show 20 Lines | pci_xhci_try_usb_xfer(struct pci_xhci_softc *sc, | ||||
ep_ctx->dwEpCtx0 = FIELD_REPLACE( | ep_ctx->dwEpCtx0 = FIELD_REPLACE( | ||||
ep_ctx->dwEpCtx0, XHCI_ST_EPCTX_RUNNING, 0x7, 0); | ep_ctx->dwEpCtx0, XHCI_ST_EPCTX_RUNNING, 0x7, 0); | ||||
err = 0; | err = 0; | ||||
do_intr = 0; | do_intr = 0; | ||||
xfer = devep->ep_xfer; | xfer = devep->ep_xfer; | ||||
USB_DATA_XFER_LOCK(xfer); | |||||
/* outstanding requests queued up */ | /* outstanding requests queued up */ | ||||
if (dev->dev_ue->ue_data != NULL) { | if (dev->dev_ue->ue_data != NULL) { | ||||
err = dev->dev_ue->ue_data(dev->dev_sc, xfer, | err = dev->dev_ue->ue_data(dev->dev_sc, xfer, | ||||
epid & 0x1 ? USB_XFER_IN : USB_XFER_OUT, epid/2); | epid & 0x1 ? USB_XFER_IN : USB_XFER_OUT, epid/2); | ||||
if (err == USB_ERR_CANCELLED) { | if (err == USB_ERR_CANCELLED) { | ||||
if (USB_DATA_GET_ERRCODE(&xfer->data[xfer->head]) == | if (USB_DATA_GET_ERRCODE(&xfer->data[xfer->head]) == | ||||
USB_NAK) | USB_NAK) | ||||
err = XHCI_TRB_ERROR_SUCCESS; | err = XHCI_TRB_ERROR_SUCCESS; | ||||
} else { | } else { | ||||
err = pci_xhci_xfer_complete(sc, xfer, slot, epid, | err = pci_xhci_xfer_complete(sc, xfer, slot, epid, | ||||
&do_intr); | &do_intr); | ||||
if (err == XHCI_TRB_ERROR_SUCCESS && do_intr) { | if (err == XHCI_TRB_ERROR_SUCCESS && do_intr) { | ||||
pci_xhci_assert_interrupt(sc); | pci_xhci_assert_interrupt(sc); | ||||
} | } | ||||
/* XXX should not do it if error? */ | /* XXX should not do it if error? */ | ||||
USB_DATA_XFER_RESET(xfer); | USB_DATA_XFER_RESET(xfer); | ||||
} | } | ||||
} | } | ||||
USB_DATA_XFER_UNLOCK(xfer); | |||||
return (err); | return (err); | ||||
} | } | ||||
static int | static int | ||||
pci_xhci_handle_transfer(struct pci_xhci_softc *sc, | pci_xhci_handle_transfer(struct pci_xhci_softc *sc, | ||||
struct pci_xhci_dev_emu *dev, struct pci_xhci_dev_ep *devep, | struct pci_xhci_dev_emu *dev, struct pci_xhci_dev_ep *devep, | ||||
struct xhci_endp_ctx *ep_ctx, struct xhci_trb *trb, uint32_t slot, | struct xhci_endp_ctx *ep_ctx, struct xhci_trb *trb, uint32_t slot, | ||||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | DPRINTF(("pci_xhci: device doorbell ep[%u] %08x %08x %016lx %08x\r\n", | ||||
epid, ep_ctx->dwEpCtx0, ep_ctx->dwEpCtx1, ep_ctx->qwEpCtx2, | epid, ep_ctx->dwEpCtx0, ep_ctx->dwEpCtx1, ep_ctx->qwEpCtx2, | ||||
ep_ctx->dwEpCtx4)); | ep_ctx->dwEpCtx4)); | ||||
if (ep_ctx->qwEpCtx2 == 0) | if (ep_ctx->qwEpCtx2 == 0) | ||||
return; | return; | ||||
/* handle pending transfers */ | /* handle pending transfers */ | ||||
if (devep->ep_xfer->ndata > 0) { | if (devep->ep_xfer->ndata > 0) { | ||||
USB_DATA_XFER_LOCK(devep->ep_xfer); | |||||
pci_xhci_try_usb_xfer(sc, dev, devep, ep_ctx, slot, epid); | pci_xhci_try_usb_xfer(sc, dev, devep, ep_ctx, slot, epid); | ||||
USB_DATA_XFER_UNLOCK(devep->ep_xfer); | |||||
return; | return; | ||||
} | } | ||||
/* get next trb work item */ | /* get next trb work item */ | ||||
if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { | if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { | ||||
sctx_tr = &devep->ep_sctx_trbs[streamid]; | sctx_tr = &devep->ep_sctx_trbs[streamid]; | ||||
ringaddr = sctx_tr->ringaddr; | ringaddr = sctx_tr->ringaddr; | ||||
ccs = sctx_tr->ccs; | ccs = sctx_tr->ccs; | ||||
▲ Show 20 Lines • Show All 906 Lines • Show Last 20 Lines |
In general the FreeBSD project doesn't like having copyright added unless > 25% of the file has been modified. Is it Ok if I remove this ?