X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FInterfaces%2FUDI%2Ftrans%2Fgio_uart.c;h=e420647267bcc6ff6fa23684406712125d7b9337;hb=845b6f9d90bb87b5e760e4d49aa93b0e003ab750;hp=b906bb60e20a9d642677dcd982ffb261ece139a8;hpb=73c3cf615a9cae10446661133fd4dd16ae5bcdfe;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Interfaces/UDI/trans/gio_uart.c b/KernelLand/Modules/Interfaces/UDI/trans/gio_uart.c index b906bb60..e4206472 100644 --- a/KernelLand/Modules/Interfaces/UDI/trans/gio_uart.c +++ b/KernelLand/Modules/Interfaces/UDI/trans/gio_uart.c @@ -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 //#include #include @@ -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); }