Commit Graph

2421 Commits

Author SHA1 Message Date
maxv
89453def58 Remove isic(4). It is part of ISDN, which we are now retiring. 2018-09-22 16:22:22 +00:00
maxv
9d7954dab6 Remove daic(4), it has never been functional.
ok martin@
2018-09-19 13:58:26 +00:00
riastradh
d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
msaitoh
3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
maxv
6655fcaaf5 constify 2018-06-23 06:57:24 +00:00
msaitoh
4b508fb16e It's not required to include net/bpfdesc.h. Remove it. 2018-06-22 04:17:40 +00:00
jdolecek
b478cbed47 fix off-by-one in the mapping of the ISA DMA page registers, they actually
start at 0x81; the code used bus_space_map() starting from 0x80 but
used +1 offset for actual I/O, now it maps starting 0x81 and does I/O
without offset

the reads and writes work exactly the same as before, but this frees
0x80 for being mapped independantly

patch provided in PR kern/52468 by Jonathan Chapman; checked against the spec
and also FreeBSD sys/x86/isa/isa_dma.c
2018-05-29 06:14:33 +00:00
yamaguchi
bb9c38f4bf Use spin mutex to fix a panic
The GPIO part of wbsio(4) has a lock to keep the register access
order. In addition to the lock, gpio(4) has a look to prevent
multiple control through gpio_pin_ctl(). Those locks hold at
once when gpio_pin_ctl() is called, and the lock of gpio(4) hold
before that of wbsio(4).

Therefore, the wbsio(4) has to use spin lock if gpio(4) uses
spin lock.
2018-04-25 08:29:45 +00:00
mlelstv
f3a7ac8991 Fix an ancient typo, instead of setting the base address, the size
value is written leaving the autoconf setting (-1) as the address.
The value is only used for printing an attach message, the actual
pcdisplay_init code uses hard coded base addresses again.
2018-04-21 15:10:28 +00:00
jdolecek
a7910e25b4 use isa_intr_establish_xname() 2018-03-24 18:34:43 +00:00
msaitoh
8ecbb809ea Add NCT6796D. Some functions of NCT6796D is extended from NCT6795D,
but this commit doesn't support them yet.
2018-03-07 09:25:56 +00:00
pgoyette
7fdb7d5dce Handle watchdog attachment in the wbsio_rescan() function, where we
take care of other children.

ok knakahara@ and yamaguchi@
2018-02-20 01:53:39 +00:00
dholland
32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
tsutsui
e4c99f6264 Handle yet another atari specific quirk in the MI ISA fdc(4)/fd(4) driver.
This makes fd(4) drive(s) (which is necessary for installation)
properly attached on Milan.

atari uses "fdcisa" and "fdisa" for ISA fdc to co-exist other fd(4)
drivers, on-board (atari/dev/fd.c) one and Hades (atari/dev/hdfd.c) one.
2018-01-20 18:18:02 +00:00
pgoyette
b0ab52e7b1 Now that watchdog support has been added, make sure that a modular driver
requires the sysmon_wdog module.
2018-01-02 00:47:14 +00:00
christos
9c08206436 PR/52887: HITOSHI Osada: wbsio needs sysmon_wdog. 2018-01-02 00:25:35 +00:00
knakahara
2f00003c5d Improve the error log message to use product name. Implemeted by s-yamaguchi@IIJ, reviewed by msaitoh@n.o.
I just commit by proxy.
2017-12-13 00:31:46 +00:00
knakahara
b13537d02d Add an option to enable GPIO function of wbsio. Implemeted by s-yamaguchi@IIJ, reviewed by msaitoh@n.o.
I just commit by proxy.
2017-12-13 00:29:02 +00:00
knakahara
b317ff9c1b Add Watchdog timer implementation to wbsio(4). Implemeted by s-yamaguchi@IIJ, reviewed by msaitoh@n.o.
I just commit by proxy.
2017-12-13 00:27:53 +00:00
knakahara
d1310c7326 Fix NCT6779 gpio pin configuration. Implemeted by s-yamaguchi@IIJ, reviewed by msaitoh@n.o.
I just commit by proxy.
2017-12-13 00:27:01 +00:00
knakahara
2934f9b4f4 Add wbsio(4) GPIO driver. Implemeted by s-yamaguchi@IIJ, reviewed by msaitoh@n.o.
I just commit by proxy.
2017-12-13 00:26:06 +00:00
msaitoh
419a28baa0 s/Id/NetBSD/. Pointed out by wiz! 2017-11-15 10:13:11 +00:00
msaitoh
6fa7a33d6c Restore NetBSD RCS Id which was accidentally removed in rev. 1.2. 2017-11-15 09:13:26 +00:00
nat
5f873527bc Add AUDIO_ENCODING_SLINEAR to supported encodings. This allows sb, sbpro
& sb16 to configure with 8-bit precision.

Tested in games/mame with a 486DX emulation.
2017-11-04 01:46:56 +00:00
nat
cadf46dc9e Add padding to gus.c so fields match up when it ts cast to a ad1848_isa
softc for the allocation of hw ring buffers.

Locking fixes as gus KASSERTS / uses the codec locks.

