Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset cf002dbf in mainline


Ignore:
Timestamp:
2011-05-11T19:31:16Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
5f0fe4e9
Parents:
70c12d6
Message:

Add comments to mass storage driver

Location:
uspace/drv/usbmast
Files:
3 edited

Legend:

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

    r70c12d6 rcf002dbf  
    5555
    5656#define STR_UNKNOWN "<unknown>"
     57
     58/** String constants for SCSI peripheral device types. */
    5759static const char *str_peripheral_device_types[] = {
    5860        "direct-access device",
     
    9294        (sizeof(str_peripheral_device_types)/sizeof(str_peripheral_device_types[0]))
    9395
     96/** Get string representation for SCSI peripheral device type.
     97 *
     98 * See for example here for a list
     99 * http://en.wikipedia.org/wiki/SCSI_Peripheral_Device_Type.
     100 *
     101 * @param type SCSI peripheral device type code.
     102 * @return String representation.
     103 */
    94104const char *usb_str_masstor_scsi_peripheral_device_type(int type)
    95105{
     
    101111}
    102112
     113/** Trim trailing spaces from a string (rewrite with string terminator).
     114 *
     115 * @param name String to be trimmed (in-out parameter).
     116 */
    103117static void trim_trailing_spaces(char *name)
    104118{
     
    110124}
    111125
     126/** Perform SCSI INQUIRY command on USB mass storage device.
     127 *
     128 * @param dev USB device.
     129 * @param bulk_in_idx Index (in dev->pipes) of bulk in pipe.
     130 * @param bulk_out_idx Index of bulk out pipe.
     131 * @param inquiry_result Where to store parsed inquiry result.
     132 * @return Error code.
     133 */
    112134int usb_massstor_inquiry(usb_device_t *dev,
    113135    size_t bulk_in_idx, size_t bulk_out_idx,
  • uspace/drv/usbmast/mast.c

    r70c12d6 rcf002dbf  
    139139}
    140140
     141/** Perform bulk-only mass storage reset.
     142 *
     143 * @param dev Device to be reseted.
     144 * @return Error code.
     145 */
    141146int usb_massstor_reset(usb_device_t *dev)
    142147{
     
    146151}
    147152
     153/** Perform complete reset recovery of bulk-only mass storage.
     154 *
     155 * Notice that no error is reported because if this fails, the error
     156 * would reappear on next transaction somehow.
     157 *
     158 * @param dev Device to be reseted.
     159 * @param bulk_in_idx Index of bulk in pipe.
     160 * @param bulk_out_idx Index of bulk out pipe.
     161 */
    148162void usb_massstor_reset_recovery(usb_device_t *dev,
    149163    size_t bulk_in_idx, size_t bulk_out_idx)
     
    157171}
    158172
     173/** Get max LUN of a mass storage device.
     174 *
     175 * @warning Error from this command does not necessarily indicate malfunction
     176 * of the device. Device does not need to support this request.
     177 *
     178 * @param dev Mass storage device.
     179 * @return Error code of maximum LUN (index, not count).
     180 */
    159181int usb_massstor_get_max_lun(usb_device_t *dev)
    160182{
  • uspace/drv/usbmast/mast.h

    r70c12d6 rcf002dbf  
    4242#include <usb/devdrv.h>
    4343
     44/** Result of SCSI INQUIRY command.
     45 * This is already parsed structure, not the original buffer returned by
     46 * the device.
     47 */
    4448typedef struct {
     49        /** SCSI peripheral device type. */
    4550        int peripheral_device_type;
     51        /** Whether the device is removable. */
    4652        bool removable;
     53        /** Vendor ID string. */
    4754        char vendor_id[9];
     55        /** Product ID and product revision string. */
    4856        char product_and_revision[12];
    4957} usb_massstor_inquiry_result_t;
Note: See TracChangeset for help on using the changeset viewer.