1 | /*
|
---|
2 | * Copyright 2007, Hugo Santos. All Rights Reserved.
|
---|
3 | * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved.
|
---|
4 | * Distributed under the terms of the MIT License.
|
---|
5 | */
|
---|
6 |
|
---|
7 |
|
---|
8 | #include <sys/bus.h>
|
---|
9 | #include <sys/rman.h>
|
---|
10 | #include "if_skreg.h"
|
---|
11 |
|
---|
12 |
|
---|
13 | HAIKU_FBSD_DRIVER_GLUE(marvell_yukon_sk, skc, pci)
|
---|
14 |
|
---|
15 | extern driver_t *DRIVER_MODULE_NAME(e1000phy, miibus);
|
---|
16 | extern driver_t *DRIVER_MODULE_NAME(ukphy, miibus);
|
---|
17 | extern driver_t *DRIVER_MODULE_NAME(xmphy, miibus);
|
---|
18 |
|
---|
19 |
|
---|
20 | driver_t *
|
---|
21 | __haiku_select_miibus_driver(device_t dev)
|
---|
22 | {
|
---|
23 | driver_t *drivers[] = {
|
---|
24 | DRIVER_MODULE_NAME(xmphy, miibus),
|
---|
25 | DRIVER_MODULE_NAME(e1000phy, miibus),
|
---|
26 | DRIVER_MODULE_NAME(ukphy, miibus),
|
---|
27 | NULL
|
---|
28 | };
|
---|
29 |
|
---|
30 | return __haiku_probe_miibus(dev, drivers);
|
---|
31 | }
|
---|
32 |
|
---|
33 | int
|
---|
34 | __haiku_disable_interrupts(device_t dev)
|
---|
35 | {
|
---|
36 | struct sk_softc *sc = device_get_softc(dev);
|
---|
37 | u_int32_t status;
|
---|
38 |
|
---|
39 | status = CSR_READ_4(sc, SK_ISSR);
|
---|
40 | if (status == 0 || status == 0xffffffff || sc->sk_suspended)
|
---|
41 | return 0;
|
---|
42 |
|
---|
43 | if (sc->sk_if[0] != NULL)
|
---|
44 | sc->sk_intrmask &= ~SK_INTRS1;
|
---|
45 | if (sc->sk_if[1] != NULL)
|
---|
46 | sc->sk_intrmask &= ~SK_INTRS2;
|
---|
47 |
|
---|
48 | CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);
|
---|
49 |
|
---|
50 | return 1;
|
---|
51 | }
|
---|
52 |
|
---|
53 |
|
---|
54 | void
|
---|
55 | __haiku_reenable_interrupts(device_t dev)
|
---|
56 | {
|
---|
57 | struct sk_softc *sc = device_get_softc(dev);
|
---|
58 |
|
---|
59 | CSR_READ_4(sc, SK_ISSR);
|
---|
60 | if (sc->sk_if[0] != NULL)
|
---|
61 | sc->sk_intrmask |= SK_INTRS1;
|
---|
62 | if (sc->sk_if[1] != NULL)
|
---|
63 | sc->sk_intrmask |= SK_INTRS2;
|
---|
64 |
|
---|
65 | // sc->sk_intrmask |= SK_ISR_EXTERNAL_REG;
|
---|
66 |
|
---|
67 | CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);
|
---|
68 | }
|
---|
69 |
|
---|
70 | HAIKU_DRIVER_REQUIREMENTS(0 /*FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE | FBSD_SWI_TASKQUEUE*/);
|
---|
71 |
|
---|