Commit Graph

13712 Commits

Author SHA1 Message Date
Hajimu UMEMOTO
b3130703e6 get current temperature from _TMP during passive cooling is active.
it makes CPU freq transition smooth.
2005-08-25 11:31:30 +00:00
Hajimu UMEMOTO
9b96aa9ad7 initialize only ACPI_BUFFER to avoid race condition with passive
cooling thread which refers psv, tc1, tc2 and tsp.  The previous
code made the period where sc->tz_zone.tsp was zero, and it caused
panic at msleep().

Reported by:	keramida
Tested by:	keramida
2005-08-25 10:50:36 +00:00
John Baldwin
00d101cf1f - Remove redundant assertions that the driver lock is not held in attach()
and detach() since mtx_lock() will assert that already since the driver
  lock is not recursive.
- Move the call to callout_init_mtx() before hme_stop() so that the
  callout_stop() in hme_stop() doesn't operate on an uninitialized callout
  structure during attach.

Reported by:	yongari (2)
MFC after:	3 days
2005-08-24 20:28:56 +00:00
Ian Dowse
f1129b105e Provide the USB device release number along with other parameters
so that devd can match on it. This field was already available to
usbd and is used by a number of usbd.conf entries, so now it is
possible to transfer those entries to devd.conf.

Submitted by:	Anish Mistry
2005-08-23 21:32:49 +00:00
Søren Schmidt
70037ab36a Apply fix for "pr82261 DMA-support on Sparc64 broken"
The Acer chip or wiring that SUN uses has problems that this patch
tries to work around.
Original patch by Marius Strobl, hacked into shape by me..
2005-08-23 08:53:01 +00:00
Joseph Koshy
e753fde4e6 On x86 processors, turn off any 'INTERRUPT' capabilities on PMCs
if the CPU does not have its local APIC enabled.

MFC after:	3 days
2005-08-22 18:20:41 +00:00
Joseph Koshy
744d67975f 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.

MFC after:	3 days
2005-08-22 18:18:20 +00:00
Joseph Koshy
a8eb16c5ea Print PMC capabilities at module load time.
MFC after:	3 days
2005-08-22 17:51:08 +00:00
Søren Schmidt
971846e49c Fix problem on Promise "mio" controllers and 48bit mode caused by last commit 2005-08-22 11:38:53 +00:00
Joseph Koshy
d4d6be499f Turn off sampling modes on the AMD64 till the time I can track down
the reason for the double fault seen when sampling under load.

MFC after:	3 days
2005-08-22 02:59:51 +00:00
Warner Losh
fa949fc86d if_ral_pccard does not depend on pccard module directly, but rather
depends, like all other pccard drivers, indirectly through kobj on
pccard.  Therefore, it is not appropriate to force pccard to be loaded
when if_ral.ko is loaded.  This makes it possible to load if_ral w/o
loading pccard.ko on, eg, pci only systems.
2005-08-22 00:20:28 +00:00
Damien Bergamini
30feefb1d2 Fix basic rates set for 802.11a/g operating modes. This can significantly
improve transfer rates in 802.11a/g.  Fix IFS settings in ral(4) too.

MFC after:	6 days
2005-08-21 14:16:20 +00:00
Damien Bergamini
fb533d55c6 Enhanced WME (802.11e) support. 2005-08-21 09:52:18 +00:00
Damien Bergamini
ec01dc2bbc Add some necessary bits for upcoming 802.11e support:
o management of multiple tx rings (up to 4)
o setting of WME IE in association requests

Some features are still missing though, like the possibility to override
the default cwmin/cwmax/asfn values of each tx queues.
2005-08-20 16:49:03 +00:00
Damien Bergamini
d599e39db8 Remove IEEE80211_C_WPA from capabilities flags. WPA support is not fully
implemented in ipw.

MFC after:	1 week
2005-08-20 15:03:41 +00:00
Damien Bergamini
4ab4bbc6fe Export adapter's internal statistics sysctl even if IPW_DEBUG is not defined.
MFC after:	1 week
2005-08-20 14:41:16 +00:00
Damien Bergamini
94a7a9a24d Export adapter's internal statistics sysctl even if IWI_DEBUG is not defined.
MFC after:	1 week
2005-08-20 14:34:54 +00:00
Damien Bergamini
e0454c269b Don't automatically start scanning in if_init() if IEEE80211_ROAMING_MANUAL
flag is set.

MFC after:	1 week
2005-08-20 14:28:37 +00:00
John Baldwin
c8b27aca43 Fixup locking and mark MPSAFE:
- Add locked versions of start and init.  The SRM_MEDIA code in dc_init()
  stayed in dc_init() instead of moving to dc_init_locked() to make the
  locking saner.
- Use callout_init_mtx().
- Fixup locking in detach and ioctl.
- Lock the driver in the ifmedia callouts.
- Don't recurse on the driver lock.
- De-spl.

MFC after:	3 days
2005-08-18 19:10:07 +00:00
John Baldwin
2a3e25a07f Fixup locking for sf(4) and mark MPSAFE:
- Add locked variants of start, init, and ifmedia_upd.
- Use callout_* instead of timeout/untimeout.
- Don't recurse on the driver lock.
- Fixup locking in ioctl.
- Lock the driver lock in the ifmedia handlers rather than across
  ifmedia_ioctl().

Tested by:	brueffer
MFC after:	3 days
2005-08-18 17:09:16 +00:00
Maxim Sobolev
536fde3465 In re_shutdown() mark interface as down since otherwise we will panic if
interrupt comes in later on, which can happen in some uncommon cases.

Another possible fix is to call re_detach() instead of re_stop(), like
ve(4) does, but I am not sure if the latter is really RTTD, so that stick
with this one-liner for now.

PR:		kern/80005
Approved by:	silence on -arch, no reply from selected network gurus
2005-08-18 14:29:01 +00:00
Brooks Davis
d3c497e1c8 Remove an unnecessicary bzero that was zeroing the softc's struct ifnet
pointer.

Submitted by:	brueffer
Reviewed by:	dfr
2005-08-17 18:53:06 +00:00
John Baldwin
8a8573fdb2 - Use htole32() instead of using bswap32() conditional on #if BYTE_ORDER.
- Don't set IFF_ALLMULTI in our ifnet's if_flags if we end up allowing
  all multicast due to limits in the MAC receive filters in hardware.

Requested by:	rwatson (2)
2005-08-17 17:46:51 +00:00
John Baldwin
6da5b383f1 Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros. 2005-08-17 17:45:19 +00:00
John Baldwin
9eda9d7ac5 Add callout_drain()'s to foo_detach() after calling foo_stop() to make sure
that if softclock is running on another CPU and is blocked on our driver
lock, we will wait until it has acquired the lock, seen that it was
cancelled, dropped the lock, and awakened us so that we can safely destroy
the mutex.

MFC after:	3 days
2005-08-17 17:44:32 +00:00
Hajimu UMEMOTO
c219fd0c5e don't raise cpu speed over the value when passive cooling is in
effect.  since CPU speed is restored by degrees, we cannot use
the facility of saving cpu speed by CPUFREQ_set() effectively.
so, we need to save the value when passive cooling is in effect.

Repoeted by:	Kevin Oberman <oberman__at__es.net>
2005-08-17 17:01:25 +00:00
Søren Schmidt
85047b1b0c Add support for working around controllers that cannot do DMA in 48bit mode.
The workaround use PIO mode above ~137GB to allow using the disk.
Add the Acer chips with rev < 0xc4 as first candidate.
2005-08-17 15:00:33 +00:00
Søren Schmidt
fb235b243c Use the bio field instead of the driver field as intended. 2005-08-17 14:50:18 +00:00
John Baldwin
45f3f78ced Catch up to ic_curchan changes by making the same change here that was made
in ipw(4) in the earlier ic_curchan mega commit.

Submitted by:	Øyvind Kolbu oyvind at kolbu dot ws
Tested by:	Stefan Ehmann shoesoft at gmx dot net
2005-08-17 14:08:52 +00:00
Christian S.J. Peron
8677689134 Ensure that file flags such as schg, sappnd (and others) are honored
by md(4). Before this change, it was possible to by-pass these flags
by creating memory disks which used a file as a backing store and
writing to the device.

This was discussed by the security team, and although this is problematic,
it was decided that it was not critical as we never guarantee that root will
be restricted.

This change implements the following behavior changes:

-If the user specifies the readonly flag, unset write operations before
 opening the file. If the FWRITE mask is unset, the device will be
 created with the MD_READONLY mask set. (readonly)
-Add a check in g_md_access which checks to see if the MD_READONLY mask
 is set, if so return EROFS
-Do not gracefully downgrade access modes without telling the user. Instead
 make the user specify their intentions for the device (assuming the file is
 read only). This seems like the more correct way to handle things.

This is a RELENG_6 candidate.

PR:		kern/84635
Reviewed by:	phk
2005-08-17 01:24:55 +00:00
John Baldwin
ca5fc32d02 Fixup locking in if_my(4) and mark it MPSAFE:
- Add locked variants of my_start() and my_init().
- Assert that the lock is held in several places rather than recursing.
- Overhaul failure case handling in my_attach() so that it will actually
  clean up completely in each of the failure cases.
- Setup the interrupt after ether_ifattach() in my_attach().
- Remove unused callout handle from softc.
- Free the metadata for the descriptors my_in detach() (we leaked it
  before).
- Fix locking in my_ioctl().
- Remove spls.

Tested by:	brueffer
MFC after:	3 days
2005-08-16 20:39:30 +00:00
Marius Strobl
1b279bfb52 - 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. Instead
  check whether input and output refers to the same device and is of
  type serial (uart(4) was already doing this) and for the fallback
  to a serial console in case a keyboard is the selected input device
  but unplugged do the same for stdin and stdout in case the input
  device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard'
  property (RS232 keyboards). Additionally also check whether the OFW
  did a fallback to a serial console in the same way in case the
  output device is nonexistent. 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.
  This fixes selecting a serial console and the appropriate device
  when using a device path for the 'input-device' and 'output-device'
  OFW environment variables instead of an alias for the serial device
  to use or when using a screen alias that additionally denotes a
  video mode (like e.g. 'screen:r1024x768x60') but no keyboard is
  plugged in (amongst others). It also makes the code select a serial
  console in case the OFW did the same due to a misconfiguration like
  both 'input-device' and 'output-device' set to 'keyboard' or to a
  nonexisting device (whether the OFW does a fallback to a serial
  console in case of a misconfiguration or one ends up with just no
  console at all highly depends on the OBP version however).
- Reduce the size of buffers that only ever need to hold the string
  'serial' accordingly. Double the size of buffers that may need to
  hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a'
  exceeds 32 chars.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport() as it's unused there and future
  use is also unlikely.

MFC after:	1 week
2005-08-15 20:58:36 +00:00
Warner Losh
1dd467ac95 Some preliminary support for Megahertz XJEM and CCEM (same cards really)
combo cards.
2005-08-15 18:28:49 +00:00
Warner Losh
dfad9073ad Diff reduction to my tree: commit the trivial part of efforts to add
support for the really old Megahertz ethernet/modem combo cards.
2005-08-15 17:20:34 +00:00
Bjoern A. Zeeb
e3c18d1d11 * Solve "No PHY found" problem for more Yukon Lite variants.
* Catch a bus attach error.
* Improve locking.

MFC after:	6 days
2005-08-13 11:13:12 +00:00
Sam Leffler
b831470b4d fix handling of the current channel (missed in previous commit) 2005-08-13 00:30:26 +00:00
Sam Leffler
80f05a81d9 fix media_status so devd recognizes the device as an 802.11 interface
Submitted by:	Robert C. Noland III
2005-08-13 00:04:42 +00:00
Sam Leffler
6ee571b27a correct CTS duration calculation; SIFS+ACK should use the xmit rate not
the rate for CTS

MFC after:	3 days
Obtained from:	Atheros
2005-08-12 23:11:44 +00:00
Søren Schmidt
c7dc7718f6 Add support for the Promise PDC4071[89] chips used on fx the Fasttrak TX4300.
Docs kindly provided by Promise.
2005-08-12 16:54:11 +00:00
Nate Lawson
84cdcfb36f Modify the fix in rev 1.16 slightly. Instead of setting the cap to zero,
just skip summing it if it's unknown.

