Deleted Added
full compact
if_pcn.c (93818) if_pcn.c (99165)
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 93818 2002-04-04 21:03:38Z jhb $
33 * $FreeBSD: head/sys/pci/if_pcn.c 99165 2002-06-30 22:16:22Z luigi $
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 93818 2002-04-04 21:03:38Z jhb $";
100 "$FreeBSD: head/sys/pci/if_pcn.c 99165 2002-06-30 22:16:22Z luigi $";
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" },

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

855 struct pcn_softc *sc;
856{
857 struct pcn_tx_desc *cur_tx = NULL;
858 struct ifnet *ifp;
859 u_int32_t idx;
860
861 ifp = &sc->arpcom.ac_if;
862
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" },

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

855 struct pcn_softc *sc;
856{
857 struct pcn_tx_desc *cur_tx = NULL;
858 struct ifnet *ifp;
859 u_int32_t idx;
860
861 ifp = &sc->arpcom.ac_if;
862
863 /* Clear the timeout timer. */
864 ifp->if_timer = 0;
865
866 /*
867 * Go through our tx list and free mbufs for those
868 * frames that have been transmitted.
869 */
870 idx = sc->pcn_cdata.pcn_tx_cons;
871 while (idx != sc->pcn_cdata.pcn_tx_prod) {
872 cur_tx = &sc->pcn_ldata->pcn_tx_list[idx];
873

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

894 ifp->if_opackets++;
895 if (sc->pcn_cdata.pcn_tx_chain[idx] != NULL) {
896 m_freem(sc->pcn_cdata.pcn_tx_chain[idx]);
897 sc->pcn_cdata.pcn_tx_chain[idx] = NULL;
898 }
899
900 sc->pcn_cdata.pcn_tx_cnt--;
901 PCN_INC(idx, PCN_TX_LIST_CNT);
863 /*
864 * Go through our tx list and free mbufs for those
865 * frames that have been transmitted.
866 */
867 idx = sc->pcn_cdata.pcn_tx_cons;
868 while (idx != sc->pcn_cdata.pcn_tx_prod) {
869 cur_tx = &sc->pcn_ldata->pcn_tx_list[idx];
870

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

891 ifp->if_opackets++;
892 if (sc->pcn_cdata.pcn_tx_chain[idx] != NULL) {
893 m_freem(sc->pcn_cdata.pcn_tx_chain[idx]);
894 sc->pcn_cdata.pcn_tx_chain[idx] = NULL;
895 }
896
897 sc->pcn_cdata.pcn_tx_cnt--;
898 PCN_INC(idx, PCN_TX_LIST_CNT);
902 ifp->if_timer = 0;
903 }
904
899 }
900
905 sc->pcn_cdata.pcn_tx_cons = idx;
906
907 if (cur_tx != NULL)
901 if (idx != sc->pcn_cdata.pcn_tx_cons) {
902 /* Some buffers have been freed. */
903 sc->pcn_cdata.pcn_tx_cons = idx;
908 ifp->if_flags &= ~IFF_OACTIVE;
904 ifp->if_flags &= ~IFF_OACTIVE;
905 }
906 ifp->if_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5;
909
910 return;
911}
912
913static void pcn_tick(xsc)
914 void *xsc;
915{
916 struct pcn_softc *sc;

--- 518 unchanged lines hidden ---
907
908 return;
909}
910
911static void pcn_tick(xsc)
912 void *xsc;
913{
914 struct pcn_softc *sc;

--- 518 unchanged lines hidden ---