1 typedef struct Regdump Regdump;
11 Pcistate, 32, "Pcistate",
14 static Regdump gmacreg[] = {
29 Smidata, 16, "Smidata",
30 Phyaddr, 16, "Phyaddr",
31 Mchash+0, 16, "Mchash",
32 Mchash+2, 16, "Mchash",
33 Mchash+4, 16, "Mchash",
34 Mchash+6, 16, "Mchash",
43 static Regdump macreg[] = {
45 Gfrxctl, 32, "Gfrxctl",
53 Linkctl, 8, "Linkctl",
61 static Regdump reg[] = {
70 Macadr/2, 16, "Macadr",
71 Macadr/2+1, 16, "Macadr",
72 Macadr/2+2, 16, "Macadr",
78 Clkgate, 8, "Clkgate",
81 Tstctl1, 8, "Tstctl1",
84 Asfhost, 32, "Asfhost",
85 Statctl, 32, "Statctl",
87 Stataddr, 32, "Stataddr",
91 Statiwm, 8, "Statiwm",
95 dumppci(Ctlr *c, char *p, char *e)
101 p = seprint(p, e, "/* pci reg */\n");
102 for(i = 0; i < nelem(pcireg); i++)
105 p = seprint(p, e, "%s: bug size %d\n", r[i].name, r[i].size);
108 p = seprint(p, e, "%s: %.8ux\n", r[i].name, pcicfgr32(c->p, r[i].offset));
115 dumpgmac(Ctlr *c, char *p, char *e)
121 p = seprint(p, e, "/* gmac reg */\n");
122 for(i = 0; i < nelem(gmacreg); i++)
125 p = seprint(p, e, "%s: bug size %d\n", r[i].name, r[i].size);
128 p = seprint(p, e, "%s: %.4ux\n", r[i].name, gmacread(c, r[i].offset));
131 p = seprint(p, e, "%s: %.8ux\n", r[i].name, gmacread32(c, r[i].offset));
138 dumpmac(Ctlr *c, char *p, char *e)
144 p = seprint(p, e, "/* mac reg */\n");
145 for(i = 0; i < nelem(macreg); i++)
148 p = seprint(p, e, "%s: bug size %d\n", r[i].name, r[i].size);
151 p = seprint(p, e, "%s: %.2ux\n", r[i].name, macread8(c, r[i].offset));
154 p = seprint(p, e, "%s: %.8ux\n", r[i].name, macread32(c, r[i].offset));
161 dumpreg(Ctlr *c, char *p, char *e)
167 p = seprint(p, e, "/* reg */\n");
168 for(i = 0; i < nelem(reg); i++)
171 p = seprint(p, e, "%s: bug size %d\n", r[i].name, r[i].size);
174 p = seprint(p, e, "%s: %.2ux\n", r[i].name, c->reg8[r[i].offset]);
177 p = seprint(p, e, "%s: %.4ux\n", r[i].name, c->reg16[r[i].offset]);
180 p = seprint(p, e, "%s: %.8ux\n", r[i].name, c->reg[r[i].offset]);
186 static char *optab[256] = {
204 dumpring(Sring *r, Block **t, char *p, char *e)
210 "bring: rp %ud wp %ud cnt %ud m %ud : ",
211 r->rp, r->wp, r->cnt, r->m);
214 for(i = 0; i < r->cnt; i++){
216 if(m>=0 && t[i] == nil){
217 p = seprint(p, e, "%ud", m);
219 p = seprint(p, e, "-%ud", i-1);
220 p = seprint(p, e, " ");
222 }else if(m<0 && t[i] != nil)
226 p = seprint(p, e, "%ud", m);
228 p = seprint(p, e, "-%ud ", i-1);
230 return seprint(p, e, "n=%d/%d", n, r->cnt);
235 descriptorfu(Ether *e, uint qoff)
237 char buf[PRINTSIZE], *p, *f;
239 Block *b, *a, **bring;
245 f = buf + sizeof buf;
249 p = seprint(buf, f, "tx ");
253 p = seprint(buf, f, "rx ");
256 q = prread16(c, qoff + Pgetidx);
257 print(" getidx %ud\n", q);
260 print(" try getidx %ud\n", q);
267 print(" %0.4d %.2ux l=%d p=%#p @%#p\n", q, t->op,
268 (uint)getle(t->l, 2), KZERO+(ulong)getle(t->status, 4), Pciwaddrl(t));
269 print(" %0.4d %.2ux l=%d p=%#p @%#p\n", qm1, t->op,
270 (uint)getle(v->l, 2), KZERO+(ulong)getle(v->status, 4), Pciwaddrl(v));
272 print(" %#p %#p (wp)\n", b? b->wp: 0, a? a->wp: 0);
274 print(" %#p %#p (rp)\n", b? b->rp: 0, a? a->rp: 0);
276 dumpring(r, bring, p, f);