yongari [Tue, 12 Aug 2008 00:57:39 +0000 (00:57 +0000)]
Restore link state handling which was broken in rev 1.69.
Also report current link state while auto-negotiation is in
progress.
With this change link loss should be reported within a second
and drivers that rely on link state should work.
Reported by: Pete French < petefrench at ticketswitch dot com >
Tested by: Pete French < petefrench at ticketswitch dot com >
MFC after: 1 week
ache [Mon, 11 Aug 2008 23:24:42 +0000 (23:24 +0000)]
Suggections from bde@
1) Split too long source lines
2) Portable code should not assume that null pointer == all-bits-0,
so back out prev. calloc() change.
csjp [Mon, 11 Aug 2008 20:14:56 +0000 (20:14 +0000)]
Make sure we check the preselection masks present for all audit pipes.
It is possible that the audit pipe(s) have different preselection configs
then the global preselection mask.
pjd [Mon, 11 Aug 2008 08:41:08 +0000 (08:41 +0000)]
- Convert sc_sessions_mtx mutex to a rwlock, so in the fast path
(glxsb_process()) we don't block others when looking for our session.
- Simplify the loop responsible for freeing sessions on detach.
- No need to drop a lock around malloc(M_NOWAIT).
- Treat ses_used as boolean.
- Avoid gotos where possible.
- Various style(9) fixes.
Reviewed by: philip, Patrick Lamaiziere <patfbsd@davenulle.org>
weongyo [Mon, 11 Aug 2008 03:57:31 +0000 (03:57 +0000)]
Add Conexant/Intersil PrismGT SoftMAC wireless USB driver - upgt(4).
This driver supports GW3887 based chipsets and works on
x86/powerpc/sparc64. You need upgtfw kernel module before loading
upgt(4). Please see the manpage.
yongari [Mon, 11 Aug 2008 01:45:05 +0000 (01:45 +0000)]
Partial back out r180952.
pci_get_vendor() and pci_get_device() don't do configuration space
accessses so cahcing them makes no sense.
Pointed out by: jhb, imp, des
kientzle [Mon, 11 Aug 2008 01:19:36 +0000 (01:19 +0000)]
Fix up test suite so it works again with the libarchive 1.x API.
In particular, FreeBSD 6 still uses the libarchive 1.x API and
this correction will permit MFCing new libarchive features back
to FreeBSD 6.
das [Sun, 10 Aug 2008 19:33:35 +0000 (19:33 +0000)]
Make -fno-math-errno the default. Our libm doesn't support the SysV
mistake of setting errno, and never has. This will need to be fixed
upstream in a more generic way, but the changes are somewhat more
involved.
das [Sun, 10 Aug 2008 19:02:57 +0000 (19:02 +0000)]
Make -mfancy-math-387 the default on FreeBSD, as it is on most other
operating systems. Previously, gcc would inhibit the generation of
fsqrt, fsin, and several other floating point instructions, for the
benefit of the old in-kernel math emulator, which was removed over 5
years ago.
antoine [Sun, 10 Aug 2008 18:11:24 +0000 (18:11 +0000)]
Improve periodic/security/550.ipfwlimit a bit:
- don't run it if net.inet.ip.fw.verbose = 0 as it is pointless
- handle rules without logging limit correctly [1]
(those rules show up without logamount in "ipfw -a list")
ache [Sun, 10 Aug 2008 11:31:56 +0000 (11:31 +0000)]
All cosmetic.
1) Rename RANDOM_MAX to RANDOM_MAX_PLUS1 to not confuse with random()'s max
2) Use calloc() instead of zeroing fields explicitly
3) "too many lines" -> "too many delimiters" for err()
imp [Sat, 9 Aug 2008 15:55:10 +0000 (15:55 +0000)]
It turns out that checking the first DWORD register is more reliable
on a variety of cards. Adjust the comments accordingly to match the
code. Even if the vendor chose 0xffff for the device ID, the vendor
ID can't be 0xffff, so the test is still valid from a standards
perspective.
philip [Sat, 9 Aug 2008 14:52:31 +0000 (14:52 +0000)]
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (as
found in Soekris hardware, for instance). The hardware supports acceleration
of AES-128-CBC accessible through crypto(4) and supplies entropy to random(4).
TODO:
o Implement rndtest(4) support
o Performance enhancements
Submitted by: Patrick Lamaizière <patfbsd -at- davenulle.org>
Reviewed by: jhb, sam
MFC after: 1 week
Delete unused files in the window(1) directory that contain a colon.
During the import of the 4.4BSD Lite sources, four files got added to
the repository called :tt, :tty, :var and :ww. They seem to contain some
kind of debug information. These files aren't used/installed anywhere.
Unfortunately the colons in the filenames prevents us from checking out
the source tree on file systems that don't support colons (such as FAT).
Just remove these unneeded files to keep SVN happy.
imp [Sat, 9 Aug 2008 07:41:18 +0000 (07:41 +0000)]
After some intial testing, there are even slower cards than the ones
that I have. Wait up to 1.1s for the card to become ready. Document
what the standards say, and use that to justify the behavior in the
code: PCI standard says that a card must respond to configuration
cycles within 2^25 cycles after reset goes high, which is
approximately 1s. Therefore, give cards a little break and wait for
up to 1.1s for VENDOR to become valid. Only look at the vendor part
of the ID, since only it can't be 0xffff (although in practice
vendor/device will always be != 0xfffffffff). Include detailed
pointers to standards so epople understand why we're doing what we're
doing and why it just might be OK. Make it clear in the timeout
message that it is just a warning, sinc we try to soldier on as best
we can anyway.
This should eliminate an error message that r181453 produced on
certain Atheros cards.
alc [Sat, 9 Aug 2008 05:46:13 +0000 (05:46 +0000)]
Intel describes the behavior of their processors as "undefined" if two or
more mappings to the same physical page have different memory types, i.e.,
PAT settings. Consequently, if pmap_change_attr() is applied to a virtual
address range within the kernel map, then the corresponding ranges of the
direct map also need to be changed. Enhance pmap_change_attr() to handle
this case automatically.
Add a comment describing what pmap_change_attr() does.
imp [Sat, 9 Aug 2008 05:46:01 +0000 (05:46 +0000)]
Verify that the WPA flags set are actually compatible with the
driver's set of valid flags. Otherwise, wpa_supplicant wouldn't
report an error for old wi cards that can't do WPA.
imp [Sat, 9 Aug 2008 04:08:36 +0000 (04:08 +0000)]
Rather than waiting a fixed amount of time, which might not be enough
and also holds things up, check every 20ms to see if we can read the
vendor of device 0.0. It will be 0xffffffff until the card is out of
reset. Always wait at least 20ms, for safety.
I think this is a better fix to the reset problem. However, I did it
as a separate commit in case something bad happens, people can roll
back to the commit before this one to see if that gives them reliable
behavior. I don't have FreeBSD up on enough machines to do exhaustive
testing on all known bridges...
imp [Sat, 9 Aug 2008 03:37:12 +0000 (03:37 +0000)]
While most bridges can bring a card out of reset in 20ms, there are
some bridge + card combinations that take longer for reasons unknown.
Adjust the timeout to be 100ms on all !RICOH bridges, but leave RICOH
at 400ms. The 400ms is "lore" from other open source projects, and
I've never see my ricoh bridge chips take this long. Maybe it is the
same thing? Maybe a bit should be read instead of a hard-wired pause?
After this adjustment, a few cards that I'd insert and get only:
cbb0: card_power: 3V
cbb0: card_power: 0V
with full debugging enabled would actually try to attach.
jhb [Fri, 8 Aug 2008 19:41:20 +0000 (19:41 +0000)]
- Initialize the vm86 structure to a known-good state. Specifically, always
set the %eflags used during a BIOS call via BTX to 0x202. Previously
the flags field was uninitialized garbage, and thus it was "random" if
interrupts were enabled or not during BIOS calls.
- Use constants from <machine/psl.h> for fields in %eflags.
jhb [Fri, 8 Aug 2008 19:39:11 +0000 (19:39 +0000)]
Fix the hangs reported with the real mode BTX:
- I had errantly assumed that all user requests should run with interrupts
enabled. User requests for software interrupts, however, need to disable
interrupts (and tracing) just like hardware interrupts.
- Disable alignment checking when emulating a hardware interrupt as well
(based on the description of the real mode operation of the 'INT'
instruction in the IA-32 manuals).
- Use constants for fields in %eflags.
stas [Fri, 8 Aug 2008 16:26:53 +0000 (16:26 +0000)]
- Add cpuctl(4) pseudo-device driver to provide access to some low-level
features of CPUs like reading/writing machine-specific registers,
retrieving cpuid data, and updating microcode.
- Add cpucontrol(8) utility, that provides userland access to
the features of cpuctl(4).
- Add subsequent manpages.
The cpuctl(4) device operates as follows. The pseudo-device node cpuctlX
is created for each cpu present in the systems. The pseudo-device minor
number corresponds to the cpu number in the system. The cpuctl(4) pseudo-
device allows a number of ioctl to be preformed, namely RDMSR/WRMSR/CPUID
and UPDATE. The first pair alows the caller to read/write machine-specific
registers from the correspondent CPU. cpuid data could be retrieved using
the CPUID call, and microcode updates are applied via UPDATE.
The permissions are inforced based on the pseudo-device file permissions.
RDMSR/CPUID will be allowed when the caller has read access to the device
node, while WRMSR/UPDATE will be granted only when the node is opened
for writing. There're also a number of priv(9) checks.
The cpucontrol(8) utility is intened to provide userland access to
the cpuctl(4) device features. The utility also allows one to apply
cpu microcode updates.
Currently only Intel and AMD cpus are supported and were tested.
Approved by: kib
Reviewed by: rpaulo, cokane, Peter Jeremy
MFC after: 1 month
There is no need to mark this device node to use Giant. The only
architectures that use io(4) (i386 and amd64) only change a flag in
td->td_frame, which is only accessed by curthread.
Apart from this change, I think some fishy things may happen when using
/dev/io in multithreaded applications. I haven't tested, but looking at
the code, the flag doesn't get cleared when close() is called from
another thread, but this may not be this important.
I'm not removing D_NEEDGIANT from mem(4), because this driver isn't
Giant safe at all (it calls GIANT_REQUIRED).
cperciva [Fri, 8 Aug 2008 04:34:00 +0000 (04:34 +0000)]
In `freebsd-update IDS`, strip out file flags before we look for
non-matching index lines. This fixes a bug where bogus warnings would
be printed file has the wrong file flags AND has been updated by
FreeBSD Update.
edwin [Fri, 8 Aug 2008 04:20:36 +0000 (04:20 +0000)]
MFV of tzdata2008d
- Mauritius will have a DST experiment between 2008-11-01 and 2009-03-31.
- Add/Fix historical data for C-Eur, the SovietZone, Germany,
Bahamas, San Luis.
- Add information about West Para (America/Santarem)
- America/Eirunepe and America/Rio_Branco go to UTC-4
Approved by: bde (mentor, implicit), des
MFC after: 1 week
ache [Fri, 8 Aug 2008 02:46:47 +0000 (02:46 +0000)]
1) Fix longstanding math bug with denominator > 1 (wrong probability).
Test case:
random -f some_small_file 10000
(in most cases must be no output)
2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be
choosed) with EFBIG err()
3) After line is found, terminate list loop for -U case too,
since nothing to do in the rest of the loop left.
ache [Fri, 8 Aug 2008 01:42:17 +0000 (01:42 +0000)]
I was confused a bit by the wrong construction with RAND_MAX
used in randomize_fd.c.
Although the max value is the same currently, RAND_MAX is for rand(),
not for random().
So move RANDOM_MAX const to the common file now, make it UL and
use in randomize_fd.c too.
(in any case its old value was 1 less then must be, as noted in
the prev. commit)
ache [Fri, 8 Aug 2008 01:02:30 +0000 (01:02 +0000)]
1) Replace hardcoded RANDOM_MAX macro with wrong (1 less than must be)
value with ((double)RAND_MAX + 1)
2) For exit code increase valid denominator upper range from 255 to 256
since returned value is [0 .. denom - 1]
das [Fri, 8 Aug 2008 00:15:16 +0000 (00:15 +0000)]
In the line
#pragma STDC CX_LIMITED_RANGE ON
the "ON" needs to be in caps. gcc doesn't understand this pragma
anyway and assumes it is always on in any case, but icc supports
it and cares about the case.
marius [Thu, 7 Aug 2008 22:46:25 +0000 (22:46 +0000)]
- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
no particular reason for them to be implemented in assembler and
having them in C allows easier extension as well as using more C
macros and {d,i}tlb_slot_max rather than hard-coding magic (and
actually spitfire-only) values.
- Fix the compilation of pmap_print_tte().
- Change pmap_print_tlb() to use ldxa() rather than re-rolling it
inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than
hardcoding magic (and actually spitfire-only) values.
- While at it, suffix the above mentioned functions with "_sun4u" to
underline they're architecture-specific.
- Use __FBSDID and macros instead of magic values in locore.S.
- Remove unused includes and smp_stack in locore.S.
imp [Thu, 7 Aug 2008 21:16:14 +0000 (21:16 +0000)]
Fix a small problem in the comment about departure from NetBSD.
Also, r181392 fixed a small problem with multifunction cards that would
cause the card not to power down when the last driver detached from it.
jhb [Thu, 7 Aug 2008 21:00:13 +0000 (21:00 +0000)]
Permit Giant to be passed as the explicit interlock either to
msleep/mtx_sleep or the various cv_*wait*() routines. Currently, the
"unlock" behavior of PDROP and cv_wait_unlock() with Giant is not
permitted as it is will be confusing since Giant is fully unrecursed and
unlocked during a thread sleep.
This is handy for subsystems which wish to allow unlocked drivers to
continue to use Giant such as CAM, the new TTY layer, and the new USB
stack. CAM currently uses a hack that I told Scott to use because I
really didn't want to permit this behavior, and the TTY and USB patches
both have various patches to permit this.
imp [Thu, 7 Aug 2008 20:55:20 +0000 (20:55 +0000)]
Convert to new style PC Card front end driver. Add support for the
NEC PC-9801N-J02 and PC-9801N-J02R. I can't test the former because
it requires resources that conflict with my laptop. I can't test the
latter because my dog chewed up my -J02R card and it didn't survive
well enough for me to test.