mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Allow any speeds in baudrate
This commit is contained in:
parent
d8af1fd8ae
commit
79ad0d4c63
1 changed files with 6 additions and 2 deletions
|
|
@ -211,6 +211,7 @@ int flushinp()
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef TERMIOS
|
||||
struct speed {
|
||||
speed_t s;
|
||||
int sp;
|
||||
|
|
@ -253,25 +254,28 @@ static struct speed speeds[] = {
|
|||
,{B115200, 115200}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
int
|
||||
baudrate()
|
||||
{
|
||||
#ifndef TERMIOS
|
||||
int i, ret;
|
||||
#endif
|
||||
|
||||
T(("baudrate() called"));
|
||||
|
||||
#ifdef TERMIOS
|
||||
ret = cfgetospeed(&cur_term->Nttyb);
|
||||
return cfgetospeed(&cur_term->Nttyb);
|
||||
#else
|
||||
ret = cur_term->Nttyb.sg_ospeed;
|
||||
#endif
|
||||
if(ret < 0 || ret > MAX_BAUD)
|
||||
return ERR;
|
||||
for (i = 0; i < (sizeof(speeds) / sizeof(struct speed)); i++)
|
||||
if (speeds[i].s == ret)
|
||||
return speeds[i].sp;
|
||||
return ERR;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue