aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
author <andrew.vasquez@qlogic.com>2005-04-17 16:04:54 -0400
committerJames Bottomley <jejb@titanic>2005-04-18 14:47:19 -0400
commit8482e118afa0cb4321ab3d30b1100d27d63130c0 (patch)
tree971714d297194e1c20e1b80b1d2e031d4517f5ad /drivers/scsi/qla2xxx/qla_init.c
parentf4f051ebb40e74ad0ba02d2cb3a6c16b0393472b (diff)
[PATCH] qla2xxx: add remote port codes...
Add initial support for FC remote port infrastructure. o Use fc_remote_port...() registration and block/unlock functions. o Consolidate 'attribute' (fc-remote/sysfs) helpers into new qla_attr.c file. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 00bfbd42bdb6..29b301ecd2ff 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -19,6 +19,7 @@
19#include "qla_def.h" 19#include "qla_def.h"
20 20
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <scsi/scsi_transport_fc.h>
22 23
23#include "qla_devtbl.h" 24#include "qla_devtbl.h"
24 25
@@ -1927,8 +1928,35 @@ qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
1927 qla2x00_lun_discovery(ha, fcport); 1928 qla2x00_lun_discovery(ha, fcport);
1928 } 1929 }
1929 atomic_set(&fcport->state, FCS_ONLINE); 1930 atomic_set(&fcport->state, FCS_ONLINE);
1931 if (ha->flags.init_done)
1932 qla2x00_reg_remote_port(ha, fcport);
1930} 1933}
1931 1934
1935void
1936qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
1937{
1938 struct fc_rport_identifiers rport_ids;
1939
1940 if (fcport->rport) {
1941 fc_remote_port_unblock(fcport->rport);
1942 return;
1943 }
1944
1945 rport_ids.node_name = be64_to_cpu(*(uint64_t *)fcport->node_name);
1946 rport_ids.port_name = be64_to_cpu(*(uint64_t *)fcport->port_name);
1947 rport_ids.port_id = fcport->d_id.b.domain << 16 |
1948 fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
1949 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
1950 if (fcport->port_type == FCT_INITIATOR)
1951 rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR;
1952 if (fcport->port_type == FCT_TARGET)
1953 rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET;
1954
1955 fcport->rport = fc_remote_port_add(ha->host, 0, &rport_ids);
1956 if (!fcport->rport)
1957 qla_printk(KERN_WARNING, ha,
1958 "Unable to allocate fc remote port!\n");
1959}
1932/* 1960/*
1933 * qla2x00_lun_discovery 1961 * qla2x00_lun_discovery
1934 * Issue SCSI inquiry command for LUN discovery. 1962 * Issue SCSI inquiry command for LUN discovery.
@@ -2895,8 +2923,7 @@ qla2x00_device_resync(scsi_qla_host_t *ha)
2895 if (atomic_read(&fcport->state) == FCS_ONLINE) { 2923 if (atomic_read(&fcport->state) == FCS_ONLINE) {
2896 if (format != 3 || 2924 if (format != 3 ||
2897 fcport->port_type != FCT_INITIATOR) { 2925 fcport->port_type != FCT_INITIATOR) {
2898 atomic_set(&fcport->state, 2926 qla2x00_mark_device_lost(ha, fcport, 0);
2899 FCS_DEVICE_LOST);
2900 } 2927 }
2901 } 2928 }
2902 fcport->flags &= ~FCF_FARP_DONE; 2929 fcport->flags &= ~FCF_FARP_DONE;