dragonfly.git
12 years agoBe very generous with timeouts for synchronize cache. We may wait a very long
Peter Avalos [Sat, 24 Nov 2007 01:31:39 +0000 (01:31 +0000)]
Be very generous with timeouts for synchronize cache. We may wait a very long
time in the cases where it really sends the drive out to lunch, but it also
allows us to catch very weird edge cases of strange drives that might take
a very long time.

Obtained-from: FreeBSD

12 years agoAdd llabs(3).
Simon Schubert [Sat, 24 Nov 2007 00:55:10 +0000 (00:55 +0000)]
Add llabs(3).

12 years agoAdd llabs(3).
Simon Schubert [Sat, 24 Nov 2007 00:54:25 +0000 (00:54 +0000)]
Add llabs(3).

Obtained-From:  FreeBSD

12 years agoUniformly refer to RFCs as 'RFC xxxx' and not 'RFCxxxx' or 'RFC-xxxx'.
Sascha Wildner [Fri, 23 Nov 2007 23:16:37 +0000 (23:16 +0000)]
Uniformly refer to RFCs as 'RFC xxxx' and not 'RFCxxxx' or 'RFC-xxxx'.

12 years agoFix a number of typos in defined values (ioctls and others).
Sascha Wildner [Fri, 23 Nov 2007 23:03:57 +0000 (23:03 +0000)]
Fix a number of typos in defined values (ioctls and others).

12 years agoRemove debugging printfs.
Matthew Dillon [Fri, 23 Nov 2007 22:29:51 +0000 (22:29 +0000)]
Remove debugging printfs.

12 years agoProperly use .Ar
Sascha Wildner [Fri, 23 Nov 2007 20:08:35 +0000 (20:08 +0000)]
Properly use .Ar

12 years agoAdd comment about pcicfgregs.pmgt field
Sepherosa Ziehau [Fri, 23 Nov 2007 14:41:56 +0000 (14:41 +0000)]
Add comment about pcicfgregs.pmgt field

12 years agoCreate structure to group PCI power management configuration
Sepherosa Ziehau [Fri, 23 Nov 2007 14:36:17 +0000 (14:36 +0000)]
Create structure to group PCI power management configuration

Obtained-from: FreeBSD

12 years ago- Add CAP_PTR macro for type 2 devices (cardbus)
Sepherosa Ziehau [Fri, 23 Nov 2007 13:40:58 +0000 (13:40 +0000)]
- Add CAP_PTR macro for type 2 devices (cardbus)
- Less magic values in pci_read_extcap()

Obtained-from: FreeBSD

12 years agoUse .Ev
Sascha Wildner [Thu, 22 Nov 2007 21:17:55 +0000 (21:17 +0000)]
Use .Ev

12 years agoFix typos.
Hasso Tepper [Thu, 22 Nov 2007 20:19:43 +0000 (20:19 +0000)]
Fix typos.

Obtained-from: NetBSD

12 years agoRemove comments about 0x2 flags value and FDC_YE option of which there
Sascha Wildner [Thu, 22 Nov 2007 20:13:38 +0000 (20:13 +0000)]
Remove comments about 0x2 flags value and FDC_YE option of which there
are no traces in the code.

Found-in: FreeBSD

12 years agoReplace the very predictable 'random' IP sequence number generator with
Matthew Dillon [Thu, 22 Nov 2007 19:57:14 +0000 (19:57 +0000)]
Replace the very predictable 'random' IP sequence number generator with
something far less predictable.  Use DragonFly's built-in PRNG and add a
shuffle algorithm.  We eat 128KB of ram for the shuffle array but I've
pretty much had it with roll-your-own PRNGs.  At least this way any PRNG
issues can be corrected in one place -- our system PRNG.

Turn net.inet.ip.random_id on by default.  Eat the minor loss in performance.
On the bright side, our PRNG is very fast, so this should not represent
a burden.

References: Analysis of BSD ip randomizer algorithm by "Amit Klein"
    <amit.klein@trusteer.com> showing serious vulnerabilities in
    the algorithm.

12 years agoFix bug in scsi_read_write() where it might use 6-byte commands when
Peter Avalos [Thu, 22 Nov 2007 17:35:12 +0000 (17:35 +0000)]
Fix bug in scsi_read_write() where it might use 6-byte commands when
10/12-byte-specific flags were specified.

