Interface Kit
libbe.soMost of the fork's API work is here: fractional scaling, frame-accurate presentation, dark mode and colour emoji, plus a private accessibility interface.
Added
BScreen::DeviceScale() and B_DEVICE_PIXEL_BITMAP
interface/Screen.h, interface/InterfaceDefs.hHaiku reference ↗
class BScreen {
BRect Frame();
+ float DeviceScale();
+ // frame buffer pixels per coordinate unit, 1.5 at 150%
enum bitmap_drawing_options {
B_FILTER_BITMAP_BILINEAR = 0x00000100,
B_WAIT_FOR_RETRACE = 0x00000800,
+ B_DEVICE_PIXEL_BITMAP = 0x00001000
};
air/OS draws the desktop at the density of each monitor (100–300%, including fractional steps). Apps keep working in logical coordinates. DeviceScale() tells an app how many frame buffer pixels make one coordinate unit, so it can render a bitmap at full resolution. A bitmap drawn with B_DEVICE_PIXEL_BITMAP holds frame buffer pixels: it is placed one to one at the pixel where the destination's top-left corner falls, and is not scaled to the destination rectangle.
Design notes: SCALING.md ↗Design notes: FULL-DENSITY.md ↗4843681f80 908c1fb3fb
Added
BScreen::WaitForOutputRetrace() and GetScanTiming()
interface/Screen.hHaiku reference ↗
+ typedef struct display_scan_timing {
+ uint32 output_id; // 0: the outputs share one blank
+ uint32 flags; // B_SCAN_TIMING_FROM_HARDWARE / _FROM_BLANK
+ BRect frame; // the output, in screen coordinates
+ clipping_rect device_frame; // and in frame buffer pixels
+ bigtime_t scan_start; // system_time() of a frame's start
+ bigtime_t period; // the next ones every period
+ uint32 generation; // changes with the layout and modes
+ } display_scan_timing;
status_t WaitForRetrace(bigtime_t timeout);
+ status_t WaitForOutputRetrace(BRect frame,
+ bigtime_t timeout = B_INFINITE_TIMEOUT);
+ status_t GetScanTiming(BRect frame,
+ display_scan_timing* timing);
With several monitors, each has its own refresh. WaitForOutputRetrace() waits for the next frame of the monitor that shows frame (a window's frame, for example) rather than the main screen's. GetScanTiming() tells a video player or game when that monitor's frames start and how long they last, so it can schedule presentation instead of polling. scan_start comes from the hardware where the driver can read it (B_SCAN_TIMING_FROM_HARDWARE), or from the blank interrupt (B_SCAN_TIMING_FROM_BLANK).
Design notes: RETRACE.md ↗b0e2b79ca0 a6bc6c2763
Behaviour
B_WAIT_FOR_RETRACE is honoured
interface/InterfaceDefs.hHaiku reference ↗
Haiku accepts the B_WAIT_FOR_RETRACE bitmap drawing option but ignores it. In air/OS a bitmap drawn with it reaches the screen at the next vertical blank of its monitor, without tearing. app_server also copies to the screen once per frame, just after the blank, on every output. MediaPlayer already passes the flag.
Design notes: RETRACE.md ↗0be2fa3e5a
Added
Dark mode: ui_dark_mode() and set_ui_dark_mode()
interface/InterfaceDefs.hHaiku reference ↗
rgb_color tint_color(rgb_color color, float tint);
+ // Light or dark appearance (air/OS). Each has its own palette of UI colors;
+ // switching makes the other palette current, and applications get
+ // B_COLORS_UPDATED as for any change of colors.
+ bool ui_dark_mode();
+ void set_ui_dark_mode(bool dark);
There are two complete palettes of UI colours, light and dark, switched in Screen preferences. Colours an app never set follow the current appearance. A switch arrives as an ordinary B_COLORS_UPDATED, which now also carries the colours being replaced in a "be:previous colors" message: BTextView uses it to recolour text that was in the old system text colour, and an app with custom colours can do the same. Summit uses ui_dark_mode() to answer the web's prefers-color-scheme.
ee481831a8 cbdd6fbb4a
Added
B_COLOR_GLYPHS_AS_SHAPES
interface/Font.hHaiku reference ↗
enum {
B_DISABLE_ANTIALIASING = 0x00000001,
B_FORCE_ANTIALIASING = 0x00000002,
+ B_COLOR_GLYPHS_AS_SHAPES = 0x00000004
};
air/OS draws colour emoji, including sequences (ZWJ families, flags, keycaps, skin tones). This font flag draws colour glyphs in the high colour, in the shape of their pixels, for text shadows and outlines. The same happens automatically when the font has a false bold width. In BTextView an emoji sequence counts as one character for the caret, selection and deletion.
Design notes: COLOR-EMOJI.md ↗b1aa7ef0f9
Added
Touchpad wheel phases
interface/Input.h
+ // "be:wheel_phase" of a B_MOUSE_WHEEL_CHANGED message from a touchpad
+ enum input_wheel_phase {
+ B_WHEEL_PHASE_NONE = 0,
+ B_WHEEL_PHASE_BEGAN = 1,
+ B_WHEEL_PHASE_CHANGED = 2,
+ B_WHEEL_PHASE_ENDED = 3
+ };
Two-finger scrolling on a touchpad is smooth. B_MOUSE_WHEEL_CHANGED from a touchpad carries "be:wheel_precise_delta_x" and "be:wheel_precise_delta_y" (float) and "be:wheel_phase". Messages in the middle of a gesture can have whole-step deltas of 0; the stock views ignore those, and an app that scrolls by the precise deltas should too.
Design notes: TOUCHPAD-SCROLLING.md ↗bf91f88318
Behaviour
Drawing on a scaled desktop
BView, BBitmap, BFontHaiku reference ↗
On a scaled desktop app_server renders text and shapes at the frame buffer's density, but bitmaps are enlarged (with area sampling), so content an app draws offscreen at logical size comes out soft. Prefer drawing directly, or render at DeviceScale() and draw with B_DEVICE_PIXEL_BITMAP. Other differences: a BBitmap made from a vector icon keeps its vector form and is drawn sharp at any density (writing to Bits() drops it); CopyBits() by a fraction of a pixel becomes a redraw; B_SCREEN_CHANGED carries "device scale" (float); subpixel anti-aliasing is off while scaled; fractional font sizes are measured at their exact size, so StringWidth() of 13.8-point text differs slightly from Haiku's even at 100%.
Design notes: SCALING.md ↗908c1fb3fb 6a0056c5d4 68fa242f34
Behaviour
Windows, menus and alerts on several monitors
BWindow, BMenu, BAlertHaiku reference ↗
Each monitor is its own region of the desktop. BWindow::Zoom() fills the monitor holding most of the window. CenterOnScreen() and MoveOnScreen() use the window's monitor (or the mouse's while the window is hidden). Alerts open on the mouse's monitor, and menus, submenus and tool tips stay on the monitor they open on. When a monitor is unplugged, its windows move to one that remains.
94f6fc4197 27fc7547a2
Added
B_DIRECT_DEVICE_PIXELS window flag
interface/Window.hHaiku reference ↗
B_NO_SERVER_SIDE_WINDOW_MODIFIERS = 0x00000200,
+ B_DIRECT_DEVICE_PIXELS = 0x00000400
+ // a BDirectWindow that draws in the frame buffer's own pixels,
+ // so it stays connected when the desktop is drawn at a higher
+ // density (see direct_buffer_info::device_scale)
See the Game Kit below: without this flag a BDirectWindow is disconnected while the desktop is scaled.
7a2a4f225f
Private
Accessibility: BAccessible
private/interface/Accessible.h, AccessibilityProtocol.h
+ class BAccessible {
+ public:
+ virtual accessible_role Role() const = 0;
+ virtual BString Name() const;
+ virtual BString Value() const;
+ virtual uint64 States() const;
+ virtual BRect Frame() const;
+ virtual int32 CountChildren() const;
+ virtual BAccessible* ChildAt(int32 index) const;
+ virtual status_t PerformAction(accessible_action action);
+ void NotifyEvent(accessible_event event,
+ const BMessage* details = NULL);
+ static status_t Attach(BView* view, BAccessible* root);
+ static status_t SetName(BView* view, const char* name);
+ static status_t SetDescription(BView* view, const char* description);
+ static void Announce(const char* text, bool interrupt = false);
+ ...
+ };
A system accessibility interface for screen readers. Standard views (BControl, BTextView, BListView, BMenu, BSlider, BColumnListView, BWindow) report themselves and their events with no work from the app. An app can name an icon-only button with SetName(), or attach its own tree of nodes (a web view's document) with Attach(). Nothing runs until an assistive tool connects to accessibility_server; until then each hook costs one branch. Used by the ScreenReader app; Summit is the planned first big client.
Design notes: ACCESSIBILITY.md ↗1fa68a8f2e 5082fadeb9
Private
Window capture
private/interface/WindowInfo.h
BPrivate::read_window_bitmap() returns a window's whole content even where other windows cover it, and do_window_action() with kWindowActionCaptureStart / kWindowActionCaptureStop marks the window's tab while it is being shared. Summit uses it for getDisplayMedia() window sharing.
0fec0a7d2b
Application Kit
libbe.soNo public header changes. Notifications can now answer the app that posted them, and there are new system protocols for media keys and shutdown.
Behaviour
Notifications that answer
BNotification (notification_server)Haiku reference ↗
BNotification has no new methods, but the server reads extra fields from the archived notification. With "_reply:target" (a BMessenger) set, a click sends "_reply:activated" back (with "button": 0 for the notification itself, 1 and up for buttons) instead of launching the app. "_reply:closed" is sent when it goes away, and "_buttons" (strings) adds buttons under the text. Terminal uses this for OSC 99 desktop notifications.
Design notes: NOTIFICATIONS.md ↗37cec9713a 8aedd194e6
Private
Media keys: kMsgMediaKey
private/shared/MediaKeys.h
Play/pause, next and previous keys (including Bluetooth keyboards' consumer keys) go to the app that is playing, else to the active one. The system first sends a query (kMsgMediaKey, 'mkey'); an app answers with reply_media_key_query() and handles the key with reply_media_key_handled(). MediaPlayer, Amp and airTime answer it; /bin/mediakey sends keys from scripts.
Design notes: MEDIA-CONTROLS.md ↗10522a195f
Private
B_REG_QUIT_USER_APPS
private/app/RegistrarDefs.h
Runs only the first phase of a shutdown: user apps get the normal quit request and can save their work or refuse. The reply names the app that refused. System Updater uses it before installing an update.
Design notes: SYSTEM-UPDATER.md ↗778738c03e
Device Kit
libdevice.soGame pad rumble, gap-free isochronous USB input, and a class for small auxiliary displays.
Added
BJoystick: device IDs and rumble
device/Joystick.hHaiku reference ↗
+ status_t GetDeviceIDs(uint16* outVendorID,
+ uint16* outProductID);
+ bool HasRumble();
+ bool HasTriggerRumble();
+ status_t SetRumble(uint16 strongMagnitude,
+ uint16 weakMagnitude, bigtime_t duration,
+ uint16 leftTriggerMagnitude = 0,
+ uint16 rightTriggerMagnitude = 0);
GetDeviceIDs() returns the USB or Bluetooth vendor and product IDs, for controller mapping databases (0 where the transport has none). SetRumble() drives the force-feedback motors: magnitudes run from 0 to 65535, strong is the low-frequency (left) motor and weak the high-frequency (right) one, and the trigger motors exist where HasTriggerRumble() says so. A call replaces the running effect; a duration of 0 stops it, and B_INFINITE_TIMEOUT keeps it running until the next call or Close(). Xbox One/Series pads over USB and Bluetooth LE game pads now also appear as BJoystick devices.
Design notes: GAMEPADS.md ↗38afc262ec a6a840afa1
Added
BUSBEndpoint: isochronous streams
device/USBKit.hHaiku reference ↗
+ struct usb_stream_packet_header {
+ uint16 length;
+ uint16 flags; // B_USB_STREAM_PACKET_ERROR, B_USB_STREAM_PACKET_GAP
+ };
class BUSBEndpoint {
+ status_t StartIsochronousStream(size_t packetSize,
+ uint32 packetsPerTransfer = 32,
+ uint32 transferCount = 4,
+ size_t bufferSize = 0) const;
+ ssize_t ReadIsochronousStream(void* data, size_t length,
+ bigtime_t timeout) const;
+ status_t StopIsochronousStream() const;
One IsochronousTransfer() at a time loses whatever the device sends between calls. A stream keeps transferCount transfers queued in the system and buffers up to bufferSize bytes. ReadIsochronousStream() returns packets back to back, each as a usb_stream_packet_header followed by its data (empty packets are left out); B_USB_STREAM_PACKET_GAP marks lost packets. There is one stream per device. The UVC webcam driver is built on this.
0af4c0889e
Added
BAuxDisplay
device/AuxDisplay.h, drivers/auxdisplay.h
+ class BAuxDisplay {
+ public:
+ static int32 CountDisplays();
+ status_t SetTo(int32 index = 0);
+ int32 Width() const;
+ int32 Height() const;
+ bool HasTouch() const;
+ status_t SetBacklight(float brightness);
+ BBitmap* Bitmap(); // B_RGB32, accepts views
+ status_t Present();
+ status_t Present(const BBitmap* bitmap);
+ status_t WaitForTouch(aux_display_touch_event* events,
+ int32* _count, bigtime_t timeout);
+ ...
+ };
A small screen beside the desktop that a program draws on itself, such as a Raspberry Pi's DSI panel or a USB LCD. It is not part of app_server's desktop: one program at a time draws into Bitmap() (views can be attached to it) and calls Present(). Drivers publish these displays under /dev/auxdisplay with the interface in drivers/auxdisplay.h, which also carries touch events.
df829acd3f
Network Kit
libbnetapi.soLink speed, a Wi-Fi password parameter, a service order for the default route, and .local names.
Added
BNetworkInterface::LinkSpeed()
net/NetworkInterface.hHaiku reference ↗
uint32 Metric() const;
+ uint64 LinkSpeed() const;
+ // in bit/s, 0 if unknown
The speed the driver reports (SIOCGIFLINKSPEED). For Wi-Fi it is the last transmit rate.
02bbad282c
Added
BNetworkRoster::AddPersistentNetwork() with a password
net/NetworkRoster.hHaiku reference ↗
status_t AddPersistentNetwork(
const wireless_network& network);
+ status_t AddPersistentNetwork(
+ const wireless_network& network,
+ const char* password);
Saves a Wi-Fi network together with its password, so it joins automatically later. The networks file is now written with mode 0600, because it holds passwords.
4ba582512b
Behaviour
Service order and the default route
network stack, net_server
The default route is chosen at each lookup: an interface with a link first, then the lowest metric, then the faster link. Haiku uses the order in which routes were added. Wired interfaces default to metric 1000 and wireless ones to 2000, so Ethernet is preferred over Wi-Fi. The user can reorder services in Network preferences; that sends net_server kMsgSetServiceOrder (private, net/NetServer.h). A DHCP lease is kept when the link drops briefly.
02bbad282c 8718cc50b1
Behaviour
.local names and HTTPS on ARM64
getaddrinfo(), BSecureSocketHaiku reference ↗
getaddrinfo() resolves .local names over multicast DNS. An app can publish a name with mdns_server (MDNS_REGISTER_NAME, private net/mdns_server.h), as Summit does for WebRTC. BSecureSocket finds Haiku's CA bundle even when OpenSSL was built without its path, as on ARM64.
Design notes: MDNS.md ↗f38e5d8fc9 542a103674
Private
Location service
private/net/location_server.h
location_server answers LOCATION_GET_POSITION with latitude, longitude, accuracy, source and time, or B_NOT_ALLOWED when the user has location switched off. Intended for Summit's geolocation.
Design notes: LOCATION.md ↗5a5d610564
Bluetooth Kit
libbluetooth.soBluetooth Low Energy, Secure Simple Pairing events, link policy and A2DP audio. The Haiku Book does not document the Bluetooth Kit; Haiku's headers are the reference.
Added
LE commands and events
bluetooth/HCI/btHCI_command.h, btHCI_event.h, btHCI_acl.h
+ #define OGF_LE_CONTROL 0x08
+ #define OCF_LE_SET_EVENT_MASK 0x0001
+ #define OCF_LE_READ_BUFFER_SIZE 0x0002
+ #define OCF_LE_SET_SCAN_PARAMETERS 0x000b
+ #define OCF_LE_SET_SCAN_ENABLE 0x000c
+ #define OCF_LE_CREATE_CONN 0x000d
+ #define OCF_LE_CREATE_CONN_CANCEL 0x000e
+ #define OCF_LE_START_ENCRYPTION 0x0019
+ struct hci_cp_le_create_conn { ... };
+ struct hci_cp_le_start_encryption { ... };
+ #define HCI_EVENT_LE_META 0x3E
+ struct hci_ev_le_conn_complete { ... };
+ #define HCI_ACL_PACKET_START_NON_FLUSHABLE 0x0
The HCI definitions an LE host needs: scanning, connecting, encryption, the LE meta event and connection-complete subevent, and the non-flushable start flag LE links use.
4ba582512b
Added
Pairing, page scan and link policy
bluetooth/HCI/btHCI_command.h, btHCI_event.h
+ #define OCF_SET_EVENT_MASK 0x0001
+ #define OCF_WRITE_PAGE_SCAN_TYPE 0x0047
+ #define OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056
+ #define OCF_WRITE_LE_HOST_SUPPORTED 0x006d
+ #define OCF_WRITE_SC_HOST_SUPPORT 0x007a
+ #define OCF_WRITE_PAGE_SCAN_ACTIVITY 0x001C
+ #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F
+ #define HCI_EVENT_USER_PASSKEY_NOTIFICATION 0x3B
+ struct hci_ev_keypress_notification { ... };
Secure Simple Pairing with passkey entry (for keyboards), interlaced page scan every 320 ms so sleeping keyboards reconnect quickly, and default link policy (role switch, hold, sniff).
0a9099e9f9 2de146d688
Added
L2CAP on LE links and channel MTUs
bluetooth/L2CAP/btL2CAP.h
+ /* Use these values in l2cap_psm when connecting to an LE fixed channel. */
+ #define B_L2CAP_LE_ATT_CID 0x0004
+ #define B_L2CAP_LE_SMP_CID 0x0006
+ /* getsockopt() options at level BLUETOOTH_PROTO_L2CAP, each a uint16, valid
+ once the channel is connected. */
+ #define B_L2CAP_OUTGOING_MTU 1 /* largest packet the peer accepts */
+ #define B_L2CAP_INCOMING_MTU 2 /* largest packet we accept */
An L2CAP socket can connect to an LE device's ATT or SMP fixed channel by putting the channel ID in l2cap_psm. getsockopt() reports the negotiated MTUs. The HCI transport now fragments ACL data at the controller's packet size (bluetooth_device::mtu, leMtu).
4ba582512b 950f9a7363 1fa2d28f58
Private
LE, HID-over-GATT and A2DP libraries
private/bluetooth/LE*.h, A2dpSource.h, SbcEncoder.h
libbluetooth carries a private LE stack (pairing sessions with legacy pairing, bond store, ATT client, HID-over-GATT service and mouse decoder) and an A2DP source with an SBC encoder. They are used by the LE mouse input add-on, the bluetooth_audio media add-on and Bluetooth preferences. RemoteDevice::GetFriendlyName() now returns the address rather than "Not Valid name" when no name is known, and connecting no longer waits for a remote-name request.
6c07be3b2b da57aae976 8225f603e6
Tracker Kit and Quick Look
libtracker.so, libquicklook.soA public add-on API for Quick Look previews, plus private protocols for network shares and the Deskbar.
Added
Quick Look preview add-ons
add-ons/quick_look/QuickLook.h
+ #define B_QUICK_LOOK_PREVIEW_CHANGED 'QLpc'
+ class BQuickLookPreview : public BView {
+ virtual BSize PreferredContentSize();
+ virtual BString Summary(); // "1920 × 1080 pixels"
+ virtual void Start();
+ virtual void Stop();
+ virtual void DirectConnected(direct_buffer_info* info);
+ protected:
+ void NotifyChanged();
+ };
+ class BQuickLookAddOn {
+ virtual float Supports(const entry_ref& ref,
+ const char* mimeType) = 0; // 0 .. 1
+ virtual BQuickLookPreview* CreatePreview(const entry_ref& ref,
+ const char* mimeType, BString* error) = 0;
+ };
+ extern "C" BQuickLookAddOn* instantiate_quick_look_add_on(image_id image);
Pressing the space bar in Tracker previews the selected file in a panel hosted by quick_look_server. Add-ons in add-ons/quick_look bid on a file with Supports() (0 to 1, cheap: it is asked for every file shown); the highest bidder makes a BQuickLookPreview view. The panel is a BDirectWindow, so previews that play video can draw into the frame buffer. Apps that own playback code ship their own add-on, so there is one media stack. Link with -lquicklook.
Design notes: QUICK-LOOK.md ↗584588df96
Private
Network shares, places and per-monitor backgrounds
private/mount/MountServer.h, private/tracker/tracker_private.h
mount_server keeps SMB network shares and mounts them at startup; Tracker's settings and Mount menu talk to it with kGetNetworkShares, kSetNetworkShare, kMountNetworkShare and related messages. Deskbar asks Tracker to open Home, the boot volume and Trash on the main display (kTrackerOpenOnMainDisplay). The desktop background is drawn whole on each monitor.
1d8ed8c294 250d12cdb0 a0339c46ce
Graphics drivers (accelerants)
add-ons/accelerantsOptional hooks for several monitors on one device, per-monitor blanks, device-side copies to the screen, and resume.
Added
Display outputs
add-ons/graphics/Accelerant.h
+ B_GET_DISPLAY_OUTPUT_COUNT = 0x600,
+ B_GET_DISPLAY_OUTPUTS,
+ B_GET_DISPLAY_OUTPUT_MODES,
+ B_SET_DISPLAY_LAYOUT,
+ B_SET_DISPLAY_CHANGE_PORT,
+ B_GET_DISPLAY_OUTPUT_RETRACE_SEMAPHORE,
+ B_GET_DISPLAY_OUTPUT_SCAN_LINE,
+ typedef struct {
+ uint32 id; // the connector, stable
+ char name[32]; // "DP-2"
+ uint32 flags; // CONNECTED, ENABLED, SCALABLE, INTERNAL, MIRROR
+ int32 x, y; // its region of the frame buffer
+ uint16 width, height;
+ uint16 scale; // percent
+ uint16 render_scale; // frame buffer pixels per logical pixel, percent
+ display_timing native_timing, timing;
+ uint32 edid_length;
+ uint8 edid[512];
+ } display_output;
A device that drives several monitors describes each as a region of one frame buffer, with its own timing, scale and EDID. B_SET_DISPLAY_LAYOUT arranges and enables them (outputs left out are disabled) and returns the mode for the whole frame buffer, which takes effect with B_SET_DISPLAY_MODE. Connect and disconnect events go to the port given with B_SET_DISPLAY_CHANGE_PORT. Each output has its own retrace semaphore and scan-line position, which app_server uses for tear-free flushing per monitor. A device without these hooks drives one monitor, as in Haiku. Used by the nvidia_rm, amdgpu and ARM display drivers.
a9772093c9 6744dd2d24 2d6665ab1c a5ff69d2dc
Added
Frame buffer sources and shadows
add-ons/graphics/Accelerant.h
+ B_CREATE_FRAME_BUFFER_SOURCE = 0x700,
+ B_DELETE_FRAME_BUFFER_SOURCE,
+ B_COPY_TO_FRAME_BUFFER,
+ B_CREATE_FRAME_BUFFER_SHADOW,
+ B_COPY_FRAME_BUFFER_SOURCE,
+ typedef struct {
+ uint32 id;
+ void* bits; // in the caller's address space
+ uint32 bytes_per_row;
+ uint16 width, height;
+ color_space space;
+ } frame_buffer_source;
A source is memory the device can read: app_server draws into it and has the device copy rectangles to the same place on screen, so the CPU never touches the frame buffer. A shadow is a source only the device reaches, normally in video memory, filled from a source and copied to the screen, so what was drawn is not copied twice by the CPU. Any error means the caller copies itself.
c8dce0f6e5 9a8002b931
Added
B_WAIT_FOR_DISPLAY_RESTORE
add-ons/graphics/Accelerant.h
+ typedef status_t (*wait_for_display_restore)(bigtime_t timeout);
+ /* Returns B_OK when the accelerant restored the display state after it
+ was lost (e.g. when resuming from suspend) and the screen contents need
+ to be redrawn, B_TIMED_OUT when nothing happened within timeout. */
Lets app_server redraw the screen after a resume from suspend.
44ed654981
Device drivers
kernel modulesPower management for suspend, more PCI host topologies, USB device speed and keep-awake, and USB Audio 2.0 descriptors.
Added
PCI: suspend and resume a function
drivers/bus/PCI.h, drivers/PCI.h
typedef struct pci_device_module_info {
+ status_t (*suspend_device)(pci_device* device, uint8 state);
+ status_t (*resume_device)(pci_device* device);
} pci_device_module_info;
+ #define PCI_pm_status_pme_enable 0x0100
+ #define PCI_pm_status_pme_status 0x8000
suspend_device() saves the configuration space and puts the function into D3hot; resume_device() returns it to D0 and restores BARs, MSI and MSI-X, which a function without No_Soft_Reset loses. For drivers that power their device down while the system sleeps.
80c3618630 44ed654981
Added
PCI host topologies
drivers/bus/PCI.h, drivers/bus/PCIInterrupts.h
+ #define B_PCI_MSI_CONTROLLER_ADDRESS "pci/msi/controller_address"
+ #define B_PCI_MSI_REQUESTER_BASE "pci/msi/requester_base"
+ #define B_PCI_MSI_REQUESTER_COUNT "pci/msi/requester_count"
typedef struct pci_controller_module_info {
+ status_t (*get_root_bus)(void* cookie, uint32 index, uint8* bus);
} pci_controller_module_info;
+ #define B_PCI_INTX_MODULE_NAME "bus_managers/pci/intx/v1"
+ typedef struct pci_intx_module_info { ... } pci_intx_module_info;
get_root_bus() lets a controller report several host bridges in one segment (multi-die processors). The MSI requester attributes describe a simple requester-ID translation on ARM64 hosts with an ITS. PCIInterrupts.h adds a module for wide legacy INTx routing.
ff086be678 3ce6f6c457 c5ade157f0
Added
USB: device speed and keep-awake
drivers/USB3.h
+ #define B_USB_KEEP_AWAKE 'kpaw'
+ typedef struct usb_keep_awake_args {
+ usb_device device;
+ bool keep_awake;
+ } usb_keep_awake_args;
+ #define B_USB_GET_DEVICE_SPEED 'gspd'
+ enum { B_USB_DEVICE_SPEED_LOW = 0, ..._FULL, ..._HIGH, ..._SUPER, ..._SUPER_PLUS };
usb_ioctl() opcodes. B_USB_KEEP_AWAKE keeps a device's link up during suspend to idle (a network adapter keeping its link for wake-on-LAN). B_USB_GET_DEVICE_SPEED tells a driver whether isochronous intervals count 125 µs microframes or 1 ms frames.
4091cd6d62 ef85ddfc55
Added
USB Audio 2.0
drivers/usb/USB_audio.h
enum { // Audio Interface Protocol Codes
USB_AUDIO_PROTOCOL_UNDEFINED = 0x00,
+ USB_AUDIO_PROTOCOL_IP_VERSION_02_00 = 0x20 // R2
};
+ typedef struct { ... } usb_audio_streaming_endpoint_descriptor_r2;
+ enum { USB_AUDIO_V2_CUR = 0x01, USB_AUDIO_V2_RANGE, USB_AUDIO_V2_MEM };
+ enum { USB_AUDIO_CS_SAM_FREQ_CONTROL = 0x01, USB_AUDIO_CS_CLOCK_VALID_CONTROL };
+ enum { USB_AUDIO_FORMAT_V2_PCM = 1 << 0, ... };
The descriptors, request codes, clock controls and format bits of USB Audio Class 2.0, used by the usb_audio driver for UAC2 DACs.
ef85ddfc55
Added
ACPI: leaving a sleep state
drivers/ACPI.h
struct acpi_module_info {
+ /* Leaving a sleep state: called with interrupts disabled and
+ \a prepare set first, then again with interrupts enabled. */
+ status_t (*leave_sleep_state)(uint8 state, bool prepare);
};
The counterpart of entering a sleep state, used by suspend to RAM on x86-64.
3ccc672604