Changeset 77733a9 in mainline


Ignore:
Timestamp:
2018-01-27T13:35:46Z (6 years ago)
Author:
Salmelu <salmelu@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
80f7c54
Parents:
a94cbfa
Message:

libusbdev: removed unneeded isoch session

Location:
uspace/lib/usbdev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/pipes.h

    ra94cbfa r77733a9  
    6060        /** The connection used for sending the data. */
    6161        usb_dev_session_t *bus_session;
    62         /** The session used for isochronous endpoints.
    63          * Required as isochronous sends/receive can block the session.
    64          */
    65         usb_dev_session_t *isoch_session;
    6662} usb_pipe_t;
    6763
  • uspace/lib/usbdev/src/pipes.c

    ra94cbfa r77733a9  
    190190        }
    191191
    192         async_exch_t *exch;
    193         if (pipe->desc.transfer_type == USB_TRANSFER_ISOCHRONOUS)
    194                 exch = async_exchange_begin(pipe->isoch_session);
    195         else
    196                 exch = async_exchange_begin(pipe->bus_session);
     192        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
    197193        size_t act_size = 0;
    198194        const int rc =
     
    230226        }
    231227
    232         async_exch_t *exch;
    233         if (pipe->desc.transfer_type == USB_TRANSFER_ISOCHRONOUS)
    234                 exch = async_exchange_begin(pipe->isoch_session);
    235         else
    236                 exch = async_exchange_begin(pipe->bus_session);
    237 
     228        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
    238229        const int rc = usbhc_write(exch, pipe->desc.endpoint_no, 0, buffer, size);
    239230        async_exchange_end(exch);
    240231        return rc;
    241 }
    242 
    243 /** Setup isochronous session for isochronous communication.
    244  *  Isochronous endpoints need a different session as they might block while waiting for data.
    245  *
    246  * @param pipe Endpoint pipe being initialized.
    247  * @return Error code.
    248  */
    249 static int usb_isoch_session_initialize(usb_pipe_t *pipe) {
    250 
    251         /*
    252          * XXX: As parallel exhanges are implemented by using parallel sessions,
    253          * it is safe to just take the same session. Once this won't be true,
    254          * just use session cloning to clone the bus session.
    255          */
    256         pipe->isoch_session = pipe->bus_session;
    257         return EOK;
    258232}
    259233
     
    270244        pipe->auto_reset_halt = false;
    271245        pipe->bus_session = bus_session;
    272 
    273         if (transfer_type == USB_TRANSFER_ISOCHRONOUS)
    274                 return usb_isoch_session_initialize(pipe);
    275246
    276247        return EOK;
Note: See TracChangeset for help on using the changeset viewer.