Commit Graph

67542 Commits

Author SHA1 Message Date
Remko Lodder
8dce5c1bf6 Add another 8139D variant.
PR:		124622
Submitted by:	Evgeny Zhirnov <jirnov at gmail dot com>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
2008-06-16 18:32:20 +00:00
Konstantin Belousov
05427aafc6 Struct cdev is always the member of the struct cdev_priv. When devfs
needed to promote cdev to cdev_priv, the si_priv pointer was followed.

Use member2struct() to calculate address of the wrapping cdev_priv.
Rename si_priv to __si_reserved.

Tested by:	pho
Reviewed by:	ed
MFC after:	2 weeks
2008-06-16 17:34:59 +00:00
Konstantin Belousov
4c20b7670c Add the member2struct() macro, that returns pointer to the containing
structure given pointer to some structure member.

MFC after:	2 weeks
2008-06-16 17:25:20 +00:00
Oliver Fromme
25eed6867e Implement a workaround for a long-standing problem in
libi386's time(), caused by a qemu bug.  The bug might
be present in other BIOSes, too.

qemu either does not simulate the AT RTC correctly or
has a broken BIOS 1A/02 implementation, and will return
an incorrect value if the RTC is read while it is being
updated.

The effect is worsened by the fact that qemu's INT 15/86
function ("wait" a.k.a. usleep) is non-implmeneted or
broken and returns immediately, causing beastie.4th to
spin in a tight loop calling the "read RTC" function
millions of times, triggering the problem quickly.

Therefore, we keep reading the BIOS value until we get
the same result twice.  This change fixes beastie.4th's
countdown under qemu.

Approved by:	des (mentor)
2008-06-16 17:04:04 +00:00
John Birrell
5d846378f7 Remove code that isn't required. It actually breaks the case where KDTRACE_HOOKS
is defined and KDB isn't. This is the case that it was intended for.
2008-06-16 04:44:29 +00:00
Konstantin Belousov
a0b454dc4b Do not redo the vnode tear-down work already done by insmntque() when
vnode cannot be put on the vnode list for mount.

Reported and tested by:	marck
Guilty party:	me
MFC after:	3 days
2008-06-15 18:40:58 +00:00
Coleman Kane
38ad9366dc Silence warning about missing IoGetDeviceObjectPointer by implementing
a simple stub that always returns STATUS_SUCCESS.

Submitted by:	Paul B. Mahol <onemda@gmail.com>
Reviewed by:	thompsa
MFC after:	1 week
2008-06-15 13:37:29 +00:00
Randall Stewart
97a7b90ff3 More prep for Vimage:
- only one functino to destroy an SCTP stack sctp_finish()
 - Make it so this function also arranges for any threads
   created by the image to do a kthread_exit()
2008-06-15 12:31:23 +00:00
Robert Watson
a0faacaa38 When NETATALK is compiled into the kernel, at_rmx.c is required regardless
of whether NETATALKDEBUG is enabled, so make building it conditional on
NETATALK instead.  This problem appears to have been present from the time
that the netatalk implementation was imported.

PR:		124456
Submitted by:	Nathan Whitehorn <whitehorn at wisc dot edu>
MFC after:	3 days
2008-06-14 15:17:02 +00:00
Randall Stewart
9b02321796 - Fixes foobar on my part. Some missing virtualization macros from
specific logging cases.
2008-06-14 13:24:49 +00:00
Wojciech A. Koszek
53a609f064 Remove obselete PECOFF image activator support.
PRs assigned at the time of removal:    kern/80742

Discussed on:   freebsd-current (silence), IRC
Tested by:      make universe
Approved by:    cognet (mentor)
2008-06-14 12:51:44 +00:00
Ed Schouten
45792eb9b8 Turn sgtty into a binary-only compatibility interface.
sgtty was the original interface to configure terminal attributes on my
UNIX-like operating systems. It has been deprecated by the POSIX termios
interface, which is implemented in almost any modern system.

An advantage of turning this into a binary compatibility interface, is
that we can now eventually remove the COMPAT_43TTY switch from kernel
configurations. This removes many ioctl()'s from the TTY layer.

While there, increase the __FreeBSD_version, which may be useful for the
people working on the Ports tree.

Reviewed by:	kib
Approved by:	philip (mentor)
2008-06-14 10:42:18 +00:00
Randall Stewart
b3f1ea41fd - Macro-izes the packed declaration in all headers.
- Vimage prep - these are major restructures to move
  all global variables to be accessed via a macro or two.
  The variables all go into a single structure.
- Asconf address addition tweaks (add_or_del Interfaces)
- Fix rwnd calcualtion to be more conservative.
- Support SACK_IMMEDIATE flag to skip delayed sack
  by demand of peer.
- Comment updates in the sack mapping calculations
- Invarients panic added.
- Pre-support for UDP tunneling (we can do this on
  MAC but will need added support from UDP to
  get a "pipe" of UDP packets in.
- clear trace buffer sysctl added when local tracing on.

Note the majority of this huge patch is all the vimage prep stuff :-)
2008-06-14 07:58:05 +00:00
Robert Watson
37f44cb428 The TrustedBSD MAC Framework named struct ipq instances 'ipq', which is the
same as the global variable defined in ip_input.c.  Instead, adopt the name
'q' as found in about 1/2 of uses in ip_input.c, preventing a collision on
the name.  This is non-harmful, but means that search and replace on the
global works less well (as in the virtualization work), as well as indexing
tools.

