dragonfly.git
12 years agoMerge from vendor branch LIBARCHIVE:
Peter Avalos [Sat, 5 May 2007 21:25:33 +0000 (21:25 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive 2.1.10 which brings in a few minor code cleanups.

12 years agoImport libarchive 2.1.10 which brings in a few minor code cleanups.
Peter Avalos [Sat, 5 May 2007 21:25:33 +0000 (21:25 +0000)]
Import libarchive 2.1.10 which brings in a few minor code cleanups.

12 years agoGrab version from the contributed code instead of manually updating it
Peter Avalos [Sat, 5 May 2007 21:16:57 +0000 (21:16 +0000)]
Grab version from the contributed code instead of manually updating it
every time.

12 years agoThe bus_get_resource_list DEVMETHOD is primarily used to by PCI devices
Matthew Dillon [Sat, 5 May 2007 16:52:55 +0000 (16:52 +0000)]
The bus_get_resource_list DEVMETHOD is primarily used to by PCI devices
to get a list of resources from their parent bus device.  The default
method should not just recurse up a randomly or a child might get
something really unexpected.  Instead, if the method is not supported,
NULL should be returned.

Obtained-from: FreeBSD
Suggestd-by: Martin <dragonfly@wommm.nl>
12 years ago(essential part of rev 1.54 in FreeBSD)
YONETANI Tomokazu [Sat, 5 May 2007 16:13:53 +0000 (16:13 +0000)]
(essential part of rev 1.54 in FreeBSD)
Pull out the module path from the loader.  When you boot a kernel
installed in a different place (say /test and /test/modules) using
module_path, you'd want your kern.module_path set to the same paths
or else you can end up loading out-of-sync modules.

12 years agoUpdate vnode.9, correct spelling.
Matthew Dillon [Sat, 5 May 2007 06:26:57 +0000 (06:26 +0000)]
Update vnode.9, correct spelling.

12 years agoUpdate the vget, vput, vref, vrele, vhold, and vdrop documentation
Matthew Dillon [Sat, 5 May 2007 06:09:01 +0000 (06:09 +0000)]
Update the vget, vput, vref, vrele, vhold, and vdrop documentation
to reflect reality.

12 years agoSync with NetBSD.
Peter Avalos [Sat, 5 May 2007 00:27:40 +0000 (00:27 +0000)]
Sync with NetBSD.

12 years agopci_get_resource_list() was returning an illegal pointer instead of NULL
Matthew Dillon [Fri, 4 May 2007 17:25:04 +0000 (17:25 +0000)]
pci_get_resource_list() was returning an illegal pointer instead of NULL
in cases where no resource list is present.

Reported-by: Martin <dragonfly@wommm.nl>
12 years agoFollowup commit - fix a bug in the last commit.
Matthew Dillon [Fri, 4 May 2007 17:18:55 +0000 (17:18 +0000)]
Followup commit - fix a bug in the last commit.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
12 years agoMake libthread_xu use the new lwp_rtprio() system call, mainly taken from
Matthew Dillon [Thu, 3 May 2007 23:08:34 +0000 (23:08 +0000)]
Make libthread_xu use the new lwp_rtprio() system call, mainly taken from
FreeBSD.  Add additional code to bounds check priority values rather then
silently accepting out of bounds values.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Obtained-from: Portions obtained from FreeBSD

12 years agoAdd a new system call, lwp_rtprio(), and regenerate system calls.
Matthew Dillon [Thu, 3 May 2007 23:04:36 +0000 (23:04 +0000)]
Add a new system call, lwp_rtprio(), and regenerate system calls.
int lwp_rtprio (int, pid_t, lwpid_t, struct rtprio *);

This patch provides an alternative to rtprio(2) which is able to operate
on individual LWPs.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
12 years agoRestore part of old behaviour of bge_tick() -- if link is up, then don't
Sepherosa Ziehau [Thu, 3 May 2007 14:09:22 +0000 (14:09 +0000)]
Restore part of old behaviour of bge_tick() -- if link is up, then don't
call mii_tick().  Mii_tick() will read and write various PHY registers.
For bge(4), PHY accessing registers normally involves flipping AUTOPOLL
bit of BGE_MI_MODE, which trigers interrupts about link state changing.

# This changing restores netperf UDP_RR

12 years agoregen
Sepherosa Ziehau [Thu, 3 May 2007 08:32:24 +0000 (08:32 +0000)]
regen

12 years agoPHY ids for Broadcom 5755/5787
Sepherosa Ziehau [Thu, 3 May 2007 08:31:33 +0000 (08:31 +0000)]
PHY ids for Broadcom 5755/5787

12 years agoregen
Sepherosa Ziehau [Thu, 3 May 2007 07:58:57 +0000 (07:58 +0000)]
regen

12 years agoMore Broadcom GigE PCI ids.
Sepherosa Ziehau [Thu, 3 May 2007 07:58:06 +0000 (07:58 +0000)]
More Broadcom GigE PCI ids.

12 years agoFix typo.
Jeremy C. Reed [Wed, 2 May 2007 16:37:36 +0000 (16:37 +0000)]
Fix typo.

12 years ago- Merge following link state detection fixes from FreeBSD:
Sepherosa Ziehau [Wed, 2 May 2007 14:34:10 +0000 (14:34 +0000)]
- Merge following link state detection fixes from FreeBSD:
  if_bge.c rev 1.{102, 104, 113, 120, 124} (mainly oleg@freebsd.org)
  Local modifications:
  o  Split bge_link_upd() into
     bge_bcm5700_link_upd() -- for 5700 chips, except B2
     bge_tbi_link_upd()     -- for fiber interface
     bge_copper_link_upd()  -- for the rest for the bge(4) chips
     Assign one of them to bge_softc.bge_link_upd based on chip type
     in attach routine.
  o  Add bge_softc.bge_link_chg, which is setup based on chip type in
     attach routine.  It is used to check against MAC_STS to determine
     whether link state is changed or not.
  o  We always trust that "link state changed" bit in MAC_STS is correct.
  o  Keep the PCS error checks for fiber interface during link state
     changing detection.
- After above change, bge_tick() is used to drive mii_tick(), so cleanup
  brgphy_mii_phy_auto().
- In brgphy_status(), use temporary variable to hold BRGPHY_MII_AUXSTS,
  so it is not accessed twice.
- For fiber interface, correct media status reporting if link is down.
  Obtained-from: OpenBSD (brad@openbsd.org)
- Correct chip id for 5700 B1 and 5700 B2.
- Minor style changes.

12 years agoCorrect inverse setting and clearing BBP_R3 "smart mode" bit.
Sepherosa Ziehau [Wed, 2 May 2007 11:29:27 +0000 (11:29 +0000)]
Correct inverse setting and clearing BBP_R3 "smart mode" bit.

Obtained-from: FreeBSD p4 (hselasky@freebsd.org)

12 years agoWhen thread0 is initialized it must also be LWKT scheduled or LWKT will
Matthew Dillon [Wed, 2 May 2007 05:55:35 +0000 (05:55 +0000)]
When thread0 is initialized it must also be LWKT scheduled or LWKT will
forget it exists when you switch away without sleeping.  This fixes
a lockup with early uses of DRIVERSLEEP().

Reported-by: Sascha Wildner <saw@online.de>, YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
12 years agoReduce the livelock limit from 50Khz to 40Khz.
Matthew Dillon [Tue, 1 May 2007 23:53:51 +0000 (23:53 +0000)]
Reduce the livelock limit from 50Khz to 40Khz.

Change the livelock state machine to a one second test based on
gd_time_seconds instead of ticks to try to make the hysteresis
work better.

Add a debug mode so we can measure the interrupt rate while livelocked,
and automatically enable when booting -v (during the boot sequence only).

12 years agoDocument the interrupt moderation timer and the fact that even though
Matthew Dillon [Tue, 1 May 2007 23:48:03 +0000 (23:48 +0000)]
Document the interrupt moderation timer and the fact that even though
we are programming it, no interrupt moderation is actually occuring.

12 years agoata_boot_attach() is no longer used, #if 0 it out.
Matthew Dillon [Tue, 1 May 2007 17:16:23 +0000 (17:16 +0000)]
ata_boot_attach() is no longer used, #if 0 it out.

12 years agoAdd missing crit_exit();
Matthew Dillon [Tue, 1 May 2007 17:07:38 +0000 (17:07 +0000)]
Add missing crit_exit();

12 years agoMove clock registration from before SMP startup to after. APIC_IO builds
Matthew Dillon [Tue, 1 May 2007 02:29:31 +0000 (02:29 +0000)]
Move clock registration from before SMP startup to after.  APIC_IO builds
need the ioapic interrupt routing information from the mptable scan.

12 years agoImplement kern.do_async_attach. default disabled. To enable add
Matthew Dillon [Tue, 1 May 2007 00:05:18 +0000 (00:05 +0000)]
Implement kern.do_async_attach. default disabled.  To enable add
kern.do_async_attach="1" to your /boot/loader.conf.  This feature allows
conforming drivers to attach in their own thread, allowing multiple
drivers to attach in parallel.

Implement a new device state, DS_INPROGRESS.  Seems to work properly.
Implement device_set_async_attach(), which allows a device's probe
function to indicate that it is ok for its attach function to be run in
its own thread.

Split tsleep's enable out from the 'cold' variable. tsleep works earlier
then when cold is cleared.  Add a 'tsleep_now_works' variable to take
over the functionality.

Implement DRIVERSLEEP()... similar to DELAY(), this function works in
any context and will call lwkt_switch() in its spin loop.  It isn't perfect
yet.

ATA/NATA:
    * Uses the new async attach feature
    * Uses DRIVERSLEEP
    * No longer uses a configuration interrupt hook.  Interrupts are now
      available during device config.

    NOTE: atapicam does not seem to be scanning the 'bus' (from cam's point
    of view), so 'cd0' is not found until CAM scans the bus itself in the
    interrupt config hook code.

USB:
    * Uses the new async attach feature
    * Uses tsleep instead of DELAY

MISC:
    * IF_EM, IF_NFE also use the async attach feature as a test, but it
      doesn't seem to have a huge effect.

12 years agoBring kernel threads back into top.
Hasso Tepper [Mon, 30 Apr 2007 22:48:26 +0000 (22:48 +0000)]
Bring kernel threads back into top.

Reviewed-by: tgen
12 years agoMore cleanups, do not allow backspacing beyond the start of the line.
Matthew Dillon [Mon, 30 Apr 2007 20:02:45 +0000 (20:02 +0000)]
More cleanups, do not allow backspacing beyond the start of the line.

12 years agoMake the mountroot> prompt a bit more user-friendly.
Matthew Dillon [Mon, 30 Apr 2007 19:33:08 +0000 (19:33 +0000)]
Make the mountroot> prompt a bit more user-friendly.

12 years agoIt is possible for spurious interrupt(s) to be posted to an AP cpu
Matthew Dillon [Mon, 30 Apr 2007 17:41:15 +0000 (17:41 +0000)]
It is possible for spurious interrupt(s) to be posted to an AP cpu
while the cpu is being bootstrapped.  Explicitly enable interrupts
while still in a critical section near the end of ap_init to allow
the cpu to issue the interrupt vector(s), then clear the software
interrupt pending fields in the globaldata structure.

This stops the single report to the console of a spurious interrupt
occuring during AP booting.  This problem is unrelated to the multitude
of spurious interrupts that can be reported during device initialization.
Those will probably still occur.

12 years agoReorder cpu interrupt enablement, do it in the code that drops
Matthew Dillon [Mon, 30 Apr 2007 16:46:01 +0000 (16:46 +0000)]
Reorder cpu interrupt enablement, do it in the code that drops
the critical section during booting.  Add a new interrupt controller
ABI function 'cleanup' which is called after interrupts are enabled
but before the critical section is dropped.

12 years agoEST's module was being installed before the module list got initialized,
Matthew Dillon [Mon, 30 Apr 2007 16:39:20 +0000 (16:39 +0000)]
EST's module was being installed before the module list got initialized,
adjust its priority from SI_BOOT2_BIOS to SI_BOOT2_KLD.

Reported-by: Sascha Wildner <saw@online.de>
12 years ago- Don't use the status block's link state change bit to micro-optimize
Sepherosa Ziehau [Mon, 30 Apr 2007 14:05:22 +0000 (14:05 +0000)]
- Don't use the status block's link state change bit to micro-optimize
  performance, instead, read MAC_STS which always contains the correct
  value about link state changing.  Enormous amount of superflucious
  link up events, which keep coming originally when the interface is
  brought up before cable is plugged in, disappear after this change.
- Nuke the no longer needed PCI bridge cache flush.
- Minor style change.

12 years agoRevamp SYSINIT ordering. Relabel sysinit IDs (SI_* in sys/kernel.h) to
Matthew Dillon [Mon, 30 Apr 2007 07:18:57 +0000 (07:18 +0000)]
Revamp SYSINIT ordering.  Relabel sysinit IDs (SI_* in sys/kernel.h) to
make them less confusing, particularly with regard to the relative order
init routines are called in.

Reorder many sysinits.  Reorder the SMP and CLOCK code to bring all the
cpus up far earlier in the boot sequence and to make the full threading and
clocking subsystems available for device config.

12 years agoStore the frequency and cputimer used to initialize a periodic systimer.
Matthew Dillon [Mon, 30 Apr 2007 06:57:38 +0000 (06:57 +0000)]
Store the frequency and cputimer used to initialize a periodic systimer.
If the system cputimer changes, periodic systimers will be adjusted at
the next timeout.

This allows the cputimer to be changed with only minor glitches, which
in turn will allow us to initialize with the 8254 and then later change
over to the ACPI timer.

Theoretically this allows the cputimer to be changed on the fly, after
the system has booted, but the sysctl is read-only for now.

12 years ago* Use SYSREF for vmspace structures. This replaces the vmspace structure's
Matthew Dillon [Sun, 29 Apr 2007 18:25:41 +0000 (18:25 +0000)]
* Use SYSREF for vmspace structures.  This replaces the vmspace structure's
  roll-your-own refcnt implementation and replaces its zalloc backing store.
  Numerous procedures have been added to handle termination and DTOR
  operations and to properly interlock with vm_exitingcnt, all centered
  around the vmspace_sysref_class declaration.

* Replace pmap_activate() and pmap_deactivate() with add pmap_replacevm().
  This replaces numerous instances where roll-your-own deactivate/activate
  sequences were being used, creating small windows of opportunity where
  an update to the kernel pmap would not be visible to running code.

* Properly deactivate pmaps and add assertions to the fact in the teardown
  code.  Cases had to be fixed in cpu_exit_switch(), the exec code, the
  AIO code, and a few other places.

* Add pmap_puninit() which is called as part of the DTOR sequence for
  vmspaces, allowing the kmem mapping and VM object to be recovered.
  We could not do this with the previous zalloc() implementation.

* Properly initialize the per-cpu sysid allocator (globaldata->gd_sysid_alloc).

Make the following adjustments to the LWP exiting code.

* P_WEXIT interlocks the master exiting thread, eliminating races which can
  occur when it is signaling the 'other' threads.

* LWP_WEXIT interlocks individual exiting threads, eliminating races which
  can occur there and streamlining some of the tests.

* Don't bother queueing the last LWP to the reaper.  Instead, just leave it
  in the p_lwps list (but still decrement nthreads), and add code to
  kern_wait() to reap the last thread.  This improves exit/wait performance
  for unthreaded applications.

* Fix a VMSPACE teardown race in the LWP code.  It turns out that it was
  still possible for the VMSPACE for an exiting LWP to be ripped out from
  under it by the reaper (due to a conditional that was really supposed to
  be a loop), or by kern_wait() (due to not waiting for all the LWPs to
  enter an exiting state).  The fix is to have the LWPs PHOLD() the process
  and then PRELE() it when they are reaped.

This is a little mixed up because the addition of SYSREF revealed a number
of other semi-related bugs in the pmap and LWP code which also had to be
fixed.

12 years agoAlthough defined in sys/time.h we don't have CLOCK_VIRTUAL and CLOCK_PROF
Hasso Tepper [Sun, 29 Apr 2007 12:23:52 +0000 (12:23 +0000)]
Although defined in sys/time.h we don't have CLOCK_VIRTUAL and CLOCK_PROF
implemented yet. But we have CLOCK_MONOTONIC.

12 years agoRemove unneeded references to sys/syslink.h. Get syslink_desc from
Matthew Dillon [Sun, 29 Apr 2007 06:11:19 +0000 (06:11 +0000)]
Remove unneeded references to sys/syslink.h.  Get syslink_desc from
sys/syslink_rpc.h

12 years agoUse the __boolean_t defined in machine/stdint.h instead of the
Matthew Dillon [Sun, 29 Apr 2007 06:05:02 +0000 (06:05 +0000)]
Use the __boolean_t defined in machine/stdint.h instead of the
boolean_t from sys/types.h, which doesn't work from userland unless
sys/user.h is carefully positioned.

12 years agoWhen <sys/user.h> is included, it MUST be included first because it sets
Matthew Dillon [Sun, 29 Apr 2007 01:36:04 +0000 (01:36 +0000)]
When <sys/user.h> is included, it MUST be included first because it sets
a preprocessor variable that effects other header files.

12 years agoImplement SYSREF - structural reference counting, allocation, and sysid
Matthew Dillon [Sun, 29 Apr 2007 01:29:33 +0000 (01:29 +0000)]
Implement SYSREF - structural reference counting, allocation, and sysid
management subsystem.

* Structural reference count management, including creation and termination
  sequencing (e.g. where the structure might be temporarily referenced
  during termination).

* Allocation.  It uses an objcache backend for optimal allocation,
  deallocation, and memory recovery.

* Sysid assignment and red-black tree indexing.  It does this in the
  objcache CTOR and DTOR so it costs us absolutely nothing in the
  resource allocation / deallocation critical path.  sysids will be
  reused unless they are externally accessed.

12 years agoAdd a shortcut function, objcache_create_mbacked(), which is more complex
Matthew Dillon [Sun, 29 Apr 2007 01:26:46 +0000 (01:26 +0000)]
Add a shortcut function, objcache_create_mbacked(), which is more complex
then objcache_create_simple() but less complex then objcache_create().

12 years agoWhen <sys/user.h> is included, it MUST be included first because it sets
Matthew Dillon [Sun, 29 Apr 2007 01:10:33 +0000 (01:10 +0000)]
When <sys/user.h> is included, it MUST be included first because it sets
a preprocessor variable that effects other header files.

12 years agoUse the new PLATFORM_CONFIG_H mechanism rather than maintaining patches
Peter Avalos [Sat, 28 Apr 2007 16:16:31 +0000 (16:16 +0000)]
Use the new PLATFORM_CONFIG_H mechanism rather than maintaining patches
against contrib/.

Reminded-by: joerg
12 years agoAdd FreeBSD 6.3 (for archive_write_disk(3)).
Sascha Wildner [Sat, 28 Apr 2007 16:11:37 +0000 (16:11 +0000)]
Add FreeBSD 6.3 (for archive_write_disk(3)).

12 years ago- PHY error bit no longer exists in RX descriptor flags.
Sepherosa Ziehau [Sat, 28 Apr 2007 14:40:13 +0000 (14:40 +0000)]
- PHY error bit no longer exists in RX descriptor flags.
- Cipher error mask is off by one bit.
Obtained-from: Ralink Linux RT61 driver

- Cache host byte order RX descriptor flags.

12 years agoImplement ncpus_fit and ncpus_fit_mask. Admittedly not the best name.
Matthew Dillon [Fri, 27 Apr 2007 23:27:18 +0000 (23:27 +0000)]
Implement ncpus_fit and ncpus_fit_mask.  Admittedly not the best name.
This variable is the nearest power of 2 >= ncpus (ncpus2 is the nearest
power of 2 <= ncpus).

12 years agoAdd a generally accessible cpu_pause() inline for spin loops.
Matthew Dillon [Fri, 27 Apr 2007 23:23:59 +0000 (23:23 +0000)]
Add a generally accessible cpu_pause() inline for spin loops.

12 years agoGC old libarchive version.
Peter Avalos [Fri, 27 Apr 2007 23:02:55 +0000 (23:02 +0000)]
GC old libarchive version.

12 years agoUpgrade to libarchive 2.1.9. Including bug fixes, this improves ar support
Peter Avalos [Fri, 27 Apr 2007 22:56:18 +0000 (22:56 +0000)]
Upgrade to libarchive 2.1.9.  Including bug fixes, this improves ar support
and adds read/write_compress_program.

Discussed-with:  joerg

12 years agoAdd our READMEs.
Peter Avalos [Fri, 27 Apr 2007 22:14:42 +0000 (22:14 +0000)]
Add our READMEs.

12 years agoThese weren't supposed to get imported.
Peter Avalos [Fri, 27 Apr 2007 22:13:31 +0000 (22:13 +0000)]
These weren't supposed to get imported.

12 years agoImport libarchive 2.1.9.
Peter Avalos [Fri, 27 Apr 2007 22:01:15 +0000 (22:01 +0000)]
Import libarchive 2.1.9.

12 years agoMerge from vendor branch LIBARCHIVE:
Peter Avalos [Fri, 27 Apr 2007 22:01:15 +0000 (22:01 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive 2.1.9.

12 years agoSpecify section number for .Xr
Sascha Wildner [Fri, 27 Apr 2007 08:49:42 +0000 (08:49 +0000)]
Specify section number for .Xr

12 years agoTestcommit.
Hasso Tepper [Fri, 27 Apr 2007 06:56:36 +0000 (06:56 +0000)]
Testcommit.

12 years agoMerge from vendor branch SENDMAIL:
Gregory Neil Shapiro [Fri, 27 Apr 2007 03:55:39 +0000 (03:55 +0000)]
Merge from vendor branch SENDMAIL:
Bring in sendmail.org code from the future 8.14.2 release which restores
ABI compatibility to users of the libmilter.so shared library.

12 years agoBring in sendmail.org code from the future 8.14.2 release which restores
Gregory Neil Shapiro [Fri, 27 Apr 2007 03:55:39 +0000 (03:55 +0000)]
Bring in sendmail.org code from the future 8.14.2 release which restores
ABI compatibility to users of the libmilter.so shared library.

12 years agoFix various paths in rc.d/diskless and friends.
Matthew Dillon [Thu, 26 Apr 2007 23:34:27 +0000 (23:34 +0000)]
Fix various paths in rc.d/diskless and friends.

Submitted-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
12 years agoRemove unneeded comma.
Sascha Wildner [Thu, 26 Apr 2007 20:08:56 +0000 (20:08 +0000)]
Remove unneeded comma.

12 years agoUse .Xr for manpage references.
Sascha Wildner [Thu, 26 Apr 2007 17:35:03 +0000 (17:35 +0000)]
Use .Xr for manpage references.

12 years agoAdd a reference to manpath.config(5).
Sascha Wildner [Thu, 26 Apr 2007 15:47:43 +0000 (15:47 +0000)]
Add a reference to manpath.config(5).

12 years agoUse a smaller indentation because it looks better.
Sascha Wildner [Thu, 26 Apr 2007 15:45:59 +0000 (15:45 +0000)]
Use a smaller indentation because it looks better.

12 years ago- Factor out ieee80211_reset_state() from ieee80211_newstate(), so
Sepherosa Ziehau [Thu, 26 Apr 2007 12:59:14 +0000 (12:59 +0000)]
- Factor out ieee80211_reset_state() from ieee80211_newstate(), so
  802.11 layer can clean up its internal state machine without state
  changing or going through driver code.
- Merge sta_disassoc() and sta_disauth() into sta_disconnect(), which
  sends disassoc to associated STA and deauth to authenticating STA.
- Call ieee80211_reset_state(), if operational mode is going to be
  changed, so we will do a proper state machine clean up.  In the
  original way, if we are acting as AP and switch directly to act as
  STA, we will send out wrong management frames.
- Call ieee80211_reset_state(), if PHY is going to be changed.  This
  prevents panic (due to a proper assertion) under following scenario:
  o  Current PHY of the AP is 11b.
  o  An 11b STA joins the BSS created by the AP.  Since AP's current
     PHY is 11b, this STA will not be counted as long slot time STA,
     i.e. long slot time STA count left untouched.
  o  Switch AP's PHY to 11g.
  AP will panick (long slot time STA count is zero, while there is a
  long slot time STA associated, in ieee80211_node_leave_11g()).  The
  assertion fails, because 802.11 state machine is doing its clean up
  as if AP were using 11g PHY, but it actually used 11b PHY.

12 years ago- Don't disable interrupt in bge_intr(), just acknowledge it. This avoids
Sepherosa Ziehau [Thu, 26 Apr 2007 11:58:10 +0000 (11:58 +0000)]
- Don't disable interrupt in bge_intr(), just acknowledge it.  This avoids
  potential lose of interrupt when interrupt gets re-enabled, since writing
  to BGE_MBX_IRQ0_LO also serves as interrupt acknowledgment.
- Move interrupt acknowledgment before reading status block.  This lets us
  read the correct/complete status block.
- Reset ifnet.if_timer, only if there is nothing pending to be TXed.

Obtained-from: FreeBSD (bde@freebsd.org)

12 years agoAdd a manual page explaining the format of /etc/manpath.config.
Sascha Wildner [Thu, 26 Apr 2007 08:35:52 +0000 (08:35 +0000)]
Add a manual page explaining the format of /etc/manpath.config.

12 years agoSort alphabetically.
Sascha Wildner [Thu, 26 Apr 2007 08:33:24 +0000 (08:33 +0000)]
Sort alphabetically.

12 years agoRevert my previous commit to nrelease/Makefile and add /usr/local/share/man
Sascha Wildner [Thu, 26 Apr 2007 08:25:41 +0000 (08:25 +0000)]
Revert my previous commit to nrelease/Makefile and add /usr/local/share/man
to manpath.config.

Requested-by: dillon
12 years agoEnable manpath(1) to map more than one man dir to a bin dir.
Sascha Wildner [Thu, 26 Apr 2007 08:17:54 +0000 (08:17 +0000)]
Enable manpath(1) to map more than one man dir to a bin dir.

12 years agoMove syslink_desc to sys/syslink_rpc.h so kernel code does not need
Matthew Dillon [Thu, 26 Apr 2007 02:11:00 +0000 (02:11 +0000)]
Move syslink_desc to sys/syslink_rpc.h so kernel code does not need
to #include sys/syslink.h.  Add a kernel config option 'SYSLINK' to build
with kern_syslink.c, so it can be worked on (read: broken) without
interfering with other developer's kernel builds.  Add a shims file for
the syslink() system call for kernels not built with kern_syslink.c.  The
shims file can be used generally for this purpose.

12 years agoIPV6 type 0 route headers are a flawed design, insecure by default, and
Matthew Dillon [Wed, 25 Apr 2007 21:55:33 +0000 (21:55 +0000)]
IPV6 type 0 route headers are a flawed design, insecure by default, and
open hosts and networks up to DOS attacks by allowing normal router IP
filtering to be bypassed.  Disable them by default.

Submitted-by: Hasso Tepper <hasso@estpak.ee>
Obtained-from: OpenBSD

12 years agostyle(9) cleanup: Remove parameter names from prototypes.
Sascha Wildner [Wed, 25 Apr 2007 11:45:28 +0000 (11:45 +0000)]
style(9) cleanup: Remove parameter names from prototypes.

Submitted-by: Hasso Tepper <hasso@estpak.ee>
12 years agoUse .Nm
Sascha Wildner [Wed, 25 Apr 2007 09:35:31 +0000 (09:35 +0000)]
Use .Nm

12 years agoCreate a symbolic link /usr/local/share/man -> /usr/local/man because
Sascha Wildner [Wed, 25 Apr 2007 09:22:06 +0000 (09:22 +0000)]
Create a symbolic link /usr/local/share/man -> /usr/local/man because
apparently stuff using autotools prefers to install its manual pages
in this location.

Observed-and-suggested-by: Hasso Tepper <hasso@estpak.ee>
12 years agoUse .Fn instead of .Xr.
Sascha Wildner [Wed, 25 Apr 2007 08:13:36 +0000 (08:13 +0000)]
Use .Fn instead of .Xr.

12 years ago- Cleanup header file inclusion.
Sepherosa Ziehau [Tue, 24 Apr 2007 11:06:47 +0000 (11:06 +0000)]
- Cleanup header file inclusion.
- Nuke no longer needed functions.
- Nuke no longer needed fields in bge_softc.

12 years agoCorrect hardware csum offload support for bge(4)
Sepherosa Ziehau [Mon, 23 Apr 2007 15:14:37 +0000 (15:14 +0000)]
Correct hardware csum offload support for bge(4)

Obtained-from: FreeBSD (w/ modification)

12 years agoMention wlan_ratectl_{onoe,sample}
Sepherosa Ziehau [Mon, 23 Apr 2007 13:15:57 +0000 (13:15 +0000)]
Mention wlan_ratectl_{onoe,sample}

Reminded-by: swildner@
12 years agoNuke unnecessary setting of ural(4)'s security registers. ural(4) only
Sepherosa Ziehau [Mon, 23 Apr 2007 12:35:03 +0000 (12:35 +0000)]
Nuke unnecessary setting of ural(4)'s security registers.  ural(4) only
supports software encrypt/decrypt.  The nuked code itself is quite
problematic, as pointed out by Sam Leffler -- wk->wk_keyix should be
replaced by the loop count.

Noticed-by: Hans Petter Selasky <hselasky@c2i.net>
12 years agoAdd support for generic prosigns by enabling ligatures.
Simon Schubert [Sun, 22 Apr 2007 23:03:48 +0000 (23:03 +0000)]
Add support for generic prosigns by enabling ligatures.

A ligature can be created by putting the letters in angle brackets, like `<KA>'.

12 years agoAdd the possibility to dump the generated audio to a file instead of playing it.
Simon Schubert [Sun, 22 Apr 2007 22:04:20 +0000 (22:04 +0000)]
Add the possibility to dump the generated audio to a file instead of playing it.

This can be used to create morse mp3s from input texts, like this:

morse -o | lame -r -s 44.1 -x -m m --resample 11 - morse.mp3

Add a comment on the timing calculation.

12 years agoProperly use .Cd
Sascha Wildner [Sun, 22 Apr 2007 20:40:20 +0000 (20:40 +0000)]
Properly use .Cd

12 years agoFix function name.
Sascha Wildner [Sun, 22 Apr 2007 16:29:50 +0000 (16:29 +0000)]
Fix function name.

12 years agoTurn off Sample TX rate control algorithm support for 2661d BBP. Due to
Sepherosa Ziehau [Sun, 22 Apr 2007 11:44:56 +0000 (11:44 +0000)]
Turn off Sample TX rate control algorithm support for 2661d BBP.  Due to
delayed/batched TX status report, Sample does not play well with this kind
of BBP.  Use Onoe TX rate control algorithm for 2661d BBP.

12 years agoPut a DELAY in the AT-style keyboard detection loop to wait
YONETANI Tomokazu [Sun, 22 Apr 2007 10:54:43 +0000 (10:54 +0000)]
Put a DELAY in the AT-style keyboard detection loop to wait
certain amount of time without relying on ISA bus timing.

Suggested-by: Matt
DragonFly-Bug: http://bugs.dragonflybsd.org/issue573

12 years agoWhen enabling A20, put upper limit on amount of time we wait for the
YONETANI Tomokazu [Sun, 22 Apr 2007 10:43:00 +0000 (10:43 +0000)]
When enabling A20, put upper limit on amount of time we wait for the
keyboard controller to get ready (65K x ISA access time, visually
around 1 second).  If we have wait more than that amount it's likely
that the hardware is a legacy-free one and simply doesn't have keyboard
controller and doesn't require enabling A20 at all.

Taken-from: FreeBSD (with modifications suggested by Matt)

 relavant commit logs(and discussion):
  http://docs.FreeBSD.org/cgi/mid.cgi?200604110439.k3B4dTOD072774
  http://docs.FreeBSD.org/cgi/mid.cgi?200604112053.k3BKrnC1053262
  http://docs.FreeBSD.org/cgi/mid.cgi?200604260605.k3Q65GZZ095546

12 years agoPull morse(6) into the new millenium and teach it to use sound(4).
Simon Schubert [Sun, 22 Apr 2007 10:22:32 +0000 (10:22 +0000)]
Pull morse(6) into the new millenium and teach it to use sound(4).

Feedback-by: swildner@
12 years ago- Define macro for the number of channels. Use it instead of the magic
Sepherosa Ziehau [Sun, 22 Apr 2007 09:14:46 +0000 (09:14 +0000)]
- Define macro for the number of channels.  Use it instead of the magic
  number.
- Define maximum and default channel TX power.
- The EEPROM regions, which contain 5GHz and 2GHz channels' TX power, are
  not contiguous.  Add rt2661_read_txpower_config() to read them seperately.
- Lower channel's TX power is in the lower byte of the 16bits EEPROM value,
  while upper channel's TX power is in the upper byte of the 16bits EEPROM
  value.
- Channel's TX power should never exceed maximum channel TX power, if it is
  set it to default channel TX power.
- Rename rt2661_read_eeprom() to rt2661_read_config(), since we already have
  rt2661_eeprom_read().

EEPROM layout, EEPROM values' layout and various limit values are obtained
from Ralink RT61 Linux driver.

12 years agoFix typo and use section numbers for .Xr.
Sascha Wildner [Sun, 22 Apr 2007 07:57:31 +0000 (07:57 +0000)]
Fix typo and use section numbers for .Xr.

12 years agoTXRX_CSR5 stores allowable ACK rates instead of basic rates, so rename
Sepherosa Ziehau [Sun, 22 Apr 2007 05:18:38 +0000 (05:18 +0000)]
TXRX_CSR5 stores allowable ACK rates instead of basic rates, so rename
rt2661_set_basicrates() to rt2661_set_ackrates().  Also turn on 6Mbits/s,
12Mbits/s and 24Mbits/s in ACK rates, if we are not forced to be in 11b
mode and to start/join an ERP BSS.  Now rt2661 part will send ACK at
24Mbits/s instead of 6Mbits/s, if the data to be acknowledged are sent at
rate above/equal 24Mbits/s, which is standard conforming and improves
performance a bit.

# This problem is identified by running following command on any NIC
# that can capture control frames and is aware of ERP:
#   tcpdump -ni iface -y ieee802_11_radio not wlan type mgt
# Pay attention to the rate, at which ACK gets sent ;]

12 years agoConst-fy rate set argument of ieee80211_iserp_rateset().
Sepherosa Ziehau [Sun, 22 Apr 2007 04:35:12 +0000 (04:35 +0000)]
Const-fy rate set argument of ieee80211_iserp_rateset().

12 years agoBusdma(9)-fy, mainly obtained from FreeBSD:
Sepherosa Ziehau [Sun, 22 Apr 2007 04:16:26 +0000 (04:16 +0000)]
Busdma(9)-fy, mainly obtained from FreeBSD:
if_bge.c rev 1.{45,76,81,85,101,105,106,109,151}
if_bgereg.h rev 1.{19,40}

Local changes:
- Factor out bge_dma_block_{alloc,free}() to avoid code duplication.
- Move jumbo buffer pool allocation/free into bge_dma_{alloc,free}().
- In bge_newbuf_std(), use bus_dmamap_load_mbuf() instead of bus_dmamap_load().
- Nuke vm header files inclusion.
- In bge_start():
  o   Bail out if OACTIVE is turned on or if bge(4) is not running yet.
  o   Move ifq_dequeue() before bge_encap(), since m_defrag() in bge_encap()
      will trash the mbuf parameter passed in.
  o   Make sure there are enough TX descriptors, before dequeuing mbuf and
      calling bge_encap().
- Don't call ifnet.if_start() on very interrupt, but at the end of bge_txeof().
- In bge_txeof(), if there are not enough TX descriptors, then don't clear
  OACTIVE.
- Minor style changes.

12 years agosbappendcontrol() was improperly setting sb_lastmbuf, creating a possible
Matthew Dillon [Sun, 22 Apr 2007 04:08:59 +0000 (04:08 +0000)]
sbappendcontrol() was improperly setting sb_lastmbuf, creating a possible
mbuf leak and/or sb_cc count mismatch.  The passed mbuf 'm' is a chain,
not a single mbuf, and must be iterated through to locate the last mbuf.

Optimize sbappend().  M_EOR is always set in the last mbuf and the sockbuf's
sb_lastmbuf and sb_lastrecord fields can be used instead of iterating
through all the mbufs in the sockbuf.  Only UNIX domain stream sockets used
this function.  Normal TCP connections use the already-optimized
sbappendstream() call.

Properly propogate M_EOR in sbappendcontrol() and sbappendaddr().

Do various code and comment cleanups.

12 years agoSync netstat up to the sockbuf changes.
Matthew Dillon [Sun, 22 Apr 2007 01:25:04 +0000 (01:25 +0000)]
Sync netstat up to the sockbuf changes.

12 years agoGive the sockbuf structure its own header file and supporting source file.
Matthew Dillon [Sun, 22 Apr 2007 01:13:17 +0000 (01:13 +0000)]
Give the sockbuf structure its own header file and supporting source file.
Move all sockbuf-specific functions from kern/uipc_socket2.c into the new
kern/uipc_sockbuf.c and move all the sockbuf-specific structures from
sys/socketvar.h to sys/sockbuf.h.

Change the sockbuf structure to only contain those fields required to
properly management a chain of mbufs.  Create a signalsockbuf structure
to hold the remaining fields (e.g. selinfo, mbmax, etc).

Change the so_rcv and so_snd structures in the struct socket from
a sockbuf to a signalsockbuf.

Remove the recently added sorecv_direct structure which was being used
to provide a direct mbuf path to consumers for socket I/O.  Use the newly
revamped sockbuf base structure instead.  This gives mbuf consumers
direct access to the sockbuf API functions for use outside of a struct
socket.  This will also allow new API functions to be added to the sockbuf
interface to ease the job of parsing data out of chained mbufs.

12 years agoJust throw all the main arguments for syslink() into syslink_info and
Matthew Dillon [Sun, 22 Apr 2007 00:59:27 +0000 (00:59 +0000)]
Just throw all the main arguments for syslink() into syslink_info and
pass the structure.  Do not pass the descriptor separately, do not pass
a pointer to the structure size (just pass the size directly).  The
search routines just return one structure at a time so a return size
field is not needed.

Start revamping syslink() to make it more mbuf-centric.  This work is
very much still in progress.

12 years agoDon't use .Xr for pathnames.
Sascha Wildner [Sat, 21 Apr 2007 22:42:22 +0000 (22:42 +0000)]
Don't use .Xr for pathnames.

12 years agoMerge from vendor branch TNFTP:
Peter Avalos [Sat, 21 Apr 2007 20:18:21 +0000 (20:18 +0000)]
Merge from vendor branch TNFTP:
Sync with NetBSD.  In addition to some bug fixes, this brings in -s srcaddr
functionality -- using srcaddr as the local IP address for the connection.

12 years agoSync with NetBSD. In addition to some bug fixes, this brings in -s srcaddr
Peter Avalos [Sat, 21 Apr 2007 20:18:21 +0000 (20:18 +0000)]
Sync with NetBSD.  In addition to some bug fixes, this brings in -s srcaddr
functionality -- using srcaddr as the local IP address for the connection.