mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Remove targ_enable()/targ_disable() frontend methods.
Those methods were never implemented, and I believe that their concept is wrong, since single frontend (SCSI port) can not handle several targets.
This commit is contained in:
parent
264f86e1ad
commit
2f5be87a14
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268265
@ -329,8 +329,6 @@ static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td);
|
||||
static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td);
|
||||
static void ctl_ioctl_online(void *arg);
|
||||
static void ctl_ioctl_offline(void *arg);
|
||||
static int ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id);
|
||||
static int ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id);
|
||||
static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id);
|
||||
static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id);
|
||||
static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio);
|
||||
@ -1093,8 +1091,6 @@ ctl_init(void)
|
||||
fe->port_online = ctl_ioctl_online;
|
||||
fe->port_offline = ctl_ioctl_offline;
|
||||
fe->onoff_arg = &softc->ioctl_info;
|
||||
fe->targ_enable = ctl_ioctl_targ_enable;
|
||||
fe->targ_disable = ctl_ioctl_targ_disable;
|
||||
fe->lun_enable = ctl_ioctl_lun_enable;
|
||||
fe->lun_disable = ctl_ioctl_lun_disable;
|
||||
fe->targ_lun_arg = &softc->ioctl_info;
|
||||
@ -1449,22 +1445,6 @@ ctl_add_initiator(uint64_t wwpn, int32_t targ_port, uint32_t iid)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX KDM should we pretend to do something in the target/lun
|
||||
* enable/disable functions?
|
||||
*/
|
||||
static int
|
||||
ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id)
|
||||
{
|
||||
@ -4310,24 +4290,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *ctl_lun,
|
||||
STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
|
||||
int retval;
|
||||
|
||||
/*
|
||||
* XXX KDM this only works for ONE TARGET ID. We'll need
|
||||
* to do things differently if we go to a multiple target
|
||||
* ID scheme.
|
||||
*/
|
||||
if ((fe->status & CTL_PORT_STATUS_TARG_ONLINE) == 0) {
|
||||
|
||||
retval = fe->targ_enable(fe->targ_lun_arg, target_id);
|
||||
if (retval != 0) {
|
||||
printf("ctl_alloc_lun: FETD %s port %d "
|
||||
"returned error %d for targ_enable on "
|
||||
"target %ju\n", fe->port_name,
|
||||
fe->targ_port, retval,
|
||||
(uintmax_t)target_id.id);
|
||||
} else
|
||||
fe->status |= CTL_PORT_STATUS_TARG_ONLINE;
|
||||
}
|
||||
|
||||
retval = fe->lun_enable(fe->targ_lun_arg, target_id,lun_number);
|
||||
if (retval != 0) {
|
||||
printf("ctl_alloc_lun: FETD %s port %d returned error "
|
||||
|
@ -105,30 +105,6 @@ typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len);
|
||||
* and port_offline(). This is specified by the
|
||||
* FETD.
|
||||
*
|
||||
* targ_enable(): This function is called, with targ_lun_arg and a
|
||||
* target ID as its arguments, by CTL when it wants
|
||||
* the FETD to enable a particular target. targ_enable()
|
||||
* will always be called for a particular target ID
|
||||
* before any LUN is enabled for that target. If the
|
||||
* FETD does not support enabling targets, but rather
|
||||
* LUNs, it should ignore this call and return 0. If
|
||||
* the FETD does support enabling targets, it should
|
||||
* return 0 for success and non-zero if it cannot
|
||||
* enable the given target.
|
||||
*
|
||||
* TODO: Add the ability to specify a WWID here.
|
||||
*
|
||||
* targ_disable(): This function is called, with targ_lun_arg and a
|
||||
* target ID as its arguments, by CTL when it wants
|
||||
* the FETD to disable a particular target.
|
||||
* targ_disable() will always be called for a
|
||||
* particular target ID after all LUNs are disabled
|
||||
* on that particular target. If the FETD does not
|
||||
* support enabling targets, it should ignore this
|
||||
* call and return 0. If the FETD does support
|
||||
* enabling targets, it should return 0 for success,
|
||||
* and non-zero if it cannot disable the given target.
|
||||
*
|
||||
* lun_enable(): This function is called, with targ_lun_arg, a target
|
||||
* ID and a LUN ID as its arguments, by CTL when it
|
||||
* wants the FETD to enable a particular LUN. If the
|
||||
@ -212,8 +188,6 @@ struct ctl_frontend {
|
||||
port_func_t port_online; /* passed to CTL */
|
||||
port_func_t port_offline; /* passed to CTL */
|
||||
void *onoff_arg; /* passed to CTL */
|
||||
targ_func_t targ_enable; /* passed to CTL */
|
||||
targ_func_t targ_disable; /* passed to CTL */
|
||||
lun_func_t lun_enable; /* passed to CTL */
|
||||
lun_func_t lun_disable; /* passed to CTL */
|
||||
fe_ioctl_t ioctl; /* passed to CTL */
|
||||
|
@ -101,8 +101,6 @@ void cfcs_shutdown(void);
|
||||
static void cfcs_poll(struct cam_sim *sim);
|
||||
static void cfcs_online(void *arg);
|
||||
static void cfcs_offline(void *arg);
|
||||
static int cfcs_targ_enable(void *arg, struct ctl_id targ_id);
|
||||
static int cfcs_targ_disable(void *arg, struct ctl_id targ_id);
|
||||
static int cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
|
||||
static int cfcs_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
|
||||
static void cfcs_datamove(union ctl_io *io);
|
||||
@ -163,8 +161,6 @@ cfcs_init(void)
|
||||
fe->port_online = cfcs_online;
|
||||
fe->port_offline = cfcs_offline;
|
||||
fe->onoff_arg = softc;
|
||||
fe->targ_enable = cfcs_targ_enable;
|
||||
fe->targ_disable = cfcs_targ_disable;
|
||||
fe->lun_enable = cfcs_lun_enable;
|
||||
fe->lun_disable = cfcs_lun_disable;
|
||||
fe->targ_lun_arg = softc;
|
||||
@ -335,18 +331,6 @@ cfcs_offline(void *arg)
|
||||
cfcs_onoffline(arg, /*online*/ 0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfcs_targ_enable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfcs_targ_disable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
|
||||
{
|
||||
|
@ -192,8 +192,6 @@ int cfi_init(void);
|
||||
void cfi_shutdown(void) __unused;
|
||||
static void cfi_online(void *arg);
|
||||
static void cfi_offline(void *arg);
|
||||
static int cfi_targ_enable(void *arg, struct ctl_id targ_id);
|
||||
static int cfi_targ_disable(void *arg, struct ctl_id targ_id);
|
||||
static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
|
||||
static int cfi_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
|
||||
static void cfi_datamove(union ctl_io *io);
|
||||
@ -261,8 +259,6 @@ cfi_init(void)
|
||||
fe->port_online = cfi_online;
|
||||
fe->port_offline = cfi_offline;
|
||||
fe->onoff_arg = softc;
|
||||
fe->targ_enable = cfi_targ_enable;
|
||||
fe->targ_disable = cfi_targ_disable;
|
||||
fe->lun_enable = cfi_lun_enable;
|
||||
fe->lun_disable = cfi_lun_disable;
|
||||
fe->targ_lun_arg = softc;
|
||||
@ -346,18 +342,6 @@ cfi_offline(void *arg)
|
||||
softc->flags &= ~CFI_ONLINE;
|
||||
}
|
||||
|
||||
static int
|
||||
cfi_targ_enable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfi_targ_disable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
|
||||
{
|
||||
|
@ -145,8 +145,6 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
|
||||
int cfiscsi_init(void);
|
||||
static void cfiscsi_online(void *arg);
|
||||
static void cfiscsi_offline(void *arg);
|
||||
static int cfiscsi_targ_enable(void *arg, struct ctl_id targ_id);
|
||||
static int cfiscsi_targ_disable(void *arg, struct ctl_id targ_id);
|
||||
static int cfiscsi_lun_enable(void *arg,
|
||||
struct ctl_id target_id, int lun_id);
|
||||
static int cfiscsi_lun_disable(void *arg,
|
||||
@ -1342,8 +1340,6 @@ cfiscsi_init(void)
|
||||
fe->port_online = cfiscsi_online;
|
||||
fe->port_offline = cfiscsi_offline;
|
||||
fe->onoff_arg = softc;
|
||||
fe->targ_enable = cfiscsi_targ_enable;
|
||||
fe->targ_disable = cfiscsi_targ_disable;
|
||||
fe->lun_enable = cfiscsi_lun_enable;
|
||||
fe->lun_disable = cfiscsi_lun_disable;
|
||||
fe->targ_lun_arg = softc;
|
||||
@ -1447,20 +1443,6 @@ cfiscsi_offline(void *arg)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
cfiscsi_targ_enable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
cfiscsi_targ_disable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
|
||||
{
|
||||
|
@ -211,8 +211,6 @@ static void ctlfedone(struct cam_periph *periph,
|
||||
static void ctlfe_onoffline(void *arg, int online);
|
||||
static void ctlfe_online(void *arg);
|
||||
static void ctlfe_offline(void *arg);
|
||||
static int ctlfe_targ_enable(void *arg, struct ctl_id targ_id);
|
||||
static int ctlfe_targ_disable(void *arg, struct ctl_id targ_id);
|
||||
static int ctlfe_lun_enable(void *arg, struct ctl_id targ_id,
|
||||
int lun_id);
|
||||
static int ctlfe_lun_disable(void *arg, struct ctl_id targ_id,
|
||||
@ -410,8 +408,6 @@ ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
|
||||
fe->port_online = ctlfe_online;
|
||||
fe->port_offline = ctlfe_offline;
|
||||
fe->onoff_arg = bus_softc;
|
||||
fe->targ_enable = ctlfe_targ_enable;
|
||||
fe->targ_disable = ctlfe_targ_disable;
|
||||
fe->lun_enable = ctlfe_lun_enable;
|
||||
fe->lun_disable = ctlfe_lun_disable;
|
||||
fe->targ_lun_arg = bus_softc;
|
||||
@ -1927,18 +1923,6 @@ ctlfe_offline(void *arg)
|
||||
xpt_free_path(path);
|
||||
}
|
||||
|
||||
static int
|
||||
ctlfe_targ_enable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctlfe_targ_disable(void *arg, struct ctl_id targ_id)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This will get called to enable a LUN on every bus that is attached to
|
||||
* CTL. So we only need to create a path/periph for this particular bus.
|
||||
|
Loading…
Reference in New Issue
Block a user