diff options
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 9 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_disc.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_elsct.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 14 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_libfc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 16 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_npiv.c | 4 | ||||
-rw-r--r-- | include/scsi/fc_encode.h | 18 | ||||
-rw-r--r-- | include/scsi/libfc.h | 2 |
10 files changed, 36 insertions, 35 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: |
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index b292272d296f..c7985da88099 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c | |||
@@ -440,7 +440,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len) | |||
440 | ids.port_id = ntoh24(np->fp_fid); | 440 | ids.port_id = ntoh24(np->fp_fid); |
441 | ids.port_name = ntohll(np->fp_wwpn); | 441 | ids.port_name = ntohll(np->fp_wwpn); |
442 | 442 | ||
443 | if (ids.port_id != fc_host_port_id(lport->host) && | 443 | if (ids.port_id != lport->port_id && |
444 | ids.port_name != lport->wwpn) { | 444 | ids.port_name != lport->wwpn) { |
445 | rdata = lport->tt.rport_create(lport, ids.port_id); | 445 | rdata = lport->tt.rport_create(lport, ids.port_id); |
446 | if (rdata) { | 446 | if (rdata) { |
diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c index 53748724f2c5..e9412b710fab 100644 --- a/drivers/scsi/libfc/fc_elsct.c +++ b/drivers/scsi/libfc/fc_elsct.c | |||
@@ -63,7 +63,7 @@ struct fc_seq *fc_elsct_send(struct fc_lport *lport, u32 did, | |||
63 | return NULL; | 63 | return NULL; |
64 | } | 64 | } |
65 | 65 | ||
66 | fc_fill_fc_hdr(fp, r_ctl, did, fc_host_port_id(lport->host), fh_type, | 66 | fc_fill_fc_hdr(fp, r_ctl, did, lport->port_id, fh_type, |
67 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 67 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
68 | 68 | ||
69 | return lport->tt.exch_seq_send(lport, fp, resp, NULL, arg, timer_msec); | 69 | return lport->tt.exch_seq_send(lport, fp, resp, NULL, arg, timer_msec); |
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 6addbd6e41e2..104e0fba7c43 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -1927,7 +1927,7 @@ static void fc_exch_rrq(struct fc_exch *ep) | |||
1927 | did = ep->sid; | 1927 | did = ep->sid; |
1928 | 1928 | ||
1929 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, did, | 1929 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, did, |
1930 | fc_host_port_id(lport->host), FC_TYPE_ELS, | 1930 | lport->port_id, FC_TYPE_ELS, |
1931 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 1931 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
1932 | 1932 | ||
1933 | if (fc_exch_seq_send(lport, fp, fc_exch_rrq_resp, NULL, ep, | 1933 | if (fc_exch_seq_send(lport, fp, fc_exch_rrq_resp, NULL, ep, |
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 81a7c976b373..ec1f66c4a9d4 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -490,7 +490,7 @@ crc_err: | |||
490 | if (stats->InvalidCRCCount++ < 5) | 490 | if (stats->InvalidCRCCount++ < 5) |
491 | printk(KERN_WARNING "libfc: CRC error on data " | 491 | printk(KERN_WARNING "libfc: CRC error on data " |
492 | "frame for port (%6.6x)\n", | 492 | "frame for port (%6.6x)\n", |
493 | fc_host_port_id(lport->host)); | 493 | lport->port_id); |
494 | put_cpu(); | 494 | put_cpu(); |
495 | /* | 495 | /* |
496 | * Assume the frame is total garbage. | 496 | * Assume the frame is total garbage. |
@@ -1109,7 +1109,7 @@ static int fc_fcp_cmd_send(struct fc_lport *lport, struct fc_fcp_pkt *fsp, | |||
1109 | rpriv = rport->dd_data; | 1109 | rpriv = rport->dd_data; |
1110 | 1110 | ||
1111 | fc_fill_fc_hdr(fp, FC_RCTL_DD_UNSOL_CMD, rport->port_id, | 1111 | fc_fill_fc_hdr(fp, FC_RCTL_DD_UNSOL_CMD, rport->port_id, |
1112 | fc_host_port_id(rpriv->local_port->host), FC_TYPE_FCP, | 1112 | rpriv->local_port->port_id, FC_TYPE_FCP, |
1113 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 1113 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
1114 | 1114 | ||
1115 | seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy, | 1115 | seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy, |
@@ -1382,7 +1382,7 @@ static void fc_fcp_rec(struct fc_fcp_pkt *fsp) | |||
1382 | 1382 | ||
1383 | fr_seq(fp) = fsp->seq_ptr; | 1383 | fr_seq(fp) = fsp->seq_ptr; |
1384 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, | 1384 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, |
1385 | fc_host_port_id(rpriv->local_port->host), FC_TYPE_ELS, | 1385 | rpriv->local_port->port_id, FC_TYPE_ELS, |
1386 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 1386 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
1387 | if (lport->tt.elsct_send(lport, rport->port_id, fp, ELS_REC, | 1387 | if (lport->tt.elsct_send(lport, rport->port_id, fp, ELS_REC, |
1388 | fc_fcp_rec_resp, fsp, | 1388 | fc_fcp_rec_resp, fsp, |
@@ -1640,7 +1640,7 @@ static void fc_fcp_srr(struct fc_fcp_pkt *fsp, enum fc_rctl r_ctl, u32 offset) | |||
1640 | srr->srr_rel_off = htonl(offset); | 1640 | srr->srr_rel_off = htonl(offset); |
1641 | 1641 | ||
1642 | fc_fill_fc_hdr(fp, FC_RCTL_ELS4_REQ, rport->port_id, | 1642 | fc_fill_fc_hdr(fp, FC_RCTL_ELS4_REQ, rport->port_id, |
1643 | fc_host_port_id(rpriv->local_port->host), FC_TYPE_FCP, | 1643 | rpriv->local_port->port_id, FC_TYPE_FCP, |
1644 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 1644 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
1645 | 1645 | ||
1646 | seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp, NULL, | 1646 | seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp, NULL, |
@@ -2101,12 +2101,12 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd) | |||
2101 | 2101 | ||
2102 | if (fc_fcp_lport_queue_ready(lport)) { | 2102 | if (fc_fcp_lport_queue_ready(lport)) { |
2103 | shost_printk(KERN_INFO, shost, "libfc: Host reset succeeded " | 2103 | shost_printk(KERN_INFO, shost, "libfc: Host reset succeeded " |
2104 | "on port (%6.6x)\n", fc_host_port_id(lport->host)); | 2104 | "on port (%6.6x)\n", lport->port_id); |
2105 | return SUCCESS; | 2105 | return SUCCESS; |
2106 | } else { | 2106 | } else { |
2107 | shost_printk(KERN_INFO, shost, "libfc: Host reset failed, " | 2107 | shost_printk(KERN_INFO, shost, "libfc: Host reset failed, " |
2108 | "port (%6.6x) is not ready.\n", | 2108 | "port (%6.6x) is not ready.\n", |
2109 | fc_host_port_id(lport->host)); | 2109 | lport->port_id); |
2110 | return FAILED; | 2110 | return FAILED; |
2111 | } | 2111 | } |
2112 | } | 2112 | } |
@@ -2191,7 +2191,7 @@ void fc_fcp_destroy(struct fc_lport *lport) | |||
2191 | 2191 | ||
2192 | if (!list_empty(&si->scsi_pkt_queue)) | 2192 | if (!list_empty(&si->scsi_pkt_queue)) |
2193 | printk(KERN_ERR "libfc: Leaked SCSI packets when destroying " | 2193 | printk(KERN_ERR "libfc: Leaked SCSI packets when destroying " |
2194 | "port (%6.6x)\n", fc_host_port_id(lport->host)); | 2194 | "port (%6.6x)\n", lport->port_id); |
2195 | 2195 | ||
2196 | mempool_destroy(si->scsi_pkt_pool); | 2196 | mempool_destroy(si->scsi_pkt_pool); |
2197 | kfree(si); | 2197 | kfree(si); |
diff --git a/drivers/scsi/libfc/fc_libfc.h b/drivers/scsi/libfc/fc_libfc.h index efc6b3fe6f35..f5c0ca4b6ef8 100644 --- a/drivers/scsi/libfc/fc_libfc.h +++ b/drivers/scsi/libfc/fc_libfc.h | |||
@@ -47,7 +47,7 @@ extern unsigned int fc_debug_logging; | |||
47 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | 47 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ |
48 | printk(KERN_INFO "host%u: lport %6.6x: " fmt, \ | 48 | printk(KERN_INFO "host%u: lport %6.6x: " fmt, \ |
49 | (lport)->host->host_no, \ | 49 | (lport)->host->host_no, \ |
50 | fc_host_port_id((lport)->host), ##args)) | 50 | (lport)->port_id, ##args)) |
51 | 51 | ||
52 | #define FC_DISC_DBG(disc, fmt, args...) \ | 52 | #define FC_DISC_DBG(disc, fmt, args...) \ |
53 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | 53 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ |
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 7159bcfa8ec3..79c9e3ccd341 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -565,7 +565,7 @@ void __fc_linkup(struct fc_lport *lport) | |||
565 | void fc_linkup(struct fc_lport *lport) | 565 | void fc_linkup(struct fc_lport *lport) |
566 | { | 566 | { |
567 | printk(KERN_INFO "host%d: libfc: Link up on port (%6.6x)\n", | 567 | printk(KERN_INFO "host%d: libfc: Link up on port (%6.6x)\n", |
568 | lport->host->host_no, fc_host_port_id(lport->host)); | 568 | lport->host->host_no, lport->port_id); |
569 | 569 | ||
570 | mutex_lock(&lport->lp_mutex); | 570 | mutex_lock(&lport->lp_mutex); |
571 | __fc_linkup(lport); | 571 | __fc_linkup(lport); |
@@ -595,7 +595,7 @@ void __fc_linkdown(struct fc_lport *lport) | |||
595 | void fc_linkdown(struct fc_lport *lport) | 595 | void fc_linkdown(struct fc_lport *lport) |
596 | { | 596 | { |
597 | printk(KERN_INFO "host%d: libfc: Link down on port (%6.6x)\n", | 597 | printk(KERN_INFO "host%d: libfc: Link down on port (%6.6x)\n", |
598 | lport->host->host_no, fc_host_port_id(lport->host)); | 598 | lport->host->host_no, lport->port_id); |
599 | 599 | ||
600 | mutex_lock(&lport->lp_mutex); | 600 | mutex_lock(&lport->lp_mutex); |
601 | __fc_linkdown(lport); | 601 | __fc_linkdown(lport); |
@@ -697,7 +697,7 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event) | |||
697 | case DISC_EV_FAILED: | 697 | case DISC_EV_FAILED: |
698 | printk(KERN_ERR "host%d: libfc: " | 698 | printk(KERN_ERR "host%d: libfc: " |
699 | "Discovery failed for port (%6.6x)\n", | 699 | "Discovery failed for port (%6.6x)\n", |
700 | lport->host->host_no, fc_host_port_id(lport->host)); | 700 | lport->host->host_no, lport->port_id); |
701 | mutex_lock(&lport->lp_mutex); | 701 | mutex_lock(&lport->lp_mutex); |
702 | fc_lport_enter_reset(lport); | 702 | fc_lport_enter_reset(lport); |
703 | mutex_unlock(&lport->lp_mutex); | 703 | mutex_unlock(&lport->lp_mutex); |
@@ -745,7 +745,11 @@ static void fc_lport_set_port_id(struct fc_lport *lport, u32 port_id, | |||
745 | printk(KERN_INFO "host%d: Assigned Port ID %6.6x\n", | 745 | printk(KERN_INFO "host%d: Assigned Port ID %6.6x\n", |
746 | lport->host->host_no, port_id); | 746 | lport->host->host_no, port_id); |
747 | 747 | ||
748 | lport->port_id = port_id; | ||
749 | |||
750 | /* Update the fc_host */ | ||
748 | fc_host_port_id(lport->host) = port_id; | 751 | fc_host_port_id(lport->host) = port_id; |
752 | |||
749 | if (lport->tt.lport_set_port_id) | 753 | if (lport->tt.lport_set_port_id) |
750 | lport->tt.lport_set_port_id(lport, port_id, fp); | 754 | lport->tt.lport_set_port_id(lport, port_id, fp); |
751 | } | 755 | } |
@@ -950,7 +954,7 @@ static void fc_lport_reset_locked(struct fc_lport *lport) | |||
950 | lport->tt.exch_mgr_reset(lport, 0, 0); | 954 | lport->tt.exch_mgr_reset(lport, 0, 0); |
951 | fc_host_fabric_name(lport->host) = 0; | 955 | fc_host_fabric_name(lport->host) = 0; |
952 | 956 | ||
953 | if (fc_host_port_id(lport->host)) | 957 | if (lport->port_id) |
954 | fc_lport_set_port_id(lport, 0, NULL); | 958 | fc_lport_set_port_id(lport, 0, NULL); |
955 | } | 959 | } |
956 | 960 | ||
@@ -1695,7 +1699,7 @@ static int fc_lport_els_request(struct fc_bsg_job *job, | |||
1695 | fh = fc_frame_header_get(fp); | 1699 | fh = fc_frame_header_get(fp); |
1696 | fh->fh_r_ctl = FC_RCTL_ELS_REQ; | 1700 | fh->fh_r_ctl = FC_RCTL_ELS_REQ; |
1697 | hton24(fh->fh_d_id, did); | 1701 | hton24(fh->fh_d_id, did); |
1698 | hton24(fh->fh_s_id, fc_host_port_id(lport->host)); | 1702 | hton24(fh->fh_s_id, lport->port_id); |
1699 | fh->fh_type = FC_TYPE_ELS; | 1703 | fh->fh_type = FC_TYPE_ELS; |
1700 | hton24(fh->fh_f_ctl, FC_FC_FIRST_SEQ | | 1704 | hton24(fh->fh_f_ctl, FC_FC_FIRST_SEQ | |
1701 | FC_FC_END_SEQ | FC_FC_SEQ_INIT); | 1705 | FC_FC_END_SEQ | FC_FC_SEQ_INIT); |
@@ -1755,7 +1759,7 @@ static int fc_lport_ct_request(struct fc_bsg_job *job, | |||
1755 | fh = fc_frame_header_get(fp); | 1759 | fh = fc_frame_header_get(fp); |
1756 | fh->fh_r_ctl = FC_RCTL_DD_UNSOL_CTL; | 1760 | fh->fh_r_ctl = FC_RCTL_DD_UNSOL_CTL; |
1757 | hton24(fh->fh_d_id, did); | 1761 | hton24(fh->fh_d_id, did); |
1758 | hton24(fh->fh_s_id, fc_host_port_id(lport->host)); | 1762 | hton24(fh->fh_s_id, lport->port_id); |
1759 | fh->fh_type = FC_TYPE_CT; | 1763 | fh->fh_type = FC_TYPE_CT; |
1760 | hton24(fh->fh_f_ctl, FC_FC_FIRST_SEQ | | 1764 | hton24(fh->fh_f_ctl, FC_FC_FIRST_SEQ | |
1761 | FC_FC_END_SEQ | FC_FC_SEQ_INIT); | 1765 | FC_FC_END_SEQ | FC_FC_SEQ_INIT); |
diff --git a/drivers/scsi/libfc/fc_npiv.c b/drivers/scsi/libfc/fc_npiv.c index 45b6f1e2df92..dd2b43bb1c70 100644 --- a/drivers/scsi/libfc/fc_npiv.c +++ b/drivers/scsi/libfc/fc_npiv.c | |||
@@ -69,7 +69,7 @@ struct fc_lport *fc_vport_id_lookup(struct fc_lport *n_port, u32 port_id) | |||
69 | struct fc_lport *lport = NULL; | 69 | struct fc_lport *lport = NULL; |
70 | struct fc_lport *vn_port; | 70 | struct fc_lport *vn_port; |
71 | 71 | ||
72 | if (fc_host_port_id(n_port->host) == port_id) | 72 | if (n_port->port_id == port_id) |
73 | return n_port; | 73 | return n_port; |
74 | 74 | ||
75 | if (port_id == FC_FID_FLOGI) | 75 | if (port_id == FC_FID_FLOGI) |
@@ -77,7 +77,7 @@ struct fc_lport *fc_vport_id_lookup(struct fc_lport *n_port, u32 port_id) | |||
77 | 77 | ||
78 | mutex_lock(&n_port->lp_mutex); | 78 | mutex_lock(&n_port->lp_mutex); |
79 | list_for_each_entry(vn_port, &n_port->vports, list) { | 79 | list_for_each_entry(vn_port, &n_port->vports, list) { |
80 | if (fc_host_port_id(vn_port->host) == port_id) { | 80 | if (vn_port->port_id == port_id) { |
81 | lport = vn_port; | 81 | lport = vn_port; |
82 | break; | 82 | break; |
83 | } | 83 | } |
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 8eb0a0fc0a71..9b4867c9c2d2 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
@@ -74,7 +74,7 @@ static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
74 | adisc->adisc_cmd = ELS_ADISC; | 74 | adisc->adisc_cmd = ELS_ADISC; |
75 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); | 75 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); |
76 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); | 76 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); |
77 | hton24(adisc->adisc_port_id, fc_host_port_id(lport->host)); | 77 | hton24(adisc->adisc_port_id, lport->port_id); |
78 | } | 78 | } |
79 | 79 | ||
80 | /** | 80 | /** |
@@ -127,15 +127,13 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
127 | 127 | ||
128 | case FC_NS_RFT_ID: | 128 | case FC_NS_RFT_ID: |
129 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); | 129 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); |
130 | hton24(ct->payload.rft.fid.fp_fid, | 130 | hton24(ct->payload.rft.fid.fp_fid, lport->port_id); |
131 | fc_host_port_id(lport->host)); | ||
132 | ct->payload.rft.fts = lport->fcts; | 131 | ct->payload.rft.fts = lport->fcts; |
133 | break; | 132 | break; |
134 | 133 | ||
135 | case FC_NS_RFF_ID: | 134 | case FC_NS_RFF_ID: |
136 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); | 135 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); |
137 | hton24(ct->payload.rff.fr_fid.fp_fid, | 136 | hton24(ct->payload.rff.fr_fid.fp_fid, lport->port_id); |
138 | fc_host_port_id(lport->host)); | ||
139 | ct->payload.rff.fr_type = FC_TYPE_FCP; | 137 | ct->payload.rff.fr_type = FC_TYPE_FCP; |
140 | if (lport->service_params & FCP_SPPF_INIT_FCN) | 138 | if (lport->service_params & FCP_SPPF_INIT_FCN) |
141 | ct->payload.rff.fr_feat = FCP_FEAT_INIT; | 139 | ct->payload.rff.fr_feat = FCP_FEAT_INIT; |
@@ -145,16 +143,14 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
145 | 143 | ||
146 | case FC_NS_RNN_ID: | 144 | case FC_NS_RNN_ID: |
147 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); | 145 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); |
148 | hton24(ct->payload.rn.fr_fid.fp_fid, | 146 | hton24(ct->payload.rn.fr_fid.fp_fid, lport->port_id); |
149 | fc_host_port_id(lport->host)); | ||
150 | put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); | 147 | put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); |
151 | break; | 148 | break; |
152 | 149 | ||
153 | case FC_NS_RSPN_ID: | 150 | case FC_NS_RSPN_ID: |
154 | len = strnlen(fc_host_symbolic_name(lport->host), 255); | 151 | len = strnlen(fc_host_symbolic_name(lport->host), 255); |
155 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); | 152 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); |
156 | hton24(ct->payload.spn.fr_fid.fp_fid, | 153 | hton24(ct->payload.spn.fr_fid.fp_fid, lport->port_id); |
157 | fc_host_port_id(lport->host)); | ||
158 | strncpy(ct->payload.spn.fr_name, | 154 | strncpy(ct->payload.spn.fr_name, |
159 | fc_host_symbolic_name(lport->host), len); | 155 | fc_host_symbolic_name(lport->host), len); |
160 | ct->payload.spn.fr_name_len = len; | 156 | ct->payload.spn.fr_name_len = len; |
@@ -268,7 +264,7 @@ static inline void fc_logo_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
268 | logo = fc_frame_payload_get(fp, sizeof(*logo)); | 264 | logo = fc_frame_payload_get(fp, sizeof(*logo)); |
269 | memset(logo, 0, sizeof(*logo)); | 265 | memset(logo, 0, sizeof(*logo)); |
270 | logo->fl_cmd = ELS_LOGO; | 266 | logo->fl_cmd = ELS_LOGO; |
271 | hton24(logo->fl_n_port_id, fc_host_port_id(lport->host)); | 267 | hton24(logo->fl_n_port_id, lport->port_id); |
272 | logo->fl_n_port_wwn = htonll(lport->wwpn); | 268 | logo->fl_n_port_wwn = htonll(lport->wwpn); |
273 | } | 269 | } |
274 | 270 | ||
@@ -295,7 +291,7 @@ static inline void fc_rec_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
295 | rec = fc_frame_payload_get(fp, sizeof(*rec)); | 291 | rec = fc_frame_payload_get(fp, sizeof(*rec)); |
296 | memset(rec, 0, sizeof(*rec)); | 292 | memset(rec, 0, sizeof(*rec)); |
297 | rec->rec_cmd = ELS_REC; | 293 | rec->rec_cmd = ELS_REC; |
298 | hton24(rec->rec_s_id, fc_host_port_id(lport->host)); | 294 | hton24(rec->rec_s_id, lport->port_id); |
299 | rec->rec_ox_id = htons(ep->oxid); | 295 | rec->rec_ox_id = htons(ep->oxid); |
300 | rec->rec_rx_id = htons(ep->rxid); | 296 | rec->rec_rx_id = htons(ep->rxid); |
301 | } | 297 | } |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 1755fa7e9271..7495c0ba67ee 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -780,6 +780,7 @@ struct fc_disc { | |||
780 | * @dev_stats: FCoE device stats (TODO: libfc should not be | 780 | * @dev_stats: FCoE device stats (TODO: libfc should not be |
781 | * FCoE aware) | 781 | * FCoE aware) |
782 | * @retry_count: Number of retries in the current state | 782 | * @retry_count: Number of retries in the current state |
783 | * @port_id: FC Port ID | ||
783 | * @wwpn: World Wide Port Name | 784 | * @wwpn: World Wide Port Name |
784 | * @wwnn: World Wide Node Name | 785 | * @wwnn: World Wide Node Name |
785 | * @service_params: Common service parameters | 786 | * @service_params: Common service parameters |
@@ -826,6 +827,7 @@ struct fc_lport { | |||
826 | u8 retry_count; | 827 | u8 retry_count; |
827 | 828 | ||
828 | /* Fabric information */ | 829 | /* Fabric information */ |
830 | u32 port_id; | ||
829 | u64 wwpn; | 831 | u64 wwpn; |
830 | u64 wwnn; | 832 | u64 wwnn; |
831 | unsigned int service_params; | 833 | unsigned int service_params; |