Ok, let's try that again. MFC recent changes from -current, this time

to the right branch (interrupt handler API fixes, Ralink RT2500 deadlock
with wpa_supplicant).
This commit is contained in:
wpaul 2005-12-16 17:33:47 +00:00
parent c4cfae8744
commit 111400b259
3 changed files with 34 additions and 14 deletions

View File

@ -275,7 +275,7 @@ static uint8_t NdisSystemProcessorCount(void);
static void NdisMIndicateStatusComplete(ndis_handle);
static void NdisMIndicateStatus(ndis_handle, ndis_status,
void *, uint32_t);
static void ndis_intr(void *);
static uint8_t ndis_intr(kinterrupt *, void *);
static void ndis_intrhand(kdpc *, ndis_miniport_interrupt *, void *, void *);
static funcptr ndis_findwrap(funcptr);
static void NdisCopyFromPacketToPacket(ndis_packet *,
@ -1409,6 +1409,9 @@ NdisReadNetworkAddress(status, addr, addrlen, adapter)
#ifdef IFP2ENADDR
if (bcmp(IFP2ENADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
#elif __FreeBSD_version >= 700000
if (sc->ifp->if_addr == NULL ||
bcmp(IF_LLADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
#else
if (bcmp(sc->arpcom.ac_enaddr, empty, ETHER_ADDR_LEN) == 0)
#endif
@ -1416,6 +1419,8 @@ NdisReadNetworkAddress(status, addr, addrlen, adapter)
else {
#ifdef IFP2ENADDR
*addr = IFP2ENADDR(sc->ifp);
#elif __FreeBSD_version >= 700000
*addr = IF_LLADDR(sc->ifp);
#else
*addr = sc->arpcom.ac_enaddr;
#endif
@ -2321,22 +2326,21 @@ NdisMPciAssignResources(adapter, slot, list)
return (NDIS_STATUS_SUCCESS);
}
static void
ndis_intr(arg)
static uint8_t
ndis_intr(iobj, arg)
kinterrupt *iobj;
void *arg;
{
struct ndis_softc *sc;
struct ifnet *ifp;
int is_our_intr = 0;
uint8_t is_our_intr = FALSE;
int call_isr = 0;
ndis_miniport_interrupt *intr;
sc = arg;
ifp = sc->ifp;
intr = sc->ndis_block->nmb_interrupt;
if (intr == NULL || sc->ndis_block->nmb_miniportadapterctx == NULL)
return;
return(FALSE);
if (sc->ndis_block->nmb_interrupt->ni_isrreq == TRUE)
MSCALL3(intr->ni_isrfunc, &is_our_intr, &call_isr,
@ -2347,10 +2351,10 @@ ndis_intr(arg)
call_isr = 1;
}
if ((is_our_intr || call_isr))
if (call_isr)
IoRequestDpc(sc->ndis_block->nmb_deviceobj, NULL, sc);
return;
return(is_our_intr);
}
static void
@ -3512,7 +3516,7 @@ image_patch_table ndis_functbl[] = {
IMPORT_SFUNC(NdisMRegisterUnloadHandler, 2),
IMPORT_SFUNC(ndis_timercall, 4),
IMPORT_SFUNC(ndis_asyncmem_complete, 2),
IMPORT_SFUNC(ndis_intr, 1),
IMPORT_SFUNC(ndis_intr, 2),
IMPORT_SFUNC(ndis_intrhand, 4),
/*

View File

@ -234,6 +234,7 @@ static uint32_t WmiQueryTraceInformation(uint32_t, void *, uint32_t,
static uint32_t WmiTraceMessage(uint64_t, uint32_t, void *, uint16_t, ...);
static uint32_t IoWMIRegistrationControl(device_object *, uint32_t);
static void *ntoskrnl_memset(void *, int, size_t);
static void *ntoskrnl_memmove(void *, void *, size_t);
static char *ntoskrnl_strstr(char *, char *);
static int ntoskrnl_toupper(int);
static int ntoskrnl_tolower(int);
@ -423,6 +424,16 @@ ntoskrnl_memset(buf, ch, size)
return(memset(buf, ch, size));
}
static void *
ntoskrnl_memmove(dst, src, size)
void *src;
void *dst;
size_t size;
{
bcopy(src, dst, size);
return(dst);
}
static char *
ntoskrnl_strstr(s, find)
char *s, *find;
@ -1204,13 +1215,16 @@ ntoskrnl_intr(arg)
{
kinterrupt *iobj;
uint8_t irql;
uint8_t claimed;
list_entry *l;
KeAcquireSpinLock(&ntoskrnl_intlock, &irql);
l = ntoskrnl_intlist.nle_flink;
while (l != &ntoskrnl_intlist) {
iobj = CONTAINING_RECORD(l, kinterrupt, ki_list);
MSCALL1(iobj->ki_svcfunc, iobj->ki_svcctx);
claimed = MSCALL2(iobj->ki_svcfunc, iobj, iobj->ki_svcctx);
if (claimed == TRUE)
break;
l = l->nle_flink;
}
KeReleaseSpinLock(&ntoskrnl_intlock, irql);
@ -4139,7 +4153,7 @@ image_patch_table ntoskrnl_functbl[] = {
IMPORT_CFUNC_MAP(strstr, ntoskrnl_strstr, 0),
IMPORT_CFUNC_MAP(strchr, index, 0),
IMPORT_CFUNC(memcpy, 0),
IMPORT_CFUNC_MAP(memmove, ntoskrnl_memset, 0),
IMPORT_CFUNC_MAP(memmove, ntoskrnl_memmove, 0),
IMPORT_CFUNC_MAP(memset, ntoskrnl_memset, 0),
IMPORT_SFUNC(IoAllocateDriverObjectExtension, 4),
IMPORT_SFUNC(IoGetDriverObjectExtension, 2),

View File

@ -1129,11 +1129,13 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, hdrlen, lookahead, lookaheadlen, pktlen)
priv = (ndis_ethpriv *)&p->np_protocolreserved;
priv->nep_ctx = ctx;
KeAcquireSpinLock(&block->nmb_lock, &irql);
if (!NDIS_SERIALIZED(block))
KeAcquireSpinLock(&block->nmb_lock, &irql);
InsertTailList((&block->nmb_packetlist), (&p->np_list));
KeReleaseSpinLock(&block->nmb_lock, irql);
if (!NDIS_SERIALIZED(block))
KeReleaseSpinLock(&block->nmb_lock, irql);
return;
}