---
name: "uart_get_baud_rate"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/uart_get_baud_rate"
---

# uart\_get\_baud\_rate(9)

return baud rate for a particular port

## NAME

uart\_get\_baud\_rate - return baud rate for a particular port

## SYNOPSIS

**unsigned int uart\_get\_baud\_rate(struct uart\_port \*** *port***, struct ktermios \*** *termios***, struct ktermios \*** *old***, unsigned int** *min***, unsigned int** *max***);**

## ARGUMENTS

*port*

uart\_port structure describing the port in question.

*termios*

desired termios settings.

*old*

old termios (or NULL)

*min*

minimum acceptable baud rate

*max*

maximum acceptable baud rate

## DESCRIPTION

Decode the termios structure into a numeric baud rate, taking account of the magic 38400 baud rate (with spd\_\* flags), and mapping the **B0** rate to 9600 baud.

If the new baud rate is invalid, try the old termios setting. If it's still invalid, we try 9600 baud.

Update the *termios* structure to reflect the baud rate we're actually going to be using. Don't do this for the case where B0 is requested (“hang up”).

## COPYRIGHT
