if_ie.c (36735) | if_ie.c (37618) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993, University of Vermont and State 3 * Agricultural College. 4 * Copyright (c) 1992, 1993, Garrett A. Wollman. 5 * 6 * Portions: 7 * Copyright (c) 1990, 1991, William F. Jolitz 8 * Copyright (c) 1990, The Regents of the University of California --- 33 unchanged lines hidden (view full) --- 42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 48 * SUCH DAMAGE. 49 * | 1/*- 2 * Copyright (c) 1992, 1993, University of Vermont and State 3 * Agricultural College. 4 * Copyright (c) 1992, 1993, Garrett A. Wollman. 5 * 6 * Portions: 7 * Copyright (c) 1990, 1991, William F. Jolitz 8 * Copyright (c) 1990, The Regents of the University of California --- 33 unchanged lines hidden (view full) --- 42 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 43 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 44 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 48 * SUCH DAMAGE. 49 * |
50 * $Id: if_ie.c,v 1.52 1998/04/15 17:45:20 bde Exp $ | 50 * $Id: if_ie.c,v 1.53 1998/06/07 17:10:32 dfr Exp $ |
51 */ 52 53/* 54 * Intel 82586 Ethernet chip 55 * Register, bit, and structure definitions. 56 * 57 * Written by GAW with reference to the Clarkson Packet Driver code for this 58 * chip written by Russ Nelson and others. --- 589 unchanged lines hidden (view full) --- 648 break; 649 default: 650 bd_maddr = 0; 651 break; 652 } 653 dvp->id_msize = 0x8000; 654 if (kvtop(dvp->id_maddr) != bd_maddr) { 655 printf("ie%d: kernel configured maddr %lx " | 51 */ 52 53/* 54 * Intel 82586 Ethernet chip 55 * Register, bit, and structure definitions. 56 * 57 * Written by GAW with reference to the Clarkson Packet Driver code for this 58 * chip written by Russ Nelson and others. --- 589 unchanged lines hidden (view full) --- 648 break; 649 default: 650 bd_maddr = 0; 651 break; 652 } 653 dvp->id_msize = 0x8000; 654 if (kvtop(dvp->id_maddr) != bd_maddr) { 655 printf("ie%d: kernel configured maddr %lx " |
656 "doesn't match board configured maddr %x\n", | 656 "doesn't match board configured maddr %lx\n", |
657 unit, kvtop(dvp->id_maddr), bd_maddr); 658 } 659 sc->iomembot = dvp->id_maddr; 660 sc->iomem = 0; /* XXX some probes set this and some don't */ 661 sc->iosize = dvp->id_msize; 662 663 /* need to put the 586 in RESET while we access the eeprom. */ 664 outb(PORT + IEE16_ECTRL, IEE16_RESET_586); --- 25 unchanged lines hidden (view full) --- 690 printf("ie%d: mapped memory size %d not supported\n", unit, 691 dvp->id_msize); 692 return (0); 693 break; /* NOTREACHED */ 694 } 695 696 if ((kvtop(dvp->id_maddr) < 0xC0000) || 697 (kvtop(dvp->id_maddr) + sc->iosize > 0xF0000)) { | 657 unit, kvtop(dvp->id_maddr), bd_maddr); 658 } 659 sc->iomembot = dvp->id_maddr; 660 sc->iomem = 0; /* XXX some probes set this and some don't */ 661 sc->iosize = dvp->id_msize; 662 663 /* need to put the 586 in RESET while we access the eeprom. */ 664 outb(PORT + IEE16_ECTRL, IEE16_RESET_586); --- 25 unchanged lines hidden (view full) --- 690 printf("ie%d: mapped memory size %d not supported\n", unit, 691 dvp->id_msize); 692 return (0); 693 break; /* NOTREACHED */ 694 } 695 696 if ((kvtop(dvp->id_maddr) < 0xC0000) || 697 (kvtop(dvp->id_maddr) + sc->iosize > 0xF0000)) { |
698 printf("ie%d: mapped memory location %x out of range\n", unit, 699 dvp->id_maddr); | 698 printf("ie%d: mapped memory location %p out of range\n", unit, 699 (void *)dvp->id_maddr); |
700 return (0); 701 } 702 pg = (kvtop(dvp->id_maddr) & 0x3C000) >> 14; 703 adjust = IEE16_MCTRL_FMCS16 | (pg & 0x3) << 2; 704 decode = ((1 << (sc->iosize / 16384)) - 1) << pg; 705 edecode = ((~decode >> 4) & 0xF0) | (decode >> 8); 706 707 /* ZZZ This should be checked against eeprom location 6, low byte */ --- 20 unchanged lines hidden (view full) --- 728 * Always use the passed in IRQ, not the one in the EEPROM. 729 */ 730 irq = ee16_read_eeprom(sc, IEE16_EEPROM_CONFIG1); 731 irq = (irq & IEE16_EEPROM_IRQ) >> IEE16_EEPROM_IRQ_SHIFT; 732 irq = irq_translate[irq]; 733 if (dvp->id_irq > 0) { 734 if (irq != dvp->id_irq) { 735 printf("ie%d: WARNING: board configured " | 700 return (0); 701 } 702 pg = (kvtop(dvp->id_maddr) & 0x3C000) >> 14; 703 adjust = IEE16_MCTRL_FMCS16 | (pg & 0x3) << 2; 704 decode = ((1 << (sc->iosize / 16384)) - 1) << pg; 705 edecode = ((~decode >> 4) & 0xF0) | (decode >> 8); 706 707 /* ZZZ This should be checked against eeprom location 6, low byte */ --- 20 unchanged lines hidden (view full) --- 728 * Always use the passed in IRQ, not the one in the EEPROM. 729 */ 730 irq = ee16_read_eeprom(sc, IEE16_EEPROM_CONFIG1); 731 irq = (irq & IEE16_EEPROM_IRQ) >> IEE16_EEPROM_IRQ_SHIFT; 732 irq = irq_translate[irq]; 733 if (dvp->id_irq > 0) { 734 if (irq != dvp->id_irq) { 735 printf("ie%d: WARNING: board configured " |
736 "at irq %d, using %d\n", 737 dvp->id_unit, irq); | 736 "at irq %u, using %u\n", 737 dvp->id_unit, dvp->id_irq, irq); |
738 irq = dvp->id_unit; 739 } 740 } else { 741 dvp->id_irq = irq; 742 } 743 sc->irq_encoded = irq_encode[ffs(irq) - 1]; 744 745 /* --- 1663 unchanged lines hidden (view full) --- 2409 ie->want_mcsetup = 1; 2410} 2411 2412 2413#ifdef DEBUG 2414static void 2415print_rbd(volatile struct ie_recv_buf_desc * rbd) 2416{ | 738 irq = dvp->id_unit; 739 } 740 } else { 741 dvp->id_irq = irq; 742 } 743 sc->irq_encoded = irq_encode[ffs(irq) - 1]; 744 745 /* --- 1663 unchanged lines hidden (view full) --- 2409 ie->want_mcsetup = 1; 2410} 2411 2412 2413#ifdef DEBUG 2414static void 2415print_rbd(volatile struct ie_recv_buf_desc * rbd) 2416{ |
2417 printf("RBD at %08lx:\n" 2418 "actual %04x, next %04x, buffer %08x\n" | 2417 printf("RBD at %8p:\n" 2418 "actual %04x, next %04x, buffer %8p\n" |
2419 "length %04x, mbz %04x\n", | 2419 "length %04x, mbz %04x\n", |
2420 (unsigned long) rbd, 2421 rbd->ie_rbd_actual, rbd->ie_rbd_next, rbd->ie_rbd_buffer, | 2420 (void *) rbd, 2421 rbd->ie_rbd_actual, rbd->ie_rbd_next, 2422 (void *) rbd->ie_rbd_buffer, |
2422 rbd->ie_rbd_length, rbd->mbz); 2423} 2424 2425#endif /* DEBUG */ 2426#endif /* NIE > 0 */ | 2423 rbd->ie_rbd_length, rbd->mbz); 2424} 2425 2426#endif /* DEBUG */ 2427#endif /* NIE > 0 */ |