Deleted Added
full compact
if_alc.c (218141) if_alc.c (219902)
1/*-
2 * Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
3 * 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

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

23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28/* Driver for Atheros AR813x/AR815x PCIe Ethernet. */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
3 * 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

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

23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28/* Driver for Atheros AR813x/AR815x PCIe Ethernet. */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/alc/if_alc.c 218141 2011-01-31 20:00:43Z yongari $");
31__FBSDID("$FreeBSD: head/sys/dev/alc/if_alc.c 219902 2011-03-23 13:10:15Z jhb $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/malloc.h>

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

778
779 /* Set PHY address. */
780 sc->alc_phyaddr = ALC_PHY_ADDR;
781
782 /* Initialize DMA parameters. */
783 sc->alc_dma_rd_burst = 0;
784 sc->alc_dma_wr_burst = 0;
785 sc->alc_rcb = DMA_CFG_RCB_64;
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/malloc.h>

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

778
779 /* Set PHY address. */
780 sc->alc_phyaddr = ALC_PHY_ADDR;
781
782 /* Initialize DMA parameters. */
783 sc->alc_dma_rd_burst = 0;
784 sc->alc_dma_wr_burst = 0;
785 sc->alc_rcb = DMA_CFG_RCB_64;
786 if (pci_find_extcap(dev, PCIY_EXPRESS, &base) == 0) {
786 if (pci_find_cap(dev, PCIY_EXPRESS, &base) == 0) {
787 sc->alc_flags |= ALC_FLAG_PCIE;
788 sc->alc_expcap = base;
789 burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL);
790 sc->alc_dma_rd_burst =
791 (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12;
792 sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5;
793 if (bootverbose) {
794 device_printf(dev, "Read request size : %u bytes.\n",

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

958 ifp->if_ioctl = alc_ioctl;
959 ifp->if_start = alc_start;
960 ifp->if_init = alc_init;
961 ifp->if_snd.ifq_drv_maxlen = ALC_TX_RING_CNT - 1;
962 IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
963 IFQ_SET_READY(&ifp->if_snd);
964 ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4;
965 ifp->if_hwassist = ALC_CSUM_FEATURES | CSUM_TSO;
787 sc->alc_flags |= ALC_FLAG_PCIE;
788 sc->alc_expcap = base;
789 burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL);
790 sc->alc_dma_rd_burst =
791 (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12;
792 sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5;
793 if (bootverbose) {
794 device_printf(dev, "Read request size : %u bytes.\n",

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

958 ifp->if_ioctl = alc_ioctl;
959 ifp->if_start = alc_start;
960 ifp->if_init = alc_init;
961 ifp->if_snd.ifq_drv_maxlen = ALC_TX_RING_CNT - 1;
962 IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
963 IFQ_SET_READY(&ifp->if_snd);
964 ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4;
965 ifp->if_hwassist = ALC_CSUM_FEATURES | CSUM_TSO;
966 if (pci_find_extcap(dev, PCIY_PMG, &base) == 0) {
966 if (pci_find_cap(dev, PCIY_PMG, &base) == 0) {
967 ifp->if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST;
968 sc->alc_flags |= ALC_FLAG_PM;
969 sc->alc_pmcap = base;
970 }
971 ifp->if_capenable = ifp->if_capabilities;
972
973 /* Set up MII bus. */
974 error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange,

--- 2793 unchanged lines hidden ---
967 ifp->if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST;
968 sc->alc_flags |= ALC_FLAG_PM;
969 sc->alc_pmcap = base;
970 }
971 ifp->if_capenable = ifp->if_capabilities;
972
973 /* Set up MII bus. */
974 error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange,

--- 2793 unchanged lines hidden ---