Changeset 18e9eeb in mainline for uspace/drv


Ignore:
Timestamp:
2011-03-07T19:03:30Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c0f5a5d, ec4538d
Parents:
a7e2f0d (diff), f16a76b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Development branch changes

Location:
uspace/drv
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmid/main.c

    ra7e2f0d r18e9eeb  
    4444#include "usbmid.h"
    4545
     46/** Callback when new MID device is attached to the host.
     47 *
     48 * @param gen_dev Generic DDF device representing the new device.
     49 * @return Error code.
     50 */
    4651static int usbmid_add_device(ddf_dev_t *gen_dev)
    4752{
     
    8691}
    8792
     93/** USB MID driver ops. */
    8894static driver_ops_t mid_driver_ops = {
    8995        .add_device = usbmid_add_device,
    9096};
    9197
     98/** USB MID driver. */
    9299static driver_t mid_driver = {
    93100        .name = NAME,
  • uspace/drv/usbmid/usbmid.c

    ra7e2f0d r18e9eeb  
    6767}
    6868
     69/** DDF interface of the child - interface function. */
    6970static usb_iface_t child_usb_iface = {
    7071        .get_hc_handle = usb_iface_get_hc_handle_hub_child_impl,
     
    7374};
    7475
    75 
     76/** Operations for children - interface functions. */
    7677static ddf_dev_ops_t child_device_ops = {
    7778        .interfaces[USB_DEV_IFACE] = &child_usb_iface
    7879};
    7980
     81/** Operations of the device itself. */
    8082static ddf_dev_ops_t mid_device_ops = {
    8183        .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl
  • uspace/drv/usbmid/usbmid.h

    ra7e2f0d r18e9eeb  
    4444#define NAME "usbmid"
    4545
     46/** USB MID device container. */
    4647typedef struct {
    4748        /** Device container. */
     
    5455} usbmid_device_t;
    5556
     57
     58/** Container for single interface in a MID device. */
    5659typedef struct {
    5760        /** Function container. */
  • uspace/drv/usbmouse/init.c

    ra7e2f0d r18e9eeb  
    101101
    102102static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
     103/** Device ops for USB mouse. */
    103104static ddf_dev_ops_t mouse_ops = {
    104105        .default_handler = default_connection_handler
     
    135136}
    136137
    137 
     138/** Create USB mouse device.
     139 *
     140 * The mouse device is stored into <code>dev-&gt;driver_data</code>.
     141 *
     142 * @param dev Generic device.
     143 * @return Error code.
     144 */
    138145int usb_mouse_create(ddf_dev_t *dev)
    139146{
  • uspace/drv/usbmouse/main.c

    ra7e2f0d r18e9eeb  
    3939#include <str_error.h>
    4040
     41/** Callback when new mouse device is attached and recognised by DDF.
     42 *
     43 * @param dev Representation of a generic DDF device.
     44 * @return Error code.
     45 */
    4146static int usbmouse_add_device(ddf_dev_t *dev)
    4247{
     
    6368}
    6469
     70/** USB mouse driver ops. */
    6571static driver_ops_t mouse_driver_ops = {
    6672        .add_device = usbmouse_add_device,
    6773};
    6874
     75/** USB mouse driver. */
    6976static driver_t mouse_driver = {
    7077        .name = NAME,
     
    7481int main(int argc, char *argv[])
    7582{
    76         usb_log_enable(USB_LOG_LEVEL_DEBUG2, NAME);
     83        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    7784
    7885        return ddf_driver_main(&mouse_driver);
  • uspace/drv/usbmouse/mouse.c

    ra7e2f0d r18e9eeb  
    4040#include <ipc/mouse.h>
    4141
     42/** Fibril function for polling the mouse device.
     43 *
     44 * This function shall not terminate unless the device breaks and fails
     45 * to send data (e.g. stalls on data request).
     46 *
     47 * @param arg ddf_dev_t type representing the mouse device.
     48 * @return EOK Always.
     49 */
    4250int usb_mouse_polling_fibril(void *arg)
    4351{
  • uspace/drv/usbmouse/mouse.h

    ra7e2f0d r18e9eeb  
    4343#define NAME "usbmouse"
    4444
     45/** Container for USB mouse device. */
    4546typedef struct {
     47        /** Generic device container. */
    4648        ddf_dev_t *device;
     49        /** Function representing the device. */
    4750        ddf_fun_t *mouse_fun;
     51        /** Representation of connection to the device. */
    4852        usb_device_connection_t wire;
     53        /** Default (zero) control pipe. */
    4954        usb_endpoint_pipe_t ctrl_pipe;
     55        /** Polling (in) pipe. */
    5056        usb_endpoint_pipe_t poll_pipe;
     57        /** Polling interval in microseconds. */
    5158        suseconds_t poll_interval_us;
     59        /** IPC phone to console (consumer). */
    5260        int console_phone;
    5361} usb_mouse_t;
Note: See TracChangeset for help on using the changeset viewer.