mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix sesutil fault operation.
Fault and ident bits are located in different control bytes, so previous code was just doing nothing, writing into reserved bit. MFC after: 1 week
This commit is contained in:
parent
cf825f93cc
commit
efab8bfdb3
1 changed files with 9 additions and 3 deletions
|
|
@ -118,10 +118,16 @@ do_led(int fd, unsigned int idx, bool onoff, bool setfault)
|
|||
err(EXIT_FAILURE, "ENCIOC_GETELMSTAT");
|
||||
}
|
||||
o.cstat[0] |= 0x80;
|
||||
if (onoff) {
|
||||
o.cstat[2] |= (setfault ? 0x20 : 0x02);
|
||||
if (setfault) {
|
||||
if (onoff)
|
||||
o.cstat[3] |= 0x20;
|
||||
else
|
||||
o.cstat[3] &= 0xdf;
|
||||
} else {
|
||||
o.cstat[2] &= (setfault ? 0xdf : 0xfd);
|
||||
if (onoff)
|
||||
o.cstat[2] |= 0x02;
|
||||
else
|
||||
o.cstat[2] &= 0xfd;
|
||||
}
|
||||
|
||||
if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &o) < 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue