Escape <, >, &'s, plus some cleanups against the SGML. There should not

be any content changes involved in this commit, however, localization
teams are encouraged to catch up with this change.

Requested by:	intron at intron ac
Reviewed by:	Niclas Zeising <lothrandil at n00b apagnu se>
Glanced by:	simon
This commit is contained in:
Xin LI 2006-01-05 20:03:39 +00:00
parent 8ecae3308c
commit e140896ec8
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=26779
44 changed files with 568 additions and 570 deletions
en_US.ISO8859-1
books
arch-handbook
developers-handbook
fdp-primer
doc-build
examples
sgml-primer
handbook
advanced-networking
basics
config
cutting-edge
disks
firewalls
geom
install
kernelconfig
linuxemu
mac
mail
mirrors
network-servers
ppp-and-slip
security
serialcomms
x11
pmake
porters-handbook
share/sgml

View file

@ -83,7 +83,7 @@ F5 Disk 2</screen>
<row> <row>
<entry><para> <entry><para>
<screen>>>FreeBSD/i386 BOOT <screen>&gt;&gt;FreeBSD/i386 BOOT
Default: 1:ad(1,a)/boot/loader Default: 1:ad(1,a)/boot/loader
boot:</screen> boot:</screen>
</para></entry> </para></entry>
@ -453,7 +453,7 @@ struct bootinfo {
passing the execution to the loader's entry:</para> passing the execution to the loader's entry:</para>
<programlisting><filename>sys/boot/i386/boot2/boot2.c:</filename> <programlisting><filename>sys/boot/i386/boot2/boot2.c:</filename>
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), __exec((caddr_t)addr, RB_BOOTINFO | (opts &amp; RBX_MASK),
MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part),
0, 0, 0, VTOP(&amp;bootinfo));</programlisting> 0, 0, 0, VTOP(&amp;bootinfo));</programlisting>
</sect1> </sect1>
@ -472,7 +472,7 @@ struct bootinfo {
<programlisting><filename>sys/boot/common/boot.c:</filename> <programlisting><filename>sys/boot/common/boot.c:</filename>
/* Call the exec handler from the loader matching the kernel */ /* Call the exec handler from the loader matching the kernel */
module_formats[km->m_loader]->l_exec(km);</programlisting> module_formats[km-&gt;m_loader]-&gt;l_exec(km);</programlisting>
</sect1> </sect1>
<sect1 id="boot-kernel"> <sect1 id="boot-kernel">
@ -537,7 +537,7 @@ NON_GPROF_ENTRY(btext)</programlisting>
they do:</para> they do:</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols=2 align=left> <tgroup cols="2" align="left">
<tbody> <tbody>
<row> <row>
<entry><function>recover_bootinfo</function></entry> <entry><function>recover_bootinfo</function></entry>
@ -783,7 +783,7 @@ struct gate_descriptor *idt = &amp;idt0[0]; /* interrupt descriptor table */
/* skipped */ /* skipped */
#ifdef DDB #ifdef DDB
kdb_init(); kdb_init();
if (boothowto & RB_KDB) if (boothowto &amp; RB_KDB)
Debugger("Boot flags requested debugger"); Debugger("Boot flags requested debugger");
#endif</programlisting> #endif</programlisting>
@ -801,7 +801,7 @@ struct gate_descriptor *idt = &amp;idt0[0]; /* interrupt descriptor table */
#define LSYS5SIGR_SEL 1 #define LSYS5SIGR_SEL 1
#define L43BSDCALLS_SEL 2 /* notyet */ #define L43BSDCALLS_SEL 2 /* notyet */
#define LUCODE_SEL 3 #define LUCODE_SEL 3
#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */ #define LSOL26CALLS_SEL 4 /* Solaris &gt;= 2.6 system call gate */
#define LUDATA_SEL 5 #define LUDATA_SEL 5
/* separate stack, es,fs,gs sels ? */ /* separate stack, es,fs,gs sels ? */
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */ /* #define LPOSIXCALLS_SEL 5*/ /* notyet */
@ -838,7 +838,7 @@ struct gate_descriptor *idt = &amp;idt0[0]; /* interrupt descriptor table */
/* ... skipped ... */ /* ... skipped ... */
/* Call function */ /* Call function */
(*((*sipp)->func))((*sipp)->udata); (*((*sipp)-&gt;func))((*sipp)-&gt;udata);
/* ... skipped ... */ /* ... skipped ... */
}</programlisting> }</programlisting>
@ -1001,7 +1001,7 @@ create_init(const void *udata __unused)
error = fork1(&amp;proc0, RFFDG | RFPROC, &amp;initproc); error = fork1(&amp;proc0, RFFDG | RFPROC, &amp;initproc);
if (error) if (error)
panic("cannot fork init: %d\n", error); panic("cannot fork init: %d\n", error);
initproc->p_flag |= P_INMEM | P_SYSTEM; initproc-&gt;p_flag |= P_INMEM | P_SYSTEM;
cpu_set_fork_handler(initproc, start_init, NULL); cpu_set_fork_handler(initproc, start_init, NULL);
remrunqueue(initproc); remrunqueue(initproc);
splx(s); splx(s);

View file

@ -207,8 +207,8 @@ KMOD=skeleton
<para>This simple example pseudo-device remembers whatever values <para>This simple example pseudo-device remembers whatever values
you write to it and can then supply them back to you when you you write to it and can then supply them back to you when you
read from it. Two versions are shown, one for &os;&nbsp; 4.X and read from it. Two versions are shown, one for &os;&nbsp;4.X and
one for &os;&nbsp; 5.X.</para> one for &os;&nbsp;5.X.</para>
<example> <example>
<title>Example of a Sample Echo Pseudo-Device Driver for <title>Example of a Sample Echo Pseudo-Device Driver for
@ -220,7 +220,7 @@ KMOD=skeleton
* Murray Stokely * Murray Stokely
*/ */
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MIN(a,b) (((a) &lt; (b)) ? (a) : (b))
#include &lt;sys/types.h&gt; #include &lt;sys/types.h&gt;
#include &lt;sys/module.h&gt; #include &lt;sys/module.h&gt;
@ -284,7 +284,7 @@ echo_loader(struct module *m, int what, void *arg)
switch (what) { switch (what) {
case MOD_LOAD: /* kldload */ case MOD_LOAD: /* kldload */
sdev = make_dev(<literal>&</literal>echo_cdevsw, sdev = make_dev(<literal>&amp;</literal>echo_cdevsw,
0, 0,
UID_ROOT, UID_ROOT,
GID_WHEEL, GID_WHEEL,
@ -338,9 +338,9 @@ echo_read(dev_t dev, struct uio *uio, int ioflag)
* How big is this read operation? Either as big as the user wants, * How big is this read operation? Either as big as the user wants,
* or as big as the remaining data * or as big as the remaining data
*/ */
amt = MIN(uio->uio_resid, (echomsg->len - uio->uio_offset > 0) ? amt = MIN(uio-&gt;uio_resid, (echomsg-&gt;len - uio-&gt;uio_offset &gt; 0) ?
echomsg->len - uio->uio_offset : 0); echomsg-&gt;len - uio-&gt;uio_offset : 0);
if ((err = uiomove(echomsg->msg + uio->uio_offset,amt,uio)) != 0) { if ((err = uiomove(echomsg-&gt;msg + uio-&gt;uio_offset,amt,uio)) != 0) {
uprintf("uiomove failed!\n"); uprintf("uiomove failed!\n");
} }
return(err); return(err);
@ -357,12 +357,12 @@ echo_write(dev_t dev, struct uio *uio, int ioflag)
int err = 0; int err = 0;
/* Copy the string in from user memory to kernel memory */ /* Copy the string in from user memory to kernel memory */
err = copyin(uio->uio_iov->iov_base, echomsg->msg, err = copyin(uio-&gt;uio_iov-&gt;iov_base, echomsg-&gt;msg,
MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1)); MIN(uio-&gt;uio_iov-&gt;iov_len,BUFFERSIZE - 1));
/* Now we need to null terminate, then record the length */ /* Now we need to null terminate, then record the length */
*(echomsg->msg + MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1)) = 0; *(echomsg-&gt;msg + MIN(uio-&gt;uio_iov-&gt;iov_len,BUFFERSIZE - 1)) = 0;
echomsg->len = MIN(uio->uio_iov->iov_len,BUFFERSIZE); echomsg-&gt;len = MIN(uio-&gt;uio_iov-&gt;iov_len,BUFFERSIZE);
if (err != 0) { if (err != 0) {
uprintf("Write failed: bad address!\n"); uprintf("Write failed: bad address!\n");
@ -383,7 +383,7 @@ DEV_MODULE(echo,echo_loader,NULL);</programlisting>
* *
* Murray Stokely * Murray Stokely
* *
* Converted to 5.X by Søren (Xride) Straarup * Converted to 5.X by S&oslash;ren (Xride) Straarup
*/ */
#include &lt;sys/types.h&gt; #include &lt;sys/types.h&gt;
@ -440,7 +440,7 @@ echo_loader(struct module *m, int what, void *arg)
switch (what) { switch (what) {
case MOD_LOAD: /* kldload */ case MOD_LOAD: /* kldload */
echo_dev = make_dev(<literal>&</literal>echo_cdevsw, echo_dev = make_dev(<literal>&amp;</literal>echo_cdevsw,
0, 0,
UID_ROOT, UID_ROOT,
GID_WHEEL, GID_WHEEL,

View file

@ -1368,28 +1368,28 @@
</para> </para>
<para> <para>
Below are the typical call sequences when using a map depend Below are the typical call sequences when using a map depend
on the use of the map. The characters -> are used to show on the use of the map. The characters -&gt; are used to show
the flow of time. the flow of time.
</para> </para>
<para> <para>
For a buffer which stays practically fixed during all the For a buffer which stays practically fixed during all the
time between attachment and detachment of a device:</para> time between attachment and detachment of a device:</para>
<para> <para>
bus_dmamem_alloc -> bus_dmamap_load -> ...use buffer... -> bus_dmamem_alloc -&gt; bus_dmamap_load -&gt; ...use buffer... -&gt;
-> bus_dmamap_unload -> bus_dmamem_free -&gt; bus_dmamap_unload -&gt; bus_dmamem_free
</para> </para>
<para>For a buffer that changes frequently and is passed from <para>For a buffer that changes frequently and is passed from
outside the driver: outside the driver:
<!-- XXX is this correct? --> <!-- XXX is this correct? -->
<programlisting> bus_dmamap_create -> <programlisting> bus_dmamap_create -&gt;
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer -> -&gt; bus_dmamap_load -&gt; bus_dmamap_sync(PRE...) -&gt; do transfer -&gt;
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload -> -&gt; bus_dmamap_sync(POST...) -&gt; bus_dmamap_unload -&gt;
... ...
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer -> -&gt; bus_dmamap_load -&gt; bus_dmamap_sync(PRE...) -&gt; do transfer -&gt;
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload -> -&gt; bus_dmamap_sync(POST...) -&gt; bus_dmamap_unload -&gt;
-> bus_dmamap_destroy </programlisting> -&gt; bus_dmamap_destroy </programlisting>
</para> </para>
<para> <para>
@ -1817,8 +1817,8 @@
int pnperror; int pnperror;
int error = 0; int error = 0;
sc->dev = dev; /* link it back */ sc-&gt;dev = dev; /* link it back */
sc->unit = unit; </programlisting> sc-&gt;unit = unit; </programlisting>
<para> <para>
Then check for the PnP devices. The check is carried out by Then check for the PnP devices. The check is carried out by
@ -1875,8 +1875,8 @@
to get the port start value: to get the port start value:
</para> </para>
<programlisting> sc->port0 = bus_get_resource_start(dev, <programlisting> sc-&gt;port0 = bus_get_resource_start(dev,
SYS_RES_IOPORT, 0 /*rid*/); if(sc->port0 == 0) return ENXIO; SYS_RES_IOPORT, 0 /*rid*/); if(sc-&gt;port0 == 0) return ENXIO;
</programlisting> </programlisting>
<para> <para>
@ -1957,7 +1957,7 @@
<programlisting> <programlisting>
if(pnperror /* only for non-PnP devices */ if(pnperror /* only for non-PnP devices */
&#38;&#38; bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port0, &#38;&#38; bus_set_resource(dev, SYS_RES_IOPORT, 0, sc-&gt;port0,
XXX_PORT_COUNT)&lt;0) XXX_PORT_COUNT)&lt;0)
return ENXIO;</programlisting> return ENXIO;</programlisting>
@ -1968,12 +1968,12 @@
</para> </para>
<programlisting> <programlisting>
sc->port0_rid = 0; sc-&gt;port0_rid = 0;
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT, sc-&gt;port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT,
&#38;sc->port0_rid, &#38;sc-&gt;port0_rid,
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE); /*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
if(sc->port0_r == NULL) if(sc-&gt;port0_r == NULL)
return ENXIO;</programlisting> return ENXIO;</programlisting>
<para> <para>
@ -2047,12 +2047,12 @@
</para> </para>
<programlisting> <programlisting>
/* try to find out the config address first */ /* try to find out the config address first */
sc->mem0_p = bus_get_resource_start(dev, SYS_RES_MEMORY, 0 /*rid*/); sc-&gt;mem0_p = bus_get_resource_start(dev, SYS_RES_MEMORY, 0 /*rid*/);
if(sc->mem0_p == 0) { /* nope, not specified by user */ if(sc-&gt;mem0_p == 0) { /* nope, not specified by user */
sc->mem0_p = xxx_read_mem0_from_device_config(sc); sc-&gt;mem0_p = xxx_read_mem0_from_device_config(sc);
if(sc->mem0_p == 0) if(sc-&gt;mem0_p == 0)
/* can't get it from device config registers either */ /* can't get it from device config registers either */
goto bad; goto bad;
} else { } else {
@ -2068,27 +2068,27 @@
* resource which will be automatically handled by the ISA bus. * resource which will be automatically handled by the ISA bus.
*/ */
if(pnperror) { /* only for non-PnP devices */ if(pnperror) { /* only for non-PnP devices */
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/); sc-&gt;mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
if(sc->mem0_size == 0) /* not specified by user */ if(sc-&gt;mem0_size == 0) /* not specified by user */
sc->mem0_size = xxx_read_mem0_size_from_device_config(sc); sc-&gt;mem0_size = xxx_read_mem0_size_from_device_config(sc);
if(sc->mem0_size == 0) { if(sc-&gt;mem0_size == 0) {
/* suppose this is a very old model of device without /* suppose this is a very old model of device without
* auto-configuration features and the user gave no preference, * auto-configuration features and the user gave no preference,
* so assume the minimalistic case * so assume the minimalistic case
* (of course, the real value will vary with the driver) * (of course, the real value will vary with the driver)
*/ */
sc->mem0_size = 8*1024; sc-&gt;mem0_size = 8*1024;
} }
if(xxx_set_mem0_size_on_device(sc) &lt; 0) if(xxx_set_mem0_size_on_device(sc) &lt; 0)
goto bad; /* device does not support that size */ goto bad; /* device does not support that size */
if(bus_set_resource(dev, SYS_RES_MEMORY, /*rid*/0, if(bus_set_resource(dev, SYS_RES_MEMORY, /*rid*/0,
sc->mem0_p, sc->mem0_size)&lt;0) sc-&gt;mem0_p, sc-&gt;mem0_size)&lt;0)
goto bad; goto bad;
} else { } else {
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/); sc-&gt;mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
} </programlisting> } </programlisting>
<para> <para>
@ -2131,46 +2131,46 @@
/* check every resource and free if not zero */ /* check every resource and free if not zero */
/* interrupt handler */ /* interrupt handler */
if(sc->intr_r) { if(sc-&gt;intr_r) {
bus_teardown_intr(sc->dev, sc->intr_r, sc->intr_cookie); bus_teardown_intr(sc-&gt;dev, sc-&gt;intr_r, sc-&gt;intr_cookie);
bus_release_resource(sc->dev, SYS_RES_IRQ, sc->intr_rid, bus_release_resource(sc-&gt;dev, SYS_RES_IRQ, sc-&gt;intr_rid,
sc->intr_r); sc-&gt;intr_r);
sc->intr_r = 0; sc-&gt;intr_r = 0;
} }
/* all kinds of memory maps we could have allocated */ /* all kinds of memory maps we could have allocated */
if(sc->data_p) { if(sc-&gt;data_p) {
bus_dmamap_unload(sc->data_tag, sc->data_map); bus_dmamap_unload(sc-&gt;data_tag, sc-&gt;data_map);
sc->data_p = 0; sc-&gt;data_p = 0;
} }
if(sc->data) { /* sc->data_map may be legitimately equal to 0 */ if(sc-&gt;data) { /* sc-&gt;data_map may be legitimately equal to 0 */
/* the map will also be freed */ /* the map will also be freed */
bus_dmamem_free(sc->data_tag, sc->data, sc->data_map); bus_dmamem_free(sc-&gt;data_tag, sc-&gt;data, sc-&gt;data_map);
sc->data = 0; sc-&gt;data = 0;
} }
if(sc->data_tag) { if(sc-&gt;data_tag) {
bus_dma_tag_destroy(sc->data_tag); bus_dma_tag_destroy(sc-&gt;data_tag);
sc->data_tag = 0; sc-&gt;data_tag = 0;
} }
... free other maps and tags if we have them ... ... free other maps and tags if we have them ...
if(sc->parent_tag) { if(sc-&gt;parent_tag) {
bus_dma_tag_destroy(sc->parent_tag); bus_dma_tag_destroy(sc-&gt;parent_tag);
sc->parent_tag = 0; sc-&gt;parent_tag = 0;
} }
/* release all the bus resources */ /* release all the bus resources */
if(sc->mem0_r) { if(sc-&gt;mem0_r) {
bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->mem0_rid, bus_release_resource(sc-&gt;dev, SYS_RES_MEMORY, sc-&gt;mem0_rid,
sc->mem0_r); sc-&gt;mem0_r);
sc->mem0_r = 0; sc-&gt;mem0_r = 0;
} }
... ...
if(sc->port0_r) { if(sc-&gt;port0_r) {
bus_release_resource(sc->dev, SYS_RES_IOPORT, sc->port0_rid, bus_release_resource(sc-&gt;dev, SYS_RES_IOPORT, sc-&gt;port0_rid,
sc->port0_r); sc-&gt;port0_r);
sc->port0_r = 0; sc-&gt;port0_r = 0;
} }
}</programlisting> }</programlisting>
@ -2215,30 +2215,30 @@
considered an error). considered an error).
</para> </para>
<programlisting> sc->port0_rid = 0; <programlisting> sc-&gt;port0_rid = 0;
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &#38;sc->port0_rid, sc-&gt;port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &#38;sc-&gt;port0_rid,
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE); /*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
if(sc->port0_r == NULL) if(sc-&gt;port0_r == NULL)
return ENXIO; return ENXIO;
/* on-board memory */ /* on-board memory */
sc->mem0_rid = 0; sc-&gt;mem0_rid = 0;
sc->mem0_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &#38;sc->mem0_rid, sc-&gt;mem0_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &#38;sc-&gt;mem0_rid,
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE); /*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
if(sc->mem0_r == NULL) if(sc-&gt;mem0_r == NULL)
goto bad; goto bad;
/* get its virtual address */ /* get its virtual address */
sc->mem0_v = rman_get_virtual(sc->mem0_r);</programlisting> sc-&gt;mem0_v = rman_get_virtual(sc-&gt;mem0_r);</programlisting>
<para>The DMA request channel (DRQ) is allocated likewise. To <para>The DMA request channel (DRQ) is allocated likewise. To
initialize it use functions of the initialize it use functions of the
<function>isa_dma*()</function> family. For example: <function>isa_dma*()</function> family. For example:
</para> </para>
<para><function>isa_dmacascade(sc->drq0);</function></para> <para><function>isa_dmacascade(sc-&gt;drq0);</function></para>
<para>The interrupt request line (IRQ) is a bit <para>The interrupt request line (IRQ) is a bit
special. Besides allocation the driver's interrupt handler special. Besides allocation the driver's interrupt handler
@ -2257,19 +2257,19 @@
</para> </para>
<programlisting> <programlisting>
sc->intr_rid = 0; sc-&gt;intr_rid = 0;
sc->intr_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &#38;sc->intr_rid, sc-&gt;intr_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &#38;sc-&gt;intr_rid,
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE); /*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
if(sc->intr_r == NULL) if(sc-&gt;intr_r == NULL)
goto bad; goto bad;
/* /*
* XXX_INTR_TYPE is supposed to be defined depending on the type of * XXX_INTR_TYPE is supposed to be defined depending on the type of
* the driver, for example as INTR_TYPE_CAM for a CAM driver * the driver, for example as INTR_TYPE_CAM for a CAM driver
*/ */
error = bus_setup_intr(dev, sc->intr_r, XXX_INTR_TYPE, error = bus_setup_intr(dev, sc-&gt;intr_r, XXX_INTR_TYPE,
(driver_intr_t *) xxx_intr, (void *) sc, &#38;sc->intr_cookie); (driver_intr_t *) xxx_intr, (void *) sc, &#38;sc-&gt;intr_cookie);
if(error) if(error)
goto bad; goto bad;
@ -2286,12 +2286,12 @@
/*maxsize*/ BUS_SPACE_MAXSIZE_24BIT, /*maxsize*/ BUS_SPACE_MAXSIZE_24BIT,
/*nsegments*/ BUS_SPACE_UNRESTRICTED, /*nsegments*/ BUS_SPACE_UNRESTRICTED,
/*maxsegsz*/ BUS_SPACE_MAXSIZE_24BIT, /*flags*/ 0, /*maxsegsz*/ BUS_SPACE_MAXSIZE_24BIT, /*flags*/ 0,
&#38;sc->parent_tag); &#38;sc-&gt;parent_tag);
if(error) if(error)
goto bad; goto bad;
/* many things get inherited from the parent tag /* many things get inherited from the parent tag
* sc->data is supposed to point to the structure with the shared data, * sc-&gt;data is supposed to point to the structure with the shared data,
* for example for a ring buffer it could be: * for example for a ring buffer it could be:
* struct { * struct {
* u_short rd_pos; * u_short rd_pos;
@ -2299,21 +2299,21 @@
* char bf[XXX_RING_BUFFER_SIZE] * char bf[XXX_RING_BUFFER_SIZE]
* } *data; * } *data;
*/ */
error=bus_dma_tag_create(sc->parent_tag, 1, error=bus_dma_tag_create(sc-&gt;parent_tag, 1,
0, BUS_SPACE_MAXADDR, 0, /*filter*/ NULL, /*filterarg*/ NULL, 0, BUS_SPACE_MAXADDR, 0, /*filter*/ NULL, /*filterarg*/ NULL,
/*maxsize*/ sizeof(* sc->data), /*nsegments*/ 1, /*maxsize*/ sizeof(* sc-&gt;data), /*nsegments*/ 1,
/*maxsegsz*/ sizeof(* sc->data), /*flags*/ 0, /*maxsegsz*/ sizeof(* sc-&gt;data), /*flags*/ 0,
&#38;sc->data_tag); &#38;sc-&gt;data_tag);
if(error) if(error)
goto bad; goto bad;
error = bus_dmamem_alloc(sc->data_tag, &#38;sc->data, /* flags*/ 0, error = bus_dmamem_alloc(sc-&gt;data_tag, &#38;sc-&gt;data, /* flags*/ 0,
&#38;sc->data_map); &#38;sc-&gt;data_map);
if(error) if(error)
goto bad; goto bad;
/* xxx_alloc_callback() just saves the physical address at /* xxx_alloc_callback() just saves the physical address at
* the pointer passed as its argument, in this case &#38;sc->data_p. * the pointer passed as its argument, in this case &#38;sc-&gt;data_p.
* See details in the section on bus memory mapping. * See details in the section on bus memory mapping.
* It can be implemented like: * It can be implemented like:
* *
@ -2324,8 +2324,8 @@
* *(bus_addr_t *)arg = seg[0].ds_addr; * *(bus_addr_t *)arg = seg[0].ds_addr;
* } * }
*/ */
bus_dmamap_load(sc->data_tag, sc->data_map, (void *)sc->data, bus_dmamap_load(sc-&gt;data_tag, sc-&gt;data_map, (void *)sc-&gt;data,
sizeof (* sc->data), xxx_alloc_callback, (void *) &#38;sc->data_p, sizeof (* sc-&gt;data), xxx_alloc_callback, (void *) &#38;sc-&gt;data_p,
/*flags*/0);</programlisting> /*flags*/0);</programlisting>
@ -2343,7 +2343,7 @@
device it may do so, for example:</para> device it may do so, for example:</para>
<programlisting> <programlisting>
device_printf(dev, "has on-card FIFO buffer of %d bytes\n", sc->fifosize); device_printf(dev, "has on-card FIFO buffer of %d bytes\n", sc-&gt;fifosize);
</programlisting> </programlisting>
<para>If the initialization routine experiences any problems <para>If the initialization routine experiences any problems

View file

@ -214,20 +214,20 @@ jail(p, uap)
syscallarg(struct jail *) jail; syscallarg(struct jail *) jail;
} */ *uap;</programlisting> } */ *uap;</programlisting>
<para>Therefore, <literal>uap->jail</literal> would access the <para>Therefore, <literal>uap-&gt;jail</literal> would access the
jail structure which was passed to the system call. Next, jail structure which was passed to the system call. Next,
the system call copies the jail structure into kernel space the system call copies the jail structure into kernel space
using the <literal>copyin()</literal> using the <literal>copyin()</literal>
function. <literal>copyin()</literal> takes three arguments: function. <literal>copyin()</literal> takes three arguments:
the data which is to be copied into kernel space, the data which is to be copied into kernel space,
<literal>uap->jail</literal>, where to store it, <literal>uap-&gt;jail</literal>, where to store it,
<literal>j</literal> and the size of the storage. The jail <literal>j</literal> and the size of the storage. The jail
structure <literal>uap->jail</literal> is copied into kernel structure <literal>uap-&gt;jail</literal> is copied into kernel
space and stored in another jail structure, space and stored in another jail structure,
<literal>j</literal>.</para> <literal>j</literal>.</para>
<programlisting><filename>/usr/src/sys/kern/kern_jail.c: </filename> <programlisting><filename>/usr/src/sys/kern/kern_jail.c: </filename>
error = copyin(uap->jail, <![CDATA[&j]]>, sizeof j);</programlisting> error = copyin(uap-&gt;jail, <![CDATA[&j]]>, sizeof j);</programlisting>
<para>There is another important structure defined in <para>There is another important structure defined in
jail.h. It is the prison structure jail.h. It is the prison structure
@ -251,7 +251,7 @@ struct prison {
<programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename>: <programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename>:
MALLOC(pr, struct prison *, sizeof *pr , M_PRISON, M_WAITOK); MALLOC(pr, struct prison *, sizeof *pr , M_PRISON, M_WAITOK);
bzero((caddr_t)pr, sizeof *pr); bzero((caddr_t)pr, sizeof *pr);
error = copyinstr(j.hostname, <![CDATA[&pr->pr_host]]>, sizeof pr->pr_host, 0); error = copyinstr(j.hostname, <![CDATA[&pr-&gt;pr_host]]>, sizeof pr-&gt;pr_host, 0);
if (error) if (error)
goto bail;</programlisting> goto bail;</programlisting>
@ -292,20 +292,20 @@ struct prison *p_prison;
<para>In <filename>kern_jail.c</filename>, the function then <para>In <filename>kern_jail.c</filename>, the function then
copies the pr structure, which is filled with all the copies the pr structure, which is filled with all the
information from the original jail structure, over to the information from the original jail structure, over to the
<literal>p->p_prison</literal> structure. It then does a <literal>p-&gt;p_prison</literal> structure. It then does a
bitwise OR of <literal>p->p_flag</literal> with the constant bitwise OR of <literal>p-&gt;p_flag</literal> with the constant
<literal>P_JAILED</literal>, meaning that the calling <literal>P_JAILED</literal>, meaning that the calling
process is now recognized as jailed. The parent process of process is now recognized as jailed. The parent process of
each process, forked within the jail, is the program jail each process, forked within the jail, is the program jail
itself, as it calls the &man.jail.2; system call. When the itself, as it calls the &man.jail.2; system call. When the
program is executed through execve, it inherits the program is executed through execve, it inherits the
properties of its parents proc structure, therefore it has properties of its parents proc structure, therefore it has
the <literal>p->p_flag</literal> set, and the the <literal>p-&gt;p_flag</literal> set, and the
<literal>p->p_prison</literal> structure is filled.</para> <literal>p-&gt;p_prison</literal> structure is filled.</para>
<programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename> <programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename>
p->p.prison = pr; p-&gt;p.prison = pr;
p->p.flag |= P.JAILED;</programlisting> p-&gt;p.flag |= P.JAILED;</programlisting>
<para>When a process is forked from a parent process, the <para>When a process is forked from a parent process, the
&man.fork.2; system call deals differently with imprisoned &man.fork.2; system call deals differently with imprisoned
@ -316,15 +316,15 @@ p->p.flag |= P.JAILED;</programlisting>
to the child's unfilled <literal>proc</literal> to the child's unfilled <literal>proc</literal>
structure. After copying all relevant data between the structure. After copying all relevant data between the
structures, &man.fork.2; checks if the structure structures, &man.fork.2; checks if the structure
<literal>p->p_prison</literal> is filled on <literal>p-&gt;p_prison</literal> is filled on
<literal>p2</literal>. If it is, it increments the <literal>p2</literal>. If it is, it increments the
<literal>pr.ref</literal> by one, and sets the <literal>pr.ref</literal> by one, and sets the
<literal>p_flag</literal> to one on the child process.</para> <literal>p_flag</literal> to one on the child process.</para>
<programlisting><filename>/usr/src/sys/kern/kern_fork.c</filename>: <programlisting><filename>/usr/src/sys/kern/kern_fork.c</filename>:
if (p2->p_prison) { if (p2-&gt;p_prison) {
p2->p_prison->pr_ref++; p2-&gt;p_prison-&gt;pr_ref++;
p2->p_flag |= P_JAILED; p2-&gt;p_flag |= P_JAILED;
}</programlisting> }</programlisting>
</sect3> </sect3>
@ -339,7 +339,7 @@ if (p2->p_prison) {
the process is jailed, and if so, returns an error. For the process is jailed, and if so, returns an error. For
example:</para> example:</para>
<programlisting>if (p->p_prison) <programlisting>if (p-&gt;p_prison)
return EPERM;</programlisting> return EPERM;</programlisting>
<sect2> <sect2>
@ -385,7 +385,7 @@ if (p2->p_prison) {
conditional:</para> conditional:</para>
<programlisting><filename>/usr/src/sys/kern/sysv msg.c</filename>: <programlisting><filename>/usr/src/sys/kern/sysv msg.c</filename>:
if (!jail.sysvipc.allowed && p->p_prison != NULL) if (!jail.sysvipc.allowed &amp;&amp; p-&gt;p_prison != NULL)
return (ENOSYS);</programlisting> return (ENOSYS);</programlisting>
<indexterm><primary>semaphores</primary></indexterm> <indexterm><primary>semaphores</primary></indexterm>
@ -473,9 +473,9 @@ int socreate(dom, aso, type, proto, p)
register struct protosw *prp; register struct protosw *prp;
... ...
{ {
if (p->p_prison && jail_socket_unixiproute_only && if (p-&gt;p_prison &amp;&amp; jail_socket_unixiproute_only &amp;&amp;
prp->pr_domain->dom_family != PR_LOCAL && prp->pr_domain->dom_family != PF_INET prp-&gt;pr_domain-&gt;dom_family != PR_LOCAL &amp;&amp; prp-&gt;pr_domain-&gt;dom_family != PF_INET
&& prp->pr_domain->dom_family != PF_ROUTE) &amp;&amp; prp-&gt;pr_domain-&gt;dom_family != PF_ROUTE)
return (EPROTONOSUPPORT); return (EPROTONOSUPPORT);
... ...
}</programlisting> }</programlisting>
@ -498,7 +498,7 @@ register struct protosw *prp;
static int bpfopen(dev, flags, fmt, p) static int bpfopen(dev, flags, fmt, p)
... ...
{ {
if (p->p_prison) if (p-&gt;p_prison)
return (EPERM); return (EPERM);
... ...
}</programlisting> }</programlisting>
@ -538,8 +538,8 @@ int in.pcbbind(int, nam, p)
if (nam) { if (nam) {
sin = (struct sockaddr.in *)nam; sin = (struct sockaddr.in *)nam;
... ...
if (sin->sin_addr.s_addr != INADDR_ANY) if (sin-&gt;sin_addr.s_addr != INADDR_ANY)
if (prison.ip(p, 0, <![CDATA[&sin]]>->sin.addr.s_addr)) if (prison.ip(p, 0, <![CDATA[&sin]]>-&gt;sin.addr.s_addr))
return (EINVAL); return (EINVAL);
.... ....
} }
@ -559,7 +559,7 @@ int in.pcbbind(int, nam, p)
int prison_ip(struct proc *p, int flag, u_int32_t *ip) { int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
u_int32_t tmp; u_int32_t tmp;
if (!p->p_prison) if (!p-&gt;p_prison)
return (0); return (0);
if (flag) if (flag)
tmp = *ip; tmp = *ip;
@ -567,12 +567,12 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
if (tmp == INADDR_ANY) { if (tmp == INADDR_ANY) {
if (flag) if (flag)
*ip = p->p_prison->pr_ip; *ip = p-&gt;p_prison-&gt;pr_ip;
else *ip = htonl(p->p_prison->pr_ip); else *ip = htonl(p-&gt;p_prison-&gt;pr_ip);
return (0); return (0);
} }
if (p->p_prison->pr_ip != tmp) if (p-&gt;p_prison-&gt;pr_ip != tmp)
return (1); return (1);
return (0); return (0);
}</programlisting> }</programlisting>
@ -584,13 +584,13 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
<programlisting><filename>/usr/src/sys/net inet/in_pcb.c</filename> <programlisting><filename>/usr/src/sys/net inet/in_pcb.c</filename>
if (nam) { if (nam) {
... ...
lport = sin->sin.port; lport = sin-&gt;sin.port;
... if (lport) { ... if (lport) {
... ...
if (p && p->p_prison) if (p &amp;&amp; p-&gt;p_prison)
prison = 1; prison = 1;
if (prison && if (prison &amp;&amp;
prison_ip(p, 0, <![CDATA[&sin]]>->sin_addr.s_addr)) prison_ip(p, 0, <![CDATA[&sin]]>-&gt;sin_addr.s_addr))
return (EADDRNOTAVAIL);</programlisting> return (EADDRNOTAVAIL);</programlisting>
</sect2> </sect2>
@ -607,10 +607,10 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
int ufs.setattr(ap) int ufs.setattr(ap)
... ...
{ {
if ((cred->cr.uid == 0) && (p->prison == NULL)) { if ((cred-&gt;cr.uid == 0) &amp;&amp; (p-&gt;prison == NULL)) {
if ((ip->i_flags if ((ip-&gt;i_flags
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) && &amp; (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) &amp;&amp;
securelevel > 0) securelevel &gt; 0)
return (EPERM); return (EPERM);
}</programlisting> }</programlisting>

View file

@ -81,7 +81,7 @@
<para>These indirections can be visualized as the <para>These indirections can be visualized as the
following:</para> following:</para>
<programlisting>object->cache<->class</programlisting> <programlisting>object-&gt;cache&lt;-&gt;class</programlisting>
</sect1> </sect1>

View file

@ -100,7 +100,7 @@
<para>A list of data structures or data structure members <para>A list of data structures or data structure members
that this entry protects. For data structure members, the that this entry protects. For data structure members, the
name will be in the form of name will be in the form of
<structname/structure name/.<structfield/member name/.</para> &lt;structname/structure name/.&lt;structfield/member name/.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -153,38 +153,38 @@
<varname>cnt.v_swtch</varname>, <varname>cnt.v_swtch</varname>,
<varname>cp_time</varname>, <varname>cp_time</varname>,
<varname>curpriority</varname>, <varname>curpriority</varname>,
<structname/mtx/.<structfield/mtx_blocked/, &lt;structname/mtx/.&lt;structfield/mtx_blocked/,
<structname/mtx/.<structfield/mtx_contested/, &lt;structname/mtx/.&lt;structfield/mtx_contested/,
<structname/proc/.<structfield/p_procq/, &lt;structname/proc/.&lt;structfield/p_procq/,
<structname/proc/.<structfield/p_slpq/, &lt;structname/proc/.&lt;structfield/p_slpq/,
<structname/proc/.<structfield/p_sflag/ &lt;structname/proc/.&lt;structfield/p_sflag/
<structname/proc/.<structfield/p_stat/, &lt;structname/proc/.&lt;structfield/p_stat/,
<structname/proc/.<structfield/p_estcpu/, &lt;structname/proc/.&lt;structfield/p_estcpu/,
<structname/proc/.<structfield/p_cpticks/ &lt;structname/proc/.&lt;structfield/p_cpticks/
<structname/proc/.<structfield/p_pctcpu/, &lt;structname/proc/.&lt;structfield/p_pctcpu/,
<structname/proc/.<structfield/p_wchan/, &lt;structname/proc/.&lt;structfield/p_wchan/,
<structname/proc/.<structfield/p_wmesg/, &lt;structname/proc/.&lt;structfield/p_wmesg/,
<structname/proc/.<structfield/p_swtime/, &lt;structname/proc/.&lt;structfield/p_swtime/,
<structname/proc/.<structfield/p_slptime/, &lt;structname/proc/.&lt;structfield/p_slptime/,
<structname/proc/.<structfield/p_runtime/, &lt;structname/proc/.&lt;structfield/p_runtime/,
<structname/proc/.<structfield/p_uu/, &lt;structname/proc/.&lt;structfield/p_uu/,
<structname/proc/.<structfield/p_su/, &lt;structname/proc/.&lt;structfield/p_su/,
<structname/proc/.<structfield/p_iu/, &lt;structname/proc/.&lt;structfield/p_iu/,
<structname/proc/.<structfield/p_uticks/, &lt;structname/proc/.&lt;structfield/p_uticks/,
<structname/proc/.<structfield/p_sticks/, &lt;structname/proc/.&lt;structfield/p_sticks/,
<structname/proc/.<structfield/p_iticks/, &lt;structname/proc/.&lt;structfield/p_iticks/,
<structname/proc/.<structfield/p_oncpu/, &lt;structname/proc/.&lt;structfield/p_oncpu/,
<structname/proc/.<structfield/p_lastcpu/, &lt;structname/proc/.&lt;structfield/p_lastcpu/,
<structname/proc/.<structfield/p_rqindex/, &lt;structname/proc/.&lt;structfield/p_rqindex/,
<structname/proc/.<structfield/p_heldmtx/, &lt;structname/proc/.&lt;structfield/p_heldmtx/,
<structname/proc/.<structfield/p_blocked/, &lt;structname/proc/.&lt;structfield/p_blocked/,
<structname/proc/.<structfield/p_mtxname/, &lt;structname/proc/.&lt;structfield/p_mtxname/,
<structname/proc/.<structfield/p_contested/, &lt;structname/proc/.&lt;structfield/p_contested/,
<structname/proc/.<structfield/p_priority/, &lt;structname/proc/.&lt;structfield/p_priority/,
<structname/proc/.<structfield/p_usrpri/, &lt;structname/proc/.&lt;structfield/p_usrpri/,
<structname/proc/.<structfield/p_nativepri/, &lt;structname/proc/.&lt;structfield/p_nativepri/,
<structname/proc/.<structfield/p_nice/, &lt;structname/proc/.&lt;structfield/p_nice/,
<structname/proc/.<structfield/p_rtprio/, &lt;structname/proc/.&lt;structfield/p_rtprio/,
<varname>pscnt</varname>, <varname>pscnt</varname>,
<varname>slpque</varname>, <varname>slpque</varname>,
<varname>itqueuebits</varname>, <varname>itqueuebits</varname>,
@ -259,8 +259,8 @@
<varname>callfree</varname>, <varname>callfree</varname>,
<varname>callwheel</varname>, <varname>callwheel</varname>,
<varname>nextsoftcheck</varname>, <varname>nextsoftcheck</varname>,
<structname/proc/.<structfield/p_itcallout/, &lt;structname/proc/.&lt;structfield/p_itcallout/,
<structname/proc/.<structfield/p_slpcallout/, &lt;structname/proc/.&lt;structfield/p_slpcallout/,
<varname>softticks</varname>, <varname>softticks</varname>,
<varname>ticks</varname> <varname>ticks</varname>
</entry> </entry>
@ -302,16 +302,16 @@
<varname>allproc</varname> <varname>allproc</varname>
<varname>zombproc</varname> <varname>zombproc</varname>
<varname>pidhashtbl</varname> <varname>pidhashtbl</varname>
<structname/proc/.<structfield/p_list/ &lt;structname/proc/.&lt;structfield/p_list/
<structname/proc/.<structfield/p_hash/ &lt;structname/proc/.&lt;structfield/p_hash/
<varname>nextpid</varname> <varname>nextpid</varname>
</entry> </entry>
</row> </row>
<row> <row>
<entry><varname>proctree_lock</varname></entry> <entry><varname>proctree_lock</varname></entry>
<entry> <entry>
<structname/proc/.<structfield/p_children/ &lt;structname/proc/.&lt;structfield/p_children/
<structname/proc/.<structfield/p_sibling/ &lt;structname/proc/.&lt;structfield/p_sibling/
</entry> </entry>
</row> </row>
</tbody> </tbody>
@ -334,7 +334,7 @@
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para><structname/mtx/.<structfield/mtx_lock/</para> <para>&lt;structname/mtx/.&lt;structfield/mtx_lock/</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>

View file

@ -2210,9 +2210,9 @@
(object-specific wait) \ (object-specific wait) \
Label creation o Label creation o
\ \
Relabel events, o--<--. Relabel events, o--&lt;--.
Various object-specific, | | Various object-specific, | |
Access control events ~-->--o Access control events ~--&gt;--o
\ \
Label destruction o</programlisting> Label destruction o</programlisting>
@ -2301,7 +2301,7 @@ Label destruction o</programlisting>
<row> <row>
<entry><parameter>fslabel</parameter></entry> <entry><parameter>fslabel</parameter></entry>
<entry>Devfs file system label <entry>Devfs file system label
(<varname>mp->mnt_fslabel</varname>)</entry> (<varname>mp-&gt;mnt_fslabel</varname>)</entry>
</row> </row>
<row> <row>
@ -4422,8 +4422,6 @@ Label destruction o</programlisting>
update label.</para> update label.</para>
</sect4> </sect4>
</sect3> </sect3>
</sect2> </sect2>

View file

@ -228,8 +228,8 @@ wi_pccard_probe(dev)
if ((pp = pccard_product_lookup(dev, wi_pccard_products, if ((pp = pccard_product_lookup(dev, wi_pccard_products,
sizeof(wi_pccard_products[0]), NULL)) != NULL) { sizeof(wi_pccard_products[0]), NULL)) != NULL) {
if (pp->pp_name != NULL) if (pp-&gt;pp_name != NULL)
device_set_desc(dev, pp->pp_name); device_set_desc(dev, pp-&gt;pp_name);
return (0); return (0);
} }
return (ENXIO); return (ENXIO);

View file

@ -25,7 +25,7 @@
* Murray Stokely * Murray Stokely
*/ */
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MIN(a,b) (((a) &lt; (b)) ? (a) : (b))
#include &lt;sys/param.h&gt; /* defines used in kernel.h */ #include &lt;sys/param.h&gt; /* defines used in kernel.h */
#include &lt;sys/module.h&gt; #include &lt;sys/module.h&gt;
@ -127,7 +127,7 @@ mypci_attach(device_t dev)
{ {
printf("MyPCI Attach for : deviceID : 0x%x\n",pci_get_vendor(dev)); printf("MyPCI Attach for : deviceID : 0x%x\n",pci_get_vendor(dev));
sdev = make_dev(<literal>&</literal>mypci_cdevsw, 0, UID_ROOT, sdev = make_dev(<literal>&amp;</literal>mypci_cdevsw, 0, UID_ROOT,
GID_WHEEL, 0600, "mypci"); GID_WHEEL, 0600, "mypci");
printf("Mypci device loaded.\n"); printf("Mypci device loaded.\n");
return (ENXIO); return (ENXIO);
@ -235,27 +235,27 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
<para>For example, a typical driver might have something similar <para>For example, a typical driver might have something similar
to this in the <function>attach()</function> function:</para> to this in the <function>attach()</function> function:</para>
<programlisting> sc->bar0id = PCIR_BAR(0); <programlisting> sc-&gt;bar0id = PCIR_BAR(0);
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &amp;(sc->bar0id), sc-&gt;bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &amp;(sc-&gt;bar0id),
0, ~0, 1, RF_ACTIVE); 0, ~0, 1, RF_ACTIVE);
if (sc->bar0res == NULL) { if (sc-&gt;bar0res == NULL) {
printf("Memory allocation of PCI base register 0 failed!\n"); printf("Memory allocation of PCI base register 0 failed!\n");
error = ENXIO; error = ENXIO;
goto fail1; goto fail1;
} }
sc->bar1id = PCIR_BAR(1); sc-&gt;bar1id = PCIR_BAR(1);
sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &amp;(sc->bar1id), sc-&gt;bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &amp;(sc-&gt;bar1id),
0, ~0, 1, RF_ACTIVE); 0, ~0, 1, RF_ACTIVE);
if (sc->bar1res == NULL) { if (sc-&gt;bar1res == NULL) {
printf("Memory allocation of PCI base register 1 failed!\n"); printf("Memory allocation of PCI base register 1 failed!\n");
error = ENXIO; error = ENXIO;
goto fail2; goto fail2;
} }
sc->bar0_bt = rman_get_bustag(sc->bar0res); sc-&gt;bar0_bt = rman_get_bustag(sc-&gt;bar0res);
sc->bar0_bh = rman_get_bushandle(sc->bar0res); sc-&gt;bar0_bh = rman_get_bushandle(sc-&gt;bar0res);
sc->bar1_bt = rman_get_bustag(sc->bar1res); sc-&gt;bar1_bt = rman_get_bustag(sc-&gt;bar1res);
sc->bar1_bh = rman_get_bushandle(sc->bar1res);</programlisting> sc-&gt;bar1_bh = rman_get_bushandle(sc-&gt;bar1res);</programlisting>
<para>Handles for each base address register are kept in the <para>Handles for each base address register are kept in the
<structname>softc</structname> structure so that they can be <structname>softc</structname> structure so that they can be
@ -268,7 +268,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
<programlisting>uint16_t <programlisting>uint16_t
board_read(struct ni_softc *sc, uint16_t address) { board_read(struct ni_softc *sc, uint16_t address) {
return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address); return bus_space_read_2(sc-&gt;bar1_bt, sc-&gt;bar1_bh, address);
} }
</programlisting> </programlisting>
@ -276,7 +276,7 @@ board_read(struct ni_softc *sc, uint16_t address) {
<programlisting>void <programlisting>void
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) { board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value); bus_space_write_2(sc-&gt;bar1_bt, sc-&gt;bar1_bh, address, value);
} }
</programlisting> </programlisting>
@ -301,10 +301,10 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
<programlisting>/* Get the IRQ resource */ <programlisting>/* Get the IRQ resource */
sc->irqid = 0x0; sc-&gt;irqid = 0x0;
sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &amp;(sc->irqid), sc-&gt;irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &amp;(sc-&gt;irqid),
0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
if (sc->irqres == NULL) { if (sc-&gt;irqres == NULL) {
printf("IRQ allocation failed!\n"); printf("IRQ allocation failed!\n");
error = ENXIO; error = ENXIO;
goto fail3; goto fail3;
@ -312,15 +312,15 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
/* Now we should set up the interrupt handler */ /* Now we should set up the interrupt handler */
error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC, error = bus_setup_intr(dev, sc-&gt;irqres, INTR_TYPE_MISC,
my_handler, sc, &amp;(sc->handler)); my_handler, sc, &amp;(sc-&gt;handler));
if (error) { if (error) {
printf("Couldn't set up irq\n"); printf("Couldn't set up irq\n");
goto fail4; goto fail4;
} }
sc->irq_bt = rman_get_bustag(sc->irqres); sc-&gt;irq_bt = rman_get_bustag(sc-&gt;irqres);
sc->irq_bh = rman_get_bushandle(sc->irqres); sc-&gt;irq_bh = rman_get_bushandle(sc-&gt;irqres);
</programlisting> </programlisting>
<para>Some care must be taken in the detach routine of the <para>Some care must be taken in the detach routine of the

View file

@ -281,8 +281,8 @@
error; /* some code to handle the error */ error; /* some code to handle the error */
} }
softc->wpath = path; softc-&gt;wpath = path;
softc->sim = sim;</programlisting> softc-&gt;sim = sim;</programlisting>
<para>As you can see the path includes:</para> <para>As you can see the path includes:</para>
@ -385,15 +385,15 @@
switch:</para> switch:</para>
<programlisting> struct xxx_softc *softc = (struct xxx_softc *) cam_sim_softc(sim); <programlisting> struct xxx_softc *softc = (struct xxx_softc *) cam_sim_softc(sim);
struct ccb_hdr *ccb_h = &amp;ccb->ccb_h; struct ccb_hdr *ccb_h = &amp;ccb-&gt;ccb_h;
int unit = cam_sim_unit(sim); int unit = cam_sim_unit(sim);
int bus = cam_sim_bus(sim); int bus = cam_sim_bus(sim);
switch(ccb_h->func_code) { switch(ccb_h-&gt;func_code) {
case ...: case ...:
... ...
default: default:
ccb_h->status = CAM_REQ_INVALID; ccb_h-&gt;status = CAM_REQ_INVALID;
xpt_done(ccb); xpt_done(ccb);
break; break;
}</programlisting> }</programlisting>
@ -584,9 +584,9 @@
make sure that the command did not get aborted when it was make sure that the command did not get aborted when it was
sitting in the queue:</para> sitting in the queue:</para>
<programlisting> struct ccb_scsiio *csio = &amp;ccb->csio; <programlisting> struct ccb_scsiio *csio = &amp;ccb-&gt;csio;
if ((ccb_h->status &amp; CAM_STATUS_MASK) != CAM_REQ_INPROG) { if ((ccb_h-&gt;status &amp; CAM_STATUS_MASK) != CAM_REQ_INPROG) {
xpt_done(ccb); xpt_done(ccb);
return; return;
}</programlisting> }</programlisting>
@ -594,14 +594,14 @@
<para>Also we check that the device is supported at all by our <para>Also we check that the device is supported at all by our
controller:</para> controller:</para>
<programlisting> if(ccb_h->target_id > OUR_MAX_SUPPORTED_TARGET_ID <programlisting> if(ccb_h-&gt;target_id &gt; OUR_MAX_SUPPORTED_TARGET_ID
|| cch_h->target_id == OUR_SCSI_CONTROLLERS_OWN_ID) { || cch_h-&gt;target_id == OUR_SCSI_CONTROLLERS_OWN_ID) {
ccb_h->status = CAM_TID_INVALID; ccb_h-&gt;status = CAM_TID_INVALID;
xpt_done(ccb); xpt_done(ccb);
return; return;
} }
if(ccb_h->target_lun > OUR_MAX_SUPPORTED_LUN) { if(ccb_h-&gt;target_lun &gt; OUR_MAX_SUPPORTED_LUN) {
ccb_h->status = CAM_LUN_INVALID; ccb_h-&gt;status = CAM_LUN_INVALID;
xpt_done(ccb); xpt_done(ccb);
return; return;
}</programlisting> }</programlisting>
@ -621,15 +621,15 @@
<programlisting> struct xxx_hcb *hcb = allocate_hcb(softc, unit, bus); <programlisting> struct xxx_hcb *hcb = allocate_hcb(softc, unit, bus);
if(hcb == NULL) { if(hcb == NULL) {
softc->flags |= RESOURCE_SHORTAGE; softc-&gt;flags |= RESOURCE_SHORTAGE;
xpt_freeze_simq(sim, /*count*/1); xpt_freeze_simq(sim, /*count*/1);
ccb_h->status = CAM_REQUEUE_REQ; ccb_h-&gt;status = CAM_REQUEUE_REQ;
xpt_done(ccb); xpt_done(ccb);
return; return;
} }
hcb->ccb = ccb; ccb_h->ccb_hcb = (void *)hcb; hcb-&gt;ccb = ccb; ccb_h-&gt;ccb_hcb = (void *)hcb;
ccb_h->status |= CAM_SIM_QUEUED;</programlisting> ccb_h-&gt;status |= CAM_SIM_QUEUED;</programlisting>
<para>Extract the target data from CCB into the hardware control <para>Extract the target data from CCB into the hardware control
block. Check if we are asked to assign a tag and if yes then block. Check if we are asked to assign a tag and if yes then
@ -638,10 +638,10 @@
devices to set the maximal mutually supported bus width, devices to set the maximal mutually supported bus width,
synchronous rate and offset.</para> synchronous rate and offset.</para>
<programlisting> hcb->target = ccb_h->target_id; hcb->lun = ccb_h->target_lun; <programlisting> hcb-&gt;target = ccb_h-&gt;target_id; hcb-&gt;lun = ccb_h-&gt;target_lun;
generate_identify_message(hcb); generate_identify_message(hcb);
if( ccb_h->tag_action != CAM_TAG_ACTION_NONE ) if( ccb_h-&gt;tag_action != CAM_TAG_ACTION_NONE )
generate_unique_tag_message(hcb, ccb_h->tag_action); generate_unique_tag_message(hcb, ccb_h-&gt;tag_action);
if( !target_negotiated(hcb) ) if( !target_negotiated(hcb) )
generate_negotiation_messages(hcb);</programlisting> generate_negotiation_messages(hcb);</programlisting>
@ -668,24 +668,24 @@
back to a virtual address but with big pain, so we do not do back to a virtual address but with big pain, so we do not do
that.</para> that.</para>
<programlisting> if(ccb_h->flags &amp; CAM_CDB_POINTER) { <programlisting> if(ccb_h-&gt;flags &amp; CAM_CDB_POINTER) {
/* CDB is a pointer */ /* CDB is a pointer */
if(!(ccb_h->flags &amp; CAM_CDB_PHYS)) { if(!(ccb_h-&gt;flags &amp; CAM_CDB_PHYS)) {
/* CDB pointer is virtual */ /* CDB pointer is virtual */
hcb->cmd = vtobus(csio->cdb_io.cdb_ptr); hcb-&gt;cmd = vtobus(csio-&gt;cdb_io.cdb_ptr);
} else { } else {
/* CDB pointer is physical */ /* CDB pointer is physical */
#if defined(__alpha__) #if defined(__alpha__)
hcb->cmd = csio->cdb_io.cdb_ptr | alpha_XXX_dmamap_or ; hcb-&gt;cmd = csio-&gt;cdb_io.cdb_ptr | alpha_XXX_dmamap_or ;
#else #else
hcb->cmd = csio->cdb_io.cdb_ptr ; hcb-&gt;cmd = csio-&gt;cdb_io.cdb_ptr ;
#endif #endif
} }
} else { } else {
/* CDB is in the ccb (buffer) */ /* CDB is in the ccb (buffer) */
hcb->cmd = vtobus(csio->cdb_io.cdb_bytes); hcb-&gt;cmd = vtobus(csio-&gt;cdb_io.cdb_bytes);
} }
hcb->cmdlen = csio->cdb_len;</programlisting> hcb-&gt;cmdlen = csio-&gt;cdb_len;</programlisting>
<para>Now it is time to set up the data. Again, the data storage <para>Now it is time to set up the data. Again, the data storage
may be specified in the CCB in many interesting ways, may be specified in the CCB in many interesting ways,
@ -693,7 +693,7 @@
data transfer. The simplest case is if there is no data to data transfer. The simplest case is if there is no data to
transfer:</para> transfer:</para>
<programlisting> int dir = (ccb_h->flags &amp; CAM_DIR_MASK); <programlisting> int dir = (ccb_h-&gt;flags &amp; CAM_DIR_MASK);
if (dir == CAM_DIR_NONE) if (dir == CAM_DIR_NONE)
goto end_data;</programlisting> goto end_data;</programlisting>
@ -719,25 +719,25 @@
initialize_hcb_for_data(hcb); initialize_hcb_for_data(hcb);
if((!(ccb_h->flags &amp; CAM_SCATTER_VALID)) { if((!(ccb_h-&gt;flags &amp; CAM_SCATTER_VALID)) {
/* single buffer */ /* single buffer */
if(!(ccb_h->flags &amp; CAM_DATA_PHYS)) { if(!(ccb_h-&gt;flags &amp; CAM_DATA_PHYS)) {
rv = add_virtual_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir); rv = add_virtual_chunk(hcb, csio-&gt;data_ptr, csio-&gt;dxfer_len, dir);
} }
} else { } else {
rv = add_physical_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir); rv = add_physical_chunk(hcb, csio-&gt;data_ptr, csio-&gt;dxfer_len, dir);
} }
} else { } else {
int i; int i;
struct bus_dma_segment *segs; struct bus_dma_segment *segs;
segs = (struct bus_dma_segment *)csio->data_ptr; segs = (struct bus_dma_segment *)csio-&gt;data_ptr;
if ((ccb_h->flags &amp; CAM_SG_LIST_PHYS) != 0) { if ((ccb_h-&gt;flags &amp; CAM_SG_LIST_PHYS) != 0) {
/* The SG list pointer is physical */ /* The SG list pointer is physical */
rv = setup_hcb_for_physical_sg_list(hcb, segs, csio->sglist_cnt); rv = setup_hcb_for_physical_sg_list(hcb, segs, csio-&gt;sglist_cnt);
} else if (!(ccb_h->flags &amp; CAM_DATA_PHYS)) { } else if (!(ccb_h-&gt;flags &amp; CAM_DATA_PHYS)) {
/* SG buffer pointers are virtual */ /* SG buffer pointers are virtual */
for (i = 0; i < csio->sglist_cnt; i++) { for (i = 0; i &lt; csio-&gt;sglist_cnt; i++) {
rv = add_virtual_chunk(hcb, segs[i].ds_addr, rv = add_virtual_chunk(hcb, segs[i].ds_addr,
segs[i].ds_len, dir); segs[i].ds_len, dir);
if (rv != CAM_REQ_CMP) if (rv != CAM_REQ_CMP)
@ -745,7 +745,7 @@
} }
} else { } else {
/* SG buffer pointers are physical */ /* SG buffer pointers are physical */
for (i = 0; i < csio->sglist_cnt; i++) { for (i = 0; i &lt; csio-&gt;sglist_cnt; i++) {
rv = add_physical_chunk(hcb, segs[i].ds_addr, rv = add_physical_chunk(hcb, segs[i].ds_addr,
segs[i].ds_len, dir); segs[i].ds_len, dir);
if (rv != CAM_REQ_CMP) if (rv != CAM_REQ_CMP)
@ -767,7 +767,7 @@
<para>If disconnection is disabled for this CCB we pass this <para>If disconnection is disabled for this CCB we pass this
information to the hcb:</para> information to the hcb:</para>
<programlisting> if(ccb_h->flags &amp; CAM_DIS_DISCONNECT) <programlisting> if(ccb_h-&gt;flags &amp; CAM_DIS_DISCONNECT)
hcb_disable_disconnect(hcb);</programlisting> hcb_disable_disconnect(hcb);</programlisting>
<para>If the controller is able to run REQUEST SENSE command all <para>If the controller is able to run REQUEST SENSE command all
@ -779,8 +779,8 @@
to the hardware and return, the rest will be done by the to the hardware and return, the rest will be done by the
interrupt handler (or timeout handler).</para> interrupt handler (or timeout handler).</para>
<programlisting> ccb_h->timeout_ch = timeout(xxx_timeout, (caddr_t) hcb, <programlisting> ccb_h-&gt;timeout_ch = timeout(xxx_timeout, (caddr_t) hcb,
(ccb_h->timeout * hz) / 1000); /* convert milliseconds to ticks */ (ccb_h-&gt;timeout * hz) / 1000); /* convert milliseconds to ticks */
put_hcb_into_hardware_queue(hcb); put_hcb_into_hardware_queue(hcb);
return;</programlisting> return;</programlisting>
@ -790,20 +790,20 @@
<programlisting> static void <programlisting> static void
free_hcb_and_ccb_done(struct xxx_hcb *hcb, union ccb *ccb, u_int32_t status) free_hcb_and_ccb_done(struct xxx_hcb *hcb, union ccb *ccb, u_int32_t status)
{ {
struct xxx_softc *softc = hcb->softc; struct xxx_softc *softc = hcb-&gt;softc;
ccb->ccb_h.ccb_hcb = 0; ccb-&gt;ccb_h.ccb_hcb = 0;
if(hcb != NULL) { if(hcb != NULL) {
untimeout(xxx_timeout, (caddr_t) hcb, ccb->ccb_h.timeout_ch); untimeout(xxx_timeout, (caddr_t) hcb, ccb-&gt;ccb_h.timeout_ch);
/* we're about to free a hcb, so the shortage has ended */ /* we're about to free a hcb, so the shortage has ended */
if(softc->flags &amp; RESOURCE_SHORTAGE) { if(softc-&gt;flags &amp; RESOURCE_SHORTAGE) {
softc->flags &amp;= ~RESOURCE_SHORTAGE; softc-&gt;flags &amp;= ~RESOURCE_SHORTAGE;
status |= CAM_RELEASE_SIMQ; status |= CAM_RELEASE_SIMQ;
} }
free_hcb(hcb); /* also removes hcb from any internal lists */ free_hcb(hcb); /* also removes hcb from any internal lists */
} }
ccb->ccb_h.status = status | ccb-&gt;ccb_h.status = status |
(ccb->ccb_h.status &amp; ~(CAM_STATUS_MASK|CAM_SIM_QUEUED)); (ccb-&gt;ccb_h.status &amp; ~(CAM_STATUS_MASK|CAM_SIM_QUEUED));
xpt_done(ccb); xpt_done(ccb);
}</programlisting> }</programlisting>
</listitem> </listitem>
@ -856,9 +856,9 @@
reset_scsi_bus(softc); reset_scsi_bus(softc);
/* drop all enqueued CCBs */ /* drop all enqueued CCBs */
for(h = softc->first_queued_hcb; h != NULL; h = hh) { for(h = softc-&gt;first_queued_hcb; h != NULL; h = hh) {
hh = h->next; hh = h-&gt;next;
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_SCSI_BUS_RESET);
} }
/* the clean values of negotiations to report */ /* the clean values of negotiations to report */
@ -868,7 +868,7 @@
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID); | CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
/* drop all disconnected CCBs and clean negotiations */ /* drop all disconnected CCBs and clean negotiations */
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) { for(targ=0; targ &lt;= OUR_MAX_SUPPORTED_TARGET; targ++) {
clean_negotiations(softc, targ); clean_negotiations(softc, targ);
/* report the event if possible */ /* report the event if possible */
@ -879,18 +879,18 @@
xpt_free_path(path); xpt_free_path(path);
} }
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++) for(lun=0; lun &lt;= OUR_MAX_SUPPORTED_LUN; lun++)
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) { for(h = softc-&gt;first_discon_hcb[targ][lun]; h != NULL; h = hh) {
hh=h->next; hh=h-&gt;next;
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_SCSI_BUS_RESET);
} }
} }
ccb->ccb_h.status = CAM_REQ_CMP; ccb-&gt;ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb); xpt_done(ccb);
/* report the event */ /* report the event */
xpt_async(AC_BUS_RESET, softc->wpath, NULL); xpt_async(AC_BUS_RESET, softc-&gt;wpath, NULL);
return;</programlisting> return;</programlisting>
<para>Implementing the SCSI bus reset as a function may be a good <para>Implementing the SCSI bus reset as a function may be a good
@ -915,10 +915,10 @@
check that abort applies to a SCSI transaction:</para> check that abort applies to a SCSI transaction:</para>
<programlisting> struct ccb *abort_ccb; <programlisting> struct ccb *abort_ccb;
abort_ccb = ccb->cab.abort_ccb; abort_ccb = ccb-&gt;cab.abort_ccb;
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) { if(abort_ccb-&gt;ccb_h.func_code != XPT_SCSI_IO) {
ccb->ccb_h.status = CAM_UA_ABORT; ccb-&gt;ccb_h.status = CAM_UA_ABORT;
xpt_done(ccb); xpt_done(ccb);
return; return;
}</programlisting> }</programlisting>
@ -931,12 +931,12 @@
hcb = NULL; hcb = NULL;
/* We assume that softc->first_hcb is the head of the list of all /* We assume that softc-&gt;first_hcb is the head of the list of all
* HCBs associated with this bus, including those enqueued for * HCBs associated with this bus, including those enqueued for
* processing, being processed by hardware and disconnected ones. * processing, being processed by hardware and disconnected ones.
*/ */
for(h = softc->first_hcb; h != NULL; h = h->next) { for(h = softc-&gt;first_hcb; h != NULL; h = h-&gt;next) {
if(h->ccb == abort_ccb) { if(h-&gt;ccb == abort_ccb) {
hcb = h; hcb = h;
break; break;
} }
@ -944,7 +944,7 @@
if(hcb == NULL) { if(hcb == NULL) {
/* no such CCB in our queue */ /* no such CCB in our queue */
ccb->ccb_h.status = CAM_PATH_INVALID; ccb-&gt;ccb_h.status = CAM_PATH_INVALID;
xpt_done(ccb); xpt_done(ccb);
return; return;
} }
@ -994,14 +994,14 @@
yet).</para> yet).</para>
<programlisting> case HCB_BEING_TRANSFERRED: <programlisting> case HCB_BEING_TRANSFERRED:
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch); untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb-&gt;ccb_h.timeout_ch);
abort_ccb->ccb_h.timeout_ch = abort_ccb-&gt;ccb_h.timeout_ch =
timeout(xxx_timeout, (caddr_t) hcb, 10 * hz); timeout(xxx_timeout, (caddr_t) hcb, 10 * hz);
abort_ccb->ccb_h.status = CAM_REQ_ABORTED; abort_ccb-&gt;ccb_h.status = CAM_REQ_ABORTED;
/* ask the controller to abort that HCB, then generate /* ask the controller to abort that HCB, then generate
* an interrupt and stop * an interrupt and stop
*/ */
if(signal_hardware_to_abort_hcb_and_stop(hcb) < 0) { if(signal_hardware_to_abort_hcb_and_stop(hcb) &lt; 0) {
/* oops, we missed the race with hardware, this transaction /* oops, we missed the race with hardware, this transaction
* got off the bus before we aborted it, try again */ * got off the bus before we aborted it, try again */
goto abort_again; goto abort_again;
@ -1015,14 +1015,14 @@
completed.</para> completed.</para>
<programlisting> case HCB_DISCONNECTED: <programlisting> case HCB_DISCONNECTED:
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch); untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb-&gt;ccb_h.timeout_ch);
abort_ccb->ccb_h.timeout_ch = abort_ccb-&gt;ccb_h.timeout_ch =
timeout(xxx_timeout, (caddr_t) hcb, 10 * hz); timeout(xxx_timeout, (caddr_t) hcb, 10 * hz);
put_abort_message_into_hcb(hcb); put_abort_message_into_hcb(hcb);
put_hcb_at_the_front_of_hardware_queue(hcb); put_hcb_at_the_front_of_hardware_queue(hcb);
break; break;
} }
ccb->ccb_h.status = CAM_REQ_CMP; ccb-&gt;ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb); xpt_done(ccb);
return;</programlisting> return;</programlisting>
@ -1041,18 +1041,18 @@
<programlisting> case XPT_ABORT: <programlisting> case XPT_ABORT:
struct ccb *abort_ccb; struct ccb *abort_ccb;
abort_ccb = ccb->cab.abort_ccb; abort_ccb = ccb-&gt;cab.abort_ccb;
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) { if(abort_ccb-&gt;ccb_h.func_code != XPT_SCSI_IO) {
ccb->ccb_h.status = CAM_UA_ABORT; ccb-&gt;ccb_h.status = CAM_UA_ABORT;
xpt_done(ccb); xpt_done(ccb);
return; return;
} }
if(xxx_abort_ccb(abort_ccb, CAM_REQ_ABORTED) < 0) if(xxx_abort_ccb(abort_ccb, CAM_REQ_ABORTED) &lt; 0)
/* no such CCB in our queue */ /* no such CCB in our queue */
ccb->ccb_h.status = CAM_PATH_INVALID; ccb-&gt;ccb_h.status = CAM_PATH_INVALID;
else else
ccb->ccb_h.status = CAM_REQ_CMP; ccb-&gt;ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb); xpt_done(ccb);
return;</programlisting> return;</programlisting>
</listitem> </listitem>
@ -1153,47 +1153,47 @@ of the union ccb:</para>
int targ, lun; int targ, lun;
int flags; int flags;
cts = &amp;ccb->cts; cts = &amp;ccb-&gt;cts;
targ = ccb_h->target_id; targ = ccb_h-&gt;target_id;
lun = ccb_h->target_lun; lun = ccb_h-&gt;target_lun;
flags = cts->flags; flags = cts-&gt;flags;
if(flags &amp; CCB_TRANS_USER_SETTINGS) { if(flags &amp; CCB_TRANS_USER_SETTINGS) {
if(flags &amp; CCB_TRANS_SYNC_RATE_VALID) if(flags &amp; CCB_TRANS_SYNC_RATE_VALID)
softc->user_sync_period[targ] = cts->sync_period; softc-&gt;user_sync_period[targ] = cts-&gt;sync_period;
if(flags &amp; CCB_TRANS_SYNC_OFFSET_VALID) if(flags &amp; CCB_TRANS_SYNC_OFFSET_VALID)
softc->user_sync_offset[targ] = cts->sync_offset; softc-&gt;user_sync_offset[targ] = cts-&gt;sync_offset;
if(flags &amp; CCB_TRANS_BUS_WIDTH_VALID) if(flags &amp; CCB_TRANS_BUS_WIDTH_VALID)
softc->user_bus_width[targ] = cts->bus_width; softc-&gt;user_bus_width[targ] = cts-&gt;bus_width;
if(flags &amp; CCB_TRANS_DISC_VALID) { if(flags &amp; CCB_TRANS_DISC_VALID) {
softc->user_tflags[targ][lun] &amp;= ~CCB_TRANS_DISC_ENB; softc-&gt;user_tflags[targ][lun] &amp;= ~CCB_TRANS_DISC_ENB;
softc->user_tflags[targ][lun] |= flags &amp; CCB_TRANS_DISC_ENB; softc-&gt;user_tflags[targ][lun] |= flags &amp; CCB_TRANS_DISC_ENB;
} }
if(flags &amp; CCB_TRANS_TQ_VALID) { if(flags &amp; CCB_TRANS_TQ_VALID) {
softc->user_tflags[targ][lun] &amp;= ~CCB_TRANS_TQ_ENB; softc-&gt;user_tflags[targ][lun] &amp;= ~CCB_TRANS_TQ_ENB;
softc->user_tflags[targ][lun] |= flags &amp; CCB_TRANS_TQ_ENB; softc-&gt;user_tflags[targ][lun] |= flags &amp; CCB_TRANS_TQ_ENB;
} }
} }
if(flags &amp; CCB_TRANS_CURRENT_SETTINGS) { if(flags &amp; CCB_TRANS_CURRENT_SETTINGS) {
if(flags &amp; CCB_TRANS_SYNC_RATE_VALID) if(flags &amp; CCB_TRANS_SYNC_RATE_VALID)
softc->goal_sync_period[targ] = softc-&gt;goal_sync_period[targ] =
max(cts->sync_period, OUR_MIN_SUPPORTED_PERIOD); max(cts-&gt;sync_period, OUR_MIN_SUPPORTED_PERIOD);
if(flags &amp; CCB_TRANS_SYNC_OFFSET_VALID) if(flags &amp; CCB_TRANS_SYNC_OFFSET_VALID)
softc->goal_sync_offset[targ] = softc-&gt;goal_sync_offset[targ] =
min(cts->sync_offset, OUR_MAX_SUPPORTED_OFFSET); min(cts-&gt;sync_offset, OUR_MAX_SUPPORTED_OFFSET);
if(flags &amp; CCB_TRANS_BUS_WIDTH_VALID) if(flags &amp; CCB_TRANS_BUS_WIDTH_VALID)
softc->goal_bus_width[targ] = min(cts->bus_width, OUR_BUS_WIDTH); softc-&gt;goal_bus_width[targ] = min(cts-&gt;bus_width, OUR_BUS_WIDTH);
if(flags &amp; CCB_TRANS_DISC_VALID) { if(flags &amp; CCB_TRANS_DISC_VALID) {
softc->current_tflags[targ][lun] &amp;= ~CCB_TRANS_DISC_ENB; softc-&gt;current_tflags[targ][lun] &amp;= ~CCB_TRANS_DISC_ENB;
softc->current_tflags[targ][lun] |= flags &amp; CCB_TRANS_DISC_ENB; softc-&gt;current_tflags[targ][lun] |= flags &amp; CCB_TRANS_DISC_ENB;
} }
if(flags &amp; CCB_TRANS_TQ_VALID) { if(flags &amp; CCB_TRANS_TQ_VALID) {
softc->current_tflags[targ][lun] &amp;= ~CCB_TRANS_TQ_ENB; softc-&gt;current_tflags[targ][lun] &amp;= ~CCB_TRANS_TQ_ENB;
softc->current_tflags[targ][lun] |= flags &amp; CCB_TRANS_TQ_ENB; softc-&gt;current_tflags[targ][lun] |= flags &amp; CCB_TRANS_TQ_ENB;
} }
} }
ccb->ccb_h.status = CAM_REQ_CMP; ccb-&gt;ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb); xpt_done(ccb);
return;</programlisting> return;</programlisting>
@ -1205,12 +1205,12 @@ of the union ccb:</para>
<programlisting> int <programlisting> int
target_negotiated(struct xxx_hcb *hcb) target_negotiated(struct xxx_hcb *hcb)
{ {
struct softc *softc = hcb->softc; struct softc *softc = hcb-&gt;softc;
int targ = hcb->targ; int targ = hcb-&gt;targ;
if( softc->current_sync_period[targ] != softc->goal_sync_period[targ] if( softc-&gt;current_sync_period[targ] != softc-&gt;goal_sync_period[targ]
|| softc->current_sync_offset[targ] != softc->goal_sync_offset[targ] || softc-&gt;current_sync_offset[targ] != softc-&gt;goal_sync_offset[targ]
|| softc->current_bus_width[targ] != softc->goal_bus_width[targ] ) || softc-&gt;current_bus_width[targ] != softc-&gt;goal_bus_width[targ] )
return 0; /* FALSE */ return 0; /* FALSE */
else else
return 1; /* TRUE */ return 1; /* TRUE */
@ -1275,21 +1275,21 @@ of the union ccb:</para>
u_int32_t secs_per_cylinder; u_int32_t secs_per_cylinder;
int extended; int extended;
ccg = &amp;ccb->ccg; ccg = &amp;ccb-&gt;ccg;
size_mb = ccg->volume_size size_mb = ccg-&gt;volume_size
/ ((1024L * 1024L) / ccg->block_size); / ((1024L * 1024L) / ccg-&gt;block_size);
extended = check_cards_EEPROM_for_extended_geometry(softc); extended = check_cards_EEPROM_for_extended_geometry(softc);
if (size_mb > 1024 &amp;&amp; extended) { if (size_mb &gt; 1024 &amp;&amp; extended) {
ccg->heads = 255; ccg-&gt;heads = 255;
ccg->secs_per_track = 63; ccg-&gt;secs_per_track = 63;
} else { } else {
ccg->heads = 64; ccg-&gt;heads = 64;
ccg->secs_per_track = 32; ccg-&gt;secs_per_track = 32;
} }
secs_per_cylinder = ccg->heads * ccg->secs_per_track; secs_per_cylinder = ccg-&gt;heads * ccg-&gt;secs_per_track;
ccg->cylinders = ccg->volume_size / secs_per_cylinder; ccg-&gt;cylinders = ccg-&gt;volume_size / secs_per_cylinder;
ccb->ccb_h.status = CAM_REQ_CMP; ccb-&gt;ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb); xpt_done(ccb);
return;</programlisting> return;</programlisting>
@ -1413,7 +1413,7 @@ ccb_pathinq cpi</quote> of the union ccb:</para>
<para>The recommended way of setting the string fields is using <para>The recommended way of setting the string fields is using
strncpy, like:</para> strncpy, like:</para>
<programlisting> strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);</programlisting> <programlisting> strncpy(cpi-&gt;dev_name, cam_sim_name(sim), DEV_IDLEN);</programlisting>
<para>After setting the values set the status to CAM_REQ_CMP and mark the <para>After setting the values set the status to CAM_REQ_CMP and mark the
CCB as done.</para> CCB as done.</para>
@ -1500,7 +1500,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
switch (code) { switch (code) {
case AC_LOST_DEVICE: case AC_LOST_DEVICE:
targ = xpt_path_target_id(path); targ = xpt_path_target_id(path);
if(targ <= OUR_MAX_SUPPORTED_TARGET) { if(targ &lt;= OUR_MAX_SUPPORTED_TARGET) {
clean_negotiations(softc, targ); clean_negotiations(softc, targ);
/* send indication to CAM */ /* send indication to CAM */
neg.bus_width = 8; neg.bus_width = 8;
@ -1585,9 +1585,9 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
struct xxx_hcb *h, *hh; struct xxx_hcb *h, *hh;
/* drop all enqueued CCBs */ /* drop all enqueued CCBs */
for(h = softc->first_queued_hcb; h != NULL; h = hh) { for(h = softc-&gt;first_queued_hcb; h != NULL; h = hh) {
hh = h->next; hh = h-&gt;next;
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_SCSI_BUS_RESET);
} }
/* the clean values of negotiations to report */ /* the clean values of negotiations to report */
@ -1597,7 +1597,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID); | CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
/* drop all disconnected CCBs and clean negotiations */ /* drop all disconnected CCBs and clean negotiations */
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) { for(targ=0; targ &lt;= OUR_MAX_SUPPORTED_TARGET; targ++) {
clean_negotiations(softc, targ); clean_negotiations(softc, targ);
/* report the event if possible */ /* report the event if possible */
@ -1608,18 +1608,18 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
xpt_free_path(path); xpt_free_path(path);
} }
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++) for(lun=0; lun &lt;= OUR_MAX_SUPPORTED_LUN; lun++)
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) { for(h = softc-&gt;first_discon_hcb[targ][lun]; h != NULL; h = hh) {
hh=h->next; hh=h-&gt;next;
if(fatal) if(fatal)
free_hcb_and_ccb_done(h, h->ccb, CAM_UNREC_HBA_ERROR); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_UNREC_HBA_ERROR);
else else
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_SCSI_BUS_RESET);
} }
} }
/* report the event */ /* report the event */
xpt_async(AC_BUS_RESET, softc->wpath, NULL); xpt_async(AC_BUS_RESET, softc-&gt;wpath, NULL);
/* re-initialization may take a lot of time, in such case /* re-initialization may take a lot of time, in such case
* its completion should be signaled by another interrupt or * its completion should be signaled by another interrupt or
@ -1656,7 +1656,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
return; return;
} }
targ = hcb->target; targ = hcb-&gt;target;
hcb_status = get_status_of_current_hcb(softc);</programlisting> hcb_status = get_status_of_current_hcb(softc);</programlisting>
<para>First we check if the HCB has completed and if so we check <para>First we check if the HCB has completed and if so we check
@ -1668,13 +1668,13 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
<para>Then look if this status is related to the REQUEST SENSE <para>Then look if this status is related to the REQUEST SENSE
command and if so handle it in a simple way.</para> command and if so handle it in a simple way.</para>
<programlisting> if(hcb->flags &amp; DOING_AUTOSENSE) { <programlisting> if(hcb-&gt;flags &amp; DOING_AUTOSENSE) {
if(scsi_status == GOOD) { /* autosense was successful */ if(scsi_status == GOOD) { /* autosense was successful */
hcb->ccb->ccb_h.status |= CAM_AUTOSNS_VALID; hcb-&gt;ccb-&gt;ccb_h.status |= CAM_AUTOSNS_VALID;
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR); free_hcb_and_ccb_done(hcb, hcb-&gt;ccb, CAM_SCSI_STATUS_ERROR);
} else { } else {
autosense_failed: autosense_failed:
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_AUTOSENSE_FAIL); free_hcb_and_ccb_done(hcb, hcb-&gt;ccb, CAM_AUTOSENSE_FAIL);
} }
schedule_next_hcb(softc); schedule_next_hcb(softc);
return; return;
@ -1685,22 +1685,22 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
command has failed with sense data then run REQUEST SENSE command has failed with sense data then run REQUEST SENSE
command to receive that data.</para> command to receive that data.</para>
<programlisting> hcb->ccb->csio.scsi_status = scsi_status; <programlisting> hcb-&gt;ccb-&gt;csio.scsi_status = scsi_status;
calculate_residue(hcb); calculate_residue(hcb);
if( (hcb->ccb->ccb_h.flags &amp; CAM_DIS_AUTOSENSE)==0 if( (hcb-&gt;ccb-&gt;ccb_h.flags &amp; CAM_DIS_AUTOSENSE)==0
&amp;&amp; ( scsi_status == CHECK_CONDITION &amp;&amp; ( scsi_status == CHECK_CONDITION
|| scsi_status == COMMAND_TERMINATED) ) { || scsi_status == COMMAND_TERMINATED) ) {
/* start auto-SENSE */ /* start auto-SENSE */
hcb->flags |= DOING_AUTOSENSE; hcb-&gt;flags |= DOING_AUTOSENSE;
setup_autosense_command_in_hcb(hcb); setup_autosense_command_in_hcb(hcb);
restart_current_hcb(softc); restart_current_hcb(softc);
return; return;
} }
if(scsi_status == GOOD) if(scsi_status == GOOD)
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_REQ_CMP); free_hcb_and_ccb_done(hcb, hcb-&gt;ccb, CAM_REQ_CMP);
else else
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR); free_hcb_and_ccb_done(hcb, hcb-&gt;ccb, CAM_SCSI_STATUS_ERROR);
schedule_next_hcb(softc); schedule_next_hcb(softc);
return; return;
}</programlisting> }</programlisting>
@ -1714,11 +1714,11 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
<programlisting> switch(hcb_status) { <programlisting> switch(hcb_status) {
case TARGET_REJECTED_WIDE_NEG: case TARGET_REJECTED_WIDE_NEG:
/* revert to 8-bit bus */ /* revert to 8-bit bus */
softc->current_bus_width[targ] = softc->goal_bus_width[targ] = 8; softc-&gt;current_bus_width[targ] = softc-&gt;goal_bus_width[targ] = 8;
/* report the event */ /* report the event */
neg.bus_width = 8; neg.bus_width = 8;
neg.valid = CCB_TRANS_BUS_WIDTH_VALID; neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &amp;neg); xpt_async(AC_TRANSFER_NEG, hcb-&gt;ccb.ccb_h.path_id, &amp;neg);
continue_current_hcb(softc); continue_current_hcb(softc);
return; return;
case TARGET_ANSWERED_WIDE_NEG: case TARGET_ANSWERED_WIDE_NEG:
@ -1726,14 +1726,14 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
int wd; int wd;
wd = get_target_bus_width_request(softc); wd = get_target_bus_width_request(softc);
if(wd <= softc->goal_bus_width[targ]) { if(wd &lt;= softc-&gt;goal_bus_width[targ]) {
/* answer is acceptable */ /* answer is acceptable */
softc->current_bus_width[targ] = softc-&gt;current_bus_width[targ] =
softc->goal_bus_width[targ] = neg.bus_width = wd; softc-&gt;goal_bus_width[targ] = neg.bus_width = wd;
/* report the event */ /* report the event */
neg.valid = CCB_TRANS_BUS_WIDTH_VALID; neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &amp;neg); xpt_async(AC_TRANSFER_NEG, hcb-&gt;ccb.ccb_h.path_id, &amp;neg);
} else { } else {
prepare_reject_message(hcb); prepare_reject_message(hcb);
} }
@ -1746,16 +1746,16 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
wd = get_target_bus_width_request(softc); wd = get_target_bus_width_request(softc);
wd = min (wd, OUR_BUS_WIDTH); wd = min (wd, OUR_BUS_WIDTH);
wd = min (wd, softc->user_bus_width[targ]); wd = min (wd, softc-&gt;user_bus_width[targ]);
if(wd != softc->current_bus_width[targ]) { if(wd != softc-&gt;current_bus_width[targ]) {
/* the bus width has changed */ /* the bus width has changed */
softc->current_bus_width[targ] = softc-&gt;current_bus_width[targ] =
softc->goal_bus_width[targ] = neg.bus_width = wd; softc-&gt;goal_bus_width[targ] = neg.bus_width = wd;
/* report the event */ /* report the event */
neg.valid = CCB_TRANS_BUS_WIDTH_VALID; neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &amp;neg); xpt_async(AC_TRANSFER_NEG, hcb-&gt;ccb.ccb_h.path_id, &amp;neg);
} }
prepare_width_nego_rsponse(hcb, wd); prepare_width_nego_rsponse(hcb, wd);
} }
@ -1767,7 +1767,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
auto-sense in the same simple-minded way as before. Otherwise we auto-sense in the same simple-minded way as before. Otherwise we
look closer at the details again.</para> look closer at the details again.</para>
<programlisting> if(hcb->flags &amp; DOING_AUTOSENSE) <programlisting> if(hcb-&gt;flags &amp; DOING_AUTOSENSE)
goto autosense_failed; goto autosense_failed;
switch(hcb_status) {</programlisting> switch(hcb_status) {</programlisting>
@ -1781,10 +1781,10 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
/* abort affects all commands on that target+LUN, so /* abort affects all commands on that target+LUN, so
* mark all disconnected HCBs on that target+LUN as aborted too * mark all disconnected HCBs on that target+LUN as aborted too
*/ */
for(h = softc->first_discon_hcb[hcb->target][hcb->lun]; for(h = softc-&gt;first_discon_hcb[hcb-&gt;target][hcb-&gt;lun];
h != NULL; h = hh) { h != NULL; h = hh) {
hh=h->next; hh=h-&gt;next;
free_hcb_and_ccb_done(h, h->ccb, CAM_REQ_ABORTED); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_REQ_ABORTED);
} }
ccb_status = CAM_REQ_ABORTED; ccb_status = CAM_REQ_ABORTED;
} else if(requested_bus_device_reset(hcb)) { } else if(requested_bus_device_reset(hcb)) {
@ -1794,15 +1794,15 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
* mark all disconnected HCBs on that target+LUN as reset * mark all disconnected HCBs on that target+LUN as reset
*/ */
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++) for(lun=0; lun &lt;= OUR_MAX_SUPPORTED_LUN; lun++)
for(h = softc->first_discon_hcb[hcb->target][lun]; for(h = softc-&gt;first_discon_hcb[hcb-&gt;target][lun];
h != NULL; h = hh) { h != NULL; h = hh) {
hh=h->next; hh=h-&gt;next;
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_SCSI_BUS_RESET);
} }
/* send event */ /* send event */
xpt_async(AC_SENT_BDR, hcb->ccb->ccb_h.path_id, NULL); xpt_async(AC_SENT_BDR, hcb-&gt;ccb-&gt;ccb_h.path_id, NULL);
/* this was the CAM_RESET_DEV request itself, it is completed */ /* this was the CAM_RESET_DEV request itself, it is completed */
ccb_status = CAM_REQ_CMP; ccb_status = CAM_REQ_CMP;
@ -1810,8 +1810,8 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
calculate_residue(hcb); calculate_residue(hcb);
ccb_status = CAM_UNEXP_BUSFREE; ccb_status = CAM_UNEXP_BUSFREE;
/* request the further code to freeze the queue */ /* request the further code to freeze the queue */
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN; hcb-&gt;ccb-&gt;ccb_h.status |= CAM_DEV_QFRZN;
lun_to_freeze = hcb->lun; lun_to_freeze = hcb-&gt;lun;
} }
break;</programlisting> break;</programlisting>
@ -1822,12 +1822,12 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
/* report the event */ /* report the event */
neg.flags = 0 &amp; ~CCB_TRANS_TAG_ENB; neg.flags = 0 &amp; ~CCB_TRANS_TAG_ENB;
neg.valid = CCB_TRANS_TQ_VALID; neg.valid = CCB_TRANS_TQ_VALID;
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &amp;neg); xpt_async(AC_TRANSFER_NEG, hcb-&gt;ccb.ccb_h.path_id, &amp;neg);
ccb_status = CAM_MSG_REJECT_REC; ccb_status = CAM_MSG_REJECT_REC;
/* request the further code to freeze the queue */ /* request the further code to freeze the queue */
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN; hcb-&gt;ccb-&gt;ccb_h.status |= CAM_DEV_QFRZN;
lun_to_freeze = hcb->lun; lun_to_freeze = hcb-&gt;lun;
break;</programlisting> break;</programlisting>
<para>Then we check a number of other conditions, with processing <para>Then we check a number of other conditions, with processing
@ -1836,7 +1836,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
<programlisting> case SELECTION_TIMEOUT: <programlisting> case SELECTION_TIMEOUT:
ccb_status = CAM_SEL_TIMEOUT; ccb_status = CAM_SEL_TIMEOUT;
/* request the further code to freeze the queue */ /* request the further code to freeze the queue */
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN; hcb-&gt;ccb-&gt;ccb_h.status |= CAM_DEV_QFRZN;
lun_to_freeze = CAM_LUN_WILDCARD; lun_to_freeze = CAM_LUN_WILDCARD;
break; break;
case PARITY_ERROR: case PARITY_ERROR:
@ -1850,7 +1850,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
/* all other errors are handled in a generic way */ /* all other errors are handled in a generic way */
ccb_status = CAM_REQ_CMP_ERR; ccb_status = CAM_REQ_CMP_ERR;
/* request the further code to freeze the queue */ /* request the further code to freeze the queue */
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN; hcb-&gt;ccb-&gt;ccb_h.status |= CAM_DEV_QFRZN;
lun_to_freeze = CAM_LUN_WILDCARD; lun_to_freeze = CAM_LUN_WILDCARD;
break; break;
}</programlisting> }</programlisting>
@ -1858,21 +1858,21 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
<para>Then we check if the error was serious enough to freeze the <para>Then we check if the error was serious enough to freeze the
input queue until it gets proceeded and do so if it is:</para> input queue until it gets proceeded and do so if it is:</para>
<programlisting> if(hcb->ccb->ccb_h.status &amp; CAM_DEV_QFRZN) { <programlisting> if(hcb-&gt;ccb-&gt;ccb_h.status &amp; CAM_DEV_QFRZN) {
/* freeze the queue */ /* freeze the queue */
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); xpt_freeze_devq(ccb-&gt;ccb_h.path, /*count*/1);
/* re-queue all commands for this target/LUN back to CAM */ /* re-queue all commands for this target/LUN back to CAM */
for(h = softc->first_queued_hcb; h != NULL; h = hh) { for(h = softc-&gt;first_queued_hcb; h != NULL; h = hh) {
hh = h->next; hh = h-&gt;next;
if(targ == h->targ if(targ == h-&gt;targ
&amp;&amp; (lun_to_freeze == CAM_LUN_WILDCARD || lun_to_freeze == h->lun) ) &amp;&amp; (lun_to_freeze == CAM_LUN_WILDCARD || lun_to_freeze == h-&gt;lun) )
free_hcb_and_ccb_done(h, h->ccb, CAM_REQUEUE_REQ); free_hcb_and_ccb_done(h, h-&gt;ccb, CAM_REQUEUE_REQ);
} }
} }
free_hcb_and_ccb_done(hcb, hcb->ccb, ccb_status); free_hcb_and_ccb_done(hcb, hcb-&gt;ccb, ccb_status);
schedule_next_hcb(softc); schedule_next_hcb(softc);
return;</programlisting> return;</programlisting>
@ -1989,14 +1989,14 @@ xxx_timeout(void *arg)
struct xxx_softc *softc; struct xxx_softc *softc;
struct ccb_hdr *ccb_h; struct ccb_hdr *ccb_h;
softc = hcb->softc; softc = hcb-&gt;softc;
ccb_h = &amp;hcb->ccb->ccb_h; ccb_h = &amp;hcb-&gt;ccb-&gt;ccb_h;
if(hcb->flags &amp; HCB_BEING_ABORTED if(hcb-&gt;flags &amp; HCB_BEING_ABORTED
|| ccb_h->func_code == XPT_RESET_DEV) { || ccb_h-&gt;func_code == XPT_RESET_DEV) {
xxx_reset_bus(softc); xxx_reset_bus(softc);
} else { } else {
xxx_abort_ccb(hcb->ccb, CAM_CMD_TIMEOUT); xxx_abort_ccb(hcb-&gt;ccb, CAM_CMD_TIMEOUT);
} }
}</programlisting> }</programlisting>

