home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / linux / 20047 < prev    next >
Encoding:
Text File  |  1992-12-12  |  2.4 KB  |  60 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!enterpoop.mit.edu!bloom-picayune.mit.edu!daemon
  3. From: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
  4. Subject: Re: Do we have a comm program that supports v32bis (14,400kb)?
  5. Message-ID: <1992Dec12.083728.13852@athena.mit.edu>
  6. Sender: daemon@athena.mit.edu (Mr Background)
  7. Reply-To: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
  8. Organization: The Internet
  9. Date: Sat, 12 Dec 1992 08:37:28 GMT
  10. Lines: 48
  11.  
  12.    From: alsaggaf@athena.mit.edu (M. Saggaf)
  13.    Date: Fri, 11 Dec 1992 04:41:31 GMT
  14.  
  15.    Hmmm, I just took a look at the serial driver, and it seems that to
  16.    set speeds above 38k, the termio B38400 bits of CBAUD have to be set
  17.    along with another flag to substitute the desired speed for 38k.  It's
  18.    not entirely obvious to me how that flag should be set via an ioctl
  19.    from an application program. Ted, could you please post some hints on
  20.    how to go about this?
  21.  
  22. The following is from something I sent to comp.os.linux a few months
  23. ago.  When I have time (hah!), I'll write the short program myself to do
  24. these things.
  25.  
  26.                         - Ted
  27.  
  28.  
  29. What you need to do is write a small program which does something
  30. roughly like this
  31.  
  32.     ioctl(fd, TIOCGSERIAL, &sstruct);
  33.     sstruct.fflag &= ~ASYNC_SPD_MASK;
  34. #ifdef WANT_56KB
  35.     sstruct.fflag |= ASYNC_SPD_HI; /* Use 56000 instead of 38400 */
  36. #else
  37.     sstruct.fflag |= ASYNC_SPD_VHI; /* Use 115200 instead of 38400 */
  38. #endif
  39.     ioctl(fd, TIOCSSERIAL, &sstruct);
  40.  
  41. .... where fd is a file descriptor which is open on the serial port; and
  42. of course, you'll need to do error checking, which has been omitted in
  43. this code fragment.  Also note that the Linux kernel as currently
  44. configured uses 56000 bps for ASYNC_SPD_HI, instead of 56700, because
  45. that's what's in the National Semiconduct Spec.  The rest of the world
  46. seems to use 56700, so if you want, you can make that change in
  47. baud_table[] in serial.c.  It actually doesn't matter, since whether you
  48. use 56000 or 56700, you get the same baud rate divisor, which is what's
  49. important anyway.
  50.  
  51. After you run this program, the serial port will be sent so that when
  52. 38400 is selected, the actual speed of the port will really be 56000 or
  53. 115200.  So all you need to do is tell kermit "set speed 38400";
  54. depending on what kermit you are using, you may need to recompile it and
  55. possibly modify it to force it to include support for the 38400 speed if
  56. it doesn't support it already.
  57.  
  58.                         - Ted
  59.  
  60.