Commit Graph

38842 Commits

Author SHA1 Message Date
isaki
da8a629a85 round_blocksize must return a multiple of the framesize
even if 6 channels mode.
I believe that keeping "good alignment" is just a wish, not constraint.
2020-02-29 06:34:30 +00:00
isaki
098a1006a1 round_blocksize must return a multiple of the framesize.
It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
2020-02-29 06:25:33 +00:00
isaki
6e396296c4 round_blocksize must return a multiple of the framesize
even if passed blocksize is greater than the upper limit.
2020-02-29 06:06:29 +00:00
isaki
c509fb12bb Remove rounding by 4 bytes on round_blocksize().
For drivers which supports only 16bit * 2channels sampling,
rounding by 4 bytes no longer meaningful.
2020-02-29 05:51:10 +00:00
nisimura
8635cce95c add comments to show the RX filter intent 2020-02-29 04:27:53 +00:00
nisimura
8ad57d4b7d make sure to accept bcast frame all the time 2020-02-29 04:02:06 +00:00
nisimura
e1c0edcdfa iron out receive filter multicast/promisc logic 2020-02-29 02:51:14 +00:00
msaitoh
ca6a4f453f Replace bnx_ifmedia_upd() in bnx_init() with mii_ifmedia_change() for future
locking changes.
2020-02-28 14:57:55 +00:00
msaitoh
ebdef54f25 Replace bnx_ifmedia_upd() in bnx_mgmt_init() with mii_ifmedia_change() for
future locking changes. Suggested by thorpej@.

 XXX Need more work for bnx_ifmedia_upd() itself.
2020-02-28 14:20:06 +00:00
isaki
d86c3d1145 Drop 512 bytes limit on auvia_round_blocksize().
This fixes attach on 6 channels device.
PR kern/55017.
2020-02-28 13:31:03 +00:00
macallan
8fbd006440 - document the config register
- do some setup and send a start command
- mark the sensor as invalid if readings are out of range
now this works properly on my PCI-X G5
2020-02-28 13:18:25 +00:00
msaitoh
e72e0efefb When a media change is requested, don't just all (*if_init)(). That's
needlessly disruptive and incompatible with future locking changes.
We can use ether_mediachange() instead.
2020-02-28 06:53:22 +00:00
yamaguchi
f6ee8e280e Update sc->sc_parent->dk_rawvp while the lock named dk_rawlock held
to prevent a race condition

Fixes PR kern/55026

OKed by mlelstv@, thanks
2020-02-28 06:01:23 +00:00
msaitoh
3102c6481b Move PHY_RESET() in the media change path from if_et.c to etphy.c.
I don't know if the reset is required or not. I tested some media
transitions without the reset and it worked. It might be OK to remove
but Linux does it only in et1011c_config_aneg(). So move the reset to
etphy_service(,,MII_MEDIACHG)'s autonego case. This change is also
required for future locking changes.
2020-02-28 05:13:19 +00:00
sevan
322778c4e2 Cast to make up for the difference in type between our bus_dma_map(9) and
theirs. Where we expect kvap to be of void **, they expect caddr_t (typedef char *).
2020-02-27 23:15:34 +00:00
sevan
657257e0c1 Add an implementation of MCLGETI.
Borrowed from sys/dev/pci/if_bwfm_pci.c
2020-02-27 22:58:57 +00:00
jmcneill
05c715360e Explicit format string for snprintf, spotted by tnn@ 2020-02-27 17:30:07 +00:00
msaitoh
89323825a1 Regen. 2020-02-27 06:17:50 +00:00
msaitoh
5bb46a41c0 Use xxVIA instead of VIA.
0x004063 is VIA's official OUI but VT6103 use 0x0002c6.
0x0002c6 is non-bitreversed value of 0x004063. Reported by Andrius V.
2020-02-27 06:17:28 +00:00
ryoon
34b05ae8e7 Messages in pms_synaptics_input() should not start with "pms_input"
Use "pms_synaptics_input" instead for another 2 messages.
2020-02-25 21:41:38 +00:00
ryoon
2fce724e2a Messages in pms_synaptics_input() should not start with "pms_input"
Use "pms_synaptics_input" instead.
2020-02-25 21:38:42 +00:00
ryoon
38b76fc7a8 Do not enter extended W mode conditional for non extended W mode device
Even without extended W mode, sp_w can be 2. This causes
"invalid extended w mode N" warning messages.
Restrict extended W mode conditional for hardwares with extended W
support.

Tested with Synaptics 6.2 device on Panasonic CF-Y8, however it does
not work with X.
2020-02-25 21:36:13 +00:00
ryoon
ec28725d9d Remove a trailing tab. 2020-02-25 16:24:47 +00:00
yamaguchi
e13c819080 Add a comment about RSS and remove a wrong comment
pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 08:05:24 +00:00
yamaguchi
83aabbc061 Use IFM_25G_ACC
pointed out and reviewed by msaitoh@n.o., thanks
2020-02-25 08:02:29 +00:00
yamaguchi
2b15e9ec8a Use kmem_alloc instead of malloc
pointed out and reviewed by knakahar@n.o., thanks
2020-02-25 07:58:44 +00:00
yamaguchi
283d3de4a9 Change the number of retry to be the same as FreeBSD and Linux
pointed out and reviewed by knakahara@n.o., thanks.
2020-02-25 07:53:55 +00:00
yamaguchi
6e254227cf Disable all queues before waiting for the completion
on each queue to reduce the number of delays

pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 07:50:25 +00:00
yamaguchi
48bdbc0885 Use callout_halt() instead of callout_stop for safety
pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 07:45:28 +00:00
yamaguchi
aca1dd3bc4 Stop callout for statistics while the interface is not running 2020-02-25 07:41:32 +00:00
yamaguchi
a2576ffa9b Change position of the cpuid::ixl_hmc_txq
to be same with ixl_hmc_pack_txq[]

This has no functionality impact because the position on memory
is defined in ixl_hmc_pack_txq[].

pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 07:35:54 +00:00
yamaguchi
1ac38ddfd7 Hold per-queue locks when clearing config of queues for safety 2020-02-25 07:31:19 +00:00
yamaguchi
ab5a0b3d6d Add defines for the max number of queue
pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 07:22:18 +00:00
yamaguchi
57a241816f Set 0 to txr_{prod,cons} and rxr_{prod,cons} when HMC objects
are cleared

Those values should be the same as head and tail in an HMC object
2020-02-25 07:17:19 +00:00
yamaguchi
d6355b8dcf Use workqueue API directly, without the wrapper in ixl(4)
to improve performace by removing atomic_ops(3)

pointed out and reviewed by knakahara@n.o., thanks
2020-02-25 07:10:10 +00:00
yamaguchi
12a5bb547f Remove WQ_PERCPU flag for the workqueue that does configurations
such as link up and down

And added kpreempt_disable and kpreempt_enable around
workqueue_enqueue to call it in non-WQ_PERCPU thread context.

