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

Changeset 677cad5 in mainline for uspace/drv/char/i8042/i8042.c


Ignore:
Timestamp:
2017-11-20T20:29:03Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
b2f542a
Parents:
19ea61d
Message:

Chardev server-side error reporting should match client side.

File:
1 edited

Legend:

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

    r19ea61d r677cad5  
    6767
    6868static void i8042_char_conn(ipc_callid_t, ipc_call_t *, void *);
    69 static int i8042_read(chardev_srv_t *, void *, size_t);
    70 static int i8042_write(chardev_srv_t *, const void *, size_t);
     69static int i8042_read(chardev_srv_t *, void *, size_t, size_t *);
     70static int i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
    7171
    7272static chardev_ops_t i8042_chardev_ops = {
     
    333333 * @param buffer Data source
    334334 * @param size   Data size
    335  *
    336  * @return Bytes written.
    337  *
    338  */
    339 static int i8042_write(chardev_srv_t *srv, const void *data, size_t size)
     335 * @param nwr    Place to store number of bytes successfully written
     336 *
     337 * @return EOK on success or non-zero error code
     338 *
     339 */
     340static int i8042_write(chardev_srv_t *srv, const void *data, size_t size,
     341    size_t *nwr)
    340342{
    341343        i8042_port_t *port = (i8042_port_t *)srv->srvs->sarg;
     
    357359       
    358360        fibril_mutex_unlock(&i8042->write_guard);
    359         return size;
     361        *nwr = size;
     362        return EOK;
    360363}
    361364
     
    365368 * @param buffer Data place
    366369 * @param size   Data place size
    367  *
    368  * @return Bytes read.
    369  *
    370  */
    371 static int i8042_read(chardev_srv_t *srv, void *dest, size_t size)
     370 * @param nread  Place to store number of bytes successfully read
     371 *
     372 * @return EOK on success or non-zero error code
     373 *
     374 */
     375static int i8042_read(chardev_srv_t *srv, void *dest, size_t size,
     376    size_t *nread)
    372377{
    373378        i8042_port_t *port = (i8042_port_t *)srv->srvs->sarg;
     
    387392        }
    388393       
    389         return i;
     394        *nread = i;
     395        return EOK;
    390396}
    391397
Note: See TracChangeset for help on using the changeset viewer.