Deleted Added
full compact
puc_pccard.c (102714) puc_pccard.c (102734)
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice unmodified, this list of conditions, and the following

--- 8 unchanged lines hidden (view full) ---

17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice unmodified, this list of conditions, and the following

--- 8 unchanged lines hidden (view full) ---

17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * $FreeBSD: head/sys/dev/puc/puc_pccard.c 102714 2002-08-31 18:38:43Z phk $
25 * $FreeBSD: head/sys/dev/puc/puc_pccard.c 102734 2002-08-31 20:29:46Z phk $
26 */
27
28#include <sys/param.h>
29#include <sys/systm.h>
30#include <sys/kernel.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/malloc.h>
34
35#include <machine/bus.h>
36#include <machine/resource.h>
37#include <sys/rman.h>
38
39#define PUC_ENTRAILS 1
40#include <dev/puc/pucvar.h>
41
26 */
27
28#include <sys/param.h>
29#include <sys/systm.h>
30#include <sys/kernel.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/malloc.h>
34
35#include <machine/bus.h>
36#include <machine/resource.h>
37#include <sys/rman.h>
38
39#define PUC_ENTRAILS 1
40#include <dev/puc/pucvar.h>
41
42#include <dev/sio/sioreg.h>
42#include <dev/pccard/pccardvar.h>
43
44#include <opt_puc.h>
45
46const struct puc_device_description rscom_devices = {
47
48 "RS-com 2 port",
43#include <dev/pccard/pccardvar.h>
44
45#include <opt_puc.h>
46
47const struct puc_device_description rscom_devices = {
48
49 "RS-com 2 port",
50 NULL,
49 { 0, 0, 0, 0 },
50 { 0, 0, 0, 0 },
51 {
51 { 0, 0, 0, 0 },
52 { 0, 0, 0, 0 },
53 {
52 { PUC_PORT_TYPE_COM, 0x0, 0x00, 0 },
53 { PUC_PORT_TYPE_COM, 0x1, 0x00, 0 },
54 { PUC_PORT_TYPE_COM, 0x0, 0x00, DEFAULT_RCLK },
55 { PUC_PORT_TYPE_COM, 0x1, 0x00, DEFAULT_RCLK },
54 }
55};
56
57
58static int
59puc_pccard_probe(device_t dev)
60{
61 char *vendor, *product;
62 int error;
63
64 error = pccard_get_vendor_str(dev, &vendor);
65 if (error)
66 return(error);
67 error = pccard_get_product_str(dev, &product);
68 if (error)
69 return(error);
70 printf("puc_pccard_probe <%s><%s>\n", vendor, product);
56 }
57};
58
59
60static int
61puc_pccard_probe(device_t dev)
62{
63 char *vendor, *product;
64 int error;
65
66 error = pccard_get_vendor_str(dev, &vendor);
67 if (error)
68 return(error);
69 error = pccard_get_product_str(dev, &product);
70 if (error)
71 return(error);
72 printf("puc_pccard_probe <%s><%s>\n", vendor, product);
71 if (!strcmp(vendor, "PCMCIA") && !strcmp(product, "RS-COM 2P"))
73 if (!strcmp(vendor, "PCMCIA") && !strcmp(product, "RS-COM 2P")) {
74 device_set_desc(dev, rscom_devices.name);
72 return (0);
75 return (0);
76 }
73
74 return (ENXIO);
75}
76
77static int
78puc_pccard_attach(device_t dev)
79{
80

--- 26 unchanged lines hidden ---
77
78 return (ENXIO);
79}
80
81static int
82puc_pccard_attach(device_t dev)
83{
84

--- 26 unchanged lines hidden ---