Add IsoPacketDescriptor, UrbRequest, and UrbResponse types to the protocol layer. Rewrite handle_urb_loop to a concurrent architecture with pipelining for improved throughput. Replace interfaces vec with InterfaceState to track alternate settings. Implement isochronous transfer support in the nusb host handler with structured ISO packet descriptor parsing and serialization. Switch to ISO-capable nusb fork. Add IsoLoopbackHandler test fixture and ISO transfer tests. Fix host device passthrough: detach kernel drivers before claiming interfaces, use real EP0 max packet size, forward SET_CONFIGURATION to device, map nusb Speed enum to Linux kernel values, and use extend_from_slice for OUT transfer buffers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
description = "USB/IP server library and CLI tool";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
rustc
|
|
cargo
|
|
rustfmt
|
|
clippy
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
libusb1
|
|
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
|
udev
|
|
];
|
|
|
|
usbip-rs = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "usbip-rs";
|
|
version = "0.8.0";
|
|
|
|
src = self;
|
|
|
|
cargoHash = "sha256-xEyWh+bP7F+a0KpH24hVliC1JQMRIW0wfmUB3rFNvyk=";
|
|
|
|
inherit nativeBuildInputs buildInputs;
|
|
|
|
buildFeatures = [ "usbip-rs/serde" ];
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "USB/IP server library and CLI tool";
|
|
homepage = "https://github.com/jiegec/usbip";
|
|
license = licenses.mit;
|
|
mainProgram = "usbip-rs";
|
|
};
|
|
};
|
|
in
|
|
{
|
|
packages = {
|
|
default = usbip-rs;
|
|
inherit usbip-rs;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit nativeBuildInputs buildInputs;
|
|
};
|
|
});
|
|
}
|