Obtained-from: FreeBSD

12 years agoFix typo in comment.
Peter Avalos [Thu, 22 Nov 2007 17:11:43 +0000 (17:11 +0000)]
Fix typo in comment.

Obtained-from: FreeBSD

12 years agoAdd interfaces for SCSI LOG SELECT and LOG SENSE commands.
Peter Avalos [Thu, 22 Nov 2007 16:34:25 +0000 (16:34 +0000)]
Add interfaces for SCSI LOG SELECT and LOG SENSE commands.

Obtained-from: FreeBSD

12 years agoMark some functions as __printflike().
Peter Avalos [Thu, 22 Nov 2007 15:53:16 +0000 (15:53 +0000)]
Mark some functions as __printflike().

Obtained-from: FreeBSD

12 years agoUse .Ev
Sascha Wildner [Thu, 22 Nov 2007 08:40:03 +0000 (08:40 +0000)]
Use .Ev

12 years agoKill the command (don't rerun it) if we had an AUTOSENSE failure.
Peter Avalos [Thu, 22 Nov 2007 00:59:49 +0000 (00:59 +0000)]
Kill the command (don't rerun it) if we had an AUTOSENSE failure.
If we had an AUTOSENSE failure, we don't know what SENSE DATA
we had for a CHECK CONDITION. It's far better to assume failure
in this case.

Obtained-from: FreeBSD

12 years agoPropagate CAM_DIS_DISCONNECT on through:
Peter Avalos [Wed, 21 Nov 2007 22:10:16 +0000 (22:10 +0000)]
Propagate CAM_DIS_DISCONNECT on through:

1. If we get frozen, unfreeze for disable disconnects.
2. Put CAM_DIS_DISCONNECT commands at the head of the work queue
(we have a target still connected and we can't run anything else
until this command completes).

If we had an error sending the last CTIO, unfreeze the queue anyway.

Obtained-from: FreeBSD

12 years agoFix .Dv abuse and use .Li instead.
Sascha Wildner [Wed, 21 Nov 2007 22:02:32 +0000 (22:02 +0000)]
Fix .Dv abuse and use .Li instead.

12 years agoCheck the void * argument in the AC_FOUND_DEV case against NULL.
Peter Avalos [Wed, 21 Nov 2007 21:28:41 +0000 (21:28 +0000)]
Check the void * argument in the AC_FOUND_DEV case against NULL.

Obtained-from: FreeBSD

12 years agoCleanup some of the XPORT_FC code (mostly whitespace)
Peter Avalos [Wed, 21 Nov 2007 20:29:34 +0000 (20:29 +0000)]
Cleanup some of the XPORT_FC code (mostly whitespace)

Obtained-from: FreeBSD

12 years agoAdd a transport settings variant for Fibre Channel.
Peter Avalos [Wed, 21 Nov 2007 20:07:31 +0000 (20:07 +0000)]
Add a transport settings variant for Fibre Channel.

Obtained-from: FreeBSD

12 years agoUniformly use .Pa for URLs.
Sascha Wildner [Wed, 21 Nov 2007 19:12:41 +0000 (19:12 +0000)]
Uniformly use .Pa for URLs.

12 years agoFix loc_seek - using lseek to acquire the directory cookie.
Matthew Dillon [Wed, 21 Nov 2007 05:48:31 +0000 (05:48 +0000)]
Fix loc_seek - using lseek to acquire the directory cookie.

Reminded-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
12 years agoHAMMER 5/many - in-memory cache and more vnops.
Matthew Dillon [Tue, 20 Nov 2007 22:55:40 +0000 (22:55 +0000)]
HAMMER 5/many - in-memory cache and more vnops.

Get more vnops working with the in-memory cache.  Files can now be created,
linked, and deleted.  Directories can be scanned.  NOTE: The topology is
not yet flushed to the media.

12 years agoBreak out the scan info structure's support routines so external code
Matthew Dillon [Tue, 20 Nov 2007 22:52:23 +0000 (22:52 +0000)]
Break out the scan info structure's support routines so external code
can use them directly.

12 years agomdoc(7) section order
Sascha Wildner [Tue, 20 Nov 2007 22:50:48 +0000 (22:50 +0000)]
mdoc(7) section order

12 years agoAdd vop_helper_create_uid() - roughly taken from UFS. Figure out special
Matthew Dillon [Tue, 20 Nov 2007 21:37:54 +0000 (21:37 +0000)]
Add vop_helper_create_uid() - roughly taken from UFS.  Figure out special
directory permissions given the directory mode, uid, cred, and other
information, and return the uid which should be used to create a new
file/node.

12 years agoClean up some missing 32->64 bit cookie conversions. Adjust the NFS server
Matthew Dillon [Tue, 20 Nov 2007 21:36:08 +0000 (21:36 +0000)]
Clean up some missing 32->64 bit cookie conversions.  Adjust the NFS server
to return 64 bit cookies (NFSv3 supports 64 bit cookies).

12 years agoMake necessary changes to readdir/getdirentries to support HAMMER. HAMMER
Matthew Dillon [Tue, 20 Nov 2007 21:03:51 +0000 (21:03 +0000)]
Make necessary changes to readdir/getdirentries to support HAMMER.  HAMMER
needs to use 64 bit directory cookies.

Adjust libc's DIR structure and change readdir to acquire the directory
position via lseek() instead of using the basep argument to getdirentries().
The basep argument is a long, which is 32 bits on IA32, and it just isn't
wide enough.  The seek position is 64 bits and is wide enough.

Sizeof(DIR) has changed, but hopefully won't cause any major issues since
libc is responsible for allocating it.  The APIs remain the same.

Adjust the VOP_READIR() VFS interface routine to return 64 bit cookies.
All VFSs have been reworked, requiring only minor adjustments.

12 years agoAdjust getdirentries() to allow basep to be NULL. Use off_t for the loff
Matthew Dillon [Tue, 20 Nov 2007 18:35:46 +0000 (18:35 +0000)]
Adjust getdirentries() to allow basep to be NULL.  Use off_t for the loff
calculation, but we can't change basep's documented type yet.

12 years agoAdd a helper function vop_helper_setattr_flags() modeled off of UFS's
Matthew Dillon [Tue, 20 Nov 2007 18:34:01 +0000 (18:34 +0000)]
Add a helper function vop_helper_setattr_flags() modeled off of UFS's
chflags checks.

12 years agoUpdate the documentation for getdirentries(2). Describe issues with using
Matthew Dillon [Tue, 20 Nov 2007 18:21:35 +0000 (18:21 +0000)]
Update the documentation for getdirentries(2).  Describe issues with using
long *basep (it not being wide enough) and suggest using lseek (with its 64
bit seek 'offset') instead.

12 years agoFix the fix.
Hasso Tepper [Tue, 20 Nov 2007 11:32:28 +0000 (11:32 +0000)]
Fix the fix.

Pointed-out-by: swildner@
12 years agoAdd SATA ATAPI support for AHCI controllers.
Hasso Tepper [Tue, 20 Nov 2007 09:25:21 +0000 (09:25 +0000)]
Add SATA ATAPI support for AHCI controllers.

Obtained-from: FreeBSD
Reviewed-by: tgen@
12 years agoFix typo.
Hasso Tepper [Tue, 20 Nov 2007 08:40:42 +0000 (08:40 +0000)]
Fix typo.

12 years agoHAMMER 4/many - more core infrastructure
Matthew Dillon [Tue, 20 Nov 2007 07:16:28 +0000 (07:16 +0000)]
HAMMER 4/many - more core infrastructure

* Add reserved areas for a boot area and a memory log.

* Add merged scan operations which are the core procedures used to execute
  most filesystem operations.  These functions will access both the
  in-memory tree of unsynchronized information and the on-disk topology
  to generate a 'merged' result.

  Amoung other things this allows the filesystem to hold operations in a
  memory cache without actually having to mess with the HAMMER topology
  on-disk.  The on-disk topology is then updated in a deferred manner.
  Disk I/O is entirely avoided for self contained operations which create,
  write, and delete related files quickly enough.

* Add unmount sequencing, make mount and df work again.

* Test the reference counting and flushing system on most primary
  structures.

* Test basic buffer cache interactions, reading, writing, and lazy
  synchronization.

* Start tying VNOPS into the infrastructure.  open/close/read/write works
  now via the in-memory cache (none of it is synched to the disk topology
  yet!).  readdir doesn't yet work... the 32 bit cookies are not large
  enough.

12 years agoFC path inquiry settings.
Peter Avalos [Tue, 20 Nov 2007 00:03:21 +0000 (00:03 +0000)]
FC path inquiry settings.

Obtained-from: FreeBSD

12 years agoFC path inquiry settings.
Peter Avalos [Mon, 19 Nov 2007 23:52:10 +0000 (23:52 +0000)]
FC path inquiry settings.

Obtained-from: FreeBSD

12 years agoPrint out the asc/ascq and description even when both the asc and ascq
Peter Avalos [Mon, 19 Nov 2007 23:29:13 +0000 (23:29 +0000)]
Print out the asc/ascq and description even when both the asc and ascq
are zero.  This is so that users will see the "no additional sense" printout
and know that they have the full sense information.

Obtained-from: FreeBSD

12 years agoRemove various references to sysinstall from the system.
Sascha Wildner [Mon, 19 Nov 2007 18:49:06 +0000 (18:49 +0000)]
Remove various references to sysinstall from the system.

Reported-by: Robert Gauthier <rg0@sympatico.ca>
12 years agoRemove old freebsd-tips fortune(6) datfile.
Sascha Wildner [Mon, 19 Nov 2007 18:23:36 +0000 (18:23 +0000)]
Remove old freebsd-tips fortune(6) datfile.

12 years agoHAMMER 3/many - more core infrastructure.
Matthew Dillon [Mon, 19 Nov 2007 00:53:40 +0000 (00:53 +0000)]
HAMMER 3/many - more core infrastructure.

* Add an in-memory B-Tree node abstraction
* Add an in-memory record abstraction.
* Put the B-Tree cursor code in its own source file.
* Fill in more of the VOP code.

* Do a major clean-up of all in-memory structures and some on-disk
  structures.  All the major in-memory structures now use similarly
  named functions.

* Move inter-cluster link from a B-Tree leaf node to a B-Tree internal
  node, giving us a left and right boundary to play with.  This simplifies
  the algorithms by quite a bit.
* Allow the B-Tree to be unbalanced by moving the sub-type from the B-Tree
  node header to the B-Tree element structure.

* Revamp the I/O infrastructure, in particular allow B-Tree nodes to be
  held passively.
* Implement a flexible B-Tree node cache.  References into the B-Tree can
  be cached by inodes.  If the related buffer is flushed by the system, the
  related cache pointers will be cleared.

12 years agoAdd quirk for SONY SMO drive. This (pre SCSI-2) drive returns a mystic
Peter Avalos [Sun, 18 Nov 2007 19:34:50 +0000 (19:34 +0000)]
Add quirk for SONY SMO drive.  This (pre SCSI-2) drive returns a mystic
code when the medium is inserted but not spun up.

Obtained-from: FreeBSD

12 years agoFix up unit attention and selection timeout handling.
Peter Avalos [Sun, 18 Nov 2007 19:27:29 +0000 (19:27 +0000)]
Fix up unit attention and selection timeout handling.

- change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls
  cam_periph_runccb().
- change the pt(4) driver to ignore unit attentions

Obtained-from: FreeBSD

12 years agoAdd sense key table entries for DATA PROTECT and BLANK CHECK. This will
Peter Avalos [Sun, 18 Nov 2007 19:16:26 +0000 (19:16 +0000)]
Add sense key table entries for DATA PROTECT and BLANK CHECK.  This will
prevent scsi_sense_desc() from deferencing a NULL pointer when a drive
happens to return one of these sense keys.

Obtained-from: FreeBSD

12 years agoIn camperiphscsisenseerror(), don't return an error when the error action
Peter Avalos [Sun, 18 Nov 2007 19:11:23 +0000 (19:11 +0000)]
In camperiphscsisenseerror(), don't return an error when the error action
is SS_NOP.

Obtained-from: FreeBSD

12 years agoFix typo. SS_START is quite different than SSS_START.
Peter Avalos [Sun, 18 Nov 2007 19:04:08 +0000 (19:04 +0000)]
Fix typo.  SS_START is quite different than SSS_START.

12 years agoIf we have an error and are booting verbosely, don't be complaining
Peter Avalos [Sun, 18 Nov 2007 18:49:53 +0000 (18:49 +0000)]
If we have an error and are booting verbosely, don't be complaining
if this was a non-retryable selection timeout.

Obtained-from: FreeBSD

12 years agoFix typo.
Peter Avalos [Sun, 18 Nov 2007 17:59:54 +0000 (17:59 +0000)]
Fix typo.

Obtained-from: FreeBSD

12 years agoRewrite of the CAM error recovery code.
Peter Avalos [Sun, 18 Nov 2007 17:53:02 +0000 (17:53 +0000)]
Rewrite of the CAM error recovery code.

Some of the major changes include:

- The SCSI error handling portion of cam_periph_error() has
  been broken out into a number of subfunctions to better
  modularize the code that handles the hierarchy of SCSI errors.
  As a result, the code is now much easier to read.

- String handling and error printing has been significantly
  revamped.  We now use sbufs to do string formatting instead
  of using printfs (for the kernel) and snprintf/strncat (for
  userland) as before.

  There is a new catchall error printing routine,
  cam_error_print() and its string-based counterpart,
  cam_error_string() that allow the kernel and userland
  applications to pass in a CCB and have errors printed out
  properly, whether or not they're SCSI errors.  Among other
  things, this helped eliminate a fair amount of duplicate code
  in camcontrol.

  We now print out more information than before, including
  the CAM status and SCSI status and the error recovery action
  taken to remedy the problem.

Obtained-from: FreeBSD

12 years agoRemove <net/intrq.h> via 'make upgrade'.
Sascha Wildner [Sun, 18 Nov 2007 16:13:31 +0000 (16:13 +0000)]
Remove <net/intrq.h> via 'make upgrade'.

12 years agoAdd an altq(9) manpage.
Sascha Wildner [Sun, 18 Nov 2007 14:10:41 +0000 (14:10 +0000)]
Add an altq(9) manpage.

Adapted-from: NetBSD
Reviewed-by: sephe
12 years agoCPU localize dummynet(4) step 2/2:
Sepherosa Ziehau [Sun, 18 Nov 2007 13:00:28 +0000 (13:00 +0000)]
CPU localize dummynet(4) step 2/2:
- Add ip_dn_sockopt() in net/dummynet/ip_dummynet_glue.c, which
  o  Copy socket option from user space.
  o  Dispatch get/config/delete/flush operation to CPU ip_dn_cpu, so we don't
     even need to enter critical section when iterating pipes/flow_sets or
     checking whether dummynet has loaded.
  o  Copy out information from kernel space to user space.
- Adjust raw_ip.c to call ip_dn_sockopt() instead of checking DUMMYNET_LOADED
  and calling ip_dn_ctl_ptr.
- Remove now unnecessary critical section protection, however, replying dn_msg,
  setting and clearing ip_dn_io_ptr still need to be protected by critical
  section, since dn_msg and ip_dn_io_ptr are touched/checked by systimer
  callback.

12 years agoAdd a new light weight function to synchronize IPI queues on other CPUs by
Sepherosa Ziehau [Sun, 18 Nov 2007 09:53:19 +0000 (09:53 +0000)]
Add a new light weight function to synchronize IPI queues on other CPUs by
broadcasting a NOP IPI to other CPUs; this is used be make sure that all
IPIs before the NOP one are processed.

Use this new function to fix a possible race between kfree() and
malloc_uninit():
kfree() may be in transitting state when malloc_uninit() is running.

Ideas-from: dillon@
Reviewed-by: dillon@
12 years agoFix inquiry length detection for the ses(4) driver.
Peter Avalos [Sat, 17 Nov 2007 23:47:17 +0000 (23:47 +0000)]
Fix inquiry length detection for the ses(4) driver.
It was using the inq_len member of the ccb_getdev structure, but that
value was never filled in.

So we now get the length from the inquiry data returned by the drive.
(Since we will fetch as much inquiry data as the drive claims to support.)

Obtained-from: FreeBSD

12 years agoDon't use /dev/rXXX names.
Peter Avalos [Sat, 17 Nov 2007 22:41:11 +0000 (22:41 +0000)]
Don't use /dev/rXXX names.

Obtained-from: FreeBSD

12 years agoChange the peripheral driver list from a linker set to module driven
Peter Avalos [Sat, 17 Nov 2007 20:28:46 +0000 (20:28 +0000)]
Change the peripheral driver list from a linker set to module driven
driver registration.  This should allow things like da, sa, cd etc to be
in seperate KLD's to the cam core and make them preloadable.

Obtained-from: FreeBSD

12 years agoOffload the dummynet(4) init/stop work to the netisr on CPU ip_dn_cpu
Sepherosa Ziehau [Sat, 17 Nov 2007 09:23:53 +0000 (09:23 +0000)]
Offload the dummynet(4) init/stop work to the netisr on CPU ip_dn_cpu

12 years ago- Move dummynet sysctl tree root from ip_dummynet.c to ip_dummynet_glue.c
Sepherosa Ziehau [Sat, 17 Nov 2007 08:30:00 +0000 (08:30 +0000)]
- Move dummynet sysctl tree root from ip_dummynet.c to ip_dummynet_glue.c
- Add tunable to change the CPU that will run dummynet
- Add a read-only sysctl node to show the CPU number that runs dummynet

12 years agoMore assertions:
Sepherosa Ziehau [Sat, 17 Nov 2007 08:07:27 +0000 (08:07 +0000)]
More assertions:
- The mbuf contains pkthdr
- The mbuf has been tagged for dummynet(4)

12 years agoMake sure that the mbuf contains pkthdr.
Sepherosa Ziehau [Sat, 17 Nov 2007 08:05:43 +0000 (08:05 +0000)]
Make sure that the mbuf contains pkthdr.

12 years agoUpdate for less-415.
Peter Avalos [Fri, 16 Nov 2007 22:32:32 +0000 (22:32 +0000)]
Update for less-415.

12 years agoMerge from vendor branch LESS:
Peter Avalos [Fri, 16 Nov 2007 22:31:48 +0000 (22:31 +0000)]
Merge from vendor branch LESS:
Import less-415:

Fix case-insensitive searching with non-ASCII text.

Use symbolic SEEK constants.

Fix search highlight bug with non-ASCII text.

Fix display bug with no-wrap terminals.

New --follow-name option makes F command follow the name of a file
rather than the file descriptor if an open file is renamed.

12 years agoImport less-415:
Peter Avalos [Fri, 16 Nov 2007 22:31:48 +0000 (22:31 +0000)]
Import less-415:

Fix case-insensitive searching with non-ASCII text.

Use symbolic SEEK constants.

Fix search highlight bug with non-ASCII text.

Fix display bug with no-wrap terminals.

New --follow-name option makes F command follow the name of a file
rather than the file descriptor if an open file is renamed.

12 years agoNuke net/intrq.[ch] and ipintrq related bits; they were gone almost three
Sepherosa Ziehau [Fri, 16 Nov 2007 05:07:36 +0000 (05:07 +0000)]
Nuke net/intrq.[ch] and ipintrq related bits; they were gone almost three
years ago.

12 years agoCPU localize dummynet(4) step 1/2
Sepherosa Ziehau [Fri, 16 Nov 2007 02:45:45 +0000 (02:45 +0000)]
CPU localize dummynet(4) step 1/2

       CPU ip_dn_cpu                             CPU n1
+--------------------------+            +---------------------+
|          netisr          |            |                     |
|            |             |            |                     |
|            +<---------------dn_descX----[ip_fw_dn_io_ptr()] |
|            |             |            |                     |
| [ip_dn_io_ptr(dn_descX)] |            |                     |
|            |             |            |                     |
|            |             |            |                     |
|            |             |            |                     |
| [transmit_event() begin  |            |                     |
|            +----------------dn_descY------>[ip_output()]    |
|            :             |            |                     |
|            :             |            |                     |
|            :             |            +---------------------+
|            :             |
|            :             |
|            :             |                     CPU n2
|            :             |            +---------------------+
|            :             |            |                     |
|            +----------------dn_descZ------>[ip_input()]     |
|            :             |            |                     |
|  transmit_event() end]   |            +---------------------+
|            |             |
+--------------------------+

NOTE: transmit_event() is triggered by dummynet systimer on CPU ip_dn_cpu

- Add flow id field, which is packet filter independent, in dummynet
  descriptor, so that we can record the flow id realted information on the
  originator's stack.  In this way, dummynet descriptor and its associated
  mbuf could be dispatched to different thread for further processing.
- Add packet filter private data and private data unreference function
  pointer in dummynet descriptor.
- All of the dummynet descriptor is allocated and filled by packet filter
  (only ipfw(4) currently), so things like route entry reference is updated
  on the CPU to which it belongs.
- All packets are dispatched to netisr on CPU ip_dn_cpu to be queued on the
  target flow queue.  Netisr on CPU ip_dn_cpu is also where various dummynet
  events got processed.
- DUMMYNET_LOADED is not checked before dispatching a packet; it is checked
  in netisr before the packet is handed to dummynet.  This paves the way for
  step 2/2.
- ip_{output,input}/ether_{demux,output_frame} is no longer called directly
  in dummynet, they are called after packet dispatched back to the originator
  CPU, so that ip_input() will be called on the same CPU (as determined by
  ip_mport()) and things like route entry reference will be updated on the
  CPU to which it belongs.
- If the packet is to be dispatched back to ip_output(), the recorded route
  entry is checked to make sure that it is still up.
- Dummynet discriptor and its associated mbuf is freed on their originator CPU.
- Reference count the ipfw(4) rule if it is going to be associated with a
  dummynet descriptor, so we would not have a dangling rule pointer if the
  rule was deleted when the dummynet descriptor was in transit state.
Suggested-by: dillon@
- If ipfw(4) is compiled and loaded as module, reference count the ipfw(4)
  module usage, if a rule is associated with a dummynet descriptor.
- Add net/dummynet/ip_dummynet_glue.c, which contains various netisr dispatch
  function.  This file will be compiled into kernel if 'options INET' is set,
  so that we will not have a dangling function pointer in transitting dummynet
  descriptor.
- Add DUMMYNET_MBUF_TAGGED mbuf fw_flag, which may be used later.
- Nuke dummynet's dependency on ipfw(4).

12 years ago* Remove the remains of the obsolete timeout()/untimeout() interface.
Sascha Wildner [Wed, 14 Nov 2007 18:27:52 +0000 (18:27 +0000)]
* Remove the remains of the obsolete timeout()/untimeout() interface.

* Repocopy timeout(9) to callout(9). Add missing documentation, remove
  obsolete information and reword some paragraphs.

* Adjust some comments and other documentation.

Some of the text in callout(9) was taken from NetBSD.

12 years agoSwitch to sys/queue.h macros.
Peter Avalos [Wed, 14 Nov 2007 02:05:35 +0000 (02:05 +0000)]
Switch to sys/queue.h macros.

12 years agoFix building of bktr(4) with 'options BKTR_GPIO_ACCESS'.
Sascha Wildner [Tue, 13 Nov 2007 19:43:32 +0000 (19:43 +0000)]
Fix building of bktr(4) with 'options BKTR_GPIO_ACCESS'.

Reported-by: Frank Josellis <frank@dynamical-systems.org>
12 years agoUnbreak LINT build
Sepherosa Ziehau [Tue, 13 Nov 2007 14:09:32 +0000 (14:09 +0000)]
Unbreak LINT build

12 years agoRemove unneeded includes.
Peter Avalos [Tue, 13 Nov 2007 00:28:27 +0000 (00:28 +0000)]
Remove unneeded includes.

Obtained-from: FreeBSD

12 years agoRemove duplicate sys/proc.h.
Peter Avalos [Mon, 12 Nov 2007 23:48:52 +0000 (23:48 +0000)]
Remove duplicate sys/proc.h.

12 years agoAvoid resource_locate().
Peter Avalos [Mon, 12 Nov 2007 21:48:39 +0000 (21:48 +0000)]
Avoid resource_locate().

Obtained-from: FreeBSD

12 years agoRemove unneeded includes.
Peter Avalos [Mon, 12 Nov 2007 21:33:51 +0000 (21:33 +0000)]
Remove unneeded includes.

Obtained-from: FreeBSD

12 years agoFix usage().
Sascha Wildner [Mon, 12 Nov 2007 21:19:11 +0000 (21:19 +0000)]
Fix usage().

12 years agoFix function name.
Sascha Wildner [Mon, 12 Nov 2007 19:07:40 +0000 (19:07 +0000)]
Fix function name.

12 years agoRemove reference to non-existant uhub(4).
Sascha Wildner [Mon, 12 Nov 2007 19:04:00 +0000 (19:04 +0000)]
Remove reference to non-existant uhub(4).

12 years agoLinksys WPC54GS ver.2 works well with bwi(4)
Sepherosa Ziehau [Mon, 12 Nov 2007 11:46:40 +0000 (11:46 +0000)]
Linksys WPC54GS ver.2 works well with bwi(4)

12 years ago-x was removed long time ago.
Hasso Tepper [Mon, 12 Nov 2007 11:17:59 +0000 (11:17 +0000)]
-x was removed long time ago.

12 years agoBuild CAM as a module.
Peter Avalos [Mon, 12 Nov 2007 07:27:50 +0000 (07:27 +0000)]
Build CAM as a module.

This should make it possible to compile a kernel without SCSI support and
load it when, for example, a USB floppy is connected.

Obtained-from: FreeBSD

12 years agoWarns cleanup.
Peter Avalos [Sun, 11 Nov 2007 23:59:14 +0000 (23:59 +0000)]
Warns cleanup.

12 years agocdevsw -> dev_ops.
Peter Avalos [Sun, 11 Nov 2007 23:56:40 +0000 (23:56 +0000)]
cdevsw -> dev_ops.

12 years agoSync with FreeBSD.
Sascha Wildner [Sun, 11 Nov 2007 22:15:30 +0000 (22:15 +0000)]
Sync with FreeBSD.

12 years agoDon't include <sys/buf.h> twice.
Peter Avalos [Sun, 11 Nov 2007 16:08:08 +0000 (16:08 +0000)]
Don't include <sys/buf.h> twice.

12 years agoDon't enable annoying -Wpointer-sign in -Wall
Sepherosa Ziehau [Sun, 11 Nov 2007 07:43:18 +0000 (07:43 +0000)]
Don't enable annoying -Wpointer-sign in -Wall

12 years agoProtect pollctx fields (noticably netmsg used to schedule netisr_poll),
Sepherosa Ziehau [Sun, 11 Nov 2007 07:38:29 +0000 (07:38 +0000)]
Protect pollctx fields (noticably netmsg used to schedule netisr_poll),
which will be touched by systimer callback function by critical section.

12 years agoThe maximum AAC_DEBUG value is 4.
Sascha Wildner [Sat, 10 Nov 2007 19:58:23 +0000 (19:58 +0000)]
The maximum AAC_DEBUG value is 4.

12 years agoRevert part of my previous commit.
Sascha Wildner [Sat, 10 Nov 2007 19:50:29 +0000 (19:50 +0000)]
Revert part of my previous commit.

aac_printstate0() is supposed to be callable from ddb.

12 years agoSome aac(4) cleanup:
Sascha Wildner [Sat, 10 Nov 2007 19:02:04 +0000 (19:02 +0000)]
Some aac(4) cleanup:

* Activate aac_debug.c. Fix AAC_DEBUG and add it to LINT.

* Staticise stuff which is used only locally.

* Remove unused functions.

* Constify an argument of aac_print_fib().

12 years agoInclude <sys/socketvar2.h> for ssb_lock/unlock (fixes LINT build).
Sascha Wildner [Sat, 10 Nov 2007 17:55:25 +0000 (17:55 +0000)]
Include <sys/socketvar2.h> for ssb_lock/unlock (fixes LINT build).

12 years agoRemove 386 CPU support from the runtime linker.
Hasso Tepper [Fri, 9 Nov 2007 19:38:50 +0000 (19:38 +0000)]
Remove 386 CPU support from the runtime linker.

12 years agoFix LINT build.
Hasso Tepper [Fri, 9 Nov 2007 18:36:20 +0000 (18:36 +0000)]
Fix LINT build.

Reported-by: swildner
12 years agoInitialize tupleid to stop gcc's whining.
Sascha Wildner [Fri, 9 Nov 2007 10:20:30 +0000 (10:20 +0000)]
Initialize tupleid to stop gcc's whining.

12 years agoFix references.
Sascha Wildner [Wed, 7 Nov 2007 21:38:00 +0000 (21:38 +0000)]
Fix references.

12 years agoRemove last I386_CPU remains.
Sascha Wildner [Wed, 7 Nov 2007 20:56:20 +0000 (20:56 +0000)]
Remove last I386_CPU remains.

12 years agoSeparate ssb_lock() and ssb_unlock() into its own header file and reimplement
Matthew Dillon [Wed, 7 Nov 2007 18:24:06 +0000 (18:24 +0000)]
Separate ssb_lock() and ssb_unlock() into its own header file and reimplement
the macro as an inline.  Using the DragonFly '2' notation for header files
containing potentially complex inlines.

Correct an extremely old bug that caused ssb_lock() to always return success,
even when it failed.   This could have been responsible for miscellanious
random network bug reports over the years.

Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
Taken-from: FreeBSD using the inline suggested by OpenBSD