Changeset dcb74c0a in mainline for uspace/lib/scsi/include


Ignore:
Timestamp:
2011-07-03T10:05:21Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64e6945d
Parents:
8e1a819
Message:

Add function to str.c to convert space-padded ASCII to standard string
representation. Use for decoding SCSI strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/scsi/include/scsi/spc.h

    r8e1a819 rdcb74c0a  
    3838
    3939#include <stdint.h>
     40#include <str.h>
    4041
    4142/** SCSI command codes defined in SCSI-SPC */
     
    9394} scsi_std_inquiry_data_t;
    9495
     96/** Size of struct or union member. */
     97#define SCSI_MEMBER_SIZE(type, member) \
     98    (sizeof(((type *)0) -> member))
     99
     100/** Size of string buffer needed to hold converted inquiry vendor string */
     101#define SCSI_INQ_VENDOR_STR_BUFSIZE \
     102    SPASCII_STR_BUFSIZE(SCSI_MEMBER_SIZE(scsi_std_inquiry_data_t, vendor))
     103
     104/** Size of string buffer needed to hold converted inquiry product string */
     105#define SCSI_INQ_PRODUCT_STR_BUFSIZE \
     106    SPASCII_STR_BUFSIZE(SCSI_MEMBER_SIZE(scsi_std_inquiry_data_t, product))
     107
     108/** Size of string buffer needed to hold converted inquiry revision string */
     109#define SCSI_INQ_REVISION_STR_BUFSIZE \
     110    SPASCII_STR_BUFSIZE(SCSI_MEMBER_SIZE(scsi_std_inquiry_data_t, revision))
     111
    95112/** Bits in scsi_std_inquiry_data_t.pqual_devtype */
    96113enum scsi_pqual_devtype_bits {
Note: See TracChangeset for help on using the changeset viewer.