Displaying 4 results from an estimated 4 matches for "sense_buf".
Did you mean:
send_buf
2009 Oct 27
0
[PATCH 1/4] Add 'raid' interface class
...131072
#define SCSI_MAX_INQUIRY_LEN 256
+#define SCSI_SENSE_LEN 18
#define SCSI_REQ_STATUS_RETRY 0x01
@@ -136,6 +137,22 @@ static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
return r;
}
+/* Helper function to build a sense block */
+int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense)
+{
+ memset(sense_buf, 0, SCSI_SENSE_LEN);
+ if (!sense)
+ return 0;
+
+ sense_buf[0] = 0xf0; /* current, fixed format */
+ sense_buf[2] = (sense >> 16) & 0x0F;
+ sense_buf[7] = 10;
+ sense_buf[12] = (sense >> 8 ) & 0xFF;
+ sense_buf[1...
2009 Oct 27
0
[PATCH 1/4] Add 'raid' interface class
...131072
#define SCSI_MAX_INQUIRY_LEN 256
+#define SCSI_SENSE_LEN 18
#define SCSI_REQ_STATUS_RETRY 0x01
@@ -136,6 +137,22 @@ static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
return r;
}
+/* Helper function to build a sense block */
+int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense)
+{
+ memset(sense_buf, 0, SCSI_SENSE_LEN);
+ if (!sense)
+ return 0;
+
+ sense_buf[0] = 0xf0; /* current, fixed format */
+ sense_buf[2] = (sense >> 16) & 0x0F;
+ sense_buf[7] = 10;
+ sense_buf[12] = (sense >> 8 ) & 0xFF;
+ sense_buf[1...
2009 Oct 27
2
[PATCH 3/4] scsi-disk: Factor out SCSI command emulation
...t;iov;
+}
+
static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
{
SCSIRequest *r;
@@ -137,12 +148,11 @@ static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
return r;
}
-/* Helper function to build a sense block */
int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense)
{
memset(sense_buf, 0, SCSI_SENSE_LEN);
if (!sense)
- return 0;
+ return 0;
sense_buf[0] = 0xf0; /* current, fixed format */
sense_buf[2] = (sense >> 16) & 0x0F;
@@ -154,15 +164,19 @@ int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense...
2009 Oct 27
2
[PATCH 3/4] scsi-disk: Factor out SCSI command emulation
...t;iov;
+}
+
static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
{
SCSIRequest *r;
@@ -137,12 +148,11 @@ static SCSIRequest *scsi_find_request(SCSIDiskState *s, uint32_t tag)
return r;
}
-/* Helper function to build a sense block */
int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense)
{
memset(sense_buf, 0, SCSI_SENSE_LEN);
if (!sense)
- return 0;
+ return 0;
sense_buf[0] = 0xf0; /* current, fixed format */
sense_buf[2] = (sense >> 16) & 0x0F;
@@ -154,15 +164,19 @@ int32_t scsi_build_sense(uint8_t *sense_buf, uint32_t sense...