diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-10-27 03:28:28 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-10-27 03:28:28 +0000 |
commit | bc3ecb4049e9971894e9c4b2c9ab38239871e59b (patch) | |
tree | 5937856e6ce2755e4d48668c25fa266a52ef335e | |
parent | 182250ac5fc79dc8eb6be936e01935664167d928 (diff) |
the arc fimware can be configured with a password that is used to
restrict changes to its configuration. in our case we want to be
able to disable or enable the alarm. if a password is set though,
the firmware will reject that request with a PASSWORD_REQUIRED
response code. this change lets the kernel return EPERM instead of
EIO in that case.
if you dont have a password set on the firmware you can configure
the alarm just fine.
makes sense claudio@
-rw-r--r-- | sys/dev/pci/arc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index b80ff58b9aa..5a18e3d970a 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.67 2007/10/22 09:58:05 dlg Exp $ */ +/* $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -221,6 +221,7 @@ struct arc_fw_bufhdr { #define ARC_FW_NOP 0x38 /* opcode only */ #define ARC_FW_CMD_OK 0x41 +#define ARC_FW_CMD_PASS_REQD 0x4d struct arc_fw_comminfo { u_int8_t baud_rate; @@ -1043,10 +1044,14 @@ arc_bio_alarm(struct arc_softc *sc, struct bioc_alarm *ba) if (error != 0) return (error); - if (reply[0] != ARC_FW_CMD_OK) + switch (reply[0]) { + case ARC_FW_CMD_OK: + return (0); + case ARC_FW_CMD_PASS_REQD: + return (EPERM); + default: return (EIO); - - return (0); + } } int |