Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15385
b: refs/heads/master
c: e309fc6
h: refs/heads/master
i:
  15383: de08ded
v: v3
  • Loading branch information
Ben Collins authored and Jody McIntyre committed Nov 7, 2005
1 parent 18e0dd4 commit 11361f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 35 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: 365c786f0be44ee92e018773cb0bc4b19080b6aa
refs/heads/master: e309fc6d71d61bb0f049ab6d0da10c845da9513f
34 changes: 6 additions & 28 deletions trunk/drivers/ieee1394/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
INIT_LIST_HEAD(&scsi_id->scsi_list);
spin_lock_init(&scsi_id->sbp2_command_orb_lock);
scsi_id->sbp2_device_type_and_lun = SBP2_DEVICE_TYPE_LUN_UNINITIALIZED;
scsi_id->sbp2_lun = 0;

ud->device.driver_data = scsi_id;

Expand Down Expand Up @@ -1110,11 +1110,7 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id)

scsi_id->query_logins_orb->lun_misc = ORB_SET_FUNCTION(SBP2_QUERY_LOGINS_REQUEST);
scsi_id->query_logins_orb->lun_misc |= ORB_SET_NOTIFY(1);
if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {
scsi_id->query_logins_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun);
SBP2_DEBUG("sbp2_query_logins: set lun to %d",
ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun));
}
scsi_id->query_logins_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_lun);
SBP2_DEBUG("sbp2_query_logins: lun_misc initialized");

scsi_id->query_logins_orb->reserved_resp_length =
Expand Down Expand Up @@ -1223,12 +1219,7 @@ static int sbp2_login_device(struct scsi_id_instance_data *scsi_id)
scsi_id->login_orb->lun_misc |= ORB_SET_RECONNECT(0); /* One second reconnect time */
scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(exclusive_login); /* Exclusive access to device */
scsi_id->login_orb->lun_misc |= ORB_SET_NOTIFY(1); /* Notify us of login complete */
/* Set the lun if we were able to pull it from the device's unit directory */
if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {
scsi_id->login_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun);
SBP2_DEBUG("sbp2_query_logins: set lun to %d",
ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun));
}
scsi_id->login_orb->lun_misc |= ORB_SET_LUN(scsi_id->sbp2_lun);
SBP2_DEBUG("sbp2_login_device: lun_misc initialized");

scsi_id->login_orb->passwd_resp_lengths =
Expand Down Expand Up @@ -1543,7 +1534,7 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
SBP2_DEBUG("sbp2_management_agent_addr = %x",
(unsigned int) management_agent_addr);
} else if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) {
scsi_id->sbp2_device_type_and_lun = kv->value.immediate;
scsi_id->sbp2_lun = ORB_SET_LUN(kv->value.immediate);
}
break;

Expand Down Expand Up @@ -1636,7 +1627,7 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
scsi_id->sbp2_firmware_revision = firmware_revision;
scsi_id->workarounds = workarounds;
if (ud->flags & UNIT_DIRECTORY_HAS_LUN)
scsi_id->sbp2_device_type_and_lun = ud->lun;
scsi_id->sbp2_lun = ORB_SET_LUN(ud->lun);
}
}

Expand Down Expand Up @@ -2158,16 +2149,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
switch (SCpnt->cmnd[0]) {

case INQUIRY:

/*
* If scsi_id->sbp2_device_type_and_lun is uninitialized, then fill
* this information in from the inquiry response data. Lun is set to zero.
*/
if (scsi_id->sbp2_device_type_and_lun == SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {
SBP2_DEBUG("Creating sbp2_device_type_and_lun from scsi inquiry data");
scsi_id->sbp2_device_type_and_lun = (scsi_buf[0] & 0x1f) << 16;
}

/*
* Make sure data length is ok. Minimum length is 36 bytes
*/
Expand Down Expand Up @@ -2665,10 +2646,7 @@ static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_att
if (!(scsi_id = (struct scsi_id_instance_data *)sdev->host->hostdata[0]))
return 0;

if (scsi_id->sbp2_device_type_and_lun == SBP2_DEVICE_TYPE_LUN_UNINITIALIZED)
lun = 0;
else
lun = ORB_SET_LUN(scsi_id->sbp2_device_type_and_lun);
lun = ORB_SET_LUN(scsi_id->sbp2_lun);

return sprintf(buf, "%016Lx:%d:%d\n", (unsigned long long)scsi_id->ne->guid,
scsi_id->ud->id, lun);
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/ieee1394/sbp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ struct sbp2_status_block {
#define SBP2_DEVICE_TYPE_AND_LUN_KEY 0x14
#define SBP2_FIRMWARE_REVISION_KEY 0x3c

#define SBP2_DEVICE_TYPE(q) (((q) >> 16) & 0x1f)
#define SBP2_DEVICE_LUN(q) ((q) & 0xffff)

#define SBP2_AGENT_STATE_OFFSET 0x00ULL
#define SBP2_AGENT_RESET_OFFSET 0x04ULL
#define SBP2_ORB_POINTER_OFFSET 0x08ULL
Expand All @@ -256,8 +253,6 @@ struct sbp2_status_block {
*/
#define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800

#define SBP2_DEVICE_TYPE_LUN_UNINITIALIZED 0xffffffff

/*
* SCSI specific stuff
*/
Expand Down Expand Up @@ -379,7 +374,7 @@ struct scsi_id_instance_data {
u32 sbp2_command_set_spec_id;
u32 sbp2_command_set;
u32 sbp2_unit_characteristics;
u32 sbp2_device_type_and_lun;
u32 sbp2_lun;
u32 sbp2_firmware_revision;

/*
Expand Down

0 comments on commit 11361f9

Please sign in to comment.