Deleted Added
sdiff udiff text old ( 192726 ) new ( 192727 )
full compact
1/******************************************************************************
2 *
3 * Name : sky2.c
4 * Project: Gigabit Ethernet Driver for FreeBSD 5.x/6.x
5 * Version: $Revision: 1.23 $
6 * Date : $Date: 2005/12/22 09:04:11 $
7 * Purpose: Main driver source file
8 *

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

94
95/*
96 * Device driver for the Marvell Yukon II Ethernet controller.
97 * Due to lack of documentation, this driver is based on the code from
98 * sk(4) and Marvell's myk(4) driver for FreeBSD 5.x.
99 */
100
101#include <sys/cdefs.h>
102__FBSDID("$FreeBSD: head/sys/dev/msk/if_msk.c 192726 2009-05-25 06:09:18Z yongari $");
103
104#include <sys/param.h>
105#include <sys/systm.h>
106#include <sys/bus.h>
107#include <sys/endian.h>
108#include <sys/mbuf.h>
109#include <sys/malloc.h>
110#include <sys/kernel.h>

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

470 MSK_IF_LOCK_ASSERT(sc_if);
471
472 mii = device_get_softc(sc_if->msk_miibus);
473 ifp = sc_if->msk_ifp;
474 if (mii == NULL || ifp == NULL ||
475 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
476 return;
477
478 if (mii->mii_media_status & IFM_ACTIVE) {
479 if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)
480 sc_if->msk_flags |= MSK_FLAG_LINK;
481 } else
482 sc_if->msk_flags &= ~MSK_FLAG_LINK;
483
484 if ((sc_if->msk_flags & MSK_FLAG_LINK) != 0) {
485 /* Enable Tx FIFO Underrun. */
486 CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_MSK),
487 GM_IS_TX_FF_UR | GM_IS_RX_FF_OR);
488 /*
489 * Because mii(4) notify msk(4) that it detected link status
490 * change, there is no need to enable automatic

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

533 } else {
534 /*
535 * Link state changed to down.
536 * Disable PHY interrupts.
537 */
538 msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0);
539 /* Disable Rx/Tx MAC. */
540 gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL);
541 gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
542 GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac);
543 /* Read again to ensure writing. */
544 GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL);
545 }
546}
547
548static void
549msk_rxfilter(struct msk_if_softc *sc_if)
550{
551 struct msk_softc *sc;
552 struct ifnet *ifp;

--- 3696 unchanged lines hidden ---