Add POWER_CONDITION modepage marshalling/unmarshalling
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 "
|
||||
|
||||
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user