Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161040
b: refs/heads/master
c: 14d9cb5
h: refs/heads/master
v: v3
  • Loading branch information
Chandra Seetharaman authored and James Bottomley committed Aug 22, 2009
1 parent 48d0c39 commit e720070
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18ee70c9d7b2dcd312a1f8c6536841e7c0fea5ca
refs/heads/master: 14d9cb5f760c86b3a8f686909465982231c06627
59 changes: 56 additions & 3 deletions trunk/drivers/scsi/device_handler/scsi_dh_emc.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,61 @@ static int clariion_activate(struct scsi_device *sdev)

return result;
}
/*
* params - parameters in the following format
* "no_of_params\0param1\0param2\0param3\0...\0"
* for example, string for 2 parameters with value 10 and 21
* is specified as "2\010\021\0".
*/
static int clariion_set_params(struct scsi_device *sdev, const char *params)
{
struct clariion_dh_data *csdev = get_clariion_data(sdev);
unsigned int hr = 0, st = 0, argc;
const char *p = params;
int result = SCSI_DH_OK;

if ((sscanf(params, "%u", &argc) != 1) || (argc != 2))
return -EINVAL;

while (*p++)
;
if ((sscanf(p, "%u", &st) != 1) || (st > 1))
return -EINVAL;

while (*p++)
;
if ((sscanf(p, "%u", &hr) != 1) || (hr > 1))
return -EINVAL;

if (st)
csdev->flags |= CLARIION_SHORT_TRESPASS;
else
csdev->flags &= ~CLARIION_SHORT_TRESPASS;

if (hr)
csdev->flags |= CLARIION_HONOR_RESERVATIONS;
else
csdev->flags &= ~CLARIION_HONOR_RESERVATIONS;

/*
* If this path is owned, we have to send a trespass command
* with the new parameters. If not, simply return. Next trespass
* command would use the parameters.
*/
if (csdev->lun_state != CLARIION_LUN_OWNED)
goto done;

csdev->lun_state = CLARIION_LUN_UNINITIALIZED;
result = send_trespass_cmd(sdev, csdev);
if (result != SCSI_DH_OK)
goto done;

/* Update status */
result = clariion_send_inquiry(sdev, csdev);

done:
return result;
}

static const struct scsi_dh_devlist clariion_dev_list[] = {
{"DGC", "RAID"},
Expand All @@ -581,11 +636,9 @@ static struct scsi_device_handler clariion_dh = {
.check_sense = clariion_check_sense,
.activate = clariion_activate,
.prep_fn = clariion_prep_fn,
.set_params = clariion_set_params,
};

/*
* TODO: need some interface so we can set trespass values
*/
static int clariion_bus_attach(struct scsi_device *sdev)
{
struct scsi_dh_data *scsi_dh_data;
Expand Down

0 comments on commit e720070

Please sign in to comment.