Ignore:
Timestamp:
2009-03-12T17:54:24Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a1c048
Parents:
a0e1b48
Message:

update for the new scheme of wiring device drivers to keyboard/serial modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/drivers/ns16550/ns16550.h

    ra0e1b48 r3c79afe  
    2727 */
    2828
    29 /** @addtogroup genarch 
     29/** @addtogroup genarch
    3030 * @{
    3131 */
    3232/**
    3333 * @file
    34  * @brief       Headers for NS 16550 serial controller.
     34 * @brief Headers for NS 16550 serial controller.
    3535 */
    3636
     
    4242#include <console/chardev.h>
    4343
    44 #define IER_ERBFI       0x01    /** Enable Receive Buffer Full Interrupt. */
     44#define IER_ERBFI  0x01  /** Enable Receive Buffer Full Interrupt. */
    4545
    46 #define LCR_DLAB        0x80    /** Divisor Latch Access bit. */
     46#define LCR_DLAB   0x80  /** Divisor Latch Access bit. */
    4747
    48 #define MCR_OUT2        0x08    /** OUT2. */
     48#define MCR_OUT2   0x08  /** OUT2. */
    4949
    5050/** NS16550 registers. */
    51 struct ns16550 {
    52         ioport8_t rbr;  /**< Receiver Buffer Register. */
    53         ioport8_t ier;  /**< Interrupt Enable Register. */
     51typedef struct {
     52        ioport8_t rbr;      /**< Receiver Buffer Register. */
     53        ioport8_t ier;      /**< Interrupt Enable Register. */
    5454        union {
    55                 ioport8_t iir;  /**< Interrupt Ident Register (read). */
    56                 ioport8_t fcr;  /**< FIFO control register (write). */
     55                ioport8_t iir;  /**< Interrupt Ident Register (read). */
     56                ioport8_t fcr;  /**< FIFO control register (write). */
    5757        } __attribute__ ((packed));
    58         ioport8_t lcr;  /**< Line Control register. */
    59         ioport8_t mcr;  /**< Modem Control Register. */
    60         ioport8_t lsr;  /**< Line Status Register. */
    61 } __attribute__ ((packed));
    62 typedef struct ns16550 ns16550_t;
     58        ioport8_t lcr;      /**< Line Control register. */
     59        ioport8_t mcr;      /**< Modem Control Register. */
     60        ioport8_t lsr;      /**< Line Status Register. */
     61} __attribute__ ((packed)) ns16550_t;
    6362
    6463/** Structure representing the ns16550 device. */
    65 typedef struct ns16550_instance {
     64typedef struct {
    6665        devno_t devno;
    6766        ns16550_t *ns16550;
    6867        irq_t irq;
    69         chardev_t *devout;
     68        indev_t kbrdin;
    7069} ns16550_instance_t;
    7170
    72 extern bool ns16550_init(ns16550_t *, devno_t, inr_t, cir_t, void *,
    73     chardev_t *);
    74 extern irq_ownership_t ns16550_claim(irq_t *);
    75 extern void ns16550_irq_handler(irq_t *);
     71extern indev_t *ns16550_init(ns16550_t *, devno_t, inr_t, cir_t, void *)
    7672
    7773#endif
Note: See TracChangeset for help on using the changeset viewer.