MFC after:	1 day
2005-08-11 17:12:57 +00:00
John Baldwin
22f6205d3b Use device_printf() and if_printf() and remove dc_unit from softc. 2005-08-10 20:33:46 +00:00
John Baldwin
fc8c1e5d98 Use if_printf() and device_printf() and axe sf_unit from the softc as a
result.
2005-08-10 20:24:39 +00:00
John Baldwin
bd295e68c6 - Remove pre-new-bus code under #if 0 and some other rotted code under
#if 0.
- Use pci_enable_busmaster() to enable busmastering instead of frobbing
  the command register directly.
- Don't check to see if memory or I/O can be enabled by writing to the
  command register.  The PCI bus driver's bus_alloc_resource() method
  already checks this and will fail if it can't enable the bit.
2005-08-10 20:21:29 +00:00
John Baldwin
1261113169 - Use if_printf() and device_printf() instead of outputting my%d:
everywhere.  This means that my_unit is no longer used as well.  The
  watchdog routine now also prints 'my0: ...' rather than 'm0x0: ...'.
- Don't bzero the softc and don't try to free it in detach or if attach
  fails.
- A whitespace fix.
2005-08-10 20:15:56 +00:00
John Baldwin
3e17bf524e - Use callout_init_mtx() to close races between hme_stop() and hme_tick().
- Use the driver lock instead of Giant in a bus dma callback.
- Clear IFF_DRV_(RUNNING|OACTIVE) in hme_stop() instead of just clearing
  RUNNING in hme_ioctl() to be more like other ethernet drivers.
- Lock the driver lock around mii operations.
- Remove spls.
- Cleanup locking in hme_ioctl().

MFC after:	1 week
2005-08-10 20:12:25 +00:00
Sam Leffler
b5c9941514 Clarify/fix handling of the current channel:
o add ic_curchan and use it uniformly for specifying the current
  channel instead of overloading ic->ic_bss->ni_chan (or in some
  drivers ic_ibss_chan)
o add ieee80211_scanparams structure to encapsulate scanning-related
  state captured for rx frames
o move rx beacon+probe response frame handling into separate routines
o change beacon+probe response handling to treat the scan table
  more like a scan cache--look for an existing entry before adding
  a new one; this combined with ic_curchan use corrects handling of
  stations that were previously found at a different channel
o move adhoc neighbor discovery by beacon+probe response frames to
  a new ieee80211_add_neighbor routine

Reviewed by:	avatar
Tested by:	avatar, Michal Mertl
MFC after:	2 weeks
2005-08-10 16:22:30 +00:00
David E. O'Brien
c11ba30c9a Remove public declarations of variables that were forgotten when they were
made static.
2005-08-10 07:10:02 +00:00
David E. O'Brien
35038adf6e Fix FBSDid style nit. 2005-08-10 03:56:31 +00:00
David E. O'Brien
fba19691c7 Add proper copyright attribution. 2005-08-10 03:54:37 +00:00
John Baldwin
fcde23065f Call tulip_start() rather than tulip_ifstart() from the interrupt handler
to avoid recursing on the driver lock.  Not sure why my test box didn't
catch this earlier.

MFC after:	3 days
2005-08-09 21:53:26 +00:00
Paul Saab
7a0c10de8d There's no reason to check the valence. This allows ciss to work
on the P600.
2005-08-09 20:53:51 +00:00
Robert Watson
13f4c340ae 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
MFC after:	7 days
2005-08-09 10:20:02 +00:00
John Baldwin
3212724cc0 - Use callout_init_mtx() to close a small race between callout_stop() and
the timeout routine.
- Fix locking in detach.
- Add locking in shutdown.
- Don't mess with the PCI command register in resume, the PCI bus driver
  already does this for us.
- Add locking to the non-serial ifmedia routines.
- Fix locking in ioctl.
- Remove spls and support for 4.x.

