Commit Graph

54713 Commits

Author SHA1 Message Date
Andrey A. Chernov
63ecaee8d6 Add -mno-sse3 for prescott/nocona 2005-07-15 12:22:14 +00:00
Andrey A. Chernov
64b3210d91 Add -mno-sse3 for prescott/nocona 2005-07-15 11:45:30 +00:00
George V. Neville-Neil
ba7be0a934 Fix for PR 82974. We were not checking that the route looked up in
the case of an RTM_CHANGE was specific, i.e. that it matched completely.  This
led to a route change of a non-existent route changing the default route
as the radix code would simply back track to that point and hand that
route back to the routing socket code.

PR: 82974
Reviewed by: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
             Ben Kaduk <minimarmot@gmail.com>
             Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net>
Obtained from:	OpenBSD with modifications.
MFC after: 2 weeks
2005-07-15 09:18:34 +00:00
Poul-Henning Kamp
1c3cf26412 Implement a gctl handler and the verb "write MBR" which can be used to
update metadata and bootcode while the MBR is in use.

MFC candidate
2005-07-15 08:00:44 +00:00
Warner Losh
49fd8f11fe Use the new cis scanning code to look for the proper MAC address. The
offset varies between models of these cards.

# this gets the MAC address right for my CEM-2, but it doesn't detect
# the media attached correctly.
2005-07-15 06:46:04 +00:00
Warner Losh
730b64121c Fix a couple of leaking situations when errors happen. 2005-07-15 06:08:26 +00:00
Warner Losh
d55dc24982 Fix the xircom match routine. In it we were always return a match
when the base vendor/id didn't match.  Some cards woudl bogusly match
and would cause other downstream problems.
2005-07-15 06:05:11 +00:00
Takanori Watanabe
f35f3346a2 Add options for sl811.
Pointed out by: nyan
2005-07-15 05:12:49 +00:00
Warner Losh
f83fe7ce90 Don't wait for the printer to become ready before allowing the open to
succeed.  There are many printers that return status over the read
channel, and if we wait for the status to become ready, then we can't
find the status automatically.  Linux doesn't wait, nor does it ever
seem to really check the status in any meaningful way...  If there
really is a problem, the writes to the bulk out endpoint will still
fail (like they would if the printer was ready and then ran out of
paper or became unready).

In addition, there are a number of printers being made that emulate
the 'status' byte by returning '0' always rather than '0x18'.  This
fixes the EBUSY on open timeouts on those printer as well.

Reviewed by: the defining silence on usb@
2005-07-15 04:19:42 +00:00
Warner Losh
ce71e8d87f s/_us// 2005-07-15 04:11:42 +00:00
Warner Losh
d224ede0da Move to using tsleeps in the cardbus reset case as well. This
eliminates the last of the DELAYs in pccbb.
2005-07-15 03:25:22 +00:00
Warner Losh
33d6891bc8 Add support for the DLink DMF650TX Ethernet+56k modem PC Card. This
gets the ethernet part of the card working, while putting appropriate
hooks in place for the modem code.  Other ed based lan/modem combo
cards should be easy to add.  Please send me info on any you'd like to
see support added.

Note: The 650 isn't a strictly conforming multi-function card, so
special support is needed. :-(
2005-07-15 01:54:59 +00:00
Warner Losh
5e2f32718d Add real support for obtaining the silicom MAC address from the
apporpriate place in the CIS, now that we have the CIS scanning code.
2005-07-15 01:48:38 +00:00
Warner Losh
faf98cda63 Insert missing int i; 2005-07-15 01:43:08 +00:00
Maksim Yevmenkin
f9e566779c kbdmux(4) keyboard multiplexer integration
o Add minimal kbdmux(4) man page to the source tree (more details to follow);

o Hook up kbdmux(4) to the build.

This concludes the first part of the kbdmux(4) keyboard multiplexer
integration. It now should be possible to use kbdmux(4), however one
must configure kbdmux(4) by hand (i.e. load kbdmux(4) module and use
kbdcontrol(1) to add/remove slave keyboards to/from kbdmux(4)).

MFC after:	1 week
2005-07-14 23:04:23 +00:00
Maksim Yevmenkin
4673ea01e3 kbdmux(4) keyboard multiplexer integration
o Slightly change KBADDKBD and KBRELKBD ioctl() interface. Instead of passing
  keyboard index pass keyboard_info_t structure with populated 'kb_unit' and
  'kb_name' fields. Keyboard index is not very user-friendly and is not very
  easy to obtain. Keyboard driver name and unit, on the other hand, is much
  more user friendly and known almost all the time;

o Move definition of keyboard_info_t structure up;

o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
  multiplexor;

o Update kbdcontrol(1) man page and document new functionality.

To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).

