From fredb@immanent.net  Thu Dec 16 16:21:53 2004
Return-Path: <fredb@immanent.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B6BCE16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Dec 2004 16:21:53 +0000 (GMT)
Received: from mail.immanent.net (mail.immanent.net [209.100.230.148])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 878D943D58
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Dec 2004 16:21:52 +0000 (GMT)
	(envelope-from fredb@immanent.net)
Received: from construction.immanent.net (construction.immanent.net [IPv6:2001:5c0:81c1:80:230:48ff:fe81:eb66])
	by mail.immanent.net (8.12.11/8.12.11) with ESMTP id iBGGLkTr006756
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Dec 2004 10:21:46 -0600 (CST)
Received: from construction.immanent.net (localhost [IPv6:::1])
	by construction.immanent.net (8.13.1/8.13.1) with ESMTP id iBGGLkV9008178
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Dec 2004 10:21:46 -0600 (CST)
	(envelope-from fredb@construction.immanent.net)
Received: (from fredb@localhost)
	by construction.immanent.net (8.13.1/8.13.1/Submit) id iBGGLjbq008177;
	Thu, 16 Dec 2004 10:21:45 -0600 (CST)
	(envelope-from fredb)
Message-Id: <200412161621.iBGGLjbq008177@construction.immanent.net>
Date: Thu, 16 Dec 2004 10:21:45 -0600 (CST)
From: Frederick S Bruckman <fredb@immanent.net>
Reply-To: Frederick S Bruckman <fredb@immanent.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Please update twa driver (for 3ware 9000 series) to 9.1.5.2.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75154
>Category:       kern
>Synopsis:       [patch] Please update twa driver (for 3ware 9000 series) to 9.1.5.2.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 16 16:30:29 GMT 2004
>Closed-Date:    Tue Apr 05 14:52:58 GMT 2005
>Last-Modified:  Tue Apr 05 14:52:58 GMT 2005
>Originator:     Frederick S Bruckman
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD construction.immanent.net 5.3-RELEASE FreeBSD 5.3-RELEASE #6: Wed Dec 15 22:22:11 CST 2004 fredb@construction.immanent.net:/usr/src/sys/i386/compile/CONDUCTION i386


>Description:

	Please update the twa driver for AMCC/3ware 9500S series RAID cards to
	the latest codeset, 9.1.5.2 (driver 2.50.02.011/firmware 2.04.00.005).
	The new firmware is needed to properly support the Battery Backup Units,
	and the new driver to support the latest utilities, "tw_cli" and "3dm2".

>How-To-Repeat:

	Please update... (just kidding).

>Fix:

	The following mechanical diff is against the driver from AMCC's web
	site, which is otherwise a "drop in" replacement on FreeBSD 5.3. You
	can download it from:
	
		http://www.3ware.com/support/download.asp

	In the form, choose "3ware 9000 series", "9.1.5.2", "Driver", "FreeBSD
	5.x driver source (5.2 and above)". Hopefully, it will be no harder to
	port to current.


diff -u twa-2.50.02.011.orig/twa.h twa-2.50.02.011/twa.h
--- twa-2.50.02.011.orig/twa.h	Mon Nov  8 18:28:46 2004
+++ twa-2.50.02.011/twa.h	Wed Dec 15 20:08:14 2004
@@ -172,7 +172,7 @@
 					between ioctl calls */
     
 	device_t		twa_bus_dev;	/* bus device */
-	dev_t			twa_ctrl_dev;	/* control device */
+	struct cdev 		*twa_ctrl_dev;	/* control device */
 	struct resource		*twa_io_res;	/* register interface window */
 	bus_space_handle_t	twa_bus_handle;	/* bus space handle */
 	bus_space_tag_t		twa_bus_tag;	/* bus space tag */
diff -u twa-2.50.02.011.orig/twa_freebsd.c twa-2.50.02.011/twa_freebsd.c
--- twa-2.50.02.011.orig/twa_freebsd.c	Mon Nov  8 18:28:46 2004
+++ twa-2.50.02.011/twa_freebsd.c	Wed Dec 15 22:21:42 2004
@@ -50,6 +50,8 @@
 static	d_ioctl_t		twa_ioctl_wrapper;
 
 static struct cdevsw twa_cdevsw = {
+	.d_version =	D_VERSION,
+	.d_flags =	D_NEEDGIANT,
 	.d_open =	twa_open,
 	.d_close =	twa_close,
 	.d_ioctl =	twa_ioctl_wrapper,
@@ -74,7 +76,7 @@
  *			non-zero-- failure
  */
 static int
-twa_open(dev_t dev, int flags, int fmt, d_thread_t *proc)
+twa_open(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
 {
 	int			unit = minor(dev);
 	struct twa_softc	*sc = devclass_get_softc(twa_devclass, unit);
@@ -99,7 +101,7 @@
  *			non-zero-- failure
  */
 static int
-twa_close(dev_t dev, int flags, int fmt, d_thread_t *proc)
+twa_close(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
 {
 	int			unit = minor(dev);
 	struct twa_softc	*sc = devclass_get_softc(twa_devclass, unit);
@@ -127,7 +129,7 @@
  *			non-zero-- failure
  */
 static int
-twa_ioctl_wrapper(dev_t dev, u_long cmd, caddr_t buf,
+twa_ioctl_wrapper(struct cdev *dev, u_long cmd, caddr_t buf,
 					int flags, d_thread_t *proc)
 {
 	struct twa_softc	*sc = (struct twa_softc *)(dev->si_drv1);


>Release-Note:
>Audit-Trail:

From: Frederick Bruckman <fredb@immanent.net>
To: vkashyap@FreeBSD.org
Cc: fredb@immanent.net, freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/75154: [patch] Please update twa driver (for 3ware 9000
	series) to 9.1.5.2.
Date: Tue, 05 Apr 2005 09:35:54 -0500

 I see the 9.1.5.2 driver was commited and pulled up to the release
 branches in January/2005. Please just close this.
 
 BTW, I ported 9.2 to FreeBSD 5.3 easily, using similar mechanical
 changes -- dev_t -> struct cdevsw*, !D_NOGIANT -> D_NEEDGIANT, #include
 "file.h" -> #include <dev/twa/file.h>, and by updating "sys/conf/files"
 -- and it runs fine. However, the diff is huge, because of the file name
 changes, and not very readable, so I'll just wait until you get to that.
 
 Thanks,
 
 Frederick Bruckman
State-Changed-From-To: open->closed 
State-Changed-By: glebius 
State-Changed-When: Tue Apr 5 14:51:46 GMT 2005 
State-Changed-Why:  
Closed due to submitters request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75154 
>Unformatted:
