if_fatm.c (243857) | if_fatm.c (254263) |
---|---|
1/*- 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * 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 * SUCH DAMAGE. 26 * 27 * Author: Hartmut Brandt <harti@freebsd.org> 28 * 29 * Fore PCA200E driver for NATM 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * 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 * SUCH DAMAGE. 26 * 27 * Author: Hartmut Brandt <harti@freebsd.org> 28 * 29 * Fore PCA200E driver for NATM 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/fatm/if_fatm.c 243857 2012-12-04 09:32:43Z glebius $"); | 33__FBSDID("$FreeBSD: head/sys/dev/fatm/if_fatm.c 254263 2013-08-12 23:30:01Z scottl $"); |
34 35#include "opt_inet.h" 36#include "opt_natm.h" 37 38#include <sys/types.h> 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 2782 unchanged lines hidden (view full) --- 2824 ifp->if_flags = IFF_SIMPLEX; 2825 ifp->if_ioctl = fatm_ioctl; 2826 ifp->if_start = fatm_start; 2827 ifp->if_init = fatm_init; 2828 ifp->if_linkmib = &IFP2IFATM(sc->ifp)->mib; 2829 ifp->if_linkmiblen = sizeof(IFP2IFATM(sc->ifp)->mib); 2830 2831 /* | 34 35#include "opt_inet.h" 36#include "opt_natm.h" 37 38#include <sys/types.h> 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 2782 unchanged lines hidden (view full) --- 2824 ifp->if_flags = IFF_SIMPLEX; 2825 ifp->if_ioctl = fatm_ioctl; 2826 ifp->if_start = fatm_start; 2827 ifp->if_init = fatm_init; 2828 ifp->if_linkmib = &IFP2IFATM(sc->ifp)->mib; 2829 ifp->if_linkmiblen = sizeof(IFP2IFATM(sc->ifp)->mib); 2830 2831 /* |
2832 * Enable memory and bustmaster | 2832 * Enable busmaster |
2833 */ | 2833 */ |
2834 cfg = pci_read_config(dev, PCIR_COMMAND, 2); 2835 cfg |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; 2836 pci_write_config(dev, PCIR_COMMAND, cfg, 2); | 2834 pci_enable_busmaster(dev); |
2837 2838 /* 2839 * Map memory 2840 */ | 2835 2836 /* 2837 * Map memory 2838 */ |
2841 cfg = pci_read_config(dev, PCIR_COMMAND, 2); 2842 if (!(cfg & PCIM_CMD_MEMEN)) { 2843 if_printf(ifp, "failed to enable memory mapping\n"); 2844 error = ENXIO; 2845 goto fail; 2846 } | |
2847 sc->memid = 0x10; 2848 sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, 2849 RF_ACTIVE); 2850 if (sc->memres == NULL) { 2851 if_printf(ifp, "could not map memory\n"); 2852 error = ENXIO; 2853 goto fail; 2854 } --- 244 unchanged lines hidden --- | 2839 sc->memid = 0x10; 2840 sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, 2841 RF_ACTIVE); 2842 if (sc->memres == NULL) { 2843 if_printf(ifp, "could not map memory\n"); 2844 error = ENXIO; 2845 goto fail; 2846 } --- 244 unchanged lines hidden --- |