Commit Graph

13598 Commits

Author SHA1 Message Date
Nate Lawson
9396c1b2d1 When summing capacities, skip info from batteries that weren't present.
Previously, we used all info (including -1 or "not present") which would
keep the system from reaching 100% when charging.

Reported by:	Eric Anderson
MFC after:	2 days
2005-08-05 17:00:58 +00:00
Søren Schmidt
77ada08656 Add support for the ITE IT8211F controller. 2005-08-05 13:14:00 +00:00
Anton Berezin
32aa5f0e3e Recognize D-Link DGE-528(T) Gigabit as an re(4) device.
Submitted by:	Andrus Nomm <andrus@members.ee>
PR:		76780
MFC After:	1 week
2005-08-05 08:19:12 +00:00
Warner Losh
584d11ee54 When the MAC address is reported all zeros, then error is necessarily
0.  This means that we 'succeed' the attach, even after we've freed
the internal data bits.  This leads to a panic when you eject the card
with this problem.

Set error = ENXIO in the mac read zeros case.
2005-08-05 04:56:14 +00:00
Markus Brueffer
0873506fc0 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>
MFC after:	1 week
2005-08-04 22:48:36 +00:00
Søren Schmidt
08f7225609 Dont limit all transfers to DEV_BSIZE (stale dbug code)
Hide the loaded/unloaded message behind bootverbose
2005-08-04 18:39:36 +00:00
Hajimu UMEMOTO
fa4679950b don't do mutex locking around kthread_create() call.
Reported by:	Maxim Maximov <mcsi__at__mcsi.pp.ru>
2005-08-04 18:34:26 +00:00
Ian Dowse
16a0ad03b8 Fix two bugs that interacted to cause page faults in softclock()
when using mice containing a tilt movement: there was a missing
usb_callout_init() for the UMS_SPUR_BUT_UP quirk code, and UMS_T
was defined to the same flag value as UMS_SPUR_BUT_UP.

Reported by:	flz
MFC after:	3 days
2005-08-04 02:21:37 +00:00
Warner Losh
c2e94196e3 Minor style nits. 2005-08-03 15:07:14 +00:00
Justin T. Gibbs
286e947fee Correct attribution in clause three to address the correct copyright
holders.  The license that was approved for my changes to this driver
originally came from LSI, but the changes to the driver core are not
owned by LSI.

MFC: 1 day
2005-08-03 14:08:41 +00:00
Robert Watson
358371dcec Back out change accidentally committed as Makefile:1.21 -- a local
tweak to let the 6.x/7.x kernel series build on a 5.x userland.

Pointed out by:		njl
2005-08-03 00:47:33 +00:00
Robert Watson
13b203d0d7 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>
MFC after:		1 week
2005-08-03 00:18:35 +00:00
Maksim Yevmenkin
c20990577c Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.

Reviewed by:	imp
MFC after:	1 day
2005-08-02 16:03:51 +00:00
Christian Brueffer
906507dd4c - 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:	ru
MFC after:	2 weeks
2005-08-02 09:27:42 +00:00
Ruslan Ermilov
b34b221d77 Add missing ether_poll_deregister(). This is still not enough to
kldunload/kldload without a panic.  The same (but worse) problem
is also present in ixgb(4).
2005-08-02 08:44:45 +00:00
Eric Anholt
786d03d56a Fix a buffer aging problem in new r300 code that could lead to hangs with some
apps.

Obtained from:	DRM CVS
2005-08-01 17:50:19 +00:00
Tai-hwa Liang
0b1ae45dc5 Fixing compilation error by:
- Conforming to the latest ether_ifattach() change;
	- Moving PCCARD_API_LEVEL to the right place.

