summaryrefslogtreecommitdiffstats
path: root/sys/dev/puc
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2003-08-01 02:25:32 +0000
committerambrisko <ambrisko@FreeBSD.org>2003-08-01 02:25:32 +0000
commita1fbadfb8de71f817a03707900a9eac99e29c781 (patch)
treece3aeb2c6adcbd20da5149ad5af2127c6bcdb54c /sys/dev/puc
parent631df8957ef156c0ebf5aed2eeafe277cb1ee093 (diff)
downloadFreeBSD-src-a1fbadfb8de71f817a03707900a9eac99e29c781.zip
FreeBSD-src-a1fbadfb8de71f817a03707900a9eac99e29c781.tar.gz
Add printer support to puc(4) driver.
- Move isa/ppc* to sys/dev/ppc (repo-copy) - Add an attachment method to ppc for puc - In puc we need to walk the chain of parents. Still to do, is to make ppc(4) & puc(4) work on other platforms. Testers wanted. PR: 38372 (in spirit done differently) Verified by: Make universe (if I messed up a platform please fix)
Diffstat (limited to 'sys/dev/puc')
-rw-r--r--sys/dev/puc/puc.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index 5cfe3ab..802f409 100644
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -256,6 +256,9 @@ puc_attach(device_t dev, const struct puc_device_description *desc)
case PUC_PORT_TYPE_COM:
typestr = "sio";
break;
+ case PUC_PORT_TYPE_LPT:
+ typestr = "ppc";
+ break;
default:
continue;
}
@@ -457,8 +460,15 @@ puc_alloc_resource(device_t dev, device_t child, int type, int *rid,
struct resource *retval;
struct resource_list *rl;
struct resource_list_entry *rle;
+ device_t my_child;
- pdev = device_get_ivars(child);
+ /*
+ * in the case of a child of child we need to find our immediate child
+ */
+ for (my_child = child; device_get_parent(my_child) != dev;
+ my_child = device_get_parent(my_child));
+
+ pdev = device_get_ivars(my_child);
rl = &pdev->resources;
#ifdef PUC_DEBUG
@@ -476,8 +486,11 @@ puc_alloc_resource(device_t dev, device_t child, int type, int *rid,
printf("found rle, %lx, %lx, %lx\n", start, end, count);
#endif
retval = rle->res;
- } else
+ }
+#ifdef PUC_DEBUG
+ else
printf("oops rle is gone\n");
+#endif
return (retval);
}
OpenPOWER on IntegriCloud