diff options
author | Seokmann Ju <seokmann.ju@qlogic.com> | 2008-01-31 15:33:52 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-02-07 19:02:40 -0500 |
commit | da4541b63bbe9a945d7bbc1105f2deacc42ef195 (patch) | |
tree | 6b99d11f9e5b6379a2bad3fc557cd12ce3aa0121 /drivers/scsi/qla2xxx | |
parent | 99363ef81cc7d0bab275304b8d34cf71d189cdcc (diff) |
[SCSI] qla2xxx: Access the proper 'physical' port in FC-transport callbacks.
For following fc_host specific attributes, vports rely on the pport.
So, this patch changed way to access the data for those attributes so that
they can access pport's.
- get_host_speed (speed)
- get_host_port_state (port_state)
- get_host_port_type (port_type)
- get_fc_host_stats
Also, added PORT_SPEED_8GB case in the speed attribute for 8Gb HBAs.
Signed-Off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 11 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_inline.h | 7 |
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 1dd8591bd5c2..4894dc886b62 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -848,7 +848,7 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost) | |||
848 | static void | 848 | static void |
849 | qla2x00_get_host_speed(struct Scsi_Host *shost) | 849 | qla2x00_get_host_speed(struct Scsi_Host *shost) |
850 | { | 850 | { |
851 | scsi_qla_host_t *ha = shost_priv(shost); | 851 | scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); |
852 | uint32_t speed = 0; | 852 | uint32_t speed = 0; |
853 | 853 | ||
854 | switch (ha->link_data_rate) { | 854 | switch (ha->link_data_rate) { |
@@ -861,6 +861,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) | |||
861 | case PORT_SPEED_4GB: | 861 | case PORT_SPEED_4GB: |
862 | speed = 4; | 862 | speed = 4; |
863 | break; | 863 | break; |
864 | case PORT_SPEED_8GB: | ||
865 | speed = 8; | ||
866 | break; | ||
864 | } | 867 | } |
865 | fc_host_speed(shost) = speed; | 868 | fc_host_speed(shost) = speed; |
866 | } | 869 | } |
@@ -868,7 +871,7 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) | |||
868 | static void | 871 | static void |
869 | qla2x00_get_host_port_type(struct Scsi_Host *shost) | 872 | qla2x00_get_host_port_type(struct Scsi_Host *shost) |
870 | { | 873 | { |
871 | scsi_qla_host_t *ha = shost_priv(shost); | 874 | scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); |
872 | uint32_t port_type = FC_PORTTYPE_UNKNOWN; | 875 | uint32_t port_type = FC_PORTTYPE_UNKNOWN; |
873 | 876 | ||
874 | switch (ha->current_topology) { | 877 | switch (ha->current_topology) { |
@@ -978,7 +981,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost) | |||
978 | static struct fc_host_statistics * | 981 | static struct fc_host_statistics * |
979 | qla2x00_get_fc_host_stats(struct Scsi_Host *shost) | 982 | qla2x00_get_fc_host_stats(struct Scsi_Host *shost) |
980 | { | 983 | { |
981 | scsi_qla_host_t *ha = shost_priv(shost); | 984 | scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); |
982 | int rval; | 985 | int rval; |
983 | struct link_statistics *stats; | 986 | struct link_statistics *stats; |
984 | dma_addr_t stats_dma; | 987 | dma_addr_t stats_dma; |
@@ -1062,7 +1065,7 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost) | |||
1062 | static void | 1065 | static void |
1063 | qla2x00_get_host_port_state(struct Scsi_Host *shost) | 1066 | qla2x00_get_host_port_state(struct Scsi_Host *shost) |
1064 | { | 1067 | { |
1065 | scsi_qla_host_t *ha = shost_priv(shost); | 1068 | scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); |
1066 | 1069 | ||
1067 | if (!ha->flags.online) | 1070 | if (!ha->flags.online) |
1068 | fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE; | 1071 | fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE; |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index b72c7f170854..3750319f4968 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2041,8 +2041,6 @@ typedef struct vport_params { | |||
2041 | #define VP_RET_CODE_NO_MEM 5 | 2041 | #define VP_RET_CODE_NO_MEM 5 |
2042 | #define VP_RET_CODE_NOT_FOUND 6 | 2042 | #define VP_RET_CODE_NOT_FOUND 6 |
2043 | 2043 | ||
2044 | #define to_qla_parent(x) (((x)->parent) ? (x)->parent : (x)) | ||
2045 | |||
2046 | /* | 2044 | /* |
2047 | * ISP operations | 2045 | * ISP operations |
2048 | */ | 2046 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 8e3b04464cff..5d1a3f7c408f 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h | |||
@@ -119,6 +119,13 @@ static __inline__ void qla2x00_check_fabric_devices(scsi_qla_host_t *ha) | |||
119 | qla2x00_get_firmware_state(ha, &fw_state); | 119 | qla2x00_get_firmware_state(ha, &fw_state); |
120 | } | 120 | } |
121 | 121 | ||
122 | static __inline__ scsi_qla_host_t * to_qla_parent(scsi_qla_host_t *); | ||
123 | static __inline__ scsi_qla_host_t * | ||
124 | to_qla_parent(scsi_qla_host_t *ha) | ||
125 | { | ||
126 | return ha->parent ? ha->parent : ha; | ||
127 | } | ||
128 | |||
122 | /** | 129 | /** |
123 | * qla2x00_issue_marker() - Issue a Marker IOCB if necessary. | 130 | * qla2x00_issue_marker() - Issue a Marker IOCB if necessary. |
124 | * @ha: HA context | 131 | * @ha: HA context |