summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2007-10-27 03:28:27 +0000
committerdlg <dlg@openbsd.org>2007-10-27 03:28:27 +0000
commit231b04425daa907e39274aca01f209ab384a4a7b (patch)
tree441dbf40e190bb7cbe6764765ab7c330eb3926d7 /sys/dev
parentadd missing dependency (diff)
downloadwireguard-openbsd-231b04425daa907e39274aca01f209ab384a4a7b.tar.xz
wireguard-openbsd-231b04425daa907e39274aca01f209ab384a4a7b.zip
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@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/arc.c13
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