pointed out and reviewed by knakahara@n.o., thanks.
2020-02-25 07:05:57 +00:00
yamaguchi
e99dedd666 Added __KERNEL_RCSID 2020-02-25 07:00:26 +00:00
rin
4c1762c6a4 0x%#x --> %#x for non-external codes.
Also, stop mixing up 0x%x and %#x in single files as far as possible.
2020-02-24 12:38:57 +00:00
rin
4ecd76e535 0x%p --> %p for non-external codes. 2020-02-24 12:20:29 +00:00
ad
d2a0ebb67a UVM locking changes, proposed on tech-kern:
- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.
2020-02-23 15:46:38 +00:00
martin
25565a0d85 Do not replay the msgbuf if we are booting silent or quiet. 2020-02-23 14:44:23 +00:00
skrll
8288919360 typo in comment 2020-02-23 10:30:43 +00:00
riastradh
ebc45b4b1c Simplify some branches and kassert some redundant assignments. 2020-02-23 08:54:55 +00:00
riastradh
ad0054ce45 Fix mistake in use of usbd_xfer_schedule_timeout in motg.
This code path is used both for xfers that are new, and xfers that
are being done piece by piece and are partway done.  For the latter
case, skip usbd_xfer_schedule_timeout so we schedule it only once per
xfer.
2020-02-23 08:54:47 +00:00
isaki
66c7f93253 Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@
2020-02-23 07:17:01 +00:00
isaki
49489285f6 Improve error handling around audio_hw_probe().
It was difficult to return multiple errors.
2020-02-23 04:24:56 +00:00
isaki
92e2bd444b Make start_input/halt_input optional if the driver has no recording,
make start_output/halt_output optional if the driver has no playback.
And remove such never called functions.
2020-02-23 04:02:45 +00:00
chs
5d4d9a2027 remove some unnecessary includes of internal UVM headers. 2020-02-22 19:49:11 +00:00
jmcneill
eb15acbd6a Match BCM54213PE 2020-02-22 18:57:31 +00:00
jmcneill
0210926b50 regen 2020-02-22 18:57:09 +00:00
jmcneill
65d0cc155b Add BCM54213PE 2020-02-22 18:56:57 +00:00
jmcneill
c992f78e6a Add support for hardware rx filters. 2020-02-22 13:41:40 +00:00
isaki
4f60b558c3 Make calling get_props() lockless.
get_props() of all MD drivers now can be called without sc_lock.
2020-02-22 08:15:09 +00:00
isaki
6d13f8a36a On audio_[pr]mixer_halt(), it's better to reset parameters in intr_lock. 2020-02-22 08:03:19 +00:00
isaki
710d84f6ac Add KASSERTs. audio_[pr]mixer_start() need exlock. 2020-02-22 08:01:59 +00:00
isaki
3dc846c0d9 Move #if DIAGNOSTIC..#endif to correct place.
It should ignore stray interrupts regardless of DIAGNOSTIC.
2020-02-22 07:59:47 +00:00
isaki
379e7aeb32 hw_if->query_format is already mandatory method. Drop null checks. 2020-02-22 07:09:18 +00:00
isaki
61f731db38 Improve KASSERT messages. 2020-02-22 06:58:39 +00:00
isaki
63cdbdbe8c Change two aprint_error_dev() to device_printf() (and improve messages).
This is also called from other than boot.
2020-02-22 06:36:07 +00:00
isaki
9fd5ffc974 const-ify. These arguments are no longer written back. 2020-02-22 06:28:10 +00:00
isaki
5eda9f581a Fix/Update comments. 2020-02-22 06:22:46 +00:00
isaki
0b3fcad9a1 Limit the number of channels that userland apps can set (by AUDIO_SETINFO)
to the number of channels supported by the hardware or less, if the hardware
supports multi channels.
- On monaural or stereo hardware, userland apps can always set 1ch or 2ch.
  The kernel (audio layer) can convert mono-stereo each other.
- On 3ch (2.1ch) hardware, for example, userland apps can set 1, 2, or 3ch,
  but not 4ch or more.
This allows userland apps to know actual number of channels supported by
the hardware in the same way as before.
PR kern/54973.
2020-02-22 05:51:39 +00:00
jmcneill
cb1ea6d12b Add ACPI glue for Broadcom GENETv5 2020-02-22 02:28:06 +00:00
jmcneill
75b925d5cf Add support for Broadcom GENET v5 ethernet controller as found on the
Raspberry Pi 4 (BCM2711).
2020-02-22 00:28:35 +00:00
skrll
71d602f2c7 Fix a memory leak. Spotted by nat@ 2020-02-21 12:41:29 +00:00
joerg
ce578dfc2b Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
2020-02-21 00:26:21 +00:00
jmcneill
4951916a8c Add dma-ranges support. 2020-02-20 01:35:55 +00:00
riastradh
f50fdb79bb usbdi dtrace probes 2020-02-19 16:07:37 +00:00
riastradh
13eca39faf Sprinkle some dtrace probes into scsi(4). 2020-02-19 16:05:41 +00:00
riastradh
16dde5e683 C99 initializers for scsipi_bustype. No functional change intended. 2020-02-19 16:04:39 +00:00
riastradh
2d463de989 umass dtrace probes 2020-02-19 16:04:01 +00:00
riastradh
e715cf708b New dtrace usb provider, with a handful of probes in usb.c. 2020-02-19 16:03:30 +00:00
riastradh
cb1b4b8e31 Make sure the umass transfer callback is run in error branches. 2020-02-19 16:02:50 +00:00
riastradh
9f1c0575da Consolidate logic to call the transfer callback.
No functional change intended.
2020-02-19 16:02:33 +00:00
riastradh
8349adddfa Fix mistakes in timeout/abort/completion changes in motg(4).
- Call usbd_xfer_schedule_timeout so we actually do time out.

- Don't call usbd_xfer_trycomplete until all the data have been
  transferred -- it commits to completion, not timeout.

- Use xfer->ux_status != USBD_IN_PROGRESS to test whether, after a
  partial write, an xfer has been interrupted or timed out and need
  not be continued.

- Remove wrong assertion.
2020-02-19 16:01:37 +00:00
riastradh
bc5592b8ef Abort default pipe too on detach before detaching children.
This ensures that pending xfers on the default pipe will be aborted
before we wait for children, which, in the case of scsibus -> sd,
means waiting for pending xfers to complete -- xfers that may never
complete if something is wedged.
2020-02-19 16:00:28 +00:00
mrg
f2ddcf3597 regen. 2020-02-19 09:00:43 +00:00
mrg
5b6b20acd5 add a couple of GPUs i have:
product ATI RADEON_HD4290      0x9714  Radeon HD4290 Graphics
product NVIDIA GF_440          0x0de0  GeForce GT 440
2020-02-19 09:00:34 +00:00
riastradh
29f401d621 Fix wrong KASSERT in motg abort.
This has been wrong since last summer when we did the transition to
xfer->ux_status = USBD_CANCELLED earlier.

XXX pullup-9
2020-02-18 17:50:20 +00:00
msaitoh
e6334c3f8e No functional change:
- u_int*_t -> uint*_t
 - whitespace fixes.
 - KNF.
2020-02-18 04:12:40 +00:00
msaitoh
baf0814f90 Whitespace fix. No functional change. 2020-02-18 04:09:31 +00:00
msaitoh
ba67005d1f Add comment. 2020-02-18 04:08:12 +00:00
msaitoh
ae193e13d9 It's useless to not to set PCI_PMCSR_PME_STS bit when writing because
the bit is W1C. Instead, always write PCI_PMCSR_PME_STS bit to clear in
case it's already set.
2020-02-18 04:07:14 +00:00
msaitoh
dc2d2bb7a9 Whitespace fix. No functional change. 2020-02-18 03:48:22 +00:00
riastradh
fbd9ae86b4 When aborting a pipe, set pipe->up_running = 0.
This prevents any concurrent usb_transfer_complete from restarting
the pipe with usbd_start_next.
2020-02-17 08:16:44 +00:00
nisimura
a4c13d8e17 comment mods and code tiddy ups 2020-02-17 06:05:31 +00:00
thorpej
d0734eed97 Add fdt_intr_mask() / fdt_intr_unmask() functions, for masking and
unmasking invididual interrupt sources (similar to acpi_intr_mask()
and acpi_intr_unmask()).

(This file was missed in a previous commit.)
2020-02-16 23:05:42 +00:00
thorpej
8acfda791f - Don't use I2C_F_POLL.
- G/C the non-FDT entry points; nothing uses them anymore.
2020-02-16 22:43:27 +00:00
thorpej
d172e13f0a Don't access the i2c bus in interrupt context. Instead, mask the
interrupt and process it on a work queue.
2020-02-16 20:32:29 +00:00
thorpej
86758bd61b Add fdt_intr_mask() / fdt_intr_unmask() functions, for masking and
unmasking invididual interrupt sources (similar to acpi_intr_mask()
and acpi_intr_unmask()).
2020-02-16 20:28:18 +00:00
thorpej
2b1ba9ff43 Rename fdtbus_set_data() to fdtbus_init(). NFC. 2020-02-16 14:56:52 +00:00
maxv
606b6de518 Improve the check, to prevent more surprises. 2020-02-16 09:53:54 +00:00
maxv
788d40eade Move usb_desc_* into usbdi_util.c, no functional change. 2020-02-16 09:40:35 +00:00
thorpej
839cd8df19 Interrupt-driven I/O seems to completely go off the rails, at least
on AllWinner implementations of this controller, so force polled mode
for now.
2020-02-15 23:42:01 +00:00
riastradh
b4488d07f0 Fix non-DIAGNOSTIC builds. 2020-02-15 13:56:55 +00:00
ryo
da59490bcc return the ifmedia active status correctly even while the link is not up after attach.
pointed out by msaitoh@. thanks.
2020-02-15 12:20:35 +00:00
skrll
9366ffe370 Change bNbrPorts for loop to start from 1 to match others. NFCI. 2020-02-15 09:26:07 +00:00
skrll
37efdc1032 Fix build 2020-02-15 07:46:48 +00:00
isaki
72caf9588f Enumerating probably always starts from sc->sc_startnode. 2020-02-15 03:04:45 +00:00
isaki
9e6a92af82 Remove incorrect KASSERT(!mutex_owned()).
Pointed out by riastradh@.
2020-02-15 02:47:00 +00:00
manu
17ba52234e Add support for D-Link DWM-157 3G USB modem 2020-02-15 02:14:02 +00:00
manu
f88a2a2a05 regen 2020-02-15 02:10:45 +00:00
manu
c60531f466 Add UE version of D-Link DWM-157 2020-02-15 02:08:54 +00:00
riastradh
73c7d65210 Fix mistakes in previous sloppy change with root intr xfers.
- Make sure ux_status is set to USBD_IN_PROGRESS when started.
  Otherwise, if it is still in flight when we abort the pipe,
  usbd_ar_pipe will skip calling upm_abort.

- Initialize ux_status under the lock; in principle a completion
  interrupt (or a delay) could race with the initialization.

- KASSERT that the xfer is in progress when we're about to complete
  it.

Candidate fix for PR kern/54963 for other HCI drivers than uhci.

ok nick
ok phone

(This is the change that nick evidently MEANT to ok when he ok'd the
previous one!)
2020-02-15 01:21:56 +00:00
riastradh
5890bb5228 Set ux_isdone in uhci_poll_hub for DIAGNOSTIC. 2020-02-14 16:47:28 +00:00
riastradh
3412e5de96 Initialize xfer->ux_status in uhci_root_intr_start.
Otherwise, it will be USBD_NOT_STARTED, so usbd_ar_pipe will skip
calling upm_abort.

Candidate fix for PR kern/54963, same problem as reported at:
https://mail-index.NetBSD.org/current-users/2020/02/13/msg037740.html
2020-02-14 16:47:11 +00:00
nisimura
2027843624 unbreak the previous commit error 2020-02-14 14:17:42 +00:00
nisimura
585f03229a determine FDX flow control abilities 2020-02-14 14:14:45 +00:00
nisimura
dc51abea5c add missing two aprint_normal* lines 2020-02-14 12:14:33 +00:00
sevan
a880d49f8b redundant include 2020-02-13 23:05:53 +00:00
riastradh
73dc35407f Fix steady state of root intr xfers.
Why?

- Avoid completing a root intr xfer multiple times in races.
- Avoid potential use-after-free in poll_hub callouts (uhci, ahci).

How?

- Use sc->sc_intr_xfer or equivalent to store only a pending xfer
  that has not yet completed -- whether successfully, by timeout, or
  by synchronous abort.  When any of those happens, set it to null
  under the lock, so the xfer is completed only once.

- For hci drivers that use a callout to poll the root hub (uhci, ahci):

  . Pass the softc pointer, not the xfer, to the callout, so the
    callout is not even tempted to use xfer after free -- if the
    callout fires, but the xfer is synchronously aborted before the
    callout can do anything, the xfer might be freed by the time the
    callout starts to examine it.

  . Teach the callout to do nothing if it is callout_pending after it
    has fired.  This way:

    1. completion or synchronous abort can just callout_stop
    2. start can just callout_schedule

    If the callout had already fired before (1), and doesn't acquire
    the bus lock until after (2), it may be tempted to abort the new
    root intr xfer just after submission, which would be wrong -- so
    instead we just have the callout do nothing if it notices it has
    been rescheduled, since it will fire again after the appropriate
    time has elapsed.
2020-02-12 16:02:01 +00:00
riastradh
87858756ca Factor out HCI-independent xfer completion logic.
New API for HCI drivers to synchronize hardware completion
interrupts, synchronous aborts, and asynchronous timeouts:

- When submitting an xfer to hardware, call
  usbd_xfer_schedule_timeout(xfer).

- On HCI completion interrupt for xfer completion:

	if (!usbd_xfer_trycomplete(xfer))
		return;		/* timed out or aborted, ignore it */

- In upm_abort methods, call usbd_xfer_abort(xfer).

