Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / trans / gio_uart.c
index b906bb6..e420647 100644 (file)
@@ -5,7 +5,7 @@
  * trans/gio_uart.c
  * - GIO UART translation (presents "uart" type GIO drivers as serial ports)
  */
-#define DEBUG  1
+#define DEBUG  0
 #include <udi.h>
 //#include <udi_gio.h>
 #include <acess.h>
@@ -106,22 +106,23 @@ void acessuart_bind_ack(udi_gio_bind_cb_t *cb, udi_ubit32_t device_size_lo, udi_
                return ;
        }
        
-       // bound, create PTY instance
-       rdata->PTYInstance = PTY_Create("serial#", rdata, acessuart_pty_output, NULL, NULL);
-       if( !rdata->PTYInstance ) {
-               udi_channel_event_complete(channel_cb, UDI_STAT_RESOURCE_UNAVAIL);
-               return ;
-       }
-       
-       struct ptymode mode = {
-               .OutputMode = PTYBUFFMT_TEXT,
-               .InputMode = PTYIMODE_CANON|PTYIMODE_ECHO
-       };
+       // We're bound on the GIO channel, create a PTY for this UART
        struct ptydims dims = {
                .W = 80, .H = 25,
                .PW = 0, .PH = 0
        };
-       PTY_SetAttrib(rdata->PTYInstance, &dims, &mode, 0);
+       struct ptymode mode = {
+               .OutputMode = PTYBUFFMT_TEXT,
+               .InputMode = PTYIMODE_CANON|PTYIMODE_ECHO
+       };
+       rdata->PTYInstance = PTY_Create("serial#", rdata, acessuart_pty_output,
+               NULL, NULL,
+               &dims, &mode
+               );
+       if( !rdata->PTYInstance ) {
+               udi_channel_event_complete(channel_cb, UDI_STAT_RESOURCE_UNAVAIL);
+               return ;
+       }
        
        udi_channel_event_complete(channel_cb, UDI_OK);
 }

UCC git Repository :: git.ucc.asn.au