135863739SMike Smith /*- 235863739SMike Smith * Copyright (c) 2000 Michael Smith 335863739SMike Smith * Copyright (c) 2000 BSDi 435863739SMike Smith * All rights reserved. 535863739SMike Smith * 635863739SMike Smith * Redistribution and use in source and binary forms, with or without 735863739SMike Smith * modification, are permitted provided that the following conditions 835863739SMike Smith * are met: 935863739SMike Smith * 1. Redistributions of source code must retain the above copyright 1035863739SMike Smith * notice, this list of conditions and the following disclaimer. 1135863739SMike Smith * 2. Redistributions in binary form must reproduce the above copyright 1235863739SMike Smith * notice, this list of conditions and the following disclaimer in the 1335863739SMike Smith * documentation and/or other materials provided with the distribution. 1435863739SMike Smith * 1535863739SMike Smith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1635863739SMike Smith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1735863739SMike Smith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1835863739SMike Smith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1935863739SMike Smith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2035863739SMike Smith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2135863739SMike Smith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2235863739SMike Smith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2335863739SMike Smith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2435863739SMike Smith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2535863739SMike Smith * SUCH DAMAGE. 2635863739SMike Smith * 2735863739SMike Smith * $FreeBSD$ 2835863739SMike Smith */ 2935863739SMike Smith 3035863739SMike Smith /* 3135863739SMike Smith * Status codes for block read/write commands, etc. 3235863739SMike Smith * 3335863739SMike Smith * XXX many of these would not normally be returned, as they are 3435863739SMike Smith * relevant only to FSA operations. 3535863739SMike Smith */ 3635863739SMike Smith static struct aac_code_lookup aac_command_status_table[] = { 376352e2e2SEd Maste {"OK", ST_OK}, 386352e2e2SEd Maste {"operation not permitted", ST_PERM}, 396352e2e2SEd Maste {"not found", ST_NOENT}, 406352e2e2SEd Maste {"I/O error", ST_IO}, 416352e2e2SEd Maste {"device not configured", ST_NXIO}, 426352e2e2SEd Maste {"too big", ST_E2BIG}, 436352e2e2SEd Maste {"permission denied", ST_ACCES}, 446352e2e2SEd Maste {"file exists", ST_EXIST}, 456352e2e2SEd Maste {"cross-device link", ST_XDEV}, 466352e2e2SEd Maste {"operation not supported by device", ST_NODEV}, 476352e2e2SEd Maste {"not a directory", ST_NOTDIR}, 486352e2e2SEd Maste {"is a directory", ST_ISDIR}, 496352e2e2SEd Maste {"invalid argument", ST_INVAL}, 506352e2e2SEd Maste {"file too large", ST_FBIG}, 516352e2e2SEd Maste {"no space on device", ST_NOSPC}, 526352e2e2SEd Maste {"readonly filesystem", ST_ROFS}, 536352e2e2SEd Maste {"too many links", ST_MLINK}, 546352e2e2SEd Maste {"operation would block", ST_WOULDBLOCK}, 556352e2e2SEd Maste {"file name too long", ST_NAMETOOLONG}, 566352e2e2SEd Maste {"directory not empty", ST_NOTEMPTY}, 576352e2e2SEd Maste {"quota exceeded", ST_DQUOT}, 586352e2e2SEd Maste {"stale file handle", ST_STALE}, 596352e2e2SEd Maste {"too many levels of remote in path", ST_REMOTE}, 606352e2e2SEd Maste {"device busy (spinning up)", ST_NOT_READY}, 616352e2e2SEd Maste {"bad file handle", ST_BADHANDLE}, 626352e2e2SEd Maste {"not sync", ST_NOT_SYNC}, 636352e2e2SEd Maste {"bad cookie", ST_BAD_COOKIE}, 646352e2e2SEd Maste {"operation not supported", ST_NOTSUPP}, 656352e2e2SEd Maste {"too small", ST_TOOSMALL}, 666352e2e2SEd Maste {"server fault", ST_SERVERFAULT}, 676352e2e2SEd Maste {"bad type", ST_BADTYPE}, 686352e2e2SEd Maste {"jukebox", ST_JUKEBOX}, 696352e2e2SEd Maste {"not mounted", ST_NOTMOUNTED}, 706352e2e2SEd Maste {"in maintenance mode", ST_MAINTMODE}, 716352e2e2SEd Maste {"stale ACL", ST_STALEACL}, 726352e2e2SEd Maste {"bus reset - command aborted", ST_BUS_RESET}, 7335863739SMike Smith {NULL, 0}, 7435863739SMike Smith {"unknown command status", 0} 7535863739SMike Smith }; 7635863739SMike Smith 7735863739SMike Smith #define AAC_COMMAND_STATUS(x) aac_describe_code(aac_command_status_table, x) 7835863739SMike Smith 7935863739SMike Smith static struct aac_code_lookup aac_cpu_variant[] = { 8035863739SMike Smith {"i960JX", CPUI960_JX}, 8135863739SMike Smith {"i960CX", CPUI960_CX}, 8235863739SMike Smith {"i960HX", CPUI960_HX}, 8335863739SMike Smith {"i960RX", CPUI960_RX}, 847cb209f5SScott Long {"i960 80303", CPUI960_80303}, 8535863739SMike Smith {"StrongARM SA110", CPUARM_SA110}, 867cb209f5SScott Long {"PPC603e", CPUPPC_603e}, 877cb209f5SScott Long {"XScale 80321", CPU_XSCALE_80321}, 887cb209f5SScott Long {"MIPS 4KC", CPU_MIPS_4KC}, 897cb209f5SScott Long {"MIPS 5KC", CPU_MIPS_5KC}, 9035863739SMike Smith {"Unknown StrongARM", CPUARM_xxx}, 9135863739SMike Smith {"Unknown PowerPC", CPUPPC_xxx}, 9235863739SMike Smith {NULL, 0}, 9335863739SMike Smith {"Unknown processor", 0} 9435863739SMike Smith }; 9535863739SMike Smith 9635863739SMike Smith static struct aac_code_lookup aac_battery_platform[] = { 9735863739SMike Smith {"required battery present", PLATFORM_BAT_REQ_PRESENT}, 9835863739SMike Smith {"REQUIRED BATTERY NOT PRESENT", PLATFORM_BAT_REQ_NOTPRESENT}, 9935863739SMike Smith {"optional battery present", PLATFORM_BAT_OPT_PRESENT}, 10035863739SMike Smith {"optional battery not installed", PLATFORM_BAT_OPT_NOTPRESENT}, 10135863739SMike Smith {"no battery support", PLATFORM_BAT_NOT_SUPPORTED}, 10235863739SMike Smith {NULL, 0}, 10335863739SMike Smith {"unknown battery platform", 0} 10435863739SMike Smith }; 10535863739SMike Smith 10635863739SMike Smith static struct aac_code_lookup aac_container_types[] = { 10735863739SMike Smith {"Volume", CT_VOLUME}, 10835863739SMike Smith {"RAID 1 (Mirror)", CT_MIRROR}, 10935863739SMike Smith {"RAID 0 (Stripe)", CT_STRIPE}, 11035863739SMike Smith {"RAID 5", CT_RAID5}, 11135863739SMike Smith {"SSRW", CT_SSRW}, 11235863739SMike Smith {"SSRO", CT_SSRO}, 11335863739SMike Smith {"Morph", CT_MORPH}, 11435863739SMike Smith {"Passthrough", CT_PASSTHRU}, 11535863739SMike Smith {"RAID 4", CT_RAID4}, 1168ea9ab66SScott Long {"RAID 0/1", CT_RAID10}, 1178ea9ab66SScott Long {"RAID 0/0", CT_RAID00}, 11835863739SMike Smith {"Volume of Mirrors", CT_VOLUME_OF_MIRRORS}, 11935863739SMike Smith {"Pseudo RAID 3", CT_PSEUDO_RAID3}, 1208ea9ab66SScott Long {"RAID 0/5", CT_RAID50}, 1217cb209f5SScott Long {"RAID 5D", CT_RAID5D}, 1227cb209f5SScott Long {"RAID 0/5D", CT_RAID5D0}, 1237cb209f5SScott Long {"RAID 1E", CT_RAID1E}, 1247cb209f5SScott Long {"RAID 6", CT_RAID6}, 1257cb209f5SScott Long {"RAID 0/6", CT_RAID60}, 12635863739SMike Smith {NULL, 0}, 12735863739SMike Smith {"unknown", 0} 12835863739SMike Smith }; 12935863739SMike Smith 130