For HCI drivers that use this API (not needed in drivers that don't,
or for xfers like root intr xfers that don't use it):

- New ubm_abortx method serves role of former *hci_abort_xfer, but
  without any logic for wrangling timeouts/callouts/tasks -- caller
  in usbd_xfer_abort has already handled them.

- New ubm_dying method, returns true if the device is in the process
  of detaching, used by the timeout logic.

Converted and tested:
- ehci
- ohci

Converted and compile-tested:
- ahci (XXX did this ever work?)
- dwc2
- motg (XXX missing usbd_xfer_schedule_timeout in motg_*_start?)
- uhci
- xhci

Not changed:

- slhci (sys/dev/ic/sl811hs.c) -- doesn't use a separate per-xfer
  callout for timeouts (XXX but maybe should?)

- ugenhc (sys/rump/dev/lib/libugenhc/ugenhc.c) -- doesn't manage its
  own transfer timeouts

- vhci -- times transfers out only on detach; could be adapted easily
  if we wanted to use the xfer->ux_callout
2020-02-12 16:01:00 +00:00
riastradh
eae210eb42 Fix steady state of timeouts in ehci.
This is complicated because:

1. There are three ways that an xfer can be completed:
   (a) hardware interrupt completes xfer
   (b) software decision aborts xfer with USBD_CANCELLED
   (c) timeout aborts xfer with USBD_TIMEOUT

2. The timeout abort can't be done in callout because ehci_sync_hc,
   called unconditionally by ehci_abort_xfer to wait until the device
   has finished using any references to the xfer, may sleep.  So we
   have to schedule a callout that, when run, will schedule a usb_task.

3. The hardware completion interrupt can't sleep waiting for a callout
   or task to finish -- can't use callout_halt or usb_rem_task_wait.
   So the callout and usb_task must be able to run _after_ the hardware
   completion interrupt, and recognize that they're late to the party.

   (Note, though, that usbd_free_xfer does wait for the callout and
   task to complete, so there's no danger they may use themselves after
   free.)

4. The xfer may resubmitted -- and the timeout may be rescheduled --
   immediately after the hardware completion interrupt, _while_ the
   callout and/or usb_task may still be scheduled.  Specifically, we
   may have the following sequence of events:
   (a) hardware completion interrupt
   (b) callout or usb_task fires
   (c) driver resubmits xfer
   (d) callout or usb_task acquires lock and looks around dazed and
       bewildered at the firehose of events like reading the news in 2019

The mechanism for sorting this out is that we have two bits of state:

- xfer->ux_timeout_set informs the driver, when submitting an xfer and
  setting up its timeout, whether either the callout or usb_task is
  already scheduled or not.

- xfer->ux_timeout_reset informs the callout or usb_task whether it
  should reschedule the callout, because the xfer got resubmitted, or
  not.
2020-02-12 16:00:34 +00:00
riastradh
4dd8641b42 New xfer state variables ux_timeout_set and ux_timeout_reset.
These are needed because:

- The host controller interrupt cannot wait for the callout or task
  to finish running.

- Nothing in the USBD API as is waits for the callout or task to
  finish running.

- Callers expect to be able to resubmit USB xfers from xfer callbacks
  without waiting for anything to finish running.

The variable ux_timeout_set can be used by a host controller to
decide on submission whether to schedule the callout or to ask an
already-scheduled callout or already-queued task to reschedule the
callout, by setting the variable ux_timeout_reset to true.

When the callout or task runs and sees that ux_timeout_reset is true,
rather than queue the task or abort the xfer, it can instead just
schedule the callout anew.
2020-02-12 16:00:17 +00:00
riastradh
130dc8fe1e Nothing guarantees xfer's timeout has completed.
Wait for it when we free the xfer.
2020-02-12 15:59:59 +00:00
riastradh
470e18a045 New function usb_task_pending for diagnostic assertions.
Usable only for negative diagnostic assertions:

	KASSERT(!usb_task_pending(dev, task))

If you can think of a better name for this than !usb_task_pending,
I'm all ears.
2020-02-12 15:59:44 +00:00
riastradh
611f3a357f Teach usb_rem_task to return whether removed from queue or not. 2020-02-12 15:59:30 +00:00
yamaguchi
7f102db335 Remove wrong KASSERTs because mutex_owned for a spin lock doesn't check
that a lock is held in the current context.
2020-02-12 06:41:44 +00:00
yamaguchi
ab7363fa6b Use Set RSS key command and Set LUT command to enable RSS on X722 2020-02-12 06:37:21 +00:00
yamaguchi
ca6fb19728 xl(4) should use the aq command to access RX control registers
if the device is X722 or others whose API version is upper than 1.5
2020-02-12 06:26:02 +00:00
yamaguchi
0988a4021e Fix a wrong comment in ixl(4) 2020-02-12 06:21:44 +00:00
yamaguchi
2fb60d52be Change the command sequence and timing to prevent EIO
in "Get PHY Abilities" command

The error has been appeared on X722 attaching an SFP module
without link up.
2020-02-12 06:20:13 +00:00
chs
64b2d7d8bf the number of possible ATAPI devices on an ATA bus is not always 2,
it is however many devices the underlying ATA bus can have (eg. 1 for SATA),
so initialize the scsipi chan_ntargets from the ATA ch_ndrives.
this fixes a memory read overrun detected by KASAN.
discussed with mlelstv@ and jdolecek@
2020-02-12 00:19:07 +00:00
jdolecek
fce3b0937b use wdc_maxdrives for atabus_alloc_drives() also in wdc_sataprobe()
instead of magic 1; no functional change, all wdc_sataprobe() users
actually set wdc_maxdrives to 1
2020-02-10 20:11:48 +00:00
ryoon
eb3a0a30dd Introduce hw.alps.touchpad_movement_threshold to better button area clicks 2020-02-10 16:12:58 +00:00
ryoon
0b1d31ee04 Fix typo in sysctl node name 2020-02-10 15:29:05 +00:00
mlelstv
5981b364e7 Reject open when attach didn't complete successfully. 2020-02-10 10:05:55 +00:00
skrll
b4461e2abf Fix USB_DEBUG build 2020-02-10 09:15:27 +00:00
msaitoh
4f5840cebb Restore an register read for RX_FRAMES_OK which was removed in rev. 1.133.
All statistics registers should be read to ACK the interrupt. Fixes PR#54920.

XXX pullup-[89]
2020-02-10 07:48:02 +00:00
ryo
accb2dabd4 add support VLAN HW filter 2020-02-10 05:53:11 +00:00
ryo
c7d7f2416b fix descriptions of register map in comment 2020-02-10 05:07:28 +00:00
jmcneill
428130a8e6 Retire azalia(4). 2020-02-09 16:06:17 +00:00
maya
5c658b8ee4 Remove trace of uyurex. Pointed out by maxv, thanks! 2020-02-09 15:46:15 +00:00
maxv
c105e3ae2a Move three functions into usbdi_util.c, where they belong. No functional
change.
2020-02-08 08:47:27 +00:00
msaitoh
20da7ca447 Apply FreeBSD r357300:
> aic7xxx(4): Fix unintended sign extension in ahd_inq()
 >
 > ahd_inb() returns type uint8_t.  The shift left by untyped 24 implicitly
 > promotes the result to type (signed) int.  Then the binary OR with uint64_t
 > values sign-extends the integer.  If bit 31 of the read value happened to be
 > set, the 64-bit result would have all upper 32 bits set to 1 due to OR.
 > This is clearly not intended.
 >
 > Reported by:	Coverity
 > CID:		980473 (old one!)
2020-02-08 08:23:01 +00:00
maxv
abaa08a478 Reorder usbdi_util.{c,h}, for clarity. No functional change. 2020-02-08 08:18:06 +00:00
maxv
1dd4e37fc6 Dedup usb_desc_iter_next with usb_desc_iter_peek. 2020-02-08 07:57:16 +00:00
maxv
b8633ab02c Introduce usbd_clear_endpoint_feature(), and dedup. 2020-02-08 07:53:23 +00:00
maxv
335e3606f2 Move uvideo's parsers into usbdi.c, to make them global. Rename
usb_desc_iter_peek_next -> usb_desc_iter_peek for consistency.
2020-02-08 07:38:17 +00:00
maxv
c25a854061 constify 2020-02-08 07:24:46 +00:00
maxv
c1eb3f90d4 localify 2020-02-08 07:20:41 +00:00
maxv
909cab20b9 constify 2020-02-08 07:19:09 +00:00
jmcneill
e83803dfe8 Read GCAP and version regs after taking the controller out of reset. Fixes
stream counts on my Radeon HD 7850.
2020-02-08 00:14:06 +00:00
yamaguchi
8c55b266c7 Use if_link_state_change() even if ixl(4) is attaching 2020-02-07 09:38:29 +00:00
thorpej
77da4edce3 Use callout_setfunc() / callout_schedule(). 2020-02-07 01:19:46 +00:00
thorpej
2a15fc8a3a Use callout_setfunc() / callout_schedule(). 2020-02-07 00:56:48 +00:00
thorpej
286e564fad Use callout_setfunc() / callout_schedule(). 2020-02-07 00:04:28 +00:00
macallan
a1c53e9088 sent PMF events when (un)blanking so things like lmu can turn their lights on
or off as well
2020-02-06 13:31:30 +00:00
thorpej
7cfe9d50f8 Ensure we don't call workqueue_enqueue() if the pluggable optics
handler is already pending.
2020-02-06 06:28:49 +00:00
msaitoh
0263ce38fb Modify note in ixv_update_stats(). VF doesn't count errors by hardware. 2020-02-05 10:07:47 +00:00
msaitoh
07ee1dd971 No functional change:
- Fix typos.
 - Remove extra newline.
2020-02-05 09:47:16 +00:00
skrll
58613969ea Adopt <net/if_stats.h> 2020-02-05 08:33:19 +00:00
msaitoh
f380331f6a No functional change:
- Add debug printf()s.
 - Remove unused macros.
 - Remove extra newline.
2020-02-05 07:45:46 +00:00
msaitoh
41e8782383 Cast to uint32_t to avoid undefined behavior in smsc_setmacaddress.
Found by kUBSan.
2020-02-05 07:24:07 +00:00
msaitoh
a238ecab53 RDC -> xxRDC. No functional change. 2020-02-05 06:39:13 +00:00
msaitoh
1c2de8d945 Regen. 2020-02-05 06:38:36 +00:00
msaitoh
4067ed044f Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value
of official 0x000bb4. From Andrius V.
2020-02-05 06:38:20 +00:00
msaitoh
60a9d80d07 Update comment in ixgbe_update_stats_counters() to clarify why we update
if_iqdrops and if_ierrors only. No functional change.
OK'd by knakahara and thorpej.
2020-02-05 01:44:53 +00:00
jdolecek
60ef6bcfd7 add a config fragment to include all ppbus devices to make it simpler
to compile test; right now assumes attachment of atppc(4) via acpi
2020-02-04 21:09:03 +00:00
jdolecek
31b98d959c finish adoption of <net/if_stats.h> 2020-02-04 20:46:51 +00:00
thorpej
162c119532 - Fix locking problem with optics module interrupts: ifmedia_add()
may block on memory allocation, and so it cannot be safely done from
  a softint nor can it be done while holding a spin lock.  Fix this by
  using a workqueue rather than a softint, and hold the IFNET_LOCK
  across the entire handler, and the CORE_LOCK only across the code that
  needs to serialize access to the hardware state.
- Use ifmedia_fini().

Tested in a variety of devices by msaitoh@.  (Thanks!)
2020-02-04 19:42:55 +00:00
skrll
a4d48c0f92 Trailing whitespace 2020-02-04 07:40:34 +00:00
skrll
11704b9814 Adopt <net/if_stats.h> 2020-02-04 07:35:21 +00:00
mrg
ddeb337bff don't call usb_syncmem() for zero-length packets. 2020-02-04 06:30:46 +00:00
thorpej
4947e861f2 Use ifmedia_fini(). 2020-02-04 05:44:14 +00:00
thorpej
2fba6779ed Use ifmedia_fini(). 2020-02-04 05:18:36 +00:00
maya
1893f08fad Remove more urio(4) traces.
Pointed out by maxv, thanks.
2020-02-03 19:37:42 +00:00
kre
442e7c4f3e urio(4) has gone - remove it from here as well, so any kernel config
files that reference it will fail to configure, rather than later
failing to build.
2020-02-03 12:56:26 +00:00
skrll
ed7083cb05 Adopt <net/if_stats.h> 2020-02-03 07:47:53 +00:00
jmcneill
c57f707c75 Add acpimcfg_conf_valid helper for pcie controllers with nonstandard
config space layouts.
2020-02-02 16:31:25 +00:00
jmcneill
57cc42dc03 pci_probe_device: make sure PCI_ID_REG returns valid data before touching
any other registers
2020-02-02 16:30:31 +00:00
jmcneill
21e52a637c Fix null deref for busses with no IO port resources. 2020-02-02 14:45:14 +00:00
macallan
bebdaa5f7c break long lines 2020-02-02 06:43:14 +00:00
macallan
d4a683d733 attach LEDs according to info passed as device properties 2020-02-02 06:41:27 +00:00
thorpej
c22abb987d - Adopt <net/if_stats.h>.
- Use ifmedia_fini().
2020-02-02 05:56:42 +00:00
tnn
8fd56fc1ed fix build 2020-02-01 20:11:24 +00:00
christos
d26e043876 use designated initializers 2020-02-01 19:11:59 +00:00
jmcneill
7058d749ef appease -Werror=missing-field-initializers 2020-02-01 18:24:24 +00:00
skrll
4481a897c2 Use designated initializers 2020-02-01 15:24:04 +00:00
riastradh
f3ecae1cb1 opencrypto orders new_session -> process for us.
No need for membar_producer.

Discussed with hikaru@.
2020-02-01 13:48:18 +00:00
jmcneill
8507cd68b3 Add NXP/Freescale ESDHC specific support 2020-02-01 13:40:55 +00:00
jmcneill
996c868a1d Use acpi_match_hid to match both _HID and _CID 2020-02-01 13:09:08 +00:00
thorpej
6a41b9f75c Adopt <net/if_stats.h>.
XXX This driver needs some work in this regard (practually no
stats are reported).
2020-02-01 12:55:22 +00:00
thorpej
3451334835 Adopt <net/if_stats.h>. 2020-02-01 12:45:05 +00:00
thorpej
b3ed1ce596 Adopt <net/if_stats.h>. 2020-02-01 07:12:40 +00:00
thorpej
ad1b1128be Adopt <net/if_stats.h>. 2020-02-01 06:38:58 +00:00
thorpej
77438b1eb3 Adopt <net/if_stats.h>. 2020-02-01 06:17:23 +00:00
thorpej
4683cc0316 Adopt <net/if_stats.h>. 2020-02-01 05:14:28 +00:00
riastradh
59523fb8d0 Use atomic_load_acquire for FreeBSDish atomic_load_acq_uint shim. 2020-02-01 02:33:08 +00:00
riastradh
e8a2aeafd9 Use atomic_load/store_* in ena(4), not questionable membar_sync. 2020-02-01 02:32:40 +00:00
jmcneill
340b7c4ae7 Match HID 808622B7 (DesignWare USB3) 2020-01-31 23:12:13 +00:00
thorpej
be29826f37 Adopt <net/if_stats.h>. 2020-01-31 22:41:07 +00:00
knakahara
b1afdae5ad wm(4) unset RSS UDP flags like ixg(4) and other OS's one.
To handle IP fragmented UDP first packet and second packet by the same
Rx queue.

I tested on I354.
2020-01-31 12:09:13 +00:00
knakahara
0895949de8 Fix missing workqueue_destroy(). ok by msaitoh@n.o 2020-01-31 12:04:57 +00:00
knakahara
a8e63b4f2c Fix wm(4) create too many workqueue. Pointed out by msaitoh@n.o 2020-01-31 12:03:23 +00:00
yamaguchi
212a173771 Revert r1.32 because some documents say that the device supports SFP+ SX/LX
I referred the document #332191-024 "Intel Ethernet Controller
X710/XXV710/XL710 Feature Support Matrix"

pointed out by msaitoh@, thanks.
2020-01-31 03:30:37 +00:00
yamaguchi
799555abd8 Fix missing kpreempt_disabe() 2020-01-31 02:25:06 +00:00
yamaguchi
3d65111b1b Remove unsupported media on ixl(4) 2020-01-31 02:21:17 +00:00
yamaguchi
202164f9a9 Add media and flow changes support for ixl(4) 2020-01-31 02:16:26 +00:00
yamaguchi
5ae8f77bd1 Fix a wrong return code from ixl_get_phy_types() 2020-01-31 02:11:06 +00:00
thorpej
c3db30f709 Adopt <net/if_stats.h>. 2020-01-30 13:56:48 +00:00
yamaguchi
b5012ea1ab Add SIOCSIFMTU support for ixl(4) 2020-01-30 09:53:49 +00:00
thorpej
7ea25e2de8 Adopt <net/if_stats.h>. 2020-01-30 06:03:34 +00:00
thorpej
c47207d4c0 Adopt <net/if_stats.h>. 2020-01-30 04:56:11 +00:00
jmcneill
8941e790e2 Prefer memory space register mapping over IO space. Make an exception for
RTL8169SC, as the FreeBSD driver says memory mapped IO doesn't work there.
2020-01-30 00:36:29 +00:00
jmcneill
98d658ee71 Only dump ELD info if HDAFG_HDMI_DEBUG is defined 2020-01-30 00:21:23 +00:00
mlelstv
dcf76c79ba urio(4) was deleted 2020-01-29 21:52:16 +00:00
christos
930278defc compile without INET 2020-01-29 21:11:38 +00:00
maya
5e031685d6 remove urio(4), a driver for the Rio500 MP3 player.
At this point it is highly unlikely this 1999 device still has users,
but it still comes up in the context of maxv's USB-fuzzing (and any device
could pretend to be a urio(4)), so it's best to get rid of it.

