Commit Graph

64417 Commits

Author SHA1 Message Date
Gerasim Troeglazov
e511f0c1cb usb_serial: add WinChipHead (CH340/CH341) support
Fixes #15872.

Change-Id: I3b43094574045464ca0d3e024f8b5aac32ce5210
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5401
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-27 09:15:58 +00:00
Jérôme Duval
caf0369a89 ext2: check volume state when mounting
we deny mounting read/write when not clean or with errors.

Change-Id: Ie0188319618d9d8e7199b308c007fbaeacaed87c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5400
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-06-25 20:16:06 +00:00
Jérôme Duval
732f5f0f87 ext2: accept block count until the disk size plus one
my understanding is that it's possible that the last block (for instance of size 4KB)
is too large for the last few partition sectors, if the partition size isn't a multiple
of the block size.

Change-Id: I88c709d6e449aa52358fd9343c9f68f7ac1c01fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5399
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-25 20:16:06 +00:00
Jérôme Duval
442298d494 kernel/devfs: improve devfs_compute_geometry_size
the old code could lead to an odd head count, thus a smaller partition size.
with power of two, this works at least accurately if the size is aligned.
we should probably introduce a new ioctl or extend the current one to avoid this problem.

Change-Id: Ia6c034262b1756e901d6ad76ab17b278b2314631
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5398
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-25 20:16:06 +00:00
Autocomitter
faefd309d9 Update translations from Pootle 2022-06-25 08:11:32 +00:00
Jérôme Duval
d2e5fc7fa4 usb_disk: add support for drives bigger than 2TB
* tested read/write with a NTFS partition at the end of a 5TB USB hard disk.
* fix #14670

Change-Id: Ic005dfb7ef94b50a2d6fc8099ef5c83ec6b4a730
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5397
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-25 07:05:26 +00:00
Jérôme Duval
e49b671dcf kernel/vfs: lstat a symlinked dir with a trailing slash should traverse
golang's TestSymlinkWithTrailingSlash exhibits the bug.

Change-Id: I7e16bad9857e9be042fc215a587c861bc4eef716
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5395
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-24 08:31:44 +00:00
Augustin Cavalier
c95c5ed821 idualwifi7260: Merge patch from OpenBSD for some 9xxx devices. 2022-06-22 14:34:17 -04:00
Augustin Cavalier
a928b16e36 freebsd_network: Unlock the taskqueue before waiting for threads.
Also set tq_threads to NULL to prevent double-frees.
2022-06-22 00:34:37 -04:00
Augustin Cavalier
7e1c1d3020 openbsd_network: Adjust reference-taking in bus_dmamap_load_mbuf.
dm_segs is a flexible-length array at the end of a structure.
Taking its address with & gives the same address as using it without,
however, the types are not identical in the different cases.

This should fix some warnings about incompatibile pointer types
while not changing behavior.
2022-06-21 23:23:02 -04:00
Augustin Cavalier
4b6af34c06 kernel: Move aligned_alloc to heap.cpp alongside calloc.
It is independent of whatever heap implementation is actually in use,
so it belongs in here (even if this file is probably not the right
place for such functions in the first place.)

This allows the kernel to be built once again with things other than
the default slab heap.
2022-06-21 22:59:57 -04:00
Augustin Cavalier
8e059bfa63 ralinkwifi (ral): Upgrade to FreeBSD 13.1
One new device ID.
2022-06-21 17:34:52 -04:00
Augustin Cavalier
b071913066 freebsd_network & drivers: Remove need to specify FBSD_TASKQUEUES.
Instead make FBSD_TASKQUEUES a combination flag of all taskqueues,
so that if even one is needed, the init_taskqueues function will
be invoked appropriately.
2022-06-21 17:22:37 -04:00
Augustin Cavalier
b4bf3ed0d5 drivers/network: Adjust all HAIKU_DRIVER_REQUIREMENTS for taskqueues.
Many of these did not need taskqueues at all. Others can hang off
the WLAN feature's implicit usage of taskqueues.
2022-06-21 17:12:29 -04:00
Augustin Cavalier
0163191229 freebsd_network: Rework taskqueues implementation.
* Use FreeBSD's queue management directly, only retaining thread
   creation and synchronization functions from Haiku.

 * Use FreeBSD's task structure declarations.

 * Use a standard non-FAST taskqueue for taskqueue_thread.

 * Rewrite header and adjust consumers as appropriate.
