Commit Graph

69609 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
4b3f4d3818 Adopt the comment for tcp_maxmtu(); we are returning a number
not a pointer. While here update the rest of the comment to
better match what we have these days.

MFC after:	2 months
2008-11-06 12:59:00 +00:00
Bjoern A. Zeeb
6f01cac68a Fix a bug introduced with r182851 splitting tcp_mss() into
tcp_mss() and tcp_mss_update() so that tcp_mtudisc() could
re-use the same code.

In case we return early and got a metricptr to pass the hostcache
info back to the caller we need to initialize the data to a defined
state (zero it) as tcp_hc_get() would do if there was no hit.
Without that the caller would check on random stack garbage which
could lead to undefined results.

This only affected tcp_mss() if there was no routing entry for the peer,
tcp_mtudisc() was not affected.

MFC after:	2 months (along with r182851)
2008-11-06 12:33:33 +00:00
Doug Rabson
c3c1513719 Don't depend on krpc.ko in the NFS_LEGACYRPC case. 2008-11-06 11:43:49 +00:00
Bjoern A. Zeeb
c30067e8bf Hide AF_INET specific ioctl handling under #ifdef INET.
MFC after:	2 months
2008-11-06 11:11:25 +00:00
Bjoern A. Zeeb
edb04458d5 Hide AF_INET specific ioctl handling under #ifdef INET.
MFC after:	2 months
2008-11-06 11:00:57 +00:00
Dag-Erling Smørgrav
19aa71e559 Unbreak NFS.
Pointy hat to:	dfr
2008-11-06 10:53:35 +00:00
Bjoern A. Zeeb
ca6bc428e7 For now our LRO code (tcp_lro.c) only supports IPv4 properly thus
only enable if INET is on.

Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:35:46 +00:00
Bjoern A. Zeeb
34627f9384 Hide AF_INET specific ioctl handling under #ifdef INET.
Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:17:57 +00:00
Bjoern A. Zeeb
f0176c5c6f Hide an unused variable in case we compile with neither INET nor INET6.
NATM needs 'struct in_addr' to compile, which is a problem on its own
but include in.h for now if we have NATM but neither INET or INET6.

MFC after:	2 months
2008-11-06 09:41:31 +00:00
Bjoern A. Zeeb
3ba6ebdb2a Check for INET not AF_INET in #ifdef. Makes it compile without INET.
MFC after:	2 months
2008-11-06 09:27:47 +00:00
Bjoern A. Zeeb
9939ceb05c Hide an unused variable in case we compile without INET.
Include ethernet.h and if_arp.h directly so that the constants are
always defined.
Makes token compile without INET.

MFC after:	2 months
2008-11-06 09:18:29 +00:00
Bjoern A. Zeeb
41d9907a4b Hide an unused variable in case we compile without INET.
Include ethernet.h directly so that the constants are always defined.
Makes fddi compile without INET.

MFC after:	2 months
2008-11-06 09:07:56 +00:00
Bjoern A. Zeeb
994d867cf7 In case INET is not defined, then ANCACHE is not defined and
the sc does not have 'an_have_rssimap' variable.
Add an ANCACHE check to poperly hide the case and make an(4)
compile without INET.

MFC after:	2 months
2008-11-06 08:55:46 +00:00
Craig Rodrigues
6a73ed4f46 Remove definition of KMEM_DEBUG accidentally brought in by latest DTrace
import.

Noticed by:	thompsa
2008-11-05 20:32:13 +00:00
Craig Rodrigues
e506f34b24 Merge latest DTrace changes from Perforce.
Approved by:	jb
2008-11-05 19:40:36 +00:00
Craig Rodrigues
f5a97d1bcb Merge latest DTrace changes from Perforce. 2008-11-05 19:39:11 +00:00
Doug Rabson
4822a31d1c If mountd doesn't specify a secflavor list for the mount, assume that -sec=sys
is what was wanted.
2008-11-05 16:25:26 +00:00
Doug Rabson
e3c56574b3 Don't return a NULL mbuf from xdrmbuf_getall. 2008-11-05 16:24:31 +00:00
Dag-Erling Smørgrav
faecfd5641 utf-8
MFC after:	3 weeks
2008-11-05 15:08:09 +00:00
Ed Schouten
932ef5b5cd Reintroduce the snp(4) driver.
Because the TTY hooks interface was not finished when I imported the
MPSAFE TTY layer, I had to disconnect the snp(4) driver. This snp(4)
implementation has been sitting in my P4 branch for some time now.
Unfortunately it still doesn't use the same error handling as snp(4)
(returning codes through FIONREAD), but it should already be usable.

I'm committing this to SVN, hoping someone else could polish off its
rough edges. It's always better than having a broken driver sitting in
the tree.
2008-11-05 15:04:03 +00:00
Bjoern A. Zeeb
63c79eb71f Make compile without INET.
The change is modelled after the way it was done for (without) INET6.

MFC after:	2 months
2008-11-05 12:02:25 +00:00
Bjoern A. Zeeb
d8afa3a3b1 Hide the IPv4 init function if the kernel is compiled without INET.
It is not used in that case and would not compile.
2008-11-05 11:54:56 +00:00
Bjoern A. Zeeb
a37de8bed9 Make compile without INET.
MFC after:	2 months
2008-11-05 11:43:01 +00:00
Bjoern A. Zeeb
063acb9ac1 Make tun(4) compile without INET.
MFC after:	2 months
2008-11-05 11:39:46 +00:00
Bjoern A. Zeeb
e0de57f9ea Do only define the variable if either INET or INET6 is defined.
To prevent it from compiling without INET and INET6 we should put
an explicit #error in there like we have in other files,
but not rely on an unused variable.

MFC after:	2 months
2008-11-05 11:37:26 +00:00
David Xu
7b4a950a7d Revert rev 184216 and 184199, due to the way the thread_lock works,
it may cause a lockup.

Noticed by: peter, jhb
2008-11-05 03:01:23 +00:00
John Baldwin
927edcc9ba Use shared vnode locks for auditing vnode arguments as auditing only
does a VOP_GETATTR() which does not require an exclusive lock.

Reviewed by:	csjp, rwatson
2008-11-04 22:31:04 +00:00
John Baldwin
16da60664d Don't lock the vnode around calls to vn_fullpath().
Reviewed by:	csjp, rwatson
2008-11-04 22:30:24 +00:00
Rink Springer
203b82c842 Even though the previous commit was functionally equivalent with the code it replaced, it was wrong: le16toh should have been used.
Note that these changes will not make the driver work on powerpc, but it should fix at least the i386/amd64 cases.

Obtained from:	//depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#20
Noticed by:	jeli, ed
2008-11-04 20:57:39 +00:00
Rink Springer
9fbaa8e74d Fix the build (on at least powerpc) by moving the htole16() from the case(x) expression directly to the switch(x) itself.
Reviewed by:	imp@
2008-11-04 19:28:19 +00:00
John Baldwin
0caf1ab15a Don't bother calling setrunnable() and clearing the sleeping flag in
sleepq_resume_thread() if the thread isn't asleep.
2008-11-04 19:13:53 +00:00
John Baldwin
2ff47c5f18 Remove unnecessary locking around vn_fullpath(). The vnode lock for the
vnode in question does not need to be held.  All the data structures used
during the name lookup are protected by the global name cache lock.
Instead, the caller merely needs to ensure a reference is held on the
vnode (such as vhold()) to keep it from being freed.

In the case of procfs' <pid>/file entry, grab the process lock while we
gain a new reference (via vhold()) on p_textvp to fully close races with
execve(2).

For the kern.proc.vmmap sysctl handler, use a shared vnode lock around
the call to VOP_GETATTR() rather than an exclusive lock.

MFC after:	1 month
2008-11-04 19:04:01 +00:00
John Baldwin
2ef42c06d6 Quiet a WITNESS warning with the dirhash sx locks by setting the DUPOK
flag.  Specifically, if two threads race to create a dirhash for a
directory, then one might already have created a private dirhash
structure (and locked it) when it realizes the directory now has a
structure and tries to lock that one.
2008-11-04 18:56:12 +00:00
John Baldwin
7265164f53 Don't pass WANTPARENT to the pathname lookup of the mount point for a
unionfs mount just so we can immediately drop the reference on the parent
directory vnode without using it.
2008-11-04 18:54:44 +00:00
John Baldwin
b1b3a8653d Don't leak a reference on the /compat/linux vnode everytime
the linprocfs 'mtab' file is read.

MFC after:	1 month
2008-11-04 18:53:33 +00:00
Doug Rabson
a720ad3450 Include <sys/eventhandler.h>. 2008-11-04 16:43:02 +00:00
Edward Tomasz Napierala
4a4f18ed37 In UFS, when reading EA that contains ACL fails for some reason, include
inode number and filesystem name, so the administrator can fix the problem.

