Commit graph

70632 commits

Author SHA1 Message Date
Sam Leffler c3b85cf91f Add support for the StrataFlash on 2348 boards:
o add bus shim for cfi driver
o add static mapping for CS0 (we map all 16M as the cfi driver doesn't
  support demand mapping)

Note this needs some tweaking to work for 2358 boards which is why the
CAMBRIA config is not touched.
2009-02-03 19:16:04 +00:00
Sam Leffler e73090b5d3 honor any interface width (e.g. setup by the bus shim) and don't probe;
this is needed for the moment to workaround bus shim issues
2009-02-03 19:09:16 +00:00
Sam Leffler 3a114d1f92 reorg ioctl code to simplify adding new requests 2009-02-03 19:07:41 +00:00
Sam Leffler 22f8f5fe92 force atomic_cmpset_ptr types to match atomic_cmpset_32;
this matches what powerpc does

Submitted by:	stass
MFC after:	2 weeks
2009-02-03 19:06:12 +00:00
Sam Leffler 50d5ad0e42 fix compilation w/ AH_DEBUG 2009-02-03 19:00:56 +00:00
Sean Bruno 23ee18767e Delete fwohci_filt() as it is now unused
Obtained from:	Marius Strobl <marius@alchemy.franken.de>
MFC after:	2 weeks
2009-02-03 17:13:37 +00:00
John Baldwin 3619ea6a08 Don't right-adjust the SMBus slave address for SSIF IPMI BMCs enumerated
via ACPI either.  This is somewhat academic since we don't currently
support such devices though.
2009-02-03 16:39:51 +00:00
John Baldwin bb6bb7fe1b - Change ichsmb(4) to follow the format of all the other smbus controllers
for slave addressing by using left-adjusted slave addresses (i.e.
  xxxxxxx0b).
- Require the low bit of the slave address to always be zero in smb(4) to
  help catch broken applications.
- Adjust some code in the IPMI driver to not convert the slave address for
  SSIF to a right-adjusted address.  I (or possibly ambrisko@) added this in
  the past to (unknowingly) work around the bug in ichsmb(4).

Submitted by:	 Andriy Gapon <avg of icyb.net.ua> (1,2)
MFC after:	1 month
2009-02-03 16:14:37 +00:00
Andrew Thompson c96a3b833f - Keep the same sorting on usb_errstr_table as the enum.
- Use c99 array initializers for usb_quirk_str so the indexing isnt critical.
2009-02-03 16:00:20 +00:00
Andrew Thompson 911ee9f112 Add missing string table for the usb quirk enum.
Pointy hat:	me
Submitted by:	rrs
2009-02-03 15:24:00 +00:00
Randall Stewart a99b67833a - Cleanup checksum code.
- Prepare for CRC offloading, add MIB counters (RS/MT).
- Bugfix: Disable CRC computation for IPv6 addresses with local scope (MT).
- Bugfix: Handle close() with SO_LINGER correctly when notifications
          are generated during the close() call(MT).
- Bugfix: Generate DRY event when sender is dry during subscription.
          Only for 1-to-1 style sockets (RS/MT)
- Bugfix: Put vtags for the correct amount of time into time-wait (MT).
- Bugfix: Clear vtag entries correctly on expiration (MT).
- Bugfix: shutdown() indicates ENOTCONN when called for unconnected
          1-to-1 style sockets (MT).
- Bugfix: In sctp Auth code (PL).
- Add support for devices that support SCTP csum offload (igb).
- Add missing sctp_associd to mib sysctl xsctp_tcb structure (RS)
Obtained from:	With help from Peter Lei and Michael Tuexen
2009-02-03 11:04:03 +00:00
Randall Stewart 2f4afd2125 Adds support for SCTP checksum offload. This means
we, like TCP and UDP, move the checksum calculation
into the IP routines when there is no hardware support
we call into the normal SCTP checksum routine.

The next round of SCTP updates will use
this functionality. Of course the IGB driver needs
a few updates to support the new intel controller set
that actually does SCTP csum offload too.

Reviewed by:	gnn, rwatson, kmacy
2009-02-03 11:00:43 +00:00
Joseph Koshy bb471e3315 Improve robustness of NMI handling, for NMIs recognized in kernel
mode.

- Make the NMI handler run on its own stack (TSS_IST2).
- Store the GSBASE value for each CPU just before the start of
  each NMI stack, permitting efficient retrieval using %rsp-relative
  addressing.
- For NMIs taken from kernel mode, program MSR_GSBASE explicitly
  since one or both of MSR_GSBASE and MSR_KGSBASE can be potentially
  invalid.  The current contents of MSR_GSBASE are saved and restored
  at exit.
- For NMIs handled from user mode, continue to use 'swapgs' to
  load the per-CPU GSBASE.

Reviewed by:	jeff
Debugging help:	jeff
Tested by:	gnn, Artem Belevich <artemb at gmail dot com>
2009-02-03 09:01:45 +00:00
Warner Losh 2c204a1631 Use NULL in preference to 0 in pointer contexts. 2009-02-03 07:54:42 +00:00
Warner Losh 13b4c4c3a3 Make bioq_disksort have a ANSI-C definition rather than a K&R definition. 2009-02-03 07:53:51 +00:00
Warner Losh 8ed4d9c970 rman_debug should be static, so make it static. 2009-02-03 07:53:08 +00:00
Warner Losh bada728732 Use ANSI function definition for profil. 2009-02-03 07:52:36 +00:00
Warner Losh 04d17b6283 Prefer ANSI function definitions to K&R ones. 2009-02-03 07:52:07 +00:00
Warner Losh d710cae75a Use NULL in preference to 0 for pointers. 2009-02-03 07:51:41 +00:00
Warner Losh 4592c621f3 Use NULL in preference to 0 for pointers. 2009-02-03 07:51:11 +00:00
Warner Losh 8260e3a4c0 o Use unsigned for bit fields.
o Use NULL for pointers in preference to 0.
2009-02-03 07:50:41 +00:00
Warner Losh 9483543dfc int foo(void) is the proper ANSI function definition when there's no
parameters.  Use it for resettodr().
2009-02-03 07:50:01 +00:00
Marcel Moolenaar da3ee90988 In g_handleattr(), set bp->bio_completed also for the case
where len is 0. Otherwise g_getattr() will never succeed
when it is handled by g_handleattr_str().
2009-02-03 07:07:13 +00:00
Joseph Koshy c897f076bd Introduce a C type representing the header for GNU-style hash table
sections.  These ELF sections are generated by newer versions of
GNU binutils.

Reviewed by:		kaiw, Ali Bahrami <ali dot bahrami at sun dot com>
2009-02-03 06:12:13 +00:00
Andrew Thompson 5261ba87bc Move away from autogenerated enums, these values never change and its helpful
to be able to look them up.
2009-02-03 05:50:36 +00:00
Warner Losh 711873d44f o Define some symbols for a few items that are bare constants in the
code.
o Use NULL in preference to 0 for a few pointers.
o default to bus timing normal, like we default to bus_width_1.
2009-02-03 04:28:45 +00:00
Kip Macy 476f05d531 make sure that interrupts are disabled when handling page faults et al 2009-02-03 03:43:00 +00:00
Warner Losh 22d9e1f557 Use NULL in preference to 0 for pointers. 2009-02-03 01:17:34 +00:00
Warner Losh 1750692cac Use NULL in preference to '0' for pointers. 2009-02-03 01:17:17 +00:00
Warner Losh bdf331d450 Declare bus_data_devices to be static: it isn't used elsewhere.
Use NULL in a couple of places rather than 0 in the context of
pointers to be consistent with the rest of the file.
2009-02-03 00:10:21 +00:00
Kip Macy a392a2719c break out of loop if we run out of mbufs 2009-02-02 23:04:20 +00:00
John Baldwin ba8d936dd2 Goof, catch up to constant rename (I renamed it to match the overall PCI
style of having register offsets start with PCIR_* rather than PCI_*).

Submitted by:	rss
2009-02-02 22:06:20 +00:00
John Baldwin 333ebd77dc - Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
device.  The details include the current value of the BAR (including all
  the flag bits and the current base address), its length, and whether or not
  it is enabled.  Since this operation is not invasive, non-root users are
  allowed to use it (unlike manual config register access which requires
  root).  The intention is that userland apps (such as Xorg) will use this
  interface rather than dangerously frobbing the BARs from userland to
  obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf.  The -b flag when used
  with -l will now list all the active BARs for each device.

(Missed in previous commit)

MFC after:	1 week
2009-02-02 22:04:40 +00:00
Maksim Yevmenkin 8de7d5083c Properly retun error core from kbdmux_modevent()
Reported by:	Christoph Mallon < christoph -dot- mallon -at- gmx -dot- de >
MFC after:	1 week
2009-02-02 21:34:04 +00:00
Olivier Houchard 001944c3bd Move a comment to where it belongs.
Spotted out by:	Christoph Mallon <christoph d0t mallon AT gmx d0t de>
2009-02-02 20:24:29 +00:00
Olivier Houchard 027e0d0c50 Remove unused variables.
Spotted out by:	Christoph Mallon <christoph d0t mallon AT gmx d0t de>
2009-02-02 20:09:14 +00:00
John Baldwin da1e0915c5 - Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
device.  The details include the current value of the BAR (including all
  the flag bits and the current base address), its length, and whether or not
  it is enabled.  Since this operation is not invasive, non-root users are
  allowed to use it (unlike manual config register access which requires
  root).  The intention is that userland apps (such as Xorg) will use this
  interface rather than dangerously frobbing the BARs from userland to
  obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf.  The -b flag when used
  with -l will now list all the active BARs for each device.

MFC after:	1 month
2009-02-02 19:54:16 +00:00
Sam Leffler 8216b39e2b o make SAVE_CCK slightly less error prone by always writing the _flag
value used later by RESTORE_CCK
o swap arg order in RESTORE_CCK to slightly reduce cost
2009-02-02 16:56:58 +00:00
Sam Leffler 55a2313ad2 restore variable initialization removed in r187831; this broke
the horrible SAVE/RESTORE_CCK macros used by swan/nala cards to
implement 11b using 11g
2009-02-02 16:55:57 +00:00
Stephane E. Potvin 60b7f468da Fix select on platforms where sizeof(long) != sizeof(int). This used
to work by accident before the cleanup done in revision 187693.

Approved by:	kan (mentor)
2009-02-02 03:34:40 +00:00
Alfred Perlstein 7e474656a6 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
Sean Bruno 3042cc43f0 Some updates and bug squashing in the firewire stack.
Move the interupt handler to a driver_intr_t type function as it was trying
to do way to much for a lightweight filter interrupt function.

Introduce much more locking around fc->mtx.  Tested this for lock reversals
and other such lockups.  Locking seems to be working better, but there
is much more to do with regard to locking.  The most significant lock is
in the BUS RESET handler.  It was possible, before this checkin, to set
a bus reset via "fwcontrol -r" and have the BUS RESET handler fire before
the code responsible for asserting BUS RESET was complete.  This locking
fixes that issue.

Move some of the memory allocations in the fc struct to the attach function
in firewire.c

Rework the businfo.generation indicator to be merely a on/off bit now.
It's purpose according to spec is to notify the bus that the config ROM
has changed.  That's it.

Catch and squash a possible panic in SBP where in the SBP_LOCK was held
during a possible error case.  The error handling code would definitely
panic as it would try to acquire the SBP_LOCK on entrance.

Catch and squash a camcontrol/device lockup when firewire drives go away.
When a firewire device was powered off or disconnected from the firewire
bus, a "camcontrol rescan all" would hang trying to poll removed devices
as they were not properly detached.  Don't do that.

Approved by:	scottl
MFC after:	2 weeks
2009-02-01 23:28:52 +00:00
Sam Leffler a3dfb736e8 when promoting an 11b channel to 11g do not accept a ``pure G'' (OFDM only)
channel, only accept a real 11g channel; this fixes a problem where we were
wrongly promoting 11b to a Dynamic Turbo G channel which broke scanning on
channel 6
2009-02-01 22:24:08 +00:00
Bjoern A. Zeeb 09f8c3ff36 Remove the single global unlocked route cache ip6_forward_rt
from the inet6 stack along with statistics and make sure we
properly free the rt in all cases.

While the current situation is not better performance wise it
prevents panics seen more often these days.
After more inet6 and ipsec cleanup we should be able to improve
the situation again passing the rt to ip6_forward directly.

Leave the ip6_forward_rt entry in struct vinet6 but mark it
for removal.

PR:		kern/128247, kern/131038
MFC after:	25 days
Committed from:	Bugathon #6
Tested by:	Denis Ahrens <denis@h3q.com> (different initial version)
2009-02-01 21:11:08 +00:00
Marcel Moolenaar 709a626613 Constify val in g_handleattr() and str in g_handleattr_str().
This allows passing string constants to g_handleattr_str().
2009-02-01 01:50:09 +00:00
Andrew Thompson 84bcda5d68 Revert part of r187970, the NULL check was removed from
udbp_bulk_read_complete() as well as udbp_attach.
2009-02-01 01:07:15 +00:00
Andrew Thompson 50bf982db6 Remove check for null softc in attach, it can never happen. 2009-02-01 00:51:25 +00:00
Bjoern A. Zeeb e72f0a071c Bring over the code from sys/i386/i386/mp_machdep.c, r187880
to make XEN config compile again:
- Allocate apic vectors on a per-cpu basis.
2009-01-31 21:40:27 +00:00
David E. O'Brien d065e13dc2 Fix the inconsistent tabbing.
Noticed by:	bde
2009-01-31 20:46:01 +00:00
David Schultz 544048ecef Add a function attribute called `__malloc_like', which informs gcc
that the annotated function returns a pointer that doesn't alias any
extant pointer. This results in a 50%+ speedup in microbenchmarks such
as the following:

    char *cp = malloc(1), *buf = malloc(BUF);
    for (i = 0; i < BUF; i++) buf[i] = *cp;

In real programs, your mileage will vary. Note that gcc already
performs this optimization automatically for any function called
`malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is
used.
2009-01-31 18:27:02 +00:00