From owner-svn-src-head@FreeBSD.ORG Fri Dec 25 17:34:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D09EF1065670; Fri, 25 Dec 2009 17:34:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A574C8FC0A; Fri, 25 Dec 2009 17:34:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBPHYhe7067361; Fri, 25 Dec 2009 17:34:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBPHYhQL067357; Fri, 25 Dec 2009 17:34:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912251734.nBPHYhQL067357@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Dec 2009 17:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200991 - head/sys/dev/twe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 17:34:43 -0000 Author: mav Date: Fri Dec 25 17:34:43 2009 New Revision: 200991 URL: http://svn.freebsd.org/changeset/base/200991 Log: Teach twe driver to report array stripe size to GEOM. Modified: head/sys/dev/twe/twe.c head/sys/dev/twe/twe_freebsd.c head/sys/dev/twe/twevar.h Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Fri Dec 25 17:05:55 2009 (r200990) +++ head/sys/dev/twe/twe.c Fri Dec 25 17:34:43 2009 (r200991) @@ -201,7 +201,7 @@ twe_add_unit(struct twe_softc *sc, int u int table, error = 0; u_int16_t dsize; TWE_Param *drives = NULL, *param = NULL; - TWE_Unit_Descriptor *ud; + TWE_Array_Descriptor *ud; if (unit < 0 || unit > TWE_MAX_UNITS) return (EINVAL); @@ -244,8 +244,9 @@ twe_add_unit(struct twe_softc *sc, int u error = EIO; goto out; } - ud = (TWE_Unit_Descriptor *)param->data; + ud = (TWE_Array_Descriptor *)param->data; dr->td_type = ud->configuration; + dr->td_stripe = ud->stripe_size; /* build synthetic geometry as per controller internal rules */ if (dr->td_size > 0x200000) { Modified: head/sys/dev/twe/twe_freebsd.c ============================================================================== --- head/sys/dev/twe/twe_freebsd.c Fri Dec 25 17:05:55 2009 (r200990) +++ head/sys/dev/twe/twe_freebsd.c Fri Dec 25 17:34:43 2009 (r200991) @@ -818,6 +818,13 @@ twed_attach(device_t dev) sc->twed_disk->d_maxsize = (TWE_MAX_SGL_LENGTH - 1) * PAGE_SIZE; sc->twed_disk->d_sectorsize = TWE_BLOCK_SIZE; sc->twed_disk->d_mediasize = TWE_BLOCK_SIZE * (off_t)sc->twed_drive->td_size; + if (sc->twed_drive->td_type == TWE_UD_CONFIG_RAID0 || + sc->twed_drive->td_type == TWE_UD_CONFIG_RAID5 || + sc->twed_drive->td_type == TWE_UD_CONFIG_RAID10) { + sc->twed_disk->d_stripesize = + TWE_BLOCK_SIZE << sc->twed_drive->td_stripe; + sc->twed_disk->d_stripeoffset = 0; + } sc->twed_disk->d_fwsectors = sc->twed_drive->td_sectors; sc->twed_disk->d_fwheads = sc->twed_drive->td_heads; sc->twed_disk->d_unit = sc->twed_drive->td_sys_unit; Modified: head/sys/dev/twe/twevar.h ============================================================================== --- head/sys/dev/twe/twevar.h Fri Dec 25 17:05:55 2009 (r200990) +++ head/sys/dev/twe/twevar.h Fri Dec 25 17:34:43 2009 (r200991) @@ -59,6 +59,7 @@ struct twe_drive /* unit state and type */ u_int8_t td_state; u_int8_t td_type; + u_int8_t td_stripe; /* handle for attached driver */ device_t td_disk;