Deleted Added
full compact
if_pcn.c (69067) if_pcn.c (69583)
1/*
2 * Copyright (c) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 *
1/*
2 * Copyright (c) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.com>. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/pci/if_pcn.c 69067 2000-11-23 00:28:43Z wpaul $
33 * $FreeBSD: head/sys/pci/if_pcn.c 69583 2000-12-04 22:46:50Z wpaul $
34 */
35
36/*
37 * AMD Am79c972 fast ethernet PCI NIC driver. Datatheets are available
38 * from http://www.amd.com.
39 *
40 * Written by Bill Paul <wpaul@osd.bsdi.com>
41 */

--- 50 unchanged lines hidden (view full) ---

92
93MODULE_DEPEND(pcn, miibus, 1, 1, 1);
94
95/* "controller miibus0" required. See GENERIC if you get errors here. */
96#include "miibus_if.h"
97
98#ifndef lint
99static const char rcsid[] =
34 */
35
36/*
37 * AMD Am79c972 fast ethernet PCI NIC driver. Datatheets are available
38 * from http://www.amd.com.
39 *
40 * Written by Bill Paul <wpaul@osd.bsdi.com>
41 */

--- 50 unchanged lines hidden (view full) ---

92
93MODULE_DEPEND(pcn, miibus, 1, 1, 1);
94
95/* "controller miibus0" required. See GENERIC if you get errors here. */
96#include "miibus_if.h"
97
98#ifndef lint
99static const char rcsid[] =
100 "$FreeBSD: head/sys/pci/if_pcn.c 69067 2000-11-23 00:28:43Z wpaul $";
100 "$FreeBSD: head/sys/pci/if_pcn.c 69583 2000-12-04 22:46:50Z wpaul $";
101#endif
102
103/*
104 * Various supported device vendors/types and their names.
105 */
106static struct pcn_type pcn_devs[] = {
107 { PCN_VENDORID, PCN_DEVICEID_PCNET, "AMD PCnet/PCI 10/100BaseTX" },
108 { PCN_VENDORID, PCN_DEVICEID_HOME, "AMD PCnet/Home HomePNA" },

--- 382 unchanged lines hidden (view full) ---

491 u_int32_t command;
492 struct pcn_softc *sc;
493 struct ifnet *ifp;
494 int unit, error = 0, rid;
495
496 sc = device_get_softc(dev);
497 unit = device_get_unit(dev);
498
101#endif
102
103/*
104 * Various supported device vendors/types and their names.
105 */
106static struct pcn_type pcn_devs[] = {
107 { PCN_VENDORID, PCN_DEVICEID_PCNET, "AMD PCnet/PCI 10/100BaseTX" },
108 { PCN_VENDORID, PCN_DEVICEID_HOME, "AMD PCnet/Home HomePNA" },

--- 382 unchanged lines hidden (view full) ---

491 u_int32_t command;
492 struct pcn_softc *sc;
493 struct ifnet *ifp;
494 int unit, error = 0, rid;
495
496 sc = device_get_softc(dev);
497 unit = device_get_unit(dev);
498
499 /* Initialize our mutex. */
500 mtx_init(&sc->pcn_mtx, device_get_nameunit(dev), MTX_DEF);
501 PCN_LOCK(sc);
502
499 /*
500 * Handle power management nonsense.
501 */
502
503 command = pci_read_config(dev, PCN_PCI_CAPID, 4) & 0x000000FF;
504 if (command == 0x01) {
505
506 command = pci_read_config(dev, PCN_PCI_PWRMGMTCTRL, 4);

--- 70 unchanged lines hidden (view full) ---

577
578 if (error) {
579 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->pcn_res);
580 bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res);
581 printf("pcn%d: couldn't set up irq\n", unit);
582 goto fail;
583 }
584
503 /*
504 * Handle power management nonsense.
505 */
506
507 command = pci_read_config(dev, PCN_PCI_CAPID, 4) & 0x000000FF;
508 if (command == 0x01) {
509
510 command = pci_read_config(dev, PCN_PCI_PWRMGMTCTRL, 4);

--- 70 unchanged lines hidden (view full) ---

581
582 if (error) {
583 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->pcn_res);
584 bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res);
585 printf("pcn%d: couldn't set up irq\n", unit);
586 goto fail;
587 }
588
585 /* Initialize our mutex. */
586 mtx_init(&sc->pcn_mtx, device_get_nameunit(dev), MTX_DEF);
587 PCN_LOCK(sc);
588
589 /* Reset the adapter. */
590 pcn_reset(sc);
591
592 /*
593 * Get station address from the EEPROM.
594 */
595 eaddr[0] = CSR_READ_4(sc, PCN_IO32_APROM00);
596 eaddr[1] = CSR_READ_4(sc, PCN_IO32_APROM01);

--- 841 unchanged lines hidden ---
589 /* Reset the adapter. */
590 pcn_reset(sc);
591
592 /*
593 * Get station address from the EEPROM.
594 */
595 eaddr[0] = CSR_READ_4(sc, PCN_IO32_APROM00);
596 eaddr[1] = CSR_READ_4(sc, PCN_IO32_APROM01);

--- 841 unchanged lines hidden ---