]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r343728: Check element type before setting LEDs.
authormav <mav@FreeBSD.org>
Mon, 11 Feb 2019 14:49:10 +0000 (14:49 +0000)
committermav <mav@FreeBSD.org>
Mon, 11 Feb 2019 14:49:10 +0000 (14:49 +0000)
commit9c0e357f31c23db6de044c065135d6d7574b9ede
tree41948dda5995ba80f047b8f24507ec2eb1378b10
parent75ca22921a43b25b19c9c94e55e1d86589e6d84d
MFC r343728: Check element type before setting LEDs.

With r319610, sesutil started twiddling the bits of every SES device.
Not everything is a disk slot, there are also fan controllers, temperature
sensors, even power supplies, among other things controlled by SES.

Add a type check to make sure we are only operating on device slot and array
device slot elements.  Other type elements will be skipped, but it would be
simple to add additional cases for controlling the ident LEDs of other
element types (which are not necessarily the same bits).

Rather than doing raw bit manipulation of an unstructured byte array using
unnamed numeric constants, leverage existing code abstractions.

Submitted by:   Ryan Moeller <ryan@freqlabs.com>
Sponsored by:   iXsystems, Inc.
usr.sbin/sesutil/sesutil.c