From le@univie.ac.at  Tue Dec  9 23:51:52 2003
Return-Path: <le@univie.ac.at>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C058716A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Dec 2003 23:51:52 -0800 (PST)
Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3FD8643D13
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Dec 2003 23:51:50 -0800 (PST)
	(envelope-from le@univie.ac.at)
Received: from korben.in.tern (adslle.cc.univie.ac.at [131.130.102.11])
	by mailbox.univie.ac.at (8.12.10/8.12.10) with ESMTP id hBA7pevG546650
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 10 Dec 2003 08:51:42 +0100
Received: from korben.in.tern (korben.in.tern [127.0.0.1])
	by korben.in.tern (8.12.10/8.12.10) with ESMTP id hBA7pexY000847
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 10 Dec 2003 08:51:40 +0100 (CET)
	(envelope-from le@korben.in.tern)
Received: (from le@localhost)
	by korben.in.tern (8.12.10/8.12.10/Submit) id hBA7pYwd000846;
	Wed, 10 Dec 2003 08:51:34 +0100 (CET)
	(envelope-from le)
Message-Id: <200312100751.hBA7pYwd000846@korben.in.tern>
Date: Wed, 10 Dec 2003 08:51:34 +0100 (CET)
From: Lukas Ertl <l.ertl@univie.ac.at>
Reply-To: Lukas Ertl <l.ertl@univie.ac.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] update sample code in PCI driver chapter of arch handbook
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         60107
>Category:       docs
>Synopsis:       [PATCH] update sample code in PCI driver chapter of arch handbook
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 10 00:00:43 PST 2003
>Closed-Date:    Wed Dec 31 10:16:52 PST 2003
>Last-Modified:  Wed Dec 31 10:16:52 PST 2003
>Originator:     Lukas Ertl
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Vienna University Computer Center
>Environment:
System: FreeBSD korben 5.2-CURRENT FreeBSD 5.2-CURRENT #71: Mon Dec 8 21:32:27 CET 2003 le@korben:/usr/obj/usr/src/sys/KORBEN i386


	
>Description:

The following patch updates some of the sample code in the PCI driver
chapter of the arch handbook to work correctly on 5.X.

>How-To-Repeat:
	
>Fix:

	

--- archdoc.diff begins here ---
Index: en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml
===================================================================
RCS file: /usr/local/bsdcvs/doc/en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml,v
retrieving revision 1.14
diff -u -r1.14 chapter.sgml
--- en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml	5 Nov 2003 10:50:50 -0000	1.14
+++ en_US.ISO8859-1/books/arch-handbook/pci/chapter.sgml	10 Dec 2003 07:45:43 -0000
@@ -25,18 +25,22 @@
 
 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
 
-#include &lt;sys/types.h&gt;
+#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 #include &lt;sys/module.h&gt;
 #include &lt;sys/systm.h&gt;  /* uprintf */ 
 #include &lt;sys/errno.h&gt;
-#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 #include &lt;sys/kernel.h&gt; /* types used in module initialization */
 #include &lt;sys/conf.h&gt;   /* cdevsw struct */
 #include &lt;sys/uio.h&gt;    /* uio struct */
 #include &lt;sys/malloc.h&gt;
 #include &lt;sys/bus.h&gt;	/* structs, prototypes for pci bus stuff */
 
-#include &lt;pci/pcivar.h&gt; /* For get_pci macros! */
+#include &lt;machine/bus.h&gt;
+#include &lt;sys/rman.h&gt;
+#include &lt;machine/resource.h&gt;
+
+#include &lt;dev/pci/pcivar.h&gt; /* For get_pci macros! */
+#include &lt;dev/pci/pcireg.h&gt;
 
 /* Function prototypes */
 d_open_t      mypci_open;
@@ -61,7 +65,7 @@
    open/close/read/write at this point */
 
 int 
-mypci_open(dev_t dev, int oflags, int devtype, struct proc *p)
+mypci_open(dev_t dev, int oflags, int devtype, struct thread *td)
 {
   int err = 0;
 
@@ -70,7 +74,7 @@
 }
 
 int 
-mypci_close(dev_t dev, int fflag, int devtype, struct proc *p)
+mypci_close(dev_t dev, int fflag, int devtype, struct thread *td)
 {
   int err=0;
 
--- archdoc.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Lukas Ertl <l.ertl@univie.ac.at>
To: j.el-rayes@daemon.li
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/60107: [PATCH] update sample code in PCI driver chapter of
 arch handbook
Date: Wed, 10 Dec 2003 11:21:44 +0100 (CET)

 On Wed, 10 Dec 2003, Josef El-Rayes wrote:
 
 > Lukas Ertl <l.ertl@univie.ac.at> wrote:
 > > +#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 > > -#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 >
 > hi lukas!
 >
 > it is a good idea to have a look at the diff-generated patch
 > before sending in, to avoid bogus lines like this.
 
 It is a good idea to actually understand what the patch does before
 calling it bogus.
 
 The original code had sys/param.h and sys/types.h included, which is a
 style(9) violation.  My patch removes one include and moves the other one
 further up.
 
 regards,
 le
 
 -- 
 Lukas Ertl                             eMail: l.ertl@univie.ac.at
 UNIX Systemadministrator               Tel.:  (+43 1) 4277-14073
 Vienna University Computer Center      Fax.:  (+43 1) 4277-9140
 University of Vienna                   http://mailbox.univie.ac.at/~le/

From: Josef El-Rayes <josef@daemon.li>
To: Lukas Ertl <l.ertl@univie.ac.at>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/60107: [PATCH] update sample code in PCI driver chapter of arch handbook
Date: Wed, 10 Dec 2003 10:00:36 +0000

 Lukas Ertl <l.ertl@univie.ac.at> wrote:
 > +#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 > -#include &lt;sys/param.h&gt;  /* defines used in kernel.h */
 
 hi lukas!
 
 it is a good idea to have a look at the diff-generated patch
 before sending in, to avoid bogus lines like this.
 
 for example when you move a line(i.e. remove & insert at another
 place), you get such behaviour in your patch which makes it hard to read.
 
 keep up the good work :)
 greets, josef
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Wed Dec 31 10:16:40 PST 2003 
State-Changed-Why:  
Comitted, thanks! 

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