From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 7 22:40:41 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D77A16A4D8 for ; Thu, 7 Oct 2004 22:40:41 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC1F243D6E for ; Thu, 7 Oct 2004 22:40:40 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i97MeXhG098995 for ; Thu, 7 Oct 2004 22:40:33 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i97MeWX4098994; Thu, 7 Oct 2004 22:40:32 GMT (envelope-from gnats) Resent-Date: Thu, 7 Oct 2004 22:40:32 GMT Resent-Message-Id: <200410072240.i97MeWX4098994@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Henry Miller Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21D9F16A4CE for ; Thu, 7 Oct 2004 22:37:08 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1497D43D1D for ; Thu, 7 Oct 2004 22:37:08 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i97Mb78p058956 for ; Thu, 7 Oct 2004 22:37:07 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i97Mb7EM058953; Thu, 7 Oct 2004 22:37:07 GMT (envelope-from nobody) Message-Id: <200410072237.i97Mb7EM058953@www.freebsd.org> Date: Thu, 7 Oct 2004 22:37:07 GMT From: Henry Miller To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/72433: AMR raid, amrreg.h struct amr_enquery3 ae_driveformat should be u_int8_t X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 22:40:42 -0000 >Number: 72433 >Category: kern >Synopsis: AMR raid, amrreg.h struct amr_enquery3 ae_driveformat should be u_int8_t >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 07 22:40:32 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Henry Miller >Release: 4.9-release >Organization: Intradyn, Inc >Environment: uname -a FreeBSD 4.9-RELEASE-p10 FreeBSD 4.9-RELEASE-p10 #0: Wed Jun 23 10:16:26 CDT 2004 root@chan.hq.intradyn.com:/usr/src/sys/compile/RV1U i386 from adapter: Adapter Name = MegaRAID SATA 150-4D The Firmware Version = 712T The BIOS Version = G116 >Description: This is seen in the source code of current as well. in sys/dev/arm/amrreg.h struct amr_enquiry3 the field ae_driveformat is listed as u_int16_t workign with real hardware, it appears that this field should be u_int8_t. >How-To-Repeat: Wrote a simple program to send an ioctl: struct amr_user_ioctl cmd; struct amr_enquiry3 ae; memset(&cmd,0,sizeof(struct amr_user_ioctl)); memset(&ae,0,sizeof(struct amr_enquiry3)); cmd.au_cmd[0] = AMR_CMD_CONFIG; cmd.au_cmd[1] = AMR_CONFIG_ENQ3; cmd.au_buffer = &ae; cmd.au_length = sizeof(struct amr_enquiry3); cmd.au_direction = AMR_IO_READ; open("/dev/amr0",O_RDONLY); ioctl(fd,AMR_IO_COMMAND,&cmd); printf("%x %x %x\n",ae.ae_driveformat[0], ae.ae_driveformat[1],ae.ae_driveformat[2]); on a normal array with 4 drive (0-3) this resulted in 3333 5333 0 (note, drive 2 was failed in a previous test) After removing drive 1: 3433 5333 0 after replacing drive 4533 5333 0 Expected results should be 33 45 53 >Fix: Change the type. However it is not known how this change will affect the overall size of the structure. I do not have docs from LSIlogic so I do not know if there are any potential problems there. >Release-Note: >Audit-Trail: >Unformatted: