diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index d36ca6f210..96973ec865 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -4472,7 +4472,7 @@ void board_autoled_off(int led);
- Interface Definition.
- The header file for the NuttX CAN driver reside at
include/nuttx/can.h
.
+ The header file for the NuttX CAN driver resides at include/nuttx/drivers/can.h
.
This header file includes both the application level interface to the CAN driver as well as the interface between the "upper half" and "lower half" drivers.
The CAN module uses a standard character driver framework.
diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c
index f25de325b9..f961bef549 100644
--- a/arch/arm/src/lpc17xx/lpc17_can.c
+++ b/arch/arm/src/lpc17xx/lpc17_can.c
@@ -57,7 +57,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c
index 3e1b3d116a..f801e6e834 100644
--- a/arch/arm/src/sama5/sam_can.c
+++ b/arch/arm/src/sama5/sam_can.c
@@ -60,7 +60,7 @@
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/sama5/sam_can.h b/arch/arm/src/sama5/sam_can.h
index c18361533f..5a26fe8314 100644
--- a/arch/arm/src/sama5/sam_can.h
+++ b/arch/arm/src/sama5/sam_can.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/sam_can.h"
-#include
+#include
#if defined(CONFIG_CAN) && (defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1))
diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c
index 748b01b10b..49e05f306b 100644
--- a/arch/arm/src/samv7/sam_mcan.c
+++ b/arch/arm/src/samv7/sam_mcan.c
@@ -56,7 +56,7 @@
#include
#include
#include
-#include
+#include
#include "cache.h"
#include "up_internal.h"
diff --git a/arch/arm/src/samv7/sam_mcan.h b/arch/arm/src/samv7/sam_mcan.h
index 540800b37d..07ecdd71ad 100644
--- a/arch/arm/src/samv7/sam_mcan.h
+++ b/arch/arm/src/samv7/sam_mcan.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/sam_mcan.h"
-#include
+#include
#if defined(CONFIG_CAN) && (defined(CONFIG_SAMV7_MCAN0) || \
defined(CONFIG_SAMV7_MCAN1))
diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c
index 334c7337d6..ed973d57bd 100644
--- a/arch/arm/src/stm32/stm32_can.c
+++ b/arch/arm/src/stm32/stm32_can.c
@@ -53,7 +53,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/stm32/stm32_can.h b/arch/arm/src/stm32/stm32_can.h
index e78b3af34f..765dc95c0c 100644
--- a/arch/arm/src/stm32/stm32_can.h
+++ b/arch/arm/src/stm32/stm32_can.h
@@ -45,7 +45,7 @@
#include "chip.h"
#include "chip/stm32_can.h"
-#include
+#include
/************************************************************************************
* Pre-processor Definitions
diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c
index 7891319e8f..18b49a86e7 100644
--- a/arch/arm/src/stm32l4/stm32l4_can.c
+++ b/arch/arm/src/stm32l4/stm32l4_can.c
@@ -57,7 +57,7 @@
#include
#include
#include
-#include
+#include
#include "up_internal.h"
#include "up_arch.h"
diff --git a/arch/arm/src/stm32l4/stm32l4_can.h b/arch/arm/src/stm32l4/stm32l4_can.h
index 453b031bda..86eb26fb65 100644
--- a/arch/arm/src/stm32l4/stm32l4_can.h
+++ b/arch/arm/src/stm32l4/stm32l4_can.h
@@ -49,7 +49,7 @@
#include "chip.h"
#include "chip/stm32l4_can.h"
-#include
+#include
/************************************************************************************
* Pre-processor Definitions
diff --git a/configs/nucleo-f303re/src/stm32_can.c b/configs/nucleo-f303re/src/stm32_can.c
index 41eae2ff92..ec689b3e91 100644
--- a/configs/nucleo-f303re/src/stm32_can.c
+++ b/configs/nucleo-f303re/src/stm32_can.c
@@ -46,7 +46,7 @@
#include
#include
-#include
+#include
#include "stm32.h"
diff --git a/configs/olimex-lpc1766stk/src/lpc17_can.c b/configs/olimex-lpc1766stk/src/lpc17_can.c
index 3282587dd4..afb1ff47a0 100644
--- a/configs/olimex-lpc1766stk/src/lpc17_can.c
+++ b/configs/olimex-lpc1766stk/src/lpc17_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/olimex-stm32-e407/src/stm32_can.c b/configs/olimex-stm32-e407/src/stm32_can.c
index d4fa00aa4c..42def42a81 100644
--- a/configs/olimex-stm32-e407/src/stm32_can.c
+++ b/configs/olimex-stm32-e407/src/stm32_can.c
@@ -41,7 +41,7 @@
#include
#include
-#include
+#include
#include
#include "stm32.h"
#include "stm32_can.h"
diff --git a/configs/olimex-stm32-h405/src/stm32_can.c b/configs/olimex-stm32-h405/src/stm32_can.c
index ed2ee4a069..62c94a0b19 100644
--- a/configs/olimex-stm32-h405/src/stm32_can.c
+++ b/configs/olimex-stm32-h405/src/stm32_can.c
@@ -41,7 +41,7 @@
#include
#include
-#include
+#include
#include
#include "stm32.h"
#include "stm32_can.h"
diff --git a/configs/olimex-stm32-h407/src/stm32_can.c b/configs/olimex-stm32-h407/src/stm32_can.c
index c401e0c411..ec7f2d39ab 100644
--- a/configs/olimex-stm32-h407/src/stm32_can.c
+++ b/configs/olimex-stm32-h407/src/stm32_can.c
@@ -41,7 +41,7 @@
#include
#include
-#include
+#include
#include
#include "stm32.h"
#include "stm32_can.h"
diff --git a/configs/olimex-stm32-p107/src/stm32_can.c b/configs/olimex-stm32-p107/src/stm32_can.c
index b292036f14..2687c08f9c 100644
--- a/configs/olimex-stm32-p107/src/stm32_can.c
+++ b/configs/olimex-stm32-p107/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/olimex-stm32-p207/src/stm32_can.c b/configs/olimex-stm32-p207/src/stm32_can.c
index 16c71ae43e..b05dcb2446 100644
--- a/configs/olimex-stm32-p207/src/stm32_can.c
+++ b/configs/olimex-stm32-p207/src/stm32_can.c
@@ -41,7 +41,7 @@
#include
#include
-#include
+#include
#include
#include "stm32.h"
#include "stm32_can.h"
diff --git a/configs/olimexino-stm32/src/stm32_can.c b/configs/olimexino-stm32/src/stm32_can.c
index 483d561f9f..c03a1c8d26 100644
--- a/configs/olimexino-stm32/src/stm32_can.c
+++ b/configs/olimexino-stm32/src/stm32_can.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/sama5d3-xplained/src/sam_can.c b/configs/sama5d3-xplained/src/sam_can.c
index 7befbcee65..76b12f3b14 100644
--- a/configs/sama5d3-xplained/src/sam_can.c
+++ b/configs/sama5d3-xplained/src/sam_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/sama5d3x-ek/src/sam_can.c b/configs/sama5d3x-ek/src/sam_can.c
index dae9f4e61e..f483e30dd0 100644
--- a/configs/sama5d3x-ek/src/sam_can.c
+++ b/configs/sama5d3x-ek/src/sam_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/same70-xplained/src/sam_mcan.c b/configs/same70-xplained/src/sam_mcan.c
index 722e83c361..2c5301c3a1 100644
--- a/configs/same70-xplained/src/sam_mcan.c
+++ b/configs/same70-xplained/src/sam_mcan.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include
#include "sam_mcan.h"
diff --git a/configs/samv71-xult/src/sam_mcan.c b/configs/samv71-xult/src/sam_mcan.c
index e692eb4013..bb28cbb9b0 100644
--- a/configs/samv71-xult/src/sam_mcan.c
+++ b/configs/samv71-xult/src/sam_mcan.c
@@ -43,7 +43,7 @@
#include
#include
-#include
+#include
#include
#include "sam_mcan.h"
diff --git a/configs/shenzhou/src/stm32_can.c b/configs/shenzhou/src/stm32_can.c
index 8bfe95ac09..bc6472bef7 100644
--- a/configs/shenzhou/src/stm32_can.c
+++ b/configs/shenzhou/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/stm3210e-eval/src/stm32_can.c b/configs/stm3210e-eval/src/stm32_can.c
index 1d296be81c..284e6098c0 100644
--- a/configs/stm3210e-eval/src/stm32_can.c
+++ b/configs/stm3210e-eval/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/stm3220g-eval/src/stm32_can.c b/configs/stm3220g-eval/src/stm32_can.c
index a7a7bf2e17..5115a7b7d9 100644
--- a/configs/stm3220g-eval/src/stm32_can.c
+++ b/configs/stm3220g-eval/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/stm3240g-eval/src/stm32_can.c b/configs/stm3240g-eval/src/stm32_can.c
index e5350615d2..75e138fd20 100644
--- a/configs/stm3240g-eval/src/stm32_can.c
+++ b/configs/stm3240g-eval/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/stm32f4discovery/src/stm32_can.c b/configs/stm32f4discovery/src/stm32_can.c
index bbc0f3e093..beafd449d9 100644
--- a/configs/stm32f4discovery/src/stm32_can.c
+++ b/configs/stm32f4discovery/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/viewtool-stm32f107/src/stm32_can.c b/configs/viewtool-stm32f107/src/stm32_can.c
index 2aad6dfdf2..ce2b5912f5 100644
--- a/configs/viewtool-stm32f107/src/stm32_can.c
+++ b/configs/viewtool-stm32f107/src/stm32_can.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/configs/zkit-arm-1769/src/lpc17_can.c b/configs/zkit-arm-1769/src/lpc17_can.c
index 0bdba84446..03176894a9 100644
--- a/configs/zkit-arm-1769/src/lpc17_can.c
+++ b/configs/zkit-arm-1769/src/lpc17_can.c
@@ -47,7 +47,7 @@
#include
#include
-#include
+#include
#include
#include "chip.h"
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 5418cd8289..090fbf5168 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -148,7 +148,7 @@ menuconfig CAN
default n
---help---
This selection enables building of the "upper-half" CAN driver.
- See include/nuttx/can.h for further CAN driver information.
+ See include/nuttx/drivers/can.h for further CAN driver information.
if CAN
diff --git a/drivers/README.txt b/drivers/README.txt
index 420988ccd4..7137db2aa0 100644
--- a/drivers/README.txt
+++ b/drivers/README.txt
@@ -13,7 +13,8 @@ Files in this directory
^^^^^^^^^^^^^^^^^^^^^^^
can.c
- This is a CAN driver. See include/nuttx/can.h for usage information.
+ This is a CAN driver. See include/nuttx/drivers/can.h for usage
+ information.
dev_null.c and dev_zero.c
These files provide the standard /dev/null and /dev/zero devices.
diff --git a/drivers/can.c b/drivers/can.c
index 8dc67601a7..483769d7db 100644
--- a/drivers/can.c
+++ b/drivers/can.c
@@ -56,7 +56,7 @@
#include
#include
-#include
+#include
#ifdef CONFIG_CAN_TXREADY
# include
diff --git a/include/nuttx/analog/adc.h b/include/nuttx/analog/adc.h
index a566f2a0de..639eddc5cf 100644
--- a/include/nuttx/analog/adc.h
+++ b/include/nuttx/analog/adc.h
@@ -6,7 +6,7 @@
* Author: Li Zhuoyi
* Gregory Nutt
*
- * Derived from include/nuttx/can.h
+ * Derived from include/nuttx/drivers/can.h
*
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
diff --git a/include/nuttx/analog/dac.h b/include/nuttx/analog/dac.h
index 5648b51a9a..db2cf5a736 100644
--- a/include/nuttx/analog/dac.h
+++ b/include/nuttx/analog/dac.h
@@ -5,7 +5,7 @@
* Author: Li Zhuoyi
* History: 0.1 2011-08-04 initial version
*
- * Derived from include/nuttx/can.h
+ * Derived from include/nuttx/drivers/can.h
*
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
diff --git a/include/nuttx/can.h b/include/nuttx/drivers/can.h
similarity index 98%
rename from include/nuttx/can.h
rename to include/nuttx/drivers/can.h
index 27ef01d77c..ed570097fc 100644
--- a/include/nuttx/can.h
+++ b/include/nuttx/drivers/can.h
@@ -1,7 +1,7 @@
/************************************************************************************
- * include/nuttx/can.h
+ * include/nuttx/drivers/can.h
*
- * Copyright (C) 2008, 2009, 2011-2012, 2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009, 2011-2012, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
************************************************************************************/
-#ifndef _INCLUDE_NUTTX_CAN_H
-#define _INCLUDE_NUTTX_CAN_H
+#ifndef _INCLUDE_NUTTX_DRVERS_CAN_H
+#define _INCLUDE_NUTTX_DRVERS_CAN_H
/************************************************************************************
* Included Files
@@ -60,9 +60,11 @@
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
+
/* Configuration ********************************************************************/
-/* CONFIG_CAN - Enables CAN support (one or both of CONFIG_STM32_CAN1 or
- * CONFIG_STM32_CAN2 must also be defined)
+/* CONFIG_CAN - Enables CAN support (MCU-specific selections are also required. For
+ * STM32, as an example, one or both of CONFIG_STM32_CAN1 or CONFIG_STM32_CAN2
+ * must also be defined)
* CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default
* Standard 11-bit IDs.
* CONFIG_CAN_FD - Enable support for CAN FD mode. For the upper half driver, this
@@ -794,4 +796,4 @@ int can_txready(FAR struct can_dev_s *dev);
#endif
#endif /* CONFIG_CAN */
-#endif /* _INCLUDE_NUTTX_CAN_H */
+#endif /* _INCLUDE_NUTTX_DRVERS_CAN_H */
diff --git a/include/nuttx/fs/ioctl.h b/include/nuttx/fs/ioctl.h
index b79c783923..adfa0446cd 100644
--- a/include/nuttx/fs/ioctl.h
+++ b/include/nuttx/fs/ioctl.h
@@ -341,7 +341,7 @@
#define _RELAYIOC(nr) _IOC(_RELAYBASE,nr)
/* CAN driver ioctl definitions *********************************************/
-/* (see nuttx/can.h */
+/* (see nuttx/drivers/can.h */
#define _CANIOCVALID(c) (_IOC_TYPE(c)==_CANBASE)
#define _CANIOC(nr) _IOC(_CANBASE,nr)