Renamed all major entries to obsolete, as was done in previous removals.

This still requires an update to sanitizers, but they're located in
"external", perhaps it should be first committed upstream?

Proposed on tech-kern a month ago.
2020-01-29 18:39:00 +00:00
thorpej
10ca93f873 Adopt <net/if_stats.h>. 2020-01-29 15:00:39 +00:00
thorpej
1f99bccc85 Adopt <net/if_stats.h>. 2020-01-29 14:47:08 +00:00
thorpej
2d501ecfdc Adopt <net/if_stats.h>. 2020-01-29 13:54:41 +00:00
thorpej
38c29a8b06 Adopt <net/if_stats.h>. 2020-01-29 06:46:58 +00:00
thorpej
cdaa0e91f5 Adopt <net/if_stats.h>. 2020-01-29 06:35:28 +00:00
thorpej
72f872d2b2 Adopt <net/if_stats.h>. 2020-01-29 06:17:07 +00:00
thorpej
d18dc54823 Adopt <net/if_stats.h>. 2020-01-29 05:52:27 +00:00
macallan
372fa65ce5 the beginning of a driver for Philips Semiconductors PCA 9555 and 9556
GPIO controllers, found in Sun Fire v210 and some G5 macs.
Only prints configuration and line status so far.
2020-01-29 05:27:05 +00:00
msaitoh
cdec9b8ea7 u_int{32,64}_t -> uint{32,64}_t. No functional change. 2020-01-29 02:16:02 +00:00
martin
b476da6354 First arg of cpu_setmodel needs to be a format string - fix the llvm build.
From maxv.
2020-01-28 08:09:19 +00:00
msaitoh
ffa2c4cca6 Fix comment. 2020-01-28 05:08:02 +00:00
msaitoh
b636a557bc Regen. 2020-01-28 02:28:09 +00:00
msaitoh
0f3d40ab8d Remove duplicated entries. 2020-01-28 02:27:46 +00:00
yamaguchi
c39f1292af Add TX checksum offload supports for ixl(4) 2020-01-27 09:40:43 +00:00
yamaguchi
ef64510dd2 Fix missing PCI_INTR_MPSAFE settings in ixl(4) 2020-01-27 08:40:46 +00:00
jmcneill
700e7ec864 regen 2020-01-27 00:51:40 +00:00
jmcneill
5f1dc67ef7 Make sure that all vendor strings are shorter than 16 (MAX_AUDIO_DEV_LEN)
characters as the values are used in the AUDIO_GETDEV ioctl.
2020-01-27 00:51:15 +00:00
riastradh
c837f63abc Use __BIT. 2020-01-26 22:34:17 +00:00
riastradh
0b3f0fd87c Unconditionally enable UATP_DEBUG. 2020-01-26 22:19:54 +00:00
riastradh
aa44508fe1 Downgrade noisy message from aprint_verbose to DPRINTF. 2020-01-26 22:19:39 +00:00
riastradh
7823daf7bc Work around quirk of Fountain and Geyser 1 trackpads.
Sometimes they get desynchronized, but we know the last packet is a
17-byte packet, so if we get one early then stop here.

