Hi all. So far I've failed to have a working wireless connection with this combination. There are no FreeBSD drivers for the included intel 4965AG card. I've tried to use the ndiswrapper framework without success. The ndisgen wizard runs without issues, but kldloading the driver freezes and reboots the machine. I've also tried two cardbus devices. The Cisco Aironet - AIR CB21AG (ath driver): Oct 26 13:30:27 t61p kernel: cardbus0: Expecting link target, got 0x0 Oct 26 13:30:27 t61p kernel: ath0: <Atheros 5212> mem 0xbfeb0000-0xbfebffff irq 16 at device 0.0 on cardbus0 Oct 26 13:30:27 t61p kernel: ath0: [ITHREAD] Oct 26 13:30:27 t61p kernel: ath0: unable to attach hardware; HAL status 13 Oct 26 13:30:27 t61p kernel: device_attach: ath0 attach returned 6 and the Conceptronic C54RC (ral driver): Oct 26 13:40:59 t61p kernel: cardbus0: Expecting link target, got 0x0 Oct 26 13:40:59 t61p kernel: ral0: <Ralink Technology RT2560> mem 0xbfeb0000-0xbfeb1fff irq 16 at device 0.0 on cardbus0 Oct 26 13:40:59 t61p kernel: ral0: MAC/BBP RT2560 (rev 0x00), RF RT2522 Oct 26 13:40:59 t61p kernel: ral0: [ITHREAD] Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP Oct 26 13:41:40 t61p kernel: ral0: could not write to BBP Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP Oct 26 13:41:40 t61p kernel: ral0: could not write to BBP Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP Oct 26 13:41:40 t61p last message repeated 99 times Oct 26 13:41:40 t61p kernel: ral0: timeout waiting for BBP I'm running: uname -a FreeBSD t61p 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Fri Oct 26 13:10:37 WEST 2007 root@t61p:/usr/obj/usr/src/sys/GENERIC i386 GENERIC kernel with ULE and without debugging. Is there anything I can do to diagnose these issues? Thanks! -- Luis Neves
Yuri Lukin wrote:> On Fri, 26 Oct 2007 15:24:40 +0100, Luis Neves wrote> FWIW, I have a T61 (not the "p" version) with 7.0-PRERELEASE from Oct 15th and > have an integrated IBM miniPCI card that uses the ath driver without any problems: > > ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) > ath0: <Atheros 5212> mem 0xdf2f0000-0xdf2fffff irq 17 at device 0.0 on pci3 > ath0: [ITHREAD] > ath0: using obsoleted if_watchdog interface > ath0: mac 10.3 phy 6.1 radio 10.2 > > You should have no issues using the CB21AG adapter under FreeBSD. I have > several of these and have used them as far back as 6.0-RELEASE on multiple > laptops without any issues. In fact, I just dug one up and inserted it into my > T61 and it attached to ath1: > > ath1: <Atheros 5212> mem 0x88000000-0x8800ffff irq 16 at device 0.0 on cardbus0 > ath1: [ITHREAD] > ath1: using obsoleted if_watchdog interface > ath1: mac 5.6 phy 4.1 radio 3.6Huumm... this is similar output to what i had last week, since then I've updated RAM to 4GB (a delicate process, I might have screwed up something) and updated FreeBSD a couple of times to the latest RELENG_7.>> I'm running: >> uname -a >> >> FreeBSD t61p 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Fri Oct 26 13:10:37 >> WEST 2007 root@t61p:/usr/obj/usr/src/sys/GENERIC i386 >> >> GENERIC kernel with ULE and without debugging. >> >> Is there anything I can do to diagnose these issues? >> > > What does dmesg show for "ath" when you boot? Or can you post "pciconf -l -v"?cardbus: cbb0@pci0:21:0:0: class=0x060700 card=0x20c617aa chip=0x04761180 rev=0xba hdr=0x02 vendor = 'Ricoh Company, Ltd.' device = 'unknown Ricoh R/RL/5C476(II)' class = bridge subclass = PCI-CardBus "ral" card: ral0@pci0:22:0:0: class=0x028000 card=0x3c001948 chip=0x02011814 rev=0x01 hdr=0x00 vendor = 'Ralink Technology, Corp' device = '0x03011814 Zonet ZEW1601 (Ralink Chipset) 802.11b/g WLAN Card' class = network "ath" card ath0@pci0:22:0:0: class=0x020000 card=0xcb2114b9 chip=0x0013168c rev=0x01 hdr=0x00 vendor = 'Atheros Communications Inc.' device = 'AR5212, AR5213 802.11a/b/g Wireless Adapter' class = network subclass = ethernet Thanks for your help! -- Luis Neves
On Fri, 26 Oct 2007 15:24:40 +0100, Luis Neves wrote> Hi all. > So far I've failed to have a working wireless connection with this combination. > > There are no FreeBSD drivers for the included intel 4965AG card. > I've tried to use the ndiswrapper framework without success. The > ndisgen wizard runs without issues, but kldloading the driver > freezes and reboots the machine.I dont think there's any support for this card in FreeBSD just yet.> > I've also tried two cardbus devices. > > The Cisco Aironet - AIR CB21AG (ath driver): > > Oct 26 13:30:27 t61p kernel: cardbus0: Expecting link target, got 0x0 > > Oct 26 13:30:27 t61p kernel: ath0: <Atheros 5212> mem 0xbfeb0000- > 0xbfebffff irq 16 at device 0.0 on cardbus0 > Oct 26 13:30:27 t61p kernel: ath0: [ITHREAD] > Oct 26 13:30:27 t61p kernel: ath0: unable to attach hardware; HAL > status 13 > Oct 26 13:30:27 t61p kernel: device_attach: ath0 attach returned 6 >FWIW, I have a T61 (not the "p" version) with 7.0-PRERELEASE from Oct 15th and have an integrated IBM miniPCI card that uses the ath driver without any problems: ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) ath0: <Atheros 5212> mem 0xdf2f0000-0xdf2fffff irq 17 at device 0.0 on pci3 ath0: [ITHREAD] ath0: using obsoleted if_watchdog interface ath0: mac 10.3 phy 6.1 radio 10.2 You should have no issues using the CB21AG adapter under FreeBSD. I have several of these and have used them as far back as 6.0-RELEASE on multiple laptops without any issues. In fact, I just dug one up and inserted it into my T61 and it attached to ath1: ath1: <Atheros 5212> mem 0x88000000-0x8800ffff irq 16 at device 0.0 on cardbus0 ath1: [ITHREAD] ath1: using obsoleted if_watchdog interface ath1: mac 5.6 phy 4.1 radio 3.6> and the Conceptronic C54RC (ral driver): >I have no experience with these.> I'm running: > uname -a > > FreeBSD t61p 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Fri Oct 26 13:10:37 > WEST 2007 root@t61p:/usr/obj/usr/src/sys/GENERIC i386 > > GENERIC kernel with ULE and without debugging. > > Is there anything I can do to diagnose these issues? >What does dmesg show for "ath" when you boot? Or can you post "pciconf -l -v"? -Yuri
Abdullah Ibn Hamad Al-Marri
2007-Oct-26 09:14 UTC
7.0 BETA1 and Thinkpad T61p : Wireless misadventure
----- Original Message ----> From: Luis Neves <luis.neves@co.sapo.pt>> To: freebsd-mobile@freebsd.org; freebsd-stable@freebsd.org> Sent: Friday, October 26, 2007 5:24:40 PM> Subject: 7.0 BETA1 and Thinkpad T61p : Wireless misadventure>>> Hi all.> So far I've failed to have a working wireless connection with> this> combination.>> There are no FreeBSD drivers for the included intel 4965AG card.> I've tried to use the ndiswrapper framework without success.> The> ndisgen wizard> runs without issues, but kldloading the driver freezes and reboots> the> machine.>> I've also tried two cardbus devices.>> The Cisco Aironet - AIR CB21AG (ath driver):>> Oct 26 13:30:27 t61p kernel: cardbus0: Expecting link target, got 0x0> Oct 26 13:30:27 t61p kernel: ath0:> mem> 0xbfeb0000-0xbfebffff irq> 16 at device 0.0 on cardbus0> Oct 26 13:30:27 t61p kernel: ath0: [ITHREAD]> Oct 26 13:30:27 t61p kernel: ath0: unable to attach hardware;> HAL> status 13> Oct 26 13:30:27 t61p kernel: device_attach: ath0 attach returned 6>> and the Conceptronic C54RC (ral driver):>> Oct 26 13:40:59 t61p kernel: cardbus0: Expecting link target, got 0x0> Oct 26 13:40:59 t61p kernel: ral0: mem> 0xbfeb0000-0xbfeb1fff irq 16 at device 0.0 on cardbus0> Oct 26 13:40:59 t61p kernel: ral0: MAC/BBP RT2560 (rev 0x00), RF RT2522> Oct 26 13:40:59 t61p kernel: ral0: [ITHREAD]> Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP> Oct 26 13:41:40 t61p kernel: ral0: could not write to BBP> Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP> Oct 26 13:41:40 t61p kernel: ral0: could not write to BBP> Oct 26 13:41:40 t61p kernel: ral0: could not read from BBP> Oct 26 13:41:40 t61p last message repeated 99 times> Oct 26 13:41:40 t61p kernel: ral0: timeout waiting for BBP>> I'm running:> uname -a> FreeBSD t61p 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Fri Oct 26 13:10:37> WEST> 2007> root@t61p:/usr/obj/usr/src/sys/GENERIC i386>> GENERIC kernel with ULE and without debugging.>> Is there anything I can do to diagnose these issues?>> Thanks!>> --> Luis Neves---------- Forwarded message ---------- From: Marcin Simonides <marcin@studio4plus.com> Date: Oct 18, 2007 7:32 PM Subject: Re: NDIS: intel 4965 panic To: freebsd-drivers@freebsd.org Marcin Simonides wrote:> I've tried using an XP ndis wrapper for my intel 4965 wifi adapter.> After loading the driver the device is recognized and then kernel panics> during driver attachement.[...] Previously I didn't mention that there are some functions missing from the FreeBSD's NDIS api. These are: NdisIMCopySendPerPacketInfo strncat KeQuerySystemTime KeBugCheckEx KeTickCount With the help of NDIS reference and Linux ndiswrapper I have been able to implement all but KeBugCheckEx (they are all rather simple but I can't be 100% sure they're correct and exported appropriately). Now I'm able to load the driver and don't get any of the "ntoskrnl dummy called..." messages which probably means that there are no missing functions the driver tries to call. Unfortunately I'm still left with the: ndis0: NDIS ERROR: 40001b7c (unknown error) error message and the device doesn't work. ifconfig ndis0 shows: ndis0: flags=8806<BROADCAST,DEBUG,SIMPLEX,MULTICAST> mtu 1500 ether 00:13:e8:64:aa:f7 media: IEEE 802.11 Wireless Ethernet autoselect status: no carrier ssid "" channel 1 authmode OPEN privacy OFF txpowmax 100 bmiss 7 protmode CTS The LED indicating whether WLAN is on doesn't light up. Calling ifconfig ndis0 up results with the following kernel messages: ndis0: NDIS ERROR: 40001b7c (unknown error) ndis0: NDIS NUMERRORS: 2 ndis0: argptr: 0x56524457 ndis0: argptr: 0xdd And that's all I have been able to achieve so far :) I'll try to read some more of NDIS specification, locate the source of the aforementioned error message and generally try to blindly find something. Maybe someone has some suggestions? Maybe I should also try to post my questions to some other list? The diff of my changes: http://marcin.studio4plus.com/ndis/ndis.diff All changes are confined to the /usr/src/sys/compat/ndis directory. The functions I have added are implemented in a quick and dirty way :) -- Marcin Simonides --- Check it, it may work for you with ndis. Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
> There are no FreeBSD drivers for the included intel 4965AG card. > I've tried to use the ndiswrapper framework without success. The ndisgen wizard > runs without issues, but kldloading the driver freezes and reboots the machine.This occurs if the Windows driver contains function calls that have not been implemented in the ndiswrapper framework. Often, an older version of the Windows driver solves the issue. For Broadcom cards that use bcmwl5.sys, kernel crash is a frequent problem if the newer drivers are used, but the old drivers solve the issue. I don't know if the card you mention would even work with ndis, but it's a good first step that ndisgen wizard works. Trying an older version of the Windows driver *might* help, but only if this card is compatible with ndis framework in the first place. Good luck.
Abdullah Ibn Hamad Al-Marri
2007-Oct-31 04:21 UTC
7.0 BETA1 and Thinkpad T61p : Wireless misadventure
----- Original Message ---- From: Scot Hetzel <swhetzel@gmail.com> To: Mike Pumford <mpumford@mpc-data.co.uk> Cc: freebsd-mobile@freebsd.org; freebsd-stable@freebsd.org; Abdullah Ibn Hamad Al-Marri <wearabnet@yahoo.ca> Sent: Wednesday, October 31, 2007 6:56:58 AM Subject: Re: 7.0 BETA1 and Thinkpad T61p : Wireless misadventure On 10/30/07, Mike Pumford <mpumford@mpc-data.co.uk> wrote:> Abdullah Ibn Hamad Al-Marri wrote:>> >> > Previously I didn't mention that there are some functions missing from> >> > the FreeBSD's NDIS api. These are:> >> > With the help of NDIS reference and Linux ndiswrapper I have been able> >> > to implement all but KeBugCheckEx (they are all rather simple but I> >> Can help you with this one. This is the Windows equivalent of panic().> So just call panic with an appropriate string. If the string includes> the bugcheck code and parameters so much the better.>Thanks for your hint to use panic() in the KeBugCheckEx function. I have KeBugCheckEx partially implemented. It currently prints the bugcheck code and the 4 paramators that are sent to KeBugCheckEx. The KeBugCheckEx function still needs to be changed to display the right information depending on the bugcheck code. Abdullah, I made a minor change to your patch, strncat should be prefixed with ntoskrnl_strncat. changed IMPORT_CFUNC(strncat..) to IMPORT_CFUNC_MAP(ntoskrnl_strncat..). Scot -----Inline Attachment Follows----- Index: ndis_var.h ================================================================== RCS file: /home/ncvs/src/sys/compat/ndis/ndis_var.h,v retrieving revision 1.47 diff -u -r1.47 ndis_var.h --- ndis_var.h 6 Apr 2007 11:18:57 -0000 1.47 +++ ndis_var.h 31 Oct 2007 03:31:24 -0000 @@ -49,6 +49,10 @@ typedef register_t ndis_kspin_lock; typedef uint8_t ndis_kirql; +/* Version of NDIS supported by FreeBSD */ +#define NDIS_VERSION_51 0x00050001 +#define NDIS_VERSION NDIS_VERSION_51 + /* * NDIS status codes (there are lots of them). The ones that * don't seem to fit the pattern are actually mapped to generic Index: ntoskrnl_var.h ================================================================== RCS file: /home/ncvs/src/sys/compat/ndis/ntoskrnl_var.h,v retrieving revision 1.43 diff -u -r1.43 ntoskrnl_var.h --- ntoskrnl_var.h 17 Aug 2006 22:50:32 -0000 1.43 +++ ntoskrnl_var.h 31 Oct 2007 03:31:24 -0000 @@ -1202,14 +1202,22 @@ /* Memory pool types, for ExAllocatePoolWithTag() */ -#define NonPagedPool 0x00000000 -#define PagedPool 0x00000001 -#define NonPagedPoolMustSucceed 0x00000002 -#define DontUseThisType 0x00000003 -#define NonPagedPoolCacheAligned 0x00000004 -#define PagedPoolCacheAligned 0x00000005 -#define NonPagedPoolCacheAlignedMustS 0x00000006 -#define MaxPoolType 0x00000007 +#define NonPagedPool 0x00000000 +#define PagedPool 0x00000001 +#define NonPagedPoolMustSucceed 0x00000002 +#define DontUseThisType 0x00000003 +#define NonPagedPoolCacheAligned 0x00000004 +#define PagedPoolCacheAligned 0x00000005 +#define NonPagedPoolCacheAlignedMustS 0x00000006 +#define MaxPoolType 0x00000007 + +#define NonPagedPoolSession 0x00000020 +#define PagedPoolSession 0x00000021 +#define NonPagedPoolMustSucceedSession 0x00000022 +#define DontUseThisTypeSession 0x00000023 +#define NonPagedPoolCacheAlignedSession 0x00000024 +#define PagedPoolCacheAlignedSession 0x00000025 +#define NonPagedPoolCacheAlignedMustSSession 0x00000026 /* * IO_WORKITEM is an opaque structures that must be allocated @@ -1357,8 +1365,12 @@ extern uint8_t KeSynchronizeExecution(kinterrupt *, void *, void *); extern uintptr_t InterlockedExchange(volatile uint32_t *, uintptr_t); +extern void *ExAllocatePool(uint32_t, size_t); +extern void *ExAllocatePoolWithQuota(uint32_t, size_t); +extern void *ExAllocatePoolWithQuotaTag(uint32_t, size_t, uint32_t); extern void *ExAllocatePoolWithTag(uint32_t, size_t, uint32_t); extern void ExFreePool(void *); +extern void ExFreePoolWithTag(void *, uint32_t); extern uint32_t IoConnectInterrupt(kinterrupt **, void *, void *, kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t); Index: subr_ndis.c ================================================================== RCS file: /home/ncvs/src/sys/compat/ndis/subr_ndis.c,v retrieving revision 1.108 diff -u -r1.108 subr_ndis.c --- subr_ndis.c 31 May 2007 11:51:49 -0000 1.108 +++ subr_ndis.c 31 Oct 2007 03:31:24 -0000 @@ -272,6 +272,7 @@ static void NdisUnmapFile(ndis_handle); static void NdisCloseFile(ndis_handle); static uint8_t NdisSystemProcessorCount(void); +static void NdisGetCurrentProcessorCounts(uint32_t *, uint32_t *, uint32_t*); static void NdisMIndicateStatusComplete(ndis_handle); static void NdisMIndicateStatus(ndis_handle, ndis_status, void *, uint32_t); @@ -282,6 +283,7 @@ uint32_t, uint32_t, ndis_packet *, uint32_t, uint32_t *); static void NdisCopyFromPacketToPacketSafe(ndis_packet *, uint32_t, uint32_t, ndis_packet *, uint32_t, uint32_t *, uint32_t); +static void NdisIMCopySendPerPacketInfo(ndis_packet *, ndis_packet *); static ndis_status NdisMRegisterDevice(ndis_handle, unicode_string *, unicode_string *, driver_dispatch **, void **, ndis_handle *); @@ -3115,6 +3117,20 @@ return(mp_ncpus); } +static void +NdisGetCurrentProcessorCounts(idlecount, kerneluser, index) + uint32_t *idlecount; + uint32_t *kerneluser; + uint32_t *index; +{ + int cpu = 0; /* Current CPU */ + + *idlecount = cp_time[CP_IDLE]; + *kerneluser = (cp_time[CP_USER] + cp_time[CP_NICE]) + \ + (cp_time[CP_SYS] + cp_time[CP_INTR]); + *index = cpu; +} + typedef void (*ndis_statusdone_handler)(ndis_handle); typedef void (*ndis_status_handler)(ndis_handle, ndis_status, void *, uint32_t); @@ -3288,6 +3304,14 @@ return; } +static void +NdisIMCopySendPerPacketInfo(dpkt, spkt) + ndis_packet *dpkt; + ndis_packet *spkt; +{ + memcpy(&dpkt->np_ext, &spkt->np_ext, sizeof(ndis_packet_extension)); +} + static ndis_status NdisMRegisterDevice(handle, devname, symname, majorfuncs, devobj, devhandle) ndis_handle handle; @@ -3346,6 +3370,12 @@ return; } +static uint32_t +NdisGetVersion() +{ + return(NDIS_VERSION); +} + static void dummy() { @@ -3365,10 +3395,12 @@ image_patch_table ndis_functbl[] = { IMPORT_SFUNC(NdisCopyFromPacketToPacket, 6), IMPORT_SFUNC(NdisCopyFromPacketToPacketSafe, 7), + IMPORT_SFUNC(NdisIMCopySendPerPacketInfo, 2), IMPORT_SFUNC(NdisScheduleWorkItem, 1), IMPORT_SFUNC(NdisMIndicateStatusComplete, 1), IMPORT_SFUNC(NdisMIndicateStatus, 4), IMPORT_SFUNC(NdisSystemProcessorCount, 0), + IMPORT_SFUNC(NdisGetCurrentProcessorCounts, 3), IMPORT_SFUNC(NdisUnchainBufferAtBack, 2), IMPORT_SFUNC(NdisGetFirstBufferFromPacket, 5), IMPORT_SFUNC(NdisGetFirstBufferFromPacketSafe, 6), @@ -3482,6 +3514,7 @@ IMPORT_SFUNC(NdisMDeregisterDevice, 1), IMPORT_SFUNC(NdisMQueryAdapterInstanceName, 2), IMPORT_SFUNC(NdisMRegisterUnloadHandler, 2), + IMPORT_SFUNC(NdisGetVersion, 0), IMPORT_SFUNC(ndis_timercall, 4), IMPORT_SFUNC(ndis_asyncmem_complete, 2), IMPORT_SFUNC(ndis_intr, 2), Index: subr_ntoskrnl.c ================================================================== RCS file: /home/ncvs/src/sys/compat/ndis/subr_ntoskrnl.c,v retrieving revision 1.91 diff -u -r1.91 subr_ntoskrnl.c --- subr_ntoskrnl.c 20 Oct 2007 23:23:12 -0000 1.91 +++ subr_ntoskrnl.c 31 Oct 2007 03:31:24 -0000 @@ -219,6 +219,8 @@ static int rand(void); static void srand(unsigned int); static void ntoskrnl_time(uint64_t *); +static void KeQuerySystemTime(uint64_t *); +static uint32_t KeTickCount(void); static uint8_t IoIsWdmVersionAvailable(uint8_t, uint8_t); static void ntoskrnl_thrfunc(void *); static ndis_status PsCreateSystemThread(ndis_handle *, @@ -226,6 +228,8 @@ static ndis_status PsTerminateSystemThread(ndis_status); static ndis_status IoGetDeviceProperty(device_object *, uint32_t, uint32_t, void *, uint32_t *); +static void KeBugCheckEx(uint32_t , uint32_t *, uint32_t *, uint32_t *, + uint32_t *); static void KeInitializeMutex(kmutant *, uint32_t); static uint32_t KeReleaseMutex(kmutant *, uint8_t); static uint32_t KeReadStateMutex(kmutant *); @@ -238,8 +242,10 @@ 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 int ntoskrnl_memcmp(void *, void *, size_t); static void *ntoskrnl_memmove(void *, void *, size_t); static void *ntoskrnl_memchr(void *, unsigned char, size_t); +static char *ntoskrnl_strncat(char *, char *, size_t); static char *ntoskrnl_strstr(char *, char *); static int ntoskrnl_toupper(int); static int ntoskrnl_tolower(int); @@ -429,6 +435,16 @@ return(memset(buf, ch, size)); } + +static int +ntoskrnl_memcmp(buf1, buf2, size) + void *buf1; + void *buf2; + size_t size; +{ + return(memcmp(buf1, buf2, size)); +} + static void * ntoskrnl_memmove(dst, src, size) void *src; @@ -456,6 +472,29 @@ return (NULL); } +/* Taken from libc */ +char * +ntoskrnl_strncat(dst, src, n) + char *dst; + char *src; + size_t n; +{ + if (n != 0) { + char *d = dst; + const char *s = src; + + while (*d != 0) + d++; + do { + if ((*d = *s++) == 0) + break; + d++; + } while (--n != 0); + *d = 0; + } + return (dst); +} + static char * ntoskrnl_strstr(s, find) char *s, *find; @@ -624,6 +663,31 @@ } void * +ExAllocatePool(pooltype, len) + uint32_t pooltype; + size_t len; +{ + return(ExAllocatePoolWithTag(pooltype, len, 0)); +} + +void * +ExAllocatePoolWithQuota(pooltype, len) + uint32_t pooltype; + size_t len; +{ + return(ExAllocatePoolWithTag(pooltype, len, 0)); +} + +void * +ExAllocatePoolWithQuotaTag(pooltype, len, tag) + uint32_t pooltype; + size_t len; + uint32_t tag; +{ + return(ExAllocatePoolWithTag(pooltype, len, tag)); +} + +void * ExAllocatePoolWithTag(pooltype, len, tag) uint32_t pooltype; size_t len; @@ -642,6 +706,14 @@ ExFreePool(buf) void *buf; { + ExFreePoolWithTag(buf, 0); +} + +void +ExFreePoolWithTag(buf, tag) + void *buf; + uint32_t tag; +{ free(buf, M_DEVBUF); return; } @@ -1587,6 +1659,21 @@ return; } +static void +KeQuerySystemTime(current_time) + uint64_t *current_time; +{ + ntoskrnl_time(current_time); +} + +static uint32_t +KeTickCount(void) +{ + struct timeval tv; + getmicrouptime(&tv); + return tvtohz(&tv); +} + /* * KeWaitForSingleObject() is a tricky beast, because it can be used * with several different object types: semaphores, timers, events, @@ -2316,6 +2403,22 @@ } void +KeBugCheckEx(bugcheck, param1, param2, param3, param4) + uint32_t bugcheck; + uint32_t *param1; + uint32_t *param2; + uint32_t *param3; + uint32_t *param4; +{ + /* http://msdn2.microsoft.com/en-us/library/ms801645.aspx */ + + panic("KeBugCheckEx: STOP: %#08x, (%8p, %8p, %8p, %8p)", + bugcheck, param1, param2, param3, param4); + + return; +} + +void KeInitializeSpinLock(lock) kspin_lock *lock; { @@ -2814,7 +2917,7 @@ for (i = 0; i < WORKITEM_THREADS; i++) { kq = wq_queues + i; kq->kq_exit = 1; - KeSetEvent(&kq->kq_proc, IO_NO_INCREMENT, FALSE); + KeSetEvent(&kq->kq_proc, IO_NO_INCREMENT, FALSE); while (kq->kq_exit) tsleep(kq->kq_td->td_proc, PWAIT, "waitiw", hz/10); } @@ -3182,7 +3285,10 @@ uint8_t major; uint8_t minor; { - if (major == WDM_MAJOR && minor == WDM_MINOR_WINXP) + if (major == WDM_MAJOR && + (minor == WDM_MINOR_WIN2003 || /* Windows 2003 */ + minor == WDM_MINOR_WINXP || /* Windows XP */ + minor == WDM_MINOR_WIN2000)) /* Windows 2000 */ return(TRUE); return(FALSE); } @@ -4218,6 +4324,7 @@ IMPORT_CFUNC(strncmp, 0), IMPORT_CFUNC(strcmp, 0), IMPORT_CFUNC_MAP(stricmp, strcasecmp, 0), + IMPORT_CFUNC_MAP(strncat, ntoskrnl_strncat, 0), IMPORT_CFUNC(strncpy, 0), IMPORT_CFUNC(strcpy, 0), IMPORT_CFUNC(strlen, 0), @@ -4229,6 +4336,7 @@ IMPORT_CFUNC(memcpy, 0), IMPORT_CFUNC_MAP(memmove, ntoskrnl_memmove, 0), IMPORT_CFUNC_MAP(memset, ntoskrnl_memset, 0), + IMPORT_CFUNC_MAP(memcmp, ntoskrnl_memcmp, 0), IMPORT_CFUNC_MAP(memchr, ntoskrnl_memchr, 0), IMPORT_SFUNC(IoAllocateDriverObjectExtension, 4), IMPORT_SFUNC(IoGetDriverObjectExtension, 2), @@ -4290,8 +4398,12 @@ InterlockedPushEntrySList, 2), IMPORT_FFUNC(ExInterlockedPopEntrySList, 2), IMPORT_FFUNC(ExInterlockedPushEntrySList, 3), + IMPORT_SFUNC(ExAllocatePool, 2), + IMPORT_SFUNC(ExAllocatePoolWithQuota, 2), + IMPORT_SFUNC(ExAllocatePoolWithQuotaTag, 3), IMPORT_SFUNC(ExAllocatePoolWithTag, 3), IMPORT_SFUNC(ExFreePool, 1), + IMPORT_SFUNC(ExFreePoolWithTag, 2), #ifdef __i386__ IMPORT_FFUNC(KefAcquireSpinLockAtDpcLevel, 1), IMPORT_FFUNC(KefReleaseSpinLockFromDpcLevel,1), @@ -4336,6 +4448,7 @@ IMPORT_SFUNC(IoQueueWorkItem, 4), IMPORT_SFUNC(ExQueueWorkItem, 2), IMPORT_SFUNC(ntoskrnl_workitem, 2), + IMPORT_SFUNC(KeBugCheckEx, 5), IMPORT_SFUNC(KeInitializeMutex, 2), IMPORT_SFUNC(KeReleaseMutex, 2), IMPORT_SFUNC(KeReadStateMutex, 1), @@ -4365,6 +4478,8 @@ IMPORT_SFUNC(IoWMIRegistrationControl, 2), IMPORT_SFUNC(WmiQueryTraceInformation, 5), IMPORT_CFUNC(WmiTraceMessage, 0), + IMPORT_SFUNC(KeQuerySystemTime, 1), + IMPORT_CFUNC(KeTickCount, 0), /* * This last entry is a catch-all for any function we haven't -----Inline Attachment Follows----- ____________ Hello Marcin, Could you please try this patch which modified by Mr. Scot Hetzel please? -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com