diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ce7e712ebe8d..290a6b92616c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1668,6 +1668,24 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) | |||
1668 | return (rval); | 1668 | return (rval); |
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | static void | ||
1672 | qla2x00_rport_add(void *data) | ||
1673 | { | ||
1674 | fc_port_t *fcport = data; | ||
1675 | |||
1676 | qla2x00_reg_remote_port(fcport->ha, fcport); | ||
1677 | } | ||
1678 | |||
1679 | static void | ||
1680 | qla2x00_rport_del(void *data) | ||
1681 | { | ||
1682 | fc_port_t *fcport = data; | ||
1683 | |||
1684 | if (fcport->rport) | ||
1685 | fc_remote_port_delete(fcport->rport); | ||
1686 | fcport->rport = NULL; | ||
1687 | } | ||
1688 | |||
1671 | /** | 1689 | /** |
1672 | * qla2x00_alloc_fcport() - Allocate a generic fcport. | 1690 | * qla2x00_alloc_fcport() - Allocate a generic fcport. |
1673 | * @ha: HA context | 1691 | * @ha: HA context |
@@ -1693,6 +1711,8 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags) | |||
1693 | atomic_set(&fcport->state, FCS_UNCONFIGURED); | 1711 | atomic_set(&fcport->state, FCS_UNCONFIGURED); |
1694 | fcport->flags = FCF_RLC_SUPPORT; | 1712 | fcport->flags = FCF_RLC_SUPPORT; |
1695 | fcport->supported_classes = FC_COS_UNSPECIFIED; | 1713 | fcport->supported_classes = FC_COS_UNSPECIFIED; |
1714 | INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport); | ||
1715 | INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport); | ||
1696 | 1716 | ||
1697 | return (fcport); | 1717 | return (fcport); |
1698 | } | 1718 | } |
@@ -2056,8 +2076,8 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2056 | struct fc_rport *rport; | 2076 | struct fc_rport *rport; |
2057 | 2077 | ||
2058 | if (fcport->rport) { | 2078 | if (fcport->rport) { |
2059 | fc_remote_port_unblock(fcport->rport); | 2079 | fc_remote_port_delete(fcport->rport); |
2060 | return; | 2080 | fcport->rport = NULL; |
2061 | } | 2081 | } |
2062 | 2082 | ||
2063 | rport_ids.node_name = wwn_to_u64(fcport->node_name); | 2083 | rport_ids.node_name = wwn_to_u64(fcport->node_name); |
@@ -2071,7 +2091,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2071 | "Unable to allocate fc remote port!\n"); | 2091 | "Unable to allocate fc remote port!\n"); |
2072 | return; | 2092 | return; |
2073 | } | 2093 | } |
2074 | rport->dd_data = fcport; | 2094 | *((fc_port_t **)rport->dd_data) = fcport; |
2075 | rport->supported_classes = fcport->supported_classes; | 2095 | rport->supported_classes = fcport->supported_classes; |
2076 | 2096 | ||
2077 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; | 2097 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; |