diff options
author | Robert Love <robert.w.love@intel.com> | 2010-05-07 18:18:41 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-16 22:22:34 -0400 |
commit | 7b2787ec15b9d1c2f716da61b0eec21a3f5e6520 (patch) | |
tree | 39b098d4253fa266ea75bf1f7feb75458e78b77d /drivers/scsi/fcoe/libfcoe.c | |
parent | 5e4f8fe7b58f4da5043b7f219fe9193cddd9262e (diff) |
[SCSI] libfc: Move the port_id into lport
This patch creates a port_id member in struct fc_lport.
This allows libfc to just deal with fc_lport instances
instead of calling into the fc_host to get the port_id.
This change helps in only using symbols necessary for
operation from the libfc structures. libfc still needs
to change the fc_host_port_id() if the port_id changes
so the presentation layer (scsi_transport_fc) can provide
the user with the correct value, but libfc shouldn't
rely on the presentation layer for operational values.
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index ec4c88c2d131..948364a3342f 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
@@ -343,7 +343,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip, | |||
343 | 343 | ||
344 | fcf = fip->sel_fcf; | 344 | fcf = fip->sel_fcf; |
345 | lp = fip->lp; | 345 | lp = fip->lp; |
346 | if (!fcf || !fc_host_port_id(lp->host)) | 346 | if (!fcf || !lp->port_id) |
347 | return; | 347 | return; |
348 | 348 | ||
349 | len = sizeof(*kal) + ports * sizeof(*vn); | 349 | len = sizeof(*kal) + ports * sizeof(*vn); |
@@ -374,7 +374,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip, | |||
374 | vn->fd_desc.fip_dtype = FIP_DT_VN_ID; | 374 | vn->fd_desc.fip_dtype = FIP_DT_VN_ID; |
375 | vn->fd_desc.fip_dlen = sizeof(*vn) / FIP_BPW; | 375 | vn->fd_desc.fip_dlen = sizeof(*vn) / FIP_BPW; |
376 | memcpy(vn->fd_mac, fip->get_src_addr(lport), ETH_ALEN); | 376 | memcpy(vn->fd_mac, fip->get_src_addr(lport), ETH_ALEN); |
377 | hton24(vn->fd_fc_id, fc_host_port_id(lp->host)); | 377 | hton24(vn->fd_fc_id, lp->port_id); |
378 | put_unaligned_be64(lp->wwpn, &vn->fd_wwpn); | 378 | put_unaligned_be64(lp->wwpn, &vn->fd_wwpn); |
379 | } | 379 | } |
380 | skb_put(skb, len); | 380 | skb_put(skb, len); |
@@ -949,7 +949,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, | |||
949 | 949 | ||
950 | LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n"); | 950 | LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n"); |
951 | 951 | ||
952 | if (!fcf || !fc_host_port_id(lport->host)) | 952 | if (!fcf || !lport->port_id) |
953 | return; | 953 | return; |
954 | 954 | ||
955 | /* | 955 | /* |
@@ -987,8 +987,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, | |||
987 | if (compare_ether_addr(vp->fd_mac, | 987 | if (compare_ether_addr(vp->fd_mac, |
988 | fip->get_src_addr(lport)) == 0 && | 988 | fip->get_src_addr(lport)) == 0 && |
989 | get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn && | 989 | get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn && |
990 | ntoh24(vp->fd_fc_id) == | 990 | ntoh24(vp->fd_fc_id) == lport->port_id) |
991 | fc_host_port_id(lport->host)) | ||
992 | desc_mask &= ~BIT(FIP_DT_VN_ID); | 991 | desc_mask &= ~BIT(FIP_DT_VN_ID); |
993 | break; | 992 | break; |
994 | default: | 993 | default: |