Deleted Added
full compact
ctl_backend_ramdisk.c (275058) ctl_backend_ramdisk.c (275474)
1/*-
2 * Copyright (c) 2003, 2008 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Edward Tomasz Napierala
7 * under sponsorship from the FreeBSD Foundation.
8 *

--- 26 unchanged lines hidden (view full) ---

35 */
36/*
37 * CAM Target Layer backend for a "fake" ramdisk.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003, 2008 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Edward Tomasz Napierala
7 * under sponsorship from the FreeBSD Foundation.
8 *

--- 26 unchanged lines hidden (view full) ---

35 */
36/*
37 * CAM Target Layer backend for a "fake" ramdisk.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_backend_ramdisk.c 275058 2014-11-25 17:53:35Z mav $");
43__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_backend_ramdisk.c 275474 2014-12-04 11:34:19Z mav $");
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/condvar.h>
49#include <sys/types.h>
50#include <sys/lock.h>
51#include <sys/mutex.h>

--- 910 unchanged lines hidden (view full) ---

962 }
963
964 return (retval);
965}
966
967static int
968ctl_backend_ramdisk_config_read(union ctl_io *io)
969{
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/condvar.h>
49#include <sys/types.h>
50#include <sys/lock.h>
51#include <sys/mutex.h>

--- 910 unchanged lines hidden (view full) ---

962 }
963
964 return (retval);
965}
966
967static int
968ctl_backend_ramdisk_config_read(union ctl_io *io)
969{
970 /*
971 * XXX KDM need to implement!!
972 */
973 return (0);
970 int retval = 0;
971
972 switch (io->scsiio.cdb[0]) {
973 case SERVICE_ACTION_IN:
974 if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) {
975 /* We have nothing to tell, leave default data. */
976 ctl_config_read_done(io);
977 retval = CTL_RETVAL_COMPLETE;
978 break;
979 }
980 ctl_set_invalid_field(&io->scsiio,
981 /*sks_valid*/ 1,
982 /*command*/ 1,
983 /*field*/ 1,
984 /*bit_valid*/ 1,
985 /*bit*/ 4);
986 ctl_config_read_done(io);
987 retval = CTL_RETVAL_COMPLETE;
988 break;
989 default:
990 ctl_set_invalid_opcode(&io->scsiio);
991 ctl_config_read_done(io);
992 retval = CTL_RETVAL_COMPLETE;
993 break;
994 }
995
996 return (retval);
974}
997}