diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2011-07-26 17:51:39 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-27 07:37:31 -0400 |
commit | aea71a024914e8b5b8bed31256dae42195a0a207 (patch) | |
tree | d3d155d7323966a56425ad68837b924816719c89 /drivers/scsi/bnx2fc/bnx2fc_hwi.c | |
parent | f6e76055ba778c56716ba79e106db28297775e87 (diff) |
[SCSI] bnx2fc: Introduce interface structure for each vlan interface
Currently, bnx2fc has a hba structure that can work with only a single vlan
interface. When there is a change in vlan id, it does not have the capability
to switch to different vlan interface. To solve this problem, a new structure
called 'interface' has been introduced, and each hba can now have multiple
interfaces, one per vlan id.
Most of the patch is a moving the interface specific fields from hba to the
interface structure, and appropriately modifying the dereferences. A list of
interfaces (if_list) is maintained along with adapter list. During a create
call, the interface structure is allocated and added to if_list and deleted &
freed on a destroy call. Link events are propagated to all interfaces
belonging to the hba.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_hwi.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_hwi.c | 98 |
1 files changed, 55 insertions, 43 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index b41deb64aff1..ee1674b794b1 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c | |||
@@ -23,7 +23,7 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba, | |||
23 | struct fcoe_kcqe *ofld_kcqe); | 23 | struct fcoe_kcqe *ofld_kcqe); |
24 | static void bnx2fc_init_failure(struct bnx2fc_hba *hba, u32 err_code); | 24 | static void bnx2fc_init_failure(struct bnx2fc_hba *hba, u32 err_code); |
25 | static void bnx2fc_process_conn_destroy_cmpl(struct bnx2fc_hba *hba, | 25 | static void bnx2fc_process_conn_destroy_cmpl(struct bnx2fc_hba *hba, |
26 | struct fcoe_kcqe *conn_destroy); | 26 | struct fcoe_kcqe *destroy_kcqe); |
27 | 27 | ||
28 | int bnx2fc_send_stat_req(struct bnx2fc_hba *hba) | 28 | int bnx2fc_send_stat_req(struct bnx2fc_hba *hba) |
29 | { | 29 | { |
@@ -67,7 +67,7 @@ int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba) | |||
67 | int rc = 0; | 67 | int rc = 0; |
68 | 68 | ||
69 | if (!hba->cnic) { | 69 | if (!hba->cnic) { |
70 | printk(KERN_ALERT PFX "hba->cnic NULL during fcoe fw init\n"); | 70 | printk(KERN_ERR PFX "hba->cnic NULL during fcoe fw init\n"); |
71 | return -ENODEV; | 71 | return -ENODEV; |
72 | } | 72 | } |
73 | 73 | ||
@@ -103,6 +103,7 @@ int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba) | |||
103 | fcoe_init2.hsi_major_version = FCOE_HSI_MAJOR_VERSION; | 103 | fcoe_init2.hsi_major_version = FCOE_HSI_MAJOR_VERSION; |
104 | fcoe_init2.hsi_minor_version = FCOE_HSI_MINOR_VERSION; | 104 | fcoe_init2.hsi_minor_version = FCOE_HSI_MINOR_VERSION; |
105 | 105 | ||
106 | |||
106 | fcoe_init2.hash_tbl_pbl_addr_lo = (u32) hba->hash_tbl_pbl_dma; | 107 | fcoe_init2.hash_tbl_pbl_addr_lo = (u32) hba->hash_tbl_pbl_dma; |
107 | fcoe_init2.hash_tbl_pbl_addr_hi = (u32) | 108 | fcoe_init2.hash_tbl_pbl_addr_hi = (u32) |
108 | ((u64) hba->hash_tbl_pbl_dma >> 32); | 109 | ((u64) hba->hash_tbl_pbl_dma >> 32); |
@@ -165,7 +166,8 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port, | |||
165 | struct bnx2fc_rport *tgt) | 166 | struct bnx2fc_rport *tgt) |
166 | { | 167 | { |
167 | struct fc_lport *lport = port->lport; | 168 | struct fc_lport *lport = port->lport; |
168 | struct bnx2fc_hba *hba = port->priv; | 169 | struct bnx2fc_interface *interface = port->priv; |
170 | struct bnx2fc_hba *hba = interface->hba; | ||
169 | struct kwqe *kwqe_arr[4]; | 171 | struct kwqe *kwqe_arr[4]; |
170 | struct fcoe_kwqe_conn_offload1 ofld_req1; | 172 | struct fcoe_kwqe_conn_offload1 ofld_req1; |
171 | struct fcoe_kwqe_conn_offload2 ofld_req2; | 173 | struct fcoe_kwqe_conn_offload2 ofld_req2; |
@@ -227,7 +229,7 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port, | |||
227 | ofld_req3.hdr.flags = | 229 | ofld_req3.hdr.flags = |
228 | (FCOE_KWQE_LAYER_CODE << FCOE_KWQE_HEADER_LAYER_CODE_SHIFT); | 230 | (FCOE_KWQE_LAYER_CODE << FCOE_KWQE_HEADER_LAYER_CODE_SHIFT); |
229 | 231 | ||
230 | ofld_req3.vlan_tag = hba->vlan_id << | 232 | ofld_req3.vlan_tag = interface->vlan_id << |
231 | FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID_SHIFT; | 233 | FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID_SHIFT; |
232 | ofld_req3.vlan_tag |= 3 << FCOE_KWQE_CONN_OFFLOAD3_PRIORITY_SHIFT; | 234 | ofld_req3.vlan_tag |= 3 << FCOE_KWQE_CONN_OFFLOAD3_PRIORITY_SHIFT; |
233 | 235 | ||
@@ -278,7 +280,7 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port, | |||
278 | FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT); | 280 | FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT); |
279 | 281 | ||
280 | /* vlan flag */ | 282 | /* vlan flag */ |
281 | ofld_req3.flags |= (hba->vlan_enabled << | 283 | ofld_req3.flags |= (interface->vlan_enabled << |
282 | FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT); | 284 | FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT); |
283 | 285 | ||
284 | /* C2_VALID and ACK flags are not set as they are not suppported */ | 286 | /* C2_VALID and ACK flags are not set as they are not suppported */ |
@@ -300,12 +302,13 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port, | |||
300 | ofld_req4.src_mac_addr_mid[1] = port->data_src_addr[2]; | 302 | ofld_req4.src_mac_addr_mid[1] = port->data_src_addr[2]; |
301 | ofld_req4.src_mac_addr_hi[0] = port->data_src_addr[1]; | 303 | ofld_req4.src_mac_addr_hi[0] = port->data_src_addr[1]; |
302 | ofld_req4.src_mac_addr_hi[1] = port->data_src_addr[0]; | 304 | ofld_req4.src_mac_addr_hi[1] = port->data_src_addr[0]; |
303 | ofld_req4.dst_mac_addr_lo[0] = hba->ctlr.dest_addr[5];/* fcf mac */ | 305 | ofld_req4.dst_mac_addr_lo[0] = interface->ctlr.dest_addr[5]; |
304 | ofld_req4.dst_mac_addr_lo[1] = hba->ctlr.dest_addr[4]; | 306 | /* fcf mac */ |
305 | ofld_req4.dst_mac_addr_mid[0] = hba->ctlr.dest_addr[3]; | 307 | ofld_req4.dst_mac_addr_lo[1] = interface->ctlr.dest_addr[4]; |
306 | ofld_req4.dst_mac_addr_mid[1] = hba->ctlr.dest_addr[2]; | 308 | ofld_req4.dst_mac_addr_mid[0] = interface->ctlr.dest_addr[3]; |
307 | ofld_req4.dst_mac_addr_hi[0] = hba->ctlr.dest_addr[1]; | 309 | ofld_req4.dst_mac_addr_mid[1] = interface->ctlr.dest_addr[2]; |
308 | ofld_req4.dst_mac_addr_hi[1] = hba->ctlr.dest_addr[0]; | 310 | ofld_req4.dst_mac_addr_hi[0] = interface->ctlr.dest_addr[1]; |
311 | ofld_req4.dst_mac_addr_hi[1] = interface->ctlr.dest_addr[0]; | ||
309 | 312 | ||
310 | ofld_req4.lcq_addr_lo = (u32) tgt->lcq_dma; | 313 | ofld_req4.lcq_addr_lo = (u32) tgt->lcq_dma; |
311 | ofld_req4.lcq_addr_hi = (u32)((u64) tgt->lcq_dma >> 32); | 314 | ofld_req4.lcq_addr_hi = (u32)((u64) tgt->lcq_dma >> 32); |
@@ -335,7 +338,8 @@ static int bnx2fc_send_session_enable_req(struct fcoe_port *port, | |||
335 | struct bnx2fc_rport *tgt) | 338 | struct bnx2fc_rport *tgt) |
336 | { | 339 | { |
337 | struct kwqe *kwqe_arr[2]; | 340 | struct kwqe *kwqe_arr[2]; |
338 | struct bnx2fc_hba *hba = port->priv; | 341 | struct bnx2fc_interface *interface = port->priv; |
342 | struct bnx2fc_hba *hba = interface->hba; | ||
339 | struct fcoe_kwqe_conn_enable_disable enbl_req; | 343 | struct fcoe_kwqe_conn_enable_disable enbl_req; |
340 | struct fc_lport *lport = port->lport; | 344 | struct fc_lport *lport = port->lport; |
341 | struct fc_rport *rport = tgt->rport; | 345 | struct fc_rport *rport = tgt->rport; |
@@ -358,12 +362,12 @@ static int bnx2fc_send_session_enable_req(struct fcoe_port *port, | |||
358 | enbl_req.src_mac_addr_hi[1] = port->data_src_addr[0]; | 362 | enbl_req.src_mac_addr_hi[1] = port->data_src_addr[0]; |
359 | memcpy(tgt->src_addr, port->data_src_addr, ETH_ALEN); | 363 | memcpy(tgt->src_addr, port->data_src_addr, ETH_ALEN); |
360 | 364 | ||
361 | enbl_req.dst_mac_addr_lo[0] = hba->ctlr.dest_addr[5];/* fcf mac */ | 365 | enbl_req.dst_mac_addr_lo[0] = interface->ctlr.dest_addr[5]; |
362 | enbl_req.dst_mac_addr_lo[1] = hba->ctlr.dest_addr[4]; | 366 | enbl_req.dst_mac_addr_lo[1] = interface->ctlr.dest_addr[4]; |
363 | enbl_req.dst_mac_addr_mid[0] = hba->ctlr.dest_addr[3]; | 367 | enbl_req.dst_mac_addr_mid[0] = interface->ctlr.dest_addr[3]; |
364 | enbl_req.dst_mac_addr_mid[1] = hba->ctlr.dest_addr[2]; | 368 | enbl_req.dst_mac_addr_mid[1] = interface->ctlr.dest_addr[2]; |
365 | enbl_req.dst_mac_addr_hi[0] = hba->ctlr.dest_addr[1]; | 369 | enbl_req.dst_mac_addr_hi[0] = interface->ctlr.dest_addr[1]; |
366 | enbl_req.dst_mac_addr_hi[1] = hba->ctlr.dest_addr[0]; | 370 | enbl_req.dst_mac_addr_hi[1] = interface->ctlr.dest_addr[0]; |
367 | 371 | ||
368 | port_id = fc_host_port_id(lport->host); | 372 | port_id = fc_host_port_id(lport->host); |
369 | if (port_id != tgt->sid) { | 373 | if (port_id != tgt->sid) { |
@@ -379,10 +383,10 @@ static int bnx2fc_send_session_enable_req(struct fcoe_port *port, | |||
379 | enbl_req.d_id[0] = (port_id & 0x000000FF); | 383 | enbl_req.d_id[0] = (port_id & 0x000000FF); |
380 | enbl_req.d_id[1] = (port_id & 0x0000FF00) >> 8; | 384 | enbl_req.d_id[1] = (port_id & 0x0000FF00) >> 8; |
381 | enbl_req.d_id[2] = (port_id & 0x00FF0000) >> 16; | 385 | enbl_req.d_id[2] = (port_id & 0x00FF0000) >> 16; |
382 | enbl_req.vlan_tag = hba->vlan_id << | 386 | enbl_req.vlan_tag = interface->vlan_id << |
383 | FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT; | 387 | FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT; |
384 | enbl_req.vlan_tag |= 3 << FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT; | 388 | enbl_req.vlan_tag |= 3 << FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT; |
385 | enbl_req.vlan_flag = hba->vlan_enabled; | 389 | enbl_req.vlan_flag = interface->vlan_enabled; |
386 | enbl_req.context_id = tgt->context_id; | 390 | enbl_req.context_id = tgt->context_id; |
387 | enbl_req.conn_id = tgt->fcoe_conn_id; | 391 | enbl_req.conn_id = tgt->fcoe_conn_id; |
388 | 392 | ||
@@ -402,7 +406,8 @@ static int bnx2fc_send_session_enable_req(struct fcoe_port *port, | |||
402 | int bnx2fc_send_session_disable_req(struct fcoe_port *port, | 406 | int bnx2fc_send_session_disable_req(struct fcoe_port *port, |
403 | struct bnx2fc_rport *tgt) | 407 | struct bnx2fc_rport *tgt) |
404 | { | 408 | { |
405 | struct bnx2fc_hba *hba = port->priv; | 409 | struct bnx2fc_interface *interface = port->priv; |
410 | struct bnx2fc_hba *hba = interface->hba; | ||
406 | struct fcoe_kwqe_conn_enable_disable disable_req; | 411 | struct fcoe_kwqe_conn_enable_disable disable_req; |
407 | struct kwqe *kwqe_arr[2]; | 412 | struct kwqe *kwqe_arr[2]; |
408 | struct fc_rport *rport = tgt->rport; | 413 | struct fc_rport *rport = tgt->rport; |
@@ -423,12 +428,12 @@ int bnx2fc_send_session_disable_req(struct fcoe_port *port, | |||
423 | disable_req.src_mac_addr_hi[0] = tgt->src_addr[1]; | 428 | disable_req.src_mac_addr_hi[0] = tgt->src_addr[1]; |
424 | disable_req.src_mac_addr_hi[1] = tgt->src_addr[0]; | 429 | disable_req.src_mac_addr_hi[1] = tgt->src_addr[0]; |
425 | 430 | ||
426 | disable_req.dst_mac_addr_lo[0] = hba->ctlr.dest_addr[5];/* fcf mac */ | 431 | disable_req.dst_mac_addr_lo[0] = interface->ctlr.dest_addr[5]; |
427 | disable_req.dst_mac_addr_lo[1] = hba->ctlr.dest_addr[4]; | 432 | disable_req.dst_mac_addr_lo[1] = interface->ctlr.dest_addr[4]; |
428 | disable_req.dst_mac_addr_mid[0] = hba->ctlr.dest_addr[3]; | 433 | disable_req.dst_mac_addr_mid[0] = interface->ctlr.dest_addr[3]; |
429 | disable_req.dst_mac_addr_mid[1] = hba->ctlr.dest_addr[2]; | 434 | disable_req.dst_mac_addr_mid[1] = interface->ctlr.dest_addr[2]; |
430 | disable_req.dst_mac_addr_hi[0] = hba->ctlr.dest_addr[1]; | 435 | disable_req.dst_mac_addr_hi[0] = interface->ctlr.dest_addr[1]; |
431 | disable_req.dst_mac_addr_hi[1] = hba->ctlr.dest_addr[0]; | 436 | disable_req.dst_mac_addr_hi[1] = interface->ctlr.dest_addr[0]; |
432 | 437 | ||
433 | port_id = tgt->sid; | 438 | port_id = tgt->sid; |
434 | disable_req.s_id[0] = (port_id & 0x000000FF); | 439 | disable_req.s_id[0] = (port_id & 0x000000FF); |
@@ -442,11 +447,11 @@ int bnx2fc_send_session_disable_req(struct fcoe_port *port, | |||
442 | disable_req.d_id[2] = (port_id & 0x00FF0000) >> 16; | 447 | disable_req.d_id[2] = (port_id & 0x00FF0000) >> 16; |
443 | disable_req.context_id = tgt->context_id; | 448 | disable_req.context_id = tgt->context_id; |
444 | disable_req.conn_id = tgt->fcoe_conn_id; | 449 | disable_req.conn_id = tgt->fcoe_conn_id; |
445 | disable_req.vlan_tag = hba->vlan_id << | 450 | disable_req.vlan_tag = interface->vlan_id << |
446 | FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT; | 451 | FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT; |
447 | disable_req.vlan_tag |= | 452 | disable_req.vlan_tag |= |
448 | 3 << FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT; | 453 | 3 << FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT; |
449 | disable_req.vlan_flag = hba->vlan_enabled; | 454 | disable_req.vlan_flag = interface->vlan_enabled; |
450 | 455 | ||
451 | kwqe_arr[0] = (struct kwqe *) &disable_req; | 456 | kwqe_arr[0] = (struct kwqe *) &disable_req; |
452 | 457 | ||
@@ -525,7 +530,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, | |||
525 | { | 530 | { |
526 | struct fcoe_port *port = tgt->port; | 531 | struct fcoe_port *port = tgt->port; |
527 | struct fc_lport *lport = port->lport; | 532 | struct fc_lport *lport = port->lport; |
528 | struct bnx2fc_hba *hba = port->priv; | 533 | struct bnx2fc_interface *interface = port->priv; |
529 | struct bnx2fc_unsol_els *unsol_els; | 534 | struct bnx2fc_unsol_els *unsol_els; |
530 | struct fc_frame_header *fh; | 535 | struct fc_frame_header *fh; |
531 | struct fc_frame *fp; | 536 | struct fc_frame *fp; |
@@ -586,7 +591,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, | |||
586 | fr_eof(fp) = FC_EOF_T; | 591 | fr_eof(fp) = FC_EOF_T; |
587 | fr_crc(fp) = cpu_to_le32(~crc); | 592 | fr_crc(fp) = cpu_to_le32(~crc); |
588 | unsol_els->lport = lport; | 593 | unsol_els->lport = lport; |
589 | unsol_els->hba = hba; | 594 | unsol_els->hba = interface->hba; |
590 | unsol_els->fp = fp; | 595 | unsol_els->fp = fp; |
591 | INIT_WORK(&unsol_els->unsol_els_work, bnx2fc_unsol_els_work); | 596 | INIT_WORK(&unsol_els->unsol_els_work, bnx2fc_unsol_els_work); |
592 | queue_work(bnx2fc_wq, &unsol_els->unsol_els_work); | 597 | queue_work(bnx2fc_wq, &unsol_els->unsol_els_work); |
@@ -608,7 +613,8 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe) | |||
608 | u32 frame_len, len; | 613 | u32 frame_len, len; |
609 | struct bnx2fc_cmd *io_req = NULL; | 614 | struct bnx2fc_cmd *io_req = NULL; |
610 | struct fcoe_task_ctx_entry *task, *task_page; | 615 | struct fcoe_task_ctx_entry *task, *task_page; |
611 | struct bnx2fc_hba *hba = tgt->port->priv; | 616 | struct bnx2fc_interface *interface = tgt->port->priv; |
617 | struct bnx2fc_hba *hba = interface->hba; | ||
612 | int task_idx, index; | 618 | int task_idx, index; |
613 | int rc = 0; | 619 | int rc = 0; |
614 | 620 | ||
@@ -685,7 +691,7 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe) | |||
685 | task_idx = xid / BNX2FC_TASKS_PER_PAGE; | 691 | task_idx = xid / BNX2FC_TASKS_PER_PAGE; |
686 | index = xid % BNX2FC_TASKS_PER_PAGE; | 692 | index = xid % BNX2FC_TASKS_PER_PAGE; |
687 | task_page = (struct fcoe_task_ctx_entry *) | 693 | task_page = (struct fcoe_task_ctx_entry *) |
688 | hba->task_ctx[task_idx]; | 694 | hba->task_ctx[task_idx]; |
689 | task = &(task_page[index]); | 695 | task = &(task_page[index]); |
690 | 696 | ||
691 | io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid]; | 697 | io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid]; |
@@ -770,7 +776,8 @@ void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe) | |||
770 | struct fcoe_task_ctx_entry *task; | 776 | struct fcoe_task_ctx_entry *task; |
771 | struct fcoe_task_ctx_entry *task_page; | 777 | struct fcoe_task_ctx_entry *task_page; |
772 | struct fcoe_port *port = tgt->port; | 778 | struct fcoe_port *port = tgt->port; |
773 | struct bnx2fc_hba *hba = port->priv; | 779 | struct bnx2fc_interface *interface = port->priv; |
780 | struct bnx2fc_hba *hba = interface->hba; | ||
774 | struct bnx2fc_cmd *io_req; | 781 | struct bnx2fc_cmd *io_req; |
775 | int task_idx, index; | 782 | int task_idx, index; |
776 | u16 xid; | 783 | u16 xid; |
@@ -1004,6 +1011,7 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba, | |||
1004 | { | 1011 | { |
1005 | struct bnx2fc_rport *tgt; | 1012 | struct bnx2fc_rport *tgt; |
1006 | struct fcoe_port *port; | 1013 | struct fcoe_port *port; |
1014 | struct bnx2fc_interface *interface; | ||
1007 | u32 conn_id; | 1015 | u32 conn_id; |
1008 | u32 context_id; | 1016 | u32 context_id; |
1009 | int rc; | 1017 | int rc; |
@@ -1012,14 +1020,15 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba, | |||
1012 | context_id = ofld_kcqe->fcoe_conn_context_id; | 1020 | context_id = ofld_kcqe->fcoe_conn_context_id; |
1013 | tgt = hba->tgt_ofld_list[conn_id]; | 1021 | tgt = hba->tgt_ofld_list[conn_id]; |
1014 | if (!tgt) { | 1022 | if (!tgt) { |
1015 | printk(KERN_ERR PFX "ERROR:ofld_cmpl: No pending ofld req\n"); | 1023 | printk(KERN_ALERT PFX "ERROR:ofld_cmpl: No pending ofld req\n"); |
1016 | return; | 1024 | return; |
1017 | } | 1025 | } |
1018 | BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n", | 1026 | BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n", |
1019 | ofld_kcqe->fcoe_conn_context_id); | 1027 | ofld_kcqe->fcoe_conn_context_id); |
1020 | port = tgt->port; | 1028 | port = tgt->port; |
1021 | if (hba != tgt->port->priv) { | 1029 | interface = tgt->port->priv; |
1022 | printk(KERN_ALERT PFX "ERROR:ofld_cmpl: HBA mis-match\n"); | 1030 | if (hba != interface->hba) { |
1031 | printk(KERN_ERR PFX "ERROR:ofld_cmpl: HBA mis-match\n"); | ||
1023 | goto ofld_cmpl_err; | 1032 | goto ofld_cmpl_err; |
1024 | } | 1033 | } |
1025 | /* | 1034 | /* |
@@ -1063,6 +1072,7 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba, | |||
1063 | struct fcoe_kcqe *ofld_kcqe) | 1072 | struct fcoe_kcqe *ofld_kcqe) |
1064 | { | 1073 | { |
1065 | struct bnx2fc_rport *tgt; | 1074 | struct bnx2fc_rport *tgt; |
1075 | struct bnx2fc_interface *interface; | ||
1066 | u32 conn_id; | 1076 | u32 conn_id; |
1067 | u32 context_id; | 1077 | u32 context_id; |
1068 | 1078 | ||
@@ -1085,13 +1095,14 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba, | |||
1085 | printk(KERN_ERR PFX "context id mis-match\n"); | 1095 | printk(KERN_ERR PFX "context id mis-match\n"); |
1086 | return; | 1096 | return; |
1087 | } | 1097 | } |
1088 | if (hba != tgt->port->priv) { | 1098 | interface = tgt->port->priv; |
1089 | printk(KERN_ALERT PFX "bnx2fc-enbl_cmpl: HBA mis-match\n"); | 1099 | if (hba != interface->hba) { |
1100 | printk(KERN_ERR PFX "bnx2fc-enbl_cmpl: HBA mis-match\n"); | ||
1090 | goto enbl_cmpl_err; | 1101 | goto enbl_cmpl_err; |
1091 | } | 1102 | } |
1092 | if (ofld_kcqe->completion_status) { | 1103 | if (ofld_kcqe->completion_status) |
1093 | goto enbl_cmpl_err; | 1104 | goto enbl_cmpl_err; |
1094 | } else { | 1105 | else { |
1095 | /* enable successful - rport ready for issuing IOs */ | 1106 | /* enable successful - rport ready for issuing IOs */ |
1096 | set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); | 1107 | set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); |
1097 | set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); | 1108 | set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); |
@@ -1241,7 +1252,7 @@ void bnx2fc_indicate_kcqe(void *context, struct kcqe *kcq[], | |||
1241 | } else { | 1252 | } else { |
1242 | printk(KERN_ERR PFX "DESTROY success\n"); | 1253 | printk(KERN_ERR PFX "DESTROY success\n"); |
1243 | } | 1254 | } |
1244 | hba->flags |= BNX2FC_FLAG_DESTROY_CMPL; | 1255 | set_bit(BNX2FC_FLAG_DESTROY_CMPL, &hba->flags); |
1245 | wake_up_interruptible(&hba->destroy_wait); | 1256 | wake_up_interruptible(&hba->destroy_wait); |
1246 | break; | 1257 | break; |
1247 | 1258 | ||
@@ -1306,7 +1317,8 @@ int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt) | |||
1306 | struct fcoe_port *port = tgt->port; | 1317 | struct fcoe_port *port = tgt->port; |
1307 | u32 reg_off; | 1318 | u32 reg_off; |
1308 | resource_size_t reg_base; | 1319 | resource_size_t reg_base; |
1309 | struct bnx2fc_hba *hba = port->priv; | 1320 | struct bnx2fc_interface *interface = port->priv; |
1321 | struct bnx2fc_hba *hba = interface->hba; | ||
1310 | 1322 | ||
1311 | reg_base = pci_resource_start(hba->pcidev, | 1323 | reg_base = pci_resource_start(hba->pcidev, |
1312 | BNX2X_DOORBELL_PCI_BAR); | 1324 | BNX2X_DOORBELL_PCI_BAR); |