Changeset 27736cf in mainline for uspace/lib/usbdev/src/pipesinit.c


Ignore:
Timestamp:
2011-10-31T16:50:31Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
07a7a97d
Parents:
f37eb84
Message:

usb: Don't pass speed info when registering endpoint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/pipesinit.c

    rf37eb84 r27736cf  
    454454 * @return Error code.
    455455 */
    456 int usb_pipe_register(usb_pipe_t *pipe,
    457     unsigned int interval,
    458     usb_hc_connection_t *hc_connection)
    459 {
    460         return usb_pipe_register_with_speed(pipe, USB_SPEED_MAX + 1,
    461             interval, hc_connection);
    462 }
    463 
    464 /** Register endpoint with a speed at the host controller.
    465  *
    466  * You will rarely need to use this function because it is needed only
    467  * if the registered endpoint is of address 0 and there is no other way
    468  * to tell speed of the device at address 0.
    469  *
    470  * @param pipe Pipe to be registered.
    471  * @param speed Speed of the device
    472  *      (invalid speed means use previously specified one).
    473  * @param interval Polling interval.
    474  * @param hc_connection Connection to the host controller (must be opened).
    475  * @return Error code.
    476  */
    477 int usb_pipe_register_with_speed(usb_pipe_t *pipe, usb_speed_t speed,
    478     unsigned int interval,
     456int usb_pipe_register(usb_pipe_t *pipe, unsigned interval,
    479457    usb_hc_connection_t *hc_connection)
    480458{
    481459        assert(pipe);
    482460        assert(hc_connection);
    483        
     461
    484462        if (!usb_hc_connection_is_opened(hc_connection))
    485463                return EBADF;
    486        
     464
    487465        const usb_target_t target =
    488466            {{ .address = pipe->wire->address, .endpoint = pipe->endpoint_no }};
    489 #define _PACK2(high, low) (((high) << 16) + (low))
    490 #define _PACK3(high, middle, low) (((((high) << 8) + (middle)) << 8) + (low))
    491        
     467#define _PACK2(high, low) (((high & 0xffff) << 16) | (low & 0xffff))
     468
    492469        async_exch_t *exch = async_exchange_begin(hc_connection->hc_sess);
    493470        int rc = async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    494471            IPC_M_USBHC_REGISTER_ENDPOINT, target.packed,
    495             _PACK3(speed, pipe->transfer_type, pipe->direction),
     472            _PACK2(pipe->transfer_type, pipe->direction),
    496473            _PACK2(pipe->max_packet_size, interval));
    497474        async_exchange_end(exch);
    498        
     475
    499476#undef _PACK2
    500 #undef _PACK3
    501        
    502477        return rc;
    503478}
Note: See TracChangeset for help on using the changeset viewer.