13548 Commits

Author SHA1 Message Date
pjd
d5b47bcc0a MFC: sys/dev/md/md.c 1.155
- Add md_mtx lock to protect ID number and list of devices.
- Always check mdnew() return value, as even in !autounit case
  kthread_create() can fail.

Those two changes fix serval panics provoked by simple stress test.

Tested by:	Kris The BugMagnet
Approved by:	re (scottl)
2005-09-03 16:02:37 +00:00
rodrigc
9d9c044008 MFC:
Prevent division by zero errors in sc_mouse_move()
  by explicitly setting sc->font_width, in the same
  places where sc->font_size is set, instead of
  relying on the default initialized value of 0 for sc->font_width.

PR:             kern/84836
Reported by:    Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by:	re (scottl)
2005-09-02 15:31:03 +00:00
rodrigc
0fba2ef085 MFC: 1.380
FDOPT_NORETRY is an option, and must be compared with fd->options,
 not fd->flags.

PR:             kern/85481
Submitted by:   Lev Levinson <llevinson at inbox dot ru>
Approved by:	re (ken)
2005-09-02 00:33:30 +00:00
mux
7b3716f009 MFC if_nve.c r1.8:
date: 2005/07/25 22:21:11;  author: mux;  state: Exp;  lines: +0 -1
  Remove an erroneous m_freem() call.  If m_defrag() returns a non-NULL
  pointer, it has already freed the original mbuf chain, so we shouldn't
  do it again.

Approved by:	re (scottl)
2005-08-30 09:03:13 +00:00
jhb
3439f4b996 MFC: Locking and sundry fixes; mark MPSAFE:
- Use device_printf() and if_printf().
- Remove pre-new-bus and other #if 0 code.
- Overhaul failure handling in my_attach().

Approved by:	re (scottl)
2005-08-29 20:00:31 +00:00
marius
14280f25ba MFC: 1.30
- Wrap the handler and associated code for collecting completed RX
  descriptors that are still marked owned in #ifdef GEM_RINT_TIMEOUT
  instead of #if 0 for convenience.
- Remove stale code and comment about relying on the preset XIF config.
- In case of a watchdog timeout call the init function instead of just
  the start function so the chip is properly reset.

Merge from hme(4):
- Convert to use bus_dmamap_load_mbuf_sg() for loading RX buffers.
- Protect from a duplicate mbuf free panic in case the DMA engine hangs.

Approved by:	re (scottl)
2005-08-27 18:02:15 +00:00
marius
94bb79907b MFC: sys/boot/sparc64/loader/metadata.c 1.14,
sys/dev/uart/uart_cpu_sparc64.c 1.21

- Change the code that determines whether to use a serial console and
  which serial device to use in that case respectively to not rely on
  the OFW names of the input/output and stdin/stdout devices. While at
  it save on some variables and for sys/boot/sparc64/loader/metadata.c
  move the code in question to a new function md_bootserial() so it can
  be kept in sync with uart_cpu_getdev_console() more easily.
- Adjust the size of some buffers.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport().

Approved by:	re (scottl)
2005-08-27 15:52:05 +00:00
jkoshy
7ff186d475 MFC:
[ hwpmc_mod.c:1.14,1.15 ]
 - Print PMC capabilities at module load time.

 - Return EOPNOTSUPP instead of EINVAL if a PMC allocation request
   specifies a PMC capability (e.g., sampling) that is not supported
   by hardware.  Return EINVAL early if the PMC class passed in is
   not recognized.

 [ hwpmc_x86.c:1.3 ]
 - On x86 processors, turn off 'INTERRUPT' capabilities on PMCs
   if the CPU does not have its local APIC enabled.

Approved by:	re (scottl)
2005-08-26 19:49:32 +00:00
jhb
827b28973d MFC: Various locking fixups including removing Giant from a bus dma
callback.

Approved by:	re (scottl)
2005-08-26 14:40:03 +00:00
jhb
fa602a439e MFC: Fix up locking and remove spls and support for 4.x.
Approved by:	re (scottl)
2005-08-26 14:35:45 +00:00
sos
4e9db3bd6f MFC:
Add support for working around controllers that cannot do DMA in 48bit.
	The workaround use PIO mode above ~137GB to allow using the disk.
	Add the Acer chips with rev < 0xc4 as first candidate.

	Add support for the Promise PDC4071[89] chips on the Fasttrak TX4300.
	Docs kindly provided by Promise.

	Apply fix for "pr82261 DMA-support on Sparc64 broken"

	Use the bio field instead of the driver field as intended.

	Dont set default mode to ATA_DMA_MAX on devices not capable of DMA.

