Date: Thu, 7 Oct 2004 22:37:07 GMT From: Henry Miller <hmiller@intradyn.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/72433: AMR raid, amrreg.h struct amr_enquery3 ae_driveformat should be u_int8_t Message-ID: <200410072237.i97Mb7EM058953@www.freebsd.org> Resent-Message-ID: <200410072240.i97MeWX4098994@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410072237.i97Mb7EM058953>