View file

@ -587,7 +587,7 @@
{ {
struct sc_info *sc = mix_getdevinfo(m); struct sc_info *sc = mix_getdevinfo(m);
[set volume level] [set volume level]
return left | (right << 8);<co id="co-mxset-return"> return left | (right &lt;&lt; 8);<co id="co-mxset-return">
}</programlisting> }</programlisting>
<calloutlist> <calloutlist>

View file

@ -93,7 +93,7 @@
<para>The complete source code to FreeBSD is available from our <para>The complete source code to FreeBSD is available from our
public CVS repository. The source code is normally installed in public CVS repository. The source code is normally installed in
<filename class=directory>/usr/src</filename> which contains the <filename class="directory">/usr/src</filename> which contains the
following subdirectories:</para> following subdirectories:</para>
<para> <para>
@ -108,65 +108,65 @@
<tbody> <tbody>
<row> <row>
<entry><filename class=directory>bin/</filename></entry> <entry><filename class="directory">bin/</filename></entry>
<entry>Source for files in <entry>Source for files in
<filename>/bin</filename></entry> <filename>/bin</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>contrib/</filename></entry> <entry><filename class="directory">contrib/</filename></entry>
<entry>Source for files from contributed software.</entry> <entry>Source for files from contributed software.</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>crypto/</filename></entry> <entry><filename class="directory">crypto/</filename></entry>
<entry>Cryptographical sources</entry> <entry>Cryptographical sources</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>etc/</filename></entry> <entry><filename class="directory">etc/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/etc</filename></entry> class="directory">/etc</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>games/</filename></entry> <entry><filename class="directory">games/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/games</filename></entry> class="directory">/usr/games</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>gnu/</filename></entry> <entry><filename class="directory">gnu/</filename></entry>
<entry>Utilities covered by the GNU Public License</entry> <entry>Utilities covered by the GNU Public License</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>include/</filename></entry> <entry><filename class="directory">include/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/include</filename></entry> class="directory">/usr/include</filename></entry>
</row> </row>
<row> <row>
<entry><filename <entry><filename
class=directory>kerberos5/</filename></entry> class="directory">kerberos5/</filename></entry>
<entry>Source for Kerberos version 5</entry> <entry>Source for Kerberos version 5</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>lib/</filename></entry> <entry><filename class="directory">lib/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/lib</filename></entry> class="directory">/usr/lib</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>libexec/</filename></entry> <entry><filename class="directory">libexec/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/libexec</filename></entry> class="directory">/usr/libexec</filename></entry>
</row> </row>
<row> <row>
<entry><filename <entry><filename
class=directory>release/</filename></entry> class="directory">release/</filename></entry>
<entry>Files required to produce a FreeBSD release</entry> <entry>Files required to produce a FreeBSD release</entry>
</row> </row>
@ -177,45 +177,45 @@
</row> </row>
<row> <row>
<entry><filename class=directory>sbin/</filename></entry> <entry><filename class="directory">sbin/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/sbin</filename></entry> class="directory">/sbin</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>secure/</filename></entry> <entry><filename class="directory">secure/</filename></entry>
<entry>FreeSec sources</entry> <entry>FreeSec sources</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>share/</filename></entry> <entry><filename class="directory">share/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/share</filename></entry> class="directory">/usr/share</filename></entry>
</row> </row>
<row> <row>
<entry><filename class=directory>sys/</filename></entry> <entry><filename class="directory">sys/</filename></entry>
<entry>Kernel source files</entry> <entry>Kernel source files</entry>
</row> </row>
<row> <row>
<entry><filename class=directory>tools/</filename></entry> <entry><filename class="directory">tools/</filename></entry>
<entry>Tools used for maintenance and testing of <entry>Tools used for maintenance and testing of
FreeBSD</entry> FreeBSD</entry>
</row> </row>
<row> <row>
<entry><filename <entry><filename
class=directory>usr.bin/</filename></entry> class="directory">usr.bin/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/bin</filename></entry> class="directory">/usr/bin</filename></entry>
</row> </row>
<row> <row>
<entry><filename <entry><filename
class=directory>usr.sbin/</filename></entry> class="directory">usr.sbin/</filename></entry>
<entry>Source for files in <filename <entry>Source for files in <filename
class=directory>/usr/sbin</filename></entry> class="directory">/usr/sbin</filename></entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>

View file

@ -932,7 +932,7 @@ FreeBSD 4.x configurable supported
<screen> int on; <screen> int on;
setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY, setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY,
(char *)&amp;on, sizeof (on)) < 0)); (char *)&amp;on, sizeof (on)) &lt; 0));
</screen> </screen>
<para>When this call succeed, then this socket only receive IPv6 <para>When this call succeed, then this socket only receive IPv6
@ -1026,7 +1026,7 @@ FreeBSD 4.x configurable supported
<screen> int on; <screen> int on;
setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY, setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY,
(char *)&amp;on, sizeof (on)) < 0)); (char *)&amp;on, sizeof (on)) &lt; 0));
</screen> </screen>
<para>Wildcard AF_INET6 socket grabs IPv4 connection if and only <para>Wildcard AF_INET6 socket grabs IPv4 connection if and only
@ -1112,7 +1112,7 @@ FreeBSD 4.x configurable supported
like:</para> like:</para>
<screen> struct sockaddr_storage ss; <screen> struct sockaddr_storage ss;
family = ((struct sockaddr *)&amp;ss)->sa_family family = ((struct sockaddr *)&amp;ss)-&gt;sa_family
</screen> </screen>
</listitem> </listitem>
@ -1296,7 +1296,7 @@ FreeBSD 4.x configurable supported
<listitem> <listitem>
<para>IPsec tunnel is not combined with GIF generic tunneling <para>IPsec tunnel is not combined with GIF generic tunneling
interface. It needs a great care because we may create an interface. It needs a great care because we may create an
infinite loop between ip_output() and tunnelifp->if_output(). infinite loop between ip_output() and tunnelifp-&gt;if_output().
Opinion varies if it is better to unify them, or not.</para> Opinion varies if it is better to unify them, or not.</para>
</listitem> </listitem>

