SMP_READ_GPIO(8)
π SMP_READ_GPIO β bestie, we're reading GPIO registers π
okay so this is smp_read_gpio(8), one of the lil gems in the smp_utils collection. it pokes at your SAS expander's sideband vibes. let's go π¦
β¨ NAME β¨
smp_read_gpio β invoke the READ GPIO REGISTER (ENHANCED) SMP function. that's it, that's the whole job. π
β¨ SYNOPSIS β¨
smp_read_gpio [--count=CO] [--enhanced] [--help] [--hex] [--index=IN]
[--interface=PARAMS] [--raw] [--sa=SAS_ADDR] [--type=TY] [--verbose]
[--version] SMP_DEVICE[,N]
β¨ DESCRIPTION β¨
so what it does is: it sends a SAS Serial Management Protocol (SMP) READ GPIO REGISTER request β or the READ GPIO REGISTER ENHANCED one, your call β to an SMP target. π
who's the target? that's the SMP_DEVICE plus the SAS_ADDR. and depending on the interface, the SAS_ADDR may just be deduced from the SMP_DEVICE all by itself, no extra work. the mpt interface uses SMP_DEVICE to identify a HBA (an SMP initiator), and it needs the extra ,N to tell HBAs apart if you've got multiple hanging around. it's giving "who dis" energy π
this function is defined in SFF-8485 (see www.sffcommittee.com), alongside its partner-in-crime, the WRITE GPIO REGISTER SMP function. the rest of the SMP functions live in SAS documents over at www.t10.org. π§
and here's the lore: SFF-8485 defines a curious device called a "virtual SMP port" that lives inside a host bus adapter (HBA) and lets SMP manipulate the sideband signals on wide internal cables. so it can touch the wires. iconic behavior. β‘ but to stop other initiators in a multi-initiator domain from getting at those sideband signals, the virtual SMP (target) port is not indicated in a DISCOVER response. sneaky. lowkey invisible. π«₯
for notes on the READ GPIO REGISTER ENHANCED function, peep the ENHANCED FUNCTION section down below. β¬οΈ
β¨ OPTIONS β¨
fr fr: mandatory arguments to long options are mandatory for short options too. no shortcuts, bestie. π
-c,--count=COβ where CO is the register count. that's how many (4 byte) registers you're asking for. default is1. π-E,--enhancedβ sends aREAD GPIO REGISTER ENHANCEDfunction request. and if you don't use it? default is to send a plainREAD GPIO REGISTERfunction request. β¨-h,--helpβ outputs the usage message then dips. bye π-H,--hexβ outputs the response (less the CRC field) in hexadecimal. π-i,--index=INβ where IN is the register index. this value is origin zero and its default value is0. if the request succeeds, then--count=COregisters starting from--index=INof the given--type=TYshould be in the response. π-I,--interface=PARAMSβ interface specific parameters. and yes, "interface" here means the path through the operating system to the SMP initiator. see thesmp_utilsman page for more info. π¦-r,--rawβ sends the response (less the CRC field) tostdoutin binary. all error messages go tostderrinstead, so they don't get mixed into your raw bytes. π-s,--sa=SAS_ADDRβ specifies the SAS address of the SMP target device. typically this is an expander. this option may not be needed if theSMP_DEVICEalready has the target's SAS address inside it. heads up: the SAS_ADDR is in decimal, but most SAS addresses are shown in hexadecimal. so to give a number in hexadecimal, either prefix it with'0x'or put a trailing'h'on it. π (this trips everyone up, you're not alone)-t,--type=TYβ where TY is the register type. default value is0(GPIO_CFG). if the request succeeds, then--count=COregisters starting from--index=INof the given--type=TYshould be in the response. π-v,--verboseβ increases the verbosity of the output. can be used multiple times. stack it up π£οΈ-V,--versionβ prints the version string then exits. β
β¨ ENHANCED FUNCTION β¨
okay this section is the drama. πΏ
in the technical review of SAS-2 prior to standardization, in this t10 document: 08-212r8.pdf (page 871 or 552), there's a comment saying that the READ GPIO REGISTER and WRITE GPIO REGISTER function headers (i.e. the first 4 bytes) do not comply with all the other SMP functions in SAS-2. caught lacking. π
there's a suggestion that enhanced variants be introduced in the next version of the SFF-8485 document. and if that ever happened, it has not been made public. mystery. π΅οΈ in SAS-2.1, both the READ and WRITE GPIO REGISTER functions have been made obsolete, and the corresponding ENHANCED function numbers are "restricted" for SFF-8485.
π¨ so if you're reaching for--enhanced: if the--enhancedoption is given then the ENHANCED function number is sent. the register type, index and count fields (1 byte each) are increased by two byte positions, leaving enough space for a compliant SAS-2 SMP header to be built. that's the whole trick. π©
β¨ EXAMPLES β¨
see the "Examples" section in http://sg.danny.cz/sg/smp_utils.html β the docs live there, go look bestie π«Ά
β¨ CONFORMING TO β¨
the SMP READ GPIO REGISTER (ENHANCED) function is defined in SFF-8485 (see www.sffcommittee.com) together with its corresponding WRITE GPIO REGISTER (ENHANCED) SMP function. they're a package deal. π
β¨ AUTHORS β¨
written by Douglas Gilbert. π
β¨ REPORTING BUGS β¨
report bugs to <dgilbert at interlog dot com>. π¬
β¨ COPYRIGHT β¨
copyright Β© 2006-2011 Douglas Gilbert
this software is distributed under a FreeBSD license. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, it's free, but it's also free, yk? π
β¨ SEE ALSO β¨
smp_utilssmp_write_gpio(smp_utils)
and that's the whole page, bestie!! π this was smp_utils-0.97, dated August 2011, and you just read SMP_READ_GPIO(8). go read some GPIO registers, slay, periodt β¨ππ¦
π¦ where this page comes from
- debian bookworm: smp-utils 0.99-1 Β· BSD-3-Clause
- debian trixie: smp-utils 0.99-1 Β· BSD-3-Clause
- epel 10: smp_utils 0.99-1.el10_0 Β· BSD-3-Clause
- epel 9: smp_utils 0.99-5.el9 Β· BSD
- fedora 43: smp_utils 0.99-14.fc43 Β· BSD-3-Clause
- fedora 44: smp_utils 0.99-15.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: smp_utils 0.99-bp160.1.6 Β· BSD-3-Clause AND GPL-2.0-only
- opensuse-leap 16.0: smp_utils 0.99-bp160.1.6 Β· BSD-3-Clause AND GPL-2.0-only
- opensuse-leap 16.0: smp_utils 0.99-bp160.1.6 Β· BSD-3-Clause AND GPL-2.0-only
- opensuse-leap 16.0: smp_utils 0.99-bp160.1.6 Β· BSD-3-Clause AND GPL-2.0-only
- ubuntu jammy: smp-utils 0.99-1 Β· BSD-3-Clause
- ubuntu noble: smp-utils 0.99-1 Β· BSD-3-Clause
- ubuntu resolute: smp-utils 0.99-1build1 Β· BSD-3-Clause
- ubuntu stonking: smp-utils 0.99-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms