[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Do you want to go.. FASTER?!"
Juergen Lock <nox@jelal.hb.north.de> writes:
># set speed...
>/usr/local/bin/tspeed 115200 </dev/serial2
[...]
> and this is tspeed:
>
>#include <stdio.h>
>#include <stdlib.h>
>#include <ioctl.h>
>
>int main (argc, argv)
> int argc;
> char **argv;
>{
> long bps = -1;
> volatile long ibps, obps;
> if (argc > 1)
> bps = atol(argv[1]);
> ibps = obps = bps;
> ioctl (0, TIOCIBAUD, &ibps);
>#if 0
> printf ("old/lower ispeed %ld ", ibps);
>#endif
> ioctl (0, TIOCOBAUD, &obps);
>#if 0
> printf ("old/lower ospeed %ld\n", obps);
>#endif
> return 0;
>}
This seems to be the key: passing the actual baud value to the
appropriate system call instead of one of the B38400 family #define'd in
/usr/include/{ioctl,termios}.h. In fact, if this is the case, we could
presumably add lines like "#define B115200 115200" to those headers.
> [...] and if you wonder how the TIOC?BAUD `magically' work
>above 38400 have a look at the mint kernel source.)
Yeah. Right. :-O I managed to trace it from tcsetattr() as far as the
TIOC?BAUD Fcntl()'s, and then got lost. But if that works, I think I
know where in the pppd source to start poking... Thanks.
-sbigham