2022-06-21 16:17:50 -04:00
Augustin Cavalier
ed20f6660f glue: Add comment that argv_save and __main_thread_id need not be set here.
But they still are so the glue code is compatible with older Haiku versions.
2022-06-21 13:16:07 -04:00
Jérôme Duval
032b1422c2 kernel/device_manager: don't insert device node before nodes of the same priority
fix #16512

Change-Id: I76ce4cfc9346492008c11ca53302ca4df6a6b514
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5393
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-21 16:55:01 +00:00
Augustin Cavalier
c27c987075 freebsd_network: Fix address restriction computation in bus_dma.
The min/max usage was reversd from what it should be. This
would have led to the least restrictive restrictions being the
ones that were checked, instead of the most restrictive.
2022-06-21 12:24:04 -04:00
Augustin Cavalier
2c81f88085 freebsd_network: Clean up bus_dma restrictions implementation.
* Remove support for filters (again): they are deprecated in FreeBSD
   and no driver we have uses them. This allows the loop in the
   _validate_address function to be dropped entirely.

 * Clean up parent tag handling logic.
2022-06-21 12:24:04 -04:00
PulkoMandy
e866d6e941 ps2: disable keyboard during multiplexing probing
My machine does not have an AUX/Mouse port at all. As a result, the
commands all get sent to the keyboard, which confuses the keyboard and
it eventually resets. This is generally harmless, but it ends up
resetting the keyboard, which cancels the effect of the commands to set
the repeat rate and delay during boot.

By disabling the keyboard during this step, we can avoid interference
with it.

Change-Id: Ic0513972a31e030a15577477c3d3fe32d4ce9bd3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5387
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-21 15:52:53 +00:00
X512
b2059b9f15 libroot: set __main_thread_id in libroot initialize_before instead of entry point
DT_INIT, DT_INIT_ARRAY, initialize_before, initialize_after are called before
executable entry point so __main_thread_id may be uninitalized there. It cause
getpid() to return zero if called in one of image initalizers before main().

Fixes #11797.

Change-Id: Ia745db9ffeaeb6de4dd46b868b1575d0780b54d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5254
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-21 11:49:50 +00:00
Augustin Cavalier
b3dab377a9 idualwifi7260 & iaxwifi200: Enable PCI busmastering.
The FreeBSD KPIs that we emulate expect this to be done manually,
so we have to do it before we begin doing PCI access.

Fixes firmware load failures and device initialization problems
since the introduction of the OpenBSD driver replacing the FreeBSD one.
2022-06-20 17:17:20 -04:00
Augustin Cavalier
561bb7bac5 idualwifi7260 & iaxwifi200: Do not return but go to the appropriate fail.
This way, we will actually tear down what state got initialized.
2022-06-20 17:15:45 -04:00
Augustin Cavalier
22bdb7ba70 iaxwifi200: Add missing if_free_inplace on deinit.
It may make sense to place this later so that we don't need to add
another goto label, but that can be experimented with later.
2022-06-20 17:14:53 -04:00
Augustin Cavalier
891bd14810 packages/Haiku: Clean up WiFi firmware rules.
* Nothing uses the plural forms anymore, so drop them.
 * Nothing uses the "PACKAGE" field, so drop it.

