Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0851a3d in mainline for uspace/drv/char/i8042/i8042.h


Ignore:
Timestamp:
2017-11-24T08:19:31Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
ac307b2
Parents:
e7588a8
Message:

Move per-port data to i8042_port_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/i8042/i8042.h

    re7588a8 r0851a3d  
    22 * Copyright (c) 2006 Josef Cejka
    33 * Copyright (c) 2011 Jan Vesely
     4 * Copyright (c) 2017 Jiri Svoboda
    45 * All rights reserved.
    56 *
     
    5960/** i8042 Port. */
    6061typedef struct {
    61         struct i8042 *ctl;              /**< Controller */
    62         chardev_srvs_t cds;             /**< Character device server data */
    63         fibril_mutex_t buf_lock;        /**< Protect buffer */
    64         fibril_condvar_t buf_cv;        /**< Signal new data in buffer */
     62        /** Controller */
     63        struct i8042 *ctl;
     64        /** Device function */
     65        ddf_fun_t *fun;
     66        /** Character device server data */
     67        chardev_srvs_t cds;
     68        /** Circular buffer */
     69        circ_buf_t cbuf;
     70        /** Buffer data space */
     71        uint8_t buf_data[BUFFER_SIZE];
     72        /** Protect buffer */
     73        fibril_mutex_t buf_lock;
     74        /** Signal new data in buffer */
     75        fibril_condvar_t buf_cv;
    6576} i8042_port_t;
    6677
    6778/** i8042 Controller. */
    6879typedef struct i8042 {
    69         i8042_regs_t *regs;             /**< I/O registers. */
    70         ddf_fun_t *kbd_fun;             /**< Pirmary port device function. */
    71         ddf_fun_t *aux_fun;             /**< Auxiliary port device function. */
    72         circ_buf_t kbd_buffer;          /**< Primary port buffer. */
    73         circ_buf_t aux_buffer;          /**< Aux. port buffer. */
    74         uint8_t aux_data[BUFFER_SIZE];  /**< Primary port buffer space. */
    75         uint8_t kbd_data[BUFFER_SIZE];  /**< Aux. port buffer space. */
     80        /**< I/O registers. */
     81        i8042_regs_t *regs;
     82        /** Keyboard port */
    7683        i8042_port_t *kbd;
     84        /** AUX port */
    7785        i8042_port_t *aux;
    78         fibril_mutex_t write_guard;     /**< Prevents simultanous port writes.*/
     86        /** Prevents simultanous port writes.*/
     87        fibril_mutex_t write_guard;
    7988} i8042_t;
    80 
    8189
    8290extern int i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
Note: See TracChangeset for help on using the changeset viewer.