diff packages/devs/serial/arm/aeb/current/src/aeb_serial.c @ 115:6ed91473a1cd ecos-sw-2000-08-21

Merge from eCos master repository on 2000-08-21-22:40:54-BST
author jlarmour
date Fri, 25 Aug 2000 17:32:38 +0000
parents 6736c52df507
children e0c0827131d1
line wrap: on
line diff
--- a/packages/devs/serial/arm/aeb/current/src/aeb_serial.c
+++ b/packages/devs/serial/arm/aeb/current/src/aeb_serial.c
@@ -67,7 +67,9 @@ static Cyg_ErrNo aeb_serial_lookup(struc
                                    struct cyg_devtab_entry *sub_tab,
                                    const char *name);
 static unsigned char aeb_serial_getc(serial_channel *chan);
-static bool aeb_serial_set_config(serial_channel *chan, cyg_serial_info_t *config);
+static Cyg_ErrNo aeb_serial_set_config(serial_channel *chan, 
+                                       cyg_uint32 key,
+                                       const void *xbuf, cyg_uint32 *len);
 static void aeb_serial_start_xmit(serial_channel *chan);
 static void aeb_serial_stop_xmit(serial_channel *chan);
 
@@ -264,10 +266,26 @@ aeb_serial_getc(serial_channel *chan)
 }
 
 // Set up the device characteristics; baud rate, etc.
-static bool 
-aeb_serial_set_config(serial_channel *chan, cyg_serial_info_t *config)
+static Cyg_ErrNo
+aeb_serial_set_config(serial_channel *chan, cyg_uint32 key,
+                      const void *xbuf, cyg_uint32 *len)
 {
-    return aeb_serial_config_port(chan, config, false);
+    switch (key) {
+    case CYG_IO_SET_CONFIG_SERIAL_INFO:
+      {
+        cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf;
+        if ( *len < sizeof(cyg_serial_info_t) ) {
+            return -EINVAL;
+        }
+        *len = sizeof(cyg_serial_info_t);
+        if ( true != aeb_serial_config_port(chan, config, false) )
+            return -EINVAL;
+      }
+      break;
+    default:
+        return -EINVAL;
+    }
+    return ENOERR;
 }
 
 // Enable the transmitter on the device