Changeset e7b7ebd5 in mainline


Ignore:
Timestamp:
2011-02-24T12:47:35Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f840ed
Parents:
92574f4
Message:

Fixed initialization.

Problems introduced when merging:

  • Was not saving the size of the report and preparing space for it.
  • Was not setting configuration to the device.
File:
1 edited

Legend:

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

    r92574f4 re7b7ebd5  
    557557        // TODO: get descriptors, parse descriptors and save endpoints
    558558        usb_endpoint_pipe_start_session(&kbd_dev->ctrl_pipe);
    559         //usb_request_set_configuration(&kbd_dev->ctrl_pipe, 1);
    560559        rc = usbkbd_process_descriptors(kbd_dev);
    561560        usb_endpoint_pipe_end_session(&kbd_dev->ctrl_pipe);
     
    563562                goto error_leave;
    564563        }
    565 
     564       
     565        // save the size of the report
     566        kbd_dev->keycode_count = BOOTP_REPORT_SIZE;
     567        kbd_dev->keycodes = (uint8_t *)calloc(
     568            kbd_dev->keycode_count, sizeof(uint8_t));
     569       
     570        if (kbd_dev->keycodes == NULL) {
     571                usb_log_fatal("No memory!\n");
     572                goto error_leave;
     573        }
     574       
     575        // set configuration to the first one
     576        // TODO: handle case with no configurations
     577        usb_endpoint_pipe_start_session(&kbd_dev->ctrl_pipe);
     578        usb_request_set_configuration(&kbd_dev->ctrl_pipe,
     579            kbd_dev->conf->config_descriptor.configuration_number);
     580        usb_endpoint_pipe_end_session(&kbd_dev->ctrl_pipe);
     581       
    566582        return kbd_dev;
    567583
Note: See TracChangeset for help on using the changeset viewer.