1#ifndef _ADV_UART_INIT_H
2#define _ADV_UART_INIT_H
3#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
5#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
13 adv_serial_port = kmalloc(
sizeof(
struct adv_uart_port), GFP_KERNEL);
17 spin_lock_init(&adv_serial_port->
port.lock);
19 adv_serial_port->
port.flags = UPF_SKIP_TEST|UPF_HARD_FLOW|UPF_SOFT_FLOW;
20 adv_serial_port->
port.type = PORT_16850;
21 adv_serial_port->
port.ops = &adv_uart_ops;
22 adv_serial_port->
port.line = index;
23 adv_serial_port->
port.fifosize = 2048;
28 ret = uart_add_one_port(&adv_uart_driver, &adv_serial_port->
port);
30 vcomdata->
adv_uart = (
struct uart_port *)adv_serial_port;
31 adv_serial_port->
attr = &vcomdata->
attr;
32 adv_serial_port->
tx = &vcomdata->
rx;
33 adv_serial_port->
rx = &vcomdata->
tx;
35 INIT_LIST_HEAD(&adv_serial_port->
list);
36 list_add(&adv_serial_port->
list, &uart_list);
int adv_uart_init(struct adv_vcom *vcomdata, int index)
Definition adv_uart.c:618
struct list_head list
Definition adv_uart.h:8
struct ring_buf * rx
Definition adv_uart.h:6
struct uart_port port
Definition adv_uart.h:4
struct ring_buf * tx
Definition adv_uart.h:7
struct adv_port_att * attr
Definition adv_uart.h:5
struct uart_port * adv_uart
Definition advvcom.h:53
struct adv_port_att attr
Definition advvcom.h:54
struct ring_buf rx
Definition advvcom.h:56
struct ring_buf tx
Definition advvcom.h:55