Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/mips/adm5120/dev/ahci.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/mips/adm5120/dev/ahci.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.14 retrieving revision 1.14.8.2 diff -u -p -r1.14 -r1.14.8.2 --- src/sys/arch/mips/adm5120/dev/ahci.c 2017/06/01 02:45:06 1.14 +++ src/sys/arch/mips/adm5120/dev/ahci.c 2018/09/06 06:55:37 1.14.8.2 @@ -1,4 +1,4 @@ -/* $NetBSD: ahci.c,v 1.14 2017/06/01 02:45:06 chs Exp $ */ +/* $NetBSD: ahci.c,v 1.14.8.2 2018/09/06 06:55:37 pgoyette Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.14 2017/06/01 02:45:06 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.14.8.2 2018/09/06 06:55:37 pgoyette Exp $"); #include #include @@ -539,27 +539,16 @@ ahci_roothub_ctrl(struct usbd_bus *bus, switch (C(req->bRequest, req->bmRequestType)) { case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE): switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - - DPRINTF(D_MSG, ("UDESC_DEVICE ")); - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, USB_VENDOR_SCANLOGIC); - memcpy(buf, &devd, totlen); - break; - } #define sd ((usb_string_descriptor_t *)buf) - case C(1, UDESC_STRING): - /* Vendor */ - totlen = usb_makestrdesc(sd, len, "ADMTek"); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "ADM5120 root hub"); break; default: printf("unknownGetDescriptor=%x", value); + /* FALLTHROUGH */ + case C(0, UDESC_DEVICE): + case C(1, UDESC_STRING): /* default from usbroothub */ return buflen; } @@ -625,7 +614,7 @@ ahci_roothub_ctrl(struct usbd_bus *bus, } usb_hub_descriptor_t hubd; - totlen = min(buflen, sizeof(hubd)); + totlen = uimin(buflen, sizeof(hubd)); memcpy(&hubd, buf, totlen); hubd.bNbrPorts = 2; USETW(hubd.wHubCharacteristics, 0); @@ -653,7 +642,7 @@ ahci_roothub_ctrl(struct usbd_bus *bus, //DPRINTF(D_XFER, ("ST=%04x,CH=%04x ", status, sc->sc_change)); USETW(ps.wPortStatus, status & (UPS_CURRENT_CONNECT_STATUS|UPS_PORT_ENABLED|UPS_SUSPEND|UPS_OVERCURRENT_INDICATOR|UPS_RESET|UPS_PORT_POWER|UPS_LOW_SPEED)); USETW(ps.wPortChange, (status>>16) & (UPS_C_CONNECT_STATUS|UPS_C_PORT_ENABLED|UPS_C_SUSPEND|UPS_C_OVERCURRENT_INDICATOR|UPS_C_PORT_RESET)); - totlen = min(len, sizeof(ps)); + totlen = uimin(len, sizeof(ps)); memcpy(buf, &ps, totlen); break; case C(UR_SET_DESCRIPTOR, UT_WRITE_CLASS_DEVICE): @@ -1167,7 +1156,7 @@ ahci_device_bulk_start(struct usbd_xfer i = 0; offset = 0; while ((len>0) || (i==0)) { - tlen = min(len,4096); + tlen = uimin(len,4096); td[i]->buffer = DMAADDR(&xfer->ux_dmabuf,offset) | 0xa0000000; td[i]->buflen=tlen; td[i]->control=(isread?ADMHCD_TD_IN:ADMHCD_TD_OUT) | toggle | ADMHCD_TD_OWN | short_ok;