diff options
Diffstat (limited to 'drivers/scsi/libfc/fc_rport.c')
-rw-r--r-- | drivers/scsi/libfc/fc_rport.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index c06d63e4a00f..123493166824 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c | |||
@@ -747,13 +747,11 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport, | |||
747 | struct fc_rport_priv *rdata; | 747 | struct fc_rport_priv *rdata; |
748 | struct fc_frame *fp = rx_fp; | 748 | struct fc_frame *fp = rx_fp; |
749 | struct fc_exch *ep; | 749 | struct fc_exch *ep; |
750 | struct fc_frame_header *fh; | ||
751 | struct fc_seq_els_data rjt_data; | 750 | struct fc_seq_els_data rjt_data; |
752 | u32 sid, f_ctl; | 751 | u32 sid, f_ctl; |
753 | 752 | ||
754 | rjt_data.fp = NULL; | 753 | rjt_data.fp = NULL; |
755 | fh = fc_frame_header_get(fp); | 754 | sid = fc_frame_sid(fp); |
756 | sid = ntoh24(fh->fh_s_id); | ||
757 | 755 | ||
758 | FC_RPORT_ID_DBG(lport, sid, "Received FLOGI request\n"); | 756 | FC_RPORT_ID_DBG(lport, sid, "Received FLOGI request\n"); |
759 | 757 | ||
@@ -1430,17 +1428,14 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, | |||
1430 | struct fc_seq *sp, struct fc_frame *fp) | 1428 | struct fc_seq *sp, struct fc_frame *fp) |
1431 | { | 1429 | { |
1432 | struct fc_rport_priv *rdata; | 1430 | struct fc_rport_priv *rdata; |
1433 | struct fc_frame_header *fh; | ||
1434 | struct fc_seq_els_data els_data; | 1431 | struct fc_seq_els_data els_data; |
1435 | 1432 | ||
1436 | els_data.fp = NULL; | 1433 | els_data.fp = NULL; |
1437 | els_data.reason = ELS_RJT_UNAB; | 1434 | els_data.reason = ELS_RJT_UNAB; |
1438 | els_data.explan = ELS_EXPL_PLOGI_REQD; | 1435 | els_data.explan = ELS_EXPL_PLOGI_REQD; |
1439 | 1436 | ||
1440 | fh = fc_frame_header_get(fp); | ||
1441 | |||
1442 | mutex_lock(&lport->disc.disc_mutex); | 1437 | mutex_lock(&lport->disc.disc_mutex); |
1443 | rdata = lport->tt.rport_lookup(lport, ntoh24(fh->fh_s_id)); | 1438 | rdata = lport->tt.rport_lookup(lport, fc_frame_sid(fp)); |
1444 | if (!rdata) { | 1439 | if (!rdata) { |
1445 | mutex_unlock(&lport->disc.disc_mutex); | 1440 | mutex_unlock(&lport->disc.disc_mutex); |
1446 | goto reject; | 1441 | goto reject; |
@@ -1555,14 +1550,12 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport, | |||
1555 | struct fc_rport_priv *rdata; | 1550 | struct fc_rport_priv *rdata; |
1556 | struct fc_frame *fp = rx_fp; | 1551 | struct fc_frame *fp = rx_fp; |
1557 | struct fc_exch *ep; | 1552 | struct fc_exch *ep; |
1558 | struct fc_frame_header *fh; | ||
1559 | struct fc_els_flogi *pl; | 1553 | struct fc_els_flogi *pl; |
1560 | struct fc_seq_els_data rjt_data; | 1554 | struct fc_seq_els_data rjt_data; |
1561 | u32 sid, f_ctl; | 1555 | u32 sid, f_ctl; |
1562 | 1556 | ||
1563 | rjt_data.fp = NULL; | 1557 | rjt_data.fp = NULL; |
1564 | fh = fc_frame_header_get(fp); | 1558 | sid = fc_frame_sid(fp); |
1565 | sid = ntoh24(fh->fh_s_id); | ||
1566 | 1559 | ||
1567 | FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n"); | 1560 | FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n"); |
1568 | 1561 | ||
@@ -1682,7 +1675,6 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata, | |||
1682 | struct fc_lport *lport = rdata->local_port; | 1675 | struct fc_lport *lport = rdata->local_port; |
1683 | struct fc_exch *ep; | 1676 | struct fc_exch *ep; |
1684 | struct fc_frame *fp; | 1677 | struct fc_frame *fp; |
1685 | struct fc_frame_header *fh; | ||
1686 | struct { | 1678 | struct { |
1687 | struct fc_els_prli prli; | 1679 | struct fc_els_prli prli; |
1688 | struct fc_els_spp spp; | 1680 | struct fc_els_spp spp; |
@@ -1698,12 +1690,10 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata, | |||
1698 | u32 roles = FC_RPORT_ROLE_UNKNOWN; | 1690 | u32 roles = FC_RPORT_ROLE_UNKNOWN; |
1699 | 1691 | ||
1700 | rjt_data.fp = NULL; | 1692 | rjt_data.fp = NULL; |
1701 | fh = fc_frame_header_get(rx_fp); | ||
1702 | |||
1703 | FC_RPORT_DBG(rdata, "Received PRLI request while in state %s\n", | 1693 | FC_RPORT_DBG(rdata, "Received PRLI request while in state %s\n", |
1704 | fc_rport_state(rdata)); | 1694 | fc_rport_state(rdata)); |
1705 | 1695 | ||
1706 | len = fr_len(rx_fp) - sizeof(*fh); | 1696 | len = fr_len(rx_fp) - sizeof(struct fc_frame_header); |
1707 | pp = fc_frame_payload_get(rx_fp, sizeof(*pp)); | 1697 | pp = fc_frame_payload_get(rx_fp, sizeof(*pp)); |
1708 | if (!pp) | 1698 | if (!pp) |
1709 | goto reject_len; | 1699 | goto reject_len; |
@@ -1817,7 +1807,6 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata, | |||
1817 | struct fc_frame *rx_fp) | 1807 | struct fc_frame *rx_fp) |
1818 | { | 1808 | { |
1819 | struct fc_lport *lport = rdata->local_port; | 1809 | struct fc_lport *lport = rdata->local_port; |
1820 | struct fc_frame_header *fh; | ||
1821 | struct fc_exch *ep; | 1810 | struct fc_exch *ep; |
1822 | struct fc_frame *fp; | 1811 | struct fc_frame *fp; |
1823 | struct { | 1812 | struct { |
@@ -1832,12 +1821,11 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata, | |||
1832 | struct fc_seq_els_data rjt_data; | 1821 | struct fc_seq_els_data rjt_data; |
1833 | 1822 | ||
1834 | rjt_data.fp = NULL; | 1823 | rjt_data.fp = NULL; |
1835 | fh = fc_frame_header_get(rx_fp); | ||
1836 | 1824 | ||
1837 | FC_RPORT_DBG(rdata, "Received PRLO request while in state %s\n", | 1825 | FC_RPORT_DBG(rdata, "Received PRLO request while in state %s\n", |
1838 | fc_rport_state(rdata)); | 1826 | fc_rport_state(rdata)); |
1839 | 1827 | ||
1840 | len = fr_len(rx_fp) - sizeof(*fh); | 1828 | len = fr_len(rx_fp) - sizeof(struct fc_frame_header); |
1841 | pp = fc_frame_payload_get(rx_fp, sizeof(*pp)); | 1829 | pp = fc_frame_payload_get(rx_fp, sizeof(*pp)); |
1842 | if (!pp) | 1830 | if (!pp) |
1843 | goto reject_len; | 1831 | goto reject_len; |
@@ -1901,14 +1889,12 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, | |||
1901 | struct fc_seq *sp, | 1889 | struct fc_seq *sp, |
1902 | struct fc_frame *fp) | 1890 | struct fc_frame *fp) |
1903 | { | 1891 | { |
1904 | struct fc_frame_header *fh; | ||
1905 | struct fc_rport_priv *rdata; | 1892 | struct fc_rport_priv *rdata; |
1906 | u32 sid; | 1893 | u32 sid; |
1907 | 1894 | ||
1908 | lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); | 1895 | lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); |
1909 | 1896 | ||
1910 | fh = fc_frame_header_get(fp); | 1897 | sid = fc_frame_sid(fp); |
1911 | sid = ntoh24(fh->fh_s_id); | ||
1912 | 1898 | ||
1913 | mutex_lock(&lport->disc.disc_mutex); | 1899 | mutex_lock(&lport->disc.disc_mutex); |
1914 | rdata = lport->tt.rport_lookup(lport, sid); | 1900 | rdata = lport->tt.rport_lookup(lport, sid); |