Tested by macallan on an iBook and a PowerBook.  This code path
shouldn't break anything on MacBooks because they have different
total numbers of sensors so this branch won't be reached.
2020-01-26 22:19:27 +00:00
thorpej
50b1e3ebe4 Fix __HAVE_OLD_DISKLABEL bits so they at least compile. 2020-01-26 21:43:52 +00:00
jmcneill
56ca6a8885 defopt -> defparam (oops) 2020-01-25 19:22:05 +00:00
thorpej
e922902265 Retire the le@pci attachment. It has been superseded (and matched at a
higher priority) by the pcn(4) driver since NetBSD 1.6.
2020-01-25 18:59:43 +00:00
maxv
8784198240 Fix uninitialized variable. There may not be a TYPE_ASCII block. Found by
kMSan with nouveau.
2020-01-25 15:59:11 +00:00
jmcneill
c1058ddd10 defopt AUDIO_BLK_MS 2020-01-25 12:15:35 +00:00
msaitoh
9084121899 Add PCIe 4.0 stuff a little:
- 10-bit Tag Requester/Completer.
 - Add Data link Feature extended capability.
 - Add Physical Layer 16.0 GT/s extended capability. Not decode yet.
2020-01-25 08:13:39 +00:00
msaitoh
a0b1d015f7 - Print Bridge Config Retry Enable bit and Retimer Presence Detect Supported
bit.
- Avoid using magic number.
2020-01-25 07:59:14 +00:00
msaitoh
d31478f596 Found by kUBSan:
- Use unsigned to avoid undefined behavior in aq_hw_init().
- Cast to unsigned to avoid undefined behavior in aq_set_mac_addr().
2020-01-25 07:57:48 +00:00
knakahara
980dd520b0 wm(4) can use workqueue as deferred Rx/Tx handler like ixg(4).
Set hw.wm*.txrx_workqueue=1 to use workqueue instead of softint.
The default value of hw.wm*.txrx_workqueue is 0, that is, use softint
as before.

ok by msaitoh@n.o.
2020-01-24 02:50:41 +00:00
jmcneill
bf24108e88 More SDIO stability and performance fixes 2020-01-23 23:53:55 +00:00
knakahara
50fa1932a0 fix softint_disestablish() in wm_detach().
ok by msaitoh@n.o

XXX pullup-8, pullup-9
2020-01-23 07:49:57 +00:00
jmcneill
c1484821ef dwc_mmc fixes:
- Rockchip uses a different SDIO int bit, so take this into consideration
 - Avoid unnecessary resets and always wait for resets to complete
 - kpause instead of delay while holding spinlock
 - Do not attempt autostop for SD_IO_RW_EXTENDED commands
 - Allow for sub-blklen byte counts for single block transfers
2020-01-22 23:19:11 +00:00
jmcneill
ced685e422 Fix DWC_MMC_INT_SDIO_INT bit 2020-01-22 21:59:10 +00:00
mrg
4ea65bdb69 save the new current level when set by the user.
stops PBP display from going back to default brightness after
dpms, etc.

ok jmcneill.
2020-01-22 07:29:23 +00:00
thorpej
9c0a409d68 Static'ify. 2020-01-22 03:48:10 +00:00
msaitoh
7a3531b65f Remove unused shift and mask definitions. 2020-01-22 02:51:38 +00:00
tkusumi
67de4a9395 dm: #if0 target's ->upcall() handler
This is part of NetBSD's dm design, but unimplemented
(all handlers return 0) and also unused.
2020-01-21 16:27:53 +00:00
msaitoh
e9ddeea551 Fix the freeing code for some error paths. Found and tested by Patrick Welche. 2020-01-21 14:55:55 +00:00
jmcneill
d0ba3bb8a0 Choose between dmat and dmat64, instead of relying on subregion of the 32-bit tag 2020-01-21 11:29:17 +00:00
msaitoh
d2b5404b02 Add Intel I219 LM10-LM15 and V10-V14 from OpenBSD. 2020-01-21 08:50:54 +00:00
msaitoh
fb1eb27483 Regen. 2020-01-21 08:50:19 +00:00
msaitoh
7643c78a9e Add Intel I219 LM10-LM15 and V10-V14 from OpenBSD. 2020-01-21 08:49:31 +00:00
thorpej
ddd8630944 No longer need to go to splnet() before calling ifmedia_ioctl()
in the NET_MPSAFE; ifmedia_ioctl() will do this for us, if needed.
2020-01-20 19:45:27 +00:00
thorpej
4541d6828b Remove FDDI support. 2020-01-20 18:38:17 +00:00
skrll
dd17d38675 don't attempt to extent_alloc_subregion outside the parent extent ranges 2020-01-20 10:35:42 +00:00
msaitoh
3728a5ee47 Free jumbo mem structure correctly. Found by yamaguchi@ using with LOCKDEBUG. 2020-01-20 07:19:04 +00:00
riastradh
08a157de6e Remove filemon(4).
Discussed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2020/01/13/msg025938.html

This was never (intentionally) enabled by default, and the design has
some shortcomings.  You can get mostly the same results with ktrace,
as in usr.bin/make/filemon/filemon_ktrace.c which is now used instead
of filemon for make's meta mode.

If applications require higher performance than ktrace, or nesting
that ktrace doesn't support, we might consider adding something back
into the vfs system calls themselves, without hijacking the syscall
table.  (Might want a more reliable output format too, e.g. one that
can handle newlines in file names.)
2020-01-19 20:41:17 +00:00
thorpej
ed469c22d6 Remove Token Ring support. 2020-01-19 20:00:35 +00:00
thorpej
332fd700ea Remove the de(4) driver, which has long since been supplanted by the
tlp(4) driver, which supports more chips and more board variants.
2020-01-19 17:53:14 +00:00
thorpej
85654ec7a9 Remove HIPPI support and the esh(4) driver that uses it. There have not
been any users of HIPPI for some time, and it is unlikely to be resurrected.
2020-01-19 06:55:21 +00:00
thorpej
99c42a7910 Fix several problems with pci_configure_bus():
- Track the 64-bit range capability of prefetchable and non-prefetchable
  memory separately.  Probe the extent maps provided by the caller to
  initialize these values.  Without this, we never get 64-bit range
  capablity on the root bus, and thus are never able to forward it along
  to downstream busses.
- Always prefer allocating space for a 64-bit memory BAR > 4GB.  We will
  fall back on a 32-bit range if no space above 4GB is available.
- Constrain allocation of 32-bit memory BARs (including expansion ROM BARs)
  to be below 4GB, even if the window has a larger range available.
- When allocating non-prefetchable memory space for a PCI-PCI bridge, ensure
  it falls below 4GB, since a bridge cannot forward a 64-bit non-prefetchable
  range.
- Account for expansion ROMs as non-prefetchable memory rather than
  prefetchable memory; expansion ROMs have 32-bit BARs, and if a device
  with an expansion ROM is downstream of a brige, a 32-bit prefetchable
  range might not be available.

Tested by jmcneill@ on an Arm Neoverse N1 SDP, where the previous
code failed to configure all devices correctly.
2020-01-18 22:17:34 +00:00
tsutsui
566e6833b5 Fix panic on sun3 when any key is typed when kbd is not console. PR/54873
Should be pulled up to netbsd-9.
2020-01-18 21:08:42 +00:00
ad
024332fd3d Mark the cdev MPSAFE too. 2020-01-18 14:02:18 +00:00
jmcneill
7dd6b0d4ad Ignore PCI boot config unless the _DSM for ignoring PCI boot config is
explicitly set to 0.
2020-01-18 12:32:57 +00:00
jmcneill
07452c5e97 Make sure we have at least one of playback or capture streams setup before
attaching the audio layer.
2020-01-18 12:00:33 +00:00
simonb
0361294bbb Add new AHCI_QUIRK_BADNCQ quick for controllers that have issues with
NCQ on (some) drives.  Enable this quirk for ATI (AMD) SB600/SB700
controllers.  Alternate fix for kern/54790 and kern/54855.

ok jdolecek@, tested on my SB700 chipset and tsutsui's SB600 chipset.
2020-01-18 11:26:11 +00:00
simonb
f3ef58ddb7 Tidy quirk table and remove outdated quick from the quirk format string. 2020-01-18 11:24:40 +00:00
simonb
2fb6b7b160 Revert kern/54790 and kern/54855 NCQ fix that penalised all Samsung
EVO 860 drives.

