mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-26 14:41:23 +00:00
Mark up paths in documentation as code
Link: https://github.com/rust-vmm/vhost-device/pull/880#pullrequestreview-3250960631 Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
parent
b81929e43c
commit
c522d09759
@ -37,7 +37,7 @@ struct VideoArgs {
|
||||
#[clap(short, long)]
|
||||
socket_path: PathBuf,
|
||||
|
||||
/// Path to the video device file. Defaults to /dev/video0.
|
||||
/// Path to the video device file. Defaults to `/dev/video0`.
|
||||
#[clap(short = 'd', long, default_value = "/dev/video0")]
|
||||
v4l2_device: PathBuf,
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ pub(crate) struct VuVideoBackend {
|
||||
}
|
||||
|
||||
impl VuVideoBackend {
|
||||
/// Create a new virtio video device for /dev/video<num>.
|
||||
/// Create a new virtio video device for `/dev/video<num>`.
|
||||
pub fn new(video_path: &Path, video_backend: BackendType) -> Result<Self> {
|
||||
let backend = Arc::new(RwLock::new(video_backends::alloc_video_backend(
|
||||
video_backend,
|
||||
|
||||
@ -90,7 +90,7 @@ const I2C_FUNC_SMBUS_ALL: u64 =
|
||||
/// I2C protocol definitions
|
||||
pub(crate) const I2C_M_RD: u16 = 0x0001; // read data, from slave to master
|
||||
|
||||
/// Copied (partially) from Linux's include/uapi/linux/i2c.h
|
||||
/// Copied (partially) from Linux's `include/uapi/linux/i2c.h`
|
||||
///
|
||||
/// I2cMsg - an I2C transaction segment beginning with START
|
||||
///
|
||||
@ -185,7 +185,7 @@ pub(crate) struct SmbusMsg {
|
||||
}
|
||||
|
||||
impl SmbusMsg {
|
||||
/// Based on Linux's drivers/i2c/i2c-core-smbus.c:i2c_smbus_xfer_emulated().
|
||||
/// Based on Linux's `drivers/i2c/i2c-core-smbus.c:i2c_smbus_xfer_emulated()`.
|
||||
///
|
||||
/// These smbus related functions try to reverse what Linux does, only
|
||||
/// support basic modes (up to word transfer).
|
||||
|
||||
@ -95,7 +95,7 @@ pub(crate) struct VuRngBackend<T: ReadVolatile> {
|
||||
}
|
||||
|
||||
impl<T: ReadVolatile> VuRngBackend<T> {
|
||||
/// Create a new virtio rng device that gets random data from /dev/urandom.
|
||||
/// Create a new virtio rng device that gets random data from `/dev/urandom`.
|
||||
pub fn new(
|
||||
rng_source: Arc<Mutex<T>>,
|
||||
period_ms: u128,
|
||||
|
||||
@ -239,7 +239,7 @@ pub struct Sensor {
|
||||
notify_enabled: bool,
|
||||
/// If this sensor supports notifying the frontend actively, it should
|
||||
/// record notification device file here. (e.g. For iio device, the file
|
||||
/// is /dev/iio:deviceX)
|
||||
/// is `/dev/iio:deviceX`)
|
||||
pub notify_dev: Option<File>,
|
||||
|
||||
/// Sensor id, to identify the sensor in notification lookup.
|
||||
|
||||
@ -190,7 +190,7 @@ impl ChanScanType {
|
||||
/// The channel scan type follows the rule
|
||||
/// If repeat > 1, "%s:%c%d/%dX%d>>%u\n"
|
||||
/// Else, "%s:%c%d/%d>>%u\n".
|
||||
/// For more details, see kernel "drivers/iio/industrialio-buffer.c"
|
||||
/// For more details, see kernel `drivers/iio/industrialio-buffer.c`
|
||||
fn new(value: String) -> Option<ChanScanType> {
|
||||
let error_message = "Error format from iio device!";
|
||||
let endianness = match &value[0..2] {
|
||||
@ -260,7 +260,7 @@ struct Axis {
|
||||
/// `Bit[8]` of axis_attributes_low is set to 1.
|
||||
custom_resolution: u64,
|
||||
/// Channel scan type, necessary if the sensor supports notifications.
|
||||
/// The data from /dev/iio:deviceX will be formatted according to this.
|
||||
/// The data from `/dev/iio:deviceX` will be formatted according to this.
|
||||
/// The ChanScanType is parsed from "scan_elements/\<channel>_type"
|
||||
scan_type: Option<ChanScanType>,
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ pub struct SpiIocTransfer {
|
||||
}
|
||||
|
||||
/// Linux SPI definitions
|
||||
/// IOCTL commands, refer Linux's Documentation/spi/spidev.rst for further
|
||||
/// IOCTL commands, refer Linux's `Documentation/spi/spidev.rst` for further
|
||||
/// details.
|
||||
const _IOC_SIZEBITS: u32 = 14;
|
||||
const _IOC_SIZESHIFT: u32 = 16;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user