On 2018-11-12 11:32 a.m., Bean Huo (beanhuo) wrote:
This patch is to convert inputted string to the integer
when read data from stdin. While entering data flow, the
data between bytes can be separated by either space,
or ',' (or by '.').

V1-V2:
        1. Rebased the patch on the latest sg_write_buffer.c
        2. Added the wrong input checkup, and process
        3. Changed the delimer from ",. " to ",. /n/t", in order
         to skip the spaces at the end of string because of misoperation.
        4. Modified some wrong indents.

Tested on my own UFS platform, used to issue VU command:

./sg_write_buffer -b 0 -i 0 -v -l 0x2c -m 1  -S 7 -r /dev/block/sda
0x01 0x40 0x20
tried to read 44 bytes from -, got 3 bytes
pad with 0xff bytes and continue
sending single write buffer, mode=0x1, mpsec=7, id=0, offset=0, len=44
     Write buffer cdb: 3b e1 00 00 00 00 00 00 2c 00

./sg_read_buffer -l 32 -m 1 -S 6 -v /dev/block/sda
     Read buffer(10) cdb: 3c c1 00 00 00 00 00 00 20 00
  00     61 34 64 36 63 38 61 42  65 36 4b 4d 4c 34 4c 30
  10     30 34 44 43 45 32 30 32  57 30 00 00 00 00 00 00

Signed-off-by: Bean Huo <bean...@micron.com>

Thanks, applied.

Just prior to getting this patch today I put up a sg3_utils-1.45
(early) beta: revision 795. It's in a tarball at the top of
    http://sg.danny.cz/sg/

This patch will be in revision 796.

Doug Gilbert

Reply via email to