ciss: hw.ciss.initator_id to set the initiator ID

Add hw.ciss.inititor_id to set the initiator to something other than the
default.

PR: 246279
Reviewed by: imp
Tested by: Marek Zarychta
Differential Revision: https://reviews.freebsd.org/D25155
This commit is contained in:
Peter Eriksson 2024-10-13 22:01:33 -06:00 committed by Warner Losh
parent 45645518ea
commit fd95966af5

View File

@ -245,7 +245,15 @@ static struct cdevsw ciss_cdevsw = {
SYSCTL_NODE(_hw, OID_AUTO, ciss, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CISS sysctl tunables");
/*
* This tunable can be used to force a specific value for transfer speed.
* This tunable can be used to force a specific initiator id
*/
static int ciss_initiator_id = CAM_TARGET_WILDCARD;
SYSCTL_INT(_hw_ciss, OID_AUTO, initiator_id, CTLFLAG_RDTUN,
&ciss_initiator_id, 0,
"force a specific initiator id");
/*
* This tunable can be used to force a specific initiator id
*/
static int ciss_base_transfer_speed = 132 * 1024;
SYSCTL_INT(_hw_ciss, OID_AUTO, base_transfer_speed, CTLFLAG_RDTUN,
@ -3073,7 +3081,10 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb)
cpi->hba_misc = 0;
cpi->max_target = MAX(sc->ciss_max_physical_target, sc->ciss_cfg->max_logical_supported);
cpi->max_lun = 0; /* 'logical drive' channel only */
cpi->initiator_id = sc->ciss_cfg->max_logical_supported;
if (ciss_initiator_id != CAM_TARGET_WILDCARD)
cpi->initiator_id = ciss_initiator_id;
else
cpi->initiator_id = sc->ciss_cfg->max_logical_supported;
strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strlcpy(cpi->hba_vid, "CISS", HBA_IDLEN);
strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);