Skip to contentSkip to conversation

mptfusion: (New Feature)Added new sysfs parameters for handle and firmware id

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

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

PATCH 1/6 mptfusion: (New Feature)Added new sysfs parameters for handle and firmware id

New feature is added. sas_device_hanlde and firmware id will be visible from sysfs parameters. handle and firmware id is internal to LSI firmware. It is merely debugging purpose.

---

drivers/message/fusion/mptbase.h +1 -0
index f71f229..0f3e8fd 100644
@@ -399,6 +399,7 @@ typedef struct _VirtTarget {
 	u8			 inDMD;		/* currently in the device
 						   removal delay timer */
 	u32			 num_luns;
+	u16     		 handle;
 } VirtTarget;
 
 typedef struct _VirtDevice {
drivers/message/fusion/mptsas.c +2 -0
index d48c2c6..482e97f 100644
@@ -1758,6 +1758,7 @@ 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;
 
 			/*
 			 * Exposing hidden raid components
@@ -1983,6 +1984,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 +59 -0

66 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 3 lines · Desai

New feature is added. sas_device_hanlde and firmware id will be visible from sysfs parameters. handle and firmware id is internal to LSI firmware. It is merely debugging purpose.

Broken record time: checkpatch.pl:

WARNING: please, no space before tabs
#21: FILE: drivers/message/fusion/mptbase.h:402:
+^Iu16 ^I^I handle;$

WARNING: please, no spaces at the start of a line #67: FILE: drivers/message/fusion/mptscsih.c:3350:
+ char *buf)$

ERROR: code indent should use tabs where possible #79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no space before tabs
#79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no spaces at the start of a line #79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no spaces at the start of a line #91: FILE: drivers/message/fusion/mptscsih.c:3374:
+ char *buf)$

ERROR: code indent should use tabs where possible #103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

WARNING: please, no space before tabs
#103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

WARNING: please, no spaces at the start of a line #103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

total: 2 errors, 7 warnings, 93 lines checked

Also, as I read through this patch, doesn't it add these two parameters for every fusion device type (SPI, SAS and FC) but only set them for SAS? If you want SAS only parameters, they should probably be visible only for SAS cards.

James

#2 lore raw
Quoted 50 lines

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Sunday, February 13, 2011 1:25 AM
To: Desai, Kashyap
Cc: [email protected]; Moore, Eric; Prakash, Sathya
Subject: Re: [PATCH 01/06] mptfusion: (New Feature)Added new sysfs parameters for handle and firmware id

Quoted 1 line · Desai

New feature is added. sas_device_hanlde and firmware id will be

visible from

Quoted 2 lines

sysfs parameters. handle and firmware id is internal to LSI firmware. It is merely debugging purpose.

Broken record time: checkpatch.pl:

WARNING: please, no space before tabs
#21: FILE: drivers/message/fusion/mptbase.h:402:
+^Iu16 ^I^I handle;$

WARNING: please, no spaces at the start of a line #67: FILE: drivers/message/fusion/mptscsih.c:3350:
+ char *buf)$

ERROR: code indent should use tabs where possible #79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no space before tabs
#79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no spaces at the start of a line #79: FILE: drivers/message/fusion/mptscsih.c:3362:
+ ^I^INULL);$

WARNING: please, no spaces at the start of a line #91: FILE: drivers/message/fusion/mptscsih.c:3374:
+ char *buf)$

ERROR: code indent should use tabs where possible #103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

WARNING: please, no space before tabs
#103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

Quoted 5 lines

WARNING: please, no spaces at the start of a line #103: FILE: drivers/message/fusion/mptscsih.c:3386:
+ ^I^INULL);$

total: 2 errors, 7 warnings, 93 lines checked

James, my script missed this when I resend the patch. I missed to run "cleanpatch" from scripts directory. I will redo this.

Quoted 5 lines

Also, as I read through this patch, doesn't it add these two parameters for every fusion device type (SPI, SAS and FC) but only set them for SAS? If you want SAS only parameters, they should probably be visible only for SAS cards.

I have only used sdev_attrs for mptsas.c as below
.sdev_attrs = mptscsih_dev_attrs
It means all parameters are visible to only MPTSAS modules. Not for mptfc and mptspi. Do you want some changes in this area ?

~ Kashyap

Quoted 3 lines

James