shithub: riscv

Download patch

ref: 48352be82574e39a54e44b5ed38d407dcb66a0bb
parent: 56ac6ea29e1b9dfdad8c7b1875f81c242362da2a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jul 31 12:05:58 EDT 2017

usbxhci: provide shutdown function to halt the controller

--- a/sys/src/9/pc/usbxhci.c
+++ b/sys/src/9/pc/usbxhci.c
@@ -765,8 +765,16 @@
 }
 
 static void
-shutdown(Hci *)
+shutdown(Hci *hp)
 {
+	Ctlr *ctlr = hp->aux;
+	int i;
+
+	ctlr->opr[USBCMD] = 0;
+	for(i=0; (ctlr->opr[USBSTS] & HCH) == 0 && i < 10; i++)
+		delay(10);
+	intrdisable(ctlr->pcidev->intl, hp->interrupt, hp, ctlr->pcidev->tbdf, hp->type);
+	pciclrbme(ctlr->pcidev);
 }
 
 static void
@@ -1384,7 +1392,7 @@
 }
 	
 static int
-portenable(Hci *, int port, int on)
+portenable(Hci*, int, int)
 {
 	return 0;
 }