| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_gmc.c,v 1.5 2012/07/22 14:32:50 matt Exp $ */ | | 1 | /* $NetBSD: if_gmc.c,v 1.6 2013/06/11 16:57:05 msaitoh Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2008 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Matt Thomas <matt@3am-software.com> | | 7 | * by Matt Thomas <matt@3am-software.com> |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -37,27 +37,27 @@ | | | @@ -37,27 +37,27 @@ |
37 | #include <sys/mbuf.h> | | 37 | #include <sys/mbuf.h> |
38 | | | 38 | |
39 | #include <sys/bus.h> | | 39 | #include <sys/bus.h> |
40 | #include <machine/intr.h> | | 40 | #include <machine/intr.h> |
41 | | | 41 | |
42 | #include <arm/gemini/gemini_reg.h> | | 42 | #include <arm/gemini/gemini_reg.h> |
43 | #include <arm/gemini/gemini_gmacreg.h> | | 43 | #include <arm/gemini/gemini_gmacreg.h> |
44 | #include <arm/gemini/gemini_gmacvar.h> | | 44 | #include <arm/gemini/gemini_gmacvar.h> |
45 | | | 45 | |
46 | #include <net/if.h> | | 46 | #include <net/if.h> |
47 | #include <net/if_ether.h> | | 47 | #include <net/if_ether.h> |
48 | #include <net/if_dl.h> | | 48 | #include <net/if_dl.h> |
49 | | | 49 | |
50 | __KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.5 2012/07/22 14:32:50 matt Exp $"); | | 50 | __KERNEL_RCSID(0, "$NetBSD: if_gmc.c,v 1.6 2013/06/11 16:57:05 msaitoh Exp $"); |
51 | | | 51 | |
52 | #define MAX_TXSEG 32 | | 52 | #define MAX_TXSEG 32 |
53 | | | 53 | |
54 | struct gmc_softc { | | 54 | struct gmc_softc { |
55 | device_t sc_dev; | | 55 | device_t sc_dev; |
56 | struct gmac_softc *sc_psc; | | 56 | struct gmac_softc *sc_psc; |
57 | struct gmc_softc *sc_sibling; | | 57 | struct gmc_softc *sc_sibling; |
58 | bus_dma_tag_t sc_dmat; | | 58 | bus_dma_tag_t sc_dmat; |
59 | bus_space_tag_t sc_iot; | | 59 | bus_space_tag_t sc_iot; |
60 | bus_space_handle_t sc_ioh; | | 60 | bus_space_handle_t sc_ioh; |
61 | bus_space_handle_t sc_dma_ioh; | | 61 | bus_space_handle_t sc_dma_ioh; |
62 | bus_space_handle_t sc_gmac_ioh; | | 62 | bus_space_handle_t sc_gmac_ioh; |
63 | struct ethercom sc_ec; | | 63 | struct ethercom sc_ec; |
| @@ -696,27 +696,27 @@ gmc_intr(void *arg) | | | @@ -696,27 +696,27 @@ gmc_intr(void *arg) |
696 | } | | 696 | } |
697 | if (status & INT4_TX_XOFF) { | | 697 | if (status & INT4_TX_XOFF) { |
698 | } | | 698 | } |
699 | if (status & INT4_RX_FIFO_OVRN) { | | 699 | if (status & INT4_RX_FIFO_OVRN) { |
700 | #if 0 | | 700 | #if 0 |
701 | if (sc->sc_psc->sc_swfree_min < MAX_RXMAPS) { | | 701 | if (sc->sc_psc->sc_swfree_min < MAX_RXMAPS) { |
702 | sc->sc_psc->sc_swfree_min++; | | 702 | sc->sc_psc->sc_swfree_min++; |
703 | gmac_swfree_min_update(psc); | | 703 | gmac_swfree_min_update(psc); |
704 | } | | 704 | } |
705 | #endif | | 705 | #endif |
706 | sc->sc_if.if_ierrors++; | | 706 | sc->sc_if.if_ierrors++; |
707 | } | | 707 | } |
708 | if (status & INT4_RGMII_STSCHG) { | | 708 | if (status & INT4_RGMII_STSCHG) { |
709 | mii_tick(&sc->sc_mii); | | 709 | mii_pollstat(&sc->sc_mii); |
710 | } | | 710 | } |
711 | bus_space_write_4(sc->sc_iot, sc->sc_ioh, GMAC_INT4_STATUS, status); | | 711 | bus_space_write_4(sc->sc_iot, sc->sc_ioh, GMAC_INT4_STATUS, status); |
712 | | | 712 | |
713 | if (do_ifstart) | | 713 | if (do_ifstart) |
714 | gmc_ifstart(&sc->sc_if); | | 714 | gmc_ifstart(&sc->sc_if); |
715 | | | 715 | |
716 | aprint_debug_dev(sc->sc_dev, "gmac_intr: sts=%#x/%#x/%#x/%#x/%#x\n", | | 716 | aprint_debug_dev(sc->sc_dev, "gmac_intr: sts=%#x/%#x/%#x/%#x/%#x\n", |
717 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT0_STATUS), | | 717 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT0_STATUS), |
718 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT1_STATUS), | | 718 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT1_STATUS), |
719 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT2_STATUS), | | 719 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT2_STATUS), |
720 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT3_STATUS), | | 720 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT3_STATUS), |
721 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT4_STATUS)); | | 721 | bus_space_read_4(sc->sc_iot, sc->sc_ioh, GMAC_INT4_STATUS)); |
722 | aprint_debug_dev(sc->sc_dev, "gmac_intr: exit rv=%d\n", rv); | | 722 | aprint_debug_dev(sc->sc_dev, "gmac_intr: exit rv=%d\n", rv); |