From 6ea748c0f11c2ea589d47d6077ea3aa18430ed71 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Mon, 29 Mar 2004 02:15:29 +0000 Subject: [PATCH] Add missing cprd_flags member to partial resource structure in resource_var.h. In kern_ndis.c:ndis_convert_res(), fill in the cprd_flags and cprd_sharedisp fields as best we can. In if_ndis.c:ndis_setmulti(), don't bother updating the multicast filter if our multicast address list is empty. Add some missing updates to ndis_var.h and ntoskrnl_var.h that I forgot to check in when I added the KeDpc stuff. --- sys/compat/ndis/kern_ndis.c | 10 ++++++++++ sys/compat/ndis/ndis_var.h | 1 + sys/compat/ndis/ntoskrnl_var.h | 4 +++- sys/compat/ndis/resource_var.h | 1 + sys/dev/if_ndis/if_ndis.c | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index b59ba878e703..eb62ed85edc5 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -824,18 +824,28 @@ ndis_convert_res(arg) switch (brle->type) { case SYS_RES_IOPORT: prd->cprd_type = CmResourceTypePort; + prd->cprd_flags = CM_RESOURCE_PORT_IO; + prd->cprd_sharedisp = + CmResourceShareDeviceExclusive; prd->u.cprd_port.cprd_start.np_quad = brle->start; prd->u.cprd_port.cprd_len = brle->count; break; case SYS_RES_MEMORY: prd->cprd_type = CmResourceTypeMemory; + prd->cprd_flags = + CM_RESOURCE_MEMORY_READ_WRITE; + prd->cprd_sharedisp = + CmResourceShareDeviceExclusive; prd->u.cprd_port.cprd_start.np_quad = brle->start; prd->u.cprd_port.cprd_len = brle->count; break; case SYS_RES_IRQ: prd->cprd_type = CmResourceTypeInterrupt; + prd->cprd_flags = 0; + prd->cprd_sharedisp = + CmResourceShareDeviceExclusive; prd->u.cprd_intr.cprd_level = brle->start; prd->u.cprd_intr.cprd_vector = brle->start; prd->u.cprd_intr.cprd_affinity = 0; diff --git a/sys/compat/ndis/ndis_var.h b/sys/compat/ndis/ndis_var.h index 47106d5ce1f9..3c3de043e90f 100644 --- a/sys/compat/ndis/ndis_var.h +++ b/sys/compat/ndis/ndis_var.h @@ -1512,6 +1512,7 @@ extern int ndis_create_sysctls(void *); extern int ndis_add_sysctl(void *, char *, char *, char *, int); extern int ndis_flush_sysctls(void *); extern int ndis_sched(void (*)(void *), void *, int); +extern int ndis_unsched(void (*)(void *), void *, int); __END_DECLS #endif /* _NDIS_VAR_H_ */ diff --git a/sys/compat/ndis/ntoskrnl_var.h b/sys/compat/ndis/ntoskrnl_var.h index ccd92593f50a..a6d2d80fbfbf 100644 --- a/sys/compat/ndis/ntoskrnl_var.h +++ b/sys/compat/ndis/ntoskrnl_var.h @@ -261,7 +261,7 @@ struct kdpc { void *k_deferredctx; void *k_sysarg1; void *k_sysarg2; - uint32_t *k_lock; + register_t k_lock; }; typedef struct kdpc kdpc; @@ -480,6 +480,8 @@ __BEGIN_DECLS extern int ntoskrnl_libinit(void); extern int ntoskrnl_libfini(void); __stdcall extern void ntoskrnl_init_dpc(kdpc *, void *, void *); +__stdcall extern uint8_t ntoskrnl_queue_dpc(kdpc *, void *, void *); +__stdcall extern uint8_t ntoskrnl_dequeue_dpc(kdpc *); __stdcall extern void ntoskrnl_init_timer(ktimer *); __stdcall extern void ntoskrnl_init_timer_ex(ktimer *, uint32_t); __stdcall extern uint8_t ntoskrnl_set_timer(ktimer *, int64_t, kdpc *); diff --git a/sys/compat/ndis/resource_var.h b/sys/compat/ndis/resource_var.h index 079193bf351c..9386052ccab8 100644 --- a/sys/compat/ndis/resource_var.h +++ b/sys/compat/ndis/resource_var.h @@ -97,6 +97,7 @@ typedef enum cm_share_disposition cm_share_disposition; struct cm_partial_resource_desc { uint8_t cprd_type; uint8_t cprd_sharedisp; + uint16_t cprd_flags; union { struct { physaddr cprd_start; diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 2d5f0c6c1a73..ddb7c50cae68 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -153,6 +153,8 @@ ndis_setmulti(sc) return; } + if (TAILQ_EMPTY(&ifp->if_multiaddrs)) + return; len = sizeof(mclistsz); ndis_get_info(sc, OID_802_3_MAXIMUM_LIST_SIZE, &mclistsz, &len);