diff --git a/arch/arm/src/stm32/chip/stm32_otgfs.h b/arch/arm/src/stm32/chip/stm32_otgfs.h index b9ec9cfa86..d389897060 100644 --- a/arch/arm/src/stm32/chip/stm32_otgfs.h +++ b/arch/arm/src/stm32/chip/stm32_otgfs.h @@ -1,7 +1,7 @@ /**************************************************************************************************** * arch/arm/src/stm32/chip/stm32_otgfs.h * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -485,7 +485,8 @@ #define OTGFS_GINT_IEP (1 << 18) /* Bit 18: IN endpoint interrupt */ #define OTGFS_GINT_OEP (1 << 19) /* Bit 19: OUT endpoint interrupt */ #define OTGFS_GINT_IISOIXFR (1 << 20) /* Bit 20: Incomplete isochronous IN transfer */ -#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: Incomplete isochronous OUT transfer */ +#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: Incomplete isochronous OUT transfer (device) */ +#define OTGFS_GINT_IPXFR (1 << 21) /* Bit 21: Incomplete periodic transfer (host) */ /* Bits 22-23: Reserved, must be kept at reset value */ #define OTGFS_GINT_HPRT (1 << 24) /* Bit 24: Host port interrupt */ #define OTGFS_GINT_HC (1 << 25) /* Bit 25: Host channels interrupt */ diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index e43e246a0b..60733375da 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -135,11 +135,6 @@ # undef CONFIG_STM32_USBHOST_PKTDUMP #endif -#undef HAVE_USB_TRACE -#if defined(CONFIG_USBHOST_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB)) -# define HAVE_USB_TRACE 1 -#endif - /* HCD Setup *******************************************************************/ /* Hardware capabilities */ @@ -356,7 +351,7 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv); static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv); static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv); static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv); -static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv); +static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv); /* First level, global interrupt handler */ @@ -726,7 +721,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) case OTGFS_EPTYPE_CTRL: case OTGFS_EPTYPE_BULK: { -#ifdef HAVE_USB_TRACE +#ifdef HAVE_USBHOST_TRACE_VERBOSE uint16_t intrace; uint16_t outtrace; @@ -779,7 +774,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) priv->chan[chidx].epno); regval |= OTGFS_HCINT_BBERR; } -#ifdef HAVE_USB_TRACE +#ifdef HAVE_USBHOST_TRACE_VERBOSE else { usbhost_vtrace2(OTGFS_VTRACE2_CHANCONF_INTR_OUT, chidx, @@ -803,7 +798,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx) priv->chan[chidx].epno); regval |= (OTGFS_HCINT_TXERR | OTGFS_HCINT_BBERR); } -#ifdef HAVE_USB_TRACE +#ifdef HAVE_USBHOST_TRACE_VERBOSE else { usbhost_vtrace2(OTGFS_VTRACE2_CHANCONF_ISOC_OUT, chidx, @@ -2781,14 +2776,14 @@ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv) } /******************************************************************************* - * Name: stm32_gint_iisooxfrisr + * Name: stm32_gint_ipxfrisr * * Description: - * USB OTG FS incomplete isochronous interrupt handler + * USB OTG FS incomplete periodic interrupt handler * *******************************************************************************/ -static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv) +static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv) { uint32_t regval; @@ -2802,7 +2797,7 @@ static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv) /* Clear the incomplete isochronous OUT interrupt */ - stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_IISOOXFR); + stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_IPXFR); } /******************************************************************************* @@ -2911,12 +2906,12 @@ static int stm32_gint_isr(int irq, FAR void *context) stm32_gint_discisr(priv); } - /* Handle the incomplete isochronous OUT transfer */ + /* Handle the incomplete periodic transfer */ - if ((pending & OTGFS_GINT_IISOOXFR) != 0) + if ((pending & OTGFS_GINT_IPXFR) != 0) { usbhost_vtrace1(OTGFS_VTRACE1_GINT_IISOOXFR, 0); - stm32_gint_iisooxfrisr(priv); + stm32_gint_ipxfrisr(priv); } } @@ -3025,7 +3020,7 @@ static inline void stm32_hostinit_enable(void) regval |= (OTGFS_GINT_SOF | OTGFS_GINT_RXFLVL | OTGFS_GINT_IISOOXFR | OTGFS_GINT_HPRT | OTGFS_GINT_HC | OTGFS_GINT_DISC); #else - regval |= (OTGFS_GINT_RXFLVL | OTGFS_GINT_IISOOXFR | OTGFS_GINT_HPRT | + regval |= (OTGFS_GINT_RXFLVL | OTGFS_GINT_IPXFR | OTGFS_GINT_HPRT | OTGFS_GINT_HC | OTGFS_GINT_DISC); #endif stm32_putreg(STM32_OTGFS_GINTMSK, regval); diff --git a/arch/arm/src/stm32/stm32_usbhost.c b/arch/arm/src/stm32/stm32_usbhost.c index 9f1f0f7ec6..088fe37942 100755 --- a/arch/arm/src/stm32/stm32_usbhost.c +++ b/arch/arm/src/stm32/stm32_usbhost.c @@ -102,7 +102,7 @@ static const struct stm32_usbhost_trace_s g_trace1[TRACE1_NSTRINGS] = TRENTRY(OTGFS_VTRACE1_GINT_HC, TR_FMT1, "OTGFS Handle the host channels interrupt.\n"), TRENTRY(OTGFS_VTRACE1_GINT_HPRT, TR_FMT1, "OTGFS Handle the host port interrupt.\n"), TRENTRY(OTGFS_VTRACE1_GINT_DISC, TR_FMT1, "OTGFS Handle the disconnect detected interrupt.\n"), - TRENTRY(OTGFS_VTRACE1_GINT_IISOOXFR, TR_FMT1, "OTGFS Handle the incomplete isochronous OUT transfer.\n"), + TRENTRY(OTGFS_VTRACE1_GINT_IPXFR, TR_FMT1, "OTGFS Handle the incomplete periodic transfer.\n"), # endif #endif diff --git a/arch/arm/src/stm32/stm32_usbhost.h b/arch/arm/src/stm32/stm32_usbhost.h index 553a0d3ba7..30df7ada64 100644 --- a/arch/arm/src/stm32/stm32_usbhost.h +++ b/arch/arm/src/stm32/stm32_usbhost.h @@ -75,7 +75,7 @@ enum usbhost_trace1codes_e OTGFS_VTRACE1_GINT_HC, /* OTGFS Handle the host channels interrupt */ OTGFS_VTRACE1_GINT_HPRT, /* OTGFS Handle the host port interrupt */ OTGFS_VTRACE1_GINT_DISC, /* OTGFS Handle the disconnect detected interrupt */ - OTGFS_VTRACE1_GINT_IISOOXFR, /* OTGFS Handle the incomplete isochronous OUT transfer */ + OTGFS_VTRACE1_GINT_IPXFR, /* OTGFS Handle the incomplete periodic transfer */ # endif #endif