b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * CDDL HEADER START
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * The contents of this file are subject to the terms of the
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * Common Development and Distribution License, Version 1.0 only
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * (the "License"). You may not use this file except in compliance
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * with the License.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * See the License for the specific language governing permissions
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * and limitations under the License.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * When distributing Covered Code, include this CDDL HEADER in each
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * If applicable, add the following below this CDDL HEADER, with the
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * fields enclosed by brackets "[]" replaced with your own identifying
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * information: Portions Copyright [yyyy] [name of copyright owner]
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * CDDL HEADER END
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * Use is subject to license terms.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth#pragma ident "%Z%%M% %I% %E% SMI"
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * This program provides a command line interface to the
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * three new ioctls for the emul64 driver - EMUL64_WRITE_OFF,
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * EMUL64_WRITE_ON and EMUL64_ZERO_RANGE. All three of these
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * ioctls require the range of blocks to be specified. The
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * range is specified by starting block number and block count
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * both of which are 64 bit.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * Returns 0 on success, >0 on failure.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcthstatic int get_disk_addr(char *path, emul64_tgt_range_t *tr, char **admin);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcthstatic void
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth (void) fprintf(stderr, "Usage: emul64ioctl -s start_block "
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth "-b block_count -c write_off | write_on | zero emul64_dev\n");
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth extern char *optarg;
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth extern int optind;
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * Get admin device, target and lun
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth * open the specified emul64_dev.
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth return (0);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth return (1);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcthget_disk_addr(char *path, emul64_tgt_range_t *tr, char **admin)
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth (void) fprintf(stderr, "%s: \"%s\" is invalid disk name. "
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth return (-1);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth /* Build controller name */
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth return (-1);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth (void) snprintf(*admin, admin_size, "%sc%d", ADMIN_DIR, ctlr_num);
b1dd958f54f8bfa984d306bb8ca8264855761d7bcth return (0);