Deleted Added
full compact
if_bfe.c (195049) if_bfe.c (213893)
1/*-
2 * Copyright (c) 2003 Stuart Walsh<stu@ipng.org.uk>
3 * and Duncan Barclay<dmlb@dmlb.org>
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

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Stuart Walsh<stu@ipng.org.uk>
3 * and Duncan Barclay<dmlb@dmlb.org>
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

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/bfe/if_bfe.c 195049 2009-06-26 11:45:06Z rwatson $");
29__FBSDID("$FreeBSD: head/sys/dev/bfe/if_bfe.c 213893 2010-10-15 14:52:11Z marius $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/endian.h>
35#include <sys/kernel.h>
36#include <sys/malloc.h>
37#include <sys/mbuf.h>

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

500
501 bfe_get_config(sc);
502
503 /* Reset the chip and turn on the PHY */
504 BFE_LOCK(sc);
505 bfe_chip_reset(sc);
506 BFE_UNLOCK(sc);
507
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/endian.h>
35#include <sys/kernel.h>
36#include <sys/malloc.h>
37#include <sys/mbuf.h>

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

500
501 bfe_get_config(sc);
502
503 /* Reset the chip and turn on the PHY */
504 BFE_LOCK(sc);
505 bfe_chip_reset(sc);
506 BFE_UNLOCK(sc);
507
508 if (mii_phy_probe(dev, &sc->bfe_miibus,
509 bfe_ifmedia_upd, bfe_ifmedia_sts)) {
510 device_printf(dev, "MII without any PHY!\n");
511 error = ENXIO;
508 error = mii_attach(dev, &sc->bfe_miibus, ifp, bfe_ifmedia_upd,
509 bfe_ifmedia_sts, BMSR_DEFCAPMASK, sc->bfe_phyaddr, MII_OFFSET_ANY,
510 0);
511 if (error != 0) {
512 device_printf(dev, "attaching PHYs failed\n");
512 goto fail;
513 }
514
515 ether_ifattach(ifp, sc->bfe_enaddr);
516
517 /*
518 * Tell the upper layer(s) we support long frames.
519 */

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

626
627static int
628bfe_miibus_readreg(device_t dev, int phy, int reg)
629{
630 struct bfe_softc *sc;
631 u_int32_t ret;
632
633 sc = device_get_softc(dev);
513 goto fail;
514 }
515
516 ether_ifattach(ifp, sc->bfe_enaddr);
517
518 /*
519 * Tell the upper layer(s) we support long frames.
520 */

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

627
628static int
629bfe_miibus_readreg(device_t dev, int phy, int reg)
630{
631 struct bfe_softc *sc;
632 u_int32_t ret;
633
634 sc = device_get_softc(dev);
634 if (phy != sc->bfe_phyaddr)
635 return (0);
636 bfe_readphy(sc, reg, &ret);
637
638 return (ret);
639}
640
641static int
642bfe_miibus_writereg(device_t dev, int phy, int reg, int val)
643{
644 struct bfe_softc *sc;
645
646 sc = device_get_softc(dev);
635 bfe_readphy(sc, reg, &ret);
636
637 return (ret);
638}
639
640static int
641bfe_miibus_writereg(device_t dev, int phy, int reg, int val)
642{
643 struct bfe_softc *sc;
644
645 sc = device_get_softc(dev);
647 if (phy != sc->bfe_phyaddr)
648 return (0);
649 bfe_writephy(sc, reg, val);
650
651 return (0);
652}
653
654static void
655bfe_miibus_statchg(device_t dev)
656{

--- 1318 unchanged lines hidden ---
646 bfe_writephy(sc, reg, val);
647
648 return (0);
649}
650
651static void
652bfe_miibus_statchg(device_t dev)
653{

--- 1318 unchanged lines hidden ---