Reported and Tested by:	Vladimir Grebenschikov <vova at fbsd dot ru>
MFC after:		3 days
2005-08-01 13:51:52 +00:00
Warner Losh
049d6489ab Make the eisa probe messages just like all the others in the system.
Make the eisa no match printf closer to pci.
2005-08-01 07:09:15 +00:00
Matt Jacob
9f242f7893 AT_MAKE_TAGID needs an instance as the 2nd arg- not just a 0. 2005-07-31 23:21:19 +00:00
Alexander Leidinger
4442c32be7 Style fix.
Noticed by:	njl
2005-07-31 18:59:47 +00:00
Alexander Leidinger
87506547d2 Whats New:
1. Support wide range sampling rate, as low as 1hz up to int32 max
   (which is, insane) through new feeder_rate, multiple precisions
   choice (32/64 bit converter). This is indeed, quite insane, but it
   does give us more room and flexibility. Plenty sysctl options to
   adjust resampling characteristics.
2. Support 24/32 bit pcm format conversion through new, much improved,
   simplified and optimized feeder_fmt.

Changes:
1. buffer.c / dsp.c / sound.h
   * Support for 24/32 AFMT.
2. feeder_rate.c
   * New implementation of sampling rate conversion with 32/64 bit
     precision, 1 - int32max hz (which is, ridiculous, yet very
     addictive).  Much improved / smarter buffer management to not
     cause any missing samples at the end of conversion process
   * Tunable sysctls for various aspect:
       hw.snd.feeder_rate_ratemin - minimum allowable sampling rate
       (default to 4000)
       hw.snd.feeder_rate_ratemax - maximum allowable sampling rate
       (default to 1102500)
       hw.snd.feeder_rate_buffersize - conversion buffer size
       (default to 8192)
       hw.snd.feeder_rate_scaling - scaling / conversion method
       (please refer to the source for explaination). Default to
       previous implementation type.
3. feeder_fmt.c / sound.h
   * New implementation, support for 24/32bit conversion, optimized,
     and simplified. Few routines has been removed (8 to xlaw, 16 to
     8). It just doesn't make sense.
4. channel.c
   * Support for 24/32 AFMT
   * Fix wrong xruns increment, causing incorrect underruns statistic
     while using vchans.
5. vchan.c
   * Support for 24/32 AFMT
   * Proper speed / rate detection especially for fixed rate ac97.
     User can override it using kernel hint:
     hint.pcm.<unit>.vchanrate="xxxx".

Notes / Issues:
        * Virtual Channels (vchans)
          Enabling vchans can really, really help to solve overrun
          issues.  This is quite understandable, because it operates
          entirely within its own buffering system without relying on
          hardware interrupt / state. Even if you don't need vchan,
          just enable single channel can help much. Few soundcards
          (notably via8233x, sblive, possibly others) have their own
          hardware multi channel, and this is unfortunately beyond
          vchan reachability.
        * The arrival of 24/32 also come with a price. Applications
          that can do 24/32bit playback need to be recompiled (notably
          mplayer).  Use (recompiled) mplayer to experiment / test /
          debug this various format using -af format=fmt. Note that
          24bit seeking in mplayer is a little bit broken, sometimes
          can cause silence or loud static noise. Pausing / seeking
          few times can solve this problem.
          You don't have to rebuild world entirely for this. Simply
          copy /usr/src/sys/sys/soundcard.h to
          /usr/include/sys/soundcard.h would suffice. Few drivers also
          need recompilation, and this can be done via
          /usr/src/sys/modules/sound/.
          Support for 24bit hardware playback is beyond the scope of
          this changes. That would require spessific hardware driver
          changes.
        * Don't expect playing 9999999999hz is a wise decision. Be
          reasonable. The new feeder_rate implemention provide
          flexibility, not insanity. You can easily chew up your CPU
          with this kind of mind instability. Please use proper
          mosquito repellent device for this obvious cracked brain
          attempt. As for testing purposes, you can use (again)
          mplayer to generate / play with different sampling rate. Use
          something like "mplayer -af resample=192000:0:0 <files>".

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
2005-07-31 16:16:22 +00:00
Alexander Leidinger
fe435202da * Slightly new method to detect mixer capabilities and resolution.
This mostly to help CT4730, but apparently it does help other
  cards too (especially via8233x). This probably need further test
  and confirmation from other people with ac97 cards other than via
  / es137x.
