aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2012-01-19 06:06:55 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:08:54 -0500
commitaeddde2978f8931740032880134039fb937bb07c (patch)
tree8df6317dcd09ba6d13f24fe67c25ab9bcecf7dac /include/scsi
parent6c1b8789b0dd0ceeb04229f059dde08d84f28221 (diff)
[SCSI] scsi_transport_iscsi: Added support to show port_state and port_speed in sysfs
sysfs patch to view port_state: /sys/class/iscsi_host/host*/port_state sysfs patch to view port_speed: /sys/class/iscsi_host/host*/port_speed Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h17
-rw-r--r--include/scsi/scsi_transport_iscsi.h4
2 files changed, 21 insertions, 0 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 2703e3bedbf5..e49b7c8dd217 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -416,9 +416,26 @@ enum iscsi_host_param {
416 ISCSI_HOST_PARAM_INITIATOR_NAME, 416 ISCSI_HOST_PARAM_INITIATOR_NAME,
417 ISCSI_HOST_PARAM_NETDEV_NAME, 417 ISCSI_HOST_PARAM_NETDEV_NAME,
418 ISCSI_HOST_PARAM_IPADDRESS, 418 ISCSI_HOST_PARAM_IPADDRESS,
419 ISCSI_HOST_PARAM_PORT_STATE,
420 ISCSI_HOST_PARAM_PORT_SPEED,
419 ISCSI_HOST_PARAM_MAX, 421 ISCSI_HOST_PARAM_MAX,
420}; 422};
421 423
424/* iSCSI port Speed */
425enum iscsi_port_speed {
426 ISCSI_PORT_SPEED_UNKNOWN = 0x1,
427 ISCSI_PORT_SPEED_10MBPS = 0x2,
428 ISCSI_PORT_SPEED_100MBPS = 0x4,
429 ISCSI_PORT_SPEED_1GBPS = 0x8,
430 ISCSI_PORT_SPEED_10GBPS = 0x10,
431};
432
433/* iSCSI port state */
434enum iscsi_port_state {
435 ISCSI_PORT_STATE_DOWN = 0x1,
436 ISCSI_PORT_STATE_UP = 0x2,
437};
438
422#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 439#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
423#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 440#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
424 441
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 2c3a46d102fd..fa7ca4e16020 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -238,6 +238,8 @@ struct iscsi_cls_host {
238 atomic_t nr_scans; 238 atomic_t nr_scans;
239 struct mutex mutex; 239 struct mutex mutex;
240 struct request_queue *bsg_q; 240 struct request_queue *bsg_q;
241 uint32_t port_speed;
242 uint32_t port_state;
241}; 243};
242 244
243#define iscsi_job_to_shost(_job) \ 245#define iscsi_job_to_shost(_job) \
@@ -307,5 +309,7 @@ extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost,
307 uint32_t iface_num, int dd_size); 309 uint32_t iface_num, int dd_size);
308extern void iscsi_destroy_iface(struct iscsi_iface *iface); 310extern void iscsi_destroy_iface(struct iscsi_iface *iface);
309extern struct iscsi_iface *iscsi_lookup_iface(int handle); 311extern struct iscsi_iface *iscsi_lookup_iface(int handle);
312extern char *iscsi_get_port_speed_name(struct Scsi_Host *shost);
313extern char *iscsi_get_port_state_name(struct Scsi_Host *shost);
310 314
311#endif 315#endif