From eb4ede2859a70492462118fc8491cbea61cb2f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20G=C3=BCnther?= Date: Sat, 19 Dec 2009 20:34:50 +0000 Subject: [PATCH] * Adding the glue.c file needed to make the aironetwifi linking. The driver is not tested, though, as I don't own the hardware. * Note: This wifi driver is special, as it doesn't require the FBSD_WLAN flag set in the glue.c. This is due to the driver making little use of the wlan stack. Thus no initialization of wlan stuff is needed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34710 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../drivers/network/wlan/aironetwifi/Jamfile | 1 + .../drivers/network/wlan/aironetwifi/glue.c | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/add-ons/kernel/drivers/network/wlan/aironetwifi/glue.c diff --git a/src/add-ons/kernel/drivers/network/wlan/aironetwifi/Jamfile b/src/add-ons/kernel/drivers/network/wlan/aironetwifi/Jamfile index 559ca9397c..2012a6c0c0 100644 --- a/src/add-ons/kernel/drivers/network/wlan/aironetwifi/Jamfile +++ b/src/add-ons/kernel/drivers/network/wlan/aironetwifi/Jamfile @@ -21,6 +21,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) dev an ] ; KernelAddon aironetwifi : if_an.c if_an_pci.c + glue.c : libfreebsd_wlan.a libfreebsd_network.a diff --git a/src/add-ons/kernel/drivers/network/wlan/aironetwifi/glue.c b/src/add-ons/kernel/drivers/network/wlan/aironetwifi/glue.c new file mode 100644 index 0000000000..f1720a23db --- /dev/null +++ b/src/add-ons/kernel/drivers/network/wlan/aironetwifi/glue.c @@ -0,0 +1,45 @@ +/* + * Copyright 2009, Colin Günther, coling@gmx.de. + * All Rights Reserved. Distributed under the terms of the MIT License. + */ + + +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + + +// Netgraph function variables. +void (*ng_ether_attach_p)(struct ifnet *ifp) = NULL; +void (*ng_ether_detach_p)(struct ifnet *ifp) = NULL; + + +HAIKU_FBSD_WLAN_DRIVER_GLUE(aironetwifi, an, pci) +NO_HAIKU_FBSD_MII_DRIVER(); +NO_HAIKU_REENABLE_INTERRUPTS(); +HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES); + + +int +HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev) +{ + struct an_softc* sc = (struct an_softc*)device_get_softc(dev); + + if (sc->an_gone) + return 0; + + /* Disable interrupts. */ + CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0); + + return 1; +}