Move RQSTYPE_ABTS_RCVD parsing into generic code.
MFC after: 2 weeks
This commit is contained in:
parent
15c62456d1
commit
981ffc4e21
@ -2601,18 +2601,19 @@ isp_handle_platform_target_tmf(ispsoftc_t *isp, isp_notify_t *notify)
|
|||||||
fcportdb_t *lp;
|
fcportdb_t *lp;
|
||||||
struct ccb_immediate_notify *inot;
|
struct ccb_immediate_notify *inot;
|
||||||
inot_private_data_t *ntp = NULL;
|
inot_private_data_t *ntp = NULL;
|
||||||
|
atio_private_data_t *atp;
|
||||||
lun_id_t lun;
|
lun_id_t lun;
|
||||||
|
|
||||||
isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode,
|
isp_prt(isp, ISP_LOGTDEBUG0, "%s: code 0x%x sid 0x%x tagval 0x%016llx chan %d lun %jx", __func__, notify->nt_ncode,
|
||||||
notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun);
|
notify->nt_sid, (unsigned long long) notify->nt_tagval, notify->nt_channel, notify->nt_lun);
|
||||||
/*
|
|
||||||
* NB: This assignment is necessary because of tricky type conversion.
|
|
||||||
* XXX: This is tricky and I need to check this. If the lun isn't known
|
|
||||||
* XXX: for the task management function, it does not of necessity follow
|
|
||||||
* XXX: that it should go up stream to the wildcard listener.
|
|
||||||
*/
|
|
||||||
if (notify->nt_lun == LUN_ANY) {
|
if (notify->nt_lun == LUN_ANY) {
|
||||||
lun = CAM_LUN_WILDCARD;
|
if (notify->nt_tagval == TAG_ANY) {
|
||||||
|
lun = CAM_LUN_WILDCARD;
|
||||||
|
} else {
|
||||||
|
atp = isp_find_atpd(isp, notify->nt_channel,
|
||||||
|
notify->nt_tagval & 0xffffffff);
|
||||||
|
lun = atp ? atp->lun : CAM_LUN_WILDCARD;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
lun = notify->nt_lun;
|
lun = notify->nt_lun;
|
||||||
}
|
}
|
||||||
@ -4176,55 +4177,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...)
|
|||||||
case RQSTYPE_CTIO:
|
case RQSTYPE_CTIO:
|
||||||
isp_handle_platform_ctio(isp, hp);
|
isp_handle_platform_ctio(isp, hp);
|
||||||
break;
|
break;
|
||||||
case RQSTYPE_ABTS_RCVD:
|
|
||||||
{
|
|
||||||
abts_t *abts = (abts_t *)hp;
|
|
||||||
isp_notify_t notify, *nt = ¬ify;
|
|
||||||
atio_private_data_t *atp;
|
|
||||||
fcportdb_t *lp;
|
|
||||||
uint16_t chan;
|
|
||||||
uint32_t sid, did;
|
|
||||||
|
|
||||||
did = (abts->abts_did_hi << 16) | abts->abts_did_lo;
|
|
||||||
sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo;
|
|
||||||
ISP_MEMZERO(nt, sizeof (isp_notify_t));
|
|
||||||
|
|
||||||
nt->nt_hba = isp;
|
|
||||||
nt->nt_did = did;
|
|
||||||
nt->nt_nphdl = abts->abts_nphdl;
|
|
||||||
nt->nt_sid = sid;
|
|
||||||
isp_find_chan_by_did(isp, did, &chan);
|
|
||||||
if (chan == ISP_NOCHAN) {
|
|
||||||
nt->nt_tgt = TGT_ANY;
|
|
||||||
} else {
|
|
||||||
nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn;
|
|
||||||
if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) {
|
|
||||||
nt->nt_wwn = lp->port_wwn;
|
|
||||||
} else {
|
|
||||||
nt->nt_wwn = INI_ANY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Try hard to find the lun for this command.
|
|
||||||
*/
|
|
||||||
atp = isp_find_atpd(isp, chan, abts->abts_rxid_task);
|
|
||||||
nt->nt_lun = atp ? atp->lun : LUN_ANY;
|
|
||||||
nt->nt_need_ack = 1;
|
|
||||||
nt->nt_tagval = abts->abts_rxid_task;
|
|
||||||
nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32);
|
|
||||||
if (abts->abts_rxid_task == ISP24XX_NO_TASK) {
|
|
||||||
isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x has no task id (rx_id 0x%04x ox_id 0x%04x)",
|
|
||||||
abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rx_id, abts->abts_ox_id);
|
|
||||||
} else {
|
|
||||||
isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)",
|
|
||||||
abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task, abts->abts_rx_id, abts->abts_ox_id);
|
|
||||||
}
|
|
||||||
nt->nt_channel = chan;
|
|
||||||
nt->nt_ncode = NT_ABORT_TASK;
|
|
||||||
nt->nt_lreserved = hp;
|
|
||||||
isp_handle_platform_target_tmf(isp, nt);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ static const char rqo[] = "%s: Request Queue Overflow";
|
|||||||
|
|
||||||
static void isp_got_msg_fc(ispsoftc_t *, in_fcentry_t *);
|
static void isp_got_msg_fc(ispsoftc_t *, in_fcentry_t *);
|
||||||
static void isp_got_tmf_24xx(ispsoftc_t *, at7_entry_t *);
|
static void isp_got_tmf_24xx(ispsoftc_t *, at7_entry_t *);
|
||||||
|
static void isp_handle_abts(ispsoftc_t *, abts_t *);
|
||||||
static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *);
|
static void isp_handle_atio2(ispsoftc_t *, at2_entry_t *);
|
||||||
static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *);
|
static void isp_handle_ctio2(ispsoftc_t *, ct2_entry_t *);
|
||||||
static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *);
|
static void isp_handle_ctio7(ispsoftc_t *, ct7_entry_t *);
|
||||||
@ -361,7 +362,7 @@ isp_target_notify(ispsoftc_t *isp, void *vptr, uint32_t *optrp)
|
|||||||
|
|
||||||
case RQSTYPE_ABTS_RCVD:
|
case RQSTYPE_ABTS_RCVD:
|
||||||
isp_get_abts(isp, abts, (abts_t *)local);
|
isp_get_abts(isp, abts, (abts_t *)local);
|
||||||
isp_async(isp, ISPASYNC_TARGET_ACTION, &local);
|
isp_handle_abts(isp, (abts_t *)local);
|
||||||
break;
|
break;
|
||||||
case RQSTYPE_ABTS_RSP:
|
case RQSTYPE_ABTS_RSP:
|
||||||
isp_get_abts_rsp(isp, abts_rsp, (abts_rsp_t *)local);
|
isp_get_abts_rsp(isp, abts_rsp, (abts_rsp_t *)local);
|
||||||
@ -978,6 +979,47 @@ isp_acknak_abts(ispsoftc_t *isp, void *arg, int errno)
|
|||||||
return (isp_target_put_entry(isp, rsp));
|
return (isp_target_put_entry(isp, rsp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
isp_handle_abts(ispsoftc_t *isp, abts_t *abts)
|
||||||
|
{
|
||||||
|
isp_notify_t notify, *nt = ¬ify;
|
||||||
|
fcportdb_t *lp;
|
||||||
|
uint16_t chan;
|
||||||
|
uint32_t sid, did;
|
||||||
|
|
||||||
|
did = (abts->abts_did_hi << 16) | abts->abts_did_lo;
|
||||||
|
sid = (abts->abts_sid_hi << 16) | abts->abts_sid_lo;
|
||||||
|
ISP_MEMZERO(nt, sizeof (isp_notify_t));
|
||||||
|
|
||||||
|
nt->nt_hba = isp;
|
||||||
|
nt->nt_did = did;
|
||||||
|
nt->nt_nphdl = abts->abts_nphdl;
|
||||||
|
nt->nt_sid = sid;
|
||||||
|
isp_find_chan_by_did(isp, did, &chan);
|
||||||
|
if (chan == ISP_NOCHAN) {
|
||||||
|
nt->nt_tgt = TGT_ANY;
|
||||||
|
} else {
|
||||||
|
nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn;
|
||||||
|
if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) {
|
||||||
|
nt->nt_wwn = lp->port_wwn;
|
||||||
|
} else {
|
||||||
|
nt->nt_wwn = INI_ANY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nt->nt_lun = LUN_ANY;
|
||||||
|
nt->nt_need_ack = 1;
|
||||||
|
nt->nt_tagval = abts->abts_rxid_task;
|
||||||
|
nt->nt_tagval |= (((uint64_t) abts->abts_rxid_abts) << 32);
|
||||||
|
isp_prt(isp, ISP_LOGTINFO, "[0x%x] ABTS from N-Port handle 0x%x"
|
||||||
|
" Port 0x%06x for task 0x%x (rx_id 0x%04x ox_id 0x%04x)",
|
||||||
|
abts->abts_rxid_abts, abts->abts_nphdl, sid, abts->abts_rxid_task,
|
||||||
|
abts->abts_rx_id, abts->abts_ox_id);
|
||||||
|
nt->nt_channel = chan;
|
||||||
|
nt->nt_ncode = NT_ABORT_TASK;
|
||||||
|
nt->nt_lreserved = abts;
|
||||||
|
isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep)
|
isp_handle_atio2(ispsoftc_t *isp, at2_entry_t *aep)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user