ok jdolecek@
2020-01-18 11:22:49 +00:00
ad
bdf8ebffe6 Acquire kernel_lock in the bp->b_iodone callback. 2020-01-17 19:30:51 +00:00
jmcneill
6f25f8641b Add support for Arm N1 SDP PCIe host controller.
The N1 SDP has a few bugs that we need to work around:
 - PCIe root port config space lives in a non-standard location.
 - Access to PCIe config space of devices that do not exist results in
   an sync SError. Firmware creates a "known devices" table at a fixed
   physical address that we use to filter PCI conf access to only known
   devices.

This change splits the Arm ACPI PCI quirks into separate files for each
host controller, and allows per-segment quirks to be applied.

These changes exposed some bugs in the MI ACPI layer related to
multi-segment support. The MI ACPI PCI code was using a shared PCI
chipset tag to access devices, and these accesses can happen before our
PCI host bridge drivers are attached! The global chipset tag is now gone,
and an MD callback can provide a custom tag on a per-segment basis.
2020-01-17 17:06:32 +00:00
maya
09ad70fb6c Remove uyurex(4).
This is a driver for a "nonsense machine" made by the art group Maywa-Denki
in 2008. It was disabled by default.

Unfortunately even so it draws development attention (flaws found in the
code, MP-ification needs) and it is best not to continue to maintain this
driver.

Proposed without objections on tech-kern.
2020-01-17 15:00:20 +00:00
yamaguchi
ae111faea9 Print nvm version of ixl(4) when attaching
reviewed by msaitoh
2020-01-17 09:42:05 +00:00
yamaguchi
fa75360264 Use flags instead of bool that changes behavior related to
adminq command of ixl(4)
2020-01-17 09:37:42 +00:00
yamaguchi
48914d0511 Fix the wrong expression in ixl(4)
Closes PR/54860.
2020-01-17 09:04:04 +00:00
ryo
b03841d7c9 support internal PHY temperature sensor 2020-01-17 05:22:42 +00:00
ryo
97134c887d make counters per queue 2020-01-17 05:16:33 +00:00
ryo
3c9a6228d0 set/clear IFF_OACTIVE flag only on txring 0 2020-01-17 05:11:04 +00:00
msaitoh
cb3651ee3c Fix a bug that the virtual channel extended configuraton's arbitration phase
register can't be decoded correcty. Found by jmcneill.
2020-01-17 02:08:25 +00:00
yamaguchi
d807a63eda Fix wrong usage of PCI_PRODUCT(), ixl(4) 2020-01-16 07:19:47 +00:00
maya
2ff3c6f126 dm(8) doesn't cause problems on suspend, don't block it.
Tested by Matthias Petermann, thanks!
2020-01-16 07:18:08 +00:00
yamaguchi
5c10fc8b15 Fix ixl(4) not to assign interrupts to cpu #0
if ncpu > queue pairs
2020-01-16 07:16:04 +00:00
yamaguchi
512493ade9 Use def{flag,param} for parameters in ixl(4) 2020-01-16 07:11:50 +00:00
yamaguchi
66a44ae83e Fix typo (s/txr_opackets/txr_obytes/)
pointed out by ryo@n.o, thanks.
2020-01-15 08:25:01 +00:00
skrll
752c3237b0 If malloc fails in zyd_node_alloc then return NULL. From nick-nhusb 2020-01-15 08:21:00 +00:00
skrll
c6828b08e2 Use modern interfaces and kill tsleep/wakeup. From nick-nhusb branch. 2020-01-15 08:20:13 +00:00
skrll
3db7d1a277 Trailing whitespace 2020-01-15 08:13:20 +00:00
skrll
bf343540f8 Use a define instead of a magic constant. NFCI. 2020-01-15 08:02:53 +00:00
thorpej
47e9d51ab5 tsleep -> kpause 2020-01-15 05:56:57 +00:00
jmcneill
91882526f7 Add support for NXP i.MX 8M Dual/8M QuadLite/8M Quad family SoCs. 2020-01-15 01:09:56 +00:00
msaitoh
c015e0f4d6 Add AMDFCH41_SMBUS_PORTMASK. 2020-01-14 22:55:27 +00:00
jdolecek
0631449bd5 enable the BAD_NCQ quirk for all 860 EVO drives
XXX work-in-progress, it's not clear whether this is driver or controller
XXX problem
2020-01-14 21:08:06 +00:00
msaitoh
76a8e75348 Save/restore port number before selecting port. Linux driver says it must
be required on some systems.
2020-01-14 15:42:03 +00:00
msaitoh
877ea9b7bc Simplify. No functional change. 2020-01-14 15:36:54 +00:00
msaitoh
f8441706c9 No functional change:
- Move some definitions from if_stgereg.h to if_stge.c again because those are
  not chip (registers or descriptors) definitions.
- Use proplib to pass information that loading DSP code is required when
  PHY reset.
2020-01-14 09:49:26 +00:00
jdolecek
eef4b266f0 disable NCQ by default for "Samsung SSD 860 EVO 1TB" and
"Samsung SSD 860 EVO 500GB" - these drives have known broken NCQ support
particularly when used with AMD SB710/750 chipsets, problem occur also
under Linux and Windows

https://eu.community.samsung.com/t5/Cameras-IT-Everything-Else/860-EVO-250GB-causing-freezes-on-AMD-system/td-p/575813
https://bugzilla.kernel.org/show_bug.cgi?id=201693

It seems there is no Samsung firmware update to fix this even.

Disable NCQ regardless of the controller, it's likely same problem
exists with other controllers too.

This should fix PR kern/54790 and PR kern/54855
2020-01-13 21:20:17 +00:00
thorpej
d33e139d37 Fix silly mistake in rev 1.12. 2020-01-13 12:53:46 +00:00
martin
1c3eff7b6f Fix debug printf formats. 2020-01-13 09:53:54 +00:00
chs
3cc8c15311 apply FreeBSD revs r214848 and r214849:
r214849 | jkim | 2010-11-05 13:24:26 -0700 (Fri, 05 Nov 2010) | 2 lines

    Add a forgotten change from the previous commit.

    r214848 | jkim | 2010-11-05 12:50:09 -0700 (Fri, 05 Nov 2010) | 13 lines

    Fix a use-after-free bug for extended IRQ resource[1].  When _PRS buffer is
    copied as a template for _SRS, a string pointer for descriptor name is also
    copied and it becomes stale as soon as it gets de-allocated[2].  Now _CRS is
    used as a template for _SRS as ACPI specification suggests if it is usable.
    The template from _PRS is still utilized but only when _CRS is not available
    or broken.  To avoid use-after-free the problem in this case, however, only
    mandatory fields are copied, optional data is removed, and structure length
    is adjusted accordingly.

    Reported by:    hps[1]
    Analyzed by:    avg[2]
    Tested by:      hps

This also fixes reading past the end of a structure as detected by KASAN.
2020-01-13 00:19:43 +00:00
thorpej
1205b8062a Improve diagnostic messages:
- Pass an additional argument to gttwsi_wait() to indicate what's
  going on, and report that, along with the error code from
  cv_timedwait(), if a timeout occurs.
- In gttwsi_send_stop(), if we don't get the expected NRS status,
  report which status we *did* get when a timeout occurs.
2020-01-13 00:09:28 +00:00
sevan
d57dd85e02 Start to switch from OpenBSD timeout(9) API to callout(9) and workqueue(9)
Replace functions with NetBSD counterparts.
2020-01-12 23:22:12 +00:00
thorpej
92b1a40bcb Clean up gttwsi's register access stuff:
- Garbage-collect the obsolete GTTWSI_ALLWINNER option; it hasn't been
  needed since FDT'ization of the Allwinner support code.
- Redefine thw "TWSI_*" register definitions to clearly call out:
  -> The Marvell flavor of the offsets
  -> The Allwinner flavor of the offsets
  ...and make the regular definitions indices into a register map.
- Pass the appropriate register map from the front-end to the core.
- Remove the customer register read/write callbacks -- they are no longer
  needed now that each front-end passes an appropriate register map to
  the core.
