Matt Jacob [Mon, 2 Jul 2007 20:08:20 +0000 (20:08 +0000)]
Recover from some major omissions/problems with the 24XX port.
First, we were never correctly checking for a 24XX Status Type 0
response- that cased us to fall through to evaluate status for
commands as if this were a 2100/2200/2300 Status Type 0 response.
This is *close*, but not quite the same. This has been reported
to be apparent with some wierd lun configuration problems with
some arrays. It became glaringly apparent on sparc64 where none
of the correct byte swap things were done.
Fixing this omission then caused a whole universe shifting debug
cycle of endian issues for the 2400. The manual for 24XX f/w turns
out to be wrong about the endianness of a couple of entities. The
lun and cdb fields for the type 7 request are *not* unconditionally
big endian- they happen to be opposite of whatever the endian of
the current machine type is. Same with the sense data for the
24XX type 0 response.
While we're at it investigate and resolve some NVRAM endian
issues.
Randall Stewart [Mon, 2 Jul 2007 19:22:22 +0000 (19:22 +0000)]
- Consolidate the code that free's chunks to actually also
call the sctp_free_remote_address() function.
- Assure that when we allocate a chunk the whoTo is NULL,
also when we free it and place it into the cache we NULL
it (that way the consolidation code will always work).
- Fix a small race, when a empty data holder is left on the stream
out queue, and both sides do a shutdown, the empty data holder
would prevent us from sending a SHUTDOWN-ACK and at the same time we
never would cleanup the empty holder (since nothing was ever in queue).
We now add a utility function that a) cleans up empty holders and
b) properly determines if there are still pending data chunks on
the stream out wheel.
Approved by: re@freebsd.org (Ken Smith)
Robert Watson [Mon, 2 Jul 2007 14:03:29 +0000 (14:03 +0000)]
Continue kernel privilege cleanup for 7.0: unstaticize suser_enabled and
stop declaring it in systm.h -- it's used only in kern_priv.c and is not
required elsewhere.
Randall Stewart [Mon, 2 Jul 2007 12:50:53 +0000 (12:50 +0000)]
- Add some needed error checking on bad fd passing in the sctp
syscalls.
Approved by: re@freebsd.org (Ken Smith)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
Randall Stewart [Mon, 2 Jul 2007 10:52:34 +0000 (10:52 +0000)]
- Removes some incorrect error returns (errno was being overriden in
one of the functions)
- Fixes the error return of sctp_get_opt, it was returning the errno not
-1.
Approved by: re@freebsd.org (Robert Watson)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
Alan Cox [Mon, 2 Jul 2007 06:56:37 +0000 (06:56 +0000)]
In the previous revision, when I replaced the unconditional acquisition
of Giant in vm_pageout_scan() with VFS_LOCK_GIANT(), I had to eliminate
the acquisition of the vnode interlock before releasing the vm object's
lock because the vnode interlock cannot be held when VFS_LOCK_GIANT() is
performed. Unfortunately, this allows the vnode to be recycled between
the release of the vm object's lock and the vget() on the vnode.
In this revision, I prevent the vnode from being recycled by acquiring
another reference to the vm object and underlying vnode before releasing
the vm object's lock.
This change also addresses another preexisting but trivial problem. By
acquiring another reference to the vm object, I also prevent the vm
object from being recycled. Previously, the "vnodes skipped" counter
could be wrong because if it examined a recycled vm object.
Add cpufreq(4) to GENERIC. It does not change the frequency by default,
so systems should be relatively unaffected. Users can then simply enable
powerd(8) in rc.conf to take advantage of it.
Robert Watson [Sun, 1 Jul 2007 20:51:30 +0000 (20:51 +0000)]
Remove two boot printfs generated by Audit to announce it's presence,
and replace with software-testable sysctl node (security.audit) that
can be used to detect kernel audit support.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
Ariff Abdullah [Sun, 1 Jul 2007 17:31:20 +0000 (17:31 +0000)]
- Fix input/microphone support for ASUS A8N-VMCSM series.
Submitted by: Simon Schubert <corecode@fs.ei.tum.de>
- Defer flushing unsolicited response into taskqueue thread rather
than handle it directly in interrupt handler, since few of its
operations (like measuring/calibrating jack impedance) are quite
expensive.
- Misc. debugging cleanups.
Tested by: joel
Approved by: re (hrs)
MFC after: 3 days
Ariff Abdullah [Sun, 1 Jul 2007 17:28:58 +0000 (17:28 +0000)]
Fix no-sound issues with ASUS A9T notebook.
Note: The offending quirk should have been made model/codec specific,
but since there were no records / log which model requires it, the quirk
logic had to be inverted (blacklist instead of whitelist).
Tested by: Arkadiy Dudevitch <dudevitch@englerllc.com>
Approved by: re (hrs)
MFC after: 3 days
Andrew Thompson [Sun, 1 Jul 2007 10:25:07 +0000 (10:25 +0000)]
Remove wicontrol(8) from the base system. Using wicontrol to configure an
interface has been deprecated since 5.1, wi(4) wireless interfaces are managed
via the net80211 stack and ifconfig.
Alan Cox [Sun, 1 Jul 2007 07:08:26 +0000 (07:08 +0000)]
Pages that do belong to an object and page queue can now be freed without
holding the page queues lock. Thus, the page table pages released by
pmap_remove() and pmap_remove_pages() can be freed after the page queues
lock is released.
Andrew Thompson [Sat, 30 Jun 2007 21:39:21 +0000 (21:39 +0000)]
Fix scanning issues since the new net80211 code went in
- provide dummy routines for ic_scan_curchan and ic_scan_mindwell, we do not support those operations.
- add ieee80211_scan_done() to tell the scanning module that all channels have been scanned.
- pass IEEE80211_S_SCAN state off to net80211 so it can initiate scanning
- fix overflow in the rates array
- scale the rate value passed back from the firmware scan to the units that net80211 uses.
Andrew Thompson [Sat, 30 Jun 2007 21:23:23 +0000 (21:23 +0000)]
Change the channel number in the scan results struct to be a pointer to the
operating channel and use this in the scan cache rather than directly using
ic_curchan. Some firmware cards can only do a full scan and so ic_curchan does
not have the correct value.
Also add IEEE80211_CHAN2IEEE to directly dereference ic_ieee from the channel
to be used in the fast path.
Reviewed by: sam, sephe
Approved by: re (kensmith)
Andrew Thompson [Sat, 30 Jun 2007 21:12:41 +0000 (21:12 +0000)]
Fix the channel reporting when the card is associated. The channel array used
to be index by IEEE channel number but that is no longer the case and it needs
to be searched for.
Submitted by: avatar
Reviewed by: sam
Approved by: re (kensmith)
Warner Losh [Sat, 30 Jun 2007 20:08:08 +0000 (20:08 +0000)]
Additional devices from NetBSD and OpenBSD. This includes devices not
yet supported by this driver. Support will be committed soon, or a
filter on all the 'newer' devices will be installed before the
release.
Colin Percival [Sat, 30 Jun 2007 19:48:28 +0000 (19:48 +0000)]
Add support for HTTP/1.0 Persistent Connections to phttpget. Requests are
be marked as HTTP/1.1 but "Connection: Keep-Alive" is added; this convinces
HTTP/1.0 servers and proxies to hold the TCP connection open despite not
being able to use HTTP pipelining.
This dramatically cuts down on the number of TCP connections (and thus port
numbers) used by portsnap when talking to an HTTP/1.0 proxy (e.g., squid),
and has the side benefit of improving performance in those cases.
Tested by: simon
Approved by: re (kensmith)
MFC After: 1 week
Nate Lawson [Sat, 30 Jun 2007 17:27:31 +0000 (17:27 +0000)]
My previous commit introduced a spurious warning for the case where a
switch (i.e. lid) is set to have an action of NONE. This is not an
invalid state, so silently return. This fixes the warning:
"acpi: request to enter state S6 failed (err 22)"
Warner Losh [Sat, 30 Jun 2007 02:50:57 +0000 (02:50 +0000)]
Expand the transform API to allow transports to return 'success' for
the command. Make UFI devices return 'success' when asked to do a
SYNC_CACHE. There's no support for write caching in the UFI spec, so
this is the most appropriate action to undertake.
The nxge driver provides support for Neterion Xframe-I and Xframe-II
adapters. The driver supports TCP Segmentation Offload (TSO/LSO),
Jumbo frames (5 buffer mode), Header separation (2 and 3 Receive
buffer modes), VLAN, and Promiscuous mode.
Submitted by: Neterion
Reviewed by: rwatson
Approved by: re (kensmith)
Warner Losh [Fri, 29 Jun 2007 21:07:41 +0000 (21:07 +0000)]
Add support for various MS Wirless usb mice. the patch is from
Hellmuth with some refinements by myself and flz@. It works for me
with my non-MS mice, so nothing should be broken by it.
Submitted by: Hellmuth Michaelis
PR: 90162
Approved by: re (blanket)
Warner Losh [Fri, 29 Jun 2007 20:34:42 +0000 (20:34 +0000)]
Change uhub to dynamic status size for status change endpoint. From a
pr, the submitter says:
Found this while running freebsd as guest in qemu with -usb
parameter. The patch implements the missing dynamic size based on
number of ports a hub has.
Randall Stewart [Fri, 29 Jun 2007 15:14:23 +0000 (15:14 +0000)]
- When a SCTP socket is closed, but the last data
SACK is lost, we would incorrectly abort the association
instead of retransmitting the SACK.
Approved by: re@freebsd.org (Ken Smith)
Xin LI [Fri, 29 Jun 2007 05:23:15 +0000 (05:23 +0000)]
MFp4:
- Remove unnecessary NULL checks after M_WAITOK allocations.
- Use VOP_ACCESS instead of hand-rolled suser_cred()
calls. [1]
- Use malloc(9) KPI to allocate memory for string. The
optimization taken from NetBSD is not valid for FreeBSD
because our malloc(9) already act that way. [2]
Requested by: rwatson [1]
Submitted by: Howard Su [2]
Approved by: re (tmpfs blanket)
Robert Watson [Thu, 28 Jun 2007 12:54:58 +0000 (12:54 +0000)]
Mark wire data structures in netatalk as __packed so that they are
properly (un)padded on the arm platform. With this change, FreeBSD/arm
boxes are able to route AppleTalk properly.
Submitted/tested by: Nathan Whitehorn <nathanw at uchicago dot edu>
Tested on: arm, i386, amd64
Approved by: re (kensmith)
Back out gcc workaround per re@ request. Details:
"There seems to be some continuing discussion about how this is best fixed,
and we'd like to get Alexander (as our gcc guru) to opine on a final
solution before picking one. In the mean time, could you back out the
original commit (sys.mk:1.89)?"
Warner Losh [Thu, 28 Jun 2007 06:22:40 +0000 (06:22 +0000)]
The timeout is in milliseconds, not in hz. Only the portion of the
patch that converts ms to ticks was used. Another PR states that a
return code of 0 is the right one for libusb.
Submitted by: Lonnie Mendez
PR: 94311
Approved by: re (blanket)
Warner Losh [Thu, 28 Jun 2007 05:50:14 +0000 (05:50 +0000)]
With the advent of G3/CDMA modems, the old buffer sizes are no longer
adequate. Increase them to 1k. The referenced PR made this a sysctl,
but that seems like overkill to me. The difference between 320 and
2048 bytes in modern systems, even embedded ones, seems to be in the
noise to be worth the extra hair to make it settable.
PR: 74609
Submitted by: Divacky Roman
Approved by: re (blanket)
Warner Losh [Thu, 28 Jun 2007 05:15:33 +0000 (05:15 +0000)]
For both interrupt and isochronous (the patch was unclear which one it
applied to, but I'd think both), honor the timeout that's been set.
Return 0 bytes to be consistant with what libusb expects. By default,
the timeout will be zero, so only applications that change the default
will see a change. The patch only seems to apply to the interrupt end
points, but it should also apply to isochronous endpoints as well.
Submitted by: Maurice Castro
PR: 110122
Approved by: re (blanket)
- Add audit_arg_audinfo_addr() for auditing the arguments for setaudit_addr(2)
- In audit_bsm.c, make sure all the arguments: ARG_AUID, ARG_ASID, ARG_AMASK,
and ARG_TERMID{_ADDR} are valid before auditing their arguments. (This is done
for both setaudit and setaudit_addr.
- Audit the arguments passed to setaudit_addr(2)
- AF_INET6 does not equate to AU_IPv6. Change this in au_to_in_addr_ex() so the
audit token is created with the correct type. This fixes the processing of the
in_addr_ex token in users pace.
- Change the size of the token (as generated by the kernel) from 5*4 bytes to
4*4 bytes (the correct size of an ip6 address)
- Correct regression from ucred work which resulted in getaudit() not returning
E2BIG if the subject had an ip6 termid
- Correct slight regression in getaudit(2) which resulted in the size of a pointer
being passed instead of the size of the structure. (This resulted in invalid
auditinfo data being returned via getaudit(2))
Robert Watson [Wed, 27 Jun 2007 13:39:38 +0000 (13:39 +0000)]
Use vm_offset_t for kmembase and kmemlimit rather than char *, avoiding
unnecessary casts, and making it possible to compile kern_malloc.c with
strict aliasing.
Remko Lodder [Tue, 26 Jun 2007 22:13:43 +0000 (22:13 +0000)]
Add Viking Interworks 256MB as an ata device; this might give
some false positives but at this moment it is better to add
support then to dont have it at all (comment from Soren).
PR: kern/111516
Submitted by: Thomas Nystrom <thn at saeab dot se>
Approved by: re (kensmith)
Approved by: imp (mentor)
OK'ed by: sos (With the comment noted above about false
positives).
Attilio Rao [Tue, 26 Jun 2007 21:42:01 +0000 (21:42 +0000)]
Fix an old standing LOR between callout_lock and sleepqueues chain (which
could lead to a deadlock).
- sleepq_set_timeout acquires callout_lock (via callout_reset()) only
with sleepq chain lock held
- msleep_spin in _callout_stop_safe lock the sleepqueue chain with
callout_lock held
In order to solve this don't use msleep_spin in _callout_stop_safe() but
use directly sleepqueues as inline msleep_spin code. Rearrange the
wakeup path in order to have it consistent too.
Reported by: kris (via stress2 test suite)
Tested by: Timothy Redaelli <drizzt@gufi.org>
Reviewed by: jhb
Approved by: jeff (mentor)
Approved by: re
Attilio Rao [Tue, 26 Jun 2007 21:31:56 +0000 (21:31 +0000)]
Introduce a new rwlocks initialization function: rw_init_flags.
This is very similar to sx_init_flags: it initializes the rwlock using
special flags passed as third argument (RW_DUPOK, RW_NOPROFILE,
RW_NOWITNESS, RW_QUIET, RW_RECURSE).
Among these, the most important new feature is probabilly that rwlocks
can be acquired recursively now (for both shared and exclusive paths).
Because of the recursion counter, the ABI is changed.
Tested by: Timothy Redaelli <drizzt@gufi.org>
Reviewed by: jhb
Approved by: jeff (mentor)
Approved by: re
Matt Jacob [Tue, 26 Jun 2007 20:53:07 +0000 (20:53 +0000)]
Extension of previous commit- when we have 2k login firmware, we need to
put out a ispreqt2e_t structure onto the request queue- not a ispreqt2_t
structure. I forgot that the 23XX can use a t2 structure.
Approved by: re (ken, implicitly)
MFC after: 3 days
Remko Lodder [Tue, 26 Jun 2007 19:40:03 +0000 (19:40 +0000)]
Make zoneinfo optional so that a filesystem upgrade/update does not overwrite
possibly installed thirdparte zoneinfo databases (from ports for example).
PR: bin/104713
Submitted by: Mark Andrews <Mark_Andrews at isc dot org> (original patch
rewritten by me to be more consistent with the new practise).
Approved by: re (kensmith)
Approved by: imp (mentor)
Reviewed by: ru (some time ago already)