Changeset 411d9fa in mainline


Ignore:
Timestamp:
2011-03-18T16:53:18Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3746bfe
Parents:
98637224 (diff), 382f3266 (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:

Mouse sets boot protocol

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmouse/init.c

    r98637224 r411d9fa  
    124124                goto leave;
    125125        }
     126       
     127        /* Open the control pipe. */
     128        rc = usb_endpoint_pipe_start_session(&dev->ctrl_pipe);
     129        if (rc != EOK) {
     130                goto leave;
     131        }
     132       
     133        /* Set the boot protocol. */
     134        rc = usb_control_request_set(&dev->ctrl_pipe,
     135            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE,
     136            USB_HIDREQ_SET_PROTOCOL, USB_HID_PROTOCOL_BOOT, dev->interface_no,
     137            NULL, 0);
     138        if (rc != EOK) {
     139                goto leave;
     140        }
     141       
     142        /* Close the control pipe (ignore errors). */
     143        usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     144
    126145
    127146        /* Everything allright. */
  • uspace/lib/usb/include/usb/devdrv.h

    r98637224 r411d9fa  
    4747         */
    4848        usb_endpoint_mapping_t *pipes;
     49        /** Current interface.
     50         * Usually, drivers operate on single interface only.
     51         * This item contains the value of the interface or -1 for any.
     52         */
     53        int interface_no;
    4954        /** Generic DDF device backing this one. */
    5055        ddf_dev_t *ddf_dev;
  • uspace/lib/usb/src/devdrv.c

    r98637224 r411d9fa  
    109109{
    110110        int rc;
    111         int my_interface = usb_device_get_assigned_interface(dev->ddf_dev);
     111        dev->interface_no = usb_device_get_assigned_interface(dev->ddf_dev);
    112112
    113113        size_t pipe_count = count_other_pipes(drv);
     
    134134
    135135                dev->pipes[i].description = drv->endpoints[i];
    136                 dev->pipes[i].interface_no = my_interface;
     136                dev->pipes[i].interface_no = dev->interface_no;
    137137        }
    138138
Note: See TracChangeset for help on using the changeset viewer.