xref: /haiku/src/add-ons/kernel/drivers/network/ether/ipro100/glue.c (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1 /*
2  * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <sys/bus.h>
8 #include <sys/mutex.h>
9 #include <sys/rman.h>
10 #include <sys/systm.h>
11 
12 #include <machine/bus.h>
13 
14 #include <net/if.h>
15 #include <net/if_media.h>
16 
17 #include "if_fxpreg.h"
18 #include "if_fxpvar.h"
19 
20 
21 HAIKU_FBSD_DRIVER_GLUE(ipro100, fxp, pci)
22 
23 
24 int
25 __haiku_disable_interrupts(device_t dev)
26 {
27 	struct fxp_softc *sc = device_get_softc(dev);
28 
29 	// TODO: check interrupt status!
30 	CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
31 	return 1;
32 }
33 
34 
35 void
36 __haiku_reenable_interrupts(device_t dev)
37 {
38 	struct fxp_softc *sc = device_get_softc(dev);
39 
40 	CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0);
41 }
42 
43 
44 HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE);
45 HAIKU_FBSD_MII_DRIVER(inphy);
46