2020-01-12 17:48:42 +00:00
thorpej
ea7f1d41e7 In gttwsi_wait(), don't use cv_timedwait_sig() -- there's no reason to
catch signals here, and the code would need to handle them properly, which
this code does not.
2020-01-11 22:21:25 +00:00
nia
b91e2921c9 Support the combination of KB_SWAPCTRLCAPS and UK layout. 2020-01-11 21:43:10 +00:00
sevan
7ff7ee8575 Start porting to NetBSD. (WIP, incomplete) 2020-01-11 21:05:45 +00:00
sevan
156bc3dc15 Import rge(4) from OpenBSD for Realtek's RTL8125 based 2.5GbE network cards. 2020-01-11 20:56:50 +00:00
isaki
febfde9c6a Simplify async_mixer handling.
- It makes FIOASYNC code in mixer_ioctl() symmetric.
- For readability, mixer_async_{add,remove}() should take pid argument
  though pid is always curproc.
2020-01-11 04:53:10 +00:00
isaki
5ce2968c43 Remove old debug #ifdefs. 2020-01-11 04:06:13 +00:00
maxv
f0ac038b23 Registering the host's CR0 is done outside of the VCPU loop, so it must be
cleared because it is also cleared inside the loop.

Not clearing it could trigger DNAs on VMEXITs, because STTS/CLTS are still
here as part of debugging since my FPU overhaul.
2020-01-09 16:27:57 +00:00
martin
2fac6cb259 When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.
2020-01-09 16:23:41 +00:00
maxv
3cae8f6437 Mmh, as noted in PR/54847, this should be uint64_t, not uint16_t. Harmless
because we use only the two lowest bits anyway.

I believe this could be caught by KUBSAN; time to do another round of
NVMM+K_SAN testing.
2020-01-09 16:20:12 +00:00
msaitoh
82b4e8d166 Acquire/release host semaphore to share SMBus between the host and
the embedded controller (IMC).

 Without this change, "shutdown -r" does power off and not boot on ECS HDC-I2.
This change fixes the problem.
2020-01-09 12:49:12 +00:00
msaitoh
cc226cbe2a Reduce diff against OpenBSD. No functional change.
- USE CSR_{READ,WRITE}_*() macro.
- Move some macros from if_stge.c to if_stgereg.h
2020-01-09 10:54:16 +00:00
yamaguchi
edcbb7646e Make some parametes in ixl(4) be able to change when loading
for debugging

- nomsix(boolean)
   - disable msix support
- stats_interval(signed integer)
   - change interval for collecting statistic counters
- nqps_limit(signed integer)
   - limitation for the number of queue pairs
- {tx,rx}_ndescs(unsigned integer)
   - the number of discriptors in txqueue or rxqueue
2020-01-09 08:54:05 +00:00
thorpej
a7ebfbc5bb Re-enable the intr / mask / softint / unmask dance now that the x86
interrupt issue is fixed.  Verified working by ryoon@ (thanks!).
2020-01-09 04:04:01 +00:00
yamaguchi
ac53db4aac ixl(4) supports in-chip statistic counters per VSI 2020-01-09 02:55:41 +00:00
yamaguchi
6cade11055 ixl(4) supports in-chip statistic counters per port 2020-01-09 02:43:45 +00:00
macallan
ed787f4d25 send PMF events for volume and brightness control keys on Apple keyboards 2020-01-08 23:28:56 +00:00
isaki
3b9c5d089b Fix an resource leak on audiobell close.
audioclose() freed audio_file_t structure, but only audiobellclose
didn't pass there.  I change that all of freeing audio_file_t is done
by each *_close().
2020-01-08 13:30:15 +00:00
isaki
b01e228efb Remove obsoleted comment. 2020-01-08 13:05:02 +00:00
yamaguchi
479915944e Not stop kpreempt if unnecessary, ixl(4) 2020-01-08 09:12:11 +00:00
isaki
ab1308759b Move mutex_exit() correct place to protect sc_async_mixer.
Thanks maxv@!
2020-01-08 08:10:15 +00:00
nonaka
866b8f41d8 Added some RNDIS status definitions from FreeBSD. 2020-01-08 04:53:38 +00:00
msaitoh
0d3a42e824 - Fix SFF_SFP_ETH_FLAGS_100FX. It's not 0x10 but 0x20.
- Define SFF_SFP_ETH_FLAGS_100LX with 0x10.
2020-01-08 03:51:37 +00:00
maxv
f76a68287e Localify, constify. 2020-01-07 06:42:26 +00:00
maxv
b946d2dc5e Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free. 2020-01-07 06:12:09 +00:00
maxv
f810e291ae Fix big bugs. 2020-01-07 06:10:18 +00:00
msaitoh
9ffb315967 Fix a bug that IFF_ALLMULTI is almost always set. 2020-01-06 15:19:00 +00:00
nisimura
f93891eb30 correct bogus comparison. pointed by msaitoh@ 2020-01-06 07:57:06 +00:00
msaitoh
af30e39a49 Protect ec_multicnt. 2020-01-06 07:15:03 +00:00
tkusumi
05e54a628c dm: Add "Copyright (c) 2015 The DragonFly Project." to dm-flakey
which I missed in my initial dm-flakey commit.
2020-01-05 08:11:10 +00:00
tkusumi
ea24dc8dcc dm: Add dm-delay target
Ported from DragonFlyBSD, but this target had originally existed in
Linux kernel. See below for details.
https://www.kernel.org/doc/Documentation/device-mapper/delay.txt

Due to "tick" in hz(9) not working (which results in dmdlthread spinning
forever in _submit_queue() without dp extracted from delayed list
and queued into submit list), this hasn't been hooked to dm.kmod yet.

taken-from: DragonFlyBSD
2020-01-05 08:08:26 +00:00
mlelstv
90e85cec6c Avoid race condition. Patch from bouyer@ 2020-01-04 22:30:06 +00:00
mlelstv
e34bd76845 Be less noisy for some commands. 2020-01-04 22:28:26 +00:00
mlelstv
85cc294a62 size check was backwards. 2020-01-04 14:52:52 +00:00
jmcneill
bb3a17a5a7 If the backlight node does not have an enable gpio, set the lowest duty
cycle to turn the display off instead.
2020-01-04 12:09:54 +00:00
jmcneill
d63ecae318 Emit PMFE_DISPLAY_{ON,OFF} events in response to DPMS requests. 2020-01-04 12:08:32 +00:00
thorpej
47e0e1cb69 No need to use I2C_F_POLL here. 2020-01-04 02:21:15 +00:00
jmcneill
ae22bf259b Add driver for CellWise CW2015 Fuel Gauge IC. 2020-01-03 18:00:05 +00:00
pgoyette
ae43fc77bd Fix some typos in comments.
From vezhlys on freenode IRC.
2020-01-03 12:59:46 +00:00
jmcneill
c47914cb8a Add a quirk for the HAILUCK USB keyboard / touchpad device with product 1e.
The keyboard does not function properly unless the touchpad's intr endpoint
is active.
2020-01-03 12:39:39 +00:00
jmcneill
7ee1f951f1 regen 2020-01-03 12:35:57 +00:00
jmcneill
f0cf68d29b Add HAILUCK keyboard (product 1e) 2020-01-03 12:35:33 +00:00
thorpej
585dd234ff Eliminate all of the #ifdefs for the "strtc" driver. Define model
properties (similar to what the "dsrtc" driver does), and provide
DT compat strings corresponding to those models.  Allow config flags
to specify the model for non-FDT platforms (also like "dsrtc").
2020-01-03 03:44:42 +00:00
jmcneill
10fbab57ee If the rockchip,system-power-controller property is present, try to power off with the PMIC 2020-01-03 01:17:29 +00:00
jmcneill
cabfb0e2b3 Avoid sleeping while the audio intr lock is held. 2020-01-03 01:00:08 +00:00
jmcneill
183eeb09af Add driver for Everest Semi ES8316 Low Power Audio CODEC 2020-01-02 22:06:59 +00:00
thorpej
7ba18fd1e6 - Use todr_gettime_ymdhms / todr_settime_ymdhms.
- Correctly propagate errors up the stack.
2020-01-02 19:24:48 +00:00
thorpej
2d5ff157d0 - Use todr_gettime_ymdhms / todr_settime_ymdhms.
- Correctly propagate errors up the stack.
2020-01-02 19:11:12 +00:00
thorpej
9f0d6bd066 Use todr_gettime_ymdhms / todr_settime_ymdhms. 2020-01-02 19:00:34 +00:00
thorpej
6591db0cc5 - Use todr_gettime_ymdhms / todr_settime_ymdhms.
- Correctly propagate errors up the stack.
2020-01-02 18:57:58 +00:00