fc_exch.c (bd072111e7319d90a7b8127f91c2806b9a6f279e) | fc_exch.c (a0cc1ecc098e31d03b3265712a3e280a7fabf438) |
---|---|
1/* 2 * Copyright(c) 2007 Intel Corporation. All rights reserved. 3 * Copyright(c) 2008 Red Hat, Inc. All rights reserved. 4 * Copyright(c) 2008 Mike Christie 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms and conditions of the GNU General Public License, 8 * version 2, as published by the Free Software Foundation. --- 401 unchanged lines hidden (view full) --- 410 411 spin_lock_bh(&ep->ex_lock); 412 if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE)) 413 goto unlock; 414 415 e_stat = ep->esb_stat; 416 if (e_stat & ESB_ST_COMPLETE) { 417 ep->esb_stat = e_stat & ~ESB_ST_REC_QUAL; | 1/* 2 * Copyright(c) 2007 Intel Corporation. All rights reserved. 3 * Copyright(c) 2008 Red Hat, Inc. All rights reserved. 4 * Copyright(c) 2008 Mike Christie 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms and conditions of the GNU General Public License, 8 * version 2, as published by the Free Software Foundation. --- 401 unchanged lines hidden (view full) --- 410 411 spin_lock_bh(&ep->ex_lock); 412 if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE)) 413 goto unlock; 414 415 e_stat = ep->esb_stat; 416 if (e_stat & ESB_ST_COMPLETE) { 417 ep->esb_stat = e_stat & ~ESB_ST_REC_QUAL; |
418 spin_unlock_bh(&ep->ex_lock); |
|
418 if (e_stat & ESB_ST_REC_QUAL) 419 fc_exch_rrq(ep); | 419 if (e_stat & ESB_ST_REC_QUAL) 420 fc_exch_rrq(ep); |
420 spin_unlock_bh(&ep->ex_lock); | |
421 goto done; 422 } else { 423 resp = ep->resp; 424 arg = ep->arg; 425 ep->resp = NULL; 426 if (e_stat & ESB_ST_ABNORMAL) 427 rc = fc_exch_done_locked(ep); 428 spin_unlock_bh(&ep->ex_lock); --- 1190 unchanged lines hidden (view full) --- 1619 * This tells the remote port to stop blocking the use of 1620 * the exchange and the seq_cnt range. 1621 */ 1622static void fc_exch_rrq(struct fc_exch *ep) 1623{ 1624 struct fc_lport *lp; 1625 struct fc_els_rrq *rrq; 1626 struct fc_frame *fp; | 421 goto done; 422 } else { 423 resp = ep->resp; 424 arg = ep->arg; 425 ep->resp = NULL; 426 if (e_stat & ESB_ST_ABNORMAL) 427 rc = fc_exch_done_locked(ep); 428 spin_unlock_bh(&ep->ex_lock); --- 1190 unchanged lines hidden (view full) --- 1619 * This tells the remote port to stop blocking the use of 1620 * the exchange and the seq_cnt range. 1621 */ 1622static void fc_exch_rrq(struct fc_exch *ep) 1623{ 1624 struct fc_lport *lp; 1625 struct fc_els_rrq *rrq; 1626 struct fc_frame *fp; |
1627 struct fc_seq *rrq_sp; | |
1628 u32 did; 1629 1630 lp = ep->lp; 1631 1632 fp = fc_frame_alloc(lp, sizeof(*rrq)); 1633 if (!fp) | 1627 u32 did; 1628 1629 lp = ep->lp; 1630 1631 fp = fc_frame_alloc(lp, sizeof(*rrq)); 1632 if (!fp) |
1634 return; | 1633 goto retry; 1634 |
1635 rrq = fc_frame_payload_get(fp, sizeof(*rrq)); 1636 memset(rrq, 0, sizeof(*rrq)); 1637 rrq->rrq_cmd = ELS_RRQ; 1638 hton24(rrq->rrq_s_id, ep->sid); 1639 rrq->rrq_ox_id = htons(ep->oxid); 1640 rrq->rrq_rx_id = htons(ep->rxid); 1641 1642 did = ep->did; 1643 if (ep->esb_stat & ESB_ST_RESP) 1644 did = ep->sid; 1645 1646 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, did, 1647 fc_host_port_id(lp->host), FC_TYPE_ELS, 1648 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1649 | 1635 rrq = fc_frame_payload_get(fp, sizeof(*rrq)); 1636 memset(rrq, 0, sizeof(*rrq)); 1637 rrq->rrq_cmd = ELS_RRQ; 1638 hton24(rrq->rrq_s_id, ep->sid); 1639 rrq->rrq_ox_id = htons(ep->oxid); 1640 rrq->rrq_rx_id = htons(ep->rxid); 1641 1642 did = ep->did; 1643 if (ep->esb_stat & ESB_ST_RESP) 1644 did = ep->sid; 1645 1646 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, did, 1647 fc_host_port_id(lp->host), FC_TYPE_ELS, 1648 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1649 |
1650 rrq_sp = fc_exch_seq_send(lp, fp, fc_exch_rrq_resp, NULL, ep, 1651 lp->e_d_tov); 1652 if (!rrq_sp) { 1653 ep->esb_stat |= ESB_ST_REC_QUAL; 1654 fc_exch_timer_set_locked(ep, ep->r_a_tov); | 1650 if (fc_exch_seq_send(lp, fp, fc_exch_rrq_resp, NULL, ep, lp->e_d_tov)) |
1655 return; | 1651 return; |
1652 1653retry: 1654 spin_lock_bh(&ep->ex_lock); 1655 if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE)) { 1656 spin_unlock_bh(&ep->ex_lock); 1657 /* drop hold for rec qual */ 1658 fc_exch_release(ep); 1659 return; |
|
1656 } | 1660 } |
1661 ep->esb_stat |= ESB_ST_REC_QUAL; 1662 fc_exch_timer_set_locked(ep, ep->r_a_tov); 1663 spin_unlock_bh(&ep->ex_lock); |
|
1657} 1658 1659 1660/* 1661 * Handle incoming ELS RRQ - Reset Recovery Qualifier. 1662 */ 1663static void fc_exch_els_rrq(struct fc_seq *sp, struct fc_frame *fp) 1664{ --- 290 unchanged lines hidden --- | 1664} 1665 1666 1667/* 1668 * Handle incoming ELS RRQ - Reset Recovery Qualifier. 1669 */ 1670static void fc_exch_els_rrq(struct fc_seq *sp, struct fc_frame *fp) 1671{ --- 290 unchanged lines hidden --- |