Commit Graph

2026 Commits

Author SHA1 Message Date
gdamore 34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
christos 1a9d8ea2c7 Fix use the proper ioh. 2006-07-08 18:19:01 +00:00
chap 710af63468 Ankh-Morpork, we have a MIDI driver....
Merge from chap-midi branch, after
~month for review
Comments by thorpej@ drochner@ and Alexandre Ratchov

Incorporated: points by thorpej@ drochner@; preliminary support for
a stats-collecting ioctl suggested by martin@ from comments by A.R.

PR kern/32441 kern/32442 kern/32567 kern/32588 kern/32694 kern/33590
kern/33614 and one instance of kern/32651

ok martin@
2006-06-30 13:56:25 +00:00
chap 2c3d85cc29 Not related to chap-midi branch; corrects two compilation errors induced
by a stack-police commit to the HEAD.  (Is this why so many comments about
catching up with -current say "here we go again"?)
2006-06-18 23:15:33 +00:00
xtraeme c731b8e426 * Improve description for all sensors.
* Fix some voltage values.
* Do not print rfact+data values for sensors without any returned data.
2006-06-11 18:15:17 +00:00
christos 7b128daa3b stack police: Introduce an opl_match function that uses malloc instead of
allocating ~2K of softc on the stack.
2006-06-09 21:55:33 +00:00
xtraeme 5ff5dfea17 Adapt to timecounters. 2006-06-08 05:00:25 +00:00
xtraeme 045e0f2d3d it_check(): check values from IT_RES48 and IT_RES52, if both are default
values specified by the chip, continue attaching the driver (previously
only checking IT_RES48 was enough and IT_RES52 was ignored).
2006-06-05 15:59:47 +00:00
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
xtraeme 33a96be9f2 Driver for iTE IT87xxF and compatibles hardware monitor. Add
commented out entries on GENERIC and GENERIC_LAPTOP.

Adapted from OpenBSD.
2006-05-13 09:02:18 +00:00
rpaulo b93659c243 Make wtintr() prototype static too.
In wtsense(), make msg local variable const.
2006-04-26 17:21:30 +00:00
rpaulo accfad23f5 Put back sys/proc.h for wakeup/tsleep.
Fix more typos.
2006-04-26 17:19:50 +00:00
rpaulo 9f28da272d Make 3rd argument of wtwait() const. 2006-04-26 17:18:41 +00:00
rpaulo be1f3d0d34 Fix an obvious typo. 2006-04-26 17:17:03 +00:00
rpaulo 1595c18c6b ktrace-lwp merge. 2006-04-26 17:15:08 +00:00
rpaulo bf691ec7e3 ANSIfy, statify, KNfy.
(and maybe deadfy some day?)
2006-04-26 17:13:27 +00:00
christos 9df2078720 Make this compile again. 2006-04-23 00:08:50 +00:00
christos 16843a2657 Make this compile again. We really need an ALL kernel. 2006-04-22 23:56:39 +00:00
christos 407368a46e Coverity CID 2453: Add negative checks. 2006-04-14 22:52:00 +00:00
christos d9cf854027 On second thought, the whole statement is wrong. 2006-04-14 21:53:40 +00:00
christos 69283d75e0 Coverity CID 723: Fix bogus test. 2006-04-14 21:51:35 +00:00
christos db694f7eca Coverity CID 1104: Return early if no mbuf. 2006-04-14 21:49:08 +00:00
christos bb2402826a Coverity CID 1540: Avoid array overrun 2006-04-14 19:56:40 +00:00
blymn 3c0adb7d99 Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
2006-04-14 13:09:05 +00:00
christos d7e1743903 PR/29683: Sergey Svishchev: Make this compile again.. 2006-04-13 23:16:33 +00:00
cube b08283e19d Fix grammar in a comment, and use named constants for better readability. 2006-04-13 09:47:19 +00:00
christos dd8ade94a0 Coverity CID 1320: Don't try to use drq16 as an index in an array if it is -1 2006-04-13 03:45:44 +00:00
christos afbea8995b Fix the MPU attachment on Aztech 1020 that has a separate mpu pnp device
instead of having the mpu in io[1]. From doomwarriorx at gmail dot com.
2006-04-13 00:30:19 +00:00
jmmv 7a51d4dddc Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called.  The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place.  There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
2006-04-12 19:38:22 +00:00
garbled 1de17f11a8 Add an option PCKBCNOTEST and defopt it. On the prep 7043 and 7248
machines, the keyboard controller will not pass this test, but if you
attach anyway, it works fine.  Note that this test is specifically
disabled in ic/pckbc.c, but given that it seems to work fine on other
machines, leave it defaulted to on.
2006-04-11 17:14:44 +00:00
thorpej 2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
thorpej 6e53f1366a Use device_parent(). 2006-03-25 23:14:58 +00:00
christos 5a57baa413 don't use MALLOC with a non-constant size; use malloc instead. 2006-03-17 23:29:07 +00:00
lukem a1f606d3fd Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
2006-03-08 23:46:22 +00:00
dsl 6f0f9f8763 Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
2006-01-29 21:42:40 +00:00
bouyer bf1a4d2af5 properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
  for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