View file

@ -330,11 +330,11 @@
43:399 tp-&gt;t_state |= TS_CARR_ON; 43:399 tp-&gt;t_state |= TS_CARR_ON;
44:400 tp-&gt;t_cflag |= CLOCAL; /* cannot be a modem (:-) */ 44:400 tp-&gt;t_cflag |= CLOCAL; /* cannot be a modem (:-) */
45:401 45:401
46:402 #if PCVT_NETBSD || (PCVT_FREEBSD >= 200) 46:402 #if PCVT_NETBSD || (PCVT_FREEBSD &gt;= 200)
47:403 return ((*linesw[tp-&gt;t_line].l_open)(dev, tp)); 47:403 return ((*linesw[tp-&gt;t_line].l_open)(dev, tp));
48:404 #else 48:404 #else
49:405 return ((*linesw[tp-&gt;t_line].l_open)(dev, tp, flag)); 49:405 return ((*linesw[tp-&gt;t_line].l_open)(dev, tp, flag));
50:406 #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */ 50:406 #endif /* PCVT_NETBSD || (PCVT_FREEBSD &gt;= 200) */
51:407 } 51:407 }
52:<prompt>(kgdb)</prompt> <userinput>print tp</userinput> 52:<prompt>(kgdb)</prompt> <userinput>print tp</userinput>
53:Reading in symbols for ../../i386/i386/cons.c...done. 53:Reading in symbols for ../../i386/i386/cons.c...done.
@ -778,7 +778,7 @@ Id Refs Address Size Name
<para>If you are debugging a crash dump, you will need to walk the <para>If you are debugging a crash dump, you will need to walk the
<literal>linker_files</literal> list, starting at <literal>linker_files</literal> list, starting at
<literal>linker_files->tqh_first</literal> and following the <literal>linker_files-&gt;tqh_first</literal> and following the
<literal>link.tqe_next</literal> pointers until you find the <literal>link.tqe_next</literal> pointers until you find the
entry with the <literal>filename</literal> you are looking for. entry with the <literal>filename</literal> you are looking for.
The <literal>address</literal> member of that entry is the load The <literal>address</literal> member of that entry is the load

View file

@ -119,7 +119,7 @@
handful of very dangerous functions.</para> handful of very dangerous functions.</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols=2> <tgroup cols="2">
<tbody> <tbody>
<row><entry><function>strcpy</function>(char *dest, const char <row><entry><function>strcpy</function>(char *dest, const char
*src)</entry> *src)</entry>
@ -430,7 +430,7 @@ int main() {
permission, owner, group, size, access time, and modification permission, owner, group, size, access time, and modification
time.</simpara></listitem> time.</simpara></listitem>
<listitem><simpara>Bind to privileged ports in the Internet <listitem><simpara>Bind to privileged ports in the Internet
domain (ports < 1024)</simpara></listitem> domain (ports &lt; 1024)</simpara></listitem>
</itemizedlist> </itemizedlist>
<para><function>Jail</function> is a very useful tool for <para><function>Jail</function> is a very useful tool for

View file

@ -658,7 +658,7 @@ struct in_addr {
<programlisting> <programlisting>
sa.sin_family = AF_INET; sa.sin_family = AF_INET;
sa.sin_port = 13; sa.sin_port = 13;
sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18; sa.sin_addr.s_addr = (((((192 &lt;&lt; 8) | 43) &lt;&lt; 8) | 244) &lt;&lt; 8) | 18;
</programlisting> </programlisting>
<para>What would the result look like?</para> <para>What would the result look like?</para>
@ -846,8 +846,8 @@ struct in_addr {
<programlisting> <programlisting>
sa.sin_family = AF_INET; sa.sin_family = AF_INET;
sa.sin_port = 13 << 8; sa.sin_port = 13 &lt;&lt; 8;
sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192; sa.sin_addr.s_addr = (((((18 &lt;&lt; 8) | 244) &lt;&lt; 8) | 43) &lt;&lt; 8) | 192;
</programlisting> </programlisting>
<para>This will <emphasis>trick</emphasis> our compiler <para>This will <emphasis>trick</emphasis> our compiler
@ -992,7 +992,7 @@ int main() {
return 2; return 2;
} }
while ((bytes = read(s, buffer, BUFSIZ)) > 0) while ((bytes = read(s, buffer, BUFSIZ)) &gt; 0)
write(1, buffer, bytes); write(1, buffer, bytes);
close(s); close(s);
@ -1210,7 +1210,7 @@ int main() {
if (INADDR_ANY) if (INADDR_ANY)
sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(s, (struct sockaddr *)&amp;sa, sizeof sa) < 0) { if (bind(s, (struct sockaddr *)&amp;sa, sizeof sa) &lt; 0) {
perror("bind"); perror("bind");
return 2; return 2;
} }
@ -1251,12 +1251,12 @@ int main() {
tm = gmtime(&amp;t); tm = gmtime(&amp;t);
fprintf(client, "%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ\n", fprintf(client, "%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ\n",
tm->tm_year + 1900, tm-&gt;tm_year + 1900,
tm->tm_mon + 1, tm-&gt;tm_mon + 1,
tm->tm_mday, tm-&gt;tm_mday,
tm->tm_hour, tm-&gt;tm_hour,
tm->tm_min, tm-&gt;tm_min,
tm->tm_sec); tm-&gt;tm_sec);
fclose(client); fclose(client);
} }
@ -1659,7 +1659,7 @@ struct servent * getservbyname(const char *name, const char *proto);
fprintf(stderr, "Cannot determine which port to use.\n"); fprintf(stderr, "Cannot determine which port to use.\n");
return 7; return 7;
} }
sa.sin_port = se->s_port; sa.sin_port = se-&gt;s_port;
</programlisting> </programlisting>
<para>You usually do know the port. But if you are developing a <para>You usually do know the port. But if you are developing a

View file

@ -1649,7 +1649,7 @@ Cannot access memory at address 0x7020796d.
<command>gdb</command> info pages):</para> <command>gdb</command> info pages):</para>
<screen><lineannotation>&hellip;</lineannotation> <screen><lineannotation>&hellip;</lineannotation>
if ((pid = fork()) < 0) /* _Always_ check this */ if ((pid = fork()) &lt; 0) /* _Always_ check this */
error(); error();
else if (pid == 0) { /* child */ else if (pid == 0) { /* child */
int PauseMode = 1; int PauseMode = 1;

View file

@ -6378,7 +6378,7 @@ This is NEVER guaranteed under &unix;. It is quite common
for a &unix; user to pipe and redirect program input and output: for a &unix; user to pipe and redirect program input and output:
</para> </para>
<screen>&prompt.user; <userinput>program1 | program2 | program3 > file1</userinput></screen> <screen>&prompt.user; <userinput>program1 | program2 | program3 &gt; file1</userinput></screen>
<para> <para>
If you have written <application>program2</application>, your input If you have written <application>program2</application>, your input

View file

@ -387,8 +387,8 @@ PRI_LANG?= en_US.ISO8859-1
<programlisting>_SUBDIRUSE: .USE <programlisting>_SUBDIRUSE: .USE
.for entry in ${SUBDIR} .for entry in ${SUBDIR}
@${ECHO} "===> ${DIRPRFX}${entry}" @${ECHO} "===&gt; ${DIRPRFX}${entry}"
@(cd ${.CURDIR}/${entry} && \ @(cd ${.CURDIR}/${entry} &amp;&amp; \
${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
.endfor</programlisting> .endfor</programlisting>
@ -469,8 +469,8 @@ PRI_LANG?= en_US.ISO8859-1
<programlisting>_SUBDIRUSE: .USE <programlisting>_SUBDIRUSE: .USE
.for entry in ${SUBDIR} .for entry in ${SUBDIR}
@${ECHO} "===> ${DIRPRFX}${entry}" @${ECHO} "===&gt; ${DIRPRFX}${entry}"
@(cd ${.CURDIR}/${entry} && \ @(cd ${.CURDIR}/${entry} &amp;&amp; \
${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
.endfor</programlisting> .endfor</programlisting>

View file

@ -171,7 +171,7 @@
-c /usr/local/share/sgml/docbook/catalog \ -c /usr/local/share/sgml/docbook/catalog \
-c /usr/local/share/sgml/jade/catalog \ -c /usr/local/share/sgml/jade/catalog \
-d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl \<co id="examples-co-jade-1-dsssl"> -d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl \<co id="examples-co-jade-1-dsssl">
-t sgml <co id="examples-co-jade-1-transform"> file.sgml > file.html <co id="examples-co-jade-1-filename"></userinput></screen> -t sgml <co id="examples-co-jade-1-transform"> file.sgml &gt; file.html <co id="examples-co-jade-1-filename"></userinput></screen>
<calloutlist> <calloutlist>
<callout arearefs="examples-co-jade-1-nochunks"> <callout arearefs="examples-co-jade-1-nochunks">

View file

@ -1077,7 +1077,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
<para>You can use <command>sgmlnorm</command> to do this.</para> <para>You can use <command>sgmlnorm</command> to do this.</para>
<screen>&prompt.user; <userinput>sgmlnorm example.sgml > example.html</userinput></screen> <screen>&prompt.user; <userinput>sgmlnorm example.sgml &gt; example.html</userinput></screen>
<para>You should find a normalized (i.e., entity references <para>You should find a normalized (i.e., entity references
expanded) copy of your document in expanded) copy of your document in
@ -1091,7 +1091,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
the start. To include this you need to use the <option>-d</option> the start. To include this you need to use the <option>-d</option>
option:</para> option:</para>
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen> <screen>&prompt.user; <userinput>sgmlnorm -d example.sgml &gt; example.html</userinput></screen>
</step> </step>
</procedure> </procedure>
</sect2> </sect2>
@ -1249,7 +1249,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
<para>Produce <filename>example.html</filename> by normalizing <para>Produce <filename>example.html</filename> by normalizing
<filename>example.sgml</filename>.</para> <filename>example.sgml</filename>.</para>
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen> <screen>&prompt.user; <userinput>sgmlnorm -d example.sgml &gt; example.html</userinput></screen>
</step> </step>
<step> <step>
@ -1306,7 +1306,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
<para>Produce <filename>example.html</filename> by normalizing <para>Produce <filename>example.html</filename> by normalizing
<filename>example.sgml</filename>.</para> <filename>example.sgml</filename>.</para>
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen> <screen>&prompt.user; <userinput>sgmlnorm -d example.sgml &gt; example.html</userinput></screen>
</step> </step>
<step> <step>

View file

@ -1083,7 +1083,7 @@ wi0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
</sect4> </sect4>
<sect4> <sect4>
<title>802.11a & 802.11g Clients</title> <title>802.11a &amp; 802.11g Clients</title>
<para>The &man.ath.4; device driver supports 802.11a and 802.11g. <para>The &man.ath.4; device driver supports 802.11a and 802.11g.
If your card is based on an Atheros chipset, you may If your card is based on an Atheros chipset, you may
@ -1139,7 +1139,7 @@ linuxemu/chapter.sgml -->
wrapper module. As <username>root</username>:</para> wrapper module. As <username>root</username>:</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/modules/ndis</userinput> <screen>&prompt.root; <userinput>cd /usr/src/sys/modules/ndis</userinput>
&prompt.root; <userinput>make && make install</userinput></screen> &prompt.root; <userinput>make &amp;&amp; make install</userinput></screen>
<para>Locate the files for your specific card. Generally, they can <para>Locate the files for your specific card. Generally, they can
be found on the included CDs or at the vendors' websites. In the be found on the included CDs or at the vendors' websites. In the
@ -1179,7 +1179,7 @@ linuxemu/chapter.sgml -->
<para>Finally, we can build and install the driver module:</para> <para>Finally, we can build and install the driver module:</para>
<screen>&prompt.root; <userinput>make && make install</userinput></screen> <screen>&prompt.root; <userinput>make &amp;&amp; make install</userinput></screen>
<para>To use the driver, you must load the appropriate modules:</para> <para>To use the driver, you must load the appropriate modules:</para>
@ -2586,7 +2586,7 @@ options BOOTP_NFSROOT # NFS mount root file system using BOOTP info
<programlisting>#!/bin/sh <programlisting>#!/bin/sh
export DESTDIR=/data/misc/diskless export DESTDIR=/data/misc/diskless
mkdir -p ${DESTDIR} mkdir -p ${DESTDIR}
cd /usr/src; make world && make kernel cd /usr/src; make world &amp;&amp; make kernel
cd /usr/src/etc; make distribution</programlisting> cd /usr/src/etc; make distribution</programlisting>
<para>Once done, you may need to customize your <para>Once done, you may need to customize your

View file

@ -805,7 +805,7 @@ total 530
<row> <row>
<entry><filename class="directory">/usr/libexec/</filename></entry> <entry><filename class="directory">/usr/libexec/</filename></entry>
<entry>System daemons & system utilities (executed by other <entry>System daemons &amp; system utilities (executed by other
programs).</entry> programs).</entry>
</row> </row>
@ -839,7 +839,7 @@ total 530
<row> <row>
<entry><filename class="directory">/usr/sbin/</filename></entry> <entry><filename class="directory">/usr/sbin/</filename></entry>
<entry>System daemons & system utilities (executed by users).</entry> <entry>System daemons &amp; system utilities (executed by users).</entry>
</row> </row>
<row> <row>
@ -1384,25 +1384,25 @@ total 530
<literallayout class="monospaced">.-----------------. --. <literallayout class="monospaced">.-----------------. --.
| | | | | |
| DOS / Windows | | | DOS / Windows | |
: : > First slice, ad0s1 : : &gt; First slice, ad0s1
: : | : : |
| | | | | |
:=================: ==: --. :=================: ==: --.
| | | Partition a, mounted as / | | | | Partition a, mounted as / |
| | > referred to as ad0s2a | | | &gt; referred to as ad0s2a |
| | | | | | | |
:-----------------: ==: | :-----------------: ==: |
| | | Partition b, used as swap | | | | Partition b, used as swap |
| | > referred to as ad0s2b | | | &gt; referred to as ad0s2b |
| | | | | | | |
:-----------------: ==: | Partition c, no :-----------------: ==: | Partition c, no
| | | Partition e, used as /var > file system, all | | | Partition e, used as /var &gt; file system, all
| | > referred to as ad0s2e | of FreeBSD slice, | | &gt; referred to as ad0s2e | of FreeBSD slice,
| | | | ad0s2c | | | | ad0s2c
:-----------------: ==: | :-----------------: ==: |
| | | | | | | |
: : | Partition f, used as /usr | : : | Partition f, used as /usr |
: : > referred to as ad0s2f | : : &gt; referred to as ad0s2f |
: : | | : : | |
| | | | | | | |
| | --' | | | --' |

View file

@ -389,7 +389,7 @@ stop)
kill -9 `cat /var/run/utility.pid` kill -9 `cat /var/run/utility.pid`
;; ;;
*) *)
echo "Usage: `basename $0` {start|stop}" >&2 echo "Usage: `basename $0` {start|stop}" &gt;&2
exit 64 exit 64
;; ;;
esac esac
@ -1623,7 +1623,7 @@ kern.maxproc: 1044</screen>
syntax:</para> syntax:</para>
<screen>&prompt.root; <userinput>sysctl kern.maxfiles=5000</userinput> <screen>&prompt.root; <userinput>sysctl kern.maxfiles=5000</userinput>
kern.maxfiles: 2088 -> 5000</screen> kern.maxfiles: 2088 -&gt; 5000</screen>
<para>Settings of sysctl variables are usually either strings, <para>Settings of sysctl variables are usually either strings,
numbers, or booleans (a boolean being <literal>1</literal> for yes numbers, or booleans (a boolean being <literal>1</literal> for yes
@ -2425,7 +2425,7 @@ kern.maxvnodes: 100000</programlisting>
<para>Reboot the machine or to enable the swap file immediately, <para>Reboot the machine or to enable the swap file immediately,
type:</para> type:</para>
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0</userinput></screen> <screen>&prompt.root; <userinput>mdconfig -a -t vnode -f /usr/swap0 -u 0 &amp;&amp; swapon /dev/md0</userinput></screen>
</listitem> </listitem>
</orderedlist> </orderedlist>

View file

@ -1377,7 +1377,7 @@ Script done, &hellip;</screen>
information:</para> information:</para>
<screen>&prompt.root; <userinput>cd /dev</userinput> <screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' > /var/tmp/dev.out</userinput></screen> &prompt.root; <userinput>ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' &gt; /var/tmp/dev.out</userinput></screen>
</step> </step>
<step> <step>

View file

@ -1846,7 +1846,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
<para>Sometimes the entries under <filename>/dev</filename> will <para>Sometimes the entries under <filename>/dev</filename> will
have to be (re)created. To do that, issue:</para> have to be (re)created. To do that, issue:</para>
<screen>&prompt.root; <userinput>cd /dev && ./MAKEDEV "fd*"</userinput></screen> <screen>&prompt.root; <userinput>cd /dev &amp;&amp; ./MAKEDEV "fd*"</userinput></screen>
</sect4> </sect4>
<sect4> <sect4>
@ -2512,9 +2512,9 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen>
to send the data to a remote tape drive.</para> to send the data to a remote tape drive.</para>
<screen>&prompt.root; <userinput>for f in <replaceable>directory_list; do</replaceable></userinput> <screen>&prompt.root; <userinput>for f in <replaceable>directory_list; do</replaceable></userinput>
<userinput>find $f >> backup.list</userinput> <userinput>find $f &gt;&gt; backup.list</userinput>
<userinput>done</userinput> <userinput>done</userinput>
&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh <replaceable>user</replaceable>@<replaceable>host</replaceable> "cat > <replaceable>backup_device</replaceable>"</userinput></screen> &prompt.root; <userinput>cpio -v -o --format=newc &lt; backup.list | ssh <replaceable>user</replaceable>@<replaceable>host</replaceable> "cat &gt; <replaceable>backup_device</replaceable>"</userinput></screen>
<para>Where <replaceable>directory_list</replaceable> is the list of <para>Where <replaceable>directory_list</replaceable> is the list of
directories you want to back up, directories you want to back up,
@ -2728,7 +2728,7 @@ mkdir /mnt/var
# #
if [ ! -x /sys/compile/MINI/kernel ] if [ ! -x /sys/compile/MINI/kernel ]
then then
cat << EOM cat &lt;&lt; EOM
The MINI kernel does not exist, please create one. The MINI kernel does not exist, please create one.
Here is an example config file: Here is an example config file:
# #
@ -2776,14 +2776,14 @@ fi
cp -f /sys/compile/MINI/kernel /mnt cp -f /sys/compile/MINI/kernel /mnt
gzip -c -best /sbin/init > /mnt/sbin/init gzip -c -best /sbin/init &gt; /mnt/sbin/init
gzip -c -best /sbin/fsck > /mnt/sbin/fsck gzip -c -best /sbin/fsck &gt; /mnt/sbin/fsck
gzip -c -best /sbin/mount > /mnt/sbin/mount gzip -c -best /sbin/mount &gt; /mnt/sbin/mount
gzip -c -best /sbin/halt > /mnt/sbin/halt gzip -c -best /sbin/halt &gt; /mnt/sbin/halt
gzip -c -best /sbin/restore > /mnt/sbin/restore gzip -c -best /sbin/restore &gt; /mnt/sbin/restore
gzip -c -best /bin/sh > /mnt/bin/sh gzip -c -best /bin/sh &gt; /mnt/bin/sh
gzip -c -best /bin/sync > /mnt/bin/sync gzip -c -best /bin/sync &gt; /mnt/bin/sync
cp /root/.profile /mnt/root cp /root/.profile /mnt/root
@ -2810,18 +2810,18 @@ cd /
# #
# create minimum file system table # create minimum file system table
# #
cat > /mnt/etc/fstab <<EOM cat &gt; /mnt/etc/fstab &lt;&lt;EOM
/dev/fd0a / ufs rw 1 1 /dev/fd0a / ufs rw 1 1
EOM EOM
# #
# create minimum passwd file # create minimum passwd file
# #
cat > /mnt/etc/passwd <<EOM cat &gt; /mnt/etc/passwd &lt;&lt;EOM
root:*:0:0:Charlie &:/root:/bin/sh root:*:0:0:Charlie &:/root:/bin/sh
EOM EOM
cat > /mnt/etc/master.passwd <<EOM cat &gt; /mnt/etc/master.passwd &lt;&lt;EOM
root::0:0::0:0:Charlie &:/root:/bin/sh root::0:0::0:0:Charlie &:/root:/bin/sh
EOM EOM

View file

@ -577,7 +577,7 @@ ipmon_enable="YES" # Start IP monitor log
ipmon_flags="-Ds" # D = start as daemon ipmon_flags="-Ds" # D = start as daemon
# s = log to syslog # s = log to syslog
# v = log tcp window, ack, seq # v = log tcp window, ack, seq
# n = map IP & port to names</programlisting> # n = map IP &amp; port to names</programlisting>
<para>If you have a LAN behind this firewall that uses the <para>If you have a LAN behind this firewall that uses the
reserved private IP address ranges, then you need to add the reserved private IP address ranges, then you need to add the
@ -740,7 +740,7 @@ ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat</programlist
<programlisting>ipmon_flags="-Ds" # D = start as daemon <programlisting>ipmon_flags="-Ds" # D = start as daemon
# s = log to syslog # s = log to syslog
# v = log tcp window, ack, seq # v = log tcp window, ack, seq
# n = map IP & port to names</programlisting> # n = map IP &amp; port to names</programlisting>
<para>The benefits of logging are obvious. It provides the <para>The benefits of logging are obvious. It provides the
ability to review, after the fact, information such as which ability to review, after the fact, information such as which
@ -860,9 +860,9 @@ LOG_ERR - packets which have been logged and which can be considered short</scre
<listitem> <listitem>
<para>The addresses. This is actually three fields: the <para>The addresses. This is actually three fields: the
source address and port (separated by a comma), the -> source address and port (separated by a comma), the -&gt;
symbol, and the destination address and port. symbol, and the destination address and port.
209.53.17.22,80 -> 198.73.220.17,1722.</para> 209.53.17.22,80 -&gt; 198.73.220.17,1722.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -1525,7 +1525,7 @@ pass out quick on dc0 proto udp from any to xxx port = 53 keep state
# This rule is not needed for 'user ppp' type connection to the # This rule is not needed for 'user ppp' type connection to the
# public Internet, so you can delete this whole group. # public Internet, so you can delete this whole group.
# Use the following rule and check log for IP address. # Use the following rule and check log for IP address.
# Then put IP address in commented out rule & delete first rule # Then put IP address in commented out rule &amp; delete first rule
pass out log quick on dc0 proto udp from any to any port = 67 keep state pass out log quick on dc0 proto udp from any to any port = 67 keep state
#pass out quick on dc0 proto udp from any to z.z.z.z port = 67 keep state #pass out quick on dc0 proto udp from any to z.z.z.z port = 67 keep state
@ -1536,7 +1536,7 @@ pass out quick on dc0 proto tcp from any to any port = 80 flags S keep state
# Allow out secure www function https over TLS SSL # Allow out secure www function https over TLS SSL
pass out quick on dc0 proto tcp from any to any port = 443 flags S keep state pass out quick on dc0 proto tcp from any to any port = 443 flags S keep state
# Allow out send & get email function # Allow out send &amp; get email function
pass out quick on dc0 proto tcp from any to any port = 110 flags S keep state pass out quick on dc0 proto tcp from any to any port = 110 flags S keep state
pass out quick on dc0 proto tcp from any to any port = 25 flags S keep state pass out quick on dc0 proto tcp from any to any port = 25 flags S keep state
@ -1546,7 +1546,7 @@ pass out quick on dc0 proto tcp from any to any port = 37 flags S keep state
# Allow out nntp news # Allow out nntp news
pass out quick on dc0 proto tcp from any to any port = 119 flags S keep state pass out quick on dc0 proto tcp from any to any port = 119 flags S keep state
# Allow out gateway & LAN users non-secure FTP ( both passive & active modes) # Allow out gateway &amp; LAN users non-secure FTP ( both passive &amp; active modes)
# This function uses the IP<acronym>NAT</acronym> built in FTP proxy function coded in # This function uses the IP<acronym>NAT</acronym> built in FTP proxy function coded in
# the nat rules file to make this single rule function correctly. # the nat rules file to make this single rule function correctly.
# If you want to use the pkg_add command to install application packages # If you want to use the pkg_add command to install application packages
@ -1589,7 +1589,7 @@ block in quick on dc0 from 0.0.0.0/8 to any #loopback
block in quick on dc0 from 169.254.0.0/16 to any #DHCP auto-config block in quick on dc0 from 169.254.0.0/16 to any #DHCP auto-config
block in quick on dc0 from 192.0.2.0/24 to any #reserved for docs block in quick on dc0 from 192.0.2.0/24 to any #reserved for docs
block in quick on dc0 from 204.152.64.0/23 to any #Sun cluster interconnect block in quick on dc0 from 204.152.64.0/23 to any #Sun cluster interconnect
block in quick on dc0 from 224.0.0.0/3 to any #Class D & E multicast block in quick on dc0 from 224.0.0.0/3 to any #Class D &amp; E multicast
##### Block a bunch of different nasty things. ############ ##### Block a bunch of different nasty things. ############
# That I do not want to see in the log # That I do not want to see in the log
@ -1815,7 +1815,7 @@ block in log first quick on dc0 all
<para>The syntax for a <acronym>NAT</acronym> rule looks <para>The syntax for a <acronym>NAT</acronym> rule looks
something like this:</para> something like this:</para>
<programlisting>map <replaceable>IF</replaceable> <replaceable>LAN_IP_RANGE</replaceable> -> <replaceable>PUBLIC_ADDRESS</replaceable></programlisting> <programlisting>map <replaceable>IF</replaceable> <replaceable>LAN_IP_RANGE</replaceable> -&gt; <replaceable>PUBLIC_ADDRESS</replaceable></programlisting>
<para>The keyword <literal>map</literal> starts the rule.</para> <para>The keyword <literal>map</literal> starts the rule.</para>
@ -1898,7 +1898,7 @@ block in log first quick on dc0 all
<para>A normal NAT rule would look like:</para> <para>A normal NAT rule would look like:</para>
<programlisting>map dc0 192.168.1.0/24 -> 0/32</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 0/32</programlisting>
<para>In the above rule the packet's source port is unchanged <para>In the above rule the packet's source port is unchanged
as the packet passes through IP<acronym>NAT</acronym>. By as the packet passes through IP<acronym>NAT</acronym>. By
@ -1908,14 +1908,14 @@ block in log first quick on dc0 all
IP<acronym>NAT</acronym> to modify the source port to be IP<acronym>NAT</acronym> to modify the source port to be
within that range:</para> within that range:</para>
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp 20000:60000</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 0/32 portmap tcp/udp 20000:60000</programlisting>
<para>Additionally we can make things even easier by using the <para>Additionally we can make things even easier by using the
<literal>auto</literal> keyword to tell <literal>auto</literal> keyword to tell
IP<acronym>NAT</acronym> to determine by itself which ports IP<acronym>NAT</acronym> to determine by itself which ports
are available to use:</para> are available to use:</para>
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp auto</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 0/32 portmap tcp/udp auto</programlisting>
</sect3> </sect3>
<sect3> <sect3>
@ -1925,17 +1925,17 @@ block in log first quick on dc0 all
just too many LAN addresses to fit into a single public just too many LAN addresses to fit into a single public
address. By changing the following rule:</para> address. By changing the following rule:</para>
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 204.134.75.1</programlisting>
<para>Currently this rule maps all connections through <hostid <para>Currently this rule maps all connections through <hostid
role="ipaddr">204.134.75.1</hostid>. This can be changed role="ipaddr">204.134.75.1</hostid>. This can be changed
to specify a range:</para> to specify a range:</para>
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1-10</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 204.134.75.1-10</programlisting>
<para>Or a subnet using CIDR notation such as:</para> <para>Or a subnet using CIDR notation such as:</para>
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.0/24</programlisting> <programlisting>map dc0 192.168.1.0/24 -&gt; 204.134.75.0/24</programlisting>
</sect3> </sect3>
</sect2> </sect2>
@ -1954,17 +1954,17 @@ block in log first quick on dc0 all
address is <hostid role="ipaddr">20.20.20.5</hostid> you would address is <hostid role="ipaddr">20.20.20.5</hostid> you would
code the rule like this:</para> code the rule like this:</para>
<programlisting>rdr dc0 20.20.20.5/32 port 80 -> 10.0.10.25 port 80</programlisting> <programlisting>rdr dc0 20.20.20.5/32 port 80 -&gt; 10.0.10.25 port 80</programlisting>
<para>or:</para> <para>or:</para>
<programlisting>rdr dc0 0/32 port 80 -> 10.0.10.25 port 80</programlisting> <programlisting>rdr dc0 0/32 port 80 -&gt; 10.0.10.25 port 80</programlisting>
<para>or for a LAN DNS Server on LAN address of <hostid <para>or for a LAN DNS Server on LAN address of <hostid
role="ipaddr">10.0.10.33</hostid> that needs to receive role="ipaddr">10.0.10.33</hostid> that needs to receive
public DNS requests:</para> public DNS requests:</para>
<programlisting>rdr dc0 20.20.20.5/32 port 53 -> 10.0.10.33 port 53 udp</programlisting> <programlisting>rdr dc0 20.20.20.5/32 port 53 -&gt; 10.0.10.33 port 53 udp</programlisting>
</sect2> </sect2>
<sect2> <sect2>
@ -2000,17 +2000,17 @@ block in log first quick on dc0 all
<para>This rule will handle all the traffic for the internal <para>This rule will handle all the traffic for the internal
LAN:</para> LAN:</para>
<programlisting>map dc0 10.0.10.0/29 -> 0/32 proxy port 21 ftp/tcp</programlisting> <programlisting>map dc0 10.0.10.0/29 -&gt; 0/32 proxy port 21 ftp/tcp</programlisting>
<para>This rule handles the FTP traffic from the <para>This rule handles the FTP traffic from the
gateway:</para> gateway:</para>
<programlisting>map dc0 0.0.0.0/0 -> 0/32 proxy port 21 ftp/tcp</programlisting> <programlisting>map dc0 0.0.0.0/0 -&gt; 0/32 proxy port 21 ftp/tcp</programlisting>
<para>This rule handles all non-FTP traffic from the internal <para>This rule handles all non-FTP traffic from the internal
LAN:</para> LAN:</para>
<programlisting>map dc0 10.0.10.0/29 -> 0/32</programlisting> <programlisting>map dc0 10.0.10.0/29 -&gt; 0/32</programlisting>
<para>The FTP map rule goes before our regular map rule. All <para>The FTP map rule goes before our regular map rule. All
packets are tested against the first rule from the top. packets are tested against the first rule from the top.
@ -2039,7 +2039,7 @@ block in log first quick on dc0 all
pass out quick on rl0 proto tcp from any to any port = 21 flags S keep state pass out quick on rl0 proto tcp from any to any port = 21 flags S keep state
# Allow out passive mode data channel high order port numbers # Allow out passive mode data channel high order port numbers
pass out quick on rl0 proto tcp from any to any port > 1024 flags S keep state pass out quick on rl0 proto tcp from any to any port &gt; 1024 flags S keep state
# Active mode let data channel in from FTP server # Active mode let data channel in from FTP server
pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state</programlisting> pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state</programlisting>
@ -2909,7 +2909,7 @@ pif="dc0" # public interface name of NIC
# This rule is not needed for .user ppp. connection to the public Internet. # This rule is not needed for .user ppp. connection to the public Internet.
# so you can delete this whole group. # so you can delete this whole group.
# Use the following rule and check log for IP address. # Use the following rule and check log for IP address.
# Then put IP address in commented out rule & delete first rule # Then put IP address in commented out rule &amp; delete first rule
&dollar;cmd 00120 allow log udp from any to any 67 out via &dollar;pif keep-state &dollar;cmd 00120 allow log udp from any to any 67 out via &dollar;pif keep-state
#&dollar;cmd 00120 allow udp from any to x.x.x.x 67 out via &dollar;pif keep-state #&dollar;cmd 00120 allow udp from any to x.x.x.x 67 out via &dollar;pif keep-state
@ -2919,11 +2919,11 @@ pif="dc0" # public interface name of NIC
# Allow out secure www function https over TLS SSL # Allow out secure www function https over TLS SSL
&dollar;cmd 00220 allow tcp from any to any 443 out via &dollar;pif setup keep-state &dollar;cmd 00220 allow tcp from any to any 443 out via &dollar;pif setup keep-state
# Allow out send & get email function # Allow out send &amp; get email function
&dollar;cmd 00230 allow tcp from any to any 25 out via &dollar;pif setup keep-state &dollar;cmd 00230 allow tcp from any to any 25 out via &dollar;pif setup keep-state
&dollar;cmd 00231 allow tcp from any to any 110 out via &dollar;pif setup keep-state &dollar;cmd 00231 allow tcp from any to any 110 out via &dollar;pif setup keep-state
# Allow out FBSD (make install & CVSUP) functions # Allow out FBSD (make install &amp; CVSUP) functions
# Basically give user root "GOD" privileges. # Basically give user root "GOD" privileges.
&dollar;cmd 00240 allow tcp from me to any out via &dollar;pif setup keep-state uid root &dollar;cmd 00240 allow tcp from me to any out via &dollar;pif setup keep-state uid root
@ -2962,7 +2962,7 @@ pif="dc0" # public interface name of NIC
&dollar;cmd 00305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config &dollar;cmd 00305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config
&dollar;cmd 00306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs &dollar;cmd 00306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs
&dollar;cmd 00307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster interconnect &dollar;cmd 00307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster interconnect
&dollar;cmd 00308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D & E multicast &dollar;cmd 00308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D &amp; E multicast
# Deny public pings # Deny public pings
&dollar;cmd 00310 deny icmp from any to any in via &dollar;pif &dollar;cmd 00310 deny icmp from any to any in via &dollar;pif
@ -3000,12 +3000,12 @@ pif="dc0" # public interface name of NIC
&dollar;cmd 00410 allow tcp from any to me 22 in via &dollar;pif setup limit src-addr 2 &dollar;cmd 00410 allow tcp from any to me 22 in via &dollar;pif setup limit src-addr 2
# Allow in non-secure Telnet session from public Internet # Allow in non-secure Telnet session from public Internet
# labeled non-secure because ID & PW are passed over public # labeled non-secure because ID &amp; PW are passed over public
# Internet as clear text. # Internet as clear text.
# Delete this sample group if you do not have telnet server enabled. # Delete this sample group if you do not have telnet server enabled.
&dollar;cmd 00420 allow tcp from any to me 23 in via &dollar;pif setup limit src-addr 2 &dollar;cmd 00420 allow tcp from any to me 23 in via &dollar;pif setup limit src-addr 2
# Reject & Log all incoming connections from the outside # Reject &amp; Log all incoming connections from the outside
&dollar;cmd 00499 deny log all from any to any in via &dollar;pif &dollar;cmd 00499 deny log all from any to any in via &dollar;pif
# Everything else is denied by default # Everything else is denied by default
@ -3151,7 +3151,7 @@ ipfw -q -f flush
&dollar;cmd 305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config &dollar;cmd 305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config
&dollar;cmd 306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs &dollar;cmd 306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs
&dollar;cmd 307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster &dollar;cmd 307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster
&dollar;cmd 308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D & E multicast &dollar;cmd 308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D &amp; E multicast
# Authorized inbound packets # Authorized inbound packets
&dollar;cmd 400 allow udp from xx.70.207.54 to any 68 in &dollar;ks &dollar;cmd 400 allow udp from xx.70.207.54 to any 68 in &dollar;ks
@ -3229,11 +3229,11 @@ pif="rl0" # public interface name of NIC
# Allow out secure www function https over TLS SSL # Allow out secure www function https over TLS SSL
&dollar;cmd 050 &dollar;skip tcp from any to any 443 out via &dollar;pif setup keep-state &dollar;cmd 050 &dollar;skip tcp from any to any 443 out via &dollar;pif setup keep-state
# Allow out send & get email function # Allow out send &amp; get email function
&dollar;cmd 060 &dollar;skip tcp from any to any 25 out via &dollar;pif setup keep-state &dollar;cmd 060 &dollar;skip tcp from any to any 25 out via &dollar;pif setup keep-state
&dollar;cmd 061 &dollar;skip tcp from any to any 110 out via &dollar;pif setup keep-state &dollar;cmd 061 &dollar;skip tcp from any to any 110 out via &dollar;pif setup keep-state
# Allow out FreeBSD (make install & CVSUP) functions # Allow out FreeBSD (make install &amp; CVSUP) functions
# Basically give user root "GOD" privileges. # Basically give user root "GOD" privileges.
&dollar;cmd 070 &dollar;skip tcp from me to any out via &dollar;pif setup keep-state uid root &dollar;cmd 070 &dollar;skip tcp from me to any out via &dollar;pif setup keep-state uid root
@ -3271,7 +3271,7 @@ pif="rl0" # public interface name of NIC
&dollar;cmd 305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config &dollar;cmd 305 deny all from 169.254.0.0/16 to any in via &dollar;pif #DHCP auto-config
&dollar;cmd 306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs &dollar;cmd 306 deny all from 192.0.2.0/24 to any in via &dollar;pif #reserved for docs
&dollar;cmd 307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster &dollar;cmd 307 deny all from 204.152.64.0/23 to any in via &dollar;pif #Sun cluster
&dollar;cmd 308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D & E multicast &dollar;cmd 308 deny all from 224.0.0.0/3 to any in via &dollar;pif #Class D &amp; E multicast
# Deny ident # Deny ident
&dollar;cmd 315 deny tcp from any to any 113 in via &dollar;pif &dollar;cmd 315 deny tcp from any to any 113 in via &dollar;pif
@ -3306,15 +3306,15 @@ pif="rl0" # public interface name of NIC
&dollar;cmd 380 allow tcp from any to me 22 in via &dollar;pif setup limit src-addr 2 &dollar;cmd 380 allow tcp from any to me 22 in via &dollar;pif setup limit src-addr 2
# Allow in non-secure Telnet session from public Internet # Allow in non-secure Telnet session from public Internet
# labeled non-secure because ID & PW are passed over public # labeled non-secure because ID &amp; PW are passed over public
# Internet as clear text. # Internet as clear text.
# Delete this sample group if you do not have telnet server enabled. # Delete this sample group if you do not have telnet server enabled.
&dollar;cmd 390 allow tcp from any to me 23 in via &dollar;pif setup limit src-addr 2 &dollar;cmd 390 allow tcp from any to me 23 in via &dollar;pif setup limit src-addr 2
# Reject & Log all unauthorized incoming connections from the public Internet # Reject &amp; Log all unauthorized incoming connections from the public Internet
&dollar;cmd 400 deny log all from any to any in via &dollar;pif &dollar;cmd 400 deny log all from any to any in via &dollar;pif
# Reject & Log all unauthorized out going connections to the public Internet # Reject &amp; Log all unauthorized out going connections to the public Internet
&dollar;cmd 450 deny log all from any to any out via &dollar;pif &dollar;cmd 450 deny log all from any to any out via &dollar;pif
# This is skipto location for outbound stateful rules # This is skipto location for outbound stateful rules

View file

@ -311,7 +311,7 @@ Done.</screen>
commands; however, &man.dd.1; would also work with this commands; however, &man.dd.1; would also work with this
scenario.</para> scenario.</para>
<screen>&prompt.root; <userinput>dump -L -0 -f- / |(cd /mnt && restore -r -v -f-)</userinput></screen> <screen>&prompt.root; <userinput>dump -L -0 -f- / |(cd /mnt &amp;&amp; restore -r -v -f-)</userinput></screen>
<para>This must be done for each file system. Simply place the <para>This must be done for each file system. Simply place the
appropriate file system in the correct location when running the appropriate file system in the correct location when running the

View file

@ -2286,7 +2286,7 @@ Mounting root from ufs:/dev/md0c
The Ports Collection is a very valuable resource and well worth having The Ports Collection is a very valuable resource and well worth having
on your /usr partition, so it is advisable to say Yes to this option. on your /usr partition, so it is advisable to say Yes to this option.
For more information on the Ports Collection & the latest ports, For more information on the Ports Collection &amp; the latest ports,
visit: visit:
http://www.FreeBSD.org/ports http://www.FreeBSD.org/ports
@ -3782,7 +3782,7 @@ Press enter to continue, or ctrl-c to abort.</screen>
<screen>First specify a mouse protocol type. Choose one from the following list: <screen>First specify a mouse protocol type. Choose one from the following list:
1. Microsoft compatible (2-button protocol) 1. Microsoft compatible (2-button protocol)
2. Mouse Systems (3-button protocol) & FreeBSD moused protocol 2. Mouse Systems (3-button protocol) &amp; FreeBSD moused protocol
3. Bus Mouse 3. Bus Mouse
4. PS/2 Mouse 4. PS/2 Mouse
5. Logitech Mouse (serial, old type, Logitech protocol) 5. Logitech Mouse (serial, old type, Logitech protocol)
@ -5092,7 +5092,7 @@ Please press any key to reboot.</screen>
<literal>/boot/loader -h</literal>. All this does is pass a flag to the bootloader to <literal>/boot/loader -h</literal>. All this does is pass a flag to the bootloader to
boot into a serial console.</para> boot into a serial console.</para>
<screen>&prompt.root; <userinput>echo "/boot/loader -h" > boot.config</userinput></screen> <screen>&prompt.root; <userinput>echo "/boot/loader -h" &gt; boot.config</userinput></screen>
<para>Now that you have your floppy configured correctly, <para>Now that you have your floppy configured correctly,
you must unmount the floppy using the &man.umount.8; you must unmount the floppy using the &man.umount.8;

View file

@ -494,7 +494,7 @@
<para>In &os; 5.X and later versions you can still generate a buildable <para>In &os; 5.X and later versions you can still generate a buildable
<filename>LINT</filename> file by typing:</para> <filename>LINT</filename> file by typing:</para>
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf && make LINT</userinput></screen> <screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf &amp;&amp; make LINT</userinput></screen>
</note> </note>
<indexterm> <indexterm>
@ -1165,7 +1165,7 @@ device re # RealTek 8139C+/8169/8169S/8110S
device rl # RealTek 8129/8139 device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (<quote>Starfire</quote>) device sf # Adaptec AIC-6915 (<quote>Starfire</quote>)
device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sis # Silicon Integrated Systems SiS 900/SiS 7016
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device sk # SysKonnect SK-984x &amp; SK-982x gigabit Ethernet
device ste # Sundance ST201 (D-Link DFE-550TX) device ste # Sundance ST201 (D-Link DFE-550TX)
device ti # Alteon Networks Tigon I/II gigabit Ethernet device ti # Alteon Networks Tigon I/II gigabit Ethernet
device tl # Texas Instruments ThunderLAN device tl # Texas Instruments ThunderLAN

View file

@ -604,14 +604,14 @@ LOG=/var/log/lmgrd.log
case "$1" in case "$1" in
start) start)
lmgrd -c ${LICENSE_FILE} 2>> ${LOG} 1>&2 lmgrd -c ${LICENSE_FILE} 2&gt;&gt; ${LOG} 1&gt;&2
echo -n " lmgrd" echo -n " lmgrd"
;; ;;
stop) stop)
lmgrd -c ${LICENSE_FILE} -x lmdown 2>> ${LOG} 1>&2 lmgrd -c ${LICENSE_FILE} -x lmdown 2&gt;&gt; ${LOG} 1&gt;&2
;; ;;
*) *)
echo "Usage: `basename $0` {start|stop}" 1>&2 echo "Usage: `basename $0` {start|stop}" 1&gt;&2
exit 64 exit 64
;; ;;
esac esac
@ -3105,7 +3105,7 @@ SVRMGR&gt; <userinput>exit</userinput></screen>
total 4 total 4
drwxr-xr-x 3 idsadm sapsys 512 May 5 11:20 D00 drwxr-xr-x 3 idsadm sapsys 512 May 5 11:20 D00
drwxr-x--x 5 idsadm sapsys 512 May 5 11:35 IDS drwxr-x--x 5 idsadm sapsys 512 May 5 11:35 IDS
lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -> IDS/SYS lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -&gt; IDS/SYS
drwxrwxr-x 2 idsadm sapsys 512 May 5 13:00 tmp drwxrwxr-x 2 idsadm sapsys 512 May 5 13:00 tmp
drwxrwxr-x 11 idsadm sapsys 512 May 4 14:20 trans</screen> drwxrwxr-x 11 idsadm sapsys 512 May 4 14:20 trans</screen>

View file

@ -1764,7 +1764,7 @@ mac_partition_load="YES"</programlisting>
The following <command>sh</command> script should do the The following <command>sh</command> script should do the
trick:</para> trick:</para>
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput> <screen>&prompt.root; <userinput>for x in `awk -F: '($3 &gt;= 1001) &amp;&amp; ($3 != 65534) { print $1 }' \</userinput>
<userinput>/etc/passwd`; do pw usermod $x -L insecure; done;</userinput></screen> <userinput>/etc/passwd`; do pw usermod $x -L insecure; done;</userinput></screen>
<para>The <command>cap_mkdb</command> command will need to be <para>The <command>cap_mkdb</command> command will need to be
@ -1947,7 +1947,7 @@ round-trip min/avg/max/stddev = 204.455/204.455/204.455/0.000 ms</screen>
test1: biba/equal,mls/equal test1: biba/equal,mls/equal
&prompt.root; <userinput>setfmac biba/low test1 test2; setfmac biba/high test4 test5; \ &prompt.root; <userinput>setfmac biba/low test1 test2; setfmac biba/high test4 test5; \
setfmac mls/low test1 test3; setfmac mls/high test2 test4</userinput> setfmac mls/low test1 test3; setfmac mls/high test2 test4</userinput>
&prompt.root; <userinput>setfmac mls/equal,biba/equal test3 && getfmac test?</userinput> &prompt.root; <userinput>setfmac mls/equal,biba/equal test3 &amp;&amp; getfmac test?</userinput>
test1: biba/low,mls/low test1: biba/low,mls/low
test2: biba/low,mls/high test2: biba/low,mls/high
test3: biba/equal,mls/equal test3: biba/equal,mls/equal
@ -1974,7 +1974,7 @@ test3 test5</screen>
read access should be denied. Now for some write read access should be denied. Now for some write
tests:</para> tests:</para>
<screen>&prompt.user; <userinput>for i in `echo test*`; do echo 1 > $i; done</userinput> <screen>&prompt.user; <userinput>for i in `echo test*`; do echo 1 &gt; $i; done</userinput>
-su: test1: Permission denied -su: test1: Permission denied
-su: test4: Permission denied -su: test4: Permission denied
-su: test5: Permission denied</screen> -su: test5: Permission denied</screen>
@ -2036,7 +2036,7 @@ cat: test4: Permission denied</screen>
<para>Every user should now be placed in the default class; <para>Every user should now be placed in the default class;
a command such as:</para> a command such as:</para>
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput> <screen>&prompt.root; <userinput>for x in `awk -F: '($3 &gt;= 1001) &amp;&amp; ($3 != 65534) { print $1 }' \</userinput>
<userinput>/etc/passwd`; do pw usermod $x -L default; done;</userinput></screen> <userinput>/etc/passwd`; do pw usermod $x -L default; done;</userinput></screen>
<para>will accomplish this task in a few moments.</para> <para>will accomplish this task in a few moments.</para>

View file

@ -1839,7 +1839,7 @@ define(`confDEF_AUTH_INFO', `/etc/mail/auth-info')dnl</programlisting>
that should be displayed. In this example, we will read the that should be displayed. In this example, we will read the
first email:</para> first email:</para>
<screen>& <userinput>t 1</userinput> <screen>&amp; <userinput>t 1</userinput>
Message 1: Message 1:
From root@localhost Mon Mar 8 14:05:52 2004 From root@localhost Mon Mar 8 14:05:52 2004
X-Original-To: marcs@localhost X-Original-To: marcs@localhost
@ -1869,7 +1869,7 @@ This is a test message, please reply if you receive it.</screen>
single <keycap>.</keycap> on a new line. An example can be seen single <keycap>.</keycap> on a new line. An example can be seen
below:</para> below:</para>
<screen>& <userinput>R 1</userinput> <screen>&amp; <userinput>R 1</userinput>
To: root@localhost To: root@localhost
Subject: Re: test Subject: Re: test
@ -1886,7 +1886,7 @@ EOT</screen>
be specified by putting a single <keycap>.</keycap> on a new be specified by putting a single <keycap>.</keycap> on a new
line.</para> line.</para>
<screen>& <userinput>mail root@localhost</userinput> <screen>&amp; <userinput>mail root@localhost</userinput>
Subject: <userinput>I mastered mail Subject: <userinput>I mastered mail
Now I can send and receive email using mail ... :) Now I can send and receive email using mail ... :)
@ -2280,7 +2280,7 @@ user "john", with password "XXXXX", is "myth" here;</programlisting>
address of <email role="nolink">goodmail@example2.com</email>:</para> address of <email role="nolink">goodmail@example2.com</email>:</para>
<programlisting>:0 <programlisting>:0
* < 1000 * &lt; 1000
! goodmail@example2.com</programlisting> ! goodmail@example2.com</programlisting>
<para>Send all mail sent to <email>alternate@example.com</email> <para>Send all mail sent to <email>alternate@example.com</email>