MFC after:	1 week
2005-07-14 22:43:20 +00:00
Max Laier
6de8d9dc52 Export pfsyncstats via sysctl "net.inet.pfsync" in order to print them with
netstat (seperate commit).

Requested by:	glebius
MFC after:	1 week
2005-07-14 22:22:51 +00:00
John Baldwin
b9d3b80521 Convert a remaining !fs.map->system_map to
fs.first_object->flags & OBJ_NEEDGIANT test that was missed in an earlier
revision.  This fixes mutex assertion failures in the debug.mpsafevm=0
case.

Reported by:	ps
MFC after:	3 days
2005-07-14 21:18:07 +00:00
Warner Losh
fd4e475233 Omnibus power and interrupt fixes:
o Don't busy wait on powerup.  Instead, use the power up interrupt to wait
  for the card to power up.  Don't wait when we're turning the card off,
  since no interrupt happens in that case.
o Convert many of the long DELAYs to tsleeps.  We do not run before
  the timer have stared, so DELAY isn't necessary.  More DELAYs can likely
  be eliminated in the future.
o When powering up the card, don't do anything if the card is already
  powered up (before we'd power cycle it).  This means that for most
  cards we power them up once and then never change the power.
o On card eject, mask (by clearing) the CD bit.  Before we set it, which
  was wrong.  We don't want to see any CD events past the first one since
  they need to be debounced.

With these changes, I can insert/eject 16bit cards without glitching xmms'
sound output.  Something very important to the development of better pccard
drivers :-)
2005-07-14 20:46:59 +00:00
Warner Losh
2bb5d7f9ac Also provide the function type in the nomatch routine. 2005-07-14 20:40:42 +00:00
Max Laier
52023244de Move eventhandler for 'ifnet_departure_event' at the end of the progress.
Some of the (IPv6) cleanup functions send packets to inform peers of the
departure.  These packets confused users of ifnet_departure_event (pf at the
moment).

PR:		kern/80627
Tested by:	Divacky Roman
MFC after:	1 week
2005-07-14 20:26:43 +00:00
Paul Saab
0e38f5365b Fixes for NFS crashes on architectures that require strict alignment.
- Fix nfsm_disct() so that after pulling up data, the remaining data
  is aligned if necessary.
- Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the
  mbuf (instead of casting m_data to a uint32).

Submitted by:	Pyun YongHyeon
Reviewed by:	Mohan Srinivasan
2005-07-14 20:08:27 +00:00
Jung-uk Kim
3e709972e1 Scan static SMBIOS structures and export the following environment
variables to loader:

hint.smbios.0.enabled		"YES" when SMBIOS is detected

hint.smbios.0.bios.vendor	BIOS vendor
hint.smbios.0.bios.version	BIOS version
hint.smbios.0.bios.reldate	BIOS release date

hint.smbios.0.system.maker	System manufacturer
hint.smbios.0.system.product	System product name
hint.smbios.0.system.version	System version number

hint.smbios.0.planar.maker	Base board manufacturer
hint.smbios.0.planar.product	Base board product name
hint.smbios.0.planar.version	Base board version number

hint.smbios.0.chassis.maker	Enclosure manufacturer
hint.smbios.0.chassis.version	Enclosure version

These strings can be used to detect hardware quirks and to set appropriate
flags.  For example, Compaq R3000 series and some HP laptops require

	hint.atkbd.0.flags="0x9"

