aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_rport.c
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-07-20 18:21:12 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:06:02 -0400
commit922611569572d3c1aa0ed6491d21583fb3fcca22 (patch)
treef7cb42bf5519d1c42853808f2f784188afe1bc2e /drivers/scsi/libfc/fc_rport.c
parent239e81048b7dcd27448db40c845f88ac7c68424e (diff)
[SCSI] libfc: don't require a local exchange for incoming requests
Incoming requests shouldn't require a local exchange if we're just going to reply with one or two frames and don't expect anything further. Don't allocate exchanges for such requests until requested by the upper-layer protocol. The sequence is always NULL for new requests, so remove that as an argument to request handlers. Also change the first argument to lport->tt.seq_els_rsp_send from the sequence pointer to the received frame pointer, to supply the exchange IDs and destination ID info. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_rport.c')
-rw-r--r--drivers/scsi/libfc/fc_rport.c112
1 files changed, 39 insertions, 73 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 59879512321..25479cc7f17 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -68,14 +68,10 @@ static void fc_rport_enter_ready(struct fc_rport_priv *);
68static void fc_rport_enter_logo(struct fc_rport_priv *); 68static void fc_rport_enter_logo(struct fc_rport_priv *);
69static void fc_rport_enter_adisc(struct fc_rport_priv *); 69static void fc_rport_enter_adisc(struct fc_rport_priv *);
70 70
71static void fc_rport_recv_plogi_req(struct fc_lport *, 71static void fc_rport_recv_plogi_req(struct fc_lport *, struct fc_frame *);
72 struct fc_seq *, struct fc_frame *); 72static void fc_rport_recv_prli_req(struct fc_rport_priv *, struct fc_frame *);
73static void fc_rport_recv_prli_req(struct fc_rport_priv *, 73static void fc_rport_recv_prlo_req(struct fc_rport_priv *, struct fc_frame *);
74 struct fc_seq *, struct fc_frame *); 74static void fc_rport_recv_logo_req(struct fc_lport *, struct fc_frame *);
75static void fc_rport_recv_prlo_req(struct fc_rport_priv *,
76 struct fc_seq *, struct fc_frame *);
77static void fc_rport_recv_logo_req(struct fc_lport *,
78 struct fc_seq *, struct fc_frame *);
79static void fc_rport_timeout(struct work_struct *); 75static void fc_rport_timeout(struct work_struct *);
80static void fc_rport_error(struct fc_rport_priv *, struct fc_frame *); 76static void fc_rport_error(struct fc_rport_priv *, struct fc_frame *);
81static void fc_rport_error_retry(struct fc_rport_priv *, struct fc_frame *); 77static void fc_rport_error_retry(struct fc_rport_priv *, struct fc_frame *);
@@ -736,11 +732,10 @@ static void fc_rport_enter_flogi(struct fc_rport_priv *rdata)
736/** 732/**
737 * fc_rport_recv_flogi_req() - Handle Fabric Login (FLOGI) request in p-mp mode 733 * fc_rport_recv_flogi_req() - Handle Fabric Login (FLOGI) request in p-mp mode
738 * @lport: The local port that received the PLOGI request 734 * @lport: The local port that received the PLOGI request
739 * @sp: The sequence that the PLOGI request was on
740 * @rx_fp: The PLOGI request frame 735 * @rx_fp: The PLOGI request frame
741 */ 736 */
742static void fc_rport_recv_flogi_req(struct fc_lport *lport, 737static void fc_rport_recv_flogi_req(struct fc_lport *lport,
743 struct fc_seq *sp, struct fc_frame *rx_fp) 738 struct fc_frame *rx_fp)
744{ 739{
745 struct fc_disc *disc; 740 struct fc_disc *disc;
746 struct fc_els_flogi *flp; 741 struct fc_els_flogi *flp;
@@ -749,7 +744,6 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
749 struct fc_seq_els_data rjt_data; 744 struct fc_seq_els_data rjt_data;
750 u32 sid; 745 u32 sid;
751 746
752 rjt_data.fp = NULL;
753 sid = fc_frame_sid(fp); 747 sid = fc_frame_sid(fp);
754 748
755 FC_RPORT_ID_DBG(lport, sid, "Received FLOGI request\n"); 749 FC_RPORT_ID_DBG(lport, sid, "Received FLOGI request\n");
@@ -817,7 +811,6 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
817 if (!fp) 811 if (!fp)
818 goto out; 812 goto out;
819 813
820 sp = lport->tt.seq_start_next(sp);
821 fc_flogi_fill(lport, fp); 814 fc_flogi_fill(lport, fp);
822 flp = fc_frame_payload_get(fp, sizeof(*flp)); 815 flp = fc_frame_payload_get(fp, sizeof(*flp));
823 flp->fl_cmd = ELS_LS_ACC; 816 flp->fl_cmd = ELS_LS_ACC;
@@ -837,7 +830,7 @@ out:
837 830
838reject: 831reject:
839 mutex_unlock(&disc->disc_mutex); 832 mutex_unlock(&disc->disc_mutex);
840 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data); 833 lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
841 fc_frame_free(rx_fp); 834 fc_frame_free(rx_fp);
842} 835}
843 836
@@ -1296,13 +1289,12 @@ static void fc_rport_enter_adisc(struct fc_rport_priv *rdata)
1296/** 1289/**
1297 * fc_rport_recv_adisc_req() - Handler for Address Discovery (ADISC) requests 1290 * fc_rport_recv_adisc_req() - Handler for Address Discovery (ADISC) requests
1298 * @rdata: The remote port that sent the ADISC request 1291 * @rdata: The remote port that sent the ADISC request
1299 * @sp: The sequence the ADISC request was on
1300 * @in_fp: The ADISC request frame 1292 * @in_fp: The ADISC request frame
1301 * 1293 *
1302 * Locking Note: Called with the lport and rport locks held. 1294 * Locking Note: Called with the lport and rport locks held.
1303 */ 1295 */
1304static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata, 1296static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata,
1305 struct fc_seq *sp, struct fc_frame *in_fp) 1297 struct fc_frame *in_fp)
1306{ 1298{
1307 struct fc_lport *lport = rdata->local_port; 1299 struct fc_lport *lport = rdata->local_port;
1308 struct fc_frame *fp; 1300 struct fc_frame *fp;
@@ -1313,10 +1305,9 @@ static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata,
1313 1305
1314 adisc = fc_frame_payload_get(in_fp, sizeof(*adisc)); 1306 adisc = fc_frame_payload_get(in_fp, sizeof(*adisc));
1315 if (!adisc) { 1307 if (!adisc) {
1316 rjt_data.fp = NULL;
1317 rjt_data.reason = ELS_RJT_PROT; 1308 rjt_data.reason = ELS_RJT_PROT;
1318 rjt_data.explan = ELS_EXPL_INV_LEN; 1309 rjt_data.explan = ELS_EXPL_INV_LEN;
1319 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data); 1310 lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
1320 goto drop; 1311 goto drop;
1321 } 1312 }
1322 1313
@@ -1335,14 +1326,13 @@ drop:
1335/** 1326/**
1336 * fc_rport_recv_rls_req() - Handle received Read Link Status request 1327 * fc_rport_recv_rls_req() - Handle received Read Link Status request
1337 * @rdata: The remote port that sent the RLS request 1328 * @rdata: The remote port that sent the RLS request
1338 * @sp: The sequence that the RLS was on
1339 * @rx_fp: The PRLI request frame 1329 * @rx_fp: The PRLI request frame
1340 * 1330 *
1341 * Locking Note: The rport lock is expected to be held before calling 1331 * Locking Note: The rport lock is expected to be held before calling
1342 * this function. 1332 * this function.
1343 */ 1333 */
1344static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata, 1334static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata,
1345 struct fc_seq *sp, struct fc_frame *rx_fp) 1335 struct fc_frame *rx_fp)
1346 1336
1347{ 1337{
1348 struct fc_lport *lport = rdata->local_port; 1338 struct fc_lport *lport = rdata->local_port;
@@ -1393,8 +1383,7 @@ static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata,
1393 goto out; 1383 goto out;
1394 1384
1395out_rjt: 1385out_rjt:
1396 rjt_data.fp = NULL; 1386 lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
1397 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data);
1398out: 1387out:
1399 fc_frame_free(rx_fp); 1388 fc_frame_free(rx_fp);
1400} 1389}
@@ -1402,7 +1391,6 @@ out:
1402/** 1391/**
1403 * fc_rport_recv_els_req() - Handler for validated ELS requests 1392 * fc_rport_recv_els_req() - Handler for validated ELS requests
1404 * @lport: The local port that received the ELS request 1393 * @lport: The local port that received the ELS request
1405 * @sp: The sequence that the ELS request was on
1406 * @fp: The ELS request frame 1394 * @fp: The ELS request frame
1407 * 1395 *
1408 * Handle incoming ELS requests that require port login. 1396 * Handle incoming ELS requests that require port login.
@@ -1410,16 +1398,11 @@ out:
1410 * 1398 *
1411 * Locking Note: Called with the lport lock held. 1399 * Locking Note: Called with the lport lock held.
1412 */ 1400 */
1413static void fc_rport_recv_els_req(struct fc_lport *lport, 1401static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
1414 struct fc_seq *sp, struct fc_frame *fp)
1415{ 1402{
1416 struct fc_rport_priv *rdata; 1403 struct fc_rport_priv *rdata;
1417 struct fc_seq_els_data els_data; 1404 struct fc_seq_els_data els_data;
1418 1405
1419 els_data.fp = NULL;
1420 els_data.reason = ELS_RJT_UNAB;
1421 els_data.explan = ELS_EXPL_PLOGI_REQD;
1422
1423 mutex_lock(&lport->disc.disc_mutex); 1406 mutex_lock(&lport->disc.disc_mutex);
1424 rdata = lport->tt.rport_lookup(lport, fc_frame_sid(fp)); 1407 rdata = lport->tt.rport_lookup(lport, fc_frame_sid(fp));
1425 if (!rdata) { 1408 if (!rdata) {
@@ -1442,24 +1425,24 @@ static void fc_rport_recv_els_req(struct fc_lport *lport,
1442 1425
1443 switch (fc_frame_payload_op(fp)) { 1426 switch (fc_frame_payload_op(fp)) {
1444 case ELS_PRLI: 1427 case ELS_PRLI:
1445 fc_rport_recv_prli_req(rdata, sp, fp); 1428 fc_rport_recv_prli_req(rdata, fp);
1446 break; 1429 break;
1447 case ELS_PRLO: 1430 case ELS_PRLO:
1448 fc_rport_recv_prlo_req(rdata, sp, fp); 1431 fc_rport_recv_prlo_req(rdata, fp);
1449 break; 1432 break;
1450 case ELS_ADISC: 1433 case ELS_ADISC:
1451 fc_rport_recv_adisc_req(rdata, sp, fp); 1434 fc_rport_recv_adisc_req(rdata, fp);
1452 break; 1435 break;
1453 case ELS_RRQ: 1436 case ELS_RRQ:
1454 els_data.fp = fp; 1437 lport->tt.seq_els_rsp_send(fp, ELS_RRQ, NULL);
1455 lport->tt.seq_els_rsp_send(sp, ELS_RRQ, &els_data); 1438 fc_frame_free(fp);
1456 break; 1439 break;
1457 case ELS_REC: 1440 case ELS_REC:
1458 els_data.fp = fp; 1441 lport->tt.seq_els_rsp_send(fp, ELS_REC, NULL);
1459 lport->tt.seq_els_rsp_send(sp, ELS_REC, &els_data); 1442 fc_frame_free(fp);
1460 break; 1443 break;
1461 case ELS_RLS: 1444 case ELS_RLS:
1462 fc_rport_recv_rls_req(rdata, sp, fp); 1445 fc_rport_recv_rls_req(rdata, fp);
1463 break; 1446 break;
1464 default: 1447 default:
1465 fc_frame_free(fp); /* can't happen */ 1448 fc_frame_free(fp); /* can't happen */
@@ -1470,20 +1453,20 @@ static void fc_rport_recv_els_req(struct fc_lport *lport,
1470 return; 1453 return;
1471 1454
1472reject: 1455reject:
1473 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &els_data); 1456 els_data.reason = ELS_RJT_UNAB;
1457 els_data.explan = ELS_EXPL_PLOGI_REQD;
1458 lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
1474 fc_frame_free(fp); 1459 fc_frame_free(fp);
1475} 1460}
1476 1461
1477/** 1462/**
1478 * fc_rport_recv_req() - Handler for requests 1463 * fc_rport_recv_req() - Handler for requests
1479 * @sp: The sequence the request was on
1480 * @fp: The request frame
1481 * @lport: The local port that received the request 1464 * @lport: The local port that received the request
1465 * @fp: The request frame
1482 * 1466 *
1483 * Locking Note: Called with the lport lock held. 1467 * Locking Note: Called with the lport lock held.
1484 */ 1468 */
1485void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp, 1469void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
1486 struct fc_lport *lport)
1487{ 1470{
1488 struct fc_seq_els_data els_data; 1471 struct fc_seq_els_data els_data;
1489 1472
@@ -1495,13 +1478,13 @@ void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp,
1495 */ 1478 */
1496 switch (fc_frame_payload_op(fp)) { 1479 switch (fc_frame_payload_op(fp)) {
1497 case ELS_FLOGI: 1480 case ELS_FLOGI:
1498 fc_rport_recv_flogi_req(lport, sp, fp); 1481 fc_rport_recv_flogi_req(lport, fp);
1499 break; 1482 break;
1500 case ELS_PLOGI: 1483 case ELS_PLOGI:
1501 fc_rport_recv_plogi_req(lport, sp, fp); 1484 fc_rport_recv_plogi_req(lport, fp);
1502 break; 1485 break;
1503 case ELS_LOGO: 1486 case ELS_LOGO:
1504 fc_rport_recv_logo_req(lport, sp, fp); 1487 fc_rport_recv_logo_req(lport, fp);
1505 break; 1488 break;
1506 case ELS_PRLI: 1489 case ELS_PRLI:
1507 case ELS_PRLO: 1490 case ELS_PRLO:
@@ -1509,14 +1492,13 @@ void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp,
1509 case ELS_RRQ: 1492 case ELS_RRQ:
1510 case ELS_REC: 1493 case ELS_REC:
1511 case ELS_RLS: 1494 case ELS_RLS:
1512 fc_rport_recv_els_req(lport, sp, fp); 1495 fc_rport_recv_els_req(lport, fp);
1513 break; 1496 break;
1514 default: 1497 default:
1515 fc_frame_free(fp);
1516 els_data.fp = NULL;
1517 els_data.reason = ELS_RJT_UNSUP; 1498 els_data.reason = ELS_RJT_UNSUP;
1518 els_data.explan = ELS_EXPL_NONE; 1499 els_data.explan = ELS_EXPL_NONE;
1519 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &els_data); 1500 lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
1501 fc_frame_free(fp);
1520 break; 1502 break;
1521 } 1503 }
1522} 1504}
@@ -1524,13 +1506,12 @@ void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp,
1524/** 1506/**
1525 * fc_rport_recv_plogi_req() - Handler for Port Login (PLOGI) requests 1507 * fc_rport_recv_plogi_req() - Handler for Port Login (PLOGI) requests
1526 * @lport: The local port that received the PLOGI request 1508 * @lport: The local port that received the PLOGI request
1527 * @sp: The sequence that the PLOGI request was on
1528 * @rx_fp: The PLOGI request frame 1509 * @rx_fp: The PLOGI request frame
1529 * 1510 *
1530 * Locking Note: The rport lock is held before calling this function. 1511 * Locking Note: The rport lock is held before calling this function.
1531 */ 1512 */
1532static void fc_rport_recv_plogi_req(struct fc_lport *lport, 1513static void fc_rport_recv_plogi_req(struct fc_lport *lport,
1533 struct fc_seq *sp, struct fc_frame *rx_fp) 1514 struct fc_frame *rx_fp)
1534{ 1515{
1535 struct fc_disc *disc; 1516 struct fc_disc *disc;
1536 struct fc_rport_priv *rdata; 1517 struct fc_rport_priv *rdata;
@@ -1539,7 +1520,6 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
1539 struct fc_seq_els_data rjt_data; 1520 struct fc_seq_els_data rjt_data;
1540 u32 sid; 1521 u32 sid;
1541 1522
1542 rjt_data.fp = NULL;
1543 sid = fc_frame_sid(fp); 1523 sid = fc_frame_sid(fp);
1544 1524
1545 FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n"); 1525 FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n");
@@ -1635,21 +1615,20 @@ out:
1635 return; 1615 return;
1636 1616
1637reject: 1617reject:
1638 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data); 1618 lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
1639 fc_frame_free(fp); 1619 fc_frame_free(fp);
1640} 1620}
1641 1621
1642/** 1622/**
1643 * fc_rport_recv_prli_req() - Handler for process login (PRLI) requests 1623 * fc_rport_recv_prli_req() - Handler for process login (PRLI) requests
1644 * @rdata: The remote port that sent the PRLI request 1624 * @rdata: The remote port that sent the PRLI request
1645 * @sp: The sequence that the PRLI was on
1646 * @rx_fp: The PRLI request frame 1625 * @rx_fp: The PRLI request frame
1647 * 1626 *
1648 * Locking Note: The rport lock is exected to be held before calling 1627 * Locking Note: The rport lock is exected to be held before calling
1649 * this function. 1628 * this function.
1650 */ 1629 */
1651static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata, 1630static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
1652 struct fc_seq *sp, struct fc_frame *rx_fp) 1631 struct fc_frame *rx_fp)
1653{ 1632{
1654 struct fc_lport *lport = rdata->local_port; 1633 struct fc_lport *lport = rdata->local_port;
1655 struct fc_frame *fp; 1634 struct fc_frame *fp;
@@ -1666,7 +1645,6 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
1666 u32 fcp_parm; 1645 u32 fcp_parm;
1667 u32 roles = FC_RPORT_ROLE_UNKNOWN; 1646 u32 roles = FC_RPORT_ROLE_UNKNOWN;
1668 1647
1669 rjt_data.fp = NULL;
1670 FC_RPORT_DBG(rdata, "Received PRLI request while in state %s\n", 1648 FC_RPORT_DBG(rdata, "Received PRLI request while in state %s\n",
1671 fc_rport_state(rdata)); 1649 fc_rport_state(rdata));
1672 1650
@@ -1759,7 +1737,7 @@ reject_len:
1759 rjt_data.reason = ELS_RJT_PROT; 1737 rjt_data.reason = ELS_RJT_PROT;
1760 rjt_data.explan = ELS_EXPL_INV_LEN; 1738 rjt_data.explan = ELS_EXPL_INV_LEN;
1761reject: 1739reject:
1762 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data); 1740 lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
1763drop: 1741drop:
1764 fc_frame_free(rx_fp); 1742 fc_frame_free(rx_fp);
1765} 1743}
@@ -1767,18 +1745,15 @@ drop:
1767/** 1745/**
1768 * fc_rport_recv_prlo_req() - Handler for process logout (PRLO) requests 1746 * fc_rport_recv_prlo_req() - Handler for process logout (PRLO) requests
1769 * @rdata: The remote port that sent the PRLO request 1747 * @rdata: The remote port that sent the PRLO request
1770 * @sp: The sequence that the PRLO was on
1771 * @rx_fp: The PRLO request frame 1748 * @rx_fp: The PRLO request frame
1772 * 1749 *
1773 * Locking Note: The rport lock is exected to be held before calling 1750 * Locking Note: The rport lock is exected to be held before calling
1774 * this function. 1751 * this function.
1775 */ 1752 */
1776static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata, 1753static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
1777 struct fc_seq *sp,
1778 struct fc_frame *rx_fp) 1754 struct fc_frame *rx_fp)
1779{ 1755{
1780 struct fc_lport *lport = rdata->local_port; 1756 struct fc_lport *lport = rdata->local_port;
1781 struct fc_exch *ep;
1782 struct fc_frame *fp; 1757 struct fc_frame *fp;
1783 struct { 1758 struct {
1784 struct fc_els_prlo prlo; 1759 struct fc_els_prlo prlo;
@@ -1790,8 +1765,6 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
1790 unsigned int plen; 1765 unsigned int plen;
1791 struct fc_seq_els_data rjt_data; 1766 struct fc_seq_els_data rjt_data;
1792 1767
1793 rjt_data.fp = NULL;
1794
1795 FC_RPORT_DBG(rdata, "Received PRLO request while in state %s\n", 1768 FC_RPORT_DBG(rdata, "Received PRLO request while in state %s\n",
1796 fc_rport_state(rdata)); 1769 fc_rport_state(rdata));
1797 1770
@@ -1814,8 +1787,6 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
1814 goto reject; 1787 goto reject;
1815 } 1788 }
1816 1789
1817 sp = lport->tt.seq_start_next(sp);
1818 WARN_ON(!sp);
1819 pp = fc_frame_payload_get(fp, len); 1790 pp = fc_frame_payload_get(fp, len);
1820 WARN_ON(!pp); 1791 WARN_ON(!pp);
1821 memset(pp, 0, len); 1792 memset(pp, 0, len);
@@ -1829,17 +1800,15 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
1829 1800
1830 fc_rport_enter_delete(rdata, RPORT_EV_LOGO); 1801 fc_rport_enter_delete(rdata, RPORT_EV_LOGO);
1831 1802
1832 ep = fc_seq_exch(sp); 1803 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_ELS_REP, 0);
1833 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REP, ep->did, ep->sid, 1804 lport->tt.frame_send(lport, fp);
1834 FC_TYPE_ELS, FC_FCTL_RESP, 0);
1835 lport->tt.seq_send(lport, sp, fp);
1836 goto drop; 1805 goto drop;
1837 1806
1838reject_len: 1807reject_len:
1839 rjt_data.reason = ELS_RJT_PROT; 1808 rjt_data.reason = ELS_RJT_PROT;
1840 rjt_data.explan = ELS_EXPL_INV_LEN; 1809 rjt_data.explan = ELS_EXPL_INV_LEN;
1841reject: 1810reject:
1842 lport->tt.seq_els_rsp_send(sp, ELS_LS_RJT, &rjt_data); 1811 lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
1843drop: 1812drop:
1844 fc_frame_free(rx_fp); 1813 fc_frame_free(rx_fp);
1845} 1814}
@@ -1847,20 +1816,17 @@ drop:
1847/** 1816/**
1848 * fc_rport_recv_logo_req() - Handler for logout (LOGO) requests 1817 * fc_rport_recv_logo_req() - Handler for logout (LOGO) requests
1849 * @lport: The local port that received the LOGO request 1818 * @lport: The local port that received the LOGO request
1850 * @sp: The sequence that the LOGO request was on
1851 * @fp: The LOGO request frame 1819 * @fp: The LOGO request frame
1852 * 1820 *
1853 * Locking Note: The rport lock is exected to be held before calling 1821 * Locking Note: The rport lock is exected to be held before calling
1854 * this function. 1822 * this function.
1855 */ 1823 */
1856static void fc_rport_recv_logo_req(struct fc_lport *lport, 1824static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
1857 struct fc_seq *sp,
1858 struct fc_frame *fp)
1859{ 1825{
1860 struct fc_rport_priv *rdata; 1826 struct fc_rport_priv *rdata;
1861 u32 sid; 1827 u32 sid;
1862 1828
1863 lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); 1829 lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
1864 1830
1865 sid = fc_frame_sid(fp); 1831 sid = fc_frame_sid(fp);
1866 1832