Ignore:
Timestamp:
2011-07-15T20:41:36Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2aceec5
Parents:
7190bbc
Message:

Prepare for supporting multiple LUNs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmast/bo_trans.c

    r7190bbc re6b32a8  
    5858 * @param tag           Command block wrapper tag (automatically compared
    5959 *                      with answer)
    60  * @param lun           LUN
    6160 * @param cmd           Command block
    6261 * @param cmd_size      Command block size in bytes
     
    6867 * @return              Error code
    6968 */
    70 static int usb_massstor_cmd(usbmast_fun_t *mfun, uint32_t tag, uint8_t lun,
    71     const void *cmd, size_t cmd_size, usb_direction_t ddir, void *dbuf,
    72     size_t dbuf_size, size_t *xferred_size)
     69static int usb_massstor_cmd(usbmast_fun_t *mfun, uint32_t tag, const void *cmd,
     70    size_t cmd_size, usb_direction_t ddir, void *dbuf, size_t dbuf_size,
     71    size_t *xferred_size)
    7372{
    7473        int rc;
     
    7978        /* Prepare CBW - command block wrapper */
    8079        usb_massstor_cbw_t cbw;
    81         usb_massstor_cbw_prepare(&cbw, tag, dbuf_size, ddir, lun, cmd_size,
    82             cmd);
     80        usb_massstor_cbw_prepare(&cbw, tag, dbuf_size, ddir, mfun->lun,
     81            cmd_size, cmd);
    8382
    8483        /* Send the CBW. */
     
    170169 * @param tag           Command block wrapper tag (automatically compared with
    171170 *                      answer)
    172  * @param lun           LUN
    173171 * @param cmd           CDB (Command Descriptor)
    174172 * @param cmd_size      CDB length in bytes
     
    179177 * @return Error code
    180178 */
    181 int usb_massstor_data_in(usbmast_fun_t *mfun, uint32_t tag, uint8_t lun,
    182     const void *cmd, size_t cmd_size, void *dbuf, size_t dbuf_size, size_t *proc_size)
    183 {
    184         return usb_massstor_cmd(mfun, tag, lun, cmd, cmd_size, USB_DIRECTION_IN,
     179int usb_massstor_data_in(usbmast_fun_t *mfun, uint32_t tag, const void *cmd,
     180    size_t cmd_size, void *dbuf, size_t dbuf_size, size_t *proc_size)
     181{
     182        return usb_massstor_cmd(mfun, tag, cmd, cmd_size, USB_DIRECTION_IN,
    185183            dbuf, dbuf_size, proc_size);
    186184}
     
    191189 * @param tag           Command block wrapper tag (automatically compared with
    192190 *                      answer)
    193  * @param lun           LUN
    194191 * @param cmd           CDB (Command Descriptor)
    195192 * @param cmd_size      CDB length in bytes
     
    200197 * @return Error code
    201198 */
    202 int usb_massstor_data_out(usbmast_fun_t *mfun, uint32_t tag, uint8_t lun,
    203     const void *cmd, size_t cmd_size, const void *data, size_t data_size,
    204     size_t *proc_size)
    205 {
    206         return usb_massstor_cmd(mfun, tag, lun, cmd, cmd_size, USB_DIRECTION_OUT,
     199int usb_massstor_data_out(usbmast_fun_t *mfun, uint32_t tag, const void *cmd,
     200    size_t cmd_size, const void *data, size_t data_size, size_t *proc_size)
     201{
     202        return usb_massstor_cmd(mfun, tag, cmd, cmd_size, USB_DIRECTION_OUT,
    207203            (void *) data, data_size, proc_size);
    208204}
Note: See TracChangeset for help on using the changeset viewer.