to boot.  See amd64/67745 for more detail.

Note: Please do not abuse this feature to resolve general problem when it
      can be fixed programmatically.  This must be used as a last resort.

PR:		kern/81449
Approved by:	anholt (mentor)
2005-07-14 19:52:22 +00:00
Kelly Yancey
9c044e0fd0 Remove superfluous semicolon at the end of the __strong_reference() macro
definition.
2005-07-14 19:30:49 +00:00
Maksim Yevmenkin
dfa494399b kbdmux(4) keyboard multiplexer integration
o Add sys/dev/kbdmux/kbdmux.c to the source tree

o Add sys/modules/kbdmux/Makefile to the source tree

These are not yet connected to the build. Man page and other changes to follow.

MFC after:	1 week
2005-07-14 17:48:04 +00:00
Scott Long
1b3a4f4e7b Check the vendor and device, not subvendor and subdevice, when looking for
channel devices.  This should fix Dell 2450/2550/2650 systems that have RAID
enabled.  This will likely not fix 2400 systems though as I don't have the
appropriate PCI Id info for them.

MFC After: 3 day
2005-07-14 17:43:00 +00:00
Robert Watson
7a52a97eb3 Introduce a new sysctl, vm.zone_stats, which exports UMA(9) allocator
statistics via a binary structure stream:

- Add structure 'uma_stream_header', which defines a stream version,
  definition of MAXCPUs used in the stream, and the number of zone
  records in the stream.

- Add structure 'uma_type_header', which defines the name, alignment,
  size, resource allocation limits, current pages allocated, preferred
  bucket size, and central zone + keg statistics.

- Add structure 'uma_percpu_stat', which, for each per-CPU cache,
  includes the number of allocations and frees, as well as the number
  of free items in the cache.

- When the sysctl is queried, return a stream header, followed by a
  series of type descriptions, each consisting of a type header
  followed by a series of MAXCPUs uma_percpu_stat structures holding
  per-CPU allocation information.  Typical values of MAXCPU will be
  1 (UP compiled kernel) and 16 (SMP compiled kernel).

This query mechanism allows user space monitoring tools to extract
memory allocation statistics in a machine-readable form, and to do so
at a per-CPU granularity, allowing monitoring of allocation patterns
across CPUs in order to better understand the distribution of work and
memory flow over multiple CPUs.

While here, also export the number of UMA zones as a sysctl
vm.uma_count, in order to assist in sizing user swpace buffers to
receive the stream.

A follow-up commit of libmemstat(3), a library to monitor kernel memory
allocation, will occur in the next few days.  This change directly
supports converting netstat(1)'s "-mb" mode to using UMA-sourced stats
rather than separately maintained mbuf allocator statistics.

MFC after:	1 week
2005-07-14 16:35:13 +00:00
Robert Watson
773df9ab16 In addition to tracking allocs in the zone, also track frees. Add
a zone free counter, as well as a cache free counter.

MFC after:	1 week
2005-07-14 16:17:21 +00:00
Robert Watson
2c743d361a In an earlier world order, UMA would flush per-CPU statistics to the
zone whenever it was moving buckets between the zone and the cache,
or when coalescing statistics across the CPU.  Remove flushing of
statistics to the zone when coalescing statistics as part of sysctl,
as we won't be running on the right CPU to write to the cache
statistics.

Add a missed gathering of statistics: when uma_zalloc_internal()
does a special case allocation of a single item, make sure to update
the zone statistics to represent this.  Previously this case wasn't
accounted for in user-visible statistics.

MFC after:	1 week
2005-07-14 16:13:46 +00:00
Takanori Watanabe
39e5901ee7 Add SL811 based host controller driver for CF usb host controller.
This is based on NetBSD slhci(4) driver for X68k amateur hardware.
For now, it will not work properly, but it can detect usb device
insertion.
2005-07-14 15:57:01 +00:00
Ken Smith
22e59cec3b Add recently invented COMPAT_FREEBSD5 option.
MFC after:	3 days
2005-07-14 15:39:06 +00:00
Robert Watson
4f8721d2a9 Correct build on 64-bit: cast u_int64_t to (unsigned long long) before
printfing as (unsigned long long).  32-bit build on i386 didn't notice
this.  Whoops.