Once the Marvell driver is migrated to use a package instead of the
archive, we can drop even more of this related to HAIKU_WIFI_FIRMWARE_DO_EXTRACT.
2022-06-20 13:27:13 -04:00
Augustin Cavalier
33d311a64b HaikuBootstrap: WiFi firmware rules not needed.
The WiFi firmware rules are only needed for a few very old drivers.
Any devices we are going to bootstrap on will use one of the wifi_firmwares
packages instead.
2022-06-20 13:25:58 -04:00
Augustin Cavalier
2e1033fcf1 idualwifi7260 & iaxwifi200: preinit() can fail.
This will prevent the device from even appearing in Network preferences
if firmware loading does not work.
2022-06-20 13:04:00 -04:00
Augustin Cavalier
f578843da4 idualwifi7260 & iaxwifi200: Use the Haiku gDriverName instead of hardcoding.
This also will fix what name appears in the syslog.
2022-06-20 13:03:20 -04:00
Augustin Cavalier
7ac9dc6612 freebsd_network: Use a dedicated USB mutex instead of &Giant.
Fixes #17804.
2022-06-20 13:02:32 -04:00
Jérôme Duval
177a801206 kernel: fix trace build for fd.cpp and fifo.cpp
Change-Id: I12b2e85926ae63eaba5c077343cdaa2362cf8af1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5391
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-20 15:29:43 +00:00
PulkoMandy
a3d84aba73 ps2: improve tracing
Change-Id: I3991e1974ac4af2ba00d692284bfcf00e5b4cc84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5386
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-20 02:48:03 +00:00
PulkoMandy
d2837c97b7 Interface kit: allow get_key_repeat_{rate,delay} to fail
These functions should return an error if the input_server is not
running. They still give the default value in this case, but they now
return an error code.

Change-Id: I706cded7c780d913d4f36164596b2b7794db6f22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5385
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-20 02:48:03 +00:00
PulkoMandy
81f9c26a70 Input server: remove some dead code
This does nothing, keep the TODO but remove the useless code.

Change-Id: I14611289e1153e406ff7dec93729bceedef7d9af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5384
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-20 02:48:03 +00:00
PulkoMandy
3f18d506fa Input preferences: remove dead code
The old keyboard preferences used to save its window position in the
keyboard_settings file. The new Input preferences does not, but part of
the code had not been removed yet so it would still open the file (and
then do nothing with it)

Change-Id: Ic5e1d6bd6a8452bd779dc73872148d5c32ab12e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5383
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-20 02:48:03 +00:00
Alexander von Gluck IV
774c33c2a7 radeon_hd: Drop unused overlay, cursor registers
* Also drop unused vblank semaphore storage
* Spotted by X512. These are from intel_extreme
  which was used as a base *ages* ago.

Change-Id: I2a6baaa4849baeb8c8cf10e2046d0fbe10c3a356
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5389
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-20 02:46:55 +00:00
PulkoMandy
ea56f5e0be kernel: replace Spleen font with an enlarged version of the original KDL font
Recently we introduced Spleen as a larger font for KDL for high
resolution displays. However, it looks quite different from our original
font. I designed an enlarged version of our original font (designed by
Brian J. Swetland and also found in NewOS, LK and Fuchsia) to use
instead.

Change-Id: I10872e407d45b906f8b6c7ba44b2f993dcd19bff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5382
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-19 08:38:46 +00:00
Javier Steinaker
702ff4212d NetworkStatus: do not show non-present interfaces
Used explicit type declaration instead of auto and old style
map erase() function to (hopefully) make it compatible with gcc2 builds.

Change-Id: I8314665a3a3468f11bcac11367ee69d9a3ed2a05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5380
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-19 08:32:53 +00:00
Mashijams
9c4a46b318 xfs : version 5 superblock, checksum header file
- Implemented version 5 superblock fields and necessary macros.

- Checksum functions are implemented which will be used for crc verification and crc updates.

- fssh_kernal_priv.h ROUNDDOWN macro definition is consistent with kernal.h definition.

Change-Id: I49b7c939bfd3ea1bffc85b3db42bc678dcce75cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5350
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-18 08:32:18 +00:00
Augustin Cavalier
ac2215ca09 ifconfig: Place generic options at the end of the media types list.
Otherwise we will get "Auto-select" even if something more specific
applies, e.g. in the case of IFM_IEEE80211 at least.