Approved by: re@ (scottl)
2005-08-25 16:21:05 +00:00
rwatson
e13b2df854 Merge linux_ioctl.c:1.128 svr4_sockio.c:1.17 altq_cbq.c:1.3 if_oltr.c:1.38
if_pflog.c:1.14 if_pfsync.c:1.21 if_an.c:1.70 if_ar.c:1.72 if_arl.c:1.11
amrr.c:1.10 onoe.c:1.10 if_ath.c:1.101 awi.c:1.41 if_bfe.c:1.27
if_bge.c:1.93 if_cm_isa.c:1.7 smc90cx6.c:1.16 if_cnw.c:1.20 if_cp.c:1.25
if_cs.c:1.42 if_ct.c:1.26 if_cx.c:1.46 if_ed.c:1.256 if_em.c:1.68
if_en_pci.c:1.37 midway.c:1.66 if_ep.c:1.143 if_ex.c:1.58 if_fatm.c:1.20
if_fe.c:1.93 if_fwe.c:1.38 if_fwip.c:1.8 if_fxp.c:1.244 if_gem.c:1.33
if_hatm.c:1.25 if_hatm_intr.c:1.20 if_hatm_ioctl.c:1.13 if_hatm_rx.c:1.10
if_hatm_tx.c:1.14 if_hme.c:1.39 if_ie.c:1.104 if_ndis.c:1.101
if_ic.c:1.24 if_ipw.c:1.10 if_iwi.c:1.10 if_ixgb.c:1.13 if_lge.c:1.41
if_lnc.c:1.113 if_my.c:1.31 if_nge.c:1.77 if_nve.c:1.10 if_owi.c:1.12
if_patm.c:1.9 if_patm_intr.c:1.6 if_patm_ioctl.c:1.10 if_patm_tx.c:1.10
pdq_ifsubr.c:1.28 if_plip.c:1.38 if_ral.c:1.12 if_ral_pci.c:1.2
if_ray.c:1.81 if_rayvar.h:1.22 if_re.c:1.49 if_sbni.c:1.21 if_sbsh.c:1.14
if_sn.c:1.48 dp83932.c:1.21 if_snc_pccard.c:1.9 if_sr.c:1.70 if_tx.c:1.91
if_txp.c:1.33 if_aue.c:1.92 if_axe.c:1.32 if_cdce.c:1.8 if_cue.c:1.59
if_kue.c:1.66 if_rue.c:1.23 if_udav.c:1.16 if_ural.c:1.12 if_vge.c:1.16
if_vx.c:1.58 if_wi.c:1.185 if_wi_pci.c:1.26 if_wl.c:1.68 if_xe.c:1.60
if_xe_pccard.c:1.30 if_el.c:1.68 i4b_ipr.c:1.35 i4b_isppp.c:1.31
kern_poll.c:1.20 bridge.c:1.94 bridgestp.c:1.4 if_arcsubr.c:1.27
if_atm.h:1.24 if_atmsubr.c:1.40 if_bridge.c:1.16 if_ef.c:1.35
if_ethersubr.c:1.196 if_faith.c:1.37 if_fddisubr.c:1.100 if_fwsubr.c:1.14
if_gif.c:1.54 if_gre.c:1.34 if_iso88025subr.c:1.70 if_loop.c:1.107
if_ppp.c:1.106 if_spppsubr.c:1.121 if_tap.c:1.57 if_tun.c:1.154
if_vlan.c:1.80 ppp_tty.c:1.67 ieee80211_ioctl.c:1.32 atm_if.c:1.31
ng_eiface.c:1.33 ng_ether.c:1.50 ng_fec.c:1.19 ng_iface.c:1.44
ng_sppp.c:1.9 ip_carp.c:1.30 ip_fastfwd.c:1.30 in6.c:1.53 nd6_nbr.c:1.31
natm.c:1.40 if_dc.c:1.162 if_de.c:1.168 if_pcn.c:1.72 if_rl.c:1.154
if_sf.c:1.84 if_sis.c:1.135 if_sk.c:1.108 if_ste.c:1.86 if_ti.c:1.109
if_tl.c:1.101 if_vr.c:1.106 if_wb.c:1.81 if_xl.c:1.194 from HEAD to
RELENG_6:

  Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
  IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
  ifnet.if_drv_flags.  Device drivers are now responsible for
  synchronizing access to these flags, as they are in if_drv_flags.  This
  helps prevent races between the network stack and device driver in
  maintaining the interface flags field.

  Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
  some less so.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)
