Skip to contentSkip to conversation

mptfusion: Added new sysfs parameters for handle, sas_addr and handles

PATCH In review Kashyap, Desai 2 participants 3 messages Feb 3, 2011 – Feb 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 mptfusion: Added new sysfs parameters for handle, sas_addr and handles

New feature is added. sas_address, sad_device_hanlde and firmware id will be visible from sysfs parameters.

---

drivers/message/fusion/mptbase.h +2 -0
index f71f229..f9532fa 100644
@@ -399,6 +399,8 @@ typedef struct _VirtTarget {
 	u8			 inDMD;		/* currently in the device
 						   removal delay timer */
 	u32			 num_luns;
+	u64     		 sas_address;
+	u16     		 handle;
 } VirtTarget;
 
 typedef struct _VirtDevice {
drivers/message/fusion/mptsas.c +4 -0
index d48c2c6..7daf098 100644
@@ -1758,6 +1758,9 @@ mptsas_target_alloc(struct scsi_target *starget)
 			id = p->phy_info[i].attached.id;
 			channel = p->phy_info[i].attached.channel;
 			mptsas_set_starget(&p->phy_info[i], starget);
+			vtarget->handle = p->phy_info[i].attached.handle;
+			vtarget->sas_address =  p->phy_info[i].
+						attached.sas_address;
 
 			/*
 			 * Exposing hidden raid components
@@ -1983,6 +1986,7 @@ static struct scsi_host_template mptsas_driver_template = {
 	.cmd_per_lun			= 7,
 	.use_clustering			= ENABLE_CLUSTERING,
 	.shost_attrs			= mptscsih_host_attrs,
+	.sdev_attrs			= mptscsih_dev_attrs,
 };
 
 static int mptsas_get_linkerrors(struct sas_phy *phy)
drivers/message/fusion/mptscsih.c +84 -0

91 lines not on this page · raw message

drivers/message/fusion/mptscsih.h +1 -0
index 45a5ff3..d9839ca 100644
@@ -133,5 +133,6 @@ extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth,
 extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
 extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
 extern struct device_attribute *mptscsih_host_attrs[];
+extern struct device_attribute *mptscsih_dev_attrs[];
 extern struct scsi_cmnd	*mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i);
 extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code);
maintainer
#1 lore raw
Quoted 2 lines · Desai

New feature is added. sas_address, sad_device_hanlde and firmware id will be visible from sysfs parameters.

Well, sas_address, no ... it's already part of the phy properties of the sas transport class.

Why handle and firmware_id ... they're fairly irrelevant properties of the internal firmware ... so what's the point in exposing them externally?

James

#2 lore raw
Quoted 10 lines

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Thursday, February 03, 2011 11:04 PM
To: Desai, Kashyap
Cc: [email protected]; Moore, Eric; Prakash, Sathya
Subject: Re: [PATCH 01/06] mptfusion: Added new sysfs parameters for handle, sas_addr and handles

Quoted 8 lines
Quoted 1 line · Desai

New feature is added. sas_address, sad_device_hanlde and firmware id

will be visible from

Quoted 1 line

sysfs parameters.

Well, sas_address, no ... it's already part of the phy properties of the
sas transport class.

James,
I agree on this point.

Quoted 4 lines

Why handle and firmware_id ... they're fairly irrelevant properties of the internal firmware ... so what's the point in exposing them externally?

This is mainly for debugging in case if device is not mapped to correct handle and fw_id (which are completely LSI firmware's internal). This was raised by few customers who really wanted to watch handles and fw_id of LSI firmware through sysfs.

~ Kashyap

Quoted 3 lines

James