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_tgt.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_tgt.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_tgt.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c index 4be391edd0c6..263c2678ff62 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c +++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c | |||
@@ -65,7 +65,8 @@ static void bnx2fc_offload_session(struct fcoe_port *port, | |||
65 | { | 65 | { |
66 | struct fc_lport *lport = rdata->local_port; | 66 | struct fc_lport *lport = rdata->local_port; |
67 | struct fc_rport *rport = rdata->rport; | 67 | struct fc_rport *rport = rdata->rport; |
68 | struct bnx2fc_hba *hba = port->priv; | 68 | struct bnx2fc_interface *interface = port->priv; |
69 | struct bnx2fc_hba *hba = interface->hba; | ||
69 | int rval; | 70 | int rval; |
70 | int i = 0; | 71 | int i = 0; |
71 | 72 | ||
@@ -237,7 +238,8 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt) | |||
237 | static void bnx2fc_upload_session(struct fcoe_port *port, | 238 | static void bnx2fc_upload_session(struct fcoe_port *port, |
238 | struct bnx2fc_rport *tgt) | 239 | struct bnx2fc_rport *tgt) |
239 | { | 240 | { |
240 | struct bnx2fc_hba *hba = port->priv; | 241 | struct bnx2fc_interface *interface = port->priv; |
242 | struct bnx2fc_hba *hba = interface->hba; | ||
241 | 243 | ||
242 | BNX2FC_TGT_DBG(tgt, "upload_session: active_ios = %d\n", | 244 | BNX2FC_TGT_DBG(tgt, "upload_session: active_ios = %d\n", |
243 | tgt->num_active_ios.counter); | 245 | tgt->num_active_ios.counter); |
@@ -316,7 +318,8 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, | |||
316 | { | 318 | { |
317 | 319 | ||
318 | struct fc_rport *rport = rdata->rport; | 320 | struct fc_rport *rport = rdata->rport; |
319 | struct bnx2fc_hba *hba = port->priv; | 321 | struct bnx2fc_interface *interface = port->priv; |
322 | struct bnx2fc_hba *hba = interface->hba; | ||
320 | struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; | 323 | struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; |
321 | struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; | 324 | struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; |
322 | 325 | ||
@@ -392,7 +395,8 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport, | |||
392 | enum fc_rport_event event) | 395 | enum fc_rport_event event) |
393 | { | 396 | { |
394 | struct fcoe_port *port = lport_priv(lport); | 397 | struct fcoe_port *port = lport_priv(lport); |
395 | struct bnx2fc_hba *hba = port->priv; | 398 | struct bnx2fc_interface *interface = port->priv; |
399 | struct bnx2fc_hba *hba = interface->hba; | ||
396 | struct fc_rport *rport = rdata->rport; | 400 | struct fc_rport *rport = rdata->rport; |
397 | struct fc_rport_libfc_priv *rp; | 401 | struct fc_rport_libfc_priv *rp; |
398 | struct bnx2fc_rport *tgt; | 402 | struct bnx2fc_rport *tgt; |
@@ -537,7 +541,8 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport, | |||
537 | struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port, | 541 | struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port, |
538 | u32 port_id) | 542 | u32 port_id) |
539 | { | 543 | { |
540 | struct bnx2fc_hba *hba = port->priv; | 544 | struct bnx2fc_interface *interface = port->priv; |
545 | struct bnx2fc_hba *hba = interface->hba; | ||
541 | struct bnx2fc_rport *tgt; | 546 | struct bnx2fc_rport *tgt; |
542 | struct fc_rport_priv *rdata; | 547 | struct fc_rport_priv *rdata; |
543 | int i; | 548 | int i; |
@@ -552,7 +557,7 @@ struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port, | |||
552 | "obtained\n"); | 557 | "obtained\n"); |
553 | return tgt; | 558 | return tgt; |
554 | } else { | 559 | } else { |
555 | printk(KERN_ERR PFX "rport 0x%x " | 560 | BNX2FC_TGT_DBG(tgt, "rport 0x%x " |
556 | "is in DELETED state\n", | 561 | "is in DELETED state\n", |
557 | rdata->ids.port_id); | 562 | rdata->ids.port_id); |
558 | return NULL; | 563 | return NULL; |