'\" t .\" Title: uart_get_baud_rate .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: 16x50 UART Driver .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "UART_GET_BAUD_RATE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "16x50 UART Driver" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" uart_get_baud_rate \- return baud rate for a particular port .SH "SYNOPSIS" .HP \w'unsigned\ int\ uart_get_baud_rate('u .BI "unsigned int uart_get_baud_rate(struct\ uart_port\ *\ " "port" ", struct\ ktermios\ *\ " "termios" ", struct\ ktermios\ *\ " "old" ", unsigned\ int\ " "min" ", unsigned\ int\ " "max" ");" .SH "ARGUMENTS" .PP \fIport\fR .RS 4 uart_port structure describing the port in question\&. .RE .PP \fItermios\fR .RS 4 desired termios settings\&. .RE .PP \fIold\fR .RS 4 old termios (or NULL) .RE .PP \fImin\fR .RS 4 minimum acceptable baud rate .RE .PP \fImax\fR .RS 4 maximum acceptable baud rate .RE .SH "DESCRIPTION" .PP Decode the termios structure into a numeric baud rate, taking account of the magic 38400 baud rate (with spd_* flags), and mapping the \fBB0\fR rate to 9600 baud\&. .PP If the new baud rate is invalid, try the old termios setting\&. If it\*(Aqs still invalid, we try 9600 baud\&. .PP Update the \fItermios\fR structure to reflect the baud rate we\*(Aqre actually going to be using\&. Don\*(Aqt do this for the case where B0 is requested (\(lqhang up\(rq)\&. .SH "COPYRIGHT" .br