Commit Graph

139642 Commits

Author SHA1 Message Date
Ed Schouten
29d4cb241b Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and
friends), there is no reason to enforce a unique device minor number
policy. There are various drivers in the source tree that allocate unr
pools and such to provide minor numbers, without using them themselves.

Because we still need to support unique device minor numbers for the
cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's
that are used in combination with the cloner library should be marked
with this flag to make the cloning work.

This means drivers can now freely use si_drv0 to store their own flags
and state, making it effectively the same as si_drv1 and si_drv2. We
still keep the minor() and dev2unit() routines around to make drivers
happy.

The NTFS code also used the minor number in its hash table. We should
not do this anymore. If the si_drv0 field would be changed, it would no
longer end up in the same list.

Approved by:	philip (mentor)
2008-06-11 18:55:19 +00:00
Doug Barton
b4b04f194f Document the AUTO_UPGRADE (-U) knob for .mergemasterrc
Submitted by:	mezz
No Cookie For:	gordon  :)
2008-06-11 18:54:06 +00:00
Jack F Vogel
aa15c94529 Add man page for ixgbe driver 2008-06-11 18:49:55 +00:00
Coleman Kane
21a6592999 Convert ndis_spinlock to ndis_mtx and start using the sleepable
mtx interface for NDIS_LOCK/UNLOCK. This should result in less
CPU utilization on behalf of the ndis driver. Additionally, this
commit also fixes a potential LOR in the ndis_tick code, by
not locking inside the ndis_tick function, but instead delegating
that work to the helpers called through IoQueueWorkItem. The
way that this is currently set up for NDIS prevents us from
simply implementing a callout_init_mtx mechanism.

However, the helper functions that handle the various timeout
cases implement fine-grained locking using the spinlocks provided
by the NDIS-compat layer, and using the mtx that is added with
this commit. This leaves the following ndis_softc members operated
on in ndis_tick in an unlocked context:

  * ndis_hang_timer - Only modified outside of ndis_tick once, before
                      the first callout_reset to schedule ndis_tick
  * ifp->if_oerrors - Only incremented in two places, which should be
                      an atomic op
  * ndis_tx_timer   - Assigned to 5 (when guaranteed to be 0) or 0
                      (in txeof), to indicate to ndis_tick what to
                      do. This is the only member of which I was
                      suspicious for needing the NDIS_LOCK here. My
                      testing (and another's) have been fine so far.
  * ndis_stat_callout - Only uses a simple set of callout routines,
                        callout_reset only called by ndis_tick after
                        the initial reset, and then callout_drain is
                        used exactly once in shutdown code.

The benefit is that ndis_tick doesn't acquire NDIS_LOCK unless one of
the timeout conditions is flagged, and it still obeys the locking
order semantics that are dictated by the NDIS layer at the moment. I
have been investigating a more thorough s/spinlock/mtx/ of the NDIS
layer, but the simplest naive approach (replace KeAcquireSpinLock
with an mtx implementation) has anti-succeeded for me so far. This
is a good first step though.

Tested by:	onemda@gmail.com
Reviewed by:	current@, jhb, thompsa
Proposed by:	jhb
2008-06-11 13:40:15 +00:00
Konstantin Belousov
ac8b6edd89 In cd9660_readdir vop, always initialize the idp->uio_off member.
The while loop that is assumed to initialize the uio_off later, may
be not entered at all, causing uninitialized value to be returned in
uio->uio_offset.

PR:  122925
Submitted by:	Jaakko Heinonen <jh saunalahti fi>
MFC after:	1 weeks
2008-06-11 12:46:09 +00:00
Søren Schmidt
81b910389d Wait up to 1S for the TFD data to signal un-busy before fetching the signature.
This at least helps a few slow devices out there.

Submitted by:	Andrey V. Elsukov
2008-06-11 08:48:25 +00:00
Weongyo Jeong
1f22fabdfb fix a page fault that it occurred during ifp is NULL. This bug happens
when NDIS driver's initialization is failed and NDIS driver's trying to
call NdisWriteErrorLogEntry().
2008-06-11 07:55:07 +00:00
Benno Rice
3c463a49eb Switch to using a normal mutex instead of a spin mutex.
We still use the interrupt filter due to performance problems that show up if
we don't.  The main problem seen is that, due to the interrupt being edge
triggered, we occasionally miss interrupts which leads us to not notice that
we can transmit more packets.  Using the new approach, which just schedules
a task on a taskqueue, we are guaranteed to have the task run even if the
interrupt arrived while we were already executing.  If we were to use an
ithread the system would mask the interrupt while the handler is run and we'd
miss interrupts.
2008-06-11 07:26:02 +00:00
Benno Rice
269a069678 Convert bus_space_{read,write}_* calls to bus_{read,write}_* calls.
Suggested by:	jhb
2008-06-11 06:53:55 +00:00
Søren Schmidt
082b99a8b9 Rearrange how to call dma.alloc() so that we have resources alloc'd when need but also late enough to know how many to create. 2008-06-11 06:44:58 +00:00
Oleksandr Tymoshenko
c9688a603b Keep proper track of nsegs counter: sem_free is called for all
allocated semaphores, so it's wrong to increase it conditionally,
  in this case for every over-the-limit semaphore nsegs is decreased
  without being previously increased.

  PR:	kern/123685
  Approved by:	cognet (mentor)
2008-06-10 20:55:10 +00:00
Simon L. B. Nielsen
3bff0167b9 When the file-system containing the audit log file is running low on
disk space a warning is printed.  Make this warning a bit more
informative.

Approved by:	rwatson
2008-06-10 20:05:32 +00:00
Warner Losh
b7b4d1fd3f Add Belkin F5U257 to the mix. 2008-06-10 19:33:31 +00:00
Warner Losh
d368012659 Add Belkin F5U257 to the mix.
Submitted by:	wilko@
2008-06-10 19:31:09 +00:00
John Baldwin
87f2ff4f3e Use sysctl to fetch stats from the kernel instead of reading variables
directly via libkvm.

PR:		kern/122875, bin/123014
Tested by:	Danny Braniss  danny cs.huji.ac.il
MFC after:	1 week
2008-06-10 18:47:43 +00:00
John Baldwin
d993ea4271 Make tx(4) MPSAFE
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private timer to implement a watchdog for tx timeouts and drive
  the timer for auto negotiation.
- Use bus_foo() rather than bus_space_foo() and remove the bus space
  tag & handle from the softc.
- Call bus_setup_intr() after ether_ifattach().

Tested by:	Florian Smeets  flo of kasimir.com
2008-06-10 17:59:43 +00:00
Paul Saab
160b4e6bfc Add support for the P212, P410, P410i, P411, and P812 HP Smart Array
controllers.

Submitted by:  Scott Benesh at HP
2008-06-10 17:51:51 +00:00
Jason Evans
b1c8b30f55 In the error path through base_alloc(), release base_mtx [1].
Fix bit vector initialization for run headers.

Submitted by:	[1] Mike Schuster <schuster@adobe.com>
2008-06-10 15:46:18 +00:00
Kevin Lo
45c08eec9a Add the pxa_teardown_intr() bus method function to de-associate the
interrupt handler
2008-06-10 06:06:15 +00:00
Kevin Lo
43d8707e0f Pull all the code to deal with bus space methods into a shared set of
routines.
2008-06-10 03:44:14 +00:00
Kevin Lo
49d3c1f416 >From NetBSD:
Remove the code which disables port status change interrupts for 1s
when one occured -- this makes that events get lost or delayed until
the next change.

Obtained from:	NetBSD
2008-06-10 02:41:36 +00:00
David Christensen
680ece5918 - Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.
- Fixed a problem on i386 architecture when using split header/jumbo frame
  firmware caused by hardware alignment requirements.
- Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/
  disabled.  Enabled by default.

PR:		kern/123696
MFC after:	2 weeks
2008-06-10 02:19:11 +00:00
Wojciech A. Koszek
5bbaa5cf02 Mark "highaddr" and "lowaddr" appropriately. Change "dma" to "DMA".
Fix spelling mistage found by rodrigc@.

Reviewed by:	rodrigc, danger
2008-06-09 22:13:14 +00:00
Wojciech A. Koszek
10170e4559 Since we create a DMA tag "mtag" for TX map with bus_dmamap_create(),
we must synchronize such a map against "mtag" with bus_dmamap_sync(),
not the tag designated for RX map.

Fix it.

Approved by:	cognet
2008-06-09 21:51:48 +00:00
Marcel Moolenaar
475232fc30 Removal of gpt(8) and manpage. 2008-06-09 21:36:46 +00:00
Marcel Moolenaar
bdc03b375f Note removal of gpt(8). 2008-06-09 21:33:57 +00:00
Marcel Moolenaar
577bc11be5 Remove gpt(8). It's replaced by gpart(8). 2008-06-09 21:30:40 +00:00
Brooks Davis
9761cdd839 Use the -n flag to route(8) when calling "route get". Otherwise we hang
for a long time if we get a lease, but DNS isn't working.

MFC after:	1 week
2008-06-09 20:03:35 +00:00
Marcel Moolenaar
1e67a3e2cc Disconnect gpt(8) from the build. gpt(8) is replaced by gpart(8). 2008-06-09 16:42:55 +00:00
Colin Percival
7254457b50 Don't store a pointer in "next" if we're never going to use it.
Fix typo in checking results of strchr.

Found by:	Coverity Prevent
2008-06-09 14:44:56 +00:00
Colin Percival
f6dd73207f Make one-bit fields unsigned instead of signed. This has no effect,
since they are only tested for zero/nonzero; but it's arguably a bad
idea to set a {-1, 0} variable to 1 (as happens in this code).

Found by:	Coverity Prevent
2008-06-09 14:41:28 +00:00
Colin Percival
af58f6feff Rework code to avoid using a pointer after freeing it. Aside from the
possibility of memory becoming undereferenceable when it is freed, this
change should have no effect on bsdtar behaviour.

Found by:	Coverity Prevent
2008-06-09 14:03:55 +00:00
Konstantin Belousov
a70537835f Provide the mutual exclusion between the nfs export list modifications
and nfs requests processing. Lockmgr lock provides the shared locking for
nfs requests, while exclusive mode is used for modifications. The writer
starvation is handled by lockmgr too.

Reported by:	kris, pho, many
Based on the submission by:	mohan
Tested by:	pho
MFC after:	2 weeks
2008-06-09 10:31:38 +00:00
Mike Makonnen
e911e766b1 Document the misleading nature of the REQUIRE line. The patch in
the PR has been heavily edited for style(9) and clarity. Mistakes are
mine.

PR: bin/124251
2008-06-09 09:07:58 +00:00
Ed Schouten
2ae1fdab5a Remove sicontrol(8)'s "ttystat".
In the FreeBSD base system, there are only two utilities that use struct
tty, namely pstat and sicontrol. The sicontrol utility calls the
TCSI_TTY ioctl(), which copies struct tty back to userspace.

sicontrol should not have this functionality. The same data is already
provided by pstat. If we really want to be able to export these numbers
through a file descriptor to userspace, we can export struct xtty, which
should provide a better abstraction. The ttystat option was only used as
a debugging aid.

This makes sicontrol compile in the mpsafetty branch.

Reviewed by:	peter
Approved by:	philip (mentor)
2008-06-09 08:43:27 +00:00
John Birrell
1f1fa917bd Change the CTF conversion makefile code to use a new line to avoid
spawning another shell.

Requested by: Ed Schouten

M    config/mkmakefile.c
2008-06-09 06:33:26 +00:00
John Birrell
89020621fd Remove some sparc-specific stuff from my earlier sun4v work in p4.
It never belonged in current.

Pointed out by: marius
2008-06-09 06:31:17 +00:00
Kevin Lo
247ac1530d Remove sa1_cache_clean_addr 2008-06-09 05:53:04 +00:00
Kevin Lo
6799ed5dd8 Unify arminit() and clean up 2008-06-09 05:50:42 +00:00
David Xu
83a0758789 Make pthread_cleanup_push() and pthread_cleanup_pop() as a pair of macros,
use stack space to keep cleanup information, this eliminates overhead of
calling malloc() and free() in thread library.

Discussed on: thread@
2008-06-09 01:14:10 +00:00
Wojciech A. Koszek
e14e342b14 Change header file references from <filename>.h to
path relative to /usr/include. It looks much better anyway.

Instead of referencing "socket", which is bogus, reference
'sys/socket.h', which is what should be placed here from
the beggining.

Suggested by:	maxim
2008-06-08 21:08:20 +00:00
Wojciech A. Koszek
cad20b04fe Fix the way the date must be specified (leading 0 is redundant).
Fix several spelling mistakes brought by my earlier commit.
Trim whitespace.

Submitted by:	maxim
2008-06-08 21:01:39 +00:00
Wojciech A. Koszek
2e75877f12 Remove checks against DDB, which isn't used in this file.
My intention is to bring no functional change.

Discussion on:	IRC
Reviewed by:	ed, kan, rink,
2008-06-08 20:43:27 +00:00
David Malone
9bcce8a03e I missed some "register"s in non-dot-C files. 2008-06-08 19:59:15 +00:00
Stanislav Sedov
4f38796595 - Display '-C' option in usage().
Approved by:	kib
2008-06-08 19:48:41 +00:00
Doug Barton
e0976d1a55 The change to add subversion ID has two problems. The first is that when
newvers.sh is run pwd is actually the obj directory, so "../../.svn"
doesn't exist and the test always fails. The second is that buildkernel
is executed with a restrictive PATH, so unless you have svnversion in
/bin or /usr/bin it can't run.

Fix this by looking for svnversion in /bin, /usr/bin, and /usr/local/bin
in that order. If found, store the location and derive the value of the
source directory. Then run svnversion in the appropriate directory.

There is one possible refinement which would be to add a test for
LOCALBASE!=/usr/local if we don't find svnversion the first time, but
IMO that's not necessary at this time.
2008-06-08 19:46:23 +00:00
Sean Farley
35ed5c4e48 Fixed the output grammar to properly speak non-terminal dits.
Updated Lyndon Nerenberg's radio callsign and E-mail address.

PR:		bin/7868
Submitted by:	Lyndon Nerenberg <lyndon@orthanc.ca>
MFC after:	1 week
2008-06-08 19:35:47 +00:00
Rui Paulo
5a9555b9aa Fix typo in comment. 2008-06-08 14:42:43 +00:00
Wojciech A. Koszek
ec4e0f15cd Make usage() 'static'. 2008-06-08 12:43:02 +00:00
Roman Divacky
2e1a489300 d_ino member of linux_dirent structure should be unsigned long.
Submitted by:	Chagin Dmitry <chagin.dmitry@gmail.com>
Approved by:	kib (mentor)
2008-06-08 11:09:25 +00:00