diff options
-rw-r--r-- | sys/compat/ndis/subr_hal.c | 84 | ||||
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 8 |
2 files changed, 91 insertions, 1 deletions
diff --git a/sys/compat/ndis/subr_hal.c b/sys/compat/ndis/subr_hal.c index 4c5313a..cc51c0a 100644 --- a/sys/compat/ndis/subr_hal.c +++ b/sys/compat/ndis/subr_hal.c @@ -59,12 +59,24 @@ __FBSDID("$FreeBSD$"); #define FUNC void(*)(void) __stdcall static void hal_stall_exec_cpu(uint32_t); +__stdcall static void hal_writeport_buf_ulong(uint32_t *, + uint32_t *, uint32_t); +__stdcall static void hal_writeport_buf_ushort(uint16_t *, + uint16_t *, uint32_t); +__stdcall static void hal_writeport_buf_uchar(uint8_t *, + uint8_t *, uint32_t); __stdcall static void hal_writeport_ulong(uint32_t *, uint32_t); __stdcall static void hal_writeport_ushort(uint16_t *, uint16_t); __stdcall static void hal_writeport_uchar(uint8_t *, uint8_t); __stdcall static uint32_t hal_readport_ulong(uint32_t *); __stdcall static uint16_t hal_readport_ushort(uint16_t *); __stdcall static uint8_t hal_readport_uchar(uint8_t *); +__stdcall static void hal_readport_buf_ulong(uint32_t *, + uint32_t *, uint32_t); +__stdcall static void hal_readport_buf_ushort(uint16_t *, + uint16_t *, uint32_t); +__stdcall static void hal_readport_buf_uchar(uint8_t *, + uint8_t *, uint32_t); __stdcall static uint8_t hal_lock(/*kspin_lock * */void); __stdcall static void hal_unlock(/*kspin_lock *, uint8_t*/void); __stdcall static uint8_t hal_irql(void); @@ -105,6 +117,39 @@ hal_writeport_uchar(port, val) return; } +__stdcall static void +hal_writeport_buf_ulong(port, val, cnt) + uint32_t *port; + uint32_t *val; + uint32_t cnt; +{ + bus_space_write_multi_4(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + +__stdcall static void +hal_writeport_buf_ushort(port, val, cnt) + uint16_t *port; + uint16_t *val; + uint32_t cnt; +{ + bus_space_write_multi_2(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + +__stdcall static void +hal_writeport_buf_uchar(port, val, cnt) + uint8_t *port; + uint8_t *val; + uint32_t cnt; +{ + bus_space_write_multi_1(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + __stdcall static uint16_t hal_readport_ushort(port) uint16_t *port; @@ -126,6 +171,39 @@ hal_readport_uchar(port) return(bus_space_read_1(I386_BUS_SPACE_IO, 0x0, (uint32_t)port)); } +__stdcall static void +hal_readport_buf_ulong(port, val, cnt) + uint32_t *port; + uint32_t *val; + uint32_t cnt; +{ + bus_space_read_multi_4(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + +__stdcall static void +hal_readport_buf_ushort(port, val, cnt) + uint16_t *port; + uint16_t *val; + uint32_t cnt; +{ + bus_space_read_multi_2(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + +__stdcall static void +hal_readport_buf_uchar(port, val, cnt) + uint8_t *port; + uint8_t *val; + uint32_t cnt; +{ + bus_space_read_multi_1(I386_BUS_SPACE_IO, 0x0, + (bus_size_t)port, val, cnt); + return; +} + __stdcall static uint8_t hal_lock(/*lock*/void) { @@ -167,9 +245,15 @@ image_patch_table hal_functbl[] = { { "WRITE_PORT_ULONG", (FUNC)hal_writeport_ulong }, { "WRITE_PORT_USHORT", (FUNC)hal_writeport_ushort }, { "WRITE_PORT_UCHAR", (FUNC)hal_writeport_uchar }, + { "WRITE_PORT_BUFFER_ULONG", (FUNC)hal_writeport_buf_ulong }, + { "WRITE_PORT_BUFFER_USHORT", (FUNC)hal_writeport_buf_ushort }, + { "WRITE_PORT_BUFFER_UCHAR", (FUNC)hal_writeport_buf_uchar }, { "READ_PORT_ULONG", (FUNC)hal_readport_ulong }, { "READ_PORT_USHORT", (FUNC)hal_readport_ushort }, { "READ_PORT_UCHAR", (FUNC)hal_readport_uchar }, + { "READ_PORT_BUFFER_ULONG", (FUNC)hal_readport_buf_ulong }, + { "READ_PORT_BUFFER_USHORT", (FUNC)hal_readport_buf_ushort }, + { "READ_PORT_BUFFER_UCHAR", (FUNC)hal_readport_buf_uchar }, { "KfAcquireSpinLock", (FUNC)hal_lock }, { "KfReleaseSpinLock", (FUNC)hal_unlock }, { "KeGetCurrentIrql", (FUNC)hal_irql }, diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index a396a7e..78aa6f1 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1001,7 +1001,11 @@ ndis_cancel_timer(timer, cancelled) { struct callout *ch; + if (timer == NULL) + return; ch = timer->nmt_dpc.nk_deferredctx; + if (ch == NULL) + return; callout_stop(ch); *cancelled = timer->nmt_ktimer.nk_header.dh_sigstate; @@ -1102,7 +1106,7 @@ ndis_mapreg_cnt(bustype, cnt) uint32_t bustype; uint32_t *cnt; { - *cnt = 64; + *cnt = 8192; return(NDIS_STATUS_SUCCESS); } @@ -2376,6 +2380,8 @@ image_patch_table ndis_functbl[] = { { "NdisAllocatePacket", (FUNC)ndis_alloc_packet }, { "NdisFreePacket", (FUNC)ndis_release_packet }, { "NdisFreePacketPool", (FUNC)ndis_free_packetpool }, + { "NdisDprAllocatePacket", (FUNC)ndis_alloc_packet }, + { "NdisDprFreePacket", (FUNC)ndis_release_packet }, { "NdisAllocateBufferPool", (FUNC)ndis_alloc_bufpool }, { "NdisAllocateBuffer", (FUNC)ndis_alloc_buf }, { "NdisQueryBuffer", (FUNC)ndis_query_buf }, |