Browse Source

add usb_stop_xhci when g.

Change-Id: I35c8e28bbb6b09f461191ecc877abd3a52b5beb4
Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
master
Chong Qiao 4 years ago
parent
commit
f88cba79cf
  1. 7
      pmon/cmds/cmd_go.c
  2. 18
      sys/dev/usb/xhci.c

7
pmon/cmds/cmd_go.c

@ -52,6 +52,7 @@
#include "mod_debugger.h"
#include "mod_usb_uhci.h"
#include "mod_usb_ohci.h"
#include "mod_usb_xhci.h"
#include "initrd.h"
extern struct trapframe DBGREG;
@ -94,6 +95,9 @@ extern void usb_uhci_stop(void);
#if NMOD_USB_OHCI !=0
extern void usb_ohci_stop(void);
#endif
#if NMOD_USB_XHCI !=0
extern void usb_ohci_stop(void);
#endif
/*************************************************************
* go(ac,av), the 'g' command
*/
@ -183,6 +187,9 @@ extern char *optarg;
#if NMOD_USB_OHCI !=0
usb_ohci_stop();
#endif
#if NMOD_USB_XHCI !=0
usb_xhci_stop();
#endif
#if defined (LOONGSON_3A2H) || defined (LS7A)
gmac_stop();
#endif

18
sys/dev/usb/xhci.c

@ -1259,6 +1259,24 @@ static int xhci_lowlevel_stop(struct xhci_ctrl *ctrl)
return 0;
}
extern struct cfdata cfdata[];
int usb_xhci_stop()
{
int i, j;
struct xhci *xhci;
for(i=0;cfdata[i].cf_driver;i++)
{
if(strcmp(cfdata[i].cf_driver->cd_name,"xhci") == 0) {
for (j=0; j<cfdata[i].cf_unit;j++) {
xhci = cfdata[i].cf_driver->cd_devs[j];
xhci_lowlevel_stop(&xhci->xhcic);
}
break;
}
}
return 0;
}
int xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe,
void *buffer, int length, struct devrequest *setup)
{

Loading…
Cancel
Save