summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-08-06 21:07:28 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-08-06 21:07:28 +0000
commita5ac431469afbc189d4dec56661dcee512224d08 (patch)
treec9a8441742c2a4231ae18e617608eeca9877e1d4
parentf8c8cbd4878bcefedf694590065b23e0448eab9e (diff)
Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for serial consoles but we don't support those on puc(4) anyway. ok deraadt@
-rw-r--r--sys/dev/puc/com_puc.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sys/dev/puc/com_puc.c b/sys/dev/puc/com_puc.c
index 84ba7d16c98..8069f2197e4 100644
--- a/sys/dev/puc/com_puc.c
+++ b/sys/dev/puc/com_puc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_puc.c,v 1.17 2010/06/26 23:24:45 guenther Exp $ */
+/* $OpenBSD: com_puc.c,v 1.18 2010/08/06 21:07:27 kettenis Exp $ */
/*
* Copyright (c) 1997 - 1999, Jason Downs. All rights reserved.
@@ -54,12 +54,14 @@
#define com_lcr com_cfcr
-int com_puc_match(struct device *, void *, void *);
-void com_puc_attach(struct device *, struct device *, void *);
-int com_puc_detach(struct device *, int );
+int com_puc_match(struct device *, void *, void *);
+void com_puc_attach(struct device *, struct device *, void *);
+int com_puc_detach(struct device *, int);
+int com_puc_activate(struct device *, int);
struct cfattach com_puc_ca = {
- sizeof(struct com_softc), com_puc_match, com_puc_attach, com_puc_detach
+ sizeof(struct com_softc), com_puc_match,
+ com_puc_attach, com_puc_detach, com_puc_activate
};
int
@@ -118,3 +120,19 @@ com_puc_detach(struct device *self, int flags)
{
return com_detach(self, flags);
}
+
+int
+com_puc_activate(struct device *self, int act)
+{
+ struct com_softc *sc = (struct com_softc *)self;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ break;
+ case DVACT_RESUME:
+ com_resume(sc);
+ break;
+ }
+
+ return (0);
+}