Ok christos@.
2017-10-31 21:53:48 +00:00
maya
18b796d442 Use C99 initializer for filterops
Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};
2017-10-25 08:12:37 +00:00
jdolecek
62fb613155 move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
2017-10-20 07:06:05 +00:00
jdolecek
26cf68556f Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch
ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
2017-10-07 16:05:31 +00:00
msaitoh
6c6661e72c Add IT8728F and IT877[12]E. 2017-09-12 09:54:45 +00:00
msaitoh
beeeafc6d4 - WBSIO_ID_W83627DHG and newer devices have 12bit device ID. So, change sioid
from 8bit to 16bit and check with it strictly.
- s/lm_match/nslm_match/
- split {wb,lm,def}_match() to XXX_match and XXX_attach().
- Rename lm_probe with lm_match and call {wb,nslm,def}_match() at the end of
  the function to check strictly.
- NCT610[246]D is different from otehrs, so add new nct6102d_sensors[] table.
- Register offsets of vendor ID and chip id of NCT610[246]D are different
  from others. When it failed reading vendor ID or chip ID, fallback to
  NCT610[246]D's register offsets.
- Add debug messages.
2017-08-18 04:07:51 +00:00
msaitoh
43565adf9b Print chip name correctly. 2017-08-17 05:32:04 +00:00
msaitoh
3ad4b27256 Use uint8_t instead of int. No functional change. 2017-08-17 05:27:48 +00:00
hauke
42554a387c Enable the IT8628E shipped with my gigabyte GA-N3150N-D3V board.
XXX These IT suoer IO chips appear to be all fairly alike. Maybe add a
comprehensive list of IDs to recognize them, then deal with the
fallout?
2017-08-14 11:49:30 +00:00
msaitoh
3c99b9a436 - Sprinkle static and const. No functional change.
- Print chip ID in hexadecimal instead of octal in def_match().
2017-08-09 04:45:38 +00:00
msaitoh
bf8f24ed11 lm(4): Add suport for NCT5174D, NCT6775F, NCT6779D and NCT679[1235]D.
wbsio(4): Add support for NCT6795D.
2017-07-11 10:10:51 +00:00
msaitoh
9c36467940 Add Winbond W83627DHG-P, W83627SF, W83627UHG, W83667HGB, W83687THF, W83697UG,
Nuvoton NCT5104D, NCT6775, NCT6779, NCT6791, NCT6792 and NCT6793.
2017-07-07 08:42:15 +00:00
pgoyette
762cf1319c Instead of directly referencing a parent device's code (ie, pcppi_bell()
routine), let the parent device pass a pointer to the code (in the aux
config data).  This allows us to load the spkr module without requiring
the pcppi parent device to exist.  (The spkr device can also have an
audio as parent.)
2017-06-14 05:01:35 +00:00
pgoyette
42ce32175a Implement xxx_rescan() and xxx_childdet() functions; these will be
needed when child device wsbell(4) becomes a separately-loadable
module.
2017-06-11 21:54:22 +00:00
msaitoh
b8e169d62e Use {isa,pci}_intr_establish"_xname"() for intrctl(8). 2017-04-27 10:01:53 +00:00
msaitoh
eabd5e1de9 Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
2017-03-31 08:38:13 +00:00
msaitoh
9842222b6c Fix 0x%d and 0x%u. 2017-03-29 09:04:35 +00:00
jakllsch
9aa5903c8e Use boolean logical and operation on booleans, rather than bitwise and.
From David Binderman in PR kern/51936.
2017-02-01 19:10:33 +00:00
pgoyette
d020b0ddde Implement a common spkr_detach() function and call it from the
attachment-specific detach functions.  Returns EBUSY if the
device instance is busy, based on whether or not a sc->sc_inbuf
is allocated.  The buffer is malloc()d at spkropen time, and is
free()d in spkrclose().

Now we can actually implement the MODULE_CMD_FINI command and
unload the driver at will.

Addresses my PR kern/51785
2017-01-06 09:32:08 +00:00
ozaki-r
dd8638eea5 Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input
The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
  - Where/When if_ipackets is counted up
  - Note that some drivers still update packet statistics in their own
    way (periodical update)
- Moved bpf_mtap run in softint
  - This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
2016-12-15 09:28:02 +00:00
pgoyette
3d9d9fc2de Create a single combined module for spkr_pcppi and spkr_audio, and
build it for all architectures.

By doing this, we can handle pcppi, audio, or both attachments with
non-built-in modules.

XXX Still to do: the module currently cannot be unloaded, and the
XXX spkr device(s) currently cannot be detached.  (Really, two
XXX sides of the same problem.)
2016-12-15 06:48:14 +00:00
christos
7ce3281839 print more info during autoconfig 2016-12-14 22:30:42 +00:00
christos
f3ef98b2ea correct spkr softc. 2016-12-14 21:52:43 +00:00
christos
0b335da6c0 Restructure speaker devices so that there can be multiple of them, and have
proper softc's.
2016-12-13 20:20:34 +00:00
maya
44e7baede1 Be explicit about precedence of operators
Appeases clang when building an ALL kernel
2016-12-10 17:41:44 +00:00
christos
2721c61205 put back spkrio.h for compat 2016-12-09 06:04:06 +00:00