MFC after:	1 week
Reported by:	julian
2008-06-13 22:14:15 +00:00
Alan Cox
f9a4e9e4a9 Tweak the promotion test in pmap_promote_pde(). Specifically, test PG_A
before PG_M.  This sometimes prevents unnecessary removal of write access
from a PTE.  Overall, the net result is fewer demotions and promotion
failures.
2008-06-13 19:33:56 +00:00
John Baldwin
ef58e744a3 Make ex(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private watchdog timer.
- Setup interrupt handler after ether_ifattach().
- Use bus_foo() rather than bus_space_foo() and remove bus space tag and
  handle from softc.

Tested by:	imp
2008-06-13 12:14:22 +00:00
Kevin Lo
34b07c0273 Add the D-Link DWA-111 2008-06-13 02:02:21 +00:00
David Christensen
d75672d1c4 - Added support for BCM5709 and BCM5716.
MFC after:	2 weeks
2008-06-13 01:20:29 +00:00
David Christensen
7752e34d05 - Added support for BCM5709 and BCM5716 controllers.
MFC after:	2 weeks
2008-06-13 01:16:37 +00:00
Benno Rice
6e48215925 Use callout_init_mtx to simplify locking somewhat. While we're here, rearrange
some operations in smc_detach to remove the need for the smc_shutdown variable.

Suggested by:	jhb
2008-06-13 00:48:09 +00:00
Stephan Uphoff
11be8415c9 Fix vm object creation locking to allow SHARED vnode locking for vnode_create_vobject.
(Not currently used)

Noticed by: kib@
2008-06-12 20:46:47 +00:00
Marcel Moolenaar
d3532631de Finish the support for partition labels and add it to the XML. 2008-06-12 19:34:07 +00:00
Ed Schouten
3f7eea97fd Remove the $FreeBSD$ tag again, now I know fbsd:nokeywords exists.
Requested by:	pjd
Approved by:	philip (mentor)
2008-06-12 08:53:54 +00:00
Ed Schouten
0f03ce1bb8 Turn dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
Now that we got rid of the minor-to-unit conversion and the constraints
on device minor numbers, we can convert the functions that operate on
minor and unit numbers to simple macro's. The unit2minor() and
minor2unit() macro's are now no-ops.

The ZFS code als defined a macro named `minor'. Change the ZFS code to
use umajor() and uminor() here, as it is the correct approach to do
this. Also add $FreeBSD$ to keep SVN happy.

Approved by:	philip (mentor), pjd
2008-06-12 08:30:54 +00:00
Marcel Moolenaar
9a764aac3f Add the raw partition type to the XML. 2008-06-12 06:34:14 +00:00
Marcel Moolenaar
eab484f822 Add the raw partition type to the XML. 2008-06-12 06:26:36 +00:00
Marcel Moolenaar
a3354bb4a7 Add the raw partition type to the XML. 2008-06-12 05:56:03 +00:00
Marcel Moolenaar
0c132595dd Add the raw partiton type to the XML. 2008-06-12 05:28:47 +00:00
Marcel Moolenaar
40b075d366 Add the raw partition type to the XML. 2008-06-12 05:27:23 +00:00
Alan Cox
9d1b7fa31f Reverse the direction of pmap_promote_pde()'s traversal over the specified
page table page.  The direction of the traversal can matter if
pmap_promote_pde() has to remove write access (PG_RW) from a PTE that hasn't
been modified (PG_M).  In general, if there are two or more such PTEs to
choose among, it is better to write protect the one nearer the high end of
the page table page rather than the low end.  This is because most programs
access memory in an ascending direction.  The net result of this change is a
sometimes significant reduction in the number of failed promotion attempts
and the number of pages that are write protected by pmap_promote_pde().
2008-06-12 05:18:09 +00:00
Marcel Moolenaar
ab1e8f04c8 Add the partition label and the raw partition type to the XML. 2008-06-12 04:43:34 +00:00
Marcel Moolenaar
26371d590e Define APM_ENT_NAMELEN and APM_ENT_TYPELEN for general use. 2008-06-12 04:37:37 +00:00
Kevin Lo
bda386db88 Return an error code rather than ENXIO when both rman_init() and
rman_manage_region() failed.

Reviewed by:	marcel
2008-06-12 02:28:58 +00:00
Kevin Lo
57deb21ad4 Fix a typo: i80321_pci_probe -> i81342_pci_probe 2008-06-12 01:46:06 +00:00
Benno Rice
764e058a5b Make sure we drain our taskqueues and stop our callouts in detach. 2008-06-12 00:38:54 +00:00
Jack F Vogel
45cfd29bb8 Change include to reflect tcp_lro.h move. 2008-06-11 22:29:47 +00:00
Jack F Vogel
1af020f6ec Remove the tcp_lro.[ch] files as they are now in netinet. 2008-06-11 22:26:27 +00:00
Jack F Vogel
796c8b3758 Remove compile of tcp_lro since its now in netinet 2008-06-11 22:18:50 +00:00
Jack F Vogel
6c5087a818 Add generic TCP LOR into netinet 2008-06-11 22:12:50 +00:00
Jack F Vogel
667641261e Add LRO into kernel build 2008-06-11 22:10:10 +00:00
Jack F Vogel
a6baad0eaa Duh, wrong directory, needed to be in netinet 2008-06-11 22:08:13 +00:00
Jack F Vogel
1159a15627 Add generic TCP LRO code, moved from the ixgbe driver into net 2008-06-11 22:00:29 +00:00
Wojciech A. Koszek
b390a5baf8 Fix a typo in a comment. 2008-06-11 20:05:25 +00:00
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
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