Changeset e747303 in mainline


Ignore:
Timestamp:
2011-12-25T22:43:12Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5b0de4c
Parents:
a8f7029
Message:

i8024: Fix char dev interface return values. Make kbd function internal and look for XT keyboard.

File:
1 edited

Legend:

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

    ra8f7029 re747303  
    150150            controller->aux_buffer_end : controller->kbd_buffer_end;
    151151        if (*buffer != NULL && *buffer < buffer_end) {
    152                 *(*buffer)++ = data;
    153                 if (*buffer == buffer_end)
     152                *(*buffer) = data;
     153                if (++(*buffer) == buffer_end)
    154154                        fibril_condvar_signal(&controller->data_avail);
    155155        } else {
    156                 ddf_msg(LVL_WARN, "Unhandled %s data: %x , status: %x.",
     156                ddf_msg(LVL_WARN, "Unhandled %s data: %hhx , status: %hhx.",
    157157                    (status & i8042_AUX_DATA) ? "AUX" : "KBD", data, status);
    158158        }
     
    173173                return -1;
    174174
    175         dev->kbd_fun = ddf_fun_create(ddf_dev, fun_exposed, "ps2a");
     175        dev->kbd_fun = ddf_fun_create(ddf_dev, fun_inner, "ps2a");
    176176        if (!dev->kbd_fun)
    177177                return ENOMEM;
     178        int ret = ddf_fun_add_match_id(dev->kbd_fun, "xtkbd", 90);
     179        if (ret != EOK) {
     180                ddf_fun_destroy(dev->kbd_fun);
     181                return ret;
     182        }
    178183
    179184        dev->mouse_fun = ddf_fun_create(ddf_dev, fun_exposed, "ps2b");
     
    208213} else (void)0
    209214
    210         int ret = ddf_fun_bind(dev->kbd_fun);
     215        ret = ddf_fun_bind(dev->kbd_fun);
    211216        CHECK_RET_DESTROY(ret,
    212217            "Failed to bind keyboard function: %s.\n", str_error(ret));
     
    291296        }
    292297        fibril_mutex_unlock(&controller->guard);
    293         return EOK;
     298        return size;
    294299}
    295300/*----------------------------------------------------------------------------*/
     
    317322        controller->kbd_buffer_end = NULL;
    318323        fibril_mutex_unlock(&controller->guard);
    319         return EOK;
     324        return size;
    320325}
    321326/*----------------------------------------------------------------------------*/
     
    332337        }
    333338        fibril_mutex_unlock(&controller->guard);
    334         return EOK;
     339        return size;
    335340}
    336341/*----------------------------------------------------------------------------*/
     
    358363        controller->aux_buffer_end = NULL;
    359364        fibril_mutex_unlock(&controller->guard);
    360         return EOK;
     365        return size;
    361366}
    362367/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.