ralinkwifi: takes rt2860 into account, untested
* remove ralink2860 driver * added firmware for RT2860, get it onto the image * added interrupt handler case for rt2860 devices.
This commit is contained in:
@@ -170,7 +170,7 @@ SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
|
|||||||
aironetwifi atheroswifi broadcom43xx
|
aironetwifi atheroswifi broadcom43xx
|
||||||
iprowifi2100 iprowifi2200 iprowifi3945
|
iprowifi2100 iprowifi2200 iprowifi3945
|
||||||
iprowifi4965 marvell88w8363 marvell88w8335
|
iprowifi4965 marvell88w8363 marvell88w8335
|
||||||
ralink2860 ralinkwifi wavelanwifi
|
ralinkwifi wavelanwifi
|
||||||
}@ # x86
|
}@ # x86
|
||||||
|
|
||||||
# WWAN drivers
|
# WWAN drivers
|
||||||
|
|||||||
Binary file not shown.
@@ -26,7 +26,9 @@ KernelAddon ralinkwifi :
|
|||||||
libfreebsd_network.a
|
libfreebsd_network.a
|
||||||
;
|
;
|
||||||
|
|
||||||
HAIKU_WIFI_FIRMWARE_PACKAGE on ralinkwifi = RT61_Firmware_V1.2 ;
|
HAIKU_WIFI_FIRMWARE_PACKAGES on ralinkwifi = RT61_Firmware_V1.2
|
||||||
HAIKU_WIFI_FIRMWARE_ARCHIVE on ralinkwifi = RT61_Firmware_V1.2.zip ;
|
RT2860_Firmware_V26 ;
|
||||||
|
HAIKU_WIFI_FIRMWARE_ARCHIVES on ralinkwifi = RT61_Firmware_V1.2.zip
|
||||||
|
RT2860_Firmware_V26.zip ;
|
||||||
HAIKU_WIFI_FIRMWARE_DO_EXTRACT on ralinkwifi = true ;
|
HAIKU_WIFI_FIRMWARE_DO_EXTRACT on ralinkwifi = true ;
|
||||||
|
|
||||||
|
|||||||
@@ -1414,6 +1414,7 @@ rt2860_intr(void *arg)
|
|||||||
|
|
||||||
RAL_LOCK(sc);
|
RAL_LOCK(sc);
|
||||||
|
|
||||||
|
#ifndef __HAIKU__
|
||||||
r = RAL_READ(sc, RT2860_INT_STATUS);
|
r = RAL_READ(sc, RT2860_INT_STATUS);
|
||||||
if (__predict_false(r == 0xffffffff)) {
|
if (__predict_false(r == 0xffffffff)) {
|
||||||
RAL_UNLOCK(sc);
|
RAL_UNLOCK(sc);
|
||||||
@@ -1423,6 +1424,9 @@ rt2860_intr(void *arg)
|
|||||||
RAL_UNLOCK(sc);
|
RAL_UNLOCK(sc);
|
||||||
return; /* not for us */
|
return; /* not for us */
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
r = atomic_get((int32 *)&sc->sc_intr_status);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* acknowledge interrupts */
|
/* acknowledge interrupts */
|
||||||
RAL_WRITE(sc, RT2860_INT_STATUS, r);
|
RAL_WRITE(sc, RT2860_INT_STATUS, r);
|
||||||
|
|||||||
@@ -196,6 +196,10 @@ struct rt2860_softc {
|
|||||||
int sc_rxtap_len;
|
int sc_rxtap_len;
|
||||||
struct rt2860_tx_radiotap_header sc_txtap;
|
struct rt2860_tx_radiotap_header sc_txtap;
|
||||||
int sc_txtap_len;
|
int sc_txtap_len;
|
||||||
|
|
||||||
|
#if defined(__HAIKU__)
|
||||||
|
uint32_t sc_intr_status;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int rt2860_attach(device_t, int);
|
int rt2860_attach(device_t, int);
|
||||||
|
|||||||
@@ -19,13 +19,16 @@
|
|||||||
|
|
||||||
#include <dev/ral/rt2560reg.h>
|
#include <dev/ral/rt2560reg.h>
|
||||||
#include <dev/ral/rt2560var.h>
|
#include <dev/ral/rt2560var.h>
|
||||||
|
#include <dev/ral/rt2860reg.h>
|
||||||
|
#include <dev/ral/rt2860var.h>
|
||||||
|
|
||||||
|
|
||||||
HAIKU_FBSD_WLAN_DRIVER_GLUE(ralinkwifi, ral, pci)
|
HAIKU_FBSD_WLAN_DRIVER_GLUE(ralinkwifi, ral, pci)
|
||||||
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE | FBSD_WLAN);
|
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE | FBSD_WLAN);
|
||||||
HAIKU_FIRMWARE_VERSION(0);
|
HAIKU_FIRMWARE_VERSION(0);
|
||||||
HAIKU_FIRMWARE_NAME_MAP(3) = {{"rt2561fw", "rt2561.bin"},
|
HAIKU_FIRMWARE_NAME_MAP(4) = {{"rt2561fw", "rt2561.bin"},
|
||||||
{"rt2561sfw", "rt2561s.bin"}, {"rt2661fw", "rt2661.bin"}};
|
{"rt2561sfw", "rt2561s.bin"}, {"rt2661fw", "rt2661.bin"},
|
||||||
|
{"rt2860fw", "rt2860.bin"}};
|
||||||
|
|
||||||
NO_HAIKU_FBSD_MII_DRIVER();
|
NO_HAIKU_FBSD_MII_DRIVER();
|
||||||
NO_HAIKU_REENABLE_INTERRUPTS();
|
NO_HAIKU_REENABLE_INTERRUPTS();
|
||||||
@@ -39,21 +42,43 @@ int
|
|||||||
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
||||||
{
|
{
|
||||||
struct rt2560_softc* sc = (struct rt2560_softc*)device_get_softc(dev);
|
struct rt2560_softc* sc = (struct rt2560_softc*)device_get_softc(dev);
|
||||||
// assuming that rt2560 and rt2661 share a common context data structure
|
// sc_ifp is common between context data structures
|
||||||
struct ifnet* ifp = sc->sc_ifp;
|
struct ifnet* ifp = sc->sc_ifp;
|
||||||
|
|
||||||
if (pci_get_device(dev) == 0x0201) {
|
switch (pci_get_device(dev)) {
|
||||||
// disable interrupts
|
case 0x0201:
|
||||||
RAL_WRITE(sc, RT2560_CSR8, 0xffffffff);
|
// disable interrupts
|
||||||
} else {
|
RAL_WRITE(sc, RT2560_CSR8, 0xffffffff);
|
||||||
// disable MAC and MCU interrupts
|
|
||||||
RAL_WRITE(sc, RT2661_INT_MASK_CSR, 0xffffff7f);
|
|
||||||
RAL_WRITE(sc, RT2661_MCU_INT_MASK_CSR, 0xffffffff);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||||
// don't re-enable interrupts if we're shutting down
|
// don't re-enable interrupts if we're shutting down
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x0301:
|
||||||
|
case 0x0302:
|
||||||
|
case 0x0401:
|
||||||
|
// disable MAC and MCU interrupts
|
||||||
|
RAL_WRITE(sc, RT2661_INT_MASK_CSR, 0xffffff7f);
|
||||||
|
RAL_WRITE(sc, RT2661_MCU_INT_MASK_CSR, 0xffffffff);
|
||||||
|
|
||||||
|
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||||
|
// don't re-enable interrupts if we're shutting down
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
uint32 r;
|
||||||
|
struct rt2860_softc* sc =
|
||||||
|
(struct rt2860_softc*)device_get_softc(dev);
|
||||||
|
r = RAL_READ(sc, RT2860_INT_STATUS);
|
||||||
|
if (r == 0 || r == 0xffffffff)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
atomic_set((int32*)&sc->sc_intr_status, r);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user