reorg: normalise every protocol alias to its module name
Finish the direct-import convention: a protocol is now aliased to its module name in snake_case in every file that imports one — consumers and the runtime client wrappers alike. This kills the last of the alias variety (the generic `protocol`, plus `power` and `transfer`), so `device_manager_protocol.Hello` means the same thing everywhere and grepping a module name finds all its uses. Pure rename (identifier uses only; prose references left untouched via a guarded pattern). 14 files, 299/299 lines. zig build + test green; 16 QEMU cases pass (smoke, device-manager, driver-restart, device-list, pci-scan, usb-hid, usb-storage, display-service, display-native, display-reattach, input, acpi-ps2, vfs, fat-mount, power-button, orderly-shutdown).
This commit is contained in:
@@ -12,11 +12,11 @@
|
||||
const std = @import("std");
|
||||
const ipc = @import("ipc.zig");
|
||||
const system = @import("system.zig");
|
||||
const protocol = @import("device-manager-protocol");
|
||||
const device_manager_protocol = @import("device-manager-protocol");
|
||||
|
||||
/// What kind of driver is announcing itself (a bus that reports children, or a
|
||||
/// leaf device). Re-exported so callers name it without importing the protocol.
|
||||
pub const Role = protocol.Role;
|
||||
pub const Role = device_manager_protocol.Role;
|
||||
|
||||
/// Endpoint lookups while the manager is still registering, and the pause
|
||||
/// between them: 100 x 20 ms = ~2 s, comfortably inside the manager's 3 s hello
|
||||
@@ -42,14 +42,14 @@ pub fn hello(role: Role, device_id: u64) ?ipc.Handle {
|
||||
return null;
|
||||
};
|
||||
|
||||
const message = protocol.Hello{ .role = @intFromEnum(role), .device_id = device_id };
|
||||
var reply: [protocol.reply_size]u8 = undefined;
|
||||
const message = device_manager_protocol.Hello{ .role = @intFromEnum(role), .device_id = device_id };
|
||||
var reply: [device_manager_protocol.reply_size]u8 = undefined;
|
||||
const length = ipc.call(manager, std.mem.asBytes(&message), &reply) catch {
|
||||
std.log.info("hello call failed", .{});
|
||||
return null;
|
||||
};
|
||||
if (length < protocol.reply_size or
|
||||
std.mem.bytesToValue(protocol.HelloReply, reply[0..protocol.reply_size]).status != 0)
|
||||
if (length < device_manager_protocol.reply_size or
|
||||
std.mem.bytesToValue(device_manager_protocol.HelloReply, reply[0..device_manager_protocol.reply_size]).status != 0)
|
||||
{
|
||||
std.log.info("hello refused", .{});
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user