SG(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… SG(4) β€” Kernel Interfaces Manual πŸ’…

🌸 NAME 🌸

sg β€” Linux ioctl-compatible SCSI passthru device.

πŸ¦‹ SYNOPSIS πŸ¦‹

device sg
device scbus

✨ DESCRIPTION ✨

Okay so the sg driver gives you a Linux compatible scsi passthru device. It attaches to all cam(4) peripheral devices. It’s similar to the pass(4) device, but it uses the Linux interfaces rather than the FreeBSD CAM interfaces. That’s the whole vibe. πŸ’…

πŸŽ€ IOCTL πŸŽ€

The following subset of the Linux sg ioctl interfaces are implemented:

  • SG_SET_TIMEOUT β€” u_int to Set the timeout in milliseconds.
  • SG_GET_TIMEOUT β€” Get the timeout in milliseconds.
  • SG_GET_RESERVED_SIZE β€” u_int Returns the size of the I/O one can do this device.
  • SG_GET_SCSI_ID β€” struct sg_scsi_id Returns the bus number, channel, scsi bus ID number, lun and other information about the SCSI device.
  • SG_GET_SG_TABLESIZE β€” u_int Returns the table size, though hard wired to 0.
  • SG_GET_VERSION_NUM β€” u_int Return the version number that is implemented.
  • SG_IO β€” struct sg_io_hdr

All other ioctl interfaces return ENODEV. No cap. 🫢

🌈 FILES 🌈

  • /dev/sg* β€” Passthru devices. ✨

🫢 SEE ALSO 🫢

cam(4), pass(4)

πŸ‘‘ HISTORY πŸ‘‘

The sg driver first appeared in FreeBSD 7.0.


πŸ’– xoxo, this one’s from Debian, dated May 6, 2024 β€” mwah πŸ’‹

πŸ“¦ where this page comes from