pub struct LegacyUsbManager {
metadata: DeviceMetadata,
platform: Platform,
}Expand description
USB mass storage manager for legacy platforms.
This implementation loads kernel modules to enable USB mass storage on
older Kobo devices. For each platform it first tries g_mass_storage.ko;
if that is absent it falls back to g_file_storage.ko with
platform-specific dependencies:
- mx6sll-ntx, mx6ull-ntx: loads configfs, libcomposite, usb_f_mass_storage deps
- mx6sl-ntx: no extra dependencies (arcotg_udc is built into the kernel)
- other platforms: loads arcotg_udc before g_file_storage
Fields§
§metadata: DeviceMetadata§platform: PlatformImplementations§
Source§impl LegacyUsbManager
impl LegacyUsbManager
Sourcepub fn new(metadata: DeviceMetadata, platform: Platform) -> Self
pub fn new(metadata: DeviceMetadata, platform: Platform) -> Self
Creates a new legacy USB manager.
Accepts the platform detected by the caller. No USB operations
are performed until enable is called.
fn drivers_path(&self) -> String
fn has_g_mass_storage(&self) -> bool
Sourcefn build_file_param(&self) -> String
fn build_file_param(&self) -> String
Builds the file= parameter value for insmod, including the SD card
partition when one is present (matching the original usb-enable.sh behavior).
fn build_mass_storage_params(&self) -> Vec<String>
fn build_file_storage_params(&self) -> Vec<String>
fn load_g_mass_storage(&self) -> Result<(), UsbError>
fn load_g_file_storage(&self) -> Result<(), UsbError>
fn load_usb_module(&self) -> Result<(), UsbError>
fn get_loaded_module(&self) -> Option<String>
fn unload_usb_modules(&self) -> Result<(), UsbError>
Trait Implementations§
Source§impl KoboUsbOperations for LegacyUsbManager
impl KoboUsbOperations for LegacyUsbManager
Source§fn metadata(&self) -> &DeviceMetadata
fn metadata(&self) -> &DeviceMetadata
Provides access to the device metadata. Read more
Source§fn sync_and_drop_caches(&self) -> Result<(), UsbError>
fn sync_and_drop_caches(&self) -> Result<(), UsbError>
Syncs filesystem buffers and drops caches. Read more
Source§fn is_mounted(&self, mount_point: &str) -> Result<bool, UsbError>
fn is_mounted(&self, mount_point: &str) -> Result<bool, UsbError>
Checks if a mount point is currently mounted. Read more
Source§fn unmount_partition(&self, mount_point: &str) -> Result<(), UsbError>
fn unmount_partition(&self, mount_point: &str) -> Result<(), UsbError>
Unmounts a partition lazily. Read more
Prepares the system for USB mass storage mode. Read more
Auto Trait Implementations§
impl Freeze for LegacyUsbManager
impl RefUnwindSafe for LegacyUsbManager
impl Send for LegacyUsbManager
impl Sync for LegacyUsbManager
impl Unpin for LegacyUsbManager
impl UnwindSafe for LegacyUsbManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more