Commit Graph

65137 Commits

Author SHA1 Message Date
Adrien Destugues
0992009d13 libnetapi: remove support for old OpenSSL versions, prepare for OpenSSL 3
- Remove backported function that was needed only for old OpenSSL versions
- Add compile time options to declare which version of OpenSSL API we
  want to use

This should make it possible to build with OpenSSL 3 while keeping the
old APIs available. Once the migration to OpenSSL 3 is done, we can bump
the OPENSSL_API_COMPAT value to get compile time errors when using APIs
that are deprecated in OpenSSL3, and rewrite all the code that needs
changes.

Change-Id: I606633739ed12f9698a3013989025b68478352fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6484
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-31 16:33:08 +00:00
Zardshard
0e86ca77e7 Tracker: Fix memory leak
Change-Id: I2fa8e9e87d1097cfc358cc3653240aeac6efb910
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6485
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-31 16:32:50 +00:00
Augustin Cavalier
ca40d4ab5c usb_disk: Probe by USB configuration instead of attributes.
In the case of devices where the mass-storage interface is not the
first one, we will miss it unless we were to check all attributes
one at a time in order. Instead of doing that, just fetch the configuration
and enumerate it directly.
2023-05-30 15:32:49 -04:00
Augustin Cavalier
e1e2a82dd2 USB: Use BStackOrHeapArray in RegisterNode.
I saw in a KDL stack trace that this function was using over 4KB of stack.
As it is called as part of device_manager startup, where there can be
pretty deep recursion happening, that seems like a bad idea.

Additionally, it did not actually do bounds checking.
Now we dynamically allocate an array of sufficient length.
2023-05-30 15:24:52 -04:00
Augustin Cavalier
ac0506fd90 usb_disk: Granularize locking.
There is now an "io_lock" which must be held when performing any USB
operations. All ioctls that read basic status, size, icon, etc. information
do not need to acquire it, of course, which should improve userland
lockup occurrences on congested USB disks.
2023-05-30 15:23:36 -04:00
Augustin Cavalier
20313e56ed usb_disk: Clean up and consolidate mutex/semaphore creation/destruction. 2023-05-30 14:19:57 -04:00
Augustin Cavalier
dd6e7cb90d usb_disk: Use get_attr_uint8 instead of a loop to get class/subclass/protocol.
Suggested by axeld. The original logic was copied from the USB-ECM
driver, which may also be able to be simplified here.
2023-05-30 14:19:07 -04:00
Augustin Cavalier
9b1ff49d87 kernel/io_request: Add assertion in NotifyFinished() that fStatus is set. 2023-05-30 14:01:23 -04:00
Augustin Cavalier
831bb20728 kernel/dma_resource: Add an assertion to prevent Init() from being called twice. 2023-05-30 14:00:47 -04:00
Augustin Cavalier
92b8f3e74c kernel/dma_resource: Fix tracing. 2023-05-30 14:00:44 -04:00
Augustin Cavalier
197e4b5a6a usb_disk: Use DMAResource for bouncing and support physical I/O requests.
A "bypass" mechanism is left in for when DMAResource would just add
overhead for no reason. All other I/O goes through it and is submitted
to the USB stack as physical addresses.

Tested in QEMU, can still boot from USB on all busses.

Fixes #15569.

Change-Id: I26bfd2208de4ebe1a17170a7034316076927663f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6480
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Augustin Cavalier
55a468820c USB: Support physical-vector bulk requests.
Introduce a new utility method, "generic_memcpy", which takes
generic_addr_t plus indications of whether these specify virtual or
physical addresses (and potentially user addresess) and calls the
appropriate memcpy variant depending.

All bus drivers adjusted to support this at once. We don't actually
take advantage of the physical addresses in any way (yet), as USB
controllers have some pretty specific requirements that would have
to be carefully validated to use these directly.

All bus drivers tested and confirmed to still be working.

Change-Id: I66326667e148091147bb2b3d0843a26fb7e5bda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6479
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Augustin Cavalier
99626c2908 USB: Use generic_io_vec in Transfer.
Prepares the way for actual physical-address request support,
which is not yet wired up.