Reported by:	arved
Tested by:	sledge
2005-07-14 15:21:18 +00:00
Joseph Koshy
f15067e8b2 Fix breakage introduced in rev 1.7.
MFC after:	3 days
2005-07-14 15:09:14 +00:00
Takanori Watanabe
46fbc82b2b Add device id for RATOC REX CFU1 sl811 based USB Host Controller. 2005-07-14 14:53:38 +00:00
Takanori Watanabe
05cb19d7c2 Prepare to commit SL811 based Host controller driver. 2005-07-14 14:19:05 +00:00
Yaroslav Tykhiy
1a3b685942 MFp4:
- Introduce a helper function if_setflag() containing the code common
  to ifpromisc() and if_allmulti() instead of duplicating the code poorly,
  with different bugs.
- Call ifp->if_ioctl() in a consistent way: always use more compatible C
  syntax and check whether ifp->if_ioctl is not NULL prior to the call.

MFC after:	1 month
2005-07-14 13:56:51 +00:00
Robert Watson
cd814b2692 Introduce a new sysctl, kern.malloc_stats, which exports kernel malloc
statistics via a binary structure stream:

- Add structure 'malloc_type_stream_header', which defines a stream
  version, definition of MAXCPUS used in the stream, and a number of
  malloc_type records in the stream.

- Add structure 'malloc_type_header', which defines the name of the
  malloc type being reported on.

- When the sysctl is queried, return a stream header, followed by a
  series of type descriptions, each consisting of a type header
  followed by a series of MAXCPUS malloc_type_stats structures holding
  per-CPU allocation information.  Typical values of MAXCPUS will be 1
  (UP compiled kernel) and 16 (SMP compiled kernel).

This query mechanism allows user space monitoring tools to extract
memory allocation statistics in a machine-readable form, and to do so
at a per-CPU granularity, allowing monitoring of allocation patterns
across CPUs in order to better understand the distribution of work and
memory flow over multiple CPUs.

While here:

- Bump statistics width to uint64_t, and hard code using fixed-width
  type in order to be more sure about structure layout in the stream.
  We allocate and free a lot of memory.

- Add kmemcount, a counter of the number of registered malloc types,
  in order to avoid excessive manual counting of types.  Export via a
  new sysctl to allow user-space code to better size buffers.

- De-XXX comment on no longer maintaining the high watermark in old
  sysctl monitoring code.

A follow-up commit of libmemstat(3), a library to monitor kernel memory
allocation, will occur in the next few days.  Likewise, similar changes
to UMA.
2005-07-14 11:52:06 +00:00
Robert Watson
49bb6870cc Bump the module versions of the MAC Framework and MAC policy modules
from 2 (6.x) to 3 (7.x) to allow for future changes in the MAC policy
module ABI in 7.x.

Obtained from:	TrustedBSD Project
2005-07-14 10:46:03 +00:00
Robert Watson
d26dd2d99e When devfs cloning takes place, provide access to the credential of the
process that caused the clone event to take place for the device driver
creating the device.  This allows cloned device drivers to adapt the
device node based on security aspects of the process, such as the uid,
gid, and MAC label.

- Add a cred reference to struct cdev, so that when a device node is
  instantiated as a vnode, the cloning credential can be exposed to
  MAC.

- Add make_dev_cred(), a version of make_dev() that additionally
  accepts the credential to stick in the struct cdev.  Implement it and
  make_dev() in terms of a back-end make_dev_credv().

- Add a new event handler, dev_clone_cred, which can be registered to
  receive the credential instead of dev_clone, if desired.

- Modify the MAC entry point mac_create_devfs_device() to accept an
  optional credential pointer (may be NULL), so that MAC policies can
  inspect and act on the label or other elements of the credential
  when initializing the skeleton device protections.

- Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(),
  so that the pty clone credential is exposed to the MAC Framework.