Fixes media type detection for OpenBSD drivers.
2022-06-15 21:07:50 -04:00
Augustin Cavalier
07b1a21775 EHCI: Do not ignore status of PrepareKernelAccess.
May help with #17799.
2022-06-14 15:26:27 -04:00
Augustin Cavalier
d621ee6564 freebsd_network: Move up Giant ownership during attach.
device_attach can be recursed for MIIbus drivers, so avoid the complexity
and lock Giant from init_drivers() instead.
2022-06-14 00:34:46 -04:00
Augustin Cavalier
c6c03b01c3 freebsd_network: Validate ranges but not alignment when coalescing in bus_dma. 2022-06-14 00:30:14 -04:00
Augustin Cavalier
e206b2f350 freebsd_network: Always hold the "Giant" lock during attaches.
Reduces patches to OpenBSD drivers slightly, and could potentially
help with some of the KDLs.
2022-06-13 23:57:37 -04:00
Augustin Cavalier
e6da31ae5d idualwifi7260: Add error to panic message.
Should help with diagnosing the KDLs seen in #14298.
2022-06-13 23:21:14 -04:00
Augustin Cavalier
73d88d4ee6 ifconfig: Add basic IEEE 802.11 media types to the list.
This requires using the FreeBSD if_media.h (for now, anyway)
and adding a subtype_mask to the data structures. But this
does work.

Now 802.11 media will be displayed in ifconfig and Network
preferences.
2022-06-13 22:47:30 -04:00
Augustin Cavalier
1adb712427 preferences/network: Use ifconfig's MediaTypes object instead of recompiling.
The next commit will make it depend on FreeBSD headers,
which we do not have available here.
2022-06-13 22:47:30 -04:00
Augustin Cavalier
850fc02fa2 kernel/vm: Specifiy the page as the object being waited on in VMCache.
I got a strange whole-system hang in file_cache_resize into this
function. Possibly the page was spuriously busy, perhaps it wasn't,
but not having function arguments on x86_64 in stack traces, I was
unable to deduce what page was actually being waited on.

In case it happens again, this should allow it to be debugged further
by placing the address of the vm_page structure in the thread wait
informations. (A string is not very useful here anyway.)
2022-06-13 22:43:15 -04:00
Augustin Cavalier
44fa45df3a net/if: Drop ifmediareq and just use the regular ifreq for SIOCGIFMEDIA.
This was introduced into the main API in 2010 (d72ede75fb),
but was actually only fully used for the past month (c2a9a890f3)
when SIOCGIFMEDIA was supported for all *BSD drivers and not just WiFi.
Most userland consumers of this structure did not use it correctly,
as was the case in #17770, and only worked because in the fallback case
the network stack just treated it as if it were an ifreq.

Nothing actually used the ifm_count/ifm_ulist (though tentative APIs
were exposed for it) as noted by previous commits; and the fact that
Haiku's IFM_* declarations are so spartan makes most of the returned
values unintelligible to userland without using FreeBSD compat headers.

If, in the future, we decide to implement ifmedia listing and selection
properly, that should likely be done with separate ioctls instead of
having multi-function ones like this.

This is technically an ABI break, but in practice it should not matter:
ifmediareq::ifm_current aligns with ifreq::ifr_media, so the things
that used this structure like our in-tree code did will continue to work.
Until this past May, the only other field that was usually set was
ifm_active, but in the absence of setting ifm_status all non-Haiku
consumers should ignore it completely.

The only consumer of this ioctl that I know of out of the tree,
wpa_supplicant, still works after these changes.
2022-06-13 22:31:33 -04:00
Augustin Cavalier
ecf18ba4c8 freebsd_network: Cleanup around ifmedia handling.
* Remove unused variable.

 * Use original value for IFM_AVALID, we do not need to remap this one.
   (Actually we do not need to remap IFM_ACTIVE here either, but it makes
    some things slightly easier to work with rather than remapping it
    in a different location.)
2022-06-13 20:34:05 -04:00
Augustin Cavalier
83ac9b727c network/stack: Do not invoke SIOCGIFMEDIA but just return the already-fetched media.
This functionally disables most of the functionality of the BSD-style
SIOCGIFMEDIA, but it was never used in userland (because if it had,
it would have triggered SMAP violations in the compatibility layer.)

SIOCGIFMEDIA returns BSD-style media values, which mostly overlap
with Haiku ones but have a few differences still. These are taken care
of in the compat layer by ETHER_GET_LINK_STATE, which is where this
media value comes from, but are not by SIOCGIFMEDIA which just passes
back whatever the drivers do.

Fixes #17770, at least for ethernet drivers.
2022-06-13 20:32:57 -04:00