2005-08-25 05:01:24 +00:00
rwatson
091aba35eb Merge if_ath.c:1.99 awi.c:1.39 if_bfe.c:1.26 if_bge.c:1.92 if_ed.c:1.255
if_em.c:1.67 if_ex.c:1.57 if_fe.c:1.92 if_fxp.c:1.242 if_gem.c:1.32
if_hme.c:1.38 if_ie.c:1.103 if_ndis.c:1.100 if_ixgb.c:1.12 if_lge.c:1.40
if_lnc.c:1.112 if_my.c:1.30 if_nge.c:1.76 if_nve.c:1.9 if_owi.c:1.11
pdq_ifsubr.c:1.27 if_ray.c:1.80 if_re.c:1.47 if_sn.c:1.47 dp83932.c:1.20
if_tx.c:1.90 if_txp.c:1.32 if_aue.c:1.91 if_axe.c:1.31 if_cue.c:1.58
if_kue.c:1.65 if_rue.c:1.22 if_udav.c:1.15 if_vge.c:1.15 if_wi.c:1.182
if_wl.c:1.67 if_xe.c:1.58 if_dc.c:1.161 if_de.c:1.167 if_pcn.c:1.70
if_rl.c:1.153 if_sf.c:1.83 if_sis.c:1.134 if_sk.c:1.107 if_ste.c:1.85
if_ti.c:1.108 if_tl.c:1.100 if_vr.c:1.105 if_wb.c:1.80 if_xl.c:1.193
from HEAD to RELENG_6:

  Modify device drivers supporting multicast addresses to lock if_addr_mtx
  over iteration of their multicast address lists when synchronizing the
  hardware address filter with the network stack-maintained list.

  Problem reported by:    Ed Maste (emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 16:50:46 +00:00
brooks
ff880e3c80 MFC rev 1.9, remove an incorrect and unnecessicary bzero of the softc.
Approved by:	re (kensmith)
2005-08-20 04:35:29 +00:00
brian
e0f3ccfd97 MFC: Make ichsmb unloadable
Approved by:	re (kensmith)
Sponsored by:	Sophos/ActiveState
2005-08-19 18:38:55 +00:00
brueffer
4ef6dbcae2 MFC: rev. 1.11
- add missing ether_poll_deregister
- add per-device polling
- move the setting of if_capenable further down so that the
  VLAN caps are honored as well

Approved by:	re (kensmith), ru
2005-08-16 20:49:47 +00:00
jkoshy
e9ef177e93 MFC { sys/dev/hwpmc/hwpmc_mod.c:1.13, sys/kern/kern_pmc.c:1.5,
sys/sys/pmckern.h:1.5 }

Fail the module loading process if the currently executing kernel
was not compiled with 'options HWPMC_HOOKS' or if the compiled-in
version numbers of the kernel and module are not in sync.

Approved by:	re (kensmith)
2005-08-15 18:46:13 +00:00
tobez
e539dc2e3b MFC: Recognize D-Link DGE-528(T) Gigabit as an re(4) device.
Approved by:	re (kensmith)
2005-08-15 14:02:37 +00:00
rwatson
71a8cbcb20 Merge two sets of changes relating to devfs device node cloning from
HEAD to RELENG_6: changes to introduce a credentialed version of the
clone event handler, and then changes to merge the regular and
credentialed versions into a single interface (along with updates to
existing consumers).  With this merge, 6.x and 7.x are in sync.

First batch merges devfs_devs.c:1.37, devfs_vnops.c:1.115,
kern_conf.c:1.187, tty_pty.c:1.138, mac_vfs.c:1.109, mac_biba.c:1.36,
mac_lomac.c:1.36, mac_mls.c:1.73, mac_stub.c:1.53, mac_test.c:1.61,
conf.h:1.223, mac.h:1.68, mac_policy.h:1.67 from HEAD to RELENG_6:

  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

Second batch merges scsi_target.c:1.68, coda_fbsd.c:1.43,
firewirereg.h:1.38, fwdev.c:1.47, nmdm.c:1.36, snp.c:1.100, dsp.c:1.82,
mixer.c:1.45, vkbd.c:1.9, devfs_vnops.c:1.117, tty_pty.c:1.139,
tty_tty.c:1.57, bpf.c:1.156, if_tap.c:1.56, if_tun.c:1.153,
smb_dev.c:1.28, conf.h:1.224 from HEAD to RELENG_6:

  Merge the dev_clone and dev_clone_cred event handlers into a single
  event handler, dev_clone, which accepts a credential argument.
  Implementors of the event can ignore it if they're not interested,
  and most do.  This avoids having multiple event handler types and
  fall-back/precedence logic in devfs.

  This changes the kernel API for /dev cloning, and may affect third
  party packages containg cloning kernel modules.

  Requested by:   phk

These changes modifies the kernel device driver API for device cloning,
and might require minor modifications to third party device drivers that
make use of devfs cloning.  It will not be merged to RELENG_5.

Approved by:	re (scottl)
2005-08-13 21:24:18 +00:00
njl
10f961b659 MFC 1.18: Fix for 99% being reported instead of 100% when one battery
is missing.

Approved by:	re (kensmith)
2005-08-12 17:29:58 +00:00
markus
4748e88afa MFC Rev. 1.8:
Don't lock when holding led_mtx, instead use AcpiOsQueueForExecution to defer
  the locking.

  Idea taken from: acpi_asus(4)

  Approved by:    philip
  Reported by:    avatar
                  Gordon Bergling <gbergling@0xfce3.net>

Approved by:	re (kensmith)
2005-08-11 15:35:58 +00:00
jhb
9817d79419 MFC: Correct some if tests to fix a confusing printf when we route a new
IRQ for a link.

Approved by:	re (kensmith)
2005-08-11 15:35:41 +00:00
iedowse
6c4eb2f0bb MFC 1.78: fix two bugs that caused page faults when using mice with
tilt movements.

Approved by:	re (kensmith)
2005-08-11 00:22:28 +00:00
avatar
b9be0961d1 MFC: (1.10) Fixing compilation bustage.
Approved by:	re (kensmith)
2005-08-09 01:27:31 +00:00
avatar
810c836d08 MFC: (1.7) Fixing compilation bustage.
Approved by:	re (kensmith)
2005-08-09 01:25:32 +00:00
sos
d1c511cad7 MFC:
Remove stale struct ata_channel declaration
        Add support for the ITE IT8211F controller
        Dont limit all transfers to DEV_BSIZE (stale dbug code)
        Hide the loaded/unloaded message behind bootverbose

Approved by: re@
2005-08-07 11:20:28 +00:00
jhb
0ef1901fa9 MFC: Convert the atomic pointer operations to operate on uintptr_t rather
than void *.

Approved by:	re (kensmith)
2005-08-05 19:44:00 +00:00
emax
c7034773d9 MFC if_an.c v1.69 to RELENG_6
Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()
are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following
WITNESS warning (produced when an(4) PCMCIA card is detached).
taskqueue_drain with the following non-sleepable locks held:
exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/
sys/dev/an/if_an.c:2836

Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.

Reviewed by:	imp
Approved by:	re (kemsmith)
2005-08-04 21:12:22 +00:00
anholt
117221bef4 MFC: r300 DRM support. Supports all current non-PCIE Radeons, as far as the
developers know.

Approved by:	re (kensmith)
2005-08-04 17:31:02 +00:00
cvs2svn
1947b07479 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-08-01 17:50:20 +00:00
csjp
f087bcb30a MFC revision 1.24
date: 2005/07/30 15:53:40;  author: csjp;  state: Exp;  lines: +2 -1
Add missing parenthesis around error handling code upon attaching
mlx devices. This fixes an issue where mlx device drives fail to be
detected at system boot.

Approved by:	re@ (scottl)
2005-07-31 00:41:53 +00:00
mux
e1c2a59068 MFC r1.241:
date: 2005/07/29 22:40:06;  author: mux;  state: Exp;  lines: +1 -0
  Add a new PCI id for fxp(4) cards found on ICH7-based systems.

  Submitted by:   Martin Nilsson <martin@gneto.com>

Approved by:	re@ (kensmith)
2005-07-30 21:45:32 +00:00
sam
e6f9083cad MFC of api changes (missed in previous commit)
Approved by:	re (kensmith)
2005-07-30 04:09:06 +00:00
sam
8764859484 Sync wireless support from HEAD:
o numerous net80211 fixes including fixes for internal bridging,
  frag threshold ioctl, rts threshold bounds checking, min wep
  length check, reject assoc requests w/ wpa/rsn ie when wpa
  is not configured
o misc api changes to reduce differences against forthcoming changes
o add stats for future use and reserve space
o probe inactive neighbors in adhoc mode before timing them out
o debug msg fixups (diff reduction against forthcoming code)
o driver mods to track api changes

Also for ath driver:
o fix diversity handling
o use any fixed antenna setting when sending beacons in adhoc mode

Approved by:	re (kensmith)
2005-07-29 23:31:04 +00:00
njl
afb90606d6 MFC: Bring acpi_battery support up to HEAD, changing the API slightly
and fixing various bugs.

Approved by:	re (kensmith)
2005-07-29 16:27:07 +00:00
njl
d3ce3a1a5c MFC: Use __FBSDID
Approved by:	re (kensmith)
2005-07-29 16:22:37 +00:00
delphij
76233f99bb MFC 1.123:
Allow PLAY_MSF, PLAY_TRACK, PLAY_TRACK_REL, PAUSE, PLAY_12 commands to pass
through umass(4), in order to make cdcontrol(1) to issue commands to a USB
CD driver.

The command IDs were obtained from the CAM subsystem.  This was tested
on half dozen of USB CD drivers from different vendors.

Suggested by:   "intron" <intron at intron dot ac>
PR:             usb/83439
Reviewed by:    sanpei
Approved by:	re (kensmith)
2005-07-29 15:39:26 +00:00
jkoshy
d8ee659609 MFC r1.9:
Fix breakage introduced in rev 1.7.

Approved by:	re (kensmith)
2005-07-29 03:01:40 +00:00
jkoshy
478aec733a MFC r1.12:
Use LK_CANRECURSE since when a PMC-owning process performs an exec(),
  the new text vnode is already locked by itself.

Approved by:	re (kensmith)
2005-07-29 02:58:34 +00:00
emax
15d63eb12f MFC to RELENG_6
Fix kernel panic with vkbd(4). Initialize mutex properly (set name), or else
WITNESS gets upset.

Approved by:	re (kensmith)
2005-07-25 16:16:52 +00:00
scottl
7ecd401320 MFC rev 1.55: Check the correct IDs for the Dell PERC3/S/Di filter driver.
Approved by: re
2005-07-22 16:29:51 +00:00
cvs2svn
b63ff29afc This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-20 21:10:58 +00:00
emax
339c3c8a5d MFC to RELENG_6
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.

Approved by:	re (kensmith)
2005-07-20 18:56:21 +00:00
rwatson
d558a17887 Merge if_sbsh.c:1.13 from HEAD to RELENG_6:
Mark if_sbsh as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:52 +00:00
rwatson
a1a683e30e Merge if_cnw.c:1.19 from HEAD to RELENG_6:
Mark if_cnw as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:08 +00:00
jhb
654d629916 MFC: Don't provide an acpi attachment for the non-pnp mss(4) driver.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:46:38 +00:00
jhb
030929c001 MFC: Don't probe PnP ISA devices.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:43:45 +00:00
cvs2svn
dd2adf2c10 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-11 04:14:43 +00:00
delphij
131d31afc1 Correct a minor typo.
Pointed out by:	Xuefeng DENG <dengxf at dengh com>
Approved by:	re (scottl)
2005-07-11 02:33:25 +00:00
sam
6d86e52425 remove local mods that snuck into rev 1.6
Approved by:	re (scottl implicit)
2005-07-10 22:25:44 +00:00