Lines Matching defs:port

40 serial_get_divisor (const struct grub_serial_port *port __attribute__ ((unused)),
71 if (port->port == 0xbff003f8)
81 do_real_config (struct grub_serial_port *port)
95 if (port->configured)
98 port->broken = 0;
100 divisor = serial_get_divisor (port, &port->config);
103 grub_outb (0, port->port + UART_IER);
106 grub_outb (UART_DLAB, port->port + UART_LCR);
109 grub_outb (divisor & 0xFF, port->port + UART_DLL);
110 grub_outb (divisor >> 8, port->port + UART_DLH);
113 status |= (parities[port->config.parity]
114 | (port->config.word_len - 5)
115 | stop_bits[port->config.stop_bits]);
116 grub_outb (status, port->port + UART_LCR);
118 /* On Loongson machines serial port has only 3 wires. */
121 grub_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR);
124 grub_outb (UART_ENABLE_DTRRTS, port->port + UART_MCR);
127 grub_outb (UART_ENABLE_FIFO_TRIGGER14, port->port + UART_FCR);
130 grub_outb (UART_ENABLE_DTRRTS | UART_ENABLE_OUT2, port->port + UART_MCR);
134 while (grub_inb (port->port + UART_LSR) & UART_DATA_READY)
135 grub_inb (port->port + UART_RX);
137 port->configured = 1;
142 serial_hw_fetch (struct grub_serial_port *port)
144 do_real_config (port);
145 if (grub_inb (port->port + UART_LSR) & UART_DATA_READY)
146 return grub_inb (port->port + UART_RX);
153 serial_hw_put (struct grub_serial_port *port, const int c)
157 do_real_config (port);
159 if (port->broken > 5)
161 else if (port->broken > 1)
166 while ((grub_inb (port->port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0)
170 port->broken++;
176 if (port->broken)
177 port->broken--;
179 grub_outb (c, port->port + UART_TX);
182 /* Initialize a serial device. PORT is the port number for a serial device.
190 serial_hw_configure (struct grub_serial_port *port,
195 divisor = serial_get_divisor (port, config);
211 port->config = *config;
212 port->configured = 0;
240 com_ports[i].port = serial_hw_io_addr[i];
249 /* Return the port number for the UNITth serial device. */
260 grub_serial_ns8250_add_port (grub_port_t port)
265 if (com_ports[i].port == port)
270 p->name = grub_xasprintf ("port%lx", (unsigned long) port);
278 p->port = port;