1 1.73 msaitoh /* $NetBSD: scsipi_ioctl.c,v 1.73 2019/12/27 09:41:51 msaitoh Exp $ */ 2 1.7 cgd 3 1.33 mycroft /*- 4 1.49 mycroft * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. 5 1.33 mycroft * All rights reserved. 6 1.33 mycroft * 7 1.33 mycroft * This code is derived from software contributed to The NetBSD Foundation 8 1.33 mycroft * by Charles M. Hannum. 9 1.4 mycroft * 10 1.4 mycroft * Redistribution and use in source and binary forms, with or without 11 1.4 mycroft * modification, are permitted provided that the following conditions 12 1.4 mycroft * are met: 13 1.4 mycroft * 1. Redistributions of source code must retain the above copyright 14 1.4 mycroft * notice, this list of conditions and the following disclaimer. 15 1.4 mycroft * 2. Redistributions in binary form must reproduce the above copyright 16 1.4 mycroft * notice, this list of conditions and the following disclaimer in the 17 1.4 mycroft * documentation and/or other materials provided with the distribution. 18 1.4 mycroft * 19 1.33 mycroft * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.33 mycroft * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.33 mycroft * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.33 mycroft * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.33 mycroft * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.33 mycroft * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.33 mycroft * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.33 mycroft * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.33 mycroft * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.33 mycroft * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.33 mycroft * POSSIBILITY OF SUCH DAMAGE. 30 1.4 mycroft */ 31 1.4 mycroft 32 1.27 enami /* 33 1.1 mycroft * Contributed by HD Associates (hd (at) world.std.com). 34 1.1 mycroft * Copyright (c) 1992, 1993 HD Associates 35 1.1 mycroft * 36 1.27 enami * Berkeley style copyright. 37 1.1 mycroft */ 38 1.41 lukem 39 1.41 lukem #include <sys/cdefs.h> 40 1.73 msaitoh __KERNEL_RCSID(0, "$NetBSD: scsipi_ioctl.c,v 1.73 2019/12/27 09:41:51 msaitoh Exp $"); 41 1.30 thorpej 42 1.68 pooka #ifdef _KERNEL_OPT 43 1.30 thorpej #include "opt_compat_freebsd.h" 44 1.31 jonathan #include "opt_compat_netbsd.h" 45 1.68 pooka #endif 46 1.2 mycroft 47 1.42 lukem #include <sys/param.h> 48 1.1 mycroft #include <sys/errno.h> 49 1.19 thorpej #include <sys/systm.h> 50 1.1 mycroft #include <sys/malloc.h> 51 1.1 mycroft #include <sys/buf.h> 52 1.1 mycroft #include <sys/proc.h> 53 1.1 mycroft #include <sys/device.h> 54 1.21 thorpej #include <sys/fcntl.h> 55 1.1 mycroft 56 1.25 bouyer #include <dev/scsipi/scsipi_all.h> 57 1.25 bouyer #include <dev/scsipi/scsipiconf.h> 58 1.38 bouyer #include <dev/scsipi/scsipi_base.h> 59 1.25 bouyer #include <dev/scsipi/scsiconf.h> 60 1.1 mycroft #include <sys/scsiio.h> 61 1.27 enami 62 1.25 bouyer #include "scsibus.h" 63 1.25 bouyer #include "atapibus.h" 64 1.1 mycroft 65 1.4 mycroft struct scsi_ioctl { 66 1.11 mycroft LIST_ENTRY(scsi_ioctl) si_list; 67 1.11 mycroft struct buf si_bp; 68 1.11 mycroft struct uio si_uio; 69 1.11 mycroft struct iovec si_iov; 70 1.9 mycroft scsireq_t si_screq; 71 1.38 bouyer struct scsipi_periph *si_periph; 72 1.11 mycroft }; 73 1.11 mycroft 74 1.47 thorpej static LIST_HEAD(, scsi_ioctl) si_head; 75 1.69 mlelstv static kmutex_t si_lock; 76 1.69 mlelstv 77 1.69 mlelstv void 78 1.69 mlelstv scsipi_ioctl_init(void) 79 1.69 mlelstv { 80 1.69 mlelstv 81 1.69 mlelstv mutex_init(&si_lock, MUTEX_DEFAULT, IPL_BIO); 82 1.69 mlelstv } 83 1.20 christos 84 1.47 thorpej static struct scsi_ioctl * 85 1.47 thorpej si_get(void) 86 1.4 mycroft { 87 1.4 mycroft struct scsi_ioctl *si; 88 1.4 mycroft 89 1.43 tsutsui si = malloc(sizeof(struct scsi_ioctl), M_TEMP, M_WAITOK|M_ZERO); 90 1.64 ad buf_init(&si->si_bp); 91 1.69 mlelstv mutex_enter(&si_lock); 92 1.11 mycroft LIST_INSERT_HEAD(&si_head, si, si_list); 93 1.69 mlelstv mutex_exit(&si_lock); 94 1.11 mycroft return (si); 95 1.4 mycroft } 96 1.4 mycroft 97 1.47 thorpej static void 98 1.47 thorpej si_free(struct scsi_ioctl *si) 99 1.4 mycroft { 100 1.4 mycroft 101 1.69 mlelstv mutex_enter(&si_lock); 102 1.11 mycroft LIST_REMOVE(si, si_list); 103 1.69 mlelstv mutex_exit(&si_lock); 104 1.64 ad buf_destroy(&si->si_bp); 105 1.11 mycroft free(si, M_TEMP); 106 1.4 mycroft } 107 1.4 mycroft 108 1.47 thorpej static struct scsi_ioctl * 109 1.47 thorpej si_find(struct buf *bp) 110 1.4 mycroft { 111 1.4 mycroft struct scsi_ioctl *si; 112 1.4 mycroft 113 1.69 mlelstv mutex_enter(&si_lock); 114 1.11 mycroft for (si = si_head.lh_first; si != 0; si = si->si_list.le_next) 115 1.11 mycroft if (bp == &si->si_bp) 116 1.11 mycroft break; 117 1.69 mlelstv mutex_exit(&si_lock); 118 1.11 mycroft return (si); 119 1.4 mycroft } 120 1.1 mycroft 121 1.1 mycroft /* 122 1.1 mycroft * We let the user interpret his own sense in the generic scsi world. 123 1.37 thorpej * This routine is called at interrupt time if the XS_CTL_USERCMD bit was set 124 1.25 bouyer * in the flags passed to scsi_scsipi_cmd(). No other completion processing 125 1.1 mycroft * takes place, even if we are running over another device driver. 126 1.1 mycroft * The lower level routines that call us here, will free the xs and restart 127 1.1 mycroft * the device's queue if such exists. 128 1.1 mycroft */ 129 1.2 mycroft void 130 1.47 thorpej scsipi_user_done(struct scsipi_xfer *xs) 131 1.1 mycroft { 132 1.2 mycroft struct buf *bp; 133 1.13 mycroft struct scsi_ioctl *si; 134 1.1 mycroft scsireq_t *screq; 135 1.38 bouyer struct scsipi_periph *periph = xs->xs_periph; 136 1.1 mycroft 137 1.1 mycroft bp = xs->bp; 138 1.38 bouyer #ifdef DIAGNOSTIC 139 1.38 bouyer if (bp == NULL) { 140 1.38 bouyer scsipi_printaddr(periph); 141 1.38 bouyer printf("user command with no buf\n"); 142 1.38 bouyer panic("scsipi_user_done"); 143 1.1 mycroft } 144 1.38 bouyer #endif 145 1.4 mycroft si = si_find(bp); 146 1.38 bouyer #ifdef DIAGNOSTIC 147 1.27 enami if (si == NULL) { 148 1.38 bouyer scsipi_printaddr(periph); 149 1.38 bouyer printf("user command with no ioctl\n"); 150 1.38 bouyer panic("scsipi_user_done"); 151 1.4 mycroft } 152 1.38 bouyer #endif 153 1.38 bouyer 154 1.9 mycroft screq = &si->si_screq; 155 1.38 bouyer 156 1.38 bouyer SC_DEBUG(xs->xs_periph, SCSIPI_DB2, ("user-done\n")); 157 1.1 mycroft 158 1.1 mycroft screq->retsts = 0; 159 1.1 mycroft screq->status = xs->status; 160 1.9 mycroft switch (xs->error) { 161 1.2 mycroft case XS_NOERROR: 162 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("no error\n")); 163 1.27 enami screq->datalen_used = 164 1.27 enami xs->datalen - xs->resid; /* probably rubbish */ 165 1.1 mycroft screq->retsts = SCCMD_OK; 166 1.1 mycroft break; 167 1.2 mycroft case XS_SENSE: 168 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("have sense\n")); 169 1.70 riastrad screq->senselen_used = uimin(sizeof(xs->sense.scsi_sense), 170 1.27 enami SENSEBUFLEN); 171 1.72 mlelstv memcpy(screq->sense, &xs->sense.scsi_sense, 172 1.72 mlelstv screq->senselen_used); 173 1.1 mycroft screq->retsts = SCCMD_SENSE; 174 1.35 bouyer break; 175 1.35 bouyer case XS_SHORTSENSE: 176 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("have short sense\n")); 177 1.70 riastrad screq->senselen_used = uimin(sizeof(xs->sense.atapi_sense), 178 1.35 bouyer SENSEBUFLEN); 179 1.72 mlelstv memcpy(screq->sense, &xs->sense.atapi_sense, 180 1.72 mlelstv screq->senselen_used); 181 1.35 bouyer screq->retsts = SCCMD_UNKNOWN; /* XXX need a shortsense here */ 182 1.1 mycroft break; 183 1.2 mycroft case XS_DRIVER_STUFFUP: 184 1.38 bouyer scsipi_printaddr(periph); 185 1.38 bouyer printf("passthrough: adapter inconsistency\n"); 186 1.1 mycroft screq->retsts = SCCMD_UNKNOWN; 187 1.1 mycroft break; 188 1.36 thorpej case XS_SELTIMEOUT: 189 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("seltimeout\n")); 190 1.36 thorpej screq->retsts = SCCMD_TIMEOUT; 191 1.36 thorpej break; 192 1.2 mycroft case XS_TIMEOUT: 193 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("timeout\n")); 194 1.1 mycroft screq->retsts = SCCMD_TIMEOUT; 195 1.1 mycroft break; 196 1.2 mycroft case XS_BUSY: 197 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("busy\n")); 198 1.1 mycroft screq->retsts = SCCMD_BUSY; 199 1.1 mycroft break; 200 1.1 mycroft default: 201 1.38 bouyer scsipi_printaddr(periph); 202 1.38 bouyer printf("unknown error category %d from adapter\n", 203 1.36 thorpej xs->error); 204 1.1 mycroft screq->retsts = SCCMD_UNKNOWN; 205 1.1 mycroft break; 206 1.1 mycroft } 207 1.38 bouyer 208 1.38 bouyer if (xs->xs_control & XS_CTL_ASYNC) { 209 1.69 mlelstv mutex_enter(chan_mtx(periph->periph_channel)); 210 1.38 bouyer scsipi_put_xs(xs); 211 1.69 mlelstv mutex_exit(chan_mtx(periph->periph_channel)); 212 1.38 bouyer } 213 1.1 mycroft } 214 1.1 mycroft 215 1.1 mycroft 216 1.1 mycroft /* Pseudo strategy function 217 1.25 bouyer * Called by scsipi_do_ioctl() via physio/physstrat if there is to 218 1.73 msaitoh * be data transferred, and directly if there is no data transfer. 219 1.27 enami * 220 1.1 mycroft * Should I reorganize this so it returns to physio instead 221 1.25 bouyer * of sleeping in scsiio_scsipi_cmd? Is there any advantage, other 222 1.1 mycroft * than avoiding the probable duplicate wakeup in iodone? [PD] 223 1.1 mycroft * 224 1.1 mycroft * No, seems ok to me... [JRE] 225 1.1 mycroft * (I don't see any duplicate wakeups) 226 1.1 mycroft * 227 1.1 mycroft * Can't be used with block devices or raw_read/raw_write directly 228 1.1 mycroft * from the cdevsw/bdevsw tables because they couldn't have added 229 1.1 mycroft * the screq structure. [JRE] 230 1.1 mycroft */ 231 1.47 thorpej static void 232 1.47 thorpej scsistrategy(struct buf *bp) 233 1.1 mycroft { 234 1.4 mycroft struct scsi_ioctl *si; 235 1.1 mycroft scsireq_t *screq; 236 1.38 bouyer struct scsipi_periph *periph; 237 1.13 mycroft int error; 238 1.5 mycroft int flags = 0; 239 1.1 mycroft 240 1.4 mycroft si = si_find(bp); 241 1.27 enami if (si == NULL) { 242 1.55 martin printf("scsistrategy: " 243 1.55 martin "No matching ioctl request found in queue\n"); 244 1.12 mycroft error = EINVAL; 245 1.63 ad goto done; 246 1.4 mycroft } 247 1.9 mycroft screq = &si->si_screq; 248 1.38 bouyer periph = si->si_periph; 249 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB2, ("user_strategy\n")); 250 1.1 mycroft 251 1.4 mycroft /* 252 1.4 mycroft * We're in trouble if physio tried to break up the transfer. 253 1.1 mycroft */ 254 1.1 mycroft if (bp->b_bcount != screq->datalen) { 255 1.38 bouyer scsipi_printaddr(periph); 256 1.23 christos printf("physio split the request.. cannot proceed\n"); 257 1.12 mycroft error = EIO; 258 1.63 ad goto done; 259 1.1 mycroft } 260 1.1 mycroft 261 1.1 mycroft if (screq->timeout == 0) { 262 1.12 mycroft error = EINVAL; 263 1.63 ad goto done; 264 1.1 mycroft } 265 1.1 mycroft 266 1.25 bouyer if (screq->cmdlen > sizeof(struct scsipi_generic)) { 267 1.38 bouyer scsipi_printaddr(periph); 268 1.23 christos printf("cmdlen too big\n"); 269 1.12 mycroft error = EFAULT; 270 1.63 ad goto done; 271 1.1 mycroft } 272 1.1 mycroft 273 1.54 bouyer if ((screq->flags & SCCMD_READ) && screq->datalen > 0) 274 1.37 thorpej flags |= XS_CTL_DATA_IN; 275 1.54 bouyer if ((screq->flags & SCCMD_WRITE) && screq->datalen > 0) 276 1.37 thorpej flags |= XS_CTL_DATA_OUT; 277 1.1 mycroft if (screq->flags & SCCMD_TARGET) 278 1.37 thorpej flags |= XS_CTL_TARGET; 279 1.1 mycroft if (screq->flags & SCCMD_ESCAPE) 280 1.37 thorpej flags |= XS_CTL_ESCAPE; 281 1.2 mycroft 282 1.50 mycroft error = scsipi_command(periph, (void *)screq->cmd, screq->cmdlen, 283 1.50 mycroft (void *)bp->b_data, screq->datalen, 284 1.4 mycroft 0, /* user must do the retries *//* ignored */ 285 1.53 yamt screq->timeout, bp, flags | XS_CTL_USERCMD); 286 1.12 mycroft 287 1.63 ad done: 288 1.66 drochner if (error) 289 1.66 drochner bp->b_resid = bp->b_bcount; 290 1.63 ad bp->b_error = error; 291 1.12 mycroft biodone(bp); 292 1.53 yamt return; 293 1.1 mycroft } 294 1.1 mycroft 295 1.1 mycroft /* 296 1.1 mycroft * Something (e.g. another driver) has called us 297 1.38 bouyer * with a periph and a scsi-specific ioctl to perform, 298 1.38 bouyer * better try. If user-level type command, we must 299 1.38 bouyer * still be running in the context of the calling process 300 1.1 mycroft */ 301 1.2 mycroft int 302 1.52 reinoud scsipi_do_ioctl(struct scsipi_periph *periph, dev_t dev, u_long cmd, 303 1.62 christos void *addr, int flag, struct lwp *l) 304 1.1 mycroft { 305 1.4 mycroft int error; 306 1.1 mycroft 307 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB2, ("scsipi_do_ioctl(0x%lx)\n", cmd)); 308 1.21 thorpej 309 1.61 christos if (addr == NULL) 310 1.61 christos return EINVAL; 311 1.61 christos 312 1.21 thorpej /* Check for the safe-ness of this request. */ 313 1.21 thorpej switch (cmd) { 314 1.29 bouyer case OSCIOCIDENTIFY: 315 1.21 thorpej case SCIOCIDENTIFY: 316 1.21 thorpej break; 317 1.24 augustss case SCIOCCOMMAND: 318 1.24 augustss if ((((scsireq_t *)addr)->flags & SCCMD_READ) == 0 && 319 1.24 augustss (flag & FWRITE) == 0) 320 1.27 enami return (EBADF); 321 1.24 augustss break; 322 1.21 thorpej default: 323 1.21 thorpej if ((flag & FWRITE) == 0) 324 1.27 enami return (EBADF); 325 1.21 thorpej } 326 1.11 mycroft 327 1.27 enami switch (cmd) { 328 1.4 mycroft case SCIOCCOMMAND: { 329 1.4 mycroft scsireq_t *screq = (scsireq_t *)addr; 330 1.8 mycroft struct scsi_ioctl *si; 331 1.4 mycroft int len; 332 1.4 mycroft 333 1.71 mlelstv len = screq->datalen; 334 1.71 mlelstv 335 1.71 mlelstv /* 336 1.71 mlelstv * If there is data, there must be a data buffer and a direction specified 337 1.71 mlelstv */ 338 1.71 mlelstv if (len > 0 && (screq->databuf == NULL || 339 1.71 mlelstv (screq->flags & (SCCMD_READ|SCCMD_WRITE)) == 0)) 340 1.71 mlelstv return (EINVAL); 341 1.71 mlelstv 342 1.11 mycroft si = si_get(); 343 1.9 mycroft si->si_screq = *screq; 344 1.38 bouyer si->si_periph = periph; 345 1.4 mycroft if (len) { 346 1.11 mycroft si->si_iov.iov_base = screq->databuf; 347 1.8 mycroft si->si_iov.iov_len = len; 348 1.8 mycroft si->si_uio.uio_iov = &si->si_iov; 349 1.8 mycroft si->si_uio.uio_iovcnt = 1; 350 1.15 mycroft si->si_uio.uio_resid = len; 351 1.8 mycroft si->si_uio.uio_offset = 0; 352 1.27 enami si->si_uio.uio_rw = 353 1.8 mycroft (screq->flags & SCCMD_READ) ? UIO_READ : UIO_WRITE; 354 1.58 yamt if ((flag & FKIOCTL) == 0) { 355 1.58 yamt si->si_uio.uio_vmspace = l->l_proc->p_vmspace; 356 1.58 yamt } else { 357 1.58 yamt UIO_SETUP_SYSSPACE(&si->si_uio); 358 1.58 yamt } 359 1.11 mycroft error = physio(scsistrategy, &si->si_bp, dev, 360 1.8 mycroft (screq->flags & SCCMD_READ) ? B_READ : B_WRITE, 361 1.38 bouyer periph->periph_channel->chan_adapter->adapt_minphys, 362 1.38 bouyer &si->si_uio); 363 1.4 mycroft } else { 364 1.4 mycroft /* if no data, no need to translate it.. */ 365 1.16 mycroft si->si_bp.b_flags = 0; 366 1.11 mycroft si->si_bp.b_data = 0; 367 1.16 mycroft si->si_bp.b_bcount = 0; 368 1.14 mycroft si->si_bp.b_dev = dev; 369 1.56 christos si->si_bp.b_proc = l->l_proc; 370 1.11 mycroft scsistrategy(&si->si_bp); 371 1.11 mycroft error = si->si_bp.b_error; 372 1.1 mycroft } 373 1.16 mycroft *screq = si->si_screq; 374 1.11 mycroft si_free(si); 375 1.27 enami return (error); 376 1.4 mycroft } 377 1.4 mycroft case SCIOCDEBUG: { 378 1.4 mycroft int level = *((int *)addr); 379 1.1 mycroft 380 1.38 bouyer SC_DEBUG(periph, SCSIPI_DB3, ("debug set to %d\n", level)); 381 1.38 bouyer periph->periph_dbflags = 0; 382 1.4 mycroft if (level & 1) 383 1.38 bouyer periph->periph_dbflags |= SCSIPI_DB1; 384 1.4 mycroft if (level & 2) 385 1.38 bouyer periph->periph_dbflags |= SCSIPI_DB2; 386 1.4 mycroft if (level & 4) 387 1.38 bouyer periph->periph_dbflags |= SCSIPI_DB3; 388 1.4 mycroft if (level & 8) 389 1.38 bouyer periph->periph_dbflags |= SCSIPI_DB4; 390 1.27 enami return (0); 391 1.4 mycroft } 392 1.4 mycroft case SCIOCRECONFIG: 393 1.4 mycroft case SCIOCDECONFIG: 394 1.27 enami return (EINVAL); 395 1.4 mycroft case SCIOCIDENTIFY: { 396 1.4 mycroft struct scsi_addr *sca = (struct scsi_addr *)addr; 397 1.27 enami 398 1.67 bouyer switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(periph))) { 399 1.38 bouyer case SCSIPI_BUSTYPE_SCSI: 400 1.25 bouyer sca->type = TYPE_SCSI; 401 1.38 bouyer sca->addr.scsi.scbus = 402 1.60 thorpej device_unit(device_parent(periph->periph_dev)); 403 1.38 bouyer sca->addr.scsi.target = periph->periph_target; 404 1.38 bouyer sca->addr.scsi.lun = periph->periph_lun; 405 1.27 enami return (0); 406 1.38 bouyer case SCSIPI_BUSTYPE_ATAPI: 407 1.25 bouyer sca->type = TYPE_ATAPI; 408 1.38 bouyer sca->addr.atapi.atbus = 409 1.60 thorpej device_unit(device_parent(periph->periph_dev)); 410 1.38 bouyer sca->addr.atapi.drive = periph->periph_target; 411 1.27 enami return (0); 412 1.25 bouyer } 413 1.27 enami return (ENXIO); 414 1.4 mycroft } 415 1.26 enami #if defined(COMPAT_12) || defined(COMPAT_FREEBSD) 416 1.26 enami /* SCIOCIDENTIFY before ATAPI staff merge */ 417 1.26 enami case OSCIOCIDENTIFY: { 418 1.26 enami struct oscsi_addr *sca = (struct oscsi_addr *)addr; 419 1.26 enami 420 1.67 bouyer switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(periph))) { 421 1.38 bouyer case SCSIPI_BUSTYPE_SCSI: 422 1.60 thorpej sca->scbus = 423 1.60 thorpej device_unit(device_parent(periph->periph_dev)); 424 1.38 bouyer sca->target = periph->periph_target; 425 1.38 bouyer sca->lun = periph->periph_lun; 426 1.27 enami return (0); 427 1.27 enami } 428 1.27 enami return (ENODEV); 429 1.26 enami } 430 1.26 enami #endif 431 1.4 mycroft default: 432 1.27 enami return (ENOTTY); 433 1.1 mycroft } 434 1.1 mycroft 435 1.4 mycroft #ifdef DIAGNOSTIC 436 1.25 bouyer panic("scsipi_do_ioctl: impossible"); 437 1.4 mycroft #endif 438 1.1 mycroft } 439