diff options
| author | Matt Jacob <mjacob@FreeBSD.org> | 2000-06-18 04:50:26 +0000 |
|---|---|---|
| committer | Matt Jacob <mjacob@FreeBSD.org> | 2000-06-18 04:50:26 +0000 |
| commit | 2ad50ca5f494e5664c767109159111954139c2d4 (patch) | |
| tree | 88017e10e3d23d740c0402f183bdee42cca99fd0 /sys/dev/isp | |
| parent | 2133e16f18d6a604ba2032d88bb2fcd5bf6f2c3d (diff) | |
Notes
Diffstat (limited to 'sys/dev/isp')
| -rw-r--r-- | sys/dev/isp/isp_freebsd.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d0094a01c090b..db5e64b718474 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -490,28 +490,17 @@ isp_en_lun(struct ispsoftc *isp, union ccb *ccb) * Do some sanity checking first. */ + if (lun < 0 || lun >= (lun_id_t) isp->isp_maxluns) { + ccb->ccb_h.status = CAM_LUN_INVALID; + return; + } if (IS_SCSI(isp)) { - if (lun < 0 || lun >= 32) { - ccb->ccb_h.status = CAM_LUN_INVALID; - return; - } if (tgt != CAM_TARGET_WILDCARD && tgt != ((sdparam *) isp->isp_param)->isp_initiator_id) { ccb->ccb_h.status = CAM_TID_INVALID; return; } } else { -#ifdef ISP2100_SCCLUN - if (lun < 0 || lun >= 65536) { - ccb->ccb_h.status = CAM_LUN_INVALID; - return; - } -#else - if (lun < 0 || lun >= 16) { - ccb->ccb_h.status = CAM_LUN_INVALID; - return; - } -#endif if (tgt != CAM_TARGET_WILDCARD && tgt != ((fcparam *) isp->isp_param)->isp_loopid) { ccb->ccb_h.status = CAM_TID_INVALID; @@ -709,9 +698,9 @@ isp_target_start_ctio(struct ispsoftc *isp, union ccb *ccb) cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2; cto->ct_header.rqs_entry_count = 1; cto->ct_iid = cso->init_id; -#ifndef ISP2100_SCCLUN - cto->ct_lun = ccb->ccb_h.target_lun; -#endif + if (isp->isp_maxluns <= 16) { + cto->ct_lun = ccb->ccb_h.target_lun; + } cto->ct_rxid = cso->tag_id; cto->ct_flags = CT2_CCINCR; if (cso->dxfer_len == 0) { @@ -950,11 +939,11 @@ isp_handle_platform_atio2(struct ispsoftc *isp, at2_entry_t *aep) return (0); } -#ifdef ISP2100_SCCLUN - lun = aep->at_scclun; -#else - lun = aep->at_lun; -#endif + if (isp->isp_maxluns > 16) { + lun = aep->at_scclun; + } else { + lun = aep->at_lun; + } tptr = get_lun_statep(isp, lun); if (tptr == NULL) { tptr = get_lun_statep(isp, CAM_LUN_WILDCARD); |
