10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7563SPrasad.Singamsetty@Sun.COM * Common Development and Distribution License (the "License"). 6*7563SPrasad.Singamsetty@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*7563SPrasad.Singamsetty@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _ANALYZE_H 270Sstevel@tonic-gate #define _ANALYZE_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #ifdef __cplusplus 300Sstevel@tonic-gate extern "C" { 310Sstevel@tonic-gate #endif 320Sstevel@tonic-gate 330Sstevel@tonic-gate /* 340Sstevel@tonic-gate * This file contains definitions related to surface analysis. 350Sstevel@tonic-gate */ 360Sstevel@tonic-gate 370Sstevel@tonic-gate /* 380Sstevel@tonic-gate * These are variables referenced by the analysis routines. They 390Sstevel@tonic-gate * are declared in analyze.c. 400Sstevel@tonic-gate */ 410Sstevel@tonic-gate extern int scan_entire; 420Sstevel@tonic-gate extern diskaddr_t scan_lower, scan_upper; 430Sstevel@tonic-gate extern int scan_correct, scan_stop, scan_loop, scan_passes; 44*7563SPrasad.Singamsetty@Sun.COM extern int scan_random, scan_auto; 45*7563SPrasad.Singamsetty@Sun.COM extern uint_t scan_size; 460Sstevel@tonic-gate extern int scan_restore_defects, scan_restore_label; 470Sstevel@tonic-gate 480Sstevel@tonic-gate /* 490Sstevel@tonic-gate * These variables hold summary info for the end of analysis. 500Sstevel@tonic-gate * They are declared in analyze.c. 510Sstevel@tonic-gate */ 520Sstevel@tonic-gate extern offset_t scan_cur_block; 530Sstevel@tonic-gate extern int64_t scan_blocks_fixed; 540Sstevel@tonic-gate 550Sstevel@tonic-gate /* 560Sstevel@tonic-gate * This variable is used to tell whether the most recent surface 570Sstevel@tonic-gate * analysis error was caused by a media defect or some other problem. 580Sstevel@tonic-gate * It is declared in analyze.c. 590Sstevel@tonic-gate */ 600Sstevel@tonic-gate extern int media_error; 610Sstevel@tonic-gate extern int disk_error; 620Sstevel@tonic-gate 630Sstevel@tonic-gate /* 640Sstevel@tonic-gate * These defines are flags for the surface analysis types. 650Sstevel@tonic-gate */ 660Sstevel@tonic-gate #define SCAN_VALID 0x01 /* read data off disk */ 670Sstevel@tonic-gate #define SCAN_PATTERN 0x02 /* write and read pattern */ 680Sstevel@tonic-gate #define SCAN_COMPARE 0x04 /* manually check pattern */ 690Sstevel@tonic-gate #define SCAN_WRITE 0x08 /* write data to disk */ 700Sstevel@tonic-gate #define SCAN_PURGE 0x10 /* purge data on disk */ 710Sstevel@tonic-gate #define SCAN_PURGE_READ_PASS 0x20 /* read/compare pass */ 720Sstevel@tonic-gate #define SCAN_PURGE_ALPHA_PASS 0x40 /* alpha pattern pass */ 730Sstevel@tonic-gate #define SCAN_VERIFY 0x80 /* verify data on disk */ 740Sstevel@tonic-gate #define SCAN_VERIFY_READ_PASS 0x100 /* read/compare pass */ 750Sstevel@tonic-gate 760Sstevel@tonic-gate 770Sstevel@tonic-gate /* 780Sstevel@tonic-gate * Miscellaneous defines. 790Sstevel@tonic-gate */ 800Sstevel@tonic-gate #define BUF_SECTS 126 /* size of the buffers */ 810Sstevel@tonic-gate /* 820Sstevel@tonic-gate * Number of passes for purge command. It is kept here to allow 830Sstevel@tonic-gate * it to be used in menu_analyze.c also 840Sstevel@tonic-gate * This feature is added at the request of Sun Fed. 850Sstevel@tonic-gate */ 860Sstevel@tonic-gate #define NPPATTERNS 4 /* number of purge patterns */ 870Sstevel@tonic-gate #define READPATTERN (NPPATTERNS - 1) 880Sstevel@tonic-gate 890Sstevel@tonic-gate 900Sstevel@tonic-gate /* 910Sstevel@tonic-gate * defines for disk errors during surface analysis. 920Sstevel@tonic-gate */ 930Sstevel@tonic-gate #define DISK_STAT_RESERVED 0x01 /* disk is reserved */ 940Sstevel@tonic-gate #define DISK_STAT_NOTREADY 0x02 /* disk not ready */ 950Sstevel@tonic-gate #define DISK_STAT_UNAVAILABLE 0x03 /* disk is being formatted */ 960Sstevel@tonic-gate #define DISK_STAT_DATA_PROTECT 0x04 /* disk is write protected */ 970Sstevel@tonic-gate 980Sstevel@tonic-gate /* 990Sstevel@tonic-gate * Prototypes for ANSI C compilers 1000Sstevel@tonic-gate */ 1010Sstevel@tonic-gate int do_scan(int flags, int mode); 1020Sstevel@tonic-gate 1030Sstevel@tonic-gate #ifdef __cplusplus 1040Sstevel@tonic-gate } 1050Sstevel@tonic-gate #endif 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate #endif /* _ANALYZE_H */ 108