summaryrefslogtreecommitdiffstats
path: root/bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h')
-rw-r--r--bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h b/bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h
new file mode 100644
index 0000000000..a12e9e2c86
--- /dev/null
+++ b/bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h
@@ -0,0 +1,79 @@
+#ifndef BSP_BSDNET_ATTACH_INFO_H
+#define BSP_BSDNET_ATTACH_INFO_H
+
+/* Author: Till Straumann, 2005; see ../../LICENSE */
+
+/* Rationale: traditionally, BSPs only supported a single networking interface
+ * the BSP defined RTEMS_NETWORK_DRIVER_NAME & friends macros
+ * for applications to use.
+ * If more than one interface is present, this simple approach is
+ * not enough.
+ * Hence, this BSP exports a routine declaring all available interfaces
+ * so the application can make a choice.
+ */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Fwd. decl just in case */
+struct rtems_bsdnet_ifconfig;
+
+typedef struct {
+ /* name of the interface */
+ const char *name;
+ /* optional description (to be used by chooser 'help' function etc.) */
+ const char *description;
+ /* driver 'attach' function */
+ int (*attach_fn)(struct rtems_bsdnet_ifconfig*, int);
+} BSP_NetIFDescRec, *BSP_NetIFDesc;
+
+/* Return a pointer to the (static) list of network interface descriptions
+ * of this board.
+ *
+ * NOTES: A NULL value is returned if e.g., the board type cannot be determined
+ * or for other reasons.
+ * The 'description' field is optional, i.e., may be NULL.
+ * The list is terminated by an element with a NULL name field.
+ * The interfaces are listed in the order they are labelled.
+ */
+
+BSP_NetIFDesc
+BSP_availableNetIFs();
+
+/* Define this macro so applications can conditionally compile this API */
+#define BSP_HAS_MULTIPLE_NETIFS(x) BSP_availableNetIFs()
+
+/* Legacy macro; applications should use BSP_Available_NetIfs() to choose
+ * an interface and attach function.
+ */
+extern char BSP_auto_network_driver_name[20];
+#define RTEMS_BSP_NETWORK_DRIVER_NAME BSP_auto_network_driver_name
+
+#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_auto_enet_attach
+
+/* This routine checks the name field passed in the 'ifconfig'.
+ * If the name is NULL or points to the BSP_auto_network_driver_name
+ * array, the routine checks all interfaces for an active link and
+ * attaches the first alive one.
+ * It also updates 'ifconfig' to reflect the chosen interface's name
+ * and attach function.
+ *
+ * If another name is passed in, the routine scans
+ * the available interfaces for that name and uses it, if found.
+ * Eventually, a default interface is chosen (provided that
+ * the board type is successfully detected).
+ *
+ * Note that only ONE interface chained into rtems_bsdnet_config
+ * may use the "auto" name.
+ *
+ */
+
+int
+BSP_auto_enet_attach(struct rtems_bsdnet_ifconfig *ifconfig, int attaching);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif