Deleted Added
full compact
if_sf.c (115529) if_sf.c (117208)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

73 * PCI memory mapped mode, the entire register space can be accessed
74 * directly. However in I/O space mode, only 256 bytes are directly
75 * mapped into PCI I/O space. The other registers can be accessed
76 * indirectly using the SF_INDIRECTIO_ADDR and SF_INDIRECTIO_DATA
77 * registers inside the 256-byte I/O window.
78 */
79
80#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

73 * PCI memory mapped mode, the entire register space can be accessed
74 * directly. However in I/O space mode, only 256 bytes are directly
75 * mapped into PCI I/O space. The other registers can be accessed
76 * indirectly using the SF_INDIRECTIO_ADDR and SF_INDIRECTIO_DATA
77 * registers inside the 256-byte I/O window.
78 */
79
80#include <sys/cdefs.h>
81__FBSDID("$FreeBSD: head/sys/dev/sf/if_sf.c 115529 2003-05-31 19:59:29Z phk $");
81__FBSDID("$FreeBSD: head/sys/dev/sf/if_sf.c 117208 2003-07-03 21:39:53Z imp $");
82
83#include <sys/param.h>
84#include <sys/systm.h>
85#include <sys/sockio.h>
86#include <sys/mbuf.h>
87#include <sys/malloc.h>
88#include <sys/kernel.h>
89#include <sys/socket.h>

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

671 struct ifnet *ifp;
672 int unit, rid, error = 0;
673
674 sc = device_get_softc(dev);
675 unit = device_get_unit(dev);
676
677 mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
678 MTX_DEF | MTX_RECURSE);
82
83#include <sys/param.h>
84#include <sys/systm.h>
85#include <sys/sockio.h>
86#include <sys/mbuf.h>
87#include <sys/malloc.h>
88#include <sys/kernel.h>
89#include <sys/socket.h>

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

671 struct ifnet *ifp;
672 int unit, rid, error = 0;
673
674 sc = device_get_softc(dev);
675 unit = device_get_unit(dev);
676
677 mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
678 MTX_DEF | MTX_RECURSE);
679
679#ifndef BURN_BRIDGES
680 /*
681 * Handle power management nonsense.
682 */
683 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
684 u_int32_t iobase, membase, irq;
685
686 /* Save important PCI config data. */
687 iobase = pci_read_config(dev, SF_PCI_LOIO, 4);

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

694 pci_get_powerstate(dev));
695 pci_set_powerstate(dev, PCI_POWERSTATE_D0);
696
697 /* Restore PCI config data. */
698 pci_write_config(dev, SF_PCI_LOIO, iobase, 4);
699 pci_write_config(dev, SF_PCI_LOMEM, membase, 4);
700 pci_write_config(dev, SF_PCI_INTLINE, irq, 4);
701 }
680 /*
681 * Handle power management nonsense.
682 */
683 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
684 u_int32_t iobase, membase, irq;
685
686 /* Save important PCI config data. */
687 iobase = pci_read_config(dev, SF_PCI_LOIO, 4);

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

694 pci_get_powerstate(dev));
695 pci_set_powerstate(dev, PCI_POWERSTATE_D0);
696
697 /* Restore PCI config data. */
698 pci_write_config(dev, SF_PCI_LOIO, iobase, 4);
699 pci_write_config(dev, SF_PCI_LOMEM, membase, 4);
700 pci_write_config(dev, SF_PCI_INTLINE, irq, 4);
701 }
702
702#endif
703 /*
704 * Map control/status registers.
705 */
706 pci_enable_busmaster(dev);
707
708 rid = SF_RID;
709 sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid,
710 0, ~0, 1, RF_ACTIVE);

--- 828 unchanged lines hidden ---
703 /*
704 * Map control/status registers.
705 */
706 pci_enable_busmaster(dev);
707
708 rid = SF_RID;
709 sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid,
710 0, ~0, 1, RF_ACTIVE);

--- 828 unchanged lines hidden ---