FreeBSD/sys/cam/ctl/ctl.c
/*
 * Remove an initiator by port number and initiator ID.
 * Returns 0 for success, -1 for failure.
 */
Remove an initiator by port number and initiator ID.
Returns 0 for success, -1 for failure.
Remove an initiator by port number and initiator ID . Returns 0 for success - 1 for failure .
int
ctl_remove_initiator(struct ctl_port *port, int iid)
{
	struct ctl_softc *softc = port->ctl_softc;
	mtx_assert(&softc->ctl_lock, MA_NOTOWNED);
	if (iid > CTL_MAX_INIT_PER_PORT) {
		printf("%s: initiator ID %u > maximun %u!\n",
		       __func__, iid, CTL_MAX_INIT_PER_PORT);
		return (-1);
	}
	mtx_lock(&softc->ctl_lock);
	port->wwpn_iid[iid].in_use--;
	port->wwpn_iid[iid].last_use = time_uptime;
	mtx_unlock(&softc->ctl_lock);
	ctl_isc_announce_iid(port, iid);
	return (0);
}
int ctl_remove_initiator ( struct ctl_port * port , int iid ) { struct ctl_softc * softc = port -> ctl_softc ; mtx_assert ( & softc -> ctl_lock , MA_NOTOWNED ) ; if ( iid > CTL_MAX_INIT_PER_PORT ) { printf ( " \n " , __func__ , iid , CTL_MAX_INIT_PER_PORT ) ; return ( -1 ) ; } mtx_lock ( & softc -> ctl_lock ) ; port -> wwpn_iid [ iid ] . in_use -- ; port -> wwpn_iid [ iid ] . last_use = time_uptime ; mtx_unlock ( & softc -> ctl_lock ) ; ctl_isc_announce_iid ( port , iid ) ; return ( 0 ) ; }
Remove an initiator by port number and initiator ID.
Remove an initiator by port number and initiator ID .