Sio & Puc memory mapped
Roman Kurakin
rik at cronyx.ru
Sun May 16 02:37:38 PDT 2004
Marcel Moolenaar:
[...]
><patch>
>--- asytest.c~ Fri May 14 11:50:10 2004
>+++ asytest.c Sat May 15 11:31:03 2004
>@@ -152,6 +152,7 @@
> }
>
> opt = chan[i].old_options;
>+ cfmakeraw (&opt);
> cfsetspeed (&opt, baud);
> opt.c_cflag = CREAD | CS8;
> opt.c_lflag &= ~ICANON;
>@@ -198,7 +199,7 @@
> for (c=chan; c<chan+MAXCHAN; ++c)
> if (c->fd > 0) {
> if (c->ready_to_transmit) {
>- s = write (c->fd, tbuf+it, IOSZ);
>+ s = write (c->fd, tbuf+it, IOSZ-it);
> if (s <= 0) {
> if (s < 0) {
> if (errno != EAGAIN)
></patch>
>
Works good with my card. Thanks!
>The first (the cfmakeraw() insertion) may be related to uart(4) not
>setting proper defaults, but may also be related to uart(4) setting
>different *valid* defaults. The second is a genuine test program bug
>
The only I can say that this test works fine with sio(4), cx(4),
and under linux kernels before 2.6 with serial. So this requires
additional investigation.
>triggered by write() doing partial writes. This bug too may be the
>result of uart(4) not setting the right defaults, but since the test
>program doesn't assume complete writes the bug is primarily in the
>test program by virtue of allowing partial writes.
>
>
rik
More information about the freebsd-current
mailing list