Changeset a39cfb8 in mainline for uspace/drv/ohci/root_hub.c


Ignore:
Timestamp:
2011-04-14T07:54:33Z (14 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e05d6c3
Parents:
3f3afb9 (diff), 34e8bab (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:

merge from development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/root_hub.c

    r3f3afb9 ra39cfb8  
    205205 * @return Error code.
    206206 */
    207 int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs) {
     207int rh_init(rh_t *instance, ohci_regs_t *regs) {
    208208        assert(instance);
    209         //instance->address = -1;
    210209        instance->registers = regs;
    211         instance->device = dev;
    212210        instance->port_count =
    213211            (instance->registers->rh_desc_a >> RHDA_NDS_SHIFT) & RHDA_NDS_MASK;
    214212        rh_init_descriptors(instance);
    215213        // set port power mode to no-power-switching
    216         instance->registers->rh_desc_a =
    217                 instance->registers->rh_desc_a | (1<<9);
     214        instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
    218215
    219216        usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
    220 
    221         //start generic usb hub driver
    222 
    223         /* TODO: implement */
    224217        return EOK;
    225218}
     
    237230        assert(request);
    238231        int opResult;
    239         if (request->transfer_type == USB_TRANSFER_CONTROL) {
     232        if (request->ep->transfer_type == USB_TRANSFER_CONTROL) {
    240233                usb_log_info("Root hub got CONTROL packet\n");
    241234                opResult = process_ctrl_request(instance, request);
    242         } else if (request->transfer_type == USB_TRANSFER_INTERRUPT) {
     235        } else if (request->ep->transfer_type == USB_TRANSFER_INTERRUPT) {
    243236                usb_log_info("Root hub got INTERRUPT packet\n");
    244237                void * buffer;
    245238                create_interrupt_mask(instance, &buffer,
    246239                        &(request->transfered_size));
    247                 memcpy(request->transport_buffer, buffer,
     240                memcpy(request->data_buffer, buffer,
    248241                        request->transfered_size);
    249242                opResult = EOK;
     
    374367        if (port < 1 || port > instance->port_count)
    375368                return EINVAL;
    376         uint32_t * uint32_buffer = (uint32_t*) request->transport_buffer;
     369        uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
    377370        request->transfered_size = 4;
    378371        uint32_buffer[0] = instance->registers->rh_port_status[port - 1];
     
    400393static int process_get_hub_status_request(rh_t *instance,
    401394        usb_transfer_batch_t * request) {
    402         uint32_t * uint32_buffer = (uint32_t*) request->transport_buffer;
     395        uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
    403396        request->transfered_size = 4;
    404397        //bits, 0,1,16,17
     
    550543        }
    551544        request->transfered_size = size;
    552         memcpy(request->transport_buffer, result_descriptor, size);
     545        memcpy(request->data_buffer, result_descriptor, size);
    553546        if (del)
    554547                free(result_descriptor);
     
    571564        if (request->buffer_size != 1)
    572565                return EINVAL;
    573         request->transport_buffer[0] = 1;
     566        request->data_buffer[0] = 1;
    574567        request->transfered_size = 1;
    575568        return EOK;
Note: See TracChangeset for help on using the changeset viewer.