2016年6月24日 星期五

ses raw command example

sg_ses -c -p dm /dev/sgxx -d 00,00,00,00,0f,00,00,00,00,00,00,00,00,00,00,00

for sending download microcode mode 0x0f

sg_ses -p 0x2 -c -d 00,00,00,00,00,00,00,00,80,80,40,00,80,80,40,00,80,80,40,20 /dev/bsg/0:0:89:0  -vvv
sg_senddiag -pf -r 2,0,0,c,0,0,0,0,0,0,0,0,80,80,40,0 -vvv /dev/sg0
sg_ses  --index=_23,00 --set=2:1:1=1 /dev/sg0 -vv (in this format, _23 refers to type code 0x17 - Array device slot. for the set option, it refers to byte 2 bit 1 right shift 1-1 bit)


ex:
data was 80 80 42 00
set=2:1:3=1
changed to 80 80 40 80

trick: no need to append page header in raw format. to check header type code. sg_ses -e , to check supported diag command : sg_ses -ee