diff options
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 7b0bb6e39a9f..17bf3ca82aff 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -146,6 +146,7 @@ static int fcoe_vport_destroy(struct fc_vport *); | |||
146 | static int fcoe_vport_create(struct fc_vport *, bool disabled); | 146 | static int fcoe_vport_create(struct fc_vport *, bool disabled); |
147 | static int fcoe_vport_disable(struct fc_vport *, bool disable); | 147 | static int fcoe_vport_disable(struct fc_vport *, bool disable); |
148 | static void fcoe_set_vport_symbolic_name(struct fc_vport *); | 148 | static void fcoe_set_vport_symbolic_name(struct fc_vport *); |
149 | static void fcoe_set_port_id(struct fc_lport *, u32, struct fc_frame *); | ||
149 | 150 | ||
150 | static struct libfc_function_template fcoe_libfc_fcn_templ = { | 151 | static struct libfc_function_template fcoe_libfc_fcn_templ = { |
151 | .frame_send = fcoe_xmit, | 152 | .frame_send = fcoe_xmit, |
@@ -153,6 +154,7 @@ static struct libfc_function_template fcoe_libfc_fcn_templ = { | |||
153 | .ddp_done = fcoe_ddp_done, | 154 | .ddp_done = fcoe_ddp_done, |
154 | .elsct_send = fcoe_elsct_send, | 155 | .elsct_send = fcoe_elsct_send, |
155 | .get_lesb = fcoe_get_lesb, | 156 | .get_lesb = fcoe_get_lesb, |
157 | .lport_set_port_id = fcoe_set_port_id, | ||
156 | }; | 158 | }; |
157 | 159 | ||
158 | struct fc_function_template fcoe_transport_function = { | 160 | struct fc_function_template fcoe_transport_function = { |
@@ -2631,3 +2633,25 @@ static void fcoe_get_lesb(struct fc_lport *lport, | |||
2631 | lesb->lesb_miss_fka = htonl(mdac); | 2633 | lesb->lesb_miss_fka = htonl(mdac); |
2632 | lesb->lesb_fcs_error = htonl(dev_get_stats(netdev)->rx_crc_errors); | 2634 | lesb->lesb_fcs_error = htonl(dev_get_stats(netdev)->rx_crc_errors); |
2633 | } | 2635 | } |
2636 | |||
2637 | /** | ||
2638 | * fcoe_set_port_id() - Callback from libfc when Port_ID is set. | ||
2639 | * @lport: the local port | ||
2640 | * @port_id: the port ID | ||
2641 | * @fp: the received frame, if any, that caused the port_id to be set. | ||
2642 | * | ||
2643 | * This routine handles the case where we received a FLOGI and are | ||
2644 | * entering point-to-point mode. We need to call fcoe_ctlr_recv_flogi() | ||
2645 | * so it can set the non-mapped mode and gateway address. | ||
2646 | * | ||
2647 | * The FLOGI LS_ACC is handled by fcoe_flogi_resp(). | ||
2648 | */ | ||
2649 | static void fcoe_set_port_id(struct fc_lport *lport, | ||
2650 | u32 port_id, struct fc_frame *fp) | ||
2651 | { | ||
2652 | struct fcoe_port *port = lport_priv(lport); | ||
2653 | struct fcoe_interface *fcoe = port->fcoe; | ||
2654 | |||
2655 | if (fp && fc_frame_payload_op(fp) == ELS_FLOGI) | ||
2656 | fcoe_ctlr_recv_flogi(&fcoe->ctlr, lport, fp); | ||
2657 | } | ||