diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 46e032aa0bea..d73e677201f8 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -2277,6 +2277,36 @@ lpfc_param_init(topology, 0, 0, 6) | |||
2277 | static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, | 2277 | static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR, |
2278 | lpfc_topology_show, lpfc_topology_store); | 2278 | lpfc_topology_show, lpfc_topology_store); |
2279 | 2279 | ||
2280 | /** | ||
2281 | * lpfc_static_vport_show: Read callback function for | ||
2282 | * lpfc_static_vport sysfs file. | ||
2283 | * @dev: Pointer to class device object. | ||
2284 | * @attr: device attribute structure. | ||
2285 | * @buf: Data buffer. | ||
2286 | * | ||
2287 | * This function is the read call back function for | ||
2288 | * lpfc_static_vport sysfs file. The lpfc_static_vport | ||
2289 | * sysfs file report the mageability of the vport. | ||
2290 | **/ | ||
2291 | static ssize_t | ||
2292 | lpfc_static_vport_show(struct device *dev, struct device_attribute *attr, | ||
2293 | char *buf) | ||
2294 | { | ||
2295 | struct Scsi_Host *shost = class_to_shost(dev); | ||
2296 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | ||
2297 | if (vport->vport_flag & STATIC_VPORT) | ||
2298 | sprintf(buf, "1\n"); | ||
2299 | else | ||
2300 | sprintf(buf, "0\n"); | ||
2301 | |||
2302 | return strlen(buf); | ||
2303 | } | ||
2304 | |||
2305 | /* | ||
2306 | * Sysfs attribute to control the statistical data collection. | ||
2307 | */ | ||
2308 | static DEVICE_ATTR(lpfc_static_vport, S_IRUGO, | ||
2309 | lpfc_static_vport_show, NULL); | ||
2280 | 2310 | ||
2281 | /** | 2311 | /** |
2282 | * lpfc_stat_data_ctrl_store - write call back for lpfc_stat_data_ctrl sysfs file | 2312 | * lpfc_stat_data_ctrl_store - write call back for lpfc_stat_data_ctrl sysfs file |
@@ -3051,6 +3081,7 @@ struct device_attribute *lpfc_vport_attrs[] = { | |||
3051 | &dev_attr_lpfc_enable_da_id, | 3081 | &dev_attr_lpfc_enable_da_id, |
3052 | &dev_attr_lpfc_max_scsicmpl_time, | 3082 | &dev_attr_lpfc_max_scsicmpl_time, |
3053 | &dev_attr_lpfc_stat_data_ctrl, | 3083 | &dev_attr_lpfc_stat_data_ctrl, |
3084 | &dev_attr_lpfc_static_vport, | ||
3054 | NULL, | 3085 | NULL, |
3055 | }; | 3086 | }; |
3056 | 3087 | ||