Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292836
b: refs/heads/master
c: 089461d
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier authored and Nicholas Bellinger committed Feb 25, 2012
1 parent 59de95b commit 32a0bb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: d95b82461c56a6ff8ff248b101049a69ebb20278
refs/heads/master: 089461dda1770c10fea0b988ff74519a9be81d7e
20 changes: 10 additions & 10 deletions trunk/drivers/target/target_core_cdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@ target_emulate_inquiry_std(struct se_cmd *cmd, char *buf)
{
struct se_lun *lun = cmd->se_lun;
struct se_device *dev = cmd->se_dev;
struct se_portal_group *tpg = lun->lun_sep->sep_tpg;

if (dev == tpg->tpg_virt_lun0.lun_se_dev) {
buf[0] = 0x3f; /* Not connected */
} else {
buf[0] = dev->transport->get_device_type(dev);
if (buf[0] == TYPE_TAPE)
buf[1] = 0x80;
}
/* Set RMB (removable media) for tape devices */
if (dev->transport->get_device_type(dev) == TYPE_TAPE)
buf[1] = 0x80;

buf[2] = dev->transport->get_device_rev(dev);

/*
Expand Down Expand Up @@ -606,6 +602,7 @@ int target_emulate_inquiry(struct se_task *task)
{
struct se_cmd *cmd = task->task_se_cmd;
struct se_device *dev = cmd->se_dev;
struct se_portal_group *tpg = cmd->se_lun->lun_sep->sep_tpg;
unsigned char *buf, *map_buf;
unsigned char *cdb = cmd->t_task_cdb;
int p, ret;
Expand All @@ -630,6 +627,11 @@ int target_emulate_inquiry(struct se_task *task)
buf = map_buf;
}

if (dev == tpg->tpg_virt_lun0.lun_se_dev)
buf[0] = 0x3f; /* Not connected */
else
buf[0] = dev->transport->get_device_type(dev);

if (!(cdb[1] & 0x1)) {
if (cdb[2]) {
pr_err("INQUIRY with EVPD==0 but PAGE CODE=%02x\n",
Expand All @@ -643,8 +645,6 @@ int target_emulate_inquiry(struct se_task *task)
goto out;
}

buf[0] = dev->transport->get_device_type(dev);

for (p = 0; p < ARRAY_SIZE(evpd_handlers); ++p) {
if (cdb[2] == evpd_handlers[p].page) {
buf[1] = cdb[2];
Expand Down

0 comments on commit 32a0bb2

Please sign in to comment.