IPMI(4)

πŸ’– IPMI(4) β€” the Kernel Interfaces Manual page, but make it cute πŸ’–

okay bestie, so you know how the kernel has a bunch of manual pages? this is one of them, from the Kernel Interfaces Manual section, and it's all about ipmi. buckle up πŸŽ€


✨ NAME ✨

ipmi β€” the OpenIPMI compatible IPMI interface driver

like, that's the whole name section. short. iconic. we love a concise queen πŸ’…


🌸 SYNOPSIS 🌸

device ipmi

okay so if you wanna manually specify I/O attachment in /boot/device.hints:

hint.ipmi.0.at="isa"
hint.ipmi.0.port="0xCA2"
hint.ipmi.0.spacing="8"
hint.ipmi.0.mode="KCS"

and if you wanna manually specify memory attachment in /boot/device.hints:

hint.ipmi.0.at="isa"
hint.ipmi.0.maddr="0xf0000000"
hint.ipmi.0.spacing="8"
hint.ipmi.0.mode="SMIC"

meaning of spacing, bestie:

  • 8 β€” 8 bit alignment
  • 16 β€” 16 bit alignment
  • 32 β€” 32 bit alignment

and here's the tea β˜•: if the port and spacing aren't specified, the interface type default just gets used, no drama. and only specify either the port for I/O access or maddr for memory access. not both. pick a lane, babe 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the IPMI β€” that's the Intelligent Platform Management Interface, yes the acronym is a mouthful β€” is a standard for monitoring system hardware. it lets generic code detect and monitor the sensors in a system. it's giving hands-off observability ✨

the IPMI standard offers watchdog support, an FRU database, and other support extensions too. and rn it's being adopted by the makers of many single board and embedded system manufacturers. slay.

the ipmi driver in FreeBSD is heavily adopted from the standard and the Linux driver β€” however, not all features described in the standard are supported. so like, temper your expectations a lil 😭

here's the fun part: the ipmi driver implements the power cycling option to shutdown(8), so you can actually power cycle the system. but!! the motherboard's BMC must support the chassis device and the optional power cycle subcomand of the chassis control command, as described in section 28.3 of the IPMI standard. the length of time the system is off will be at least one second, but may be longer if the power cycle interval has been set (see section 28.9). so don't be surprised if it takes a sec, fr fr πŸ•


πŸ‘‘ IOCTLS πŸ‘‘

sending and receiving messages through the ipmi driver requires the use of ioctl(2). and why, you ask? because the data sent to and from the device is complex, bestie. it's giving "this needs its own syscall interface" πŸ’…

the ioctl(2) command codes below are defined in <sys/ipmi.h>. and heads up: the third argument to ioctl(2) should be a pointer to the type indicated. don't forget that part, okay?

currently the following ioctls are supported:

  • IPMICTL_RECEIVE_MSG (struct ipmi_recv) β€” receive a message. possible error values:
    • [EAGAIN] β€” no messages are in the process queue.
    • [EFAULT] β€” an address supplied was invalid.
    • [EMSGSIZE] β€” the address could not fit in the message buffer and will remain in the buffer.
  • IPMICTL_RECEIVE_MSG_TRUNC (struct ipmi_recv) β€” like IPMICTL_RECEIVE_MSG but if the message cannot fit into the buffer, it will truncate the contents instead of leaving the data in the buffer. it's giving "we tried, here's what fit" πŸ™ˆ
  • IPMICTL_SEND_COMMAND (struct ipmi_req) β€” send a message to the interface. possible error values:
    • [EFAULT] β€” an address supplied was invalid.
    • [ENOMEM] β€” buffers could not be allowed for the command, out of memory.
  • IPMICTL_SET_MY_ADDRESS_CMD (unsigned int) β€” set the slave address for source messages.
  • IPMICTL_GET_MY_ADDRESS_CMD (unsigned int) β€” get the slave address for source messages.
  • IPMICTL_SET_MY_LUN_CMD (unsigned int) β€” set the slave LUN for source messages.
  • IPMICTL_GET_MY_LUN_CMD (unsigned int) β€” get the slave LUN for source messages.

πŸ’€ Unimplemented Ioctls πŸ’€

these ones exist but... they're not doing the thing yet. it's giving aspirational 😭

  • IPMICTL_REGISTER_FOR_CMD (struct ipmi_cmdspec) β€” register to receive a specific command. possible error values:
    • [EFAULT] β€” an supplied address was invalid.
    • [EBUSY] β€” the network function/command is already in use.
    • [ENOMEM] β€” could not allocate memory.
  • IPMICTL_UNREGISTER_FOR_CMD (struct ipmi_cmdspec) β€” unregister to receive a specific command. possible error values:
    • [EFAULT] β€” an address supplied was invalid.
    • [ENOENT] β€” the network function/command was not found.

πŸŽ€ Stub Only Ioctl πŸŽ€

just one lonely little stub, bestie. it's doing its best 🫢

  • IPMICTL_SET_GETS_EVENTS_CMD (int) β€” set whether this interface receives events. possible error values:
    • [EFAULT] β€” an address supplied was invalid.

🌈 SEE ALSO 🌈

go read these next, iykyk:

ioctl(2), watchdog(4), reboot(8), shutdown(8), watchdog(8), watchdogd(8), watchdog(9)


⭐ HISTORY ⭐

the ipmi driver first appeared in FreeBSD 6.2. a whole era πŸ’œ


πŸ’– AUTHORS πŸ’–

the ipmi driver was written by Doug Ambrisko <ambrisko@FreeBSD.org>.

this manual page was written by Tom Rhodes <trhodes@FreeBSD.org>.

thank you for your service, legends πŸ‘‘


πŸ“ BUGS πŸ“

not all features of the MontaVista driver are supported. so like, if something's missing, that's why πŸ˜…

currently, IPMB and BT modes are not implemented. no cap. they're just not there yet.


okay that's the whole page bestie!! every flag, every ioctl, every error code, every section β€” nothing skipped, periodt πŸ’…βœ¨

and that's a wrap, my love 🫢 this page came to you from Debian, dated October 25, 2017 β€” so it's vintage, but the info still hits different. go forth and monitor those sensors, main character πŸŒΈπŸ’–πŸŽ€

πŸ“¦ where this page comes from