Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in
newer Ralink drivers. Submitted by: Paul B Mahol <onemda at gmail.com>
This commit is contained in:
parent
518c824362
commit
5f5ca78b03
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216242
@ -433,6 +433,19 @@ ndis_flush_sysctls(arg)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
ndis_get_routine_address(functbl, name)
|
||||||
|
struct image_patch_table *functbl;
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; functbl[i].ipt_name != NULL; i++)
|
||||||
|
if (strcmp(name, functbl[i].ipt_name) == 0)
|
||||||
|
return (functbl[i].ipt_wrap);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ndis_return(dobj, arg)
|
ndis_return(dobj, arg)
|
||||||
device_object *dobj;
|
device_object *dobj;
|
||||||
|
@ -1729,6 +1729,7 @@ extern int ndis_mtop(struct mbuf *, ndis_packet **);
|
|||||||
extern int ndis_ptom(struct mbuf **, ndis_packet *);
|
extern int ndis_ptom(struct mbuf **, ndis_packet *);
|
||||||
extern int ndis_get_info(void *, ndis_oid, void *, int *);
|
extern int ndis_get_info(void *, ndis_oid, void *, int *);
|
||||||
extern int ndis_set_info(void *, ndis_oid, void *, int *);
|
extern int ndis_set_info(void *, ndis_oid, void *, int *);
|
||||||
|
extern void *ndis_get_routine_address(struct image_patch_table *, char *);
|
||||||
extern int ndis_get_supported_oids(void *, ndis_oid **, int *);
|
extern int ndis_get_supported_oids(void *, ndis_oid **, int *);
|
||||||
extern int ndis_send_packets(void *, ndis_packet **, int);
|
extern int ndis_send_packets(void *, ndis_packet **, int);
|
||||||
extern int ndis_send_packet(void *, ndis_packet *);
|
extern int ndis_send_packet(void *, ndis_packet *);
|
||||||
|
@ -1466,6 +1466,7 @@ extern uint32_t IoConnectInterrupt(kinterrupt **, void *, void *,
|
|||||||
kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t,
|
kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t,
|
||||||
uint32_t, uint8_t);
|
uint32_t, uint8_t);
|
||||||
extern uint8_t MmIsAddressValid(void *);
|
extern uint8_t MmIsAddressValid(void *);
|
||||||
|
extern void *MmGetSystemRoutineAddress(unicode_string *);
|
||||||
extern void *MmMapIoSpace(uint64_t, uint32_t, uint32_t);
|
extern void *MmMapIoSpace(uint64_t, uint32_t, uint32_t);
|
||||||
extern void MmUnmapIoSpace(void *, size_t);
|
extern void MmUnmapIoSpace(void *, size_t);
|
||||||
extern void MmBuildMdlForNonPagedPool(mdl *);
|
extern void MmBuildMdlForNonPagedPool(mdl *);
|
||||||
|
@ -197,6 +197,7 @@ static ndis_status NdisMMapIoSpace(void **, ndis_handle,
|
|||||||
ndis_physaddr, uint32_t);
|
ndis_physaddr, uint32_t);
|
||||||
static void NdisMUnmapIoSpace(ndis_handle, void *, uint32_t);
|
static void NdisMUnmapIoSpace(ndis_handle, void *, uint32_t);
|
||||||
static uint32_t NdisGetCacheFillSize(void);
|
static uint32_t NdisGetCacheFillSize(void);
|
||||||
|
static void *NdisGetRoutineAddress(unicode_string *);
|
||||||
static uint32_t NdisMGetDmaAlignment(ndis_handle);
|
static uint32_t NdisMGetDmaAlignment(ndis_handle);
|
||||||
static ndis_status NdisMInitializeScatterGatherDma(ndis_handle,
|
static ndis_status NdisMInitializeScatterGatherDma(ndis_handle,
|
||||||
uint8_t, uint32_t);
|
uint8_t, uint32_t);
|
||||||
@ -1642,6 +1643,17 @@ NdisGetCacheFillSize(void)
|
|||||||
return (128);
|
return (128);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
NdisGetRoutineAddress(ustr)
|
||||||
|
unicode_string *ustr;
|
||||||
|
{
|
||||||
|
ansi_string astr;
|
||||||
|
|
||||||
|
if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE))
|
||||||
|
return (NULL);
|
||||||
|
return (ndis_get_routine_address(ndis_functbl, astr.as_buf));
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
NdisMGetDmaAlignment(handle)
|
NdisMGetDmaAlignment(handle)
|
||||||
ndis_handle handle;
|
ndis_handle handle;
|
||||||
@ -3246,6 +3258,7 @@ image_patch_table ndis_functbl[] = {
|
|||||||
IMPORT_SFUNC(NdisInitializeString, 2),
|
IMPORT_SFUNC(NdisInitializeString, 2),
|
||||||
IMPORT_SFUNC(NdisFreeString, 1),
|
IMPORT_SFUNC(NdisFreeString, 1),
|
||||||
IMPORT_SFUNC(NdisGetCurrentSystemTime, 1),
|
IMPORT_SFUNC(NdisGetCurrentSystemTime, 1),
|
||||||
|
IMPORT_SFUNC(NdisGetRoutineAddress, 1),
|
||||||
IMPORT_SFUNC(NdisGetSystemUpTime, 1),
|
IMPORT_SFUNC(NdisGetSystemUpTime, 1),
|
||||||
IMPORT_SFUNC(NdisGetVersion, 0),
|
IMPORT_SFUNC(NdisGetVersion, 0),
|
||||||
IMPORT_SFUNC(NdisMSynchronizeWithInterrupt, 3),
|
IMPORT_SFUNC(NdisMSynchronizeWithInterrupt, 3),
|
||||||
|
@ -2589,6 +2589,17 @@ MmGetPhysicalAddress(void *base)
|
|||||||
return (pmap_extract(kernel_map->pmap, (vm_offset_t)base));
|
return (pmap_extract(kernel_map->pmap, (vm_offset_t)base));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
MmGetSystemRoutineAddress(ustr)
|
||||||
|
unicode_string *ustr;
|
||||||
|
{
|
||||||
|
ansi_string astr;
|
||||||
|
|
||||||
|
if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE))
|
||||||
|
return (NULL);
|
||||||
|
return (ndis_get_routine_address(ntoskrnl_functbl, astr.as_buf));
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
MmIsAddressValid(vaddr)
|
MmIsAddressValid(vaddr)
|
||||||
void *vaddr;
|
void *vaddr;
|
||||||
@ -4382,6 +4393,7 @@ image_patch_table ntoskrnl_functbl[] = {
|
|||||||
IMPORT_SFUNC(MmUnmapLockedPages, 2),
|
IMPORT_SFUNC(MmUnmapLockedPages, 2),
|
||||||
IMPORT_SFUNC(MmBuildMdlForNonPagedPool, 1),
|
IMPORT_SFUNC(MmBuildMdlForNonPagedPool, 1),
|
||||||
IMPORT_SFUNC(MmGetPhysicalAddress, 1),
|
IMPORT_SFUNC(MmGetPhysicalAddress, 1),
|
||||||
|
IMPORT_SFUNC(MmGetSystemRoutineAddress, 1),
|
||||||
IMPORT_SFUNC(MmIsAddressValid, 1),
|
IMPORT_SFUNC(MmIsAddressValid, 1),
|
||||||
IMPORT_SFUNC(MmMapIoSpace, 3 + 1),
|
IMPORT_SFUNC(MmMapIoSpace, 3 + 1),
|
||||||
IMPORT_SFUNC(MmUnmapIoSpace, 2),
|
IMPORT_SFUNC(MmUnmapIoSpace, 2),
|
||||||
|
Loading…
Reference in New Issue
Block a user