Changeset 5f0fe4e9 in mainline for uspace/drv/usbmast/mast.c


Ignore:
Timestamp:
2011-05-11T19:37:16Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c372e03
Parents:
cf002dbf
Message:

Mass storage (small) refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmast/mast.c

    rcf002dbf r5f0fe4e9  
    173173/** Get max LUN of a mass storage device.
    174174 *
     175 * @see usb_masstor_get_lun_count
     176 *
    175177 * @warning Error from this command does not necessarily indicate malfunction
    176178 * of the device. Device does not need to support this request.
     179 * You shall rather use usb_masstor_get_lun_count.
    177180 *
    178181 * @param dev Mass storage device.
     
    195198}
    196199
     200/** Get number of LUNs supported by mass storage device.
     201 *
     202 * @warning This function hides any error during the request
     203 * (typically that shall not be a problem).
     204 *
     205 * @param dev Mass storage device.
     206 * @return Number of LUNs.
     207 */
     208size_t usb_masstor_get_lun_count(usb_device_t *dev)
     209{
     210        int max_lun = usb_massstor_get_max_lun(dev);
     211        if (max_lun < 0) {
     212                max_lun = 1;
     213        } else {
     214                max_lun++;
     215        }
     216
     217        return (size_t) max_lun;
     218}
     219
    197220/**
    198221 * @}
Note: See TracChangeset for help on using the changeset viewer.