Add POWER_CONDITION modepage marshalling/unmarshalling

This commit is contained in:
Ronnie Sahlberg
2013-07-20 15:35:38 -07:00
parent 0013ae25e6
commit 52a83e91af
9 changed files with 149 additions and 30 deletions

View File

@@ -72,7 +72,7 @@ int T0300_readonly(const char *initiator, const char *url)
/* verify the device is readonly */
task = iscsi_modesense6_sync(iscsi, lun, 0, SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES, 0,
SCSI_MODEPAGE_RETURN_ALL_PAGES, 0,
4);
if (task == NULL) {
printf("Failed to send modesense6 command: %s\n", iscsi_get_error(iscsi));
@@ -82,7 +82,7 @@ int T0300_readonly(const char *initiator, const char *url)
if (full_size > task->datain.size) {
scsi_free_scsi_task(task);
task = iscsi_modesense6_sync(iscsi, lun, 0, SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES, 0,
SCSI_MODEPAGE_RETURN_ALL_PAGES, 0,
full_size);
if (task == NULL) {
printf("Failed to send modesense6 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -6028,7 +6028,7 @@ int set_swp(struct iscsi_context *iscsi, int lun)
logging(LOG_VERBOSE, "Read CONTROL page");
sense_task = iscsi_modesense6_sync(iscsi, lun,
1, SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_CONTROL,
SCSI_MODEPAGE_CONTROL,
0, 255);
if (sense_task == NULL) {
logging(LOG_NORMAL, "Failed to send MODE_SENSE6 command: %s",
@@ -6049,7 +6049,7 @@ int set_swp(struct iscsi_context *iscsi, int lun)
ret = -1;
goto finished;
}
mp = scsi_modesense_get_page(ms, SCSI_MODESENSE_PAGECODE_CONTROL, 0);
mp = scsi_modesense_get_page(ms, SCSI_MODEPAGE_CONTROL, 0);
if (mp == NULL) {
logging(LOG_NORMAL, "failed to read control mode page");
ret = -1;
@@ -6095,7 +6095,7 @@ int clear_swp(struct iscsi_context *iscsi, int lun)
logging(LOG_VERBOSE, "Read CONTROL page");
sense_task = iscsi_modesense6_sync(iscsi, lun,
1, SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_CONTROL,
SCSI_MODEPAGE_CONTROL,
0, 255);
if (sense_task == NULL) {
logging(LOG_NORMAL, "Failed to send MODE_SENSE6 command: %s",
@@ -6116,7 +6116,7 @@ int clear_swp(struct iscsi_context *iscsi, int lun)
ret = -1;
goto finished;
}
mp = scsi_modesense_get_page(ms, SCSI_MODESENSE_PAGECODE_CONTROL, 0);
mp = scsi_modesense_get_page(ms, SCSI_MODEPAGE_CONTROL, 0);
if (mp == NULL) {
logging(LOG_NORMAL, "failed to read control mode page");
ret = -1;

View File

@@ -1185,7 +1185,7 @@ main(int argc, char *argv[])
/* check if the device is write protected or not */
task = iscsi_modesense6_sync(iscsic, lun, 0, SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES,
SCSI_MODEPAGE_RETURN_ALL_PAGES,
0, 255);
if (task == NULL) {
printf("Failed to send MODE_SENSE6 command: %s\n",

View File

@@ -41,7 +41,7 @@ test_modesense6_all_pages(void)
logging(LOG_VERBOSE, "Send MODESENSE6 command to fetch AllPages");
task = iscsi_modesense6_sync(iscsic, tgt_lun, 0,
SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES,
SCSI_MODEPAGE_RETURN_ALL_PAGES,
0, 255);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
logging(LOG_VERBOSE, "[FAILED] Failed to send MODE_SENSE6 "

View File

@@ -42,7 +42,7 @@ test_modesense6_residuals(void)
}
task = iscsi_modesense6_sync(iscsic, tgt_lun, 0,
SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES,
SCSI_MODEPAGE_RETURN_ALL_PAGES,
0, 4);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
logging(LOG_VERBOSE, "[FAILED] Failed to send MODE_SENSE6 "
@@ -82,7 +82,7 @@ test_modesense6_residuals(void)
}
task = iscsi_modesense6_sync(iscsic, tgt_lun, 0,
SCSI_MODESENSE_PC_CURRENT,
SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES,
SCSI_MODEPAGE_RETURN_ALL_PAGES,
0, 255);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
logging(LOG_VERBOSE, "[FAILED] Failed to send MODE_SENSE6 "