Lines Matching refs:buf

21 uint32_t scsi_data_cdb_xfer(uint8_t *buf)  in scsi_data_cdb_xfer()  argument
23 if ((buf[0] >> 5) == 0 && buf[4] == 0) { in scsi_data_cdb_xfer()
26 return scsi_cdb_xfer(buf); in scsi_data_cdb_xfer()
30 uint32_t scsi_cdb_xfer(uint8_t *buf) in scsi_cdb_xfer() argument
32 switch (buf[0] >> 5) { in scsi_cdb_xfer()
34 return buf[4]; in scsi_cdb_xfer()
37 return lduw_be_p(&buf[7]); in scsi_cdb_xfer()
39 return ldl_be_p(&buf[10]) & 0xffffffffULL; in scsi_cdb_xfer()
41 return ldl_be_p(&buf[6]) & 0xffffffffULL; in scsi_cdb_xfer()
49 uint8_t *buf = cmd->buf; in scsi_cmd_lba() local
52 switch (buf[0] >> 5) { in scsi_cmd_lba()
54 lba = ldl_be_p(&buf[0]) & 0x1fffff; in scsi_cmd_lba()
59 lba = ldl_be_p(&buf[2]) & 0xffffffffULL; in scsi_cmd_lba()
62 lba = ldq_be_p(&buf[2]); in scsi_cmd_lba()
71 int scsi_cdb_length(uint8_t *buf) in scsi_cdb_length() argument
75 switch (buf[0] >> 5) { in scsi_cdb_length()
125 uint8_t buf[SCSI_SENSE_LEN] = { 0 }; in scsi_build_sense_buf() local
128 buf[0] = 0x70; in scsi_build_sense_buf()
129 buf[2] = sense.key; in scsi_build_sense_buf()
130 buf[7] = 10; in scsi_build_sense_buf()
131 buf[12] = sense.asc; in scsi_build_sense_buf()
132 buf[13] = sense.ascq; in scsi_build_sense_buf()
135 buf[0] = 0x72; in scsi_build_sense_buf()
136 buf[1] = sense.key; in scsi_build_sense_buf()
137 buf[2] = sense.asc; in scsi_build_sense_buf()
138 buf[3] = sense.ascq; in scsi_build_sense_buf()
142 memcpy(out_buf, buf, len); in scsi_build_sense_buf()
146 int scsi_build_sense(uint8_t *buf, SCSISense sense) in scsi_build_sense() argument
148 return scsi_build_sense_buf(buf, SCSI_SENSE_LEN, sense, true); in scsi_build_sense()
336 uint8_t *buf, int len, bool fixed) in scsi_convert_sense() argument
342 return scsi_build_sense_buf(buf, len, SENSE_CODE(NO_SENSE), fixed); in scsi_convert_sense()
347 memcpy(buf, in_buf, MIN(len, in_len)); in scsi_convert_sense()
351 return scsi_build_sense_buf(buf, len, sense, fixed); in scsi_convert_sense()