Commit graph

10882 commits

Author SHA1 Message Date
Jacob Moody
3273db5a84 aux/mnihongo: use memdraw instead of draw
We used to rely on there being a draw(3) there in order to render the
characters in to, this resulted in flashing the rio window white and
made some documents only buildable under a terminal environment.  This
fixes both of those issues.
2025-01-03 00:43:05 +00:00
Jacob Moody
9e0913fa71 libmemdraw: change openmemsubfont() to accept rune minimum as argument
Subfonts for non ascii characters are offset by some minimum rune,
typically specified within the parent font file.  Because libmemdraw
only deals in subfonts, if we want to have it draw non ascii runes we
need some method of providing that base offset.

This function is only used in one place, so update the function
signature and fix the only caller.
2025-01-03 00:51:43 +00:00
cinap_lenrek
a101561223 auth/factotum: avoid static buffer from netmkaddr()
factotum calls authdial() in parallel, so use
the reentrant version netmkaddrbuf() instead.
2025-01-02 20:11:22 +00:00
cinap_lenrek
e981a26000 libc: provide netmkaddrbuf() function avoiding the static buffer
We need a reentrant version for netmkaddr() that
can be used in multithreaded programs.
2025-01-02 20:09:50 +00:00
cinap_lenrek
5ea80693ba usbuhci, usbehci: remove portlck qlock
Everything is already serialized by usbd. For ehci, portlck
also doubled for waiting for doorbell, so rename it to match
its use case.
2024-12-29 17:09:51 +00:00
Jacob Moody
68c89f4a43 acid: remove outdated 8.out binary default (thanks Tekk) 2024-12-27 19:29:34 +00:00
cinap_lenrek
b849349e0c devusb: fix enable delays to avoid device suspend (thanks cgnarne)
cgnarne experienced issues with his xbox controller when
connected to uhci root-port.

doing some experiments, we determined that the delay
between clearing reset and setting enable needed to
be between 5µs and 2.7ms for it to attach successfully.

this timing is close to the 3ms idle time that makes
devices enter suspend mode, so we concluded that the
delay here must be shortend (50ms -> 2ms).
2024-12-26 17:35:44 +00:00
Jacob Moody
242e1dc552 vdiff: accept diff as filename argument and man page touch-up (thanks humm) 2024-12-26 03:54:31 +00:00
Jacob Moody
ed318aac59 rio(4): fix paragraph spacing (thanks humm) 2024-12-26 03:53:18 +00:00
Ori Bernstein
0bfa3ffcb4 gefs: fix error handling in readsnap() 2024-12-26 00:46:07 +00:00
Ori Bernstein
d4938f099d auth/totp(1): separate docs for auth/totp, auth/userpasswd 2024-12-25 17:33:17 +00:00
cinap_lenrek
e05e30eaca auth/userpasswd: remove factotum-bug work-around from 2002, cruft (thanks ori) 2024-12-25 17:08:34 +00:00
Ori Bernstein
21731dd45e auth/factotum: add support for TOTP code generation 2024-12-25 02:18:43 +00:00
cinap_lenrek
1a91932731 ip/dhcpd: impvoe validip(), make validipmask() reject ipv6 masks
Because isv4() is never true for IPnoaddr,
we can skip the check.

Make validipmask() ensure that the top IPv4off
bytes are all 0xff, then check that the low
4 bytes are a valid mask (must be a power
of two minus one).
2024-12-23 16:12:35 +00:00
Jacob Moody
248634879a git: bikeshed git/walk relative path calculation and add tests 2024-12-22 22:41:02 +00:00
Jacob Moody
7814ec46c3 git: make git/diff -s print relative file paths
This makes the output of git/diff -s plumbable
when the user is not within the root of the git repo.
This is implemented through adding a flag to git/walk
and having git/walk work out how many '..'s are needed.

Also includes a small piece of documentation regarding
the use of $editor in git/commit.
2024-12-22 21:06:53 +00:00
cinap_lenrek
35cab9b816 ip/dhcpd: don't get confused by ipv6 addresses for bootp Info
When looking up tftp/bootp information from ndb,
filter out ipv6 addresses. This can happen
when for example the tftp= attribute points to
a domain or sys-name that resolves to both
ipv4 and ipv6 addresses.

Make validip() do the isv4() check, and provide
separate validipmask() function.
2024-12-22 20:06:18 +00:00
Ori Bernstein
94d9b7a49d cpp: remove stray line from tests 2024-12-22 04:53:12 +00:00
cinap_lenrek
9853ea28c8 /sys/src/9/mkfile: add imx8, lx2k and mt7688 to kernel ARCH list 2024-12-22 03:37:25 +00:00
Ori Bernstein
8b3a70dcd1 git/pull: fix typo 2024-12-22 01:19:50 +00:00
Ori Bernstein
66abd6e50a cpp: implement empty arg handling for function-like macros (thanks rod) 2024-12-22 00:48:14 +00:00
Ori Bernstein
60ea3e6d25 git/pull: only show commit summary after updating branches
this makes human error somewhat harder in noscroll windows.
2024-12-21 22:40:27 +00:00
Ori Bernstein
83fe095033 git/get: support side-band and multi-ack 2024-12-14 17:11:01 +00:00
cinap_lenrek
837c596bdf usbdwc: preserve Prtpwr bit for portstatus, turn off power by default, handle channel timeout
preserve the Prtpwr bit in portstatus instead of
unconditionally setting it.

turn off port powert on init. (let usbd will turn it on).

make chanio() halt the channel and error out
when interrupt status is 0 after timout.

this happens when the port is powered off.
2024-12-16 05:14:45 +00:00
cinap_lenrek
5028b882da usbehci: implement portpower control for rootports 2024-12-16 01:52:12 +00:00
Ori Bernstein
eff4b93652 acme/Mail: correct message line number for partially hidden threads 2024-12-15 21:56:54 +00:00
cinap_lenrek
f86cc3e912 usbxhci: preserve RsvdP bits in registers, print recovery reason, print base address.
Preserve reserved "RsvdP" bits in registers
according to 2019 xhci specification 1.2.

Print the USBSTS register and event-ring stopped flag
on recovery.

Add the controller base address in prints,
so it can be identified what errors belong
to what controller.
2024-12-15 21:27:00 +00:00
cinap_lenrek
d38dbf6415 nusb/usbd: use longer reset delay for rootports
Make reset delays more conservative:

The usb spec says root ports need 50ms reset minimum, use 100ms.
The usb spec says hub ports need 20ms minimum, use 50ms.
2024-12-15 21:19:57 +00:00
Ori Bernstein
2f685dd96b git/branch: stop emitting incorrect 'merge failed' messages 2024-12-14 05:32:05 +00:00
cinap_lenrek
473ebd0f9e ndb/dns: don't refuse queries when delegated subareas
We used to always provide soa and ns hints when
we where not authoritative.

This changed with the last commit, where we
would instead return refused error.

But this breaks when we want to explicitely
delegate to another nameserver, so add parameter
to inmyarea() to get the delegated soa out,
and provide delegated nameservers when we have one.
2024-12-14 01:49:55 +00:00
Ori Bernstein
d1b72a27b7 walk: error on mutually exclusive flags 2024-12-12 20:35:58 +00:00
Ori Bernstein
b8797a1cc6 walk: fix skipped files, simplify seen() 2024-12-12 20:17:51 +00:00
Ori Bernstein
e59b7e28cd git: refactor capability parsing
this should be a nop, but set us up better
for handling and exposing capabilities in
git/serve.
2024-12-10 23:15:22 +00:00
Ori Bernstein
e58df8173f walk: show siblings with the same qid
the code for skipping directory loops in
walk was taken from du, but the desired
behavior for the two programs is differnt;

while du wants to count the total size used,
and double-counting directories would be a
mistake, walk wants to enumerate all finite
paths in a namespace.
2024-12-10 23:14:33 +00:00
Ori Bernstein
ace81cb1ae mkfiles: check for test/mkfile when recursing
Some programs have test directories without a test
mkfile; this causes spurious errors. Discriminate
more carefully.
2024-12-10 23:11:44 +00:00
Ori Bernstein
bf398d28c3 cpiofs: add newc support for cpiofs (thanks rminnich)
Linux initrds, uroot file systems, and
others generate newc cpio images; add
support for them.
2024-12-10 23:07:26 +00:00
Ori Bernstein
15f66c69d8 tar: use IOUNIT to compute Dblock 2024-12-10 23:05:38 +00:00
cinap_lenrek
ddaadd65b4 libdisk: cleanname() paths for setname()/mkpath(), avoid utfrrune() 2024-12-09 13:57:39 +00:00
cinap_lenrek
9d552b68e4 nusb/lib: decode classcode() 0xFF -> vendor, 0xFE -> application (-specific) 2024-12-09 13:00:16 +00:00
Ori Bernstein
8e2a071b8b acme/Mail: fix redrawn line offsets, add support for flag filters
maintaining ->nsub was fragile, and didn't save very many cycles;
instead just compute it every time; it's only going to hurt with
a ton of giant threads.
2024-12-09 05:27:05 +00:00
Ori Bernstein
af83b606f9 upas/Mail: Add support for message filtering 2024-12-09 03:58:40 +00:00
cinap_lenrek
aa1e68e9fe nusbrd: pass $usbdebug to nusb/usbd
This can be usefull for debugging usb enumeration issues from boot,
if one has the chance to pass parameters on the bootloader.

It was initially suggested in a troubleshooting session todo as
a quick modification, but it can be usefull in general.
2024-12-09 01:30:16 +00:00
cinap_lenrek
eb52c928b1 nusb/usbd: improve debugging, dont portfail() when port attaches/detaches too fast, cleanup
- always dprint() all the port state transitions.
- when port is attaching in short succession and we'r reaching the limit,
  don't return -1 as that would cause portfail(), return 1 instead
  which would make us ignore it.
- cleanup portattach(), use Dev *d instead of h->dev.
2024-12-08 01:10:41 +00:00
cinap_lenrek
8cc080311f nusb/lib: decode more base class codes in classname() 2024-12-07 15:55:12 +00:00
cinap_lenrek
eab5162760 nusb/audio: fix wrong emallocz() call in getclockrange() 2024-12-07 15:54:07 +00:00
cinap_lenrek
255704232e nusb/usbd: make it less noisy: fprint() -> dprint() 2024-12-06 19:00:30 +00:00
cinap_lenrek
5cc0a1f76d nusb/usbd: impelement warm-reset for usb3 ports, attempt port reset on failed hubs, enable port-power for rootports 2024-12-06 16:10:31 +00:00
cinap_lenrek
2f12ad38ca devusb: handle root-port reset delays outside of hci driver, rootport power control
We want to avoid long delays with interrupts disabled,
so handle the delay from devusb/usbd.

Do not expect SetFeatrue/PortEnable request, this is
invalid by the usb standard. But some HCI's require
setting enable bit in port status/ctrl register of
rootports, so handle this internally.

xhci, dwc and ohci have a power-power control bit,
so implement standard Set/ClearFeature/PortPower in
roothub, which allows us to control port on some
rootports.
2024-12-06 16:07:44 +00:00
Arne
ff65b74935 nusb/joy: support xbox360 controllers
Added a custom hid descriptor for Xbox360 controllers.
Up to six axes are now supported for analog input.
Added a simple deadband filter for analog axes.
2024-12-03 20:21:37 +00:00
Ori Bernstein
0518041867 cc: dont' try compiling invalid code
When we have errors in the code, passing it on to the backend
just generates cryptic or incorrect errors, and in some case,
crashes as we try to process trees with missing labels, or
which are malformed in other ways.

Instead, bail out of codgen() and don't even try.
2024-12-01 22:37:14 +00:00