Deleted Added
full compact
if_bm.c (195049) if_bm.c (213893)
1/*-
2 * Copyright 2008 Nathan Whitehorn. All rights reserved.
3 * Copyright 2003 by Peter Grehan. All rights reserved.
4 * Copyright (C) 1998, 1999, 2000 Tsubai Masanari. 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:

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

31 */
32
33/*
34 * BMAC/BMAC+ Macio cell 10/100 ethernet driver
35 * The low-cost, low-feature Apple variant of the Sun HME
36 */
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright 2008 Nathan Whitehorn. All rights reserved.
3 * Copyright 2003 by Peter Grehan. All rights reserved.
4 * Copyright (C) 1998, 1999, 2000 Tsubai Masanari. 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:

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

31 */
32
33/*
34 * BMAC/BMAC+ Macio cell 10/100 ethernet driver
35 * The low-cost, low-feature Apple variant of the Sun HME
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/dev/bm/if_bm.c 195049 2009-06-26 11:45:06Z rwatson $");
39__FBSDID("$FreeBSD: head/sys/dev/bm/if_bm.c 213893 2010-10-15 14:52:11Z marius $");
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/sockio.h>
44#include <sys/endian.h>
45#include <sys/mbuf.h>
46#include <sys/module.h>
47#include <sys/malloc.h>

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

589 * Get the ethernet address from OpenFirmware
590 */
591 eaddr = sc->sc_enaddr;
592 OF_getprop(node, "local-mac-address", eaddr, ETHER_ADDR_LEN);
593
594 /* reset the adapter */
595 bm_chip_setup(sc);
596
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/sockio.h>
44#include <sys/endian.h>
45#include <sys/mbuf.h>
46#include <sys/module.h>
47#include <sys/malloc.h>

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

589 * Get the ethernet address from OpenFirmware
590 */
591 eaddr = sc->sc_enaddr;
592 OF_getprop(node, "local-mac-address", eaddr, ETHER_ADDR_LEN);
593
594 /* reset the adapter */
595 bm_chip_setup(sc);
596
597 /* setup MII */
598 error = mii_phy_probe(dev, &sc->sc_miibus, bm_ifmedia_upd,
599 bm_ifmedia_sts);
600 if (error != 0)
601 device_printf(dev,"PHY probe failed: %d\n", error);
597 /*
598 * Setup MII
599 * On Apple BMAC controllers, we end up in a weird state of
600 * partially-completed autonegotiation on boot. So we force
601 * autonegotation to try again.
602 */
603 error = mii_attach(dev, &sc->sc_miibus, ifp, bm_ifmedia_upd,
604 bm_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY,
605 MIIF_FORCEANEG);
606 if (error != 0) {
607 device_printf(dev, "attaching PHYs failed\n");
608 return (error);
609 }
602
603 sc->sc_mii = device_get_softc(sc->sc_miibus);
604
605 if_initname(ifp, device_get_name(sc->sc_dev),
606 device_get_unit(sc->sc_dev));
607 ifp->if_mtu = ETHERMTU;
608 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
609 ifp->if_start = bm_start;

--- 837 unchanged lines hidden ---
610
611 sc->sc_mii = device_get_softc(sc->sc_miibus);
612
613 if_initname(ifp, device_get_name(sc->sc_dev),
614 device_get_unit(sc->sc_dev));
615 ifp->if_mtu = ETHERMTU;
616 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
617 ifp->if_start = bm_start;

--- 837 unchanged lines hidden ---