This source file includes following definitions.
- hilidprobe
- hilidattach
- hiliddetach
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/device.h>
32 #include <sys/ioctl.h>
33
34 #include <machine/autoconf.h>
35 #include <machine/bus.h>
36 #include <machine/cpu.h>
37
38 #include <dev/hil/hilreg.h>
39 #include <dev/hil/hilvar.h>
40 #include <dev/hil/hildevs.h>
41
42 struct hilid_softc {
43 struct hildev_softc sc_hildev;
44
45 u_int8_t sc_id[16];
46 };
47
48 int hilidprobe(struct device *, void *, void *);
49 void hilidattach(struct device *, struct device *, void *);
50 int hiliddetach(struct device *, int);
51
52 struct cfdriver hilid_cd = {
53 NULL, "hilid", DV_DULL
54 };
55
56 struct cfattach hilid_ca = {
57 sizeof(struct hilid_softc), hilidprobe, hilidattach, hiliddetach,
58 };
59
60 int
61 hilidprobe(struct device *parent, void *match, void *aux)
62 {
63 struct hil_attach_args *ha = aux;
64
65 if (ha->ha_type != HIL_DEVICE_IDMODULE)
66 return (0);
67
68 return (1);
69 }
70
71 void
72 hilidattach(struct device *parent, struct device *self, void *aux)
73 {
74 struct hilid_softc *sc = (void *)self;
75 struct hil_attach_args *ha = aux;
76 u_int i, len;
77
78 sc->hd_code = ha->ha_code;
79 sc->hd_type = ha->ha_type;
80 sc->hd_infolen = ha->ha_infolen;
81 bcopy(ha->ha_info, sc->hd_info, ha->ha_infolen);
82 sc->hd_fn = NULL;
83
84 printf("\n");
85
86 bzero(sc->sc_id, sizeof(sc->sc_id));
87 len = sizeof(sc->sc_id);
88 printf("%s: security code", self->dv_xname);
89
90 if (send_hildev_cmd((struct hildev_softc *)sc,
91 HIL_SECURITY, sc->sc_id, &len) == 0) {
92 for (i = 0; i < sizeof(sc->sc_id); i++)
93 printf(" %02x", sc->sc_id[i]);
94 printf("\n");
95 } else
96 printf(" unavailable\n");
97 }
98
99 int
100 hiliddetach(struct device *self, int flags)
101 {
102 return (0);
103 }