Deleted Added
full compact
41c41
< __FBSDID("$FreeBSD: head/sys/dev/hme/if_hme.c 133688 2004-08-13 23:14:50Z rwatson $");
---
> __FBSDID("$FreeBSD: head/sys/dev/hme/if_hme.c 137982 2004-11-22 06:46:30Z yongari $");
101a102
> static void hme_start_locked(struct ifnet *);
106a108
> static void hme_init_locked(void *);
197a200
> HME_LOCK_ASSERT(sc, MA_NOTOWNED);
198a202
> HME_LOCK(sc);
199a204
> HME_UNLOCK(sc);
287,288c292
< ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
< IFF_NEEDSGIANT;
---
> ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
296a301
> HME_LOCK(sc);
297a303
> HME_UNLOCK(sc);
342c348
< callout_init(&sc->sc_tick_ch, 0);
---
> callout_init(&sc->sc_tick_ch, CALLOUT_MPSAFE);
375a382,383
> HME_LOCK_ASSERT(sc, MA_NOTOWNED);
>
376a385
> HME_LOCK(sc);
377a387
> HME_UNLOCK(sc);
402a413
> HME_LOCK(sc);
403a415
> HME_UNLOCK(sc);
410a423
> HME_LOCK(sc);
412c425,426
< hme_init(ifp);
---
> hme_init_locked(ifp);
> HME_UNLOCK(sc);
443a458
> HME_LOCK(sc);
445c460
< hme_init(sc);
---
> hme_init_locked(sc);
446a462
> HME_UNLOCK(sc);
673a690,699
>
> HME_LOCK(sc);
> hme_init_locked(sc);
> HME_UNLOCK(sc);
> }
>
> static void
> hme_init_locked(void *xsc)
> {
> struct hme_softc *sc = (struct hme_softc *)xsc;
677a704
> HME_LOCK_ASSERT(sc, MA_OWNED);
852c879,883
< /* mii_mediachg(sc->sc_mii); */
---
> /*
> * HME_UNLOCK(sc);
> * mii_mediachg(sc->sc_mii);
> * HME_LOCK(sc);
> */
860c891
< hme_start(ifp);
---
> hme_start_locked(ifp);
1061a1093
> HME_UNLOCK(sc);
1062a1095
> HME_LOCK(sc);
1067a1101,1110
> struct hme_softc *sc = ifp->if_softc;
>
> HME_LOCK(sc);
> hme_start_locked(ifp);
> HME_UNLOCK(sc);
> }
>
> static void
> hme_start_locked(struct ifnet *ifp)
> {
1176c1219
< hme_start(ifp);
---
> hme_start_locked(ifp);
1304a1348
> HME_LOCK(sc);
1315a1360
> HME_UNLOCK(sc);
1324a1370
> #endif
1325a1372,1373
> HME_LOCK(sc);
> #ifdef HMEDEBUG
1330a1379
> HME_UNLOCK(sc);
1342a1392,1393
> HME_LOCK_ASSERT(sc, MA_OWNED);
>
1358a1410
> HME_LOCK(sc);
1379c1431,1432
< if (v & HME_MIF_FO_TALSB)
---
> if (v & HME_MIF_FO_TALSB) {
> HME_UNLOCK(sc);
1380a1434
> }
1383a1438
> HME_UNLOCK(sc);
1393a1449
> HME_LOCK(sc);
1415c1471,1472
< if (v & HME_MIF_FO_TALSB)
---
> if (v & HME_MIF_FO_TALSB) {
> HME_UNLOCK(sc);
1416a1474
> }
1419a1478
> HME_UNLOCK(sc);
1427,1428c1486,1487
< int instance = IFM_INST(sc->sc_mii->mii_media.ifm_cur->ifm_media);
< int phy = sc->sc_phys[instance];
---
> int instance;
> int phy;
1430a1490,1492
> HME_LOCK(sc);
> instance = IFM_INST(sc->sc_mii->mii_media.ifm_cur->ifm_media);
> phy = sc->sc_phys[instance];
1445c1507,1508
< if (!hme_mac_bitflip(sc, HME_MACI_TXCFG, v, HME_MAC_TXCFG_ENABLE, 0))
---
> if (!hme_mac_bitflip(sc, HME_MACI_TXCFG, v, HME_MAC_TXCFG_ENABLE, 0)) {
> HME_UNLOCK(sc);
1446a1510
> }
1452c1516,1517
< if (!hme_mac_bitflip(sc, HME_MACI_TXCFG, v, 0, HME_MAC_TXCFG_ENABLE))
---
> if (!hme_mac_bitflip(sc, HME_MACI_TXCFG, v, 0, HME_MAC_TXCFG_ENABLE)) {
> HME_UNLOCK(sc);
1453a1519,1520
> }
> HME_UNLOCK(sc);
1469c1536,1538
< if ((ifp->if_flags & IFF_UP) == 0)
---
> HME_LOCK(sc);
> if ((ifp->if_flags & IFF_UP) == 0) {
> HME_UNLOCK(sc);
1470a1540
> }
1471a1542
> HME_UNLOCK(sc);
1472a1544
> HME_LOCK(sc);
1474a1547
> HME_UNLOCK(sc);
1486a1560
> HME_LOCK(sc);
1505c1579
< hme_init(sc);
---
> hme_init_locked(sc);
1511c1585
< hme_init(sc);
---
> hme_init_locked(sc);
1530a1605
> HME_UNLOCK(sc);
1531a1607
> HME_LOCK(sc);
1540a1617
> HME_UNLOCK(sc);
1541a1619
> HME_LOCK(sc);
1545a1624
> HME_UNLOCK(sc);
1560a1640
> HME_LOCK_ASSERT(sc, MA_OWNED);