Commit Graph

2323 Commits

Author SHA1 Message Date
kardel d1abea10e2 adjust soekrisgpio driver to NetBSD 2013-06-10 07:14:01 +00:00
kardel 630a4e285d Import of proposed patch to OpenBSD for supporting GPIO and status
leds on a Soekris net6501

patch posted on 2013-01-14 17:11:00 at
http://permalink.gmane.org/gmane.os.openbsd.tech/31317
2013-06-10 06:04:35 +00:00
christos 7b845fa9dc phase 1 of disk geometry cleanup:
- centralize the geometry -> plist code so that we don't have
	  n useless copies of it.
2013-05-29 00:47:48 +00:00
mbalmer 7dd382bcbb No need to include machine/pio.h now that inb() and outb() are no longer used. 2012-12-17 17:46:27 +00:00
mbalmer 8ac00cd302 Fix the CVS Id marker. 2012-12-17 17:44:18 +00:00
mbalmer 21a6d3b7f6 ptcd(4) is a device driver for the cash drawer port found on Protech PS3100
point of sale terminals.  It controls the cash drawer using a gpio(4) device
that attaches at ptcd0:  Pin 0 controls the drawer, pin 1 reports the current
state.  For details read the manual page.
2012-12-16 13:09:18 +00:00
msaitoh 8f757e763b Add support for ITE8720F by Nat Sloss. PR#47169. 2012-11-15 04:45:01 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
jruoho 4f0c2c3f04 Collect rnd(9) entropy from coretemp(4), acpibat(4), aibs(4), hpacel(4),
thinkpad(4), and aps(4).
2012-08-14 14:36:43 +00:00
bouyer 9edd4d81c5 Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
2012-07-31 15:50:31 +00:00
jakllsch 102f7b2016 Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
2012-07-26 20:49:44 +00:00
bouyer 03c9df05c6 Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
  probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
  really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
  ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
  with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
  University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
  when SATA cable move was needed
2012-07-02 18:15:44 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
dsl ef15904712 Patch out the 'struct malloc_type' from the isa_dma alloc routines.
All the i386 kernels now build
2012-04-29 21:13:56 +00:00
plunky 1687854c43 Tidy up a little, the way that midi attachment code works
- change midi_attach() to omit the 'parent' arg (there are
  only two callers of this and it is not used)

- change midisyn_attach() to midisyn_init(), so not needing a midi_softc,
  and fix the midi_pcppi driver to set hw_if and hw_hdl directly in
  its midi_softc before calling midi_attach()

- add a device_t to opl_softc structure, change opl drivers to store
  the device 'self' in opl_softc and fix opl_attach() to use this
  opl_softc->dev field directly rather than a field in an otherwise
  unused midi_softc

- remove unnecessary midi_softc from opl and cms drivers (child device
  provides that)

reviewed by mrg
2012-04-09 10:18:16 +00:00
plunky 4946fc398d device_pmf_is_registered() is not required 2012-04-06 20:33:20 +00:00
plunky 37e862fcf6 device_pmf_is_registered() is not required 2012-04-06 20:16:58 +00:00
plunky 6948556de5 move the pmf_device_register() for midi.c and midi_pcppi.c to midi_attach()
for symmetry, since it is removed in midi detach code

and don't need to call device_pmf_is_registered() before registering it
2012-04-05 20:13:34 +00:00
matt 1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00
christos 388e208a62 PR/45932: Add missing braces... This will probably fix interrupts too! 2012-02-06 04:29:47 +00:00
tls 7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
matt 737a317ffe Use C89 prototypes. 2012-02-01 02:01:28 +00:00
christos 6fb39d18da add a tpm driver from bsssd.sourceforge.net 2012-01-22 06:44:28 +00:00
jakllsch 8f0ea367ff wbsio(4) rescan support. 2012-01-18 00:23:30 +00:00
jakllsch c178e583d6 Improve module dependency list. 2012-01-18 00:14:32 +00:00
jakllsch 3349f7e947 Improve module dependencies, clean up old #if 0 code. 2012-01-18 00:11:43 +00:00
jakllsch 32dd90c25f update for wbsio and lm changes 2012-01-17 18:05:15 +00:00
jakllsch 7db60498ba Make this compile. 2012-01-17 18:04:46 +00:00
jakllsch 3f9c821629 No module dependencies are denoted with NULL. Pointed out by jmcneill. 2012-01-17 17:17:15 +00:00
jakllsch 4dd99ce884 Modularize lm_isa and lm_wbsio, splitting the common part out
into a 3rd module.  Add wbsio module too.
2012-01-17 16:50:07 +00:00
jakllsch 70c82e3eee Add module glue. 2012-01-17 16:34:52 +00:00
jakllsch 74ac6cec3b Add and enable detachment and child detachment functions. 2012-01-17 16:32:03 +00:00
jakllsch b5ca2ea8e0 Add NULL pmf handlers. 2012-01-17 16:28:33 +00:00
jakllsch f3842730f2 Initialize the opl softc lock pointer to the parent's interrupt lock.
Briefly tested only on wss@isapnp.
2011-12-07 17:38:50 +00:00
christos f5e469b78a make joy code consistent (avoid games with pointers), and fix the isa softc
declaration
2011-12-05 19:20:54 +00:00
drochner 9dc717c79e stopgap fix to avoid panic due to recursive locking if the keyboard beep
is activated through a tty (which it usually is)
IMO it was no good idea to abuse tty_lock here - it is already
problematic in the tty subsystem
2011-11-26 15:54:51 +00:00
riastradh 6612803043 KASSERT(!mutex_owned(...)) is not kosher. 2011-11-25 22:40:02 +00:00
jakllsch 2c12aa993d Make locking in pcppi_pckbd_bell() work. Works around locking problems
triggered when an X server rings the console bell.
2011-11-25 14:31:44 +00:00
jakllsch ca6ee1e0e7 This hopefully completes the audiomp conversion of cms(4). 2011-11-24 16:11:02 +00:00
jakllsch 1aeefdff80 Make this compile without warnings.
(No static is better than inconsistent and partial use of static.)
2011-11-24 16:07:28 +00:00
mrg 8de08fa998 put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
2011-11-24 03:35:56 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
tls 3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
jakllsch 1d4d51395d Appease _LP64 build with GCC 4.5. 2011-08-07 19:46:22 +00:00
jakllsch ffb4d47223 The Fintek base address registers implement the bottom 3 bits as read/write,
but the address decoder in the chip ignores these three bits.  Do the same.
2011-07-31 18:23:46 +00:00
jmcneill 9f438526b6 modularize and recognize ASUS F8000 Super I/O chips 2011-07-31 17:53:26 +00:00
jmcneill 0d3a27d5dc modularize 2011-07-31 16:18:54 +00:00
jmcneill 60427626c4 add module support 2011-07-29 20:58:47 +00:00
jmcneill 17536f8e9e add module support 2011-07-15 20:56:26 +00:00
mrg 1ff8330243 fix sequence point errors. diff explains best:
-       sc->sc_playbuf = ++sc->sc_playbuf % sc->sc_nbufs;
+       sc->sc_playbuf = (sc->sc_playbuf + 1) % sc->sc_nbufs;
2011-07-02 13:14:46 +00:00