~adam-hraska+lp/helenos/cht-bench

« back to all changes in this revision

Viewing changes to uspace/lib/usbdev/src/pipesinit.c

  • Committer: Adam Hraska
  • Date: 2012-08-08 17:19:28 UTC
  • mfrom: (1574.1.16 rcu-clone)
  • Revision ID: adam.hraska+hos@gmail.com-20120808171928-7gf0fh7pcxxcoaoo
Merged in mainline changes from rcu-clone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
static int process_endpoint(
154
154
    usb_endpoint_mapping_t *mapping, size_t mapping_count,
155
155
    usb_standard_interface_descriptor_t *interface,
156
 
    usb_standard_endpoint_descriptor_t *endpoint,
 
156
    usb_standard_endpoint_descriptor_t *endpoint_desc,
157
157
    usb_device_connection_t *wire)
158
158
{
159
159
 
162
162
         */
163
163
 
164
164
        /* Actual endpoint number is in bits 0..3 */
165
 
        const usb_endpoint_t ep_no = endpoint->endpoint_address & 0x0F;
 
165
        const usb_endpoint_t ep_no = endpoint_desc->endpoint_address & 0x0F;
166
166
 
167
167
        const usb_endpoint_description_t description = {
168
168
                /* Endpoint direction is set by bit 7 */
169
 
                .direction = (endpoint->endpoint_address & 128)
 
169
                .direction = (endpoint_desc->endpoint_address & 128)
170
170
                    ? USB_DIRECTION_IN : USB_DIRECTION_OUT,
171
171
                /* Transfer type is in bits 0..2 and
172
172
                 * the enum values corresponds 1:1 */
173
 
                .transfer_type = endpoint->attributes & 3,
 
173
                .transfer_type = endpoint_desc->attributes & 3,
174
174
 
175
175
                /* Get interface characteristics. */
176
176
                .interface_class = interface->interface_class,
193
193
        }
194
194
 
195
195
        int rc = usb_pipe_initialize(&ep_mapping->pipe, wire,
196
 
            ep_no, description.transfer_type, endpoint->max_packet_size,
 
196
            ep_no, description.transfer_type,
 
197
            uint16_usb2host(endpoint_desc->max_packet_size),
197
198
            description.direction);
198
199
        if (rc != EOK) {
199
200
                return rc;
200
201
        }
201
202
 
202
203
        ep_mapping->present = true;
203
 
        ep_mapping->descriptor = endpoint;
 
204
        ep_mapping->descriptor = endpoint_desc;
204
205
        ep_mapping->interface = interface;
205
206
 
206
207
        return EOK;