MFC after:	1 week
2005-08-08 21:03:54 +00:00
Robert Watson
6a113b3de7 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
MFC after:	3 days
2005-08-08 19:55:32 +00:00
Paul Saab
16ee26fd9b Add support for HP branded 2610SA
MFC after:	3 days
Approved by:	scottl
2005-08-08 19:39:58 +00:00
Sam Leffler
c1225b52f6 Split crypto tx+rx key indices and add a key index -> node mapping table:
Crypto changes:
o change driver/net80211 key_alloc api to return tx+rx key indices; a
  driver can leave the rx key index set to IEEE80211_KEYIX_NONE or set
  it to be the same as the tx key index (the former disables use of
  the key index in building the keyix->node mapping table and is the
  default setup for naive drivers by null_key_alloc)
o add cs_max_keyid to crypto state to specify the max h/w key index a
  driver will return; this is used to allocate the key index mapping
  table and to bounds check table loookups
o while here introduce ieee80211_keyix (finally) for the type of a h/w
  key index
o change crypto notifiers for rx failures to pass the rx key index up
  as appropriate (michael failure, replay, etc.)

Node table changes:
o optionally allocate a h/w key index to node mapping table for the
  station table using the max key index setting supplied by drivers
  (note the scan table does not get a map)
o defer node table allocation to lateattach so the driver has a chance
  to set the max key id to size the key index map
o while here also defer the aid bitmap allocation
o add new ieee80211_find_rxnode_withkey api to find a sta/node entry
  on frame receive with an optional h/w key index to use in checking
  mapping table; also updates the map if it does a hash lookup and the
  found node has a rx key index set in the unicast key; note this work
  is separated from the old ieee80211_find_rxnode call so drivers do
  not need to be aware of the new mechanism
o move some node table manipulation under the node table lock to close
  a race on node delete
o add ieee80211_node_delucastkey to do the dirty work of deleting
  unicast key state for a node (deletes any key and handles key map
  references)

Ath driver:
o nuke private sc_keyixmap mechansim in favor of net80211 support
o update key alloc api

These changes close several race conditions for the ath driver operating
in ap mode.  Other drivers should see no change.  Station mode operation
for ath no longer uses the key index map but performance tests show no
noticeable change and this will be fixed when the scan table is eliminated
with the new scanning support.

Tested by:	Michal Mertl, avatar, others
Reviewed by:	avatar, others
MFC after:	2 weeks
2005-08-08 18:46:36 +00:00
Scott Long
98428b152b Retire the last of the FreeBSD 4.x compat code from the mly driver. 2005-08-08 12:23:27 +00:00
Scott Long
64682a68e2 Retire the FreeBSD 4.x compat code and __FreeBSD_version checks from the aac
driver.
2005-08-08 12:19:19 +00:00
Scott Long
9cf8dd43cf Complete the removal of __FreeBSD_version checks from the amr driver. The
driver had advanced enough over the years that direct sharing of code with
FreeBSD 4.x was in no way possible anymore.
2005-08-08 12:16:21 +00:00
Sam Leffler
d365f9c760 Cleanup beacon/listen interval handling:
o separate configured beacon interval from listen interval; this
  avoids potential use of one value for the other (e.g. setting
  powersavesleep to 0 clobbers the beacon interval used in hostap
  or ibss mode)
o bounds check the beacon interval received in probe response and
  beacon frames and drop frames with bogus settings; not clear
  if we should instead clamp the value as any alteration would
  result in mismatched sta+ap configuration and probably be more
  confusing (don't want to log to the console but perhaps ok with
  rate limiting)
o while here up max beacon interval to reflect WiFi standard

Noticed by:	Martin <nakal@nurfuerspam.de>
MFC after:	1 week
2005-08-08 03:30:57 +00:00
Scott Long
b60359e981 Remove a stale __FreeBSD_version check. 2005-08-07 23:53:00 +00:00
Scott Long
4b910da2ea The presence of a on __FreeBSD_version flagged some code that hasn't been in
the right spot since the FreeBSD 3.x days, if not earlier.
2005-08-07 23:51:53 +00:00
Warner Losh
3dd22bbe78 Other changes to this driver preclude its use on 4.x, so remove 4.x compat
code elsewhere in the driver.
2005-08-07 23:16:22 +00:00
Marius Strobl
079f9edfef Recognize the SAB82532 in USIII machines. 2005-08-07 13:37:25 +00:00
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