SES(4)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… SES(4) β€” the SCSI Environmental Services driver, but make it iconic ✨

okay so bestie, welcome to ses(4) β€” yes that's the manual page name and yes we're gonna get into it. this is the kernel interfaces manual vibe, and it's literally all about the SCSI Environmental Services driver. no cap, it's giving "your enclosure has feelings and we're checking on them" 🫢


🌸 NAME 🌸

ses β€” the SCSI Environmental Services driver, periodt πŸ’–

✨ SYNOPSIS ✨

device ses

that's it. that's the line. slay.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the ses driver provides support for all SCSI devices of the environmental services class that are attached to the system through a supported SCSI Host Adapter, and it also gives you emulated support for SAF-TE β€” aka SCSI Accessible Fault Tolerant Enclosures, iykyk πŸ’…

the environmental services class is generally enclosure devices that provide environmental information like the number of power supplies (and their state), temperature, device slots, and so on. literally the enclosure's whole personality πŸŽ€

bestie, important: a SCSI Host Adapter must also be separately configured into the system before a SCSI Environmental Services device can be configured. no host adapter, no ses device. that's the rule πŸ’€

🌈 KERNEL CONFIGURATION 🌈

so here's the tea: it's only necessary to explicitly configure one ses device β€” data structures are dynamically allocated as devices are found on the SCSI bus. the kernel handles the rest, main character energy fr fr πŸ‘‘

a separate option, SES_ENABLE_PASSTHROUGH, may be specified to allow the ses driver to perform functions on devices of other classes that claim to also support ses functionality. yes, it's that girl πŸ’–

πŸ”₯ IOCTLS πŸ”₯

the following ioctl(2) calls apply to ses devices. they are defined in the header file <cam/scsi/scsi_enc.h> (q.v.). let's go through them one by one because we don't skip ✨

  • ENCIOC_GETNELM β€” used to find out how many ses elements are driven by this particular device instance.
  • ENCIOC_GETELMMAP β€” read, from the kernel, an array of SES elements which contains the element identifier, which subenclosure it is in, and the ses type of the element.
  • ENCIOC_GETENCSTAT β€” get the overall enclosure status.
  • ENCIOC_SETENCSTAT β€” set the overall enclosure status.
  • ENCIOC_GETELMSTAT β€” get the status of a particular element.
  • ENCIOC_SETELMSTAT β€” set the status of a particular element.
  • ENCIOC_GETTEXT β€” get the associated help text for an element (not yet implemented). ses devices often have descriptive text for an element which can tell you things like location (e.g., "left power supply").
  • ENCIOC_INIT β€” initialize the enclosure.
  • ENCIOC_GETELMDESC β€” get the element's descriptor string.
  • ENCIOC_GETELMDEVNAMES β€” get the device names, if any, associated with this element.
  • ENCIOC_GETSTRING β€” used to read the SES String In Diagnostic Page. the contents of this page are device-specific.
  • ENCIOC_SETSTRING β€” used to set the SES String Out Diagnostic Page. the contents of this page are device-specific.
  • ENCIOC_GETENCNAME β€” used to get the name of the enclosure.
  • ENCIOC_GETENCID β€” used to get the Enclosure Logical Identifier.

like, that's the whole list. every single one. we ate and left no crumbs πŸ“

🧚 EXAMPLE USAGE 🧚

the files contained in /usr/share/examples/ses show simple mechanisms for how to use these interfaces, as well as a very stupid simple monitoring daemon. literally go look at them, they're so helpful, I'm obsessed πŸ˜­πŸ’–

πŸŽ€ FILES πŸŽ€

  • /dev/sesN β€” the *N*th SES device.

πŸ’œ DIAGNOSTICS πŸ’œ

when the kernel is configured with DEBUG enabled, the first open to an SES device will spit out overall enclosure parameters to the console. it's giving "hello world but make it hardware" ngl πŸ‘‘

🌟 SEE ALSO 🌟

πŸ‘‘ HISTORY πŸ‘‘

the ses driver was originally written for the CAM SCSI subsystem by Matthew Jacob and first released in FreeBSD 4.3. it was a functional equivalent of a similar driver available in Solaris, Release 7. it was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for FreeBSD 9.2. historians could never πŸ’…βœ¨


and that's the whole page, bestie β€” Debian, November 12, 2019, signing off like the icon it is πŸ«ΆπŸ’–

πŸ“¦ where this page comes from