* Aggresive dac power wake up call, again, to help CT4730 (and
  probably others).

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
2005-07-31 14:28:31 +00:00
Alexander Leidinger
c249345405 - Fixup the locking.
- Don't mark MPSAFE (yet).
- DSP_CMD_DMAEXIT_8 doesn't work on old cards, use sb_reset_dsp() instead.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 13:53:53 +00:00
Alexander Leidinger
7a7689dea4 - Fixup the locking.
- Don't mark MPSAFE (yet).

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 13:51:04 +00:00
Alexander Leidinger
205d75821e Add another ID.
Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 13:49:47 +00:00
Alexander Leidinger
01bec79c11 * Add locking / MPSAFE
* Add kernel hint option to disable DXS channels entirely. Report
  from several skype users / Pav Lucistnik indicate that disabling
  DXS may fix lots of pop / crackling noise. To disable DXS add
  hint.pcm.<unit>.via_dxs_disabled="1" to /boot/device.hints.
  Further investigation of the issues regarding DXS showed, that
  the problem is in another (more generic) place, but until the
  right fix is tested/reviewed this may help a little bit.

Added sysctl's to aid testing/debugging:
hint.pcm.<unit>.via_dxs_disabled=X - Disable / Enable DXS channels entirely
hint.pcm.<unit>.via_dxs_channels=X - Limit DXS channels up to X
hint.pcm.<unit>.via_sgd_channels=X - Limit SGD channels up to X
hint.pcm.<unit>.via_dxs_src=X      - Enable / Disable DXS sample rate
                                     converter.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
2005-07-31 13:43:42 +00:00
Alexander Leidinger
cc730bdd4a Fix a LOR introduced with the last commit (some hours ago), I had the
wrong version of the patch.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Pointy hat to:	netchild
2005-07-31 13:24:47 +00:00
Alexander Leidinger
69e10e5a1b Fix a LOR introduced in the last commit (some hours ago), I had the wrong
version of the patch...

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Pointy hat to:	netchild
2005-07-31 13:22:48 +00:00
Alexander Leidinger
ae93e580dd * Register programming error during device initialization
especially for CT4730 / EV1938 chip, causing misconfigured mixer
  (David Xu), crippled after power cycle (Kevin Oberman). Fixed.
* Incorporate locking/spdif patches from Jon Noack / matk. Not all
  es137x can really do spdif, clean it up a bit to only let few capable
  chip. This adds a "hw.snd.pcm<unit>.spdif_enabled" sysctl until
  a more generic way of handling this from userland (by an ordinary
  user) is designed/implemented.
* Convert all bus_space_(read|write) to use es_rd/es_wr, simmilar
  with other drivers.
* Add tunable hw.snd.pcm<unit>.latency_timer sysctl to toggle pci
  latency timer value on the fly. Much noise / pop / crackling
  issues can be solved by increasing its value. Other people have
  pointed out to use pciconf instead, but this is just an added
  value specific for CT4730/EV1938.
* Remove es137x specific debug sysctl/code.

Several PRs can now be closed.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Submitted by:	Jon Noack <noackjr@alumni.rice.edu> (implicit)
Submitted by:	matk (implicit)
PR:		59349, 68594, 73498
Tested by:	multimedia@
2005-07-31 13:19:38 +00:00
Alexander Leidinger
f769fa83d5 This driver is already MPSAFE, remove busdma_lock_mutex and Giant from
bus_dma_tag_create.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 12:38:22 +00:00
Alexander Leidinger
2b379e8d35 * Add locking / MPSAFE.
Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	netchild
2005-07-31 11:04:36 +00:00
Alexander Leidinger
1adf8286e7 * als4000 can't do 48k properly (perhaps it really can't at all!).
Set maxspeed to 44.1k instead.
* Add locking / MPSAFE
* Fix recording

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 11:01:13 +00:00
Alexander Leidinger
7233abab86 * Fix panic during driver unload on second attempt after failure on
first (device busy).
* Fix module unloading for sound.ko itself.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
2005-07-31 10:55:24 +00:00
Warner Losh
55234c1cf4 The isa attachment calls ep_free after it has already been called once
in the resource error in ep_alloc case.  This results in a panic.
Zero resources to make it safe to call twice pending resolution of
layering questions.

