USB class drivers need to call DEV_CONNECT

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3159 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-12-04 17:35:19 +00:00
parent 59d25457d1
commit 8be8139d19
2 changed files with 20 additions and 9 deletions
+15 -8
View File
@@ -1487,6 +1487,15 @@ static void lpc17_usbreset(struct lpc17_usbdev_s *priv)
lpc17_putreg(USB_SLOW_INT|USB_DEVSTATUS_INT|USB_FAST_INT|USB_FRAME_INT|USB_ERROR_INT,
LPC17_USBDEV_INTEN);
/* Tell the class driver that we are disconnected. The class
* driver should then accept any new configurations.
*/
if (priv->driver)
{
CLASS_DISCONNECT(priv->driver, &priv->usbdev);
}
}
/*******************************************************************************
@@ -1895,8 +1904,8 @@ static inline void lpc17_ep0setup(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0SETUPSTALLED), priv->ep0state);
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
}
@@ -1957,9 +1966,8 @@ static inline void lpc17_ep0dataoutinterrupt(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0OUTSTALLED), priv->ep0state);
ep0 = &priv->eplist[LPC17_EP0_OUT];
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
return;
}
@@ -2024,9 +2032,8 @@ static inline void lpc17_ep0dataininterrupt(struct lpc17_usbdev_s *priv)
if (priv->stalled)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_EP0INSTALLED), priv->ep0state);
ep0 = &priv->eplist[LPC17_EP0_IN];
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&ep0->ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_IN].ep, false);
lpc17_epstall(&priv->eplist[LPC17_EP0_OUT].ep, false);
}
}
+5 -1
View File
@@ -2604,7 +2604,11 @@ int usbdev_register(struct usbdevclass_driver_s *driver)
/* FIXME: nothing seems to call DEV_CONNECT(), but we need to set
* the RS bit to enable the controller. It kind of makes sense
* to do this after the class has bound to us... */
* to do this after the class has bound to us...
* GEN: This bug is really in the class driver. It should make the
* soft connect when it is ready to be enumerated. I have added
* that logic to the class drivers but left this logic here.
*/
lpc313x_pullup(&g_usbdev.usbdev, true);
}