Change-Id: I1b2d04a31e334a79b8361280fa0f3a5fbdb43d2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6478
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Augustin Cavalier
65cdc13e7d kernel: Migrate struct generic_io_vec to a private header outside src/.
This way it is more easily accessed from drivers outside the kernel,
which it soon will be, without having to add an explicit UseHeaders.
(The drivers that use it already all use the IOScheduler.)

No functional change.

Change-Id: Ibc2d2678e37d9d7ab73391cb17b72cca86f92132
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6477
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Jérôme Duval
47b66bb676 loopback_frame: when the interface address isn't set, use the destination
fix #18429

Change-Id: Ifd0a15e052bbde9eb3d8875249e03152e6292994
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6482
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 16:15:49 +00:00
Augustin Cavalier
c88d446192 usb_disk: Move icon data to a separate header. 2023-05-29 16:11:30 -04:00
Augustin Cavalier
5c99f9668e XHCI: Disable MSI-X for now.
Breaks USB on some hardware. This might be a bug in Haiku's
MSI-X implementation.
2023-05-29 15:47:22 -04:00
Augustin Cavalier
e223e8e94b kernel/x86: Initialize IO-APIC only after PCI enumeration is complete.
Before the PCI refactor, PCI initialization/enumeration occurred
immediately after the PCI module was loaded, and so by the time
we got to IOAPIC initialization, it was already complete.

After the refactor, PCI enumeration is deferred until slightly later,
and so we would try to initialize IO-APICs without knowing PCI
information. This would fail, as read_irq_routing_table needs to
have that available.

Hopefully fixes #18425, #18393, #18398.

Change-Id: I1e4b06367da26eeb10085a1c6322ed39885b632b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 19:44:32 +00:00
Augustin Cavalier
b256fa4adf usb_disk: Transition to "new" driver API.
Change-Id: Ia46cb6ddc9f83917a8f797149508d35b770e44f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6473
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 18:11:26 +00:00
Jérôme Duval
7c18d58f2b usb: explore on BusManager::Start()
registering new devices requires the device_manager lock. The explore thread would wait
that the initial device scan is over to register devices.

Change-Id: I46529ab0926f349023f06ada3411979c0950dfcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6475
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 18:11:26 +00:00
Zardshard
3c416c7aa7 Tracker: Remove failing ASSERT
This ASSERT causes a crash in the debug build of libtracker.so.

The crash occurs when two conditions are met:
1. There are files in the directory with icons specific to them. This
   is the case with image files, whose icons preview what the contents
   of the image are.
2. Tracker has not displayed those icons yet. This happens if the user
   has not scrolled down far enough to see the icons.

One way to meet these conditions is to configure the build system to
compile a debug build of libtracker.so. Then compile icon-o-matic.
Then run icon-o-matic with the debug build of libtracker.so
LD_PRELOAD'ed.

With that, press File->Open and navigate to
/system/documentation/BeBook/images/admonitions. While in the images
folder, do not scroll up or down to view the icons of the images in the
folder. They should remain unrendered. It should crash as soon as
Tracker enters the admonitions folder.

The crash occurs because NodeIconCache::Deleting is called without a
corresponding call to NodeIconCache::AddItem. Tracker calls
NodeIconCache::AddItem whenever it renders an icon to cache the result.
Tracker, however, is lazy, and only renders the icon when it comes into
view. When navigating out of the directory, Tracker has to call
Deleting for every file in the directory since it doesn't keep track of
which icons it rendered and which icons it didn't. Thus, AddItem has
been called for some of the files, but Deleting has been called for all
of them, causing the assert to fail and the program to crash.

This commit fixes the problem by not requiring a call to AddItem for
each call to Deleting.

Change-Id: I1038ce70ca345c44812becee7f3752567e5b562a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6474
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 18:09:32 +00:00
PulkoMandy
7da4ade74b Remove version constraints for ICU
These are populated with the correct version automatically when building
the package, so there's no need for an explicit setting. This had
already been cleaned up for the other packages, but not yet for
haiku_secondary