View file

@ -2398,7 +2398,7 @@ doc/zh_*</screen>
configuration file is distributed; to copy it into place, run configuration file is distributed; to copy it into place, run
the following command:</para> the following command:</para>
<screen>&prompt.root; <userinput>cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf</userinput></screen> <screen>&prompt.root; <userinput>cd /usr/local/etc &amp;&amp; cp portsnap.conf.sample portsnap.conf</userinput></screen>
</note> </note>
</sect2> </sect2>
@ -2490,7 +2490,7 @@ doc/zh_*</screen>
<filename>/usr/ports/</filename>, and will send an email if any <filename>/usr/ports/</filename>, and will send an email if any
installed ports are out of date:</para> installed ports are out of date:</para>
<programlisting>0 3 * * * root portsnap -I cron update && pkg_version -vIL=</programlisting> <programlisting>0 3 * * * root portsnap -I cron update &amp;&amp; pkg_version -vIL=</programlisting>
<note> <note>
<para>If the system clock is not set to the local time zone, <para>If the system clock is not set to the local time zone,
@ -2504,7 +2504,7 @@ doc/zh_*</screen>
in the same invocation of <command>portsnap</command>. If in the same invocation of <command>portsnap</command>. If
the line above fails, try replacing the line above fails, try replacing
<command>portsnap -I cron update</command> with <command>portsnap -I cron update</command> with
<command>portsnap cron && portsnap -I update</command>.</para> <command>portsnap cron &amp;&amp; portsnap -I update</command>.</para>
</note> </note>
</sect2> </sect2>
</sect1> </sect1>

