blob: da3db3abb82c7fef4c1e728818279f823f4056e0 [file] [log] [blame]
Seokmann Ju2c3dfe32007-07-05 13:16:51 -07001/*
Andrew Vasquez01e58d82008-04-03 13:13:13 -07002 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2008 QLogic Corporation
Seokmann Ju2c3dfe32007-07-05 13:16:51 -07004 *
Andrew Vasquez01e58d82008-04-03 13:13:13 -07005 * See LICENSE.qla2xxx for copyright and licensing details.
Seokmann Ju2c3dfe32007-07-05 13:16:51 -07006 */
7#include "qla_def.h"
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -08008#include "qla_gbl.h"
Seokmann Ju2c3dfe32007-07-05 13:16:51 -07009
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070010#include <linux/moduleparam.h>
11#include <linux/vmalloc.h>
12#include <linux/smp_lock.h>
13#include <linux/list.h>
14
15#include <scsi/scsi_tcq.h>
16#include <scsi/scsicam.h>
17#include <linux/delay.h>
18
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070019void
20qla2x00_vp_stop_timer(scsi_qla_host_t *vha)
21{
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080022 if (vha->vp_idx && vha->timer_active) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070023 del_timer_sync(&vha->timer);
24 vha->timer_active = 0;
25 }
26}
27
Adrian Bunka824ebb2008-01-17 09:02:15 -080028static uint32_t
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070029qla24xx_allocate_vp_id(scsi_qla_host_t *vha)
30{
31 uint32_t vp_id;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080032 struct qla_hw_data *ha = vha->hw;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070033
34 /* Find an empty slot and assign an vp_id */
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -070035 mutex_lock(&ha->vport_lock);
Andrew Vasquezeb66dc62007-11-12 10:30:58 -080036 vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1);
37 if (vp_id > ha->max_npiv_vports) {
38 DEBUG15(printk ("vp_id %d is bigger than max-supported %d.\n",
39 vp_id, ha->max_npiv_vports));
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -070040 mutex_unlock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070041 return vp_id;
42 }
43
Andrew Vasquezeb66dc62007-11-12 10:30:58 -080044 set_bit(vp_id, ha->vp_idx_map);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070045 ha->num_vhosts++;
Seokmann Ju711c1d92008-07-10 16:55:51 -070046 ha->cur_vport_count++;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070047 vha->vp_idx = vp_id;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080048 list_add_tail(&vha->list, &ha->vp_list);
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -070049 mutex_unlock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070050 return vp_id;
51}
52
53void
54qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
55{
56 uint16_t vp_id;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080057 struct qla_hw_data *ha = vha->hw;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070058
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -070059 mutex_lock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070060 vp_id = vha->vp_idx;
61 ha->num_vhosts--;
Seokmann Ju711c1d92008-07-10 16:55:51 -070062 ha->cur_vport_count--;
Andrew Vasquezeb66dc62007-11-12 10:30:58 -080063 clear_bit(vp_id, ha->vp_idx_map);
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080064 list_del(&vha->list);
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -070065 mutex_unlock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070066}
67
Adrian Bunka824ebb2008-01-17 09:02:15 -080068static scsi_qla_host_t *
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080069qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070070{
71 scsi_qla_host_t *vha;
72
73 /* Locate matching device in database. */
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080074 list_for_each_entry(vha, &ha->vp_list, list) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070075 if (!memcmp(port_name, vha->port_name, WWN_SIZE))
76 return vha;
77 }
78 return NULL;
79}
80
81/*
82 * qla2x00_mark_vp_devices_dead
83 * Updates fcport state when device goes offline.
84 *
85 * Input:
86 * ha = adapter block pointer.
87 * fcport = port structure pointer.
88 *
89 * Return:
90 * None.
91 *
92 * Context:
93 */
Andrew Vasquez26ff7762007-09-20 14:07:47 -070094static void
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070095qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha)
96{
97 fc_port_t *fcport;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -070098
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -080099 list_for_each_entry(fcport, &vha->vp_fcports, list) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700100 DEBUG15(printk("scsi(%ld): Marking port dead, "
101 "loop_id=0x%04x :%x\n",
102 vha->host_no, fcport->loop_id, fcport->vp_idx));
103
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700104 qla2x00_mark_device_lost(vha, fcport, 0, 0);
Andrew Vasquezc9c5ced2008-07-24 08:31:49 -0700105 atomic_set(&fcport->state, FCS_UNCONFIGURED);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700106 }
107}
108
109int
110qla24xx_disable_vp(scsi_qla_host_t *vha)
111{
112 int ret;
113
114 ret = qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL);
115 atomic_set(&vha->loop_state, LOOP_DOWN);
116 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
117
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700118 qla2x00_mark_vp_devices_dead(vha);
119 atomic_set(&vha->vp_state, VP_FAILED);
120 vha->flags.management_server_logged_in = 0;
121 if (ret == QLA_SUCCESS) {
122 fc_vport_set_state(vha->fc_vport, FC_VPORT_DISABLED);
123 } else {
124 fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
125 return -1;
126 }
127 return 0;
128}
129
130int
131qla24xx_enable_vp(scsi_qla_host_t *vha)
132{
133 int ret;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800134 struct qla_hw_data *ha = vha->hw;
135 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700136
137 /* Check if physical ha port is Up */
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800138 if (atomic_read(&base_vha->loop_state) == LOOP_DOWN ||
139 atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700140 vha->vp_err_state = VP_ERR_PORTDWN;
141 fc_vport_set_state(vha->fc_vport, FC_VPORT_LINKDOWN);
142 goto enable_failed;
143 }
144
145 /* Initialize the new vport unless it is a persistent port */
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -0700146 mutex_lock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700147 ret = qla24xx_modify_vp_config(vha);
matthias@kaehlcke.net6c2f5272008-05-12 22:21:11 -0700148 mutex_unlock(&ha->vport_lock);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700149
150 if (ret != QLA_SUCCESS) {
151 fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED);
152 goto enable_failed;
153 }
154
155 DEBUG15(qla_printk(KERN_INFO, ha,
156 "Virtual port with id: %d - Enabled\n", vha->vp_idx));
157 return 0;
158
159enable_failed:
160 DEBUG15(qla_printk(KERN_INFO, ha,
161 "Virtual port with id: %d - Disabled\n", vha->vp_idx));
162 return 1;
163}
164
Andrew Vasquez26ff7762007-09-20 14:07:47 -0700165static void
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700166qla24xx_configure_vp(scsi_qla_host_t *vha)
167{
168 struct fc_vport *fc_vport;
169 int ret;
170
171 fc_vport = vha->fc_vport;
172
173 DEBUG15(printk("scsi(%ld): %s: change request #3 for this host.\n",
174 vha->host_no, __func__));
175 ret = qla2x00_send_change_request(vha, 0x3, vha->vp_idx);
176 if (ret != QLA_SUCCESS) {
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800177 DEBUG15(qla_printk(KERN_ERR, vha->hw, "Failed to enable "
178 "receiving of RSCN requests: 0x%x\n", ret));
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700179 return;
180 } else {
181 /* Corresponds to SCR enabled */
182 clear_bit(VP_SCR_NEEDED, &vha->vp_flags);
183 }
184
185 vha->flags.online = 1;
186 if (qla24xx_configure_vhba(vha))
187 return;
188
189 atomic_set(&vha->vp_state, VP_ACTIVE);
190 fc_vport_set_state(fc_vport, FC_VPORT_ACTIVE);
191}
192
193void
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800194qla2x00_alert_all_vps(struct qla_hw_data *ha, uint16_t *mb)
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700195{
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700196 scsi_qla_host_t *vha;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800197 int i = 0;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700198
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800199 list_for_each_entry(vha, &ha->vp_list, list) {
200 if (vha->vp_idx) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700201 switch (mb[0]) {
202 case MBA_LIP_OCCURRED:
203 case MBA_LOOP_UP:
204 case MBA_LOOP_DOWN:
205 case MBA_LIP_RESET:
206 case MBA_POINT_TO_POINT:
207 case MBA_CHG_IN_CONNECTION:
208 case MBA_PORT_UPDATE:
209 case MBA_RSCN_UPDATE:
210 DEBUG15(printk("scsi(%ld)%s: Async_event for"
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800211 " VP[%d], mb = 0x%x, vha=%p\n",
212 vha->host_no, __func__, i, *mb, vha));
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700213 qla2x00_async_event(vha, mb);
214 break;
215 }
216 }
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800217 i++;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700218 }
219}
220
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800221int
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700222qla2x00_vp_abort_isp(scsi_qla_host_t *vha)
223{
224 /*
225 * Physical port will do most of the abort and recovery work. We can
226 * just treat it as a loop down
227 */
228 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
229 atomic_set(&vha->loop_state, LOOP_DOWN);
230 qla2x00_mark_all_devices_lost(vha, 0);
231 } else {
232 if (!atomic_read(&vha->loop_down_timer))
233 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
234 }
235
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800236 /* To exclusively reset vport, we need to log it out first.*/
237 if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
238 qla24xx_control_vp(vha, VCE_COMMAND_DISABLE_VPS_LOGO_ALL);
239
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700240 DEBUG15(printk("scsi(%ld): Scheduling enable of Vport %d...\n",
241 vha->host_no, vha->vp_idx));
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800242 return qla24xx_enable_vp(vha);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700243}
244
Adrian Bunka824ebb2008-01-17 09:02:15 -0800245static int
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700246qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
247{
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800248 struct qla_hw_data *ha = vha->hw;
249 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
Seokmann Ju221726d2008-04-03 13:13:31 -0700250
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700251 if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) {
252 /* VP acquired. complete port configuration */
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800253 if (atomic_read(&base_vha->loop_state) == LOOP_READY) {
Seokmann Ju221726d2008-04-03 13:13:31 -0700254 qla24xx_configure_vp(vha);
255 } else {
256 set_bit(VP_IDX_ACQUIRED, &vha->vp_flags);
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800257 set_bit(VP_DPC_NEEDED, &base_vha->dpc_flags);
Seokmann Ju221726d2008-04-03 13:13:31 -0700258 }
259
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700260 return 0;
261 }
262
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800263 if (test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) {
264 qla2x00_update_fcports(vha);
265 clear_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags);
266 }
267
268 if ((test_and_clear_bit(RELOGIN_NEEDED, &vha->dpc_flags)) &&
269 !test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags) &&
270 atomic_read(&vha->loop_state) != LOOP_DOWN) {
271
272 DEBUG(printk("scsi(%ld): qla2x00_port_login()\n",
273 vha->host_no));
274 qla2x00_relogin(vha);
275
276 DEBUG(printk("scsi(%ld): qla2x00_port_login - end\n",
277 vha->host_no));
278 }
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700279
280 if (test_and_clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags) &&
281 (!(test_and_set_bit(RESET_ACTIVE, &vha->dpc_flags)))) {
282 clear_bit(RESET_ACTIVE, &vha->dpc_flags);
283 }
284
Seokmann Ju5de1f702008-07-10 16:55:58 -0700285 if (atomic_read(&vha->vp_state) == VP_ACTIVE &&
286 test_and_clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700287 if (!(test_and_set_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))) {
288 qla2x00_loop_resync(vha);
289 clear_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags);
290 }
291 }
292
293 return 0;
294}
295
296void
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800297qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700298{
299 int ret;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800300 struct qla_hw_data *ha = vha->hw;
301 scsi_qla_host_t *vp;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700302
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800303 if (vha->vp_idx)
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700304 return;
305 if (list_empty(&ha->vp_list))
306 return;
307
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800308 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700309
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800310 list_for_each_entry(vp, &ha->vp_list, list) {
311 if (vp->vp_idx)
312 ret = qla2x00_do_dpc_vp(vp);
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700313 }
314}
315
316int
317qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
318{
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800319 scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost);
320 struct qla_hw_data *ha = base_vha->hw;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700321 scsi_qla_host_t *vha;
322 uint8_t port_name[WWN_SIZE];
323
324 if (fc_vport->roles != FC_PORT_ROLE_FCP_INITIATOR)
325 return VPCERR_UNSUPPORTED;
326
327 /* Check up the F/W and H/W support NPIV */
328 if (!ha->flags.npiv_supported)
329 return VPCERR_UNSUPPORTED;
330
331 /* Check up whether npiv supported switch presented */
332 if (!(ha->switch_cap & FLOGI_MID_SUPPORT))
333 return VPCERR_NO_FABRIC_SUPP;
334
335 /* Check up unique WWPN */
336 u64_to_wwn(fc_vport->port_name, port_name);
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800337 if (!memcmp(port_name, base_vha->port_name, WWN_SIZE))
Seokmann Ju50db6b12008-01-17 09:02:14 -0800338 return VPCERR_BAD_WWN;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700339 vha = qla24xx_find_vhost_by_name(ha, port_name);
340 if (vha)
341 return VPCERR_BAD_WWN;
342
343 /* Check up max-npiv-supports */
344 if (ha->num_vhosts > ha->max_npiv_vports) {
Andrew Vasquezeb66dc62007-11-12 10:30:58 -0800345 DEBUG15(printk("scsi(%ld): num_vhosts %ud is bigger than "
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800346 "max_npv_vports %ud.\n", base_vha->host_no,
Andrew Vasquezeb66dc62007-11-12 10:30:58 -0800347 ha->num_vhosts, ha->max_npiv_vports));
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700348 return VPCERR_UNSUPPORTED;
349 }
350 return 0;
351}
352
353scsi_qla_host_t *
354qla24xx_create_vhost(struct fc_vport *fc_vport)
355{
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800356 scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost);
357 struct qla_hw_data *ha = base_vha->hw;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700358 scsi_qla_host_t *vha;
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800359 struct scsi_host_template *sht = &qla24xx_driver_template;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700360 struct Scsi_Host *host;
361
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800362 vha = qla2x00_create_host(sht, ha);
363 if (!vha) {
364 DEBUG(printk("qla2xxx: scsi_host_alloc() failed for vport\n"));
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700365 return(NULL);
366 }
367
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800368 host = vha->host;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700369 fc_vport->dd_data = vha;
370
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700371 /* New host info */
372 u64_to_wwn(fc_vport->node_name, vha->node_name);
373 u64_to_wwn(fc_vport->port_name, vha->port_name);
374
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700375 vha->fc_vport = fc_vport;
376 vha->device_flags = 0;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700377 vha->vp_idx = qla24xx_allocate_vp_id(vha);
378 if (vha->vp_idx > ha->max_npiv_vports) {
379 DEBUG15(printk("scsi(%ld): Couldn't allocate vp_id.\n",
380 vha->host_no));
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800381 goto create_vhost_failed;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700382 }
383 vha->mgmt_svr_loop_id = 10 + vha->vp_idx;
384
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700385 vha->dpc_flags = 0L;
386 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags);
387 set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags);
388
389 /*
390 * To fix the issue of processing a parent's RSCN for the vport before
391 * its SCR is complete.
392 */
393 set_bit(VP_SCR_NEEDED, &vha->vp_flags);
394 atomic_set(&vha->loop_state, LOOP_DOWN);
395 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
396
397 qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL);
398
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800399 host->can_queue = ha->req->length + 128;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700400 host->this_id = 255;
401 host->cmd_per_lun = 3;
402 host->max_cmd_len = MAX_CMDSZ;
403 host->max_channel = MAX_BUSES - 1;
404 host->max_lun = MAX_LUNS;
Seokmann Ju711c1d92008-07-10 16:55:51 -0700405 host->unique_id = host->host_no;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700406 host->max_id = MAX_TARGETS_2200;
407 host->transportt = qla2xxx_transport_vport_template;
408
409 DEBUG15(printk("DEBUG: detect vport hba %ld at address = %p\n",
410 vha->host_no, vha));
411
412 vha->flags.init_done = 1;
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700413
414 return vha;
415
Anirban Chakraborty7b867cf2008-11-06 10:40:19 -0800416create_vhost_failed:
Seokmann Ju2c3dfe32007-07-05 13:16:51 -0700417 return NULL;
418}