Changeset b4b534ac in mainline for uspace/drv/nic/ar9271/ath_usb.c


Ignore:
Timestamp:
2016-07-22T08:24:47Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f76d2c2
Parents:
5b18137 (diff), 8351f9a4 (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 lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ar9271/ath_usb.c

    r5b18137 rb4b534ac  
    3636#include <usb/debug.h>
    3737#include <malloc.h>
     38#include <errno.h>
    3839#include "ath_usb.h"
    3940
     
    9798{
    9899        ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
    99         usb_pipe_t *pipe =
    100             &ath_usb->usb_device->pipes[ath_usb->output_ctrl_pipe_number].pipe;
    101        
     100        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
     101            ath_usb->usb_device, ath_usb->output_ctrl_pipe_number)->pipe;
     102
    102103        return usb_pipe_write(pipe, buffer, buffer_size);
    103104}
     
    117118{
    118119        ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
    119         usb_pipe_t *pipe =
    120             &ath_usb->usb_device->pipes[ath_usb->input_ctrl_pipe_number].pipe;
    121        
     120        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
     121            ath_usb->usb_device, ath_usb->input_ctrl_pipe_number)->pipe;
     122
    122123        return usb_pipe_read(pipe, buffer, buffer_size, transferred_size);
    123124}
     
    140141        memcpy(complete_buffer + sizeof(ath_usb_data_header_t),
    141142            buffer, buffer_size);
    142        
     143
    143144        ath_usb_data_header_t *data_header =
    144145            (ath_usb_data_header_t *) complete_buffer;
    145146        data_header->length = host2uint16_t_le(buffer_size);
    146147        data_header->tag = host2uint16_t_le(TX_TAG);
    147        
     148
    148149        ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
    149         usb_pipe_t *pipe =
    150             &ath_usb->usb_device->pipes[ath_usb->output_data_pipe_number].pipe;
    151        
     150        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
     151            ath_usb->usb_device, ath_usb->output_data_pipe_number)->pipe;
     152
    152153        int ret_val = usb_pipe_write(pipe, complete_buffer,
    153154            complete_buffer_size);
    154        
     155
    155156        free(complete_buffer);
    156        
     157
    157158        return ret_val;
    158159}
     
    172173{
    173174        ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
    174         usb_pipe_t *pipe =
    175             &ath_usb->usb_device->pipes[ath_usb->input_data_pipe_number].pipe;
    176        
    177         return usb_pipe_read(pipe, buffer, buffer_size,
    178             transferred_size);
     175        usb_pipe_t *pipe = &usb_device_get_mapped_ep(
     176            ath_usb->usb_device, ath_usb->input_data_pipe_number)->pipe;
     177
     178        return usb_pipe_read(pipe, buffer, buffer_size, transferred_size);
    179179}
Note: See TracChangeset for help on using the changeset viewer.