View file

@ -3723,11 +3723,11 @@ www IN CNAME @</programlisting>
<listitem> <listitem>
<para>Rearrange and create basic zone and configuration files:</para> <para>Rearrange and create basic zone and configuration files:</para>
<screen>&prompt.root; <userinput>cp /etc/localtime etc</userinput><co id="localtime"> <screen>&prompt.root; <userinput>cp /etc/localtime etc</userinput><co id="localtime">
&prompt.root; <userinput>mv named.conf etc && ln -sf etc/named.conf</userinput> &prompt.root; <userinput>mv named.conf etc &amp;&amp; ln -sf etc/named.conf</userinput>
&prompt.root; <userinput>mv named.root master</userinput> &prompt.root; <userinput>mv named.root master</userinput>
<!-- I don't like this next bit --> <!-- I don't like this next bit -->
&prompt.root; <userinput>sh make-localhost</userinput> &prompt.root; <userinput>sh make-localhost</userinput>
&prompt.root; <userinput>cat > master/named.localhost &prompt.root; <userinput>cat &gt; master/named.localhost
$ORIGIN localhost. $ORIGIN localhost.
$TTL 6h $TTL 6h
@ IN SOA localhost. postmaster.localhost. ( @ IN SOA localhost. postmaster.localhost. (
@ -3758,12 +3758,12 @@ $TTL 6h
<application>named-xfer</application>, and copy it into the sandbox:</para> <application>named-xfer</application>, and copy it into the sandbox:</para>
<screen>&prompt.root; <userinput>cd /usr/src/lib/libisc</userinput> <screen>&prompt.root; <userinput>cd /usr/src/lib/libisc</userinput>
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput> &prompt.root; <userinput>make cleandir &amp;&amp; make cleandir &amp;&amp; make depend &amp;&amp; make all</userinput>
&prompt.root; <userinput>cd /usr/src/lib/libbind</userinput> &prompt.root; <userinput>cd /usr/src/lib/libbind</userinput>
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput> &prompt.root; <userinput>make cleandir &amp;&amp; make cleandir &amp;&amp; make depend &amp;&amp; make all</userinput>
&prompt.root; <userinput>cd /usr/src/libexec/named-xfer</userinput> &prompt.root; <userinput>cd /usr/src/libexec/named-xfer</userinput>
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make NOSHARED=yes all</userinput> &prompt.root; <userinput>make cleandir &amp;&amp; make cleandir &amp;&amp; make depend &amp;&amp; make NOSHARED=yes all</userinput>
&prompt.root; <userinput>cp named-xfer /etc/namedb/bin && chmod 555 /etc/namedb/bin/named-xfer</userinput><co id="clean-cruft"></screen> &prompt.root; <userinput>cp named-xfer /etc/namedb/bin &amp;&amp; chmod 555 /etc/namedb/bin/named-xfer</userinput><co id="clean-cruft"></screen>
<para>After your statically linked <para>After your statically linked
<command>named-xfer</command> is installed some cleaning up <command>named-xfer</command> is installed some cleaning up
@ -3782,11 +3782,11 @@ $TTL 6h
<para>This step has been reported to fail occasionally. If this <para>This step has been reported to fail occasionally. If this
happens to you, then issue the command:</para> happens to you, then issue the command:</para>
<screen>&prompt.root; <userinput>cd /usr/src && make cleandir && make cleandir</userinput></screen> <screen>&prompt.root; <userinput>cd /usr/src &amp;&amp; make cleandir &amp;&amp; make cleandir</userinput></screen>
<para>and delete your <filename>/usr/obj</filename> tree:</para> <para>and delete your <filename>/usr/obj</filename> tree:</para>
<screen>&prompt.root; <userinput>rm -fr /usr/obj && mkdir /usr/obj</userinput></screen> <screen>&prompt.root; <userinput>rm -fr /usr/obj &amp;&amp; mkdir /usr/obj</userinput></screen>
<para>This will clean out any <quote>cruft</quote> from your <para>This will clean out any <quote>cruft</quote> from your
source tree, and retrying the steps above should then work.</para> source tree, and retrying the steps above should then work.</para>
@ -3804,7 +3804,7 @@ $TTL 6h
<para>Make a <filename>dev/null</filename> that <para>Make a <filename>dev/null</filename> that
<application>named</application> can see and write to:</para> <application>named</application> can see and write to:</para>
<screen>&prompt.root; <userinput>cd /etc/namedb/dev && mknod null c 2 2</userinput> <screen>&prompt.root; <userinput>cd /etc/namedb/dev &amp;&amp; mknod null c 2 2</userinput>
&prompt.root; <userinput>chmod 666 null</userinput></screen> &prompt.root; <userinput>chmod 666 null</userinput></screen>
</listitem> </listitem>

View file

@ -390,7 +390,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Line 6 & 7:</term> <term>Line 6 &amp; 7:</term>
<indexterm><primary>PPP</primary><secondary>user PPP</secondary></indexterm> <indexterm><primary>PPP</primary><secondary>user PPP</secondary></indexterm>
<listitem> <listitem>
@ -469,7 +469,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Line 13 & 14:</term> <term>Line 13 &amp; 14:</term>
<listitem> <listitem>
<para>Identifies the user name and password. When <para>Identifies the user name and password. When
@ -1696,7 +1696,7 @@ reinput 1 {\255}
if success goto slhup if success goto slhup
reinput 1 {\127} reinput 1 {\127}
if success goto slhup if success goto slhup
if < \%x 60 goto look if &lt; \%x 60 goto look
else goto slhup else goto slhup
:sllogin ; login :sllogin ; login
@ -1717,7 +1717,7 @@ reinput 1 {\255}
if success goto slhup if success goto slhup
reinput 1 {\127} reinput 1 {\127}
if success goto slhup if success goto slhup
if < \%x 10 goto slloop ; try 10 times to get a login prompt if &lt; \%x 10 goto slloop ; try 10 times to get a login prompt
else goto slhup ; hang up and start again if 10 failures else goto slhup ; hang up and start again if 10 failures
:sluid :sluid

View file

@ -4799,7 +4799,7 @@ drwxr-xr-x 2 robert robert 512 Nov 10 11:54 public_html</programlisting>
<para>To begin using <application>Portaudit</application>, one <para>To begin using <application>Portaudit</application>, one
must install it from the Ports Collection:</para> must install it from the Ports Collection:</para>
<screen>&prompt.root; <userinput>cd /usr/ports/security/portaudit && make install clean</userinput></screen> <screen>&prompt.root; <userinput>cd /usr/ports/security/portaudit &amp;&amp; make install clean</userinput></screen>
<para>During the install process, the configuration files for <para>During the install process, the configuration files for
&man.periodic.8; will be updated, permitting &man.periodic.8; will be updated, permitting

View file

@ -2494,7 +2494,7 @@ Keyboard: no</screen>
interrupt the boot process. The boot blocks will then prompt you interrupt the boot process. The boot blocks will then prompt you
for further action. You should now see something like:</para> for further action. You should now see something like:</para>
<screen>>> FreeBSD/i386 BOOT <screen>&gt;&gt; FreeBSD/i386 BOOT
Default: 0:ad(0,a)/boot/loader Default: 0:ad(0,a)/boot/loader
boot:</screen> boot:</screen>

View file

@ -1421,8 +1421,8 @@ DisplayManager.requestPort: 0</screen>
<application>/usr/X11R6/bin/gnome-session</application>: <application>/usr/X11R6/bin/gnome-session</application>:
</para></note> </para></note>
<screen>&prompt.user; <userinput>echo "#!/bin/sh" > ~/.xsession</userinput> <screen>&prompt.user; <userinput>echo "#!/bin/sh" &gt; ~/.xsession</userinput>
&prompt.user; <userinput>echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession</userinput> &prompt.user; <userinput>echo "/usr/X11R6/bin/gnome-session" &gt;&gt; ~/.xsession</userinput>
&prompt.user; <userinput>chmod +x ~/.xsession</userinput></screen> &prompt.user; <userinput>chmod +x ~/.xsession</userinput></screen>
<para>Yet another option is to configure the display manager to <para>Yet another option is to configure the display manager to

View file

@ -382,7 +382,7 @@ Linking index</screen>
variables in the shell and, by tradition, consist of all variables in the shell and, by tradition, consist of all
upper-case letters (you do not have to use all upper-case upper-case letters (you do not have to use all upper-case
letters. In fact there is nothing to stop you from calling a letters. In fact there is nothing to stop you from calling a
variable <literal>@^&$%$</literal>. Just tradition). Variables variable <literal>@^&amp;$%$</literal>. Just tradition). Variables
are assigned-to using lines of the form:</para> are assigned-to using lines of the form:</para>
<programlisting>VARIABLE = value</programlisting> <programlisting>VARIABLE = value</programlisting>

View file

@ -271,13 +271,13 @@ still more lines
<para>Each boolean expression is made up of terms that look <para>Each boolean expression is made up of terms that look
like function calls, the standard C boolean operators like function calls, the standard C boolean operators
<literal>&&</literal>, <literal>||</literal>, and <literal>&amp;&amp;</literal>, <literal>||</literal>, and
<literal>!</literal>, and the standard relational operators <literal>!</literal>, and the standard relational operators
<literal>==</literal>, <literal>!=</literal>, <literal>&gt;</literal>, <literal>==</literal>, <literal>!=</literal>, <literal>&gt;</literal>,
<literal>&gt;=</literal>, <literal>&lt;</literal>, and <literal>&gt;=</literal>, <literal>&lt;</literal>, and
<literal>&lt;=</literal>, with <literal>==</literal> and <literal>&lt;=</literal>, with <literal>==</literal> and
<literal>!=</literal> being overloaded to allow string <literal>!=</literal> being overloaded to allow string
comparisons as well. <literal>&&</literal> represents logical comparisons as well. <literal>&amp;&amp;</literal> represents logical
AND; <literal>||</literal> is logical OR and <literal>!</literal> AND; <literal>||</literal> is logical OR and <literal>!</literal>
is logical NOT. The arithmetic and string operators take is logical NOT. The arithmetic and string operators take
precedence over all three of these operators, while NOT precedence over all three of these operators, while NOT

View file

@ -148,13 +148,13 @@ c.o : c.c
<screen>Suff_FindDeps (a.out) <screen>Suff_FindDeps (a.out)
using existing source a.o using existing source a.o
applying .o -> .out to "a.o" applying .o -&gt; .out to "a.o"
Suff_FindDeps (a.o) Suff_FindDeps (a.o)
trying a.c...got it trying a.c...got it
applying .c -> .o to "a.c" applying .c -&gt; .o to "a.c"
Suff_FindDeps (b.o) Suff_FindDeps (b.o)
trying b.c...got it trying b.c...got it
applying .c -> .o to "b.c" applying .c -&gt; .o to "b.c"
Suff_FindDeps (a.c) Suff_FindDeps (a.c)
trying a.y...not there trying a.y...not there
trying a.l...not there trying a.l...not there
@ -234,9 +234,9 @@ cc a.o b.o</screen>
trying jive.c...not there trying jive.c...not there
trying jive.y...not there trying jive.y...not there
trying jive.l...got it trying jive.l...got it
applying .l -> .c to "jive.l" applying .l -&gt; .c to "jive.l"
applying .c -> .o to "jive.c" applying .c -&gt; .o to "jive.c"
applying .o -> .out to "jive.o"</screen> applying .o -&gt; .out to "jive.o"</screen>
<para>and this is why: <application>PMake</application> starts with the <para>and this is why: <application>PMake</application> starts with the
target <filename>jive.out</filename>, figures out its suffix target <filename>jive.out</filename>, figures out its suffix
@ -256,7 +256,7 @@ cc a.o b.o</screen>
for <filename>jive.l</filename> and, lo and behold, there it is. for <filename>jive.l</filename> and, lo and behold, there it is.
At this point, it has defined a transformation path as follows:</para> At this point, it has defined a transformation path as follows:</para>
<literallayout><filename>.l</filename> -> <filename>.c</filename> -> <filename>.o</filename> -> <filename>.out</filename></literallayout> <literallayout><filename>.l</filename> -&gt; <filename>.c</filename> -&gt; <filename>.o</filename> -&gt; <filename>.out</filename></literallayout>
<para>and applies the transformation rules accordingly. For completeness, <para>and applies the transformation rules accordingly. For completeness,
and to give you a better idea of what <application>PMake</application> and to give you a better idea of what <application>PMake</application>
@ -266,10 +266,10 @@ cc a.o b.o</screen>
<screen>Suff_FindDeps (jive.o) <screen>Suff_FindDeps (jive.o)
using existing source jive.c using existing source jive.c
applying .c -> .o to "jive.c" applying .c -&gt; .o to "jive.c"
Suff_FindDeps (jive.c) Suff_FindDeps (jive.c)
using existing source jive.l using existing source jive.l
applying .l -> .c to "jive.l" applying .l -&gt; .c to "jive.l"
Suff_FindDeps (jive.l) Suff_FindDeps (jive.l)
Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date
Examining jive.c...non-existent...out-of-date Examining jive.c...non-existent...out-of-date
@ -485,20 +485,20 @@ lib2.a : $(LIB2OBJS)
<programlisting>system : init a.fasl b.fasl c.fasl <programlisting>system : init a.fasl b.fasl c.fasl
for i in $(.ALLSRC); for i in $(.ALLSRC);
do do
echo -n '(load "' >> input echo -n '(load "' &gt;&gt; input
echo -n ${i} >> input echo -n ${i} &gt;&gt; input
echo '")' >> input echo '")' &gt;&gt; input
done done
echo '(dump "$(.TARGET)")' >> input echo '(dump "$(.TARGET)")' &gt;&gt; input
lisp < input lisp &lt; input
a.fasl : a.l init COMPILE a.fasl : a.l init COMPILE
b.fasl : b.l init COMPILE b.fasl : b.l init COMPILE
c.fasl : c.l init COMPILE c.fasl : c.l init COMPILE
COMPILE : .USE COMPILE : .USE
echo '(compile "$(.ALLSRC)")' >> input echo '(compile "$(.ALLSRC)")' &gt;&gt; input
init : .EXEC init : .EXEC
echo '(load-system)' > input</programlisting> echo '(load-system)' &gt; input</programlisting>
<literal>.EXEC</literal> sources, do not appear in the <literal>.EXEC</literal> sources, do not appear in the
local variables of targets that depend on them (nor are local variables of targets that depend on them (nor are

View file

@ -2601,12 +2601,12 @@ MASTER_SITES= alpha:DEFAULT,SOME_SITE</programlisting>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Directories within group <para>Directories within group
<literal>DEFAULT</literal> -> old:n</para> <literal>DEFAULT</literal> -&gt; old:n</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Directories within group <para>Directories within group
<literal>NEW</literal> -> new</para> <literal>NEW</literal> -&gt; new</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</example> </example>
@ -8965,7 +8965,7 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
<filename>bsd.port.pre.mk</filename>:</para> <filename>bsd.port.pre.mk</filename>:</para>
<programlisting># no need to compile lang/perl5 if perl5 is already in system <programlisting># no need to compile lang/perl5 if perl5 is already in system
.if ${OSVERSION} > 300003 .if ${OSVERSION} &gt; 300003
BROKEN= perl is in system BROKEN= perl is in system
.endif .endif
@ -9575,9 +9575,9 @@ bacula:*:910:</programlisting>
<para>resulting in the following output from <para>resulting in the following output from
<command>make describe</command>:</para> <command>make describe</command>:</para>
<programlisting>===> foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x.</programlisting> <programlisting>===&gt; foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x.</programlisting>
<programlisting>===> foobar-0.1 is unsupported on FreeBSD 5.x.</programlisting> <programlisting>===&gt; foobar-0.1 is unsupported on FreeBSD 5.x.</programlisting>
</sect2> </sect2>
</sect1> </sect1>
@ -9661,7 +9661,7 @@ IGNORE=POINTYHAT is not supported
<command>make describe</command> (and thus, the overall <command>make describe</command> (and thus, the overall
ports <command>make index</command>). The workaround is ports <command>make index</command>). The workaround is
to enclose the conditional comparison in spaces, e.g.: to enclose the conditional comparison in spaces, e.g.:
<programlisting>if ( ${OSVERSION} > 500023 )</programlisting> <programlisting>if ( ${OSVERSION} &gt; 500023 )</programlisting>
Be aware that test-installing a port on 4.9 or 5.2 Be aware that test-installing a port on 4.9 or 5.2
will <emphasis>not</emphasis> detect this problem.</para> will <emphasis>not</emphasis> detect this problem.</para>
</listitem> </listitem>

View file

@ -189,7 +189,7 @@
(renderas (inherited-attribute-string (normalize "renderas") sect)) (renderas (inherited-attribute-string (normalize "renderas") sect))
(hlevel ;; the apparent section level; (hlevel ;; the apparent section level;
(if renderas ;; if not real section level, (if renderas ;; if not real section level,
(string->number ;; then get the apparent level (string-&gt;number ;; then get the apparent level
(substring renderas 4 5)) ;; from "renderas", (substring renderas 4 5)) ;; from "renderas",
(SECTLEVEL))) ;; else use the real level (SECTLEVEL))) ;; else use the real level
(hs (HSIZE (- 4 hlevel)))) (hs (HSIZE (- 4 hlevel))))