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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783
|
/* Copyright 2001 Sun Microsystems (thockin@sun.com) */
#include <stdio.h>
#include "ethtool-util.h"
static const char * const csr0_tap[4] = {
"No transmit automatic polling",
"Transmit automatic polling every 200 seconds",
"Transmit automatic polling every 800 seconds",
"Transmit automatic polling every 1.6 milliseconds",
};
static const char * const csr0_cache_al[4] = {
"not used",
"8-longword boundary alignment",
"16-longword boundary alignment",
"32-longword boundary alignment",
};
static const char * const csr5_buserr[8] = {
" Bus error: parity",
" Bus error: master abort",
" Bus error: target abort",
" Bus error: (unknown code, reserved)",
" Bus error: (unknown code, reserved)",
" Bus error: (unknown code, reserved)",
" Bus error: (unknown code, reserved)",
" Bus error: (unknown code, reserved)",
};
static const int csr6_tx_thresh[4] = {
72,
96,
128,
160,
};
static const char * const csr6_om[4] = {
"normal",
"internal loopback",
"external loopback",
"unknown (not used)",
};
static const char * const csr5_tx_state[8] = {
"stopped",
"running: fetch desc",
"running: wait xmit end",
"running: read buf",
"unknown (reserved)",
"running: setup packet",
"suspended",
"running: close desc",
};
static const char * const csr5_rx_state[8] = {
"stopped",
"running: fetch desc",
"running: chk pkt end",
"running: wait for pkt",
"suspended",
"running: close",
"running: flush",
"running: queue",
};
static const char * const csr12_nway_state[8] = {
"Autonegotiation disable",
"Transmit disable",
"Ability detect",
"Acknowledge detect",
"Complete acknowledge",
"FLP link good, nway complete",
"Link check",
"unknown (reserved)",
};
static const char * const csr14_tp_comp[4] = {
"Compensation Disabled Mode",
"Compensation Disabled Mode",
"High Power Mode",
"Normal Compensation Mode",
};
static void
print_ring_addresses(u32 csr3, u32 csr4)
{
fprintf(stdout,
"0x18: CSR3 (Rx Ring Base Address) 0x%08x\n"
"0x20: CSR4 (Tx Ring Base Address) 0x%08x\n"
,
csr3,
csr4);
}
static void
print_rx_missed(u32 csr8)
{
fprintf(stdout,
"0x40: CSR8 (Missed Frames Counter) 0x%08x\n", csr8);
if (csr8 & (1 << 16))
fprintf(stdout,
" Counter overflow\n");
else {
unsigned int rx_missed = csr8 & 0xffff;
if (!rx_missed)
fprintf(stdout,
" No missed frames\n");
else
fprintf(stdout,
" %u missed frames\n", rx_missed);
}
}
static void
de21040_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
{
u32 tmp, v, *data = (u32 *)regs->data;
fprintf(stdout, "21040 Registers\n");
fprintf(stdout, "---------------\n");
/*
* CSR0
*/
v = data[0];
fprintf(stdout,
"0x00: CSR0 (Bus Mode) 0x%08x\n"
" %s\n"
" %s address space\n"
" Cache alignment: %s\n"
,
v,
csr0_tap[(v >> 17) & 3],
v & (1 << 16) ? "Diagnostic" : "Standard",
csr0_cache_al[(v >> 14) & 3]);
tmp = (v >> 8) & 0x3f;
if (tmp == 0)
fprintf(stdout, " Programmable burst length unlimited\n");
else
fprintf(stdout,
" Programmable burst length %d longwords\n",
tmp);
fprintf(stdout,
" %s endian data buffers\n"
" Descriptor skip length %d longwords\n"
" %s bus arbitration scheme\n"
,
v & (1 << 7) ? "Big" : "Little",
(v >> 2) & 0x1f,
v & (1 << 1) ? "Round-robin" : "RX-has-priority");
if (v & (1 << 0))
fprintf(stdout, " Software reset asserted\n");
/*
* CSR3, 4
*/
print_ring_addresses(data[3], data[4]);
/*
* CSR5
*/
v = data[5];
fprintf(stdout,
"0x28: CSR5 (Status) 0x%08x\n"
"%s"
" Transmit process %s\n"
" Receive process %s\n"
" Link %s\n"
,
v,
v & (1 << 13) ? csr5_buserr[(v >> 23) & 0x7] : "",
csr5_tx_state[(v >> 20) & 0x7],
csr5_rx_state[(v >> 17) & 0x7],
v & (1 << 12) ? "fail" : "OK");
if (v & (1 << 16))
fprintf(stdout,
" Normal interrupts: %s%s%s\n"
,
v & (1 << 0) ? "TxOK " : "",
v & (1 << 2) ? "TxNoBufs " : "",
v & (1 << 6) ? "RxOK" : "");
if (v & (1 << 15))
fprintf(stdout,
" Abnormal intr: %s%s%s%s%s%s%s%s\n"
,
v & (1 << 1) ? "TxStop " : "",
v & (1 << 3) ? "TxJabber " : "",
v & (1 << 5) ? "TxUnder " : "",
v & (1 << 7) ? "RxNoBufs " : "",
v & (1 << 8) ? "RxStopped " : "",
v & (1 << 9) ? "RxTimeout " : "",
v & (1 << 10) ? "AUI_TP " : "",
v & (1 << 11) ? "FD_Short " : "");
/*
* CSR6
*/
v = data[6];
fprintf(stdout,
"0x30: CSR6 (Operating Mode) 0x%08x\n"
"%s"
"%s"
" Transmit threshold %d bytes\n"
" Transmit DMA %sabled\n"
"%s"
" Operating mode: %s\n"
" %s duplex\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" Receive DMA %sabled\n"
" %s filtering mode\n"
,
v,
v & (1<<17) ? " Capture effect enabled\n" : "",
v & (1<<16) ? " Back pressure enabled\n" : "",
csr6_tx_thresh[(v >> 14) & 3],
v & (1<<13) ? "en" : "dis",
v & (1<<12) ? " Forcing collisions\n" : "",
csr6_om[(v >> 10) & 3],
v & (1<<9) ? "Full" : "Half",
v & (1<<8) ? " Flaky oscillator disable\n" : "",
v & (1<<7) ? " Pass All Multicast\n" : "",
v & (1<<6) ? " Promisc Mode\n" : "",
v & (1<<5) ? " Start/Stop Backoff Counter\n" : "",
v & (1<<4) ? " Inverse Filtering\n" : "",
v & (1<<3) ? " Pass Bad Frames\n" : "",
v & (1<<2) ? " Hash-only Filtering\n" : "",
v & (1<<1) ? "en" : "dis",
v & (1<<0) ? "Hash" : "Perfect");
/*
* CSR7
*/
v = data[7];
fprintf(stdout,
"0x38: CSR7 (Interrupt Mask) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
,
v,
v & (1<<16) ? " Normal interrupt summary\n" : "",
v & (1<<15) ? " Abnormal interrupt summary\n" : "",
v & (1<<13) ? " System error\n" : "",
v & (1<<12) ? " Link fail\n" : "",
v & (1<<11) ? " Full duplex\n" : "",
v & (1<<10) ? " AUI_TP pin\n" : "",
v & (1<<9) ? " Receive watchdog timeout\n" : "",
v & (1<<8) ? " Receive stopped\n" : "",
v & (1<<7) ? " Receive buffer unavailable\n" : "",
v & (1<<6) ? " Receive interrupt\n" : "",
v & (1<<5) ? " Transmit underflow\n" : "",
v & (1<<3) ? " Transmit jabber timeout\n" : "",
v & (1<<2) ? " Transmit buffer unavailable\n" : "",
v & (1<<1) ? " Transmit stopped\n" : "",
v & (1<<0) ? " Transmit interrupt\n" : "");
/*
* CSR8
*/
print_rx_missed(data[8]);
/*
* CSR9
*/
v = data[9];
fprintf(stdout,
"0x48: CSR9 (Ethernet Address ROM) 0x%08x\n", v);
/*
* CSR11
*/
v = data[11];
fprintf(stdout,
"0x58: CSR11 (Full Duplex Autoconfig) 0x%08x\n", v);
/*
* CSR12
*/
v = data[12];
fprintf(stdout,
"0x60: CSR12 (SIA Status) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" AUI_TP pin: %s\n"
,
v,
v & (1<<7) ? " PLL sampler high\n" : "",
v & (1<<6) ? " PLL sampler low\n" : "",
v & (1<<5) ? " PLL self-test pass\n" : "",
v & (1<<4) ? " PLL self-test done\n" : "",
v & (1<<3) ? " Autopolarity state\n" : "",
v & (1<<2) ? " Link fail\n" : "",
v & (1<<1) ? " Network connection error\n" : "",
v & (1<<0) ? "AUI" : "TP");
/*
* CSR13
*/
v = data[13];
fprintf(stdout,
"0x68: CSR13 (SIA Connectivity) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
" External port output multiplexer select: %u%u%u%u\n"
"%s"
"%s"
"%s"
"%s"
" %s interface selected\n"
"%s"
"%s"
"%s"
,
v,
v & (1<<15) ? " Enable pins 5, 6, 7\n" : "",
v & (1<<14) ? " Enable pins 2, 4\n" : "",
v & (1<<13) ? " Enable pins 1, 3\n" : "",
v & (1<<12) ? " Input enable\n" : "",
v & (1<<11) ? 1 : 0,
v & (1<<10) ? 1 : 0,
v & (1<<9) ? 1 : 0,
v & (1<<8) ? 1 : 0,
v & (1<<7) ? " APLL start\n" : "",
v & (1<<6) ? " Serial interface input multiplexer\n" : "",
v & (1<<5) ? " Encoder input multiplexer\n" : "",
v & (1<<4) ? " SIA PLL external input enable\n" : "",
v & (1<<3) ? "AUI" : "10base-T",
v & (1<<2) ? " CSR autoconfiguration\n" : "",
v & (1<<1) ? " AUI_TP pin autoconfiguration\n" : "",
v & (1<<0) ? " SIA reset\n" : "");
/*
* CSR14
*/
v = data[14];
fprintf(stdout,
"0x70: CSR14 (SIA Transmit and Receive) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" %s\n"
"%s"
"%s"
"%s"
"%s"
,
v,
v & (1<<14) ? " Set polarity plus\n" : "",
v & (1<<13) ? " Autopolarity enable\n" : "",
v & (1<<12) ? " Link test enable\n" : "",
v & (1<<11) ? " Heartbeat enable\n" : "",
v & (1<<10) ? " Collision detect enable\n" : "",
v & (1<<9) ? " Collision squelch enable\n" : "",
v & (1<<8) ? " Receive squelch enable\n" : "",
csr14_tp_comp[(v >> 4) & 0x3],
v & (1<<3) ? " Link pulse send enable\n" : "",
v & (1<<2) ? " Driver enable\n" : "",
v & (1<<1) ? " Loopback enable\n" : "",
v & (1<<0) ? " Encoder enable\n" : "");
/*
* CSR15
*/
v = data[15];
fprintf(stdout,
"0x78: CSR15 (SIA General) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
,
v,
v & (1<<13) ? " Force receiver low\n" : "",
v & (1<<12) ? " PLL self-test start\n" : "",
v & (1<<11) ? " Force link fail\n" : "",
v & (1<<9) ? " Force unsquelch\n" : "",
v & (1<<8) ? " Test clock\n" : "",
v & (1<<5) ? " Receive watchdog release\n" : "",
v & (1<<4) ? " Receive watchdog disable\n" : "",
v & (1<<2) ? " Jabber clock\n" : "",
v & (1<<1) ? " Host unjab\n" : "",
v & (1<<0) ? " Jabber disable\n" : "");
}
static void
de21041_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
{
u32 tmp, v, *data = (u32 *)regs->data;
fprintf(stdout, "21041 Registers\n");
fprintf(stdout, "---------------\n");
/*
* CSR0
*/
v = data[0];
fprintf(stdout,
"0x00: CSR0 (Bus Mode) 0x%08x\n"
" %s endian descriptors\n"
" %s\n"
" %s address space\n"
" Cache alignment: %s\n"
,
v,
v & (1 << 20) ? "Big" : "Little",
csr0_tap[(v >> 17) & 3],
v & (1 << 16) ? "Diagnostic" : "Standard",
csr0_cache_al[(v >> 14) & 3]);
tmp = (v >> 8) & 0x3f;
if (tmp == 0)
fprintf(stdout, " Programmable burst length unlimited\n");
else
fprintf(stdout,
" Programmable burst length %d longwords\n",
tmp);
fprintf(stdout,
" %s endian data buffers\n"
" Descriptor skip length %d longwords\n"
" %s bus arbitration scheme\n"
,
v & (1 << 7) ? "Big" : "Little",
(v >> 2) & 0x1f,
v & (1 << 1) ? "Round-robin" : "RX-has-priority");
if (v & (1 << 0))
fprintf(stdout, " Software reset asserted\n");
/*
* CSR3, 4
*/
print_ring_addresses(data[3], data[4]);
/*
* CSR5
*/
v = data[5];
fprintf(stdout,
"0x28: CSR5 (Status) 0x%08x\n"
"%s"
" Transmit process %s\n"
" Receive process %s\n"
" Link %s\n"
,
v,
v & (1 << 13) ? csr5_buserr[(v >> 23) & 0x7] : "",
csr5_tx_state[(v >> 20) & 0x7],
csr5_rx_state[(v >> 17) & 0x7],
v & (1 << 12) ? "fail" : "OK");
if (v & (1 << 16))
fprintf(stdout,
" Normal interrupts: %s%s%s%s%s\n"
,
v & (1 << 0) ? "TxOK " : "",
v & (1 << 2) ? "TxNoBufs " : "",
v & (1 << 6) ? "RxOK" : "",
v & (1 << 11) ? "TimerExp " : "",
v & (1 << 14) ? "EarlyRx " : "");
if (v & (1 << 15))
fprintf(stdout,
" Abnormal intr: %s%s%s%s%s%s%s\n"
,
v & (1 << 1) ? "TxStop " : "",
v & (1 << 3) ? "TxJabber " : "",
v & (1 << 4) ? "ANC " : "",
v & (1 << 5) ? "TxUnder " : "",
v & (1 << 7) ? "RxNoBufs " : "",
v & (1 << 8) ? "RxStopped " : "",
v & (1 << 9) ? "RxTimeout " : "");
/*
* CSR6
*/
v = data[6];
fprintf(stdout,
"0x30: CSR6 (Operating Mode) 0x%08x\n"
"%s"
"%s"
" Transmit threshold %d bytes\n"
" Transmit DMA %sabled\n"
"%s"
" Operating mode: %s\n"
" %s duplex\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" Receive DMA %sabled\n"
" %s filtering mode\n"
,
v,
v & (1<<31) ? " Special capture effect enabled\n" : "",
v & (1<<17) ? " Capture effect enabled\n" : "",
csr6_tx_thresh[(v >> 14) & 3],
v & (1<<13) ? "en" : "dis",
v & (1<<12) ? " Forcing collisions\n" : "",
csr6_om[(v >> 10) & 3],
v & (1<<9) ? "Full" : "Half",
v & (1<<8) ? " Flaky oscillator disable\n" : "",
v & (1<<7) ? " Pass All Multicast\n" : "",
v & (1<<6) ? " Promisc Mode\n" : "",
v & (1<<5) ? " Start/Stop Backoff Counter\n" : "",
v & (1<<4) ? " Inverse Filtering\n" : "",
v & (1<<3) ? " Pass Bad Frames\n" : "",
v & (1<<2) ? " Hash-only Filtering\n" : "",
v & (1<<1) ? "en" : "dis",
v & (1<<0) ? "Hash" : "Perfect");
/*
* CSR7
*/
v = data[7];
fprintf(stdout,
"0x38: CSR7 (Interrupt Mask) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
,
v,
v & (1<<16) ? " Normal interrupt summary\n" : "",
v & (1<<15) ? " Abnormal interrupt summary\n" : "",
v & (1<<14) ? " Early receive interrupt\n" : "",
v & (1<<13) ? " System error\n" : "",
v & (1<<12) ? " Link fail\n" : "",
v & (1<<11) ? " Timer expired\n" : "",
v & (1<<9) ? " Receive watchdog timeout\n" : "",
v & (1<<8) ? " Receive stopped\n" : "",
v & (1<<7) ? " Receive buffer unavailable\n" : "",
v & (1<<6) ? " Receive interrupt\n" : "",
v & (1<<5) ? " Transmit underflow\n" : "",
v & (1<<4) ? " Link pass\n" : "",
v & (1<<3) ? " Transmit jabber timeout\n" : "",
v & (1<<2) ? " Transmit buffer unavailable\n" : "",
v & (1<<1) ? " Transmit stopped\n" : "",
v & (1<<0) ? " Transmit interrupt\n" : "");
/*
* CSR8
*/
print_rx_missed(data[8]);
/*
* CSR9
*/
v = data[9];
fprintf(stdout,
"0x48: CSR9 (Boot and Ethernet ROMs) 0x%08x\n"
" Select bits: %s%s%s%s%s%s\n"
" Data: %d%d%d%d%d%d%d%d\n"
,
v,
v & (1<<15) ? "Mode " : "",
v & (1<<14) ? "Read " : "",
v & (1<<13) ? "Write " : "",
v & (1<<12) ? "BootROM " : "",
v & (1<<11) ? "SROM " : "",
v & (1<<10) ? "ExtReg " : "",
v & (1<<7) ? 1 : 0,
v & (1<<6) ? 1 : 0,
v & (1<<5) ? 1 : 0,
v & (1<<4) ? 1 : 0,
v & (1<<3) ? 1 : 0,
v & (1<<2) ? 1 : 0,
v & (1<<1) ? 1 : 0,
v & (1<<0) ? 1 : 0);
/*
* CSR10
*/
v = data[10];
fprintf(stdout,
"0x50: CSR10 (Boot ROM Address) 0x%08x\n", v);
/*
* CSR11
*/
v = data[11];
fprintf(stdout,
"0x58: CSR11 (General Purpose Timer) 0x%08x\n"
"%s"
" Timer value: %u cycles\n"
,
v,
v & (1<<16) ? " Continuous mode\n" : "",
v & 0xffff);
/*
* CSR12
*/
v = data[12];
fprintf(stdout,
"0x60: CSR12 (SIA Status) 0x%08x\n"
" Link partner code word 0x%04x\n"
"%s"
" NWay state: %s\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
,
v,
v >> 16,
v & (1<<15) ? " Link partner negotiable\n" : "",
csr12_nway_state[(v >> 12) & 0x7],
v & (1<<11) ? " Transmit remote fault\n" : "",
v & (1<<10) ? " Unstable NLP detected\n" : "",
v & (1<<9) ? " Non-selected port receive activity\n" : "",
v & (1<<8) ? " Selected port receive activity\n" : "",
v & (1<<7) ? " PLL sampler high\n" : "",
v & (1<<6) ? " PLL sampler low\n" : "",
v & (1<<5) ? " PLL self-test pass\n" : "",
v & (1<<4) ? " PLL self-test done\n" : "",
v & (1<<3) ? " Autopolarity state\n" : "",
v & (1<<2) ? " Link fail\n" : "",
v & (1<<1) ? " Network connection error\n" : "");
/*
* CSR13
*/
v = data[13];
fprintf(stdout,
"0x68: CSR13 (SIA Connectivity) 0x%08x\n"
" SIA Diagnostic Mode 0x%04x\n"
" %s\n"
"%s"
"%s"
,
v,
(v >> 4) & 0xfff,
v & (1<<3) ? "AUI/BNC port" : "10base-T port",
v & (1<<2) ? " CSR autoconfiguration enabled\n" : "",
v & (1<<0) ? " SIA register reset asserted\n" : "");
/*
* CSR14
*/
v = data[14];
fprintf(stdout,
"0x70: CSR14 (SIA Transmit and Receive) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" %s\n"
"%s"
"%s"
"%s"
"%s"
,
v,
v & (1<<15) ? " 10base-T/AUI autosensing\n" : "",
v & (1<<14) ? " Set polarity plus\n" : "",
v & (1<<13) ? " Autopolarity enable\n" : "",
v & (1<<12) ? " Link test enable\n" : "",
v & (1<<11) ? " Heartbeat enable\n" : "",
v & (1<<10) ? " Collision detect enable\n" : "",
v & (1<<9) ? " Collision squelch enable\n" : "",
v & (1<<8) ? " Receive squelch enable\n" : "",
v & (1<<7) ? " Autonegotiation enable\n" : "",
v & (1<<6) ? " Must Be One\n" : "",
csr14_tp_comp[(v >> 4) & 0x3],
v & (1<<3) ? " Link pulse send enable\n" : "",
v & (1<<2) ? " Driver enable\n" : "",
v & (1<<1) ? " Loopback enable\n" : "",
v & (1<<0) ? " Encoder enable\n" : "");
/*
* CSR15
*/
v = data[15];
fprintf(stdout,
"0x78: CSR15 (SIA General) 0x%08x\n"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
"%s"
" %s port selected\n"
"%s"
"%s"
"%s"
,
v,
v & (1<<15) ? " GP LED2 on\n" : "",
v & (1<<14) ? " GP LED2 enable\n" : "",
v & (1<<13) ? " Force receiver low\n" : "",
v & (1<<12) ? " PLL self-test start\n" : "",
v & (1<<11) ? " LED stretch disable\n" : "",
v & (1<<10) ? " Force link fail\n" : "",
v & (1<<9) ? " Force unsquelch\n" : "",
v & (1<<8) ? " Test clock\n" : "",
v & (1<<7) ? " GP LED1 on\n" : "",
v & (1<<6) ? " GP LED1 enable\n" : "",
v & (1<<5) ? " Receive watchdog release\n" : "",
v & (1<<4) ? " Receive watchdog disable\n" : "",
v & (1<<3) ? "AUI" : "BNC",
v & (1<<2) ? " Jabber clock\n" : "",
v & (1<<1) ? " Host unjab\n" : "",
v & (1<<0) ? " Jabber disable\n" : "");
}
int
de2104x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
{
unsigned int de21040 = regs->version & 1;
if (de21040)
de21040_dump_regs(info, regs);
else
de21041_dump_regs(info, regs);
return 0;
}
|