While currently primarily focussed on MAC policies, this change is also
a prerequisite for changes to allow ptys to be instantiated with the UID
of the process looking up the pty.  This requires further changes to the
pty driver -- in particular, to immediately recycle pty nodes on last
close so that the credential-related state can be recreated on next
lookup.

Submitted by:	Andrew Reisse <andrew.reisse@sparta.com>
Obtained from:	TrustedBSD Project
Sponsored by:	SPAWAR, SPARTA
MFC after:	1 week
MFC note:	Merge to 6.x, but not 5.x for ABI reasons
2005-07-14 10:22:09 +00:00
Maksim Yevmenkin
04551c6ce5 kbdmux(4) keyboard multiplexer integration
o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove
  keyboard to (and from) kbdmux(4) keyboard multiplexer;

o Introduce new kbd_find_keyboard2() function. It does exactly the same job
  as kbd_find_keyboard() function except it allows to specify starting index.
  This function can be used to iterate over keyboards array;

o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting
  index of zero;

o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently
  active keyboard.

These changes should not have any visible effect.

MFC after:	1 week
2005-07-13 23:58:57 +00:00
John Baldwin
2c65cb82ad Add a 'sysent' target that depends on the various files built from
syscalls.master for the master list and the Alpha/OSF1 compat ABI to be
consistent with all the other compat ABIs where 'make sysent' already
works.

MFC after:	3 days
2005-07-13 20:50:17 +00:00
Andrew Thompson
489fc2258f Previously the bridge MTU was set to ETHERMTU and could not be changed. Since
we can only bridge interfaces with the same value it meant that all members had
to be set at ETHERMTU as well.

Allow the first member to be added to define the MTU for the bridge, the check
still applies to all additional members.

Print an informative message if the MTU is incorrect [1]

Requested by:	Niki Denev [1]
Approved by:	mlaier (mentor)
MFC after:	3 days
2005-07-13 20:40:19 +00:00
John Baldwin
ac5ee935dd Regen. 2005-07-13 20:35:09 +00:00
John Baldwin
8683e7fdc1 Make a pass through all the compat ABIs sychronizing the MP safe flags
with the master syscall table as well as marking several ABI wrapper
functions safe.

MFC after:	1 week
2005-07-13 20:32:42 +00:00
John Baldwin
106e24aa5b Don't try to probe ISA PnP devices for now until this driver can grow a
list of known-valid PnP IDs.

Discussed with:	imp
MFC after:	3 days
2005-07-13 15:44:53 +00:00
John Baldwin
db015a9153 Fixup some more fallout from the lapic/i8254 changes:
- Make sure timer0_max_count is set to a correct value in the lapic case.
- Revert i8254_restore() to explicitly reprogram timer 0 rather than
  calling set_timer_freq() to do it.  set_timer_freq() only reprograms
  the counter if the max count changes which it never does on resume.  This
  unbreaks suspend/resume for several people.

Tested by:	marks, others
Reviewed by:	bde
MFC after:	3 days
2005-07-13 15:43:21 +00:00
John Baldwin
11f3a4f069 - Ignore BIOS IRQs (that is, IRQ settings left by the BIOS or a previous OS
in the PCI config registers) that are > 15 as $PIR can only route PCI
  interrupts to ISA IRQs which are limited to the 0 to 15 range.
- Remove an extra word from a printf.

Reported by:	othermark atkin901 at yahoo dot com
MFC after:	3 days
2005-07-13 15:41:16 +00:00
John Baldwin
dfa9ef3d99 Don't attach the non-PnP mss pcm(4) driver to acpi busses as ACPI only
enumerates PnP ISA-like devices.

Reported by:	Harry Coin harrycoin at qconline dot com
MFC after:	3 days
2005-07-13 15:17:54 +00:00
John Baldwin
6e9b02cf80 Regen. 2005-07-13 15:14:54 +00:00
John Baldwin
2773347338 - Stop hardcoding #define's for options and use the appropriate
opt_foo.h headers instead.
- Hook up the IPC SVR4 syscalls.

MFC after:	3 days
2005-07-13 15:14:33 +00:00