This source file includes following definitions.
- le_tc_match
- le_tc_attach
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
30
31
32
33
34
35 #include <sys/param.h>
36 #include <sys/systm.h>
37 #include <sys/mbuf.h>
38 #include <sys/syslog.h>
39 #include <sys/socket.h>
40 #include <sys/device.h>
41
42 #include <net/if.h>
43 #include <net/if_media.h>
44
45 #ifdef INET
46 #include <netinet/in.h>
47 #include <netinet/if_ether.h>
48 #endif
49
50 #include <dev/ic/am7990reg.h>
51 #include <dev/ic/am7990var.h>
52
53 #include <dev/tc/if_levar.h>
54 #include <dev/tc/tcvar.h>
55
56 int le_tc_match(struct device *, void *, void *);
57 void le_tc_attach(struct device *, struct device *, void *);
58
59 struct cfattach le_tc_ca = {
60 sizeof(struct le_softc), le_tc_match, le_tc_attach
61 };
62
63 #define LE_OFFSET_RAM 0x0
64 #define LE_OFFSET_LANCE 0x100000
65 #define LE_OFFSET_ROM 0x1c0000
66
67 int
68 le_tc_match(struct device *parent, void *match, void *aux)
69 {
70 struct tc_attach_args *d = aux;
71
72 if (strncmp("PMAD-AA ", d->ta_modname, TC_ROM_LLEN) != 0)
73 return (0);
74
75 return (1);
76 }
77
78 void
79 le_tc_attach(struct device *parent, struct device *self, void *aux)
80 {
81 struct le_softc *lesc = (void *)self;
82 struct am7990_softc *sc = &lesc->sc_am7990;
83 struct tc_attach_args *d = aux;
84
85
86
87
88
89 lesc->sc_r1 = (struct lereg1 *)
90 TC_DENSE_TO_SPARSE(TC_PHYS_TO_UNCACHED(d->ta_addr + LE_OFFSET_LANCE));
91 sc->sc_mem = (void *)(d->ta_addr + LE_OFFSET_RAM);
92
93 sc->sc_copytodesc = am7990_copytobuf_contig;
94 sc->sc_copyfromdesc = am7990_copyfrombuf_contig;
95 sc->sc_copytobuf = am7990_copytobuf_contig;
96 sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
97 sc->sc_zerobuf = am7990_zerobuf_contig;
98
99
100
101
102
103
104
105 dec_le_common_attach(&lesc->sc_am7990,
106 (u_char *)(d->ta_addr + LE_OFFSET_ROM + 2));
107
108 tc_intr_establish(parent, d->ta_cookie, TC_IPL_NET, am7990_intr, sc);
109 }