Approved by:	rwatson (mentor)
2008-11-04 12:30:31 +00:00
Rui Paulo
31fb990621 Add support for Asus A8Sr notebooks.
PR:		128553
Submitted by:	Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Reviewed by:	philip
MFC after:	2 months
2008-11-04 11:52:50 +00:00
Ed Schouten
394e94079c Remove redundant return value tests.
There is no need to test whether the return value is non-zero here. Just
return the error number directly.
2008-11-04 10:58:02 +00:00
Alfred Perlstein
c63c25015a add usb2_if.m to mfiles to unbreak build of modules. 2008-11-04 03:42:01 +00:00
Alfred Perlstein
eabe30fc9c Bring in USB4BSD, Hans Petter Selasky rework of the USB stack
that includes significant features and SMP safety.

This commit includes a more or less complete rewrite of the *BSD USB
stack, including Host Controller and Device Controller drivers and
updating all existing USB drivers to use the new USB API:

1) A brief feature list:

  - A new and mutex enabled USB API.

  - Many USB drivers are now running Giant free.

  - Linux USB kernel compatibility layer.

  - New UGEN backend and libusb library, finally solves the "driver
    unloading" problem. The new BSD licensed libusb20 library is fully
    compatible with libusb-0.1.12 from sourceforge.

  - New "usbconfig" utility, for easy configuration of USB.

  - Full support for Split transactions, which means you can use your
    full speed USB audio device on a high speed USB HUB.

  - Full support for HS ISOC transactions, which makes writing drivers
    for various HS webcams possible, for example.

  - Full support for USB on embedded platforms, mostly cache flushing
    and buffer invalidating stuff.

  - Safer parsing of USB descriptors.

  - Autodetect of annoying USB install disks.

  - Support for USB device side mode, also called USB gadget mode,
    using the same API like the USB host side. In other words the new
    USB stack is symmetric with regard to host and device side.

  - Support for USB transfers like I/O vectors, means more throughput
    and less interrupts.

  - ... see the FreeBSD quarterly status reports under "USB project"

2) To enable the driver in the default kernel build:

2.a) Remove all existing USB device options from your kernel config
file.

2.b) Add the following USB device options to your kernel configuration
file:

# USB core support
device          usb2_core

# USB controller support
device		usb2_controller
device		usb2_controller_ehci
device		usb2_controller_ohci
device		usb2_controller_uhci

# USB mass storage support
device		usb2_storage
device		usb2_storage_mass

# USB ethernet support, requires miibus
device		usb2_ethernet
device		usb2_ethernet_aue
device		usb2_ethernet_axe
device		usb2_ethernet_cdce
device		usb2_ethernet_cue
device		usb2_ethernet_kue
device		usb2_ethernet_rue
device		usb2_ethernet_dav

# USB wireless LAN support
device		usb2_wlan
device		usb2_wlan_rum
device		usb2_wlan_ral
device		usb2_wlan_zyd

# USB serial device support
device		usb2_serial
device		usb2_serial_ark
device		usb2_serial_bsa
device		usb2_serial_bser
device		usb2_serial_chcom
device		usb2_serial_cycom
device		usb2_serial_foma
device		usb2_serial_ftdi
device		usb2_serial_gensa
device		usb2_serial_ipaq
device		usb2_serial_lpt
device		usb2_serial_mct
device		usb2_serial_modem
device		usb2_serial_moscom
device		usb2_serial_plcom
device		usb2_serial_visor
device		usb2_serial_vscom

# USB bluetooth support
device		usb2_bluetooth
device		usb2_bluetooth_ng

# USB input device support
device		usb2_input
device		usb2_input_hid
device		usb2_input_kbd
device		usb2_input_ms

# USB sound and MIDI device support
device		usb2_sound

2) To enable the driver at runtime:

2.a) Unload all existing USB modules. If USB is compiled into the
kernel then you might have to build a new kernel.

2.b) Load the "usb2_xxx.ko" modules under /boot/kernel having the same
base name like the kernel device option.

Submitted by: Hans Petter Selasky hselasky at c2i dot net
Reviewed by: imp, alfred
2008-11-04 02:31:03 +00:00
Nick Hibma
92ad2cd779 Bugfix: Cut&paste error from the NetBSD code.
Also: Change the initialisation of the command string to a static
initialiser. Verify it against the output of umass.c when being sent a
command using 'camcontrol eject da0' to a Bulk-Only device.

This should make those devices work that need a SCSI eject command to
switch to modem mode (Novatel 950D and others).
2008-11-03 22:09:27 +00:00
Nick Hibma
bcde061b22 uaa->ifaces contains pointers so set its entry to NULL not 0. 2008-11-03 22:05:44 +00:00
John Baldwin
4482f952b1 Adjust the license statement to more closely match a standard 3-clause BSD
license.

MFC after:	3 days
2008-11-03 21:17:02 +00:00
John Baldwin
21fc02d271 Use shared vnode locks instead of exclusive vnode locks for the access(),
chdir(), chroot(), eaccess(), fpathconf(), fstat(), fstatfs(), lseek()
(when figuring out the current size of the file in the SEEK_END case),
pathconf(), readlink(), and statfs() system calls.

Submitted by:	ups (mostly)
Tested by:	pho
MFC after:	1 month
2008-11-03 20:31:00 +00:00
Attilio Rao
30f60d8c31 Remove the mnt_holdcnt and mnt_holdcntwaiters because they are useless.
Really, the concept of holdcnt in the struct mount is rappresented by
the mnt_ref (which prevents the type-stable structure from being
"recycled) handled through vfs_ref() and vfs_rel().
On this optic, switch the holdcnt acquisition into an emulated vfs_ref()
(and subsequent release into vfs_rel()).

Discussed with:	kib
Tested by:	pho
2008-11-03 20:00:35 +00:00
John Baldwin
c439bdd86f Remove some unused and broken code that attempted to not invoke locking
asserts on NULL vnode pointers.  All the vnode assertion routines already
check for NULL vnode pointers.
2008-11-03 19:57:40 +00:00
John Baldwin
0f54f8c2b3 A few style nits. 2008-11-03 19:33:20 +00:00
Alexander Motin
9325b9b23b Remove " + 1".
Thread ID can't be zero anyway while increment may give owerflow.
2008-11-03 18:28:12 +00:00
Edward Tomasz Napierala
ea49f15447 Fix few missed accmode changes in coda.
Approved by:	rwatson (mentor)
2008-11-03 16:36:23 +00:00
Warner Losh
8481e37b53 Nit: Add a few leading zeros to make this match other mask constants
in this file.  Also to make sure that I got other ASI constants right.
2008-11-03 15:38:45 +00:00
Robert Watson
339f72c730 Implement device cloning for /dev/nsmb, the netsmb control pseudo-device.
The smb library in userspace already knows how to deal with this type of
cloning.

This also corrects a leak in which the netsmb kernel module could not be
unloaded if device nodes had been stat'd but not open'd.

Discussed with:	kib
2008-11-03 14:23:15 +00:00
Doug Rabson
45e6ab7f81 Regen. 2008-11-03 10:39:35 +00:00
Doug Rabson
a9148abd9d Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager.  I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.

The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.

To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.

As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.

Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.

The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.

Sponsored by:	Isilon Systems
MFC after:	1 month
2008-11-03 10:38:00 +00:00
Warner Losh
714cb2219c Turns out this isn't even used at all... The bogon that I was tracing was
in code from my p4 tree, not -current.  Delete it here.
2008-11-03 06:37:59 +00:00
Warner Losh
89558ee870 Use child (the card) in preference to cbdev (the bridge) when
allocating resources to read the CIS.  I'm not sure when this changed,
but it is totally wrong.  Also, add a minor improvement to the
debugging.

This should help everybody trying to run dumpcis on atheros wireless
card as well.

MFC after:	2 days
2008-11-03 06:06:22 +00:00
Warner Losh
6e39a203de We can't mask out the higher order bits and have the size come out
right...  Good thing the size was ignored...

Where this macro is used, there's no reason to do it anyway.  There
seems to have been some old-time confusion between the CIS pointer
definition, and the BAR definitions at the base of this bug.
2008-11-03 05:52:43 +00:00
Scott Long
9d685822a4 Add amr_cam module directory that was missed in the previous commit. 2008-11-03 04:13:27 +00:00
Scott Long
64c71632bf Move the CAM passthrough code into a true module so that it doesn't have to be
compiled into the main AMR driver.  It's code that is nice to have but not
required for normal operation, and it is reported to cause problems for some
people.
2008-11-03 00:53:54 +00:00
Robert Watson
2b7da2dbf1 Catch up with netsmb locking: explicit thread arguments no longer required. 2008-11-02 23:20:27 +00:00
Robert Watson
e3b3762b32 Catch up internal locking routines in netsmb with lockmgr changes --
explicit thread arguments are no longer required in many places.
2008-11-02 23:15:32 +00:00
Ivan Voras
aa880b9018 Increase the initial sbuf size for CPU topology dump to something more
usable for newer CPUs. The new value allows 2 x quad core configuration
dumps to fit within the initial buffer without reallocations.

Approved by:	gnn (mentor) (older version)
Pointed out by:	rdivacky
2008-11-02 23:11:20 +00:00
Robert Watson
6aaab44423 smb_vc_put() requires that the passed vcp be locked, so lock it before
dropping the connection when the requested service isn't available, or
we may try to release a lock that isn't locked.

This prevents an assertion failure when trying to mount a non-present
share using smbfs with INVARIANTS; a lock order reversal warning that
immediately follows is not yet fixed.

Reported by:	attilio
MFC after:	3 days
2008-11-02 20:22:24 +00:00
Konstantin Belousov
e0dec6ebb1 Revert r184516. Option RL_TWISTER_ENABLE is no more after it became
loader tunable.

Pointy hat to:	me
2008-11-02 19:40:24 +00:00
Ed Schouten
3c5f535bbf Make the touch pad on my PowerBook G4 12" a little more usable.
For an unknown reason the touch pad of my PowerBook generates button 5
events when you operate it. This causes the adb_mouse code to convert
them to button 2 events, which is not what we want.

Add a new flag, AMS_TOUCHPAD, which is used to distinguish the touch
pad. When set, don't convert button events of unknown buttons to the
last button.

There are still three problems left with respect to user input:

- The mouse button events are not properly processed when the touch pad
  isn't touched.

- The arrow keys on the keyboard don't work inside X11.

- The power button isn't handled by the kernel, similar to the ACPI
  power button on i386/amd64.

Approved by:	nwhitehorn
2008-11-02 19:08:10 +00:00
Warner Losh
132580b5af MFp4:
Make the ISA bus keep track of more PNP details.  Plus a minor style
fix while I'm here.  More could be done here, but except for some SBCs
that don't have ACPI, there's limited value to anybody in doing so.
2008-11-02 18:48:54 +00:00
Warner Losh
96cf0b6d56 Make the no driver stuff an ifdef. 2008-11-02 17:35:15 +00:00
Warner Losh
972f68aeab Move mn over. One of the last stragglers in sys/pci. There's no
module built for this hardware, so no changes needed.
2008-11-02 17:04:54 +00:00
Tom Rhodes
8b4acb0cc0 Document a few sysctls in the NFS client and server code.
Minor style(9) where applicable.

Approved by:	alfred (slightly older version)
2008-11-02 17:00:23 +00:00
Warner Losh
4a8cdcaf87 Make RL_TWISTER_ENABLE a tunable/sysctl. Eliminate it as an option.
Fix module build.

Submitted by:	Kostik Belousov
2008-11-02 16:50:57 +00:00
Alexander Motin
57675eb3fa As soon as we have several threads per process now, it is not correct to
use process ID as ACPI thread ID. Concurrent requests with equal thread
IDs broke ACPI mutexes operation causing unpredictable errors including
AE_AML_MUTEX_NOT_ACQUIRED that I have seen.

Use kernel thread ID instead of process ID for ACPI thread.
2008-11-02 12:50:16 +00:00
Edward Tomasz Napierala
2a9e5e2e7c Remove the call to getinoquota() from ntfs_access. How did it get there?!
Approved by:	rwatson (mentor)
2008-11-02 11:49:19 +00:00
Attilio Rao
b23e9e9d85 Bump __FreeBSD_version in order to reflect vfs_busy() prototype changing
and its flags (MBF_NOWAIT, MBF_MNTLSTLOCK) introduction.
2008-11-02 10:20:18 +00:00
Attilio Rao
83b3bdbc8a Improve VFS locking:
- Implement real draining for vfs consumers by not relying on the
  mnt_lock and using instead a refcount in order to keep track of lock
  requesters.
- Due to the change above, remove the mnt_lock lockmgr because it is now
  useless.
- Due to the change above, vfs_busy() is no more linked to a lockmgr.
  Change so its KPI by removing the interlock argument and defining 2 new
  flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the
  old version (which was unlinked from the lockmgr alredy) and
  MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx
  once the mnt interlock is held (ability still desired by most consumers).
- The stub used into vfs_mount_destroy(), that allows to override the
  mnt_ref if running for more than 3 seconds, make it totally useless.
  Remove it as it was thought to work into older versions.
  If a problem of "refcount held never going away" should appear, we will
  need to fix properly instead than trust on such hackish solution.
- Fix a bug where returning (with an error) from dounmount() was still
  leaving the MNTK_MWAIT flag on even if it the waiters were actually
  woken up. Just a place in vfs_mount_destroy() is left because it is
  going to recycle the structure in any case, so it doesn't matter.
- Remove the markercnt refcount as it is useless.

This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and
__FreeBSD_version will be modified accordingly.

Discussed with:	kib
Tested by:	pho
2008-11-02 10:15:42 +00:00
Warner Losh
0952268ecd Add support for reading Tivo Series 1 partitioning. This likely needs
a little refinement, but is good enough to commit as is.

# Should look to see if I should move swab(3) into the kernel or just
# provide the unoptimized routine here.

Reviewed by:	marcel@
2008-11-02 03:02:56 +00:00
Warner Losh
205e85c3e2 Merge some minor deltas from p4 newcard tree:
(1) Belkin F5D7050_V4000 was also sold as 'Ativa 802.11g wireless card'
(document)
(2) Add HP Office Jet 4215
2008-11-02 03:00:36 +00:00
Warner Losh
795239ebe6 Remove cardbus attachment. It likely was a cut-n-paste left over from
whatever template was used to create this driver.  It is not
necessary, and wouldn't work anyway since (a) this device will never
be in a cardbus tin-can and (b) the driver isn't even PCI, but instead
a built-in NIC on the IDT RC32434 on its internal bus.
2008-11-02 02:58:24 +00:00
Giorgos Keramidas
2db63c5e38 Various comment nits, and typos. 2008-11-02 00:41:26 +00:00
Robert Watson
d2f6bb070f Update introductory comment for audit pipes.
MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-11-02 00:25:48 +00:00
Robert Watson
6e1362b499 Remove stale comment about filtering in audit pipe ioctl routine: we do
support filtering now, although we may want to make it more interesting
in the future.

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-11-02 00:18:19 +00:00
Robert Watson
e4565e2028 Add comment for per-pipe stats.
MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-11-01 23:05:49 +00:00
Robert Watson
cff9c52e23 We only allow a partial read of the first record in an audit pipe
record queue, so move the offset field from the per-record
audit_pipe_entry structure to the audit_pipe structure.

Now that we support reading more than one record at a time, add a
new summary field to audit_pipe, ap_qbyteslen, which tracks the
total number of bytes present in a pipe, and return that (minus
the current offset) via FIONREAD and kqueue's data variable for
the pending byte count rather than the number of bytes remaining
in only the first record.

Add a number of asserts to confirm that these counts and offsets
following the expected rules.

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-11-01 21:56:45 +00:00
Robert Watson
a9275e0bd5 Allow a single read(2) system call on an audit pipe to retrieve data from
more than one audit record at a time in order to improve efficiency.

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-11-01 21:16:09 +00:00
Warner Losh
d5d31449de Fix a few typos/spelling errors in my comments from the last commit,
plus a few others that had lingered in this driver...

Submitted by:	"b." bf2006a att yahoo KIBO com
2008-11-01 17:02:01 +00:00
Ed Schouten
37a9f58275 Clamp the values of t_column to 5 digits in pstat -t' and show all ttys'.
We often run into these very high column numbers when we run curses
applications, because they don't print any newlines. This messes up the
table output of `pstat -t'. If these numbers get really high, they
aren't of any use to the reader anyway. Convert them to `99999' when
they run out of bounds.
2008-11-01 13:40:46 +00:00
Ed Schouten
c9dba40cc8 Reimplement the /dev/console device node.
One of the pieces of code that I had left alone during the development
of the MPSAFE TTY layer, was tty_cons.c. This file actually has two
different functions:

- It contains low-level console input/output routines (cnputc(), etc).

- It creates /dev/console and wraps all its cdevsw calls to the
  appropriate TTY.

This commit reimplements the second set of functions by moving it
directly into the TTY layer. /dev/console is now a character device node
that's basically a regular TTY, but does a lookup of `si_drv1' each time
you open it. d_write has also been changed to call log_console().
d_close() is not present, because we must make sure we don't revoke the
TTY after writing a log message to it.

Even though I'm not convinced this is in line with the future directions
of our console code, it is a good move for now. It removes recursive
locking from the top half of the TTY layer. The previous implementation
called into the TTY layer with Giant held.

I'm renaming tty_cons.c to kern_cons.c now. The code hardly contains any
TTY related bits, so we'd better give it a less misleading name.

Tested by:	Andrzej Tobola <ato iem pw edu pl>,
		Carlos A.M. dos Santos <unixmania gmail com>,
		Eygene Ryabinkin <rea-fbsd codelabs ru>
2008-11-01 08:35:28 +00:00
Ed Schouten
b75d197096 Allow a read() on /dev/ams[0-9] to be interrupted.
Right now ams_read() uses cv_wait() to wait for new data to arrive on
the mouse device. This means that when you run `cat /dev/ams0', it
cannot be interrupted directly. After you press ^C, you first need to
move the mouse before cat will quit. Make this function use
cv_wait_sig(), which allows it to be interrupted directly.

Reviewed by:	nwhitehorn
2008-11-01 08:07:02 +00:00
Warner Losh
5702451cd5 Add RL_TWISTER_ENABLE. 2008-11-01 00:28:44 +00:00
Warner Losh
9b27478be4 Add RL_TWISTER_ENABLE option. This enables the magic bits to do long
cable tuning.  This has helped in some installations for hardware
deployed by a former employer.  Made optional because the lists aren't
full of complaints about these cards... even when they were wildly
popular.

Reviewed by:	attilio@, jhb@, trhodes@ (all an older version of the patch)
2008-10-31 23:24:13 +00:00
Robert Watson
1a0edb10ca Since there is no longer the opportunity for record truncation, just
return 0 if the truncation counter is queried on an audit pipe.

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-10-31 15:11:01 +00:00
Robert Watson
5a9d15cd4c Historically, /dev/auditpipe has allows only whole records to be read via
read(2), which meant that records longer than the buffer passed to read(2)
were dropped.  Instead take the approach of allowing partial reads to be
continued across multiple system calls more in the style of streaming
character device.

This means retaining a record on the per-pipe queue in a partially read
state, so maintain a current offset into the record.  Keep the record on
the queue during a read, so add a new lock, ap_sx, to serialize removal
of records from the queue by either read(2) or ioctl(2) requesting a pipe
flush.  Modify the kqueue handler to return bytes left in the current
record rather than simply the size of the current record.

It is now possible to use praudit, which used the standard FILE * buffer
sizes, to track much larger record sizes from /dev/auditpipe, such as
very long command lines to execve(2).

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-10-31 14:40:21 +00:00
Konstantin Belousov
17b9edd35a The code in linux_proc_exit() contains a race when multiple linux based
processes exits at the same time.  The linux_emuldata structure is freed
but p->p_emuldata is left as a dangling pointer to the just freed memory.

The check for W_EXIT in the loop scanning the child processes isn't safe
since the state of the child process can change right afterwards. Lock
the process and check the W_EXIT before delivering signal.

Submitted by:	tegge
Reviewed by:	davidxu
MFC after:	1 week
2008-10-31 10:38:30 +00:00
Konstantin Belousov
d1237d3f72 The file was inadvertently excluded from r184499. 2008-10-31 10:14:28 +00:00
Konstantin Belousov
f5dfdb519f Revert r184136. Instead, push the check for crashdumpmap overflow into the
MD i386 and amd64 dump code.

Requested by:	jhb
Retested by:	pho
MFC after:	3 days (+ 176304 + 184136)
2008-10-31 10:11:35 +00:00
Peter Wemm
7a9c4d2409 Add three extra to the kinfo_proc_vmmap data. kve_offset - the offset
within an object that a mapping refers to.  fileid and fsid are inode/dev
for vnodes.  (Linux procfs has these and valgrind is really unhappy
without them.)  I believe I didn't change the size of the struct.
2008-10-31 05:43:19 +00:00
Nathan Whitehorn
4d3800847a Modify our boot block to pick an output device, without which boot1 will fail
on G4 machines. On the assumption that most people using FreeBSD on Apple
hardware are not using serial consoles, set boot1's output to screen. This
should be revisited. While here, reduce verbosity of boot1.
2008-10-31 00:52:31 +00:00
Robert Watson
1daa6feb45 When we drop an audit record going to and audit pipe because the audit
pipe has overflowed, drop the newest, rather than oldest, record.  This
makes overflow drop behavior consistent with memory allocation failure
leading to drop, avoids touching the consumer end of the queue from a
producer, and lowers the CPU overhead of dropping a record by dropping
before memory allocation and copying.

Obtained from:	Apple, Inc.
MFC after:	2 months
2008-10-30 23:09:19 +00:00
Robert Watson
846f37f1e7 Break out single audit_pipe_mtx into two types of locks: a global rwlock
protecting the list of audit pipes, and a per-pipe mutex protecting the
queue.

Likewise, replace the single global condition variable used to signal
delivery of a record to one or more pipes, and add a per-pipe condition
variable to avoid spurious wakeups when event subscriptions differ
across multiple pipes.

This slightly increases the cost of delivering to audit pipes, but should
reduce lock contention in the presence of multiple readers as only the
per-pipe lock is required to read from a pipe, as well as avoid
overheading when different pipes are used in different ways.

MFC after:	2 months
Sponsored by:	Apple, Inc.
2008-10-30 21:58:39 +00:00
Maxim Sobolev
b0606bd11a Make it possible to compile kernel with KTR but without DDB. 2008-10-30 21:48:28 +00:00
Maxim Sobolev
b5f9b5b875 Fix compilation in the case when kernel doesn't have KDB ebabled.
subr_kdb.c still references breakpoint() in this case.
2008-10-30 21:02:00 +00:00
Alexander Motin
9fccea878a Add quirk to set GPIO2 to enable internal speaker on Dell Vostro 1400.
Tested by:	Sergio Veloso
2008-10-30 17:54:20 +00:00
Robert Watson
c211285f25 Protect the event->class lookup database using an rwlock instead of a
mutex, as it's rarely changed but frequently accessed read-only from
multiple threads, so a potentially significant source of contention.

MFC after:	1 month
Sponsored by:	Apple, Inc.
2008-10-30 17:47:57 +00:00
Sam Leffler
d6f57961a8 Fix checks for fast frames negotiation. ni_ath_flags holds the
capabilities reported by the ap.  These need to be cross-checked
against the local configuration in the vap.  Previously we were
only checking the ap capabilities which meant that if an ap reported
it was ff-capable but we were not setup to use them we'd try to do
ff aggregation and drop the frame.

There are a number of problems to be fixed here but applying this
fix immediately as the problem causes all traffic to stop (and has
not workaround).

Reported by:	Ashish Shukla
2008-10-30 16:22:04 +00:00
Doug Rabson
bfd50e2732 Don't hang if encrypting/decrypting using struct iovecs where one of the
iovecs ends on a crypto block boundary.
2008-10-30 16:11:07 +00:00
Nathan Whitehorn
014186973a Fix some possible infinite loops in the ADB code, and remove some hacks
that were inserted in desperation during bring-up. In addition, move ADB bus
enumeration and child attachment to when interrupts are available.
2008-10-30 15:27:13 +00:00
Robert Watson
a1b9471a47 The V* flags passed using an accmode_t to the access() and open()
access control checks in mac_bsdextended are not in the same
namespace as the MBI_ flags used in ugidfw policies, so add an
explicit conversion routine to get from one to the other.

Obtained from:	TrustedBSD Project
2008-10-30 10:13:53 +00:00
Nick Hibma
2726c918a7 We need to print out the device info ourselves on FBSD 6.
Submitted by:	Thomas Nystrom
2008-10-30 08:32:18 +00:00
Nick Hibma
72963ee0de Bugfix: Check the error code for in progress as well, after starting the
transfer.

Some changes to improve the debugging experience.
2008-10-30 08:17:27 +00:00
Nick Hibma
7a82770108 Return USBD_NORMAL_COMPLETION instead of a hard coded 0. 2008-10-30 08:13:49 +00:00
Marcel Moolenaar
636f2ebf67 Add support for little-endian compilations to this file. 2008-10-30 03:31:33 +00:00
Alexander Motin
3a4a255741 Allow card reader bridge driver to report maximum supported transfer size.
sdhci supports up to 65535 blocks transfers, at91_mci - one block.

Enable multiblock operations disabled before to follow at91_mci driver
limitations.

Reviewed by:	imp@
2008-10-29 20:01:26 +00:00
Ivan Voras
07095abf5d Introduce a new sysctl, kern.sched.topology_spec, that returns an XML
dump of detected ULE CPU topology. This dump can be used to check the
topology detection and for general system information.

An example of CPU topology dump is:
kern.sched.topology_spec: <groups>
 <group level="1" cache-level="0">
   <cpu count="8" mask="0xff">0, 1, 2, 3, 4, 5, 6, 7</cpu>
   <flags></flags>
   <children>
     <group level="2" cache-level="0">
       <cpu count="4" mask="0xf">0, 1, 2, 3</cpu>
       <flags></flags>
     </group>
     <group level="2" cache-level="0">
       <cpu count="4" mask="0xf0">4, 5, 6, 7</cpu>
       <flags></flags>
     </group>
   </children>
 </group>
</groups>

Reviewed by:	jeff
Approved by:	gnn (mentor)
2008-10-29 13:36:23 +00:00
David Xu
94ec9c0245 If threads limit is exceeded, increase the totoal number
of failures.
2008-10-29 12:11:48 +00:00
Bjoern A. Zeeb
96ceb14462 Comment out #define turning on debugging which went in with r184436 and
which is also in conf/NOTES and thus defined twice when building LINT.
2008-10-29 11:03:15 +00:00
Nick Hibma
f0a54b4813 Add the device ID for the mass storage device that appears before the
modem appears to facilitate faster switching to modem mode.
2008-10-29 08:08:55 +00:00
Nathan Whitehorn
360bf6787a DBDMA can transfer a maximum of 64K - 1 bytes per descriptor, as the byte
count field is 16 bits. Inform ATA of this fact.

Reported by:	Marco Trillo
2008-10-28 22:09:30 +00:00
Marius Strobl
b08a33129a - Turn off interrupts instead of only entering a critical section
while doing the block store workaround so we restore the correct
  floating-point registers state in case of nested floating-point
  operations resulting from nested interrupts. This allows the
  VIS-based block copy/zero functions to be used on machines
  requiring this workaround. Alternatively, we could take care of
  saving the floating-point registers here, which would be more
  inefficiently though and also involves turning off interrupts.
- It turns out that the SCZ_PCI_DMA_SYNC register doesn't work
  like the TOMXMS_PCI_DMA_SYNC_PEND one (but more like the
  corresponding register in of Hummingbird and Sabre bridges)
  and writing the INO of the respective device to it causes a
  Safari bus error. However, due to the Schizo errata I-23,
  SCZ_PCI_DMA_SYNC can't be used as intended either, so remove
  consistent DMA syncing for Schzio bridges for now, which means
  that add-on cards with non-"sun4u compliant" (whatever that
  means exactly) PCI-PCI-bridges should be avoided until the
  proper workaround is implemented. [1]

Reported by:	Michael Moll [1]
2008-10-28 22:05:20 +00:00
Edward Tomasz Napierala
013098c874 Rename a variable missed in previous accmode_t-related commits.
Approved by:	rwatson (mentor)
2008-10-28 21:58:48 +00:00
Edward Tomasz Napierala
178da2a90e Commit part of accmode_t changes that I missed in previous commit.
Approved by:	rwatson (mentor)
2008-10-28 21:57:32 +00:00
Robert Watson
564f8f0fee Break out strictly credential-related portions of mac_process.c into a
new file, mac_cred.c.

Obtained from:	TrustedBSD Project
2008-10-28 21:53:10 +00:00
Edward Tomasz Napierala
5031ddc46c Bump __FreeBSD_version after accmode_t introduction.
Approved by:	rwatson (mentor)
2008-10-28 19:48:58 +00:00
Oleg Bulyzhin
02d09f7901 Type of q_time (start of queue idle time) has changed: uint32_t -> uint64_t.
This should fix q_time overflow, which happens after 2^32/(86400*hz) days of
uptime (~50days for hz = 1000).
q_time overflow cause following:
- traffic shaping may not work in 'fast' mode (not enabled by default).
- incorrect average queue length calculation in RED/GRED algorithm.

NB: due to ABI change this change is not applicable to stable.

PR:		kern/128401
2008-10-28 14:14:57 +00:00
Edward Tomasz Napierala
15bc6b2bd8 Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary
to add more V* constants, and the variables changed by this patch were often
being assigned to mode_t variables, which is 16 bit.

Approved by:	rwatson (mentor)
2008-10-28 13:44:11 +00:00
Robert Watson
9215889d21 Rename mac_cred_mmapped_drop_perms(), which revokes access to virtual
memory mappings when the MAC label on a process changes, to
mac_proc_vm_revoke(),

It now also acquires its own credential reference directly from the
affected process rather than accepting one passed by the the caller,
simplifying the API and consumer code.

Obtained from:	TrustedBSD Project
2008-10-28 12:49:07 +00:00
Konstantin Belousov
7cd5a03a8e Style return statements in vn_pollrecord(). 2008-10-28 12:22:33 +00:00
Konstantin Belousov
3a8540afa5 Garbage-collect ext2_kqfilter vop that is now a copy of vop_stdkqfilter(). 2008-10-28 12:15:11 +00:00
Konstantin Belousov
ae53539e21 Protect check for v_pollinfo == NULL and assignment of the newly allocated
vpollinfo with vnode interlock. Fully initialize vpollinfo before putting
pointer to it into vp->v_pollinfo.

Discussed with:	dwhite
Tested by:	pho
MFC after:	1 week
2008-10-28 12:08:36 +00:00
Konstantin Belousov
5400fa16b4 Provide an explanation for getinoquota() call in the ufs_access vop.
MFC after:	3 days
2008-10-28 12:00:28 +00:00
Robert Watson
212ab0cfb3 Rename three MAC entry points from _proc_ to _cred_ to reflect the fact
that they operate directly on credentials: mac_proc_create_swapper(),
mac_proc_create_init(), and mac_proc_associate_nfsd().  Update policies.

Obtained from:	TrustedBSD Project
2008-10-28 11:33:06 +00:00
Bjoern A. Zeeb
31b5bf894f Unbreak LINT from r184381 using the correct variable in debugging
DPRINTF for the device and remove dead code.
2008-10-28 09:45:07 +00:00
Robert Watson
048e2d5899 Extended comment on why we consider a partition relabel request of "0" to
be a no-op request, and why this might have to change if we want to allow
leaving a partition someday.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2008-10-28 09:16:34 +00:00
Robert Watson
6c6c03be2d Rename label_on_label() to partition_check(), which is far more
suggestive as to its actual function.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2008-10-28 09:12:13 +00:00
Robert Watson
5077415a10 Improve alphabetical sort order of stub entry points. 2008-10-28 08:50:09 +00:00
Warner Losh
0c3d9d1f6b style(9) nit: remove unnecessary {} pair. 2008-10-28 04:32:41 +00:00
Peter Wemm
1d387fe73b After a machine has been up for a bit more than 20 days with HZ=1000,
"ticks" goes negative.  This breaks the signed comparison in softclock.
This causes sleep() to never wake up, tcp to stop, etc etc.  This is
bad(TM).  Use the SEQ_LT() method from tcp's sequence number comparisons.
2008-10-28 03:26:25 +00:00
Nathan Whitehorn
4a8c139140 Clean up some magic numbers in the DBDMA code by replacing them with
appropriately defined constants.

Suggested by:	gnn
2008-10-27 23:11:14 +00:00
Nick Hibma
b6d213aee8 Grab Sierra and Novatel init functions from NetBSD version of the u3g
driver (rev 1.3), by Joerg Sonnenberger.

Note: This change is untested as I do not own the hardware. Let me know
if things work or do not work for you by sending me the output dmesg (and
usbctl -f /dev/usbX if possible). Thanks.
2008-10-27 22:44:22 +00:00
Marius Strobl
a8376f70e7 Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.
This was prodded by mav and is based on a suggestion and a
patch submitted by jhb.

Reviewed by:	jhb
MFC after:	2 months
2008-10-27 22:10:01 +00:00
Maxim Sobolev
f06b09959d Fix r184323 - set stathz to be the same as lapic_timer_hz when lapic_timer_hz
is less than 128. Remove extra {} to match existing style.
2008-10-27 21:45:18 +00:00
John Baldwin
a48ac38144 - Whitespace fix for vop_poll.
- Use the right label for vop_vptofh lock assertions so they are enforced.
2008-10-27 21:41:55 +00:00
Marius Strobl
c2526b097f - In GCC 4.2 __builtin_frame_address() was fixed to include the
V9 stack bias so we no longer need to add it in db_backtrace()
  and stack_capture() respectively. This also reverts r182018,
  which kludged around the resulting unaligned access.
- Sync the sun4v versions of db_trace.c and stack_machdep.c with
  the sparc64 ones and fix some style bugs.

MFC after:	3 days
2008-10-27 21:31:14 +00:00
Robert Noland
f3dcc5387b Fix error in busmaster enable logic
rs400/rs480 should clear the RADEON_BUS_MASTER_DIS bit.  This should get
the rs485 IGP chips going again.

Approved by:	jhb (mentor)
Obtained from:	drm git master
2008-10-27 21:24:34 +00:00
Robert Noland
38cbf617d3 Fix some fallout from the busmaster disable cleanup
rs400 is just like rs480

Approved by:	jhb (mentor)
Obtained from:	drm git
2008-10-27 21:21:36 +00:00
Robert Noland
c85e91464a Don't report GEM capability until we actually have GEM support.
This was causing the newer Intel video drivers to fail and abort X.

Approved by:	jhb (mentor)
2008-10-27 21:16:07 +00:00
Maxim Sobolev
a3f027fa56 Fix r184323 - set stathz to be the same as lapic_timer_hz when lapic_timer_hz
is less than 128. Remove extra {} to match existing style.
2008-10-27 21:06:16 +00:00
Sam Leffler
411373ebc6 prepare for a new hal 2008-10-27 18:30:33 +00:00
Sam Leffler
46d4d74c94 o With the addition of HT rates the set of h/w codes has a much wider range
making the use of sc_hwmap to do direct mapping impractical.  Switch to
  indexing by the rate index instead of the rate code and adjust associated
  state and logic appropriately.  This has several benefits including
  simplification of the led code.
o fix radiotap capture of HT rates
o fix conditional compilation of HT radiotap support to be based on the
  hal having 5416 support; not the ABI version as hal builds may or may
  not include 5416 support
2008-10-27 18:22:44 +00:00
Robert Watson
168a6ae7a7 When the mac_bsdextended policy is unloaded, free rule memory.
Obtained from:	TrustedBSD Project
MFC after:	3 days
2008-10-27 18:08:12 +00:00
Sam Leffler
26041a143b prefer #define to naked constant 2008-10-27 18:05:26 +00:00
Sam Leffler
180f268d4d fix handling of HT rates; these overlap legacy rates and need to be
marked as MCS in the inverse mapping table
2008-10-27 18:02:47 +00:00
Sam Leffler
dd2a574e16 add hack to deal with Ubiquiti XR9 cards, they have a different mapping
between 900MHz and 2.4GHz frequencies than SR9 cards; they are distinguished
by different country codes
2008-10-27 18:00:43 +00:00
Bjoern A. Zeeb
d90e0bbe81 Add the files missed with r184331 to make mac_bsdextended compile again. 2008-10-27 17:57:03 +00:00
Sam Leffler
7b916f8948 install bssid for ahdemo mode too 2008-10-27 17:54:17 +00:00
Sam Leffler
5d61b5e8f0 fix comment 2008-10-27 17:53:34 +00:00
Sam Leffler
74eca0c26f correct callback status parameter; only indicate success when an ACK was
received
2008-10-27 17:52:41 +00:00
Sam Leffler
84784be1ae Fixup statistics:
o update tx rssi data only when an ACK was received
o return tx rssi from sampled data instead of the last frame
o track noise floor
o return rx rssi and noise floor (was broken)
2008-10-27 17:51:24 +00:00
Sam Leffler
ad80c0aa34 update the sta inactivity timer only if we actually received an ACK 2008-10-27 17:43:23 +00:00
Sam Leffler
96abcb94d7 Regdomain fixups:
o pass country code, outdoor indication, and ecm mode into the hal
  when requesting a channel list
o add a console msg when regulatory setup fails
o add placeholder code to map between Atheros sku's and 802.11 sku's
  that handles only the debug country code used to unlock the full
  channel list (to be used only for debugging)
o fix multiple instances of mismapping the 802.11 location to the
  outdoor indication (anywhere may be outdoor also)
2008-10-27 17:41:32 +00:00
Sam Leffler
033022a93b add regdomain debug msgs 2008-10-27 17:35:09 +00:00
Sam Leffler
577eaa6032 add sys.dev.ath.X.intmit knob to enable/disable ANI
(the intmit name is historical)
2008-10-27 17:22:46 +00:00
Sam Leffler
3297be131d shuffle debug setup to simplify debugging events during attach 2008-10-27 17:19:39 +00:00
Sam Leffler
80c07f2369 rename bf_flags to bf_txflags in preparation for the addition of flags
separate from the tx descriptor flags currently recorded
2008-10-27 17:16:46 +00:00
Sam Leffler
47db982fc9 use the ic's opmode instead of our hal equivalent to check for adhoc mode;
they are always the same
2008-10-27 17:14:39 +00:00
Sam Leffler
4b54a23144 intercept IEEE80211_IOC_TXPOWER and service tx power changes immediately 2008-10-27 17:12:41 +00:00
Sam Leffler
ec9ee5e727 move complaints about bad rate codes up a level so we can print
the h/w rate code and other useful info
2008-10-27 17:10:21 +00:00
Sam Leffler
c62362cbec remove driver-private equivalent of ni_txparms; it's now superfluous 2008-10-27 17:03:24 +00:00
Sam Leffler
1eb911a5cc now that the new association callback is used when joining a bss we can
eliminate the ath_rate_newassoc callback and associated code
2008-10-27 16:58:06 +00:00
Sam Leffler
e66b0905fc o use the new association callback to notify the driver when joining a bss
in sta and adhoc modes; this should've been done forever ago as most all
  drivers use this hook to set per-station transmit parameters such as for
  tx rate control
o adjust drivers to remove explicit calls to the driver newassoc method
2008-10-27 16:46:50 +00:00
Randall Stewart
73adc48f49 More issues with pre-blocking:
a) Need for EEOR mode to take the min of the socket buffer size and the
    add more threshold, otherwise if you are so silly as to set a send
    buf size less than the add-more you could block forever in eeor mode.

 b) We were incorrectly using the sysctl vs the calculated value. This
    causes us to block forever if the addmore theshold is larger than
    then the socket buffer size.
2008-10-27 14:49:12 +00:00
Randall Stewart
35e4161b1f Two inter-related bugs.
- If we send EXACTLY the size left in the send buffer
    and then send again, we end up with exactly 0 bytes and
    don't hit the pre-block code to wait for more space.
  - If we fall into the loop with our max_len == 0 (the bug
    above) we then call in to copy out the data, setup the length
    of the waiting to transmit data to 0 and call the mbuf copy routine
    which 0 indicates copy all the data to the mbuf chain.. which it
    does. This then leaves a "stuck" message on the stream queue with
    its size exactly 0 bytes but all the data there and thus nothing
    left in the uio structure. We then reach a stuck forever state
    never being able to send data.
2008-10-27 14:01:23 +00:00
Randall Stewart
a4c651183e Get rid of ifdef for vimage on version 8 comparison. Now the
scrubbing program properly takes care of this.
2008-10-27 13:54:54 +00:00
Randall Stewart
83416c885d Invariants changes that make more sense. 2008-10-27 13:53:31 +00:00
Robert Watson
0ee8da47fb Add TrustedBSD credit to new ugidfw_internal.h file. 2008-10-27 12:12:23 +00:00
Robert Watson
34f6230e25 Break mac_bsdextended.c out into multiple .c files, with the base access
control logic and policy registration remaining in that file, and access
control checks broken out into other files by class of check.

Obtained from:	TrustedBSD Project
2008-10-27 12:09:15 +00:00
Robert Watson
4074f67f5b Copy mac_bsdextended.c to two object-specific files as a prototype for how
modularize MAC policy layout.

Obtained from:	TrustedBSD Project
2008-10-27 11:46:19 +00:00
Ed Schouten
c8978106d0 Remove unused consdev structure fields.
The cn_unit and cn_tp fields don't seem to be used anywhere. Some
drivers set them, while others don't. Just remove them, in an attempt to
make our consdev code a little easier to understand.
2008-10-27 11:45:31 +00:00
Søren Schmidt
2e9f7f6840 Only call dma.unload() if initialized.
Reported by: Stanislav Sedov
2008-10-27 09:26:24 +00:00
KATO Takenori
11df23b530 Improved IDE HDD geometry adjustment. Previous code didn't work with
certain ATA-6 drives including CF cards.

The IDE geometry of the PC98 is calculated from the drive capacity.
In addition to the algorithm in NEC BIOS, a variety of algorithms are
provided by 3'rd party boards and BIOS hacks.  This change has
implemented the three algorithms: IDE BIOS compatible mode, SCSI BIOS
compatible mode and same way as the previous version.  The tunable
machdep.ad_geom_method selects the algorithm.

I have been using this change for a year with CF cards.

Reminded by: nyan
2008-10-27 08:40:13 +00:00
Maxim Sobolev
4da059f304 vm_pnames should be "const char *const[]".
Submitted by:	Christoph Mallon
2008-10-27 08:09:05 +00:00
Maxim Sobolev
fa38c35148 vm_pnames has no reason to be global.
MFC after:	2 weeks
2008-10-27 06:34:41 +00:00
Maxim Sobolev
7f03c419bc Default HZ value (1,000) on i386/amd64 is not very virtual machine friendly.
Due to the nature of the beast it causes lot of unproductive overhead. This
is especially bad when running SMP kernel on VMWare with several virtual
processors - idle FreeBSD guest with SMP kernel takes 150% host CPU time on my
dual-core MacBook Pro when I am enabling two virtual CPUs, making even host
not very usable. Detect when we are running in the sandbox and reduce HZ
to 10 (can be adjusted via VM_HZ in the kernel config) in such cases. This
brings host CPU usage of idle FreeBSD/SMP on two virtual processors down
to 10%.

Detect most popular VM platforms out there - VMWare, Parallels, VirtualBox
and VirtualPC.

MFC after:	2 weeks
2008-10-27 06:25:02 +00:00
Marcel Moolenaar
dc9d16844c Add support for kernel profiling for both AIM and BookE.
Obtained from:	Juniper Networks, Inc (BookE support).
2008-10-27 02:36:03 +00:00
Marcel Moolenaar
1463295f81 Remove unused declarations (interrupt_vector_{base|top}). 2008-10-27 01:51:30 +00:00
Marcel Moolenaar
11722a8c11 Declare btext and etext. Needed by sys/kern/subr_prof.c for
for kernel profiling.
2008-10-27 00:26:07 +00:00
Nathan Whitehorn
e865720075 Bring Kauai ATA driver in line with Macio ATA by reading the PIO config reg
to set the initial PIO mode instead of assuming PIO4. There are still a few
nagging issues:

- There are some problems with 64 K DMA transfers waiting on lower level
changes.

- ATAPI DMA is broken on Marcel's Mac Mini because we need an ATA SELECT hook
propagated up to individual drivers for hardware without timing registers for
each ATA channel.
2008-10-27 00:09:14 +00:00
Stanislav Sedov
e06d0e0a92 - Add stream bus_space operations.
Reviewed by:	cognet
Approved by:	kib (mentor, implicit)
MFC after:	1 week
2008-10-26 22:53:59 +00:00
Stanislav Sedov
baf7d37113 - Add a missing NULL-pointer check.
Reviewed by:	cognet
Approved by:	kib (mentor, implicit)
MFC after:	3 days
2008-10-26 22:52:57 +00:00
Robert Watson
048e1287fa Implement MAC policy support for IPv6 fragment reassembly queues,
modeled on IPv4 fragment reassembly queue support.

Obtained from:	TrustedBSD Project
2008-10-26 22:46:37 +00:00
Robert Watson
4b908c8bb4 Add a MAC label, MAC Framework, and MAC policy entry points for IPv6
fragment reassembly queues.

This allows policies to label reassembly queues, perform access
control checks when matching fragments to a queue, update a queue
label when fragments are matched, and label the resulting
reassembled datagram.

Obtained from:	TrustedBSD Project
2008-10-26 22:45:18 +00:00
Robert Watson
dd8ac7f990 In both dropwithreset paths in tcp_input.c, drop the tcbinfo lock
sooner to decomplicate locking and eliminate the need for a rather
chatty comment about why we have to handle the global lock in a
special way for the benefit of ipfw and pf cred rules.

MFC after:	3 days
2008-10-26 22:03:52 +00:00
Sam Leffler
5d44f8c024 o re-enable a lock assert
o while here reformat a comment to sync w/ other repot's
2008-10-26 21:59:07 +00:00
Sam Leffler
8f4addc0a8 Fix joining an 11b BSS: scanning is normally done using 11g channels
(unless explicitly locked to mode 11b) so when we join the bss the
channel attached to the scan cache entry may need to be demoted.

o demote to 11b if the ap is advertising 11b rates
o skip the ap if it's 11b but we're locked to 11g (could consider this
  advisory but for now treat it as mandatory)
o handle an odd edge case, if there is a fixed transmit rate for 11g
  then the rate check against the 11b ap will fail, try to demote to
  11b and retry the rate check

Reviewed by:	sephe, thompsa
2008-10-26 21:56:27 +00:00
Nathan Whitehorn
b4dbc59983 Add ADB support. This provides support for the external ADB bus on the PowerMac
G3 as well as the internal ADB keyboard and mice in PowerBooks and iBooks. This
also brings in Mac GPIO support, for which we should eventually have a better
interface.

Obtained from:  NetBSD (CUDA and PMU drivers)
2008-10-26 19:37:38 +00:00
Robert Watson
4c95fd23d6 Remove endearing but syntactically unnecessary "return;" statements
directly before the final closeing brackets of some TCP functions.

MFC after:	3 days
2008-10-26 19:33:22 +00:00
Bjoern A. Zeeb
460473a071 Style changes only:
- Consistently add parentheses to return statements.
 - Use NULL instead of 0 when comparing pointers, also avoiding
   unnecessary casts.
 - Do not use pointers as booleans.

Reviewed by:	rwatson (earlier version)
MFC after:	2 months
2008-10-26 19:17:25 +00:00
Maxim Sobolev
b7865f7912 Fix division by zero panic if kern.hz less than 32.
MFC after:	1 day
2008-10-26 18:58:04 +00:00
Ulf Lilleengen
86b3c6f5bc - Import macros used in gmirror for printing gvinum debug messages and making
the output more standardized.
- Add a sysctl to set the verbosity of the debug messages.
- While there, fixup typos and wording in the messages.
2008-10-26 17:20:37 +00:00
Sam Leffler
63092fce49 New ap-side power save implementation; the main change is to allow drivers
to queue frames previously encapsulated on a separate high priority list
that is dispatched before the unencapsulated frames (to preserve order).
2008-10-26 01:04:46 +00:00
Sam Leffler
99f1b25c9f move decl up before first use 2008-10-26 01:01:01 +00:00
Sam Leffler
c1af44bdac introduce M_ENCAP flag to mark packets encapsulated w/ an 802.11 header 2008-10-26 00:55:38 +00:00
Sam Leffler
0e66722d20 fix comment that belonged w/ previous commit 2008-10-26 00:52:26 +00:00
Sam Leffler
16d7cbb108 change ieee80211_send_probereq to supply raw xmit parameters so it can
control how frames are handled by the driver
2008-10-26 00:48:20 +00:00
Sam Leffler
6683931e81 change ieee80211_send_nulldata to send a QoS Null Data frame to a
QoS-enabled station; this makes inactivity handling follow the spec
as previously it would probe inactive stations w/ a Null Data (no QoS)
data frame
2008-10-26 00:46:17 +00:00
Sam Leffler
8ac160cd2e o change ieee80211_mgmt_output to take a raw xmit parameters block so
the net80211 layer has complete control over the handling of mgt frames
  (in particular, the ac, tx rate, and retry count); this also allows us
  to purge the M_LINK0 flag that was attached to mbufs to mark them as
  needing encryption for shared key auth
o change ieee80211_send_setup to take a tid parameter so it can be used
  to setup QoS frames
2008-10-26 00:43:11 +00:00
Sam Leffler
380b865a0d fix old merge botch that causes gaps in the tx seq# space for QoS frames 2008-10-26 00:32:02 +00:00
Sam Leffler
cc71a422ea Sync BAR frame handling with out of tree work:
o correct BAR frame construction for AMPDU
o retransmit BAR frames until ACK'd or timeout (use tunables to
  control behaviour, default is very aggressive)
o defer seq# update until BAR frame is ACK'd
o add BAR response handling callback for driver to interpose and
  push new state to device or push pending aggregates

While here also:
o add backpointer to node in the per-tid tx aggregation data structure
o move ampdu tx state setup/teardown work to separate functions
2008-10-25 23:58:59 +00:00
Sam Leffler
dfcd1f4d0e set erp flag and tx parameter state when joining a bss; this allows
drivers to use ni_txparms
2008-10-25 23:44:25 +00:00
Sam Leffler
ae3f00bbfd honor IEEE80211_CLONE_NOBEACONS for type of vap, not just a sta mode vap 2008-10-25 23:43:08 +00:00
Sam Leffler
be1054ed14 improve inactivity handling debug support 2008-10-25 23:40:48 +00:00
Sam Leffler
52ef06dcfe use a private mgt frame recv handler for ahdemo mode instead of an inline
test in the adhoc mode rx path so classes derived from ahdemo mode can
override the default behaviour
2008-10-25 23:40:29 +00:00
Sam Leffler
887acaadec expand captured ie's before calling match_bss so they can potentially
be used in the process
2008-10-25 23:39:18 +00:00
Sam Leffler
1095925656 change ieee80211_sta_join to take an explicit channel instead of
using the value in the scan parameters; this will be used to fix
issues with 11b operation
2008-10-25 23:32:24 +00:00
Sam Leffler
f945bd7aa9 o add support for ifconfig wlanX mode foo
o yank useless code for setting fixed rate through media opts: this
  mechanism didn't scale to HT rates and couldn't handle multiple bands;
  fixed tx rates are set with the IEEE80211_IOC_TXPARAMS ioctl
2008-10-25 23:31:20 +00:00
Sam Leffler
fad0f46d20 add debug msgs 2008-10-25 23:28:24 +00:00
Sam Leffler
6ff2e10a56 fix associd check for adhoc mode
Reviewed by:	jhay
2008-10-25 23:28:04 +00:00
Sam Leffler
643024a2b1 ignore IEEE80211_ELEMID_PWRCNSTR when parsing beacon/probe response frames
to avoid counting it as an unknown elemid (we often beacon this so it shows
up as a "false positive")
2008-10-25 23:26:57 +00:00
Sam Leffler
d1abf1f411 add 1/2 and 1/4 channel flags to IEEE80211_CHAN_ALL so that operations
like ieee80211_find_channel are more useful
2008-10-25 23:24:49 +00:00
Sam Leffler
07760642a6 add/improve debug msgs 2008-10-25 23:23:41 +00:00
Kip Macy
e67fc8f258 only call hardclock on cpu0
pointed out by: Scott Long
2008-10-25 20:42:10 +00:00
Marcel Moolenaar
38a2db2eb0 Invalid BSD disklabels have been created by sysinstall and
are possibly still being created. The d_secperunit field
contains the number of sectors of the disk and not of the
slice/partition to which the disklabel applies.
Rather than reject the disklabel, we now silently adjust
the field. Existing code, like bslabel(8), does not seem
to check the label that extensively and seems to adjust
fields as a side-effect as well.
In other words, it's not that important apparently, so
gpart should not be too strict about it.

Reported by: nyan@
Reported by: Andriy Gapon <avg@icyb.net.ua>
2008-10-25 17:21:46 +00:00
Robert Noland
bee8d4f213 drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.

It only affects the Intel G33 series and newer.

Approved by:	bz (secteam)
Obtained from:	Intel drm repo
Security:	CVE-2008-3831
2008-10-25 16:29:28 +00:00
Dag-Erling Smørgrav
0db885bbaf Add an entry for the "SIIG Cyber 4 PCI 16550", which is a four-port card
based on the OX16PCI954 chip with a non-standard clock.

MFC after:	3 days
2008-10-25 10:55:49 +00:00
Alexander Motin
6b3a1c6a08 Fix spelling in comment. 2008-10-25 08:31:20 +00:00
Pyun YongHyeon
d2cd226334 Use auto-negotiation for manual media type selection. This fixes
establishment of 10/100Mbps link on Atheros AR8121(L1E).
2008-10-25 06:39:17 +00:00
Marcel Moolenaar
e5637f19bd Enable the cfi(4) driver. 2008-10-25 06:25:15 +00:00
Marcel Moolenaar
e00251b7ed Add a driver for flash memory that implements to the Common Flash
Memory Interface (CFI). The flash memory can be read and written
to through /dev/cfi# and an ioctl() exists so processes can read
the query information.
The driver supports the AMD and Intel command set, though only
the AMD command has been tested.

Obtained from:	Juniper Networks, Inc.
2008-10-25 06:18:12 +00:00
Marcel Moolenaar
08077f589c Add a driver for the Local Bus Controller.
Obtained from:	Juniper Networks, Inc.
2008-10-25 06:03:40 +00:00
Marcel Moolenaar
bd616bc87e Assign 0xff800000-0xffffffff to the LBC controller. That's where
the NOR flash lives by default.
2008-10-25 05:57:36 +00:00
Kip Macy
951f87e4ae handle case where eflags represents actual flags value when
restoring interrupts
2008-10-25 04:46:02 +00:00
Pyun YongHyeon
0960e62f83 Implement miibus_statchg handler. It detects whether rl(4)
established a valid link or not.
In rl_start_locked, don't try to send packets unless we have valid
link. While I'm here add a check that verifies whether driver can
accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING
flag.
2008-10-25 03:41:36 +00:00
Marcel Moolenaar
9b85e175fd In mmu_booke_mapdev(), handle mappings that cannot be represented
by a single TLB entry. The boot ROM on the MPC85555CDS is 8MB, for
example, and in order to map that we need 2 4MB TLB entries.
2008-10-25 03:36:21 +00:00
Pyun YongHyeon
d27755a283 After sending stop command to MAC, give hardware chance to drain
active DMA operation.
2008-10-25 03:06:47 +00:00
Pyun YongHyeon
f1ffe9d785 Make rl_init_locked() call rl_reset. This will put hardware into
sane state after resume/watchdog timeouts.
2008-10-25 02:52:06 +00:00
Pyun YongHyeon
85e0a22e77 Don't rearm watchdog timer in rl_txeof(). The watchdog timer was
already set in rl_start_locked(). Touching the watchdog timer in
other places will hide the root cause of watchdog timeouts.
2008-10-25 02:41:11 +00:00
Pyun YongHyeon
05a8dc6dac Various bus_dma(9) fixes.
- The hardware does not support DAC so limit DMA address space to
   4GB.
 - Removed BUS_DMA_ALLOC_NOW flag.
 - Created separated Tx buffer and Rx buffer DMA tags. Previously
   it used to single DMA tag and it was not possible to specify
   different DMA restrictions.
 - Apply 4 bytes alignment limitation of Tx buffer.
 - Apply 8 bytes alignment limitation of Rx buffer.
 - Tx side bus_dmamap_load_mbuf_sg(9) support.
 - Preallocate Tx DMA maps as creating DMA maps take very long time
   on architectures that require real DMA maps.
 - Adjust guard buffer size to 1522 + 8 as it should include VLAN
   and additional reserved bytes in Rx buffer.
 - Plug memory leak in device detach. Previously wrong buffer
   address was used to free allocated memory.
 - Added rl_list_rx_init() to clear Rx buffer and cleared the
   buffer.
 - Don't destroy DMA maps in rl_txeof() as the DMA map should be
   reused. There is no reason to destroy/recreate the DMA maps in
   this driver.
 - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks.
 - The hardware does not support descriptor based DMA on Tx side
   and the Tx buffer address should be aligned on 4 bytes boundary
   as well as manual padding for short frames. Because of this
   hardware limitation rl(4) always used to invoke m_defrag(9) to
   get a 4 bytes aligned single buffer. However m_defrag(9) takes
   a lot of CPU cycles on slow machines and not all packets need
   the help of m_defrag(9). Armed with the information, don't
   invoke m_defrag(9) if the following conditions are true.
      1. Buffer is not fragmented.
      2. Buffer is aligned on 4 bytes boundary.
      3. Manual padding is not necessary.
      4. Or padding is necessary but upper stack passed a writable
         buffer and the space needed for padding is satisfied.
   This change combined with preallocated DMA maps greatly
   increased Tx performance of driver on sparc64.
 - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and
   corrected memory synchronization operation specifier of
   bus_dmamap_sync(9).
 - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to
   reload/unload Rx buffer as rl(4) always have to copy from the
   buffer. It just needs proper bus_dmamap_sync(9) calls before
   copying the received frame.

With this change rl(4) should work on systems with more than 4GB
memory.

PR:	kern/128143
2008-10-25 02:36:08 +00:00
Nick Hibma
fb48c74147 Make the driver compile on FBSD6 as well.
Up the speed on the E220 ID as it is a part which is used in other
devices that are capable of HSPA speeds.
2008-10-24 21:52:50 +00:00
Alexander Motin
fe16530885 Add MSI support.
Tested on:	Acer TravelMate 6292 with 0x4229 chip.
Reviewed by:	sam@
2008-10-24 21:21:43 +00:00
Alexander Motin
6f6487c338 Bump the revision after the latest commits. 2008-10-24 19:36:28 +00:00
Alexander Motin
e1a5654741 Add some special handeling for AD1981HD codec. It has very unusual design
with several points unappropriate for the present parser. This patch
disables input-to-output analog monitoring but instead fixes recording.

Tested by Tobias Grosser on ThinkPad T61p.
2008-10-24 19:29:07 +00:00
Doug Rabson
842832aeae Don't rely on the value of *statep without first taking the vnode interlock.
Reviewed by:	Mike Tancsa
MFC after:	2 weeks
2008-10-24 16:04:10 +00:00
Kip Macy
1f5aa99363 Fix general issues with IPI support 2008-10-24 07:58:38 +00:00
Kip Macy
965b65a466 Fix evtchn initialization on SMP 2008-10-24 07:57:48 +00:00
Nick Hibma
80ac287fe4 After adding U3G_DEBUG to LINT we need to create the opt_u3g.h file when
building the module.
2008-10-24 07:19:09 +00:00
Nick Hibma
fe75118b0f Add U3G_DEBUG to LINT 2008-10-24 07:16:13 +00:00
Nick Hibma
c781627992 Remove the entry from the i386 specific NOTES as it is in the generic
NOTES file as well. This avoids one of the warnings from

	make LINT && config LINT
2008-10-24 07:12:05 +00:00
Nick Hibma
bebda7fab3 - Bugfix: Only claim interface after having checked all endpoints. This
might make Qualcomm and Option cards (which have all endpoints in 1
  interface) work.
- Change the USB buffer sizes to depend on the transfer speed. With UMTS
  we use a buffer 384k / 1000 frames/sec * 50msecs =~ 15kB for example.
- Add a MODULE_VERSION statement
2008-10-24 07:08:42 +00:00
David Xu
300fa5ef6e Don't rearm callout if the process is exiting, it may leak a callout
because callout_drain() only waits for running callout, but not disable
it if it is rearmed.
2008-10-24 01:09:24 +00:00
David Xu
6406fd0be6 partly revert revision 184199, because TDF_NEEDSIGCHK is persitent
when thread is in kernel mode, it can cause dead loop, now unlock
process lock after acquired sleep queue lock and thread lock to
avoid the problem. This means TDF_NEEDSIGCHK and TDF_NEEDSUSPCHK must
be set with process lock and thread lock being hold at same time.
2008-10-24 01:03:31 +00:00
John Baldwin
6239752624 Whitespace fix. 2008-10-23 21:50:16 +00:00
Dag-Erling Smørgrav
e11e3f187d Fix a number of style issues in the MALLOC / FREE commit. I've tried to
be careful not to fix anything that was already broken; the NFSv4 code is
particularly bad in this respect.
2008-10-23 20:26:15 +00:00