Misc KNF. NFCI.

This commit is contained in:
skrll 2021-01-05 16:30:37 +00:00
parent a15c9db76d
commit 3b279b2e71
1 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahci.c,v 1.22 2020/04/05 20:59:38 skrll Exp $ */
/* $NetBSD: ahci.c,v 1.23 2021/01/05 16:30:37 skrll Exp $ */
/*-
* Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.22 2020/04/05 20:59:38 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.23 2021/01/05 16:30:37 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -889,7 +889,7 @@ ahci_device_ctrl_start(struct usbd_xfer *xfer)
ep->control = pipe->up_dev->ud_addr | \
((pipe->up_dev->ud_speed==USB_SPEED_FULL)?ADMHCD_ED_SPEED:0) | \
((UGETW(pipe->up_endpoint->ue_edesc->wMaxPacketSize))<<ADMHCD_ED_MAXSHIFT);
memcpy(KERNADDR(&reqdma, 0), req, sizeof *req);
memcpy(KERNADDR(&reqdma, 0), req, sizeof(*req));
/* printf("status: %x\n",REG_READ(ADMHCD_REG_PORTSTATUS0));
printf("ep_control: %x\n",ep->control);
printf("speed: %x\n",pipe->up_dev->ud_speed);
@ -1236,16 +1236,17 @@ ahci_device_bulk_start(struct usbd_xfer *xfer)
i = 0;
offset = 0;
while ((len>0) || (i==0)) {
while (len > 0) || i == 0) {
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;
td[i]->len=tlen;
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;
td[i]->len = tlen;
toggle = ADMHCD_TD_TOGGLE;
len -= tlen;
offset += tlen;
td[i]->next = td[i+1];
td[i]->next = td[i + 1];
i++;
};