MFC After: 3 days
2005-07-31 03:33:22 +00:00
Warner Losh
48c912e4ce Add newer commands 2005-07-31 03:30:46 +00:00
Christian S.J. Peron
648fd2bd0b 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.

This is a RELENG_6 candidate.

Submitted by:	oliver
PR:		kern/84163
2005-07-30 15:53:40 +00:00
Joseph Koshy
fadcc6e201 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 out of sync.

Reported by:	cracauer
MFC after:	3 days
2005-07-30 09:02:42 +00:00
Maxime Henrion
86c8aacb07 Add a new PCI id for fxp(4) cards found on ICH7-based systems.
This commit is a RELENG_6 candidate.

Submitted by:	Martin Nilsson <martin@gneto.com>
2005-07-29 22:40:06 +00:00
Søren Schmidt
785a5193b7 Remove stale struct ata_channel declaration.
Reported by:	rodrigc
2005-07-29 18:14:06 +00:00
Paul Saab
6c9f6695fd Print the actual disk device we failed to complete i/o on. 2005-07-29 01:53:45 +00:00
Paul Saab
8c61487b21 Don't allow ioctl commands to be interrupted by the user. 2005-07-29 01:47:36 +00:00
Brian Somers
fa6e2680c0 Make ichsmb unloadable.
It seems that the unload problems were due to a dodgy sc->smb usage and a
missing mtx_destroy().

Sponsored by:	ActiveState/Sophos
MFC after:	3 weeks
2005-07-29 00:20:50 +00:00
Nate Lawson
e4515dd568 Add descriptions for the sysctls.
MFC after:	1 day
2005-07-28 19:34:51 +00:00
Nate Lawson
50d0e47aa7 Zero the _BST, _BIF, and battinfo allocations. This is needed since we
later sum capacities for all batteries, even those that weren't actually
present.  We only need to do this for _BST but do it for all of them.

Reported by:	Eric Anderson
MFC after:	1 day
2005-07-28 18:19:50 +00:00
Maksim Yevmenkin
8a03cf5c82 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

MFC after:	3 days
Silence from:	current@
2005-07-27 21:03:35 +00:00
John Baldwin
b88076fede Correct the order of some if tests so that we don't complain about being
unable to route an IRQ when we do route an IRQ ok but bootverbose is off.

Reported by:	Ben Kaduk minimarmot at gmail dot com
2005-07-27 15:21:32 +00:00
John Baldwin
d0e98e85f8 - Use callout_*() rather than timeout() to periodically poll the media.
- Add locking to protect the softc and mark this driver as MP safe.  There
  are still some edge cases with multiport cards that need more locking
  work.

MFC after:	1 week
Tested on:	alpha
2005-07-27 13:51:01 +00:00
Maxime Henrion
67685686ad 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.

This is an MFC candidate.
2005-07-25 22:21:11 +00:00
Nate Lawson
f4e31e2e89 Correct minor output bug. When the battery being queried is charging or
the overall discharge rate is 0, mark the battery remaining time as
"unknown", not 0.

Reported by:	Eric Kjeldergaard
MFC after:	4 days
2005-07-25 17:44:10 +00:00
Marius Strobl
8cfaff7d0b Remove NOP spl*() calls and add locking (making gem(4) MPSAFE).
Based on:	hme(4)
Reviewed by:	yongari
Tested on:	powerpc(grehan), sparc64
2005-07-24 18:45:15 +00:00