skip pflog interfaces in pcap_lookupdev()

2013-08-08 Thread joshua stein
Running tcpdump with no -i arg finds a good interface to listen on by default on many machines, but on my laptop it finds pflog0 before urtwn0. Can we skip pflog interfaces like loopbacks? I had a version that looked up the interface in the egress group but this is much simpler since pflog0 is

attach acpithinkpad on newer lenovo thinkpads

2011-04-27 Thread joshua stein
this attaches acpithinkpad to newer lenovo thinkpads like the x120e. hw.sensors.acpithinkpad0.temp0=57.00 degC hw.sensors.acpithinkpad0.temp1=0.00 degC hw.sensors.acpithinkpad0.temp2=57.00 degC hw.sensors.acpithinkpad0.temp3=0.00 degC hw.sensors.acpithinkpad0.temp4=0.00 degC

Re: Synaptics touchpad

2011-06-13 Thread joshua stein
I find the mouse emulation code for synaptics touch pads in your patch really weird. I've tried to understand what it does, and why it behaves badly for me on the first tap (move the pointer in the upper right direction every time), but I fail to understand the logic. your change makes the

apple macbook/usb keyboard fn key support

2011-07-10 Thread joshua stein
this makes the extra keys on most apple macbooks and apple usb/bluetooth-via-usb keyboards work like they do in mac os. most importantly, fn+up arrow does page up, fn+down does page down, fn+left does home, fn+right does end, fn+backspace does delete, and fn+return does insert. it also makes

ax88772b support for axe(4)

2011-10-19 Thread joshua stein
this adds support to axe(4) for the ax88772b usb ethernet adapter that came with my asus ux21. it adds the usb device and an ax88772b-specific register that freebsd sets[1]. according to linux[2], the ax88772b only uses 11 bits of the header for the actual packet size and the other bits are used

enable/fix vt switching on sandybridge machines

2012-03-02 Thread joshua stein
hi friends, this enables vt switching on my laptop (dell xps 13) with sandybridge video: vga1 at pci0 dev 2 function 0 Intel GT2 Video rev 0x09 previously it would do nothing on ctrl+alt+f1 and redraw the screen on ctrl+alt+f5. now i am able to switch between the console and X multiple times

Re: enable/fix vt switching on sandybridge machines

2012-03-03 Thread joshua stein
And it only works if you don't suspend the machine. After a suspend/resume cycle, X still comes back, but text mode VTs stay black again. does the console resume properly even when you boot up and don't start x? it doesn't on my laptop, so this may be an acpi-related problem.

add intel 6235 support to iwn(4)

2012-11-10 Thread joshua stein
Add support for Intel 6235 WiFi: iwn0 at pci2 dev 0 function 0 Intel Centrino Advanced-N 6235 rev 0x24: msi, MIMO 2T2R, AGN, address c4:85:08:35:55:f7 Requires newer iwn-6030 firmware that I recently added to the iwn-firmware package. Trying to configure Bluetooth coexistence kills the device

Re: UPDATE: xf86-input-synaptics 1.7.0

2013-05-31 Thread joshua stein
Prepare diff for xf86-input-synaptics 1.7.1 http://koba.devio.us/distfiles/xf86-input-synaptics-1.7.1.diff Tested with an ALPS touchpad, no regression, I'm ok with this going in. tested on elantech v4, no problems. ok jcs@

Re: cbfb: coreboot framebuffer console

2016-06-12 Thread joshua stein
driver + * + * Copyright (c) 2016 joshua stein <j...@openbsd.org> + * Copyright (c) 2015 YASUOKA Masahiko <yasu...@yasuoka.net> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +

Re: MBIM Patch (Round 3)

2016-06-09 Thread joshua stein
On Thu, 09 Jun 2016 at 19:04:27 +0200, Ingo Schwarze wrote: > Hi Gerhard, > > Gerhard Roth wrote on Wed, Jun 08, 2016 at 03:08:52PM +0200: > > > +.\" Copyright (c) 2016 genua mbH > > + * Copyright (c) 2016 genua mbH > > These kinds of Copyright notices without the name of the actual author >

Re: cbfb: coreboot framebuffer console

2016-06-15 Thread joshua stein
On Tue, 14 Jun 2016 at 07:22:14 +0200, Joerg Jung wrote: > > We should not get hung up too much about the driver name. If it is > > felt that efifb(4) is inappropriate for these chromebooks with > > coreboot, we can always rename the driver. > > Yes, renaming makes sense then. Any ideas for a

Re: cbfb: coreboot framebuffer console

2016-06-16 Thread joshua stein
On Mon, 13 Jun 2016 at 12:35:23 +0200, Mark Kettenis wrote: > > Date: Sun, 12 Jun 2016 11:47:37 -0500 > > From: joshua stein <j...@openbsd.org> > > > > Here's a new version with feedback from Miod and Ted. > > > > It also fixes a bug on a Broadwell Chr

Re: New 12" Retina Macbook (Macbook9,1)

2016-05-18 Thread joshua stein
On Wed, 18 May 2016 at 09:33:36 -0400, Bryan C. Everly wrote: > 2. The keyboard works at the boot prompt, but does not work once the > install/upgrade/shell prompt comes up The keyboard and trackpad appear to be connected over SPI: https://bugzilla.kernel.org/show_bug.cgi?id=99891 While there

Re: acpiec: handle burst mode failure

2016-07-14 Thread joshua stein
On Thu, 14 Jul 2016 at 16:31:32 -0500, joshua stein wrote: > Also, I just checked FreeBSD and they appear to do something similar > to my patch, where they check that the EC burst mode flag is set in > the status after trying to enable it: > > https://github.com/freebsd/freebsd/

Re: quiet legacy drivers on amd64

2016-08-02 Thread joshua stein
On Tue, 02 Aug 2016 at 12:30:51 +0200, Joerg Jung wrote: > > > Am 01.08.2016 um 23:14 schrieb joshua stein <j...@openbsd.org>: > > > > are these complaints really helpful on modern machines? > > Can't speak for clock. But I tend to not like this for n

Re: acpiec: handle burst mode failure

2016-08-12 Thread joshua stein
On Fri, 08 Jul 2016 at 18:51:17 -0500, joshua stein wrote: > If the EC fails to go into burst mode for whatever reason, the Burst > Acknowledge byte will not be there to read, which means the status > won't have EC_STAT_OBF, which means acpiec_wait will spin forever, > hanging

Re: acpiec: handle burst mode failure

2016-07-14 Thread joshua stein
On Sat, 09 Jul 2016 at 16:32:15 -0700, Philip Guenther wrote: > No newer bios for this thing? :-( It is actually the open-source Chrome EC found on the Chromebook Pixel (among others), and according to the source code for the version on this machine, it did not implement burst mode in its ACPI

acpiec: handle burst mode failure

2016-07-08 Thread joshua stein
If the EC fails to go into burst mode for whatever reason, the Burst Acknowledge byte will not be there to read, which means the status won't have EC_STAT_OBF, which means acpiec_wait will spin forever, hanging the machine. This at least gets us moving again, ignoring the failure to enter burst

Re: acpiec: handle burst mode failure

2016-07-09 Thread joshua stein
On Fri, 08 Jul 2016 at 22:34:34 -0700, Philip Guenther wrote: > On Fri, Jul 8, 2016 at 4:51 PM, joshua stein <j...@openbsd.org> wrote: > > If the EC fails to go into burst mode for whatever reason, the Burst > > Acknowledge byte will not be there to read, which means the

acpicbkbd

2016-07-01 Thread joshua stein
@@ +/* $OpenBSD$ */ +/* + * Copyright (c) 2016 joshua stein <j...@openbsd.org> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all

Re: inteldrm: setup backlight pwm alternate increment on backlight enable

2017-02-20 Thread joshua stein
On Fri, 10 Feb 2017 at 10:46:08 +0100, Peter Hessler wrote: > On 2017 Feb 10 (Fri) at 11:52:20 +1100 (+1100), Jonathan Gray wrote: > :On Thu, Feb 09, 2017 at 06:39:13PM -0600, joshua stein wrote: > :> I have no idea why there are chickens involved, but this fixes the > :> p

acpithinkpad: new hid

2017-02-25 Thread joshua stein
New ThinkPads use a different ACPI HID. Index: sys/dev/acpi/acpireg.h === RCS file: /cvs/src/sys/dev/acpi/acpireg.h,v retrieving revision 1.36 diff -u -p -u -p -r1.36 acpireg.h --- sys/dev/acpi/acpireg.h 10 Jul 2016 20:36:41

speed up rasops32

2017-02-19 Thread joshua stein
Some EFI framebuffers are very slow, so rather than sending every pixel of a character one at a time, send one row at a time. Under VMWare fusion, this change makes a kernel boot to userland more than 10 seconds faster. It also helps a noticeable bit on my MacBook Air before inteldrm takes over.

inteldrm: setup backlight pwm alternate increment on backlight enable

2017-02-09 Thread joshua stein
I have no idea why there are chickens involved, but this fixes the problem on at least the MacBookAir7,1 (Broadwell) where upon S3 resume, the backlight value is treated as 0 or 100 despite reporting intermediate values, so if the backlight value was anything other than 100 at suspend time, the

asmc: restore keyboard backlight on resume

2017-02-09 Thread joshua stein
After resume, the keyboard backlight is still off, so restore it (this was also helpful to figure out the machine was actually resuming). Index: sys/dev/isa/asmc.c === RCS file: /cvs/src/sys/dev/isa/asmc.c,v retrieving revision 1.30

acpi: pretend to be Darwin on Apple hardware

2017-02-09 Thread joshua stein
When running on machines with a hw_vendor of "Apple Inc." or "Apple Computer, Inc.", only return 1 for an OSI check of "Darwin" and not the other Windows variants. Code in the AML of the MacBookAir7,1 (most likely all Macs) does much different things when running on Darwin systems, but the AML

Re: acpi: pretend to be Darwin on Apple hardware

2017-02-10 Thread joshua stein
On Thu, 09 Feb 2017 at 18:30:59 -0600, joshua stein wrote: > Without this, my MacBook Air won't suspend properly (hangs calling > _PTS) and a similar change in Linux from 2014 (commit > 7bc5a2bad0b8d9d1ac9f7b8b33150e4ddf197334) notes that upon resume, > the Thunderbolt ports won't b

Re: Xorg stipple

2017-02-26 Thread joshua stein
On Sun, 26 Feb 2017 at 10:43:50 +0100, Landry Breuil wrote: > On Wed, Mar 09, 2016 at 05:09:13PM -0600, joshua stein wrote: > > Is anyone seriously finding video/Xorg bugs through the default X > > stipple pattern anymore? Xorg changed the default to draw a black > > b

Re: Add RTL8153 support to ure(4)

2017-03-10 Thread joshua stein
On Fri, 10 Mar 2017 at 20:54:39 +0100, Mark Kettenis wrote: > Fairly straightforward port of the changes made to the FreeBSD driver. > Like re(4) this has a fairly incestious relationship with rgephy(4) as > it needs a similar hack to read the media status register. > > Tests, especially on

acpisbs/acpibat

2017-03-06 Thread joshua stein
In case the DSDT provides interfaces for both a Smart Battery and a normal one, probe for acpisbs first, if it attaches, make acpibat not match. Index: dev/acpi/acpi.c === RCS file: /cvs/src/sys/dev/acpi/acpi.c,v retrieving revision

amd64: remove clock warning

2017-08-11 Thread joshua stein
Removes this useless error that appears on some modern machines: RTC BIOS diagnostic error ff Index: sys/arch/amd64/isa/clock.c === RCS file:

acpibat: add _BIX support

2017-07-21 Thread joshua stein
ACPI 4.0 deprecated _BIF for battery status, so some newer machines have _BIX instead which provides the same info plus some extra fields. I used some macro magic to make the diff less painful, and added a sensor for the new cycle count exported by _BIX which can be useful to see. Index:

Re: acpibat: add _BIX support

2017-07-22 Thread joshua stein
On Sat, 22 Jul 2017 at 18:07:56 +0200, Mark Kettenis wrote: > > Date: Fri, 21 Jul 2017 23:31:28 -0500 > > From: joshua stein <j...@openbsd.org> > > > > ACPI 4.0 deprecated _BIF for battery status, so some newer machines > > have _BIX instead which provides the

rasops: fix virtual console initialization

2017-05-14 Thread joshua stein
Only copy the console buffer contents to a rasops virtual console if it's the first one (visible). Otherwise all of the other virtual consoles initialize with the trailing end of the kernel messages and then getty writes over them, like this: https://imgur.com/a/mAXKf Index: dev/rasops/rasops.c

hidmt: add support for hybrid mode

2017-10-08 Thread joshua stein
@@ -4,6 +4,7 @@ * standard * * https://msdn.microsoft.com/en-us/library/windows/hardware/dn467314%28v=vs.85%29.aspx + * https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchscreen-packet-reporting-modes * * Copyright (c) 2016 joshua stein <j...@openbsd.

inteldrm: reduce i2c busy-wait to 100us

2017-10-10 Thread joshua stein
On my Kaby Lake laptop, running xbacklight or xrandr causes the audio and mouse cursor to pause briefly. This is because those codepaths do DRM operations that have to probe all of the available connectors, even disconnected ones. For HDMI, it does i2c operations that have to timeout. Reducing

acpithinkpad fixes for brand new machines

2017-09-08 Thread joshua stein
Revision 1.50 of acpithinkpad.c made inteldrm defer to acpithinkpad for screen brightness adjustments instead of handling it natively. That was needed to avoid some synchronization issues on machines where the hardware buttons do the backlight adjustment on their own, and just notify acpithinkpad

acpibat: don't be strict about _BIX being too big

2017-09-03 Thread joshua stein
For some reason on at least the ThinkPad X1C 5th Gen, Lenovo makes _BIX return a package with size 21 instead of 20, adding an int at the end after the OEM string value (I'm guessing to be used as an OEM int value). The template that _BIX writes into: Name (BX0I, Package (0x15)

Re: dwiic: add pci attachment

2017-11-11 Thread joshua stein
sys/dev/pci/dwiic_pci.c --- /dev/null 1 Jan 1970 00:00:00 - +++ sys/dev/pci/dwiic_pci.c 10 Nov 2017 15:56:34 - @@ -0,0 +1,204 @@ +/* $OpenBSD$ */ +/* + * Synopsys DesignWare I2C controller + * PCI attachment + * + * Copyright (c) 2015-2017 joshua stein <j...@openbsd.

ihidev(4) polling

2017-11-16 Thread joshua stein
Now that the dwiic(4) PCI support is in, this implements polling mode for ihidev to work around the problem of ioapic interrupts not arriving for them after setup. I've spent far too much time trying to debug that problem (including much of my time at t2k17), so I made this as a workaround

Re: ihidev(4) polling

2017-11-16 Thread joshua stein
On Thu, 16 Nov 2017 at 13:42:03 -0500, James Turner wrote: So I have to ask since when I hit you up on icb the above terms where all mentioned. With this diff and what you just committed to src add touchpad support to the Xiaomi Mi Air 12.5"? The Xiaomi Mi Air needs a Sunrise Point GPIO driver

dwiic: add pci attachment

2017-11-03 Thread joshua stein
C controller + * PCI attachment + * + * Copyright (c) 2015-2017 joshua stein <j...@openbsd.org> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission n

Re: inteldrm: reduce i2c busy-wait to 100us

2017-11-03 Thread joshua stein
On Wed, 11 Oct 2017 at 11:16:07 +0200, Mark Kettenis wrote: > > Date: Tue, 10 Oct 2017 15:42:26 -0500 > > From: joshua stein <j...@openbsd.org> > > > > On my Kaby Lake laptop, running xbacklight or xrandr causes the > > audio and mouse cursor to pause briefly.

Re: dwiic: add pci attachment

2017-11-09 Thread joshua stein
On Thu, 09 Nov 2017 at 10:14:16 +0100, Remi Locherer wrote: On Fri, Nov 03, 2017 at 12:01:15PM -0500, joshua stein wrote: Intel 100 Series laptops have the DesignWare I2C controller attaching via PCI instead of ACPI, so move the guts of dwiic(4) into ic/ and add dwiic_acpi and dwiic_pci files

sysctl(8): add -F option to print temps in freedom units

2018-02-19 Thread joshua stein
Index: sbin/sysctl/sysctl.8 === RCS file: /cvs/src/sbin/sysctl/sysctl.8,v retrieving revision 1.214 diff -u -p -u -p -r1.214 sysctl.8 --- sbin/sysctl/sysctl.816 Feb 2018 07:27:07 - 1.214 +++ sbin/sysctl/sysctl.8

pckbd: go back to using table 2 by default

2018-01-02 Thread joshua stein
In 2007 I changed this code to use table 3 by default, falling back on table 2 (the previous default) or 1. This was done just to make the keyboard on the OQO model 01 work, and these devices are long gone. 10 years later, some newer Lenovo machines seem to have trouble trying this mode

Re: inteldrm: always use probed screen size for fb

2018-07-26 Thread joshua stein
On Thu, 26 Jul 2018 at 22:26:51 +0200, Mark Kettenis wrote: > I'm hesitant to change this code. How does Linux behave on tese > machines? Does it use the invisible part of the framebuffer? Or have > they done away with actually using the kernel framebuffer completely > like some developers

Re: inteldrm: always use probed screen size for fb

2018-07-27 Thread joshua stein
On Fri, 27 Jul 2018 at 19:44:28 +0200, Mark Kettenis wrote: > > Date: Thu, 26 Jul 2018 17:56:03 -0500 > > From: joshua stein > > > > On Thu, 26 Jul 2018 at 22:26:51 +0200, Mark Kettenis wrote: > > > I'm hesitant to change this code. How does Linux behave on

stop using WSMOUSE_TYPE_ELANTECH in other drivers

2018-07-27 Thread joshua stein
Back when touchpad drivers were using the synaptics Xorg driver, they had to pretend to be Elantech devices in order to get particular packet processing. Since Ulf switched us to wstpad and xf86-input-ws a while ago, these drivers can stop claiming to be WSMOUSE_TYPE_ELANTECH devices and use

stop using WSMOUSE_TYPE_ELANTECH in other drivers (xenocara)

2018-07-27 Thread joshua stein
And here is the xenocara part. Index: xserver/config/wscons.c === RCS file: /cvs/xenocara/xserver/config/wscons.c,v retrieving revision 1.21 diff -u -p -u -p -r1.21 wscons.c --- xserver/config/wscons.c 8 Dec 2017 15:02:00 -

ubcmtp: fix multi-finger on type4 devices, pass in proper pressure

2018-08-15 Thread joshua stein
Type 4 devices like the MacBookPro12,1 have extra padding in between each chunk of finger data that needs to be skipped, otherwise the offset will be wrong and each additional finger will read as static coordinates. This must have been overlooked when it was added to the driver in 2015 since

fix hid constant conversion

2018-08-24 Thread joshua stein
The HID code uses hid_feature, hid_input, and hid_output constants to refer to report types internally that then need to be converted to their bus-level counterparts before actually getting sent out (so hid_feature becomes UHID_FEATURE_REPORT for USB, I2C_HID_REPORT_TYPE_FEATURE for i2c).

umt(4)

2018-08-25 Thread joshua stein
- @@ -0,0 +1,47 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 2016-2018 joshua stein +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\&q

inteldrm: always use probed screen size for fb

2018-07-23 Thread joshua stein
On the 2015 MacBook Pro and the 12" MacBook, the firmware reports a framebuffer size of 2880x1800 but the screens are 2560x1600 and 2304x1440. Our console ends up drawing text off screen and the latest few lines can't be read. Once X loads, it probes the outputs again and uses the proper

ims: match on HID touchscreens

2018-08-31 Thread joshua stein
If there is an i2c HID device that has a Digitizers/Touchscreen collection and an X report, attach ims to it. hidms already has support for touchscreens. This may help if you have a newer laptop with a touchscreen. Also limit the logical min/max finding in hidms to the first non-zero result.

Re: ims: match on HID touchscreens

2018-09-01 Thread joshua stein
On Sat, 01 Sep 2018 at 20:53:45 +0200, Mark Kettenis wrote: > Not sure if that is indeed the right approach, but we can always fix > it in a better way later. The HID report descriptor contains this: [...] 0x05, 0x01,// Usage Page (Generic Desktop Ctrls) 0x09, 0x30,//

rasops: implement scrollback for inteldrm and efifb

2018-04-16 Thread joshua stein
Index: arch/amd64/amd64/efifb.c === RCS file: /cvs/src/sys/arch/amd64/amd64/efifb.c,v retrieving revision 1.12 diff -u -p -u -p -r1.12 efifb.c --- arch/amd64/amd64/efifb.c28 Oct 2017 01:48:03 - 1.12 +++

realpath(3) on a dangling symlink

2018-06-27 Thread joshua stein
realpath(3) on a symlink that points to a non-existent path returns that path (but also sets errno), rather than returning NULL and setting errno. This is inconsistent with at least Linux, FreeBSD, and macOS. #include #include #include #include #include #include int main() {

Re: realpath(3) on a dangling symlink

2018-06-27 Thread joshua stein
On Wed, 27 Jun 2018 at 21:35:31 -0500, joshua stein wrote: > symlink("/tmp/link", "/tmp/nonexistent"); Oops, I changed this test code at the last second. The proper test code which incorrectly prints on OpenBSD: resolved realpath of /tmp/nonexistent (returned /

Re: [PATCH] Add elan(4) touchpad driver

2018-11-08 Thread joshua stein
On Fri, 09 Nov 2018 at 03:30:07 +, b...@curlybracket.co.uk wrote: > Hi all, > > This patch adds a new touchpad driver, elan(4), which supports older non > PTP I2C Elantech touchpads. I have tested this on my HP Chromebook 13 > and it appears to work well, multitouch is working as well as the

ihidev: fix possible panic

2019-04-08 Thread joshua stein
psize is built from the first two bytes read from the device, but it could be completely bogus, especially when polling. This can result in a panic when reading p. Promote it to a signed int to catch it going negative and discard it if it's 2 or less, because shortly after it is decreased by

acpithinkpad: a fix for the x260

2019-03-06 Thread joshua stein
sthen found that the HKEY version metric failed on the x260 where it reports version 1 but requires the new ACPI method of changing backlight. This diff tries to do the ACPI method on all machines and falls back to the CMOS method if that fails. Can all those that tried the previous diff

acpithinkpad: fix brightness keys, keyboard backlight value

2019-03-05 Thread joshua stein
Here we go again... On at least the ThinkPad X1C6, the screen brightness keys (F5 and F6) do not work and "wsconsctl keyboard.backlight" doesn't report the correct value when the keyboard backlight is adjusted with Fn+Space. These are both caused by the default event mask not including these

Re: wscons: precision scrolling

2019-03-16 Thread joshua stein
On Thu, 14 Mar 2019 at 00:48:33 +0100, Ulf Brosziewski wrote: > Much too fast? I'm a bit surprised. In my tests, the new method was > generally somewhat slower than the old one (and I haven't changed the > "scroll units"). How did you test it? Which hardware and which applications > did you

ihidev: always register interrupt

2019-03-16 Thread joshua stein
I still haven't figured out why ihidev doesn't receive interrupts for I2C devices on Intel 100 series and newer. But on an Intel 300 series laptop, I noticed that the Elan touchscreen (ims at ihidev) does actually generate interrupts while the Elan touchpad (imt at ihidev) doesn't. In this

Re: wscons: precision scrolling

2019-03-17 Thread joshua stein
On Sun, 17 Mar 2019 at 19:35:17 +0100, Ulf Brosziewski wrote: > Hi Joshua, > > could you make a test with the updated diff below and check whether > the scroll speed is normal? (There are no changes in ws, it's just > the kernel part). Hi, this version scrolls much better.

Re: wscons: precision scrolling

2019-03-13 Thread joshua stein
On Wed, 13 Mar 2019 at 00:41:12 +0100, Ulf Brosziewski wrote: > The standard method of scrolling in X is tailored to mouse wheels and > proceeds in coarse steps. Wheel events are mapped to button events, and on > receiving such an event, an application moves the view of its data by some > fixed

dwiic at pci: fetch timing parameters from acpi

2019-03-15 Thread joshua stein
While making dwiic at pci attach on an Intel 300 series laptop, dwiic was timing out while ihidev tried to fetch the HID descriptor. Turns out the default timing parameters pulled from the device are wrong, so try to fetch them from ACPI and use those instead. This matches what dwiic at acpi

ubcmtp: fix multi-finger on type4 devices

2019-05-25 Thread joshua stein
A previous version of this last year broke on some devices because it tried to pass in pressure data. This version only fixes the padding data of type4 devices. Tested on the 2015 MacBook Pro. Tests on other Apple devices would be appreciated. Index: sys/dev/usb/ubcmtp.c

Re: [Patch] Driver for Keyspan USA-19HS

2019-05-28 Thread joshua stein
Hi, Some feedback inline: On Tue, 28 May 2019 at 18:42:51 -0400, Cody Cutler wrote: > Hello tech, I'm submitting the following patch for inclusion. The patch > implements a driver for the Keyspan USA-19HS USB-to-serial dongle. > > I've used it for a few months now without any problems. Please

Re: [Patch] Driver for Keyspan USA-19HS

2019-06-07 Thread joshua stein
On Mon, 03 Jun 2019 at 23:44:37 -0400, Cody Cutler wrote: > Hi jcs and tech, the following is a patch which implements jcs's feedback and > adds a man page. Thanks Cody, I've imported your driver.

azalia: quirk for thinkpad x1c7

2019-08-10 Thread joshua stein
The ThinkPad X1 Carbon 7th generation has 4 speakers now, but the default setup connects both speaker and speaker2 to the same DAC. The speaker2 set needs to be routed to a different DAC (dac-0:1) to work properly. This also adds the 300 Series HDA controller to the list of devices where

ihidev: always register interrupt, stop polling if it fires

2019-07-19 Thread joshua stein
The fast polling of ihidev may cause a problem during suspend/resume because dwiic may be in an unknown state, so add a DVACT_QUIESCE handler to properly shut it down. Even if polling is requested, register the interrupt handler too. If it ever fires, stop polling and just use the interrupt.

Re: iwm: support 9260 devices

2019-11-16 Thread joshua stein
On Sat, 16 Nov 2019 at 17:09:40 +0100, Stefan Sperling wrote: > On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote: > > This diff adds support for iwm(4) 9260 devices and hopefully 9560 > > devices as well but I have not yet had time to test those. > > > > Joint work with patrick@.

Re: iwm: support 9260 devices

2019-11-16 Thread joshua stein
On Sat, 16 Nov 2019 at 19:08:05 +0100, Stefan Sperling wrote: > On Sat, Nov 16, 2019 at 11:44:03AM -0600, joshua stein wrote: > > Awesome, thanks guys. It's working great on the 9560 on my ThinkPad > > X1C7. A speed test showed 44/18 Mbps and it continues to work fine > &

Re: iwm(4): support for MSI-X

2019-11-20 Thread joshua stein
On Wed, 20 Nov 2019 at 14:59:41 +0100, Patrick Wildt wrote: > Hi, > > on my Intel NUC 8i5BEHs that has a 9560 chip the current in-tree > support for the 9000 series does not work. The issue seems to be > the interrupt delivery. The first interrupt we wait for, which is > loading the firmware

Re: apmd battery emergency message

2019-09-20 Thread joshua stein
On Fri, 20 Sep 2019 at 17:00:39 +0200, Alexander Bluhm wrote: > Hi, > > sometimes my laptop was running out of battery while I was working. > To avoid that, I patched apmd(8) to write a emergency message to > syslog(3). Then with this line in syslog.conf I receive a warning > in every xterm. >

acpivout: try to consistently adjust brightness by 5%

2019-10-13 Thread joshua stein
When responding to hardware keys to increment or decrement screen brightness, don't just adjust by 1 BCL level as there may be 100 levels. Find the next brightness level that is at least 5% up or down, and use that. Index: dev/acpi/acpivout.c

acpithinkpad: don't take over ws_[gs]et_param on version 2 devices

2019-10-13 Thread joshua stein
Newer ThinkPads have ACPI goo to allow acpivout to control screen backlight, so don't take over ws_[gs]et_param from it. This allows for 100 levels of backlight control rather than the 10 or 15 that are supported through acpithinkpad using its proprietary ACPI or CMOS interfaces. You can see

posix_openpt: allow O_CLOEXEC

2020-02-05 Thread joshua stein
The spec says the behavior of anything other than O_RDWR and O_NOCTTY is unspecified, but FreeBSD allows passing O_CLOEXEC. Index: lib/libc/stdlib/posix_openpt.3 === RCS file: /cvs/src/lib/libc/stdlib/posix_openpt.3,v retrieving

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Wed, 05 Feb 2020 at 17:48:41 -0700, Todd C. Miller wrote: > On Wed, 05 Feb 2020 15:47:37 -0600, joshua stein wrote: > > > The spec says the behavior of anything other than O_RDWR and > > O_NOCTTY is unspecified, but FreeBSD allows passing O_CLOEXEC. > > OK, but the

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Thu, 06 Feb 2020 at 11:21:11 -0700, Todd C. Miller wrote: > On Thu, 06 Feb 2020 10:45:44 -0700, "Theo de Raadt" wrote: > > > That feels better, and will be more atomic. > > Unfortunately, we can't do this in ptmioctl() since we don't have > the index of the open ptm device to use to check for

Re: posix_openpt: allow O_CLOEXEC

2020-02-06 Thread joshua stein
On Thu, 06 Feb 2020 at 12:41:47 -0700, Theo de Raadt wrote: > > Index: stdlib/posix_pty.c > > === > > RCS file: /cvs/src/lib/libc/stdlib/posix_pty.c,v > > retrieving revision 1.3 > > diff -u -p -u -p -r1.3 posix_pty.c > > ---

Re: Mouse movement speed

2020-05-17 Thread joshua stein
On Sun, 17 May 2020 at 16:17:46 -0700, jo...@armadilloaerospace.com wrote: > I enabled wsmoused for console mouse support, but the cursor was > unusably fast. This is a high resolution, high update rate USB gaming > mouse, but it was off by well over an order of magnitude. > > I searched for a

Re: acpiapplesmc(4)

2020-09-07 Thread joshua stein
On Mon, 07 Sep 2020 at 06:58:01 +0200, Marcus Glocker wrote: > This is an initial driver for the Apple System Management Controller > found in Intel based Apple computers. > > The driver is currently missing support for the Sudden Motion Sensor > (SMS), light sensor, and keyboard backlight since

acpihid: INT33D5 driver

2020-05-30 Thread joshua stein
\ acpitimer.4 acpivideo.4 acpivout.4 acpitz.4 \ diff --git share/man/man4/acpihid.4 share/man/man4/acpihid.4 new file mode 100644 index 000..8d54da962d1 --- /dev/null +++ share/man/man4/acpihid.4 @@ -0,0 +1,47 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 20

umstc: Microsoft Surface Type Cover driver

2020-05-30 Thread joshua stein
file mode 100644 index 000..da557c59d1d --- /dev/null +++ share/man/man4/umstc.4 @@ -0,0 +1,44 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 2020 joshua stein +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or

Re: acpihid: INT33D5 driver

2020-06-02 Thread joshua stein
/man/man4/acpihid.4 new file mode 100644 index 000..d9914cec7b7 --- /dev/null +++ share/man/man4/acpihid.4 @@ -0,0 +1,42 @@ +.\"$OpenBSD$ +.\" +.\" Copyright (c) 2020 joshua stein +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\

exar XR17V35x (again)

2020-08-05 Thread joshua stein
In 2018 I added support for Exar XR17V35x serial ports: The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a frequency of 125Mhz, and have a unique sleep register. A custom interrupt handler is setup in puc for these ports so it can check a register which reports

imt/hidmt: work better with dual touchpad/trackstick devices

2020-07-02 Thread joshua stein
.c @@ -3,7 +3,7 @@ * HID-over-i2c multitouch trackpad driver for devices conforming to * Windows Precision Touchpad standard * - * https://msdn.microsoft.com/en-us/library/windows/hardware/dn467314%28v=vs.85%29.aspx + * https://docs.microsoft.com/en-us/windows-hardware/design/component-gui

Re: Give support to the 2019 Apple's MBP (13-inch)

2020-06-11 Thread joshua stein
On Thu, 11 Jun 2020 at 08:29:12 +0200, Romero PĂ©rez, Abel wrote: > Hello, > > I tried to install stable flavor from USB on the MBP 13-inch 2019, with no > luck, and the following issues: > > 1. Booting kernel messages > > Centered on the screen, with a very small size, not working well for >

Re: tpm(4): removing tvtohz(9)?

2020-12-18 Thread joshua stein
On Fri, 18 Dec 2020 at 18:58:43 -0600, Scott Cheloha wrote: > Hi, > > tpm(4) is the last driver in the tree using tvtohz(9). There are no > remaining callers using tstohz(9), so if and when we remove tvtohz(9) > from tpm(4) we can remove both interfaces from the tree. > > tpm(4) is tricky

ims: claim to be a touchpad

2021-01-20 Thread joshua stein
There are no i2c-connected mice and ims(4) will always be a touchpad/touchscreen/stylus that just doesn't meet the requirements of imt(4). Presenting it as WSMOUSE_TYPE_TOUCHPAD makes the X server set it up as a separate pointer which may be useful. Index: sys/dev/i2c/ims.c

ddb: resize when new console attaches

2021-02-02 Thread joshua stein
This way we aren't wrapping ddb output lines halfway across the screen on a modern console. diff --git sys/ddb/db_output.c sys/ddb/db_output.c index 77fd0e34944..72b9a24e761 100644 --- sys/ddb/db_output.c +++ sys/ddb/db_output.c @@ -252,3 +252,10 @@ stacktrace_print(struct stacktrace *st, int

Re: [Diff] Implement multiple device cloning for hotplug

2021-05-12 Thread joshua stein
On Tue, 11 May 2021 at 22:37:55 -0400, Ashton Fagg wrote: > Inspiration for this diff was drawn from Joshua Stein [1], seeminly he > had a use-case that was somewhat similar to mine at one point but it > doesn't look like this was ever committed. Nor can I find any discussion > on it.

Re: usbhidctl: add -R flag to dump raw report descriptor bytes

2021-05-28 Thread joshua stein
On Wed, 26 May 2021 at 08:13:52 +0200, Anton Lindqvist wrote: > On Tue, May 25, 2021 at 08:31:14AM +0200, Anton Lindqvist wrote: > > On Mon, May 24, 2021 at 09:17:26AM -0500, joshua stein wrote: > > > This is useful for parsing the report descriptor with a different > &g

Re: usbhidctl: add -R flag to dump raw report descriptor bytes

2021-05-30 Thread joshua stein
On Fri, 28 May 2021 at 21:52:57 -0500, joshua stein wrote: > > Another approach which keeps the structure opaque is the extend the > > usbhid(3) API with something like: > > > > void > > hid_get_report_desc_data(report_desc_t d, uint8

usbhidctl: add -R flag to dump raw report descriptor bytes

2021-05-24 Thread joshua stein
This is useful for parsing the report descriptor with a different tool to find issues with our HID parser. I've found https://eleccelerator.com/usbdescreqparser/ to be helpful. diff --git usr.bin/usbhidctl/usbhid.c usr.bin/usbhidctl/usbhid.c index 921f211a280..bd0b5da0222 100644 ---

hidms: don't ignore mice with no x/y coordinates

2021-05-24 Thread joshua stein
A bug was reported where a Kensington USB trackball didn't work properly: uhidev4 at uhub0 port 6 configuration 1 interface 0 "Kensington Expert Wireless TB" rev 2.00/1.02 addr 9 uhidev4: iclass 3/1, 3 report ids ums3 at uhidev4 reportid 1 ums3: mouse has no X report ums4 at

  1   2   >