2006-01-16 20:30:18 +00:00
yamt 7b826aac85 initialize necessary members of struct buf. PR/32462 from Reinoud Zandijk. 2006-01-06 09:21:44 +00:00
yamt 690d424f28 - add simple functions to allocate/free a buffer for i/o.
- make bufpool static.
2006-01-04 10:13:05 +00:00
perry 3d4ed1fbc7 __inline__ -> inline 2005-12-24 23:41:33 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
drochner 69f432c06d -put gpio stuff inside #if NGPIO > 0
-kill gba_name in attach arg, specify interface attribute
2005-10-11 15:58:37 +00:00
jmcneill b8a32e9d53 Attach to gpiobus. From OpenBSD. 2005-09-27 02:56:27 +00:00
drochner 46ed4b50c4 s/locdesc_t/int/g 2005-08-26 12:42:11 +00:00
drochner ea5766898f oops, too much mechanical renaming -- clearly separate searched and
found locators
2005-08-25 20:52:02 +00:00
drochner fa3cb84d62 replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
2005-08-25 18:35:38 +00:00
joff ad50acb4b6 Add toaster, tsdio, toasterlcd devices 2005-08-14 04:15:44 +00:00
joff d4bc23d662 wsdisplay device driver for the 4x40 text-mode LCD on the NetBSD/toaster 2005-08-14 04:15:18 +00:00
joff bb813453e2 Device driver that exposes the burner element, magnetic latch, and front-panel
LEDs of the TS-7200 NetBSD/toaster via sysctl.
2005-08-14 04:14:35 +00:00
joff 43b39c1131 Simple driver for Technologic Systems TS-DIO24 PC104 board. No
userland interface (yet), basically just can detect a TS-DIO24 on a ISA
bus and provide an attachment for sub-devices.

The TS-DIO24 contains 24 programmable digital input/outputs.
2005-08-14 03:50:34 +00:00
christos 2709ce754e Fix compilation with FD_DEBUG. 2005-07-30 14:49:35 +00:00
drochner 83ebaf0ea5 complete attachment if the temperature monotor was successfully awoken,
minor whitespace fixes
2005-07-29 11:25:13 +00:00
drochner 21275bf194 activate the temperature sensors if the device is in standby mode
on attach (as on Soekris boards), from Aaron Hodgen per PR kern/23598
2005-07-29 11:05:27 +00:00
christos d39684a368 make the isdn drivers compile again with -Wconst, -Wshadow 2005-07-09 02:05:09 +00:00
wiz 4082e99219 Update comment. 2005-06-28 10:16:33 +00:00
kent eabe9bbfa4 remove pss(4) driver. It has never been workable and has not been
compilable for a long time.
2005-06-28 08:36:47 +00:00
christos 2ccc3ff1e9 - add const
- avoid variable shadowing.
2005-05-30 04:32:38 +00:00
christos 57fa3798ac sprinkle const. 2005-05-29 22:12:37 +00:00
christos d675f4acb4 avoid nested variables 2005-05-29 22:12:26 +00:00
lukem 5e4045c6bb add __KERNEL_RCSID 2005-05-24 05:14:37 +00:00
christos 7cdea212c0 No 0x in front of %p... 2005-05-22 15:54:45 +00:00
christos 1a54f2152a PR/22058: Onno van der Linden: duplicate detection of isa ip.
Use some more undocumented bits to find out if the card is in pnp mode or not.
2005-05-12 18:53:08 +00:00
jdolecek fc38d3f3ac Make it possible for attachment to specify that the 16bit access shouldn't
be toggled in WE_MEM_{ENABLE|DISABLE} when receiving or transmitting packets.
Use this to switch the toggle off for MCA cards, since it causes NIC resets
there.

Fixes PR kern/26895 by Dave Barnes.
2005-04-03 10:56:59 +00:00
cube d2d1a8c05c Make pcppi(4) use attimer(4) to set the pitch of the bell.
In case you don't configure an attimer(4) device in your kernel config,
you will simply lose the ability to set the pitch.  It will still beep.
2005-03-25 23:09:00 +00:00
cube 040e3b19e5 Add attimer(4) driver, with ISA and ACPI attachments.
attimer(4) is the new body of the part of pcppi(4) that mapped the TIMER1
register to set the pitch of the bell.  It was necessary to separate them
in order to have a working ACPI attachment (as the two appear as different
devices in the ACPI structures).
2005-03-25 23:06:19 +00:00
xtraeme 3141856faf This needs <machine/bus.h> now. 2005-03-21 18:27:32 +00:00
xtraeme d1c67e4716 This needs <machine/bus.h>, needed for ACPI pcppi(4) attachment. 2005-03-21 17:16:10 +00:00
xtraeme 65f27995a2 Move the struct pcppi_softc into pcppivar.h, add in this file
pcppi_attach(), which now accepts "struct pcppi_softc";
Split ISA specific bits from pcppi_attach() into pcppi_isa_attach()
(needed by the upcoming pcppi(4) ACPI attachment).

Reviewed by christos@.
2005-03-21 14:05:18 +00:00
xtraeme a2dce2fece Use ANSI function declarations. 2005-03-21 10:51:52 +00:00
christos f048688c46 PR/29683: M. B. Buchanan: mcd driver has printf formatting compile issue
and sets the wrong field to the number of ports.
2005-03-12 22:54:48 +00:00
simonb 0467cc278e Add a missing return after an "if" that checks for something then
did nothing.
2005-02-28 05:05:02 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
thorpej df9803ce96 Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding.  Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes.  Place items described
by the SCSI Primary Commands document into scsi_spc.h.
2005-02-21 00:29:06 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
drochner 12ff682534 Whitespace police. The rest remains crap. 2005-02-01 20:33:58 +00:00
gson 8de9537c69 Update printf format in debug printf to account for sample_rate now
being an unsigned int.
2005-02-01 12:07:58 +00:00
kent c9ec679311 ansify and KNF 2005-01-14 03:41:45 +00:00
kent b85368e36f ansify and KNF 2005-01-13 15:01:27 +00:00
kent d69abf4ca0 - make this compile
- style fixes
2005-01-12 17:43:19 +00:00
kent 23b5d91433 merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
  - remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels.  Conversion information
is conveyed by stream_filter_list_t.
  - change the type of sample_rate: u_long -> u_int
  - add `validbits,' which represents the valid data size in
precision bits.  It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
 - add two parameters to set_params()
	stream_filter_list_t *pfil, stream_filter_list *rfil
   A HW driver should set filter recipes for requested formats
 - constify audio_params parameters of trigger_output() and
trigger_input().  They represent audio formats for the hardware.
 - make open() and close() optional
 - add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
 to round_blocksize()

* sw_code is replaced with stream_filter_t.
  stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
  converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
 - audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
 - audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
 - audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
 - ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-10 22:01:36 +00:00
tsutsui a9b3f31984 Some cosmetics:
- remove __P()
- use ansi decls
- u_int8_t, u_char -> uint8_t
- use macro for debug printfs
- some KNF
2005-01-09 16:59:41 +00:00
joff 8d1a86c97d add tscs 2005-01-08 02:56:35 +00:00
joff 4b903bb725 Support for TS-ETH10 PC/104 enet isa card based on CS8900 2005-01-08 02:55:52 +00:00
abs 964859d895 Fix comments regarding configration bounaries 2004-12-12 21:03:06 +00:00
thorpej d41e8f00bf Don't use "struct scsi_generic" in a hardware-defined structure. Instead,
use an array of 12 bytes.  Check the incoming CDB to see that it will fit,
and print and error and fail the command if it won't.
2004-12-07 14:50:56 +00:00
xtraeme 347378fc9f Add ACPI mpu(4) attachment, based on lpt_acpi.c by jmcneill@,
reviewed by christos@, cube@ and martin@.

While here, remove a printf() in mpu_attach() (ic/mpu.c) to remove
an empty line in some frontends (mpu_isa.c, etc).
2004-12-02 09:50:41 +00:00
thorpej 711247fa68 When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 23:33:29 +00:00
yamt 18f717bb90 constify audio_hw_if, midi_hw_if, and radio_hw_if. 2004-10-29 12:57:15 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
yamt 22399b45d0 change some members of struct buf from long to int.
ride on 2.0H.
2004-09-18 16:40:11 +00:00
drochner 1308c6d767 Separate the namespace for default (ie unspecified) locators used
by the isa.c bus driver and the "address/whatever not specified"
argument passed to leaf device drivers.
The former is "ISACF_XXX_DEFAULT" as generaterd by config(8), the latter
"ISA_UNKNOWN_XXX", defined in isavar.h.
This way we save a dependency of every ISA device driver on "locators.h".
2004-09-14 20:20:46 +00:00
drochner edb77e2a6d include "locators.h" explicitely where it is needed, so that
it can be removed in the isavar.h header eventually
2004-09-14 17:38:30 +00:00
drochner 863cb326e8 replace 7 identical instances if cfprint functions by a single one 2004-09-14 17:19:34 +00:00
drochner 46289e1fef Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
2004-08-30 15:05:15 +00:00
drochner 5fa053333d add centralized {eisa,isa,pci,agp,mca}busprint() functions which do
what tens of the bus' parents foo{...}bridge_print()s scattered around do
2004-08-30 10:30:38 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej 2926431abf Use ANSI function decls and "static". 2004-08-19 23:30:09 +00:00
drochner a758a2aba6 allow to detach child devices and (optional selectively) bus rescans,
using the new autoconf functions
2004-08-18 11:54:47 +00:00