/*-1* Ioctl definitions for the SCSI Target Driver2*3* SPDX-License-Identifier: BSD-2-Clause4*5* Copyright (c) 2002 Nate Lawson.6* Copyright (c) 1998 Justin T. Gibbs.7* All rights reserved.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions, and the following disclaimer,14* without modification, immediately at the beginning of the file.15* 2. The name of the author may not be used to endorse or promote products16* derived from this software without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR22* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031#ifndef _CAM_SCSI_SCSI_TARGETIO_H_32#define _CAM_SCSI_SCSI_TARGETIO_H_33#ifndef _KERNEL34#include <sys/types.h>35#endif36#include <sys/ioccom.h>3738#include <cam/cam.h>39#include <cam/cam_ccb.h>4041/*42* CCBs (ATIO, CTIO, INOT, REL_SIMQ) are sent to the kernel driver43* by writing one or more pointers. The user receives notification44* of CCB completion through poll/select/kqueue and then calls45* read(2) which outputs pointers to the completed CCBs.46*/4748/*49* Enable and disable a target mode instance. For enabling, the path_id,50* target_id, and lun_id fields must be set. The grp6/7_len fields51* specify the length of vendor-specific CDBs the target expects and52* should normally be set to 0. On successful completion53* of enable, the specified target instance will answer selection.54* Disable causes the target instance to abort any outstanding commands55* and stop accepting new ones. The aborted CCBs will be returned to56* the user via read(2) or discarded if the user closes the device.57* The user can then re-enable the device for a new path.58*/59struct ioc_enable_lun {60path_id_t path_id;61target_id_t target_id;62lun_id_t lun_id;63int grp6_len;64int grp7_len;65};66#define TARGIOCENABLE _IOW('C', 5, struct ioc_enable_lun)67#define TARGIOCDISABLE _IO('C', 6)6869/*70* Set/clear debugging for this target mode instance71*/72#define TARGIOCDEBUG _IOW('C', 7, int)7374TAILQ_HEAD(ccb_queue, ccb_hdr);7576#endif /* _CAM_SCSI_SCSI_TARGETIO_H_ */777879