From a55e9376431280fd23d99e00ba49d54aa0abfe69 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 22 Apr 2017 17:03:34 -0600 Subject: [PATCH 1/7] Correct mispelling --- arch/arm/src/common/up_udelay.c | 2 +- arch/arm/src/lpc11xx/Kconfig | 2 +- arch/arm/src/lpc17xx/Kconfig | 2 +- arch/avr/src/common/up_udelay.c | 2 +- arch/hc/src/common/up_udelay.c | 2 +- arch/mips/src/common/up_udelay.c | 2 +- arch/misoc/src/common/misoc_udelay.c | 2 +- arch/renesas/src/common/up_udelay.c | 2 +- arch/x86/src/common/up_udelay.c | 2 +- arch/xtensa/src/common/xtensa_udelay.c | 2 +- arch/z16/src/common/up_udelay.c | 2 +- arch/z80/src/common/up_udelay.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm/src/common/up_udelay.c b/arch/arm/src/common/up_udelay.c index e1a19445f0..9e3115b201 100644 --- a/arch/arm/src/common/up_udelay.c +++ b/arch/arm/src/common/up_udelay.c @@ -59,7 +59,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/arm/src/lpc11xx/Kconfig b/arch/arm/src/lpc11xx/Kconfig index 46b01ab6e9..088188c950 100644 --- a/arch/arm/src/lpc11xx/Kconfig +++ b/arch/arm/src/lpc11xx/Kconfig @@ -222,7 +222,7 @@ config CAN_SAM The bus is sampled 3 times (recommended for low to medium speed buses to spikes on the bus-line). config CAN_LOOPBACK - bool "CAN looopback mode" + bool "CAN loopback mode" default n ---help--- Enable CAN loopback mode diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig index f8f95f8c5d..bef6ef884c 100644 --- a/arch/arm/src/lpc17xx/Kconfig +++ b/arch/arm/src/lpc17xx/Kconfig @@ -589,7 +589,7 @@ config CAN_SAM The bus is sampled 3 times (recommended for low to medium speed buses to spikes on the bus-line). config CAN_LOOPBACK - bool "CAN looopback mode" + bool "CAN loopback mode" default n ---help--- Enable CAN loopback mode diff --git a/arch/avr/src/common/up_udelay.c b/arch/avr/src/common/up_udelay.c index f71d5ee6b2..4105623c3c 100644 --- a/arch/avr/src/common/up_udelay.c +++ b/arch/avr/src/common/up_udelay.c @@ -75,7 +75,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/hc/src/common/up_udelay.c b/arch/hc/src/common/up_udelay.c index d4b2d3aad8..490804a457 100644 --- a/arch/hc/src/common/up_udelay.c +++ b/arch/hc/src/common/up_udelay.c @@ -75,7 +75,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/mips/src/common/up_udelay.c b/arch/mips/src/common/up_udelay.c index 496811cd79..19a7fa0d6a 100644 --- a/arch/mips/src/common/up_udelay.c +++ b/arch/mips/src/common/up_udelay.c @@ -75,7 +75,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/misoc/src/common/misoc_udelay.c b/arch/misoc/src/common/misoc_udelay.c index 42bbc1f95a..9874e0695c 100644 --- a/arch/misoc/src/common/misoc_udelay.c +++ b/arch/misoc/src/common/misoc_udelay.c @@ -59,7 +59,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/renesas/src/common/up_udelay.c b/arch/renesas/src/common/up_udelay.c index 9f9bda3033..3cd9b4c0a6 100644 --- a/arch/renesas/src/common/up_udelay.c +++ b/arch/renesas/src/common/up_udelay.c @@ -75,7 +75,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/x86/src/common/up_udelay.c b/arch/x86/src/common/up_udelay.c index 4869741860..ea7841d5e3 100644 --- a/arch/x86/src/common/up_udelay.c +++ b/arch/x86/src/common/up_udelay.c @@ -75,7 +75,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/xtensa/src/common/xtensa_udelay.c b/arch/xtensa/src/common/xtensa_udelay.c index 09d16d5d4d..8ec27f1541 100644 --- a/arch/xtensa/src/common/xtensa_udelay.c +++ b/arch/xtensa/src/common/xtensa_udelay.c @@ -59,7 +59,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/z16/src/common/up_udelay.c b/arch/z16/src/common/up_udelay.c index 4b36bc2d3c..94a29a4fd0 100644 --- a/arch/z16/src/common/up_udelay.c +++ b/arch/z16/src/common/up_udelay.c @@ -77,7 +77,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** diff --git a/arch/z80/src/common/up_udelay.c b/arch/z80/src/common/up_udelay.c index 85a1494b2f..98aca45898 100644 --- a/arch/z80/src/common/up_udelay.c +++ b/arch/z80/src/common/up_udelay.c @@ -77,7 +77,7 @@ * Description: * Delay inline for the requested number of microseconds. NOTE: Because * of all of the setup, several microseconds will be lost before the actual - * timing looop begins. Thus, the delay will always be a few microseconds + * timing loop begins. Thus, the delay will always be a few microseconds * longer than requested. * * *** NOT multi-tasking friendly *** From eb1d4ca77463575daf948988166d28f01dac7c70 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 23 Apr 2017 07:17:55 -0600 Subject: [PATCH 2/7] SAM3/4: Fixed configurations for TWI master. Obviously an incomplete port from SAMA5. --- arch/arm/src/sam34/Kconfig | 36 +++++++++++++++++++++++++++++++++++- arch/arm/src/sam34/sam_twi.c | 28 +++++++++++++++------------- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/arch/arm/src/sam34/Kconfig b/arch/arm/src/sam34/Kconfig index e9d3a7aece..806713c9d7 100644 --- a/arch/arm/src/sam34/Kconfig +++ b/arch/arm/src/sam34/Kconfig @@ -572,7 +572,6 @@ config SAM34_TWIS bool default n - config SAM34_TWIM0 bool "Two-wire Master Interface 0 (TWIM0)" default n @@ -1142,6 +1141,41 @@ config SAM34_SPI_REGDEBUG endmenu # AT91SAM3/4 SPI device driver options endif # SAM34_SPI0 || SAM34_SPI1 +if SAM34_TWIM + +menu "AT91SAM3/4 TWI master device driver options" + +config SAM34_TWIM0_FREQUENCY + int "TWI0 Frequency" + default 100000 + depends on SAM34_TWIM0 + +config SAM34_TWIM1_FREQUENCY + int "TWI1 Frequency" + default 100000 + depends on SAM34_TWIM1 + +config SAM34_TWI2_FREQUENCY + int "TWI2 Frequency" + default 100000 + depends on SAM34_TWIM2 + +config SAM34_TWI3_FREQUENCY + int "TWI3 Frequency" + default 100000 + depends on SAM34_TWIM3 + +config SAM34_TWI_REGDEBUG + bool "TWI register level debug" + depends on DEBUG_I2C_INFO + default n + ---help--- + Output detailed register-level TWI device debug information. + Very invasive! Requires also CONFIG_DEBUG_I2C_INFO. + +endmenu # TWI device driver options +endif # SAM34_TWIM + menu "AT91SAM3/4 EMAC device driver options" depends on SAM34_EMAC diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index 7242f4744d..ed52fb815a 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -71,19 +71,21 @@ #include "sam_gpio.h" #include "sam_twi.h" -#if defined(CONFIG_SAM34_TWI0) || defined(CONFIG_SAM34_TWI1) +/* REVISIT: Missing support for TWI2 master */ + +#if defined(CONFIG_SAM34_TWIM0) || defined(CONFIG_SAM34_TWIM1) /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /* Configuration ***************************************************************/ -#ifndef CONFIG_SAM34_TWI0_FREQUENCY -# define CONFIG_SAM34_TWI0_FREQUENCY 100000 +#ifndef CONFIG_SAM34_TWIM0_FREQUENCY +# define CONFIG_SAM34_TWIM0_FREQUENCY 100000 #endif -#ifndef CONFIG_SAM34_TWI1_FREQUENCY -# define CONFIG_SAM34_TWI1_FREQUENCY 100000 +#ifndef CONFIG_SAM34_TWIM1_FREQUENCY +# define CONFIG_SAM34_TWIM1_FREQUENCY 100000 #endif #ifndef CONFIG_DEBUG_I2C_INFO @@ -187,11 +189,11 @@ static void twi_hw_initialize(struct twi_dev_s *priv, unsigned int pid, * Private Data ****************************************************************************/ -#ifdef CONFIG_SAM34_TWI0 +#ifdef CONFIG_SAM34_TWIM0 static struct twi_dev_s g_twi0; #endif -#ifdef CONFIG_SAM34_TWI1 +#ifdef CONFIG_SAM34_TWIM1 static struct twi_dev_s g_twi1; #endif @@ -901,7 +903,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) flags = enter_critical_section(); -#ifdef CONFIG_SAM34_TWI0 +#ifdef CONFIG_SAM34_TWIM0 if (bus == 0) { /* Set up TWI0 register base address and IRQ number */ @@ -922,18 +924,18 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) /* Select the TWI frequency, and peripheral ID */ - frequency = CONFIG_SAM34_TWI0_FREQUENCY; + frequency = CONFIG_SAM34_TWIM0_FREQUENCY; pid = SAM_PID_TWI0; } else #endif -#ifdef CONFIG_SAM34_TWI1 +#ifdef CONFIG_SAM34_TWIM1 if (bus == 1) { /* Set up TWI1 register base address and IRQ number */ priv = &g_twi1; - priv->base = SAM_TWI0_BASE; + priv->base = SAM_TWI1_BASE; priv->irq = SAM_IRQ_TWI1; priv->twi = 1; @@ -948,7 +950,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) /* Select the TWI frequency, and peripheral ID */ - frequency = CONFIG_SAMA5_TWI1_FREQUENCY; + frequency = CONFIG_SAM34_TWIM1_FREQUENCY; pid = SAM_PID_TWI1; } else @@ -1029,4 +1031,4 @@ int sam_i2cbus_uninitialize(FAR struct i2c_master_s * dev) return OK; } -#endif /* CONFIG_SAM34_TWI0 || CONFIG_SAM34_TWI1 */ +#endif /* CONFIG_SAM34_TWIM0 || CONFIG_SAM34_TWIM1 */ From db9143b2bd98686690a49a013f079fcc1b840990 Mon Sep 17 00:00:00 2001 From: kc_dtm Date: Sun, 23 Apr 2017 07:21:44 -0600 Subject: [PATCH 3/7] SAM3/4: Remove inappropriate semicolon. --- arch/arm/src/sam34/sam_twi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index ed52fb815a..1b85275e8b 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -432,7 +432,7 @@ static void twi_wakeup(struct twi_dev_s *priv, int result) * ****************************************************************************/ -static int twi_interrupt(int irq, FAR void *context, FAR void *arg); +static int twi_interrupt(int irq, FAR void *context, FAR void *arg) { struct twi_dev_s *priv = (struct twi_dev_s *)arg; struct i2c_msg_s *msg; From ca7d88f6bb3d3b1ae611b35432bbc2012d6b467c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 23 Apr 2017 08:14:49 -0600 Subject: [PATCH 4/7] SAM3/4: Fix a few more naming differences noted by Alan Carvalho de Assiss. --- arch/arm/src/sam34/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/sam34/Kconfig b/arch/arm/src/sam34/Kconfig index 806713c9d7..862b381418 100644 --- a/arch/arm/src/sam34/Kconfig +++ b/arch/arm/src/sam34/Kconfig @@ -1155,12 +1155,12 @@ config SAM34_TWIM1_FREQUENCY default 100000 depends on SAM34_TWIM1 -config SAM34_TWI2_FREQUENCY +config SAM34_TWIM2_FREQUENCY int "TWI2 Frequency" default 100000 depends on SAM34_TWIM2 -config SAM34_TWI3_FREQUENCY +config SAM34_TWIM3_FREQUENCY int "TWI3 Frequency" default 100000 depends on SAM34_TWIM3 From 80e22691fa8f66f69df8d33a3b83824b212f24f1 Mon Sep 17 00:00:00 2001 From: Masatoshi Tateishi Date: Thu, 9 Jan 2014 13:49:20 +0900 Subject: [PATCH 5/7] USBMSC: Fix a wrong lun number issue Jira: PDFW15IS-98 Signed-off-by: Masayuki Ishikawa --- drivers/usbdev/usbmsc_scsi.c | 40 +++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/usbdev/usbmsc_scsi.c b/drivers/usbdev/usbmsc_scsi.c index 30e06be071..31c4b68ac0 100644 --- a/drivers/usbdev/usbmsc_scsi.c +++ b/drivers/usbdev/usbmsc_scsi.c @@ -508,7 +508,7 @@ static inline int usbmsc_cmdrequestsense(FAR struct usbmsc_dev_s *priv, static inline int usbmsc_cmdread6(FAR struct usbmsc_dev_s *priv) { FAR struct scsicmd_read6_s *read6 = (FAR struct scsicmd_read6_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = (uint16_t)read6->xfrlen; @@ -521,6 +521,8 @@ static inline int usbmsc_cmdread6(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRDEVICE2HOST | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = (uint32_t)(read6->mslba & SCSICMD_READ6_MSLBAMASK) << 16 | @@ -568,7 +570,7 @@ static inline int usbmsc_cmdread6(FAR struct usbmsc_dev_s *priv) static inline int usbmsc_cmdwrite6(FAR struct usbmsc_dev_s *priv) { FAR struct scsicmd_write6_s *write6 = (FAR struct scsicmd_write6_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = (uint16_t)write6->xfrlen; @@ -581,6 +583,8 @@ static inline int usbmsc_cmdwrite6(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRHOST2DEVICE | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = (uint32_t)(write6->mslba & SCSICMD_WRITE6_MSLBAMASK) << 16 | (uint32_t)usbmsc_getbe16(write6->lslba); @@ -880,7 +884,7 @@ static inline int usbmsc_cmdpreventmediumremoval(FAR struct usbmsc_dev_s *priv) #ifdef CONFIG_USBMSC_REMOVABLE FAR struct scsicmd_preventmediumremoval_s *pmr = (FAR struct scsicmd_preventmediumremoval_s *)priv->cdb; #endif - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.alloclen = 0; @@ -888,6 +892,8 @@ static inline int usbmsc_cmdpreventmediumremoval(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRNONE); if (ret == OK) { + lun = priv->lun; + #ifndef CONFIG_USBMSC_REMOVABLE lun->sd = SCSI_KCQIR_INVALIDCOMMAND; ret = -EINVAL; @@ -919,7 +925,7 @@ static inline int usbmsc_cmdreadformatcapacity(FAR struct usbmsc_dev_s *priv, { FAR struct scsicmd_readformatcapcacities_s *rfc = (FAR struct scsicmd_readformatcapcacities_s *)priv->cdb; FAR struct scsiresp_readformatcapacities_s *hdr; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.alloclen = usbmsc_getbe16(rfc->alloclen); @@ -927,6 +933,8 @@ static inline int usbmsc_cmdreadformatcapacity(FAR struct usbmsc_dev_s *priv, USBMSC_FLAGS_DIRDEVICE2HOST); if (ret == OK) { + lun = priv->lun; + hdr = (FAR struct scsiresp_readformatcapacities_s *)buf; memset(hdr, 0, SCSIRESP_READFORMATCAPACITIES_SIZEOF); hdr->listlen = SCSIRESP_CURRCAPACITYDESC_SIZEOF; @@ -955,7 +963,7 @@ static int inline usbmsc_cmdreadcapacity10(FAR struct usbmsc_dev_s *priv, { FAR struct scsicmd_readcapacity10_s *rcc = (FAR struct scsicmd_readcapacity10_s *)priv->cdb; FAR struct scsiresp_readcapacity10_s *rcr = (FAR struct scsiresp_readcapacity10_s *)buf; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; uint32_t lba; int ret; @@ -964,6 +972,8 @@ static int inline usbmsc_cmdreadcapacity10(FAR struct usbmsc_dev_s *priv, USBMSC_FLAGS_DIRDEVICE2HOST); if (ret == OK) { + lun = priv->lun; + /* Check the PMI and LBA fields */ lba = usbmsc_getbe32(rcc->lba); @@ -996,7 +1006,7 @@ static int inline usbmsc_cmdreadcapacity10(FAR struct usbmsc_dev_s *priv, static inline int usbmsc_cmdread10(FAR struct usbmsc_dev_s *priv) { struct scsicmd_read10_s *read10 = (struct scsicmd_read10_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = usbmsc_getbe16(read10->xfrlen); @@ -1004,6 +1014,8 @@ static inline int usbmsc_cmdread10(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRDEVICE2HOST | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = usbmsc_getbe32(read10->lba); @@ -1058,7 +1070,7 @@ static inline int usbmsc_cmdread10(FAR struct usbmsc_dev_s *priv) static inline int usbmsc_cmdwrite10(FAR struct usbmsc_dev_s *priv) { struct scsicmd_write10_s *write10 = (struct scsicmd_write10_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = usbmsc_getbe16(write10->xfrlen); @@ -1066,6 +1078,8 @@ static inline int usbmsc_cmdwrite10(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRHOST2DEVICE | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = usbmsc_getbe32(write10->lba); @@ -1129,7 +1143,7 @@ static inline int usbmsc_cmdwrite10(FAR struct usbmsc_dev_s *priv) static inline int usbmsc_cmdverify10(FAR struct usbmsc_dev_s *priv) { FAR struct scsicmd_verify10_s *verf = (FAR struct scsicmd_verify10_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; uint32_t lba; uint16_t blocks; size_t sector; @@ -1141,6 +1155,8 @@ static inline int usbmsc_cmdverify10(FAR struct usbmsc_dev_s *priv) ret = usbmsc_setupcmd(priv, SCSICMD_VERIFY10_SIZEOF, USBMSC_FLAGS_DIRNONE); if (ret == OK) { + lun = priv->lun; + /* Verify the starting and ending LBA */ lba = usbmsc_getbe32(verf->lba); @@ -1317,7 +1333,7 @@ static int inline usbmsc_cmdmodesense10(FAR struct usbmsc_dev_s *priv, static inline int usbmsc_cmdread12(FAR struct usbmsc_dev_s *priv) { struct scsicmd_read12_s *read12 = (struct scsicmd_read12_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = usbmsc_getbe32(read12->xfrlen); @@ -1325,6 +1341,8 @@ static inline int usbmsc_cmdread12(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRDEVICE2HOST | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = usbmsc_getbe32(read12->lba); @@ -1379,7 +1397,7 @@ static inline int usbmsc_cmdread12(FAR struct usbmsc_dev_s *priv) static inline int usbmsc_cmdwrite12(FAR struct usbmsc_dev_s *priv) { struct scsicmd_write12_s *write12 = (struct scsicmd_write12_s *)priv->cdb; - FAR struct usbmsc_lun_s *lun = priv->lun; + FAR struct usbmsc_lun_s *lun; int ret; priv->u.xfrlen = usbmsc_getbe32(write12->xfrlen); @@ -1387,6 +1405,8 @@ static inline int usbmsc_cmdwrite12(FAR struct usbmsc_dev_s *priv) USBMSC_FLAGS_DIRHOST2DEVICE | USBMSC_FLAGS_BLOCKXFR); if (ret == OK) { + lun = priv->lun; + /* Get the Logical Block Address (LBA) from cdb[] as the starting sector */ priv->sector = usbmsc_getbe32(write12->lba); From c6376006f635056d1699044cd753e002c98b5b38 Mon Sep 17 00:00:00 2001 From: Nobutaka Toyoshima Date: Tue, 25 Nov 2014 13:58:20 +0900 Subject: [PATCH 6/7] sched: Fix CHILD_FLAG_EXITED in include/nuttx/sched.h Jira: PDFW15IS-196 Jira: PDFW15IS-1109 Signed-off-by: Masayuki Ishikawa --- include/nuttx/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index f8bc539e3d..a6031c3183 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -168,7 +168,7 @@ # define CHILD_FLAG_TTYPE_TASK (0 << CHILD_FLAG_TTYPE_SHIFT) /* Normal user task */ # define CHILD_FLAG_TTYPE_PTHREAD (1 << CHILD_FLAG_TTYPE_SHIFT) /* User pthread */ # define CHILD_FLAG_TTYPE_KERNEL (2 << CHILD_FLAG_TTYPE_SHIFT) /* Kernel thread */ -#define CHILD_FLAG_EXITED (1 << 0) /* Bit 2: The child thread has exit'ed */ +#define CHILD_FLAG_EXITED (1 << 2) /* Bit 2: The child thread has exit'ed */ /* Bits 3-7: Available */ /* Sporadic scheduler flags */ From 3c1d85af323213093cdca8737f0961b45b3302cc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 24 Apr 2017 09:42:51 -0600 Subject: [PATCH 7/7] Update a README --- net/sixlowpan/README.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/net/sixlowpan/README.txt b/net/sixlowpan/README.txt index a311f5408d..ca8a513d6a 100644 --- a/net/sixlowpan/README.txt +++ b/net/sixlowpan/README.txt @@ -10,12 +10,14 @@ Optimal 6loWPAN Configuration 128 112 96 80 64 48 32 16 ---- ---- ---- ---- ---- ---- ---- ---- - xxxx xxxx xxxx xxxx xxxx 00ff fe00 MMMM 2-byte Rime address IEEE 48-bit MAC - fe80 0000 0000 0000 NNNN NNNN NNNN NNNN 8-byte Rime address IEEE EUI-64 + AAAA xxxx xxxx xxxx xxxx 00ff fe00 MMMM 2-byte Rime address IEEE 48-bit MAC + AAAA 0000 0000 0000 NNNN NNNN NNNN NNNN 8-byte Rime address IEEE EUI-64 - Where MMM is the 2-byte rime address XOR 0x0200. For example, the MAC + Where MMM is the 2-byte rime address XORed 0x0200. For example, the MAC address of 0xabcd would be 0xa9cd. And NNNN NNNN NNNN NNNN is the 8-byte - rime address address XOR 02000 0000 0000 0000 + rime address address XOR 02000 0000 0000 0000. + + For link-local address, AAAA is 0xfe80 3. MAC based link-local addresses @@ -33,9 +35,9 @@ Optimal 6loWPAN Configuration Fragmentation Headers --------------------- A fragment header is placed at the beginning of the outgoing packet just -after the MAC when the payload is too large to fit in a single IEEE 802.15.4 -frame. The fragment header contains three fields: Datagram size, datagram tag -and datagram offset. +after the MAC header when the payload is too large to fit in a single IEEE +802.15.4 frame. The fragment header contains three fields: Datagram size, +datagram tag and datagram offset. 1. Datagram size describes the total (un-fragmented) payload. 2. Datagram tag identifies the set of fragments and is used to match @@ -65,7 +67,7 @@ this is a HC1 compressed first frame of a packet This is the second frame of the same transfer: 41 88 01 cefa 3412 cdab ### 9-byte MAC header - e50e 000b 0a ### 5 byte FRAGN header + e50e 000b 0d ### 5 byte FRAGN header 42 ### SIXLOWPAN_DISPATCH_HC1 fb ### RIME_HC1_HC_UDP_HC1_ENCODING e0 ### RIME_HC1_HC_UDP_UDP_ENCODING @@ -81,5 +83,5 @@ This is the second frame of the same transfer: The payload length is encoded in the LS 11-bits of the first 16-bit value: In this example the payload size is 0x050e or 1,294. The tag is 0x000b. In -the second frame, the fifth byte contains the offset 0x0a which is 10 << 3 = -80 bytes, the size of the payload on the first packet. +the second frame, the fifth byte contains the offset 0x0d which is 13 << 3 = +104 bytes, the size of the payload on the first packet.