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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
After discussion, it was suggested that it might make more
sense to handle the noswap stuff outside of gefs, like
with any other fileserver.
plan9 file-servers are not privileged. one might even run
them in a test script to mount an image.
Factotum used to mount itself on /mnt and serving the first-level
directory "factotum" itself. This has the undesired consequence
that it has to respond to all walks crossing the /mnt directory.
Instead, we make factotum interpret the previously ignored
mount-spec (aname). If it is "factotum", it serves the
factotum directory as the root, so it can be directly mounted
onto /mnt/factotum. For backwards compatibility, the old
behaviour is preserved.
The namespace file will now always mount factotum onto /mnt/factotum.
In the case of a old factotum, that ignores the mount-spec,
do a bind moving /mnt/factotum/factotum to /mnt/factotum.
when doing bulk operations one after the other, like
mass-marking messages read, the cursor tends to jump
to update the messages, but they're already in the
right state; don't do that.
We do not want to unconditionally pull in all of
/lib/firmware, when we dont have the driver for it.
So group the files into separate proto-files
and make boot/bootmkfile simply checks that the basename
of a proto file matches the basename in $OBJ to be
considered.
This way, we can also avoid including user-space usb
daemon when the kernel lacks the usb driver.
Same for machines without devsd, devfs or devusb,
theres no disk so no reason to include disk file
servers.
The bootfs.paq file is specific to the configuration,
so give it a unique name. (Just using bootfs.paq
is fine as long as theres only a single configuration,
but i want to avoid future mistakes as people copy-paste
the kernel configuration).
We can move the pcibios code to its own module
and just provide a stub pcibiosinit() function
for pc64 so we do not have to pull in that code
and the data structures.
also lets us clean up mkdevlist hacks.
we should properly zero-pad the ethernet frames we send out
instead of sending random garbage.
for ppp -> ethernet, the ethernet header is fixed, so we
can generate it once before the read()/write() loop.
Use a 1514 byte buffer for all ethernet frames as the
maximum, and limit the mtu to 1514-14-8 -> 1492.
For xhci, we want to keep the hubs around until all its
attached devices have been released, so have the Udev
take a reference to its parent hubs ep0.
This also means that we can now use just a pointer
to the tthub instead of duplicating the properties
needed for xhci and ythe code becomes trivial.
Do a non-recursive implementation of putep() to
conserve stack space.
For device detaches, we want to immediately cancel
all I/O so that the driver can release the device
as soon as possible.
For this, we add epstop callback in the Hci struct.
Implement prefix delegation by requesting a
prefix and populate ipnet=val entry (val
passed from -i option).
Before, DHCPv6 was just implemented for stateless
one-shot operation, just exiting once we got out
IA address.
Moodies mediacom-enterprise-enterprise-ISP...
... they actually do enterprise-grade dyanmic dhcpv6
so here we are, implementing renewals...
The IA options where not parsed properly, assuming option 5
is the first option.
For managed networks, we might not get any prefix info
options, but dhcpv6 needs a gateway, so use source address
of the RA.
The Routehint is embedded into the Translation struct
at an offset, so setting the Translation *q pointer to
nil results in a non-nil Routehint* pointer passed to
ipoput4() generating a crash.
When a low/full speed device is connected to a USB2.0 hub,
the USB2.0 hub needs to be send special split transaction
protocol messages to communicate with the device below.
This also applies if the fullspeed/lowspeed device is not
directly connected to the USB2.0 hub, but has a fullspeed
hub in between like:
rootport -> usb2.0 hub -> usb1.1 hub -> fs/ls device
In this case, the tranaction translator is actually
the first hub, nut the direct parent of the device.
This was all totally wrong in the hci drivers drivers.
Also, with the new interface, usbd passes number of
ports, and TT properties in the "hub" ctl message,
so the port-count, TT Think-Time and Multi-TT properties
can be properly applied by the xhci driver.
Another bug was that the xhci route string was not
correct if a hub has more than 15 ports. A USB2.0
hub can have more than 15 ports and the standard sais
that in this case a value of 15 should be used in
its bit routestring nibble.
Also, check the hub depth. We should not exceed more
than 5 hubs.
For xhci, it turns out the hub parameters where
actually never properly applied, as the spec sais
only the first "create endpoint" command applies
the hub parameters. The "evaluate context" command
does not work.
Some pikeshedding in devusb:
- fix the freaking locking.
- remove redundant parameters (isroot -> depth < 0, ishub -> nports > 0)
- add TT properties to usb device struct
With these changes, the wired "middle port" issues
on mnt-reform xhci are gone.
In an upcoming commit, the interface for how to create hubs
and how to update endpoint parameters is going to change.
Device/endpoint properties should not be modified while
the data file is open (device is being used).
This also applies to control endpoint when changing
packet size.
The motivation here is to clean up the xhci driver
and not do these stupid hacks like parsing control
messages. It is easier to just have the hci drivers
apply everything at open time and being guaranteed
that properties do not change under them.
For this we need to make sure to only do these devctl's
while the data file is not open.
For hubs, the command changes and some parameters.
Primarily the number of ports (required for xhci) which
will let devusb do some error checking and the
USB2.0 -> USB1.1 transaction translator properties.
In usb/lib, the "isroot" property is redundant and is
replaced by depth < 0.
For usb3.0 hub descriptor, the led indicator fields are
different from usb2.0 descriptors.
Rest is pikeshedding.
This is an error probably when converting from libthread
to classid plan9 procs. umsrequest() used to just sysfatal()
once the error counter reached some value. But this leaves
9p procs (created by srvrelease()) around keeping the
device hanging around.
Instead, reply first, then attempt some recovery.
If that fails, kill our notegroup.
Also, for upcoming devusb changes, make sure we do
devctl() while the endpoint is not in use.
Instead of having the driver allocate the temporary
READSTR buffer (and messing up the error handling),
allocate it in devether (netif) and pass the driver
start and end pointers to it.
Also, systematically check that the ifstat()
function checks the zero-length read (meaning
it is supposed to just update statistics counters
for a stats file read).
Drivers where allocating a READSTR size buffer,
then readstr() it. But readstr() can raise an
error on pagefault, resulting in the buffer to
be leaked.
Instead, we change the interface and allocate
the buffer in devuart read handler, passing
the driver start and end pointers into it.
Also, provide a default implementation (when
status == nil), avoiding some duplication.
A user can create a large demand paged segment
and then do write to a ctl file with a very large buffer
driving the kernel into an out-of-memory condition.
For all practcal purposes, limit the input buffer size
to something reasonable. READSTR is 8000 bytes, which
would be enougth for even the largest ctl messages.
We have to ensure that we do the putep() loop
only once for detach, so serialize the state
transition using ep0 qlock().
Furthermore, once the state is Ddetach, we
must ensure never to set it to something else
(such as Dreset or Denabled).
usbid's where globally allocated with a generation counter,
but it would not free usbid's when freed out of order
resulting in overflow.
instead, we use a different scheme, where we allocate the
next higher id until we run out and then allocate the next
lowest id.
properly maintain epmax as well when putep() when out of
order.
make newdev() and newdevep() return the new Ep* with a
reference taken, preventing someone from freeing the ep
under us.
fix the locking, so once we release the epslock, all endpoints
have the ep->dev set properly and remove impossible checks.
remove the annoying "dump" ctl that spams the console.
The test just called date twice assuming they all
execute in the same second. This causes false positives
with the following errors (usually just 1 second
difference):
term% while(){./zones.rc}
/adm/timezone/US_Arizona Sun, 06 Oct 2024 09:09:12 -0700 1728230953 1728230952 are not equal
/adm/timezone/Uruguay Sun, 06 Oct 2024 14:09:17 -0200 1728230958 1728230957 are not equal
/adm/timezone/Japan Mon, 07 Oct 2024 01:09:19 +0900 1728230960 1728230959 are not equal
/adm/timezone/Iran Sun, 06 Oct 2024 19:39:25 +0330 1728230966 1728230965 are not equal
/adm/timezone/Australia_West Mon, 07 Oct 2024 00:09:27 +0800 1728230968 1728230967 are not equal
/adm/timezone/US_Eastern Sun, 06 Oct 2024 12:09:29 -0400 1728230970 1728230969 are not equal
/adm/timezone/GMT Sun, 06 Oct 2024 16:09:31 +0000 1728230972 1728230971 are not equal
/adm/timezone/local Sun, 06 Oct 2024 18:09:34 +0200 1728230975 1728230974 are not equal
/adm/timezone/Mexico_BajaSur Sun, 06 Oct 2024 09:09:36 -0700 1728230977 1728230976 are not equal
The fix is to get the current time once, with date -n
and then pass that to date to format the time and
then concert back and compare.
remove the global statistics counters from taslock.c
as they'r not particularily usefull nor precise
and just cause unneccessary cache traffic.
if we want them back, we should place them into
the Mach structure.
also change the lock() function prototype to return void.