Change-Id: I5bcc94fb80f639610899ec31fc77a6e678ca9e80
2023-05-28 17:03:35 +02:00
PulkoMandy
80cb3bc23e Add source for Misc_WebSearch icon
Used in WebSearchFS.

Change-Id: I55a6c74dfb2b57f2a1ea6141727f40a187a9868f
2023-05-28 16:59:19 +02:00
PulkoMandy
5bf195cdad Remove libicutu and libicutest from Haiku dependencies
These are used only by ICU tests and should not be in the ICU package.
They will be removed in the next versions of the ICU package when we
update.

Change-Id: Ib8bb2dd24ce1671e8b369c775b89d49b9b6e84eb
2023-05-28 16:59:19 +02:00
Autocomitter
86574d08dd Update translations from Pootle 2023-05-27 08:12:45 +00:00
Augustin Cavalier
958b83c3ed PoorMan: Default to UTF-8 character set.
Ideally we would default to no character set, but
libhttpd does not seem to support that.

Fixes #18424.
2023-05-25 16:21:40 -04:00
Augustin Cavalier
c098332d7b usb_disk: Retry actions after reset_recovery.
This is mostly important for B_GET_MEDIA_STATUS, which actually will
retry actions if the err_act is set appropriately.

Following this change, stalls are now fully recoverable without causing
the file descriptors of the mounted partition to be cleared, and the
system can resume normal operation without a problem.

Fixes part of #15569.
May help with #16745, #18185, #17543, #18421.
2023-05-25 15:47:40 -04:00
Augustin Cavalier
0a9e5c9e58 usb_disk: Cancel queued transfers when clearing HALTs.
XHCI, at least, has "sticky" HALT states which must be cleared at
the controller level. Invoking cancel_queued_transfers takes care
of this.

This fixes USB disks spontaneously unmounting whenever stalls occur.
However, trying to read anything from the mounted partition results
in "Bad file descriptor", probably due to media-status error propagation.
2023-05-25 15:31:34 -04:00
Augustin Cavalier
1886d5692e XHCI: Handle an unlikely corner case in CancelQueuedTransfers.
See inline comment with reference to the XHCI specification.
2023-05-25 15:29:31 -04:00
Zardshard
400eedd0c8 leak_analyser.sh: Remove usage of obsolescent egrep
Change-Id: Ibd1228238901cb7b1e117e0c611be64046c14b4e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6472
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-05-25 17:38:55 +00:00
X512
b3e608ab9f keymaps/Japanese: Japanese keymap do not use Alt Gr key
Set modifier keys as following:
- Right Cmd -> Right Alt
- Right Opt -> Right Win

Change-Id: I61a193a7690fca8486ecd2c17eb672d24d69e241
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6471
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-05-25 17:38:43 +00:00
Augustin Cavalier
1a88b571ca pci/x86: Reimplement PCIe configuration mechanism using ECAM.
This allows us to drop the PCI-specific ACPI management entirely.
Confirmed working on x86, and the fallbacks when there is no ACPI
also still work.

Change-Id: I6dac9f5539f99b934b17b341634ce22628bc66fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6470
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-25 17:35:53 +00:00
Augustin Cavalier
19ae638fb6 pci/ecam: Fix reading config registers using ACPI method.
Also adjust end-address computation: we read up to 4 bytes past the offset.

Change-Id: I76343aba38cddb614394bd0dca1b36094b8dd85e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6469
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-25 17:35:53 +00:00
Augustin Cavalier
769b4ee4aa XHCI: Implement support for MSI-X.
Works in QEMU, at least.
2023-05-24 15:42:59 -04:00
Augustin Cavalier
5dcae7c6b8 ECAM ACPI PCI controller: Fix computed length being unused for 32/64.
Amends 8be0a59e77.
2023-05-24 15:03:07 -04:00
PulkoMandy
8be0a59e77 ECAM ACPI PCI controller: handle missing address_length
On my machine, the address_length somehow is 0, but can be computed from
the minimum and maximum values.

Change-Id: I2262263915319e0d97a2cd9b9fde3f6af1f79a84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5759
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-24 11:00:07 +00:00
PulkoMandy
4dbd474753 Add BIconUtils::GetSystemIcon
Allow to easily access the alert icons and anything that's added to app_server
resources.

Fixes #10887.

Convert BAlert, Debugger AlertWithCheckbox and Keymap ModifierKeysWindow
to make use of it, removing the duplicate code to locate app_server
resources.

The resources are initialized only once (per application), so there is no need
to reload them for every access to the icons.

In the ticket there is discussion about putting this in BControlLook,
but I think this should in fact be moved fully into app_server with
special drawing commands for well-known icons. That would avoid loading
and rendering the icon on the application side to then send it to
app_server (especially in remote_app_server case)?

In any case, this simple API can serve as a base for applications to
use, and we can change how it is implemented later on.

Change-Id: Id370526ae5cf165cfb8bc277bc8a7f46c26f542d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6463
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-24 10:58:48 +00:00
Zardshard
13f2f8de06 Icon-O-Matic: Move some functions to header files
Change-Id: I3b12e88e133cfe8e9b0f5830f69d582bbaaa93c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6466
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-24 10:58:19 +00:00
Zardshard
41bd89a9fa Icon-O-Matic: Document the importer/exporter classes
Change-Id: I04e920e873efffa0756bb7d0391ac0f898128204
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6465
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-24 10:58:10 +00:00
Swangeon
2815686c1d network/tun: modify mtu and some checks to give correct types/flags
tun & tap tested

Change-Id: Ifac4ba40c56358ac9e845aa3d07cee75f1e8ce46
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6460
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-05-24 05:17:04 +00:00
Jérôme Duval
840faa402b strace: add network definitions
move select/poll to network.cpp

Change-Id: Ie70b2f5ae890b69db633ea5f45d2e8f0a2441a13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6468
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-23 18:41:51 +00:00
Augustin Cavalier
c2e8b3177b usb_raw: Fetch default language before fetching string descriptors.
This fixes strange hangs that occur with some devices when fetching
their string descriptors with language-id "0".
2023-05-23 14:23:14 -04:00
Zardshard
943b5775f8 Icon-O-Matic: Fix memory leak
I found leak_analyser.sh and gave it a try. Indeed, it did find many
leaks, including this one.

Change-Id: I7d36274f3f7772aa459c4bf1d30392e7b8cfa171
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6467
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-23 15:47:34 +00:00
Augustin Cavalier
57d035af1c listusb: Dump Super-Speed Endpoint Companion descriptors. 2023-05-22 20:06:14 -04:00
Augustin Cavalier
ed01a46241 listusb: Split CDC listing into a separate file. 2023-05-22 19:53:10 -04:00
Augustin Cavalier
67df1af45a listusb: Fix verbose class/subclass/protocol printing.
There should always be a space between the hexadecimal number
and then the looked-up string.
2023-05-22 19:50:45 -04:00
Augustin Cavalier
bcc72455d3 freebsd_network: Add missing NULL check in get_usb_device_attach_arg.
May fix #18418.
2023-05-22 19:23:04 -04:00
Augustin Cavalier
605bd3f09d termios.h: Undefine/remove some unimplemented BeOS extensions.
We did not ever implement these, it seems, and so they are just
cluttering up the global namespace.

Change-Id: Ib37c3a31663525a18268c9bfe326bfba9afbc794
2023-05-22 18:20:17 -04:00
Augustin Cavalier
5d4fe207c7 scsi_disk: Remove unused blockShift and log2.
These were used when this driver was first introduced,
but are no longer.
2023-05-22 18:10:28 -04:00
Trung Nguyen
74d2e61ee2 kernel/vm: Make cut_area respect overcommitting flag
`cut_area` now checks the protection of the target area for
the `B_OVERCOMMITTING_AREA` flag and sets it on any cache it
creates. This allows operations that split large overcommitting
areas to succeed.

Change-Id: I8dee27d22df29741cc61af2575c9e6626da25949
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6391
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-20 16:45:58 +00:00