summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/rtems_bsdnet.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-14 17:18:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-14 17:18:18 +0000
commit6f93bb49b4df8f573a8914219841a1d64fde2b6d (patch)
tree222185fa3f33d4bbda5c87ef3e9ed4ae83d61148 /cpukit/libnetworking/rtems/rtems_bsdnet.h
parentPatch rtems-rc-20000614-2-cvs.diff from Ralf Corsepius (diff)
downloadrtems-6f93bb49b4df8f573a8914219841a1d64fde2b6d.tar.bz2
Patch from Chris Johns <cjohns@cybertec.com.au> to enhance network
initialization. This adds an interface which makes it easier to control the BSD stack from user code. The BSD stack initialise uses it. It is a sort of `function' interface for an ifconfig command. I also added support for attaching and removing interfaces. With hot swap PCI comming online support for hot swap PCI will be an important factor in "state of art" RTOS's. This is also part of a general move on my part to allow RTEMS to be configured at runtime by calls rather than table driven at initialisation.
Diffstat (limited to 'cpukit/libnetworking/rtems/rtems_bsdnet.h')
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet.h b/cpukit/libnetworking/rtems/rtems_bsdnet.h
index 5be2e932f9..7838835f0f 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet.h
@@ -68,10 +68,17 @@ void rtems_bsdnet_show_tcp_stats (void);
*/
struct rtems_bsdnet_ifconfig {
/*
- * These two entries must be supplied for each interface.
+ * These three entries must be supplied for each interface.
*/
char *name;
- int (*attach)(struct rtems_bsdnet_ifconfig *conf);
+
+ /*
+ * This function now handles attaching and detaching an interface.
+ * The parameter attaching indicates the operation being invoked.
+ * For older attach functions which do not have the extra parameter
+ * it will be ignored.
+ */
+ int (*attach)(struct rtems_bsdnet_ifconfig *conf, int attaching);
/*
* Link to next interface
@@ -132,8 +139,36 @@ struct rtems_bsdnet_config {
char *name_server[3]; /* BOOTP */
char *ntp_server[3]; /* BOOTP */
};
+
+/*
+ * Default global device configuration structure. This is scanned
+ * by the initialize network function. Check the network demo's for
+ * an example of the structure. Like the RTEMS configuration tables,
+ * they are not part of RTEMS but part of your application or bsp
+ * code.
+ */
extern struct rtems_bsdnet_config rtems_bsdnet_config;
+
+/*
+ * Initialise the BSD stack, attach and `up' interfaces
+ * in the `rtems_bsdnet_config'. RTEMS must already be initialised.
+ */
int rtems_bsdnet_initialize_network (void);
+
+/*
+ * Dynamic interface control. Drivers must free any resources such as
+ * memory, interrupts, io regions claimed during the `attach' and/or
+ * `up' operations when asked to `detach'.
+ * You must configure the interface after attaching it.
+ */
+void rtems_bsdnet_attach (struct rtems_bsdnet_ifconfig *ifconfig);
+void rtems_bsdnet_detach (struct rtems_bsdnet_ifconfig *ifconfig);
+
+/*
+ * Interface configuration. The commands are listed in `sys/sockio.h'.
+ */
+int rtems_bsdnet_ifconfig (const char *ifname, unsigned32 cmd, void *param);
+
void rtems_bsdnet_do_bootp (void);
int rtems_bsdnet_synchronize_ntp (int interval, rtems_task_priority priority);