SES(4)
๐ธ SES(4) โ the SCSI Environmental Services driver, bestie edition ๐ธ
okay so welcome to the Kernel Interfaces Manual, and today's main character is ses โ the SCSI Environmental Services driver. she's the one who tells you if your enclosure is thriving or literally overheating. let's get into it ๐
โจ NAME โจ
ses โ the SCSI Environmental Services driver. that's it, that's the name, and she ate.
๐ SYNOPSIS ๐
device ses
one line. one vibe. that's how you invite her to the kernel party.
๐ DESCRIPTION ๐
so here's the tea: 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 yes, she also does emulated support for SAF-TE (SCSI Accessible Fault Tolerant Enclosures) ๐ฆ
and what even is the environmental services class, you ask? bestie, they're generally enclosure devices that serve up environmental info like:
- how many power supplies you have (and their state) ๐
- temperature ๐ก๏ธ
- device slots ๐ฐ
- and so on, and so on โจ
โ ๏ธ heads up: a SCSI Host adapter has to be separately configured into the system before a SCSI Environmental Services device can be configured. no host adapter, no ses, periodt.
๐ง KERNEL CONFIGURATION ๐ง
the way that you only need to explicitly configure one ses device โ data structures are dynamically allocated as devices are found on the SCSI bus. so don't be out here listing forty of them, she scales herself ๐
there's also a separate option, SES_ENABLE_PASSTHROUGH, which may be specified to allow the ses driver to perform functions on devices of other classes that claim to also support ses functionality. lowkey generous of her honestly ๐ซถ
๐ฅ IOCTLS ๐ฅ
these ioctl(2) calls apply to ses devices, and they're all defined in the header file <cam/scsi/scsi_enc.h> (q.v. โ go read it, iykyk).
ENCIOC_GETNELMโ used to find out how manyseselements are driven by this particular device instance. how many little guys are we managing? this tells you ๐งฎENCIOC_GETELMMAPโ read, from the kernel, an array of SES elements which contains the element identifier, which subenclosure it is in, and thesestype of the element. it's giving full roster, with receipts ๐ENCIOC_GETENCSTATโ get the overall enclosure status. the vibe check, but for your whole enclosure โจENCIOC_SETENCSTATโ set the overall enclosure status. you get to decide the vibe now ๐ENCIOC_GETELMSTATโ get the status of a particular element. one specific little guy's whole situation ๐ENCIOC_SETELMSTATโ set the status of a particular element. now you're the one writing his story ๐ENCIOC_GETTEXTโ get the associated help text for an element (not yet implemented ๐).sesdevices often have descriptive text for an element which can tell you things like location (e.g.,"left power supply"). imagine the lore we could have. someday, bestie.ENCIOC_INITโ initialize the enclosure. factory reset her wig ๐ซENCIOC_GETELMDESCโ get the element's descriptor string. her little name tag ๐ท๏ธENCIOC_GETELMDEVNAMESโ get the device names, if any, associated with this element. who is she actually attached to? ๐ฆENCIOC_GETSTRINGโ used to read the SES String In Diagnostic Page. the contents of this page are device-specific, so no two are the same, main character energy fr ๐ENCIOC_SETSTRINGโ used to set the SES String Out Diagnostic Page. the contents of this page are device-specific too. you're writing back to her โ๏ธENCIOC_GETENCNAMEโ used to get the name of the enclosure. what's her government name ๐ENCIOC_GETENCIDโ used to get the Enclosure Logical Identifier. her literal government ID ๐ชช
๐ EXAMPLE USAGE ๐
not me about to hand you free homework: 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. she said "simple" twice and meant it, and honestly? iconic ๐ญ
๐ FILES ๐
/dev/sesNโ the *N*th SES device. your girl, numbered ๐
๐ 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. she will overshare โ but only once, and only if you asked for it ๐ฃ๏ธ
๐ SEE ALSO ๐
sesutil(8)โ go say hi, she's the bestie ๐
๐ธ 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. then it was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for FreeBSD 9.2. a glow-up across two decades, we love to see it โจ
and that's the whole page, bestie. this one came to you from Debian, dated November 12, 2019 โ so if anyone asks where you learned all this, you can say a Debian manual from late 2019 told you, and honestly? slay. now go check your power supplies ๐ ๐ซถ
๐ฆ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 ยท BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2000 Matthew Jacob <mjacob@FreeBSD.org>. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms