Commit Graph

73996 Commits

Author SHA1 Message Date
Sam Leffler
c1d8b5aadd change default regdomain for thailand
Obtained from:	linux-wireless@kernel.org
2009-08-27 17:42:37 +00:00
Sam Leffler
418db7a1b2 enable mesh by default 2009-08-27 17:33:44 +00:00
Jamie Gritton
c4884ffa6f Fix a LOR between allprison_lock and vnode locks by releasing
allprison_lock before releasing a prison's root vnode.

PR:		kern/138004
Reviewed by:	kib
Approved by:	bz (mentor)
MFC after:	3 days
2009-08-27 16:15:51 +00:00
Pawel Jakub Dawidek
07a93e6b3c There's no need for checking result of M_WAITOK allocation. 2009-08-27 08:40:51 +00:00
Pawel Jakub Dawidek
c16ce31b31 Fix an obvious topology lock leak.
MFC after:	3 days
2009-08-27 08:28:34 +00:00
Qing Li
7bcee7f336 When multiple interfaces exist in the system, with each interface having
an IPv6 address assigned to it, and if an incoming packet received on
one interface has a packet destination address that belongs to another
interface, the routing table is consulted to determine how to reach this
packet destination. Since the packet destination is an interface address,
the route table will return a host route with the loopback interface as
rt_ifp. The input code must recognize this fact, instead of using the
loopback interface, the input code performs a search to find the right
interface that owns the given IPv6 address.

Reviewed by:	bz, gnn, kmacy
MFC after:	immediately
2009-08-26 21:32:50 +00:00
Stanislav Sedov
622247c0fb - Add quirk for Sony DSC digital cameras. This umass devices fail
to attach without these quirks applied.

PR:		usb/137035
URL:		http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010852.html
Reported by:	Henri Hennebert <hlh@restart.be>, Andrey V. Elsukov <bu7cher@yandex.ru>
MFC after:	1 week
2009-08-26 21:14:28 +00:00
Marius Strobl
5486ffc898 Add a temporary workaround which just lets init die instead of
causing a panic if it is killed due to a unsolved stack overflow
seen very late during shutdown on sparc64 when the gmirror worker
process exists, which is a regression introduced in 8.0.

Reviewed by:	kib
MFC after:	3 days
2009-08-26 21:10:47 +00:00
Konstantin Belousov
4f4946d337 Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
and similar calls.

Obtained from:	Petr Salinger, Debian GNU/kFreeBSD, Debian bug #489894
MFC after:	3 days
2009-08-26 14:32:37 +00:00
Robert Watson
ed2dabfc68 Add IFNET_HOLD reserved pointer value for the ifindex ifnet array,
which allows an index to be reserved for an ifnet without making
the ifnet available for management operations.  Use this in if_alloc()
while the ifnet lock is released between initial index allocation and
completion of ifnet initialization.

Add ifindex_free() to centralize the implementation of releasing an
ifindex value.  Use in if_free() and if_vmove(), as well as when
releasing a held index in if_alloc().

Reviewed by:	bz
MFC after:	3 days
2009-08-26 11:13:10 +00:00
Jilles Tjoelker
74d1c4927a Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.
This reverts part of r196460, so that sockets only return POLLHUP if both
directions are closed/error. Fifos get POLLHUP by closing the unused
direction immediately after creating the sockets.

The tools/regression/poll/*poll.c tests now pass except for two other things:
- if POLLHUP is returned, POLLIN is always returned as well instead of only
  when there is data left in the buffer to be read
- fifo old/new reader distinction does not work the way POSIX specs it

Reviewed by:	kib, bde
2009-08-25 21:44:14 +00:00
Robert Watson
61f6986b07 Break out allocation of new ifindex values from if_alloc() and if_vmove(),
and centralize in a single function ifindex_alloc().  Assert the
IFNET_WLOCK, and add missing IFNET_WLOCK in if_alloc().  This does not
close all known races in this code.

Reviewed by:	bz
MFC after:	3 days
2009-08-25 20:21:16 +00:00
Max Laier
c31650ade1 Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.

Submitted by:	pjd
Reviewed by:	{krw,sthen,markus}@openbsd.org
MFC after:	3 days
2009-08-25 19:30:32 +00:00
Andrew Thompson
51e8c0d6c6 It is possible for all the kthreads to exit (hci modules unloaded) which in
turn ends our usb process. This means the proc pointer becomes invalid and will
panic if a new kthread is added. Count the number of threads and clear the proc
pointer on the last one.

Suggested by:	julian
MFC after:	3 days
2009-08-25 16:59:55 +00:00
Gleb Smirnoff
08cc4f3542 Fix build broken in r196524. 2009-08-25 14:08:33 +00:00
Rafal Jaworowski
7ec5aa41ca Introduce SheevaPlug support.
- The device is based on Marvell 88F6281 system on chip.
  - More info about the platform at http://www.plugcomputer.org

  - To build the FreeBSD kernel:
    make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG

  - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell

Submitted by:	Michal Hajduk
Obtained from:	Semihalf
2009-08-25 10:09:25 +00:00
Robert Watson
dc56e98f0d Use locks specific to the lltable code, rather than borrow the ifnet
list/index locks, to protect link layer address tables.  This avoids
lock order issues during interface teardown, but maintains the bug that
sysctl copy routines may be called while a non-sleepable lock is held.

Reviewed by:	bz, kmacy
MFC after:	3 days
2009-08-25 09:52:38 +00:00
Rafal Jaworowski
18159f6a49 Introduce MII_ADDR_BASE option on ARM, which allows to override the default
per platform requirements.

Notes:
- Only used by mge(4) at the moment.

- This is very simplified approach and should be replaced by some long-term
  solution for managing the board/platform configuration (among others the
  MAC-PHY binding info).

Submitted by:	Michal Hajduk
Obtained from:	Semihalf
2009-08-25 09:47:12 +00:00
Rafal Jaworowski
c0d853f6b9 Exclude common Kirkwood settings so they can be shared among various platforms
based on this SOC. This is a preliminary step for SheevaPlug support.

Submitted by:	Michal Hajduk
Obtained from:	Semihalf
2009-08-25 09:39:11 +00:00
Rafal Jaworowski
5694b144c0 Properly handle initial state of power mgmt.
Modules on Marvell SOC can be selectively PM-disabled, and we must not access
disabled devices' registers (attempt to initialize them) unconditionally, as
this leads to the system hang. This patch introduces graceful handling of the
PM state during devices init.

Submitted by:	Michal Hajduk
Obtained from:	Semihalf
2009-08-25 09:35:50 +00:00
Rafal Jaworowski
a7817ce466 Eliminate platform_pmap_init() to simplify Marvell bootstrap code. 2009-08-25 09:30:03 +00:00
Warner Losh
58a745889f Rather than havnig enabled/disabled, implement a max queue depth.
While usually not an issue, this firewalls bugs in the code that may
run us out of memory.

Fix a memory exhaustion in the case where devctl was disabled, but the
link was bouncing.  The check to queue was in the wrong place.

Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
compatibility hacks for hw.bus.devctl_disable to ease transition.

Reviewed by:	emaste@
Approved by:	re@ (kib)
MFC after:	asap
2009-08-25 06:25:59 +00:00
Xin LI
c5bebef869 Fix VESA modes and allow 8bit depth modes.
PR:		i386/124902
Submitted by:	paradox <ddkprog yahoo com>
MFC after:	2 months
2009-08-24 22:35:53 +00:00
John Baldwin
2fcd493c4b Tweak the way that the ACPI and ISA bus drivers match hint devices to
BIOS-enumerated devices:
- Assume a device is a match if the memory and I/O ports match even if the
  IRQ or DRQ is wrong or missing.  Some BIOSes don't include an IRQ for
  the atrtc device for example.
- Add a hack to better match floppy controller devices.  Many BIOSes do not
  include the starting port of the floppy controller listed in the hints
  (0x3f0) in the resources for the device.  So far, however, all the BIOS
  variations encountered do include the 'port + 2' resource (0x3f2), so
  adjust the matching for "fdc" devices to look for 'port + 2'.

Reviewed by:	imp
MFC after:	3 days
2009-08-24 21:51:46 +00:00
Jack F Vogel
3de029efaf When bridging LRO is causing a problem, the believe
that it would work as long as all interfaces have TSO
seems to be false, until the matter gets sorted out
just disable LRO completely.
2009-08-24 21:04:51 +00:00
Jack F Vogel
d166ef5286 A couple of changes: first, make header split on by default
and remove from its dependency on LRO, my tests have shown
that its always beneficial, even when doing bridging.
Second, fix up a few problems in the statistics code, the
adapter dependencies had gotten lost so some code that should
only run on 82599 was always running, this resulted in bogus
flow control numbers on 82598.
2009-08-24 20:41:51 +00:00
Pyun YongHyeon
e4d5e24821 Don't try to power down PHY when alc(4) failed to map the device.
This fixes system crash when mapping alc(4) device failed in device
attach.

Reported by:	Jim < stapleton.41 <> gmail DOT com >
MFC after:	3 days
2009-08-24 20:37:15 +00:00
Pyun YongHyeon
5fa06abe89 Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
the description of RTL8168D as RL_HWREV_8168D can be either
RTL8168D or RTL8111D.

PR:	kern/137672
MFC after:	3 days
2009-08-24 18:58:13 +00:00
Bjoern A. Zeeb
89ffc202d6 Fix handling of .note.ABI-tag section for GNU systems [1].
Handle GNU/Linux according to LSB Core Specification 4.0,
Chapter 11. Object Format, 11.8. ABI note tag.

Also check the first word of desc, not only name, according to
glibc abi-tags specification to distinguish between Linux and
kFreeBSD.

Add explicit handling for Debian GNU/kFreeBSD, which runs
on our kernels as well [2].

In {amd64,i386}/trap.c, when checking osrel of the current process,
also check the ABI to not change the signal behaviour for Linux
binary processes, now that we save an osrel version for all three
from the lists above in struct proc [2].

These changes make it possible to run FreeBSD, Debian GNU/kFreeBSD
and Linux binaries on the same machine again for at least i386 and
amd64, and no longer break kFreeBSD which was detected as GNU(/Linux).

PR:		kern/135468
Submitted by:	dchagin [1] (initial patch)
Suggested by:	kib [2]
Tested by:	Petr Salinger (Petr.Salinger seznam.cz) for kFreeBSD
Reviewed by:	kib
MFC after:	3 days
2009-08-24 16:19:47 +00:00
Robert Watson
8e937462f4 Make if_grow static -- it's not used outside of if.c, and with the
internals destined to change, it's better if it remains that way.

MFC after:	3 days
2009-08-24 12:52:05 +00:00
Michael Tuexen
24ae5c4a73 This fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
was not honored, if the socket buffer size was not 4 times that large.

Approved by: rrs (mentor)
MFC after: 3 days.
2009-08-24 11:46:40 +00:00
Randall Stewart
0fa753b3fb This fixes two bugs in the NR-Sack code:
1) When calculating the table offset for sliding the sack
    array, the two byte values must be "ored" together in order
    for us to do the correct sliding of the arrays.
 2) We were NOT properly doing CC and other changes to things only
    NR-Sacked. The solution here is to make a separate function that
    will actually do both CC/updates and free things if its NR sack'd.
    This actually shrinks out common code from three places (much better).

MFC after:	3 days
2009-08-24 11:13:32 +00:00
Ed Schouten
2992abe047 Allow multiple console devices per driver without insane code duplication.
Say, a driver wants to have multiple console devices to pick from, you
would normally write down something like this:

	CONSOLE_DRIVER(dev1);
	CONSOLE_DRIVER(dev2);

Unfortunately, this means that you have to declare 10 cn routines,
instead of 5. It also isn't possible to initialize cn_arg on beforehand.

I noticed this restriction when I was implementing some of the console
bits for my vt(4) driver in my newcons branch. I have a single set of cn
routines (termcn_*) which are shared by all vt(4) console devices.

In order to solve this, I'm adding a separate consdev_ops structure,
which contains all the function pointers. This structure is referenced
through consdev's cn_ops field.

While there, I'm removing CONS_DRIVER() and cn_checkc, which have been
deprecated for years. They weren't used throughout the source, until the
Xen console driver showed up. CONSOLE_DRIVER() has been changed to do
the right thing. It now declares both the consdev and consdev_ops
structure and ties them together. In other words: this change doesn't
change the KPI for drivers that used the regular way of declaring
console devices.

If drivers want to use multiple console devices, they can do this as
follows:

	static const struct consdev_ops mydriver_cnops = {
		.cn_probe	= mydriver_cnprobe,
		...
	};
	static struct mydriver_softc cons0_softc = {
		...
	};
	CONSOLE_DEVICE(cons0, mydriver_cnops, &cons0_softc);
	static struct mydriver_softc cons1_softc = {
		...
	};
	CONSOLE_DEVICE(cons1, mydriver_cnops, &cons1_softc);

Obtained from:	//depot/user/ed/newcons/...
2009-08-24 10:53:30 +00:00
Marko Zec
0cb8b6a9b7 When "jail -c vnet" request fails, the current code actually creates and
leaves behind an orphaned vnet.  This change ensures that such vnets get
released.

This change affects only options VIMAGE builds.

Submitted by:	jamie
Discussed with:	bz
Approved by:	re (rwatson), julian (mentor)
MFC after:	3 days
2009-08-24 10:16:19 +00:00
Marko Zec
52db6805ea When moving ifnets from one vnet to another, and the ifnet
has ifaddresses of AF_LINK type which thus have an embedded
if_index "backpointer", we must update that if_index backpointer
to reflect the new if_index that our ifnet just got assigned.

This change affects only options VIMAGE builds.

Submitted by:	bz
Reviewed by:	bz
Approved by:	re (rwatson), julian (mentor)
2009-08-24 10:14:09 +00:00
Marko Zec
0348c661d1 Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
context inside the RPC code.

Temporarily set td's cred to mount's cred before calling socreate() via
__rpc_nconf2socket().

Submitted by:	rmacklem (in part)
Reviewed by:	rmacklem, rwatson
Discussed with:	dfr, bz
Approved by:	re (rwatson), julian (mentor)
MFC after:	3 days
2009-08-24 10:09:30 +00:00
Marko Zec
2b73aacaf9 Introduce a div_destroy() function which takes over per-vnet cleanup tasks
from the existing modevent / MOD_UNLOAD handler, and register div_destroy()
in protosw as per-vnet .pr_destroy() handler for options VIMAGE builds.  In
nooptions VIMAGE builds, div_destroy() will be invoked from the modevent
handler, resulting in effectively identical operation as it was prior this
change.  div_destroy() also tears down hashtables used by ipdivert, which
were previously left behind on ipdivert kldunloads.

For options VIMAGE builds only, temporarily disable kldunloading of ipdivert,
because without introducing additional locking logic it is impossible to
atomically check whether all ipdivert instances in all vnets are idle, and
proceed with cleanup without opening a race window for a vnet to open an
ipdivert socket while ipdivert tear-down is in progress.

While here, staticize div_init(), because it is not used outside of
ip_divert.c.

In cooperation with:	julian
Approved by:	re (rwatson), julian (mentor)
MFC after:	3 days
2009-08-24 10:06:02 +00:00
Marko Zec
d57425ab65 When registering a protocol to an existing protocol domain via
pf_proto_register(), iterate over all existing vnets to call protosw_init()
and thus the appropriate .pr_init() handler in the context of each vnet.
NB in the future we probably want to separate pr_init() handlers into
two, i.e. per-vnet and global, functions.

This change has no impact on nooptions VIMAGE builds.

Approved by:	re (rwatson), julian (mentor)
MFC after:	3 days
2009-08-24 10:03:41 +00:00
Ed Schouten
416b15e41e Cleanups to the Xen console driver:
- Use CONSOLE_DRIVER() instead of the deprecated CONS_DRIVER() declaration.

- This means we cannot use cn_checkc anymore, which is supposed to do
  the same as cn_getc nowadays. Remove the cn_getc implementation (that
  was never being called) and rename cn_checkc to cn_getc.

- Don't run-time patch cn_putc, but add the logic to xc_cnputc().

This means I could do some cleanups to our console code...

Tested by:	nobody on hackers@
2009-08-24 08:27:42 +00:00
Alfred Perlstein
cb18f7d12b - Patch to allow USB controller to resume operation after
being polled.

         - Remove the need for Giant from the USB HUB driver.

         - Leave device unconfigured instead of disabling the USB port
           when Huawei Autoinstall disk detection triggers. This should
           fix problems that the Huawei device is not detected after
           Autoinstall eject is issued.
         - Reported by: Nikolay Antsiferov

         - Fix memory use after free race for USB character devices.
         - Reported by: Lucius Windschuh

         - Factor out the enumeration lock into three functions to make the
         coming newbus lock conversion more easy.
          - usbd_enum_lock
          - usbd_enum_unlock
          - usbd_enum_is_locked

Submitted by:	hps
2009-08-24 05:05:38 +00:00
Alfred Perlstein
a5508450dc Remove redundant locking.
Submitted by:	hps
2009-08-24 05:03:59 +00:00
Alfred Perlstein
f2db024fe6 Add a reminder comment to optimize bus_dmamap_sync calls.
Submitted by:	hps
2009-08-24 05:03:30 +00:00
Alfred Perlstein
77c33ae7cc Add mass storage quirks.
PR:             usb/137138,usb/137226,usb/137789,usb/135372

Submitted by:	hps
2009-08-24 05:02:36 +00:00
Alfred Perlstein
40675d1a70 - fix uvisor support, mostly correct buffer sizes used.
- correct device info flag for SONY Cli NR70V

Reported by: Marc Fonvieille
Submitted by:	hps
2009-08-24 05:01:40 +00:00
Alfred Perlstein
ec1201a2c9 - Fix false positive uipaq probe
Reported by: Alexander Motin <mav@freebsd.org>

Submitted by:	hps
2009-08-24 05:01:06 +00:00
Alfred Perlstein
9739167c64 - fix CDC ethernet matching order so that the match flags get correct.
Reported by: Juergen Lock

Submitted by:	hps
2009-08-24 05:00:33 +00:00
Alfred Perlstein
069f9a8bd6 We used force all of the GPIO pins low first and then
enable the ones we want. This has been changed to better
match the ADMtek's reference design to avoid setting the
power-down configuration line of the PHY at the same time
it is reset.

Submitted by:	John Hood via hps
2009-08-24 05:00:07 +00:00
Alfred Perlstein
03a7d05c2d - FIFO's are always opened separately in read and write
direction even if the actual device is opened for read and
        write. Fix fflags check so that the UFM and URIO drivers work.
Reported by: Krassimir Slavchev

Submitted by:	hps
2009-08-24 04:59:09 +00:00
Alfred Perlstein
247549d145 - patch for cordump slowdown. Avoid using DELAY(1000) when no
keys are pressed.
        - Reported by: Various people

        - add sysctl to disable keyboard led control request
        - Reported by: Yoshihiro Ota

        - Save system CPU usage: Patch to stop keyboard timer when no
        keys are pressed.

Submitted by:	hps
MFC after:	3 days
2009-08-24 04:58:42 +00:00
Alfred Perlstein
34b4872224 - allow disabling "root_mount_hold()" by
setting a sysctl/tunable at boot
        - remove some redundant initial explore code

Submitted by:	hps
2009-08-24 04:58:11 +00:00