s3c2440 + wince5.0 + sdio接口wifi 8686的调试记录

前面调试sdio接口wifi的时候遇到了一些问题,现在整理记录一下。当时给的驱动是windowsmobile 6.0上用的,大概是pxa310上的驱动,不过我在网上搜索到MAVELL_WIFI的驱动,里面内容差不多,基本一样。

早期的时候,我对sd卡的驱动也不太熟悉,所以这部分虽然修改了,但是实际上检测sd卡的驱动部分就是错的,这时候会出来一些错误的信息,不过这也是调试的一个重要组成部分,有很多问题也能搜索到,但实际的原因可能并不准确。

最初的打印信息

 

MRVDRVND5: DLL_PROCESS_ATTACH ok

MRVDRVND5: LoaderEntry ok

 INIT - Enter DriverEntry

 *** Driver version 38.p45 ***

*** Built on Aug 17 2010 11:14:24 ***

<== DriverEntry: register miniport success

-BSPIntrEnableIrq(irq = 26)

SDHC +Init

SDHCDInitialize starts

GPIO registers mapped to 480000

SDI control registers mapped to 490000

Clock & Power Management Special Register mapped to 4a0000

DMA Register mapped to 4b0000

-BSPIntrEnableIrq(irq = 21)

-BSPIntrEnableIrq(irq = 17)

SDHCDInitialize ends

SDHC -Init

这是最早的部分,只有这部分打印信息,没有弹出网络搜索框(出了就奇怪了)。于是开始网上搜索原因,把各种帖子都看了一下。开始尝试着修改注册表,来调整。

 

IF 0

IF MRVL_MONOLITHIC_SDIO

    ; setup monolithic SDIO Bus and SDHC parameters

[HKEY_LOCAL_MACHINE/Drivers/Builtin/SDIO8686]

   "Order"=dword:2

  "Dll"="SDIO8686.dll"

   "Prefix"="NDL"

   "Instance0"="SDIO8686:SDIO86861"

   "ThreadPriority"=dword:64     ; default thread priority for dispatch thread

   "RequestListDepth"=dword:30   ; pre-allocated requests

   "IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=%b","{6F40791D-300E-44E4-BC38-E0E63CA8375C}=%b"

 

    "ControllerIRQ"=dword:17 ; IRQ_MMC 23

    "ControllerISTPriority"=dword:64

IF BSP_MAINSTONEII

   "CardDetectIRQ"=dword:20 ; IRQ_GPIO0_MMCCD 32

ELSE

    "CardDetectIRQ"=dword:28 ; IRQ_GPIOXX_MMCCD 40

ENDIF

    "CardDetectISTPriority"=dword:65

    "ClockAlwaysOn"=dword:0

    "ClockOnIfInterruptsEnabled"=dword:1

    "ehancePS"=dword:1

 

    "DMAChannel"=dword:14 ;comment this out to disable DMA support

   "DMAIsrDll"="sdhc_dmaisr.dll"

    "DMAIsrHandler"="SDHC_DMA_ISR"

    "DMAIRQ"=dword:19 ; IRQ_DMAC = 25

    "DMAISTPriority"=dword:63

    "DMABufferSize"=dword:10000

    "MaximumClockFrequency"=dword:1312D00 ; clock rate 989680(10MHz) 1312D00(20MHz)

ENDIF MRVL_MONOLITHIC_SDIO

ENDIF

当时我是选择把这一部分打开,并修改一些对应的IRQ跟sdio的部分保持一致。这部分其实是我当时不太理解造成的。真正的加载,并没有通过这里,下面会介绍。这时候调试信息是这样的

 

-BSPIntrEnableIrq(irq = 35)

INIT - Enter DriverEntry

*** Driver version 38.p45 ***

 *** Built on Aug 13 2010 10:45:07 ***

 <== DriverEntry: register miniport success

 -BSPIntrEnableIrq(irq = 26)

SDHC +Init

SDHCDInitialize starts

GPIO registers mapped to 480000

SDI control registers mapped to 490000

Clock & Power Management Special Register mapped to 4a0000

DMA Register mapped to 4b0000

-BSPIntrEnableIrq(irq = 21)

-BSPIntrEnableIrq(irq = 17)

SDHCDInitialize ends

SDHC -Init

INIT - Enter MrvDrvInitialize

 [WiFi]: Driver Version: 38.p45

 pAssoInfo = 0x561d68, pAssoInfo->Length = 0x561d68

 HW_USBClocks::D0

HW_USBClocks::D0 [Mini2440]

-BSPIntrEnableIrq(irq = 25)

********sdio_Initialization**********

********SDNdisGetSDDeviceHandle**********

SDNdis: Active path str == Drivers/Active/24

SDNdis: Active Path Retrieved: Drive

rs/Active/24

*** SDNdisGetSDDeviveHandleFailed 0

 *** SDIOInitialization FAILED! ***

 [TT] SDIO initialization is failed! Quit initialization process

 

 

这个时候我以为看到曙光了,但其实大方向都是错误的了。当时注册表里确实加了这个驱动的部分信息,但它不是通过sdio加载的,是通过写的builtin里面直接加载的。然后sd卡驱动部分去读,结果就出错了。

从始至终打印信息,wifi的在sd卡之前。曾经我还以为,是因为sd卡驱动在wifi驱动之后导致的,其实不是。修改order并没有用处。这部分打印信息的前后其实没有问题。

然后得到了别人的帮助,看代码,弄明白了wifi不应该是这样加载。而是应该通过sdio驱动来加载。注册表里

 

; registry keys for the Streams portion of the driver

[HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Custom/MANF-02DF-CARDID-9103-FUNC-1]

   "Dll"="SDIO8686.dll"     ; use the "streams" interface portion to load the NDIS portion

   "Prefix"="NDL"

       ; add instance key for each instance that can be added

   "Instance0"="SDIO8686:SDIO86861" ; "InstanceX" = "<Miniport Name>:<Miniport Instance>"

才是正确的加载方式。

 

 

下面有了努力的方向,开始进行其他地方的修改。

 

[HKEY_LOCAL_MACHINE/Comm/SDIO8686]

   "DisplayName"="Marvell SDIO8686 Wireless Card"

   "Group"="NDIS"

   "ImagePath"="SDIO8686.dll"

  "NoDeviceCreate"=dword:01

这里把 "NoDeviceCreate"=dword:01改为 "NoDeviceCreate"=dword:0,打印信息如下

 

MRVDRVND5: DLL_PROCESS_ATTACH ok

MRVDRVND5: LoaderEntry ok

INIT - Enter DriverEntry

 *** Driver version 38.p45 ***

*** Built on Aug 17 2010 14:53:22 ***

<== DriverEntry: register miniport success

INIT - Enter MrvDrvInitialize

[WiFi]: Driver Version: 38.p45

pAssoInfo = 0x261d68, pAssoInfo->Length = 0x261d68

********sdio_Initialization**********

********SDNdisGetSDDeviceHandle**********

SDNdis: Failed to get active path key (0xC0000001)

*** SDNdisGetSDDeviveHandleFailed -1073741823

*** SDIOInitialization FAILED! ***

[TT] SDIO initialization is failed! Quit initialization process

MRVDRVND5: DLL_PROCESS_ATTACH ok

MRVDRVND5: LoaderEntry ok

这个时候这些错误,开始在网上找答案。有的说把      

; 1:SDIO 4 bit mode; 0: SDIO 1 bit mode

   "SetSD4BIT"=dword:1

改为   "SetSD4BIT"=dword:0,这个时候用的也没效果,后面因为这个还导致另一个问题。

有人说是RoamingMode 设为3,快速模式,改掉之后,没有效果。SDGPIOIntEnable改为0,通过这项选择用sdio的驱动来Set the value to use GPIO pin as Interrupt pin, 1:use GPIO pin as interrupt source; 0:used SDIO bus 。还是启动到SDNdis: Failed to get active path key (0xC0000001)。下面是RoamingMode 设为3的打印信息

 

 

MRVDRVND5: DLL_PROCESS_ATTACH

MRVDRVND5: LoaderEntry ok

INIT - Enter DriverEntry

*** Driver version 38.p45 ***

*** Built on Aug 17 2010 17:08:21 ***

<== DriverEntry: register miniport success

INIT - Enter MrvDrvInitialize

  [WiFi]: Driver Version: 38.p45

pAssoInfo = 0x261d68, pAssoInfo->Length = 0x261d68

RoamSignalStrengthThreshold: 45

RoamChannelScanList: 7ff

RoamMaxScanInterval: 3000 ms

RoamMinScanInterval: 200 ms

RoamDiffRSSIThreshold: 15

RoamScanAlgorithm: 1

->Roam: Using normal-scan

->Roam: wlan_roam_set_state:

 Transite to the same state(WRS_NOT_CONNECT)

->Roam: EndOf wlan_roam_init, (1d91090)

********sdio_Initialization**********

********SDNdisGetSDDeviceHandle**********

NdisOpenConfiguration ok

SDNdis: Failed to get active path key (0xC0000001)

*** SDNdisGetSDDeviveHandleFailed -1073741823

*** SDIOInitialization FAILED! ***

[TT] SDIO initialization is failed! Quit initialization process

MRVDRVND5: DLL_PROCESS_ATTACH ok

MRVDRVND5: DLL_PROCESS_DETACH

MRVDRVND5: LoaderEntry ok

-BSPIntrEnableIrq(irq = 26)

-BSPIntrEnableIrq(irq = 33)

SDHC +Init

SDHC SDHCDAllocateContext

SDHC CreateSDIOController

SDHC InterpretCapabilities

SDHCDInitialize starts

GPIO registers mapped to 4a0000

SDI control registers mapped to 4b0000

Clock & Power Management Special Register mapped to 4c0000

DMA Register mapped to 4d0000

-BSPIntrEnableIrq(irq = 21)

-BSPIntrEnableIrq(irq = 17)

SDHCDInitialize ends

SDHC SDHCDRegisterHostController

SDHC -Init        

 

 

 

这些都测试了一下,当时都没有用。开始想其他的办法。

好了,上面都是错误的方法,错误的结果。下面才迈出了成功的第一步。前面刚看过wince.he的帖子,说调试的另一款wifi。当时觉得他是通过写了一个应用程序,手动来进行sd卡的插入拔出检测。询问了一下,知道是用注册表来实现的。

于是我开始重新修改SD卡的驱动,在线程里检测SD卡的部分,也通过读注册表来实现。把原来的   "NoDeviceCreate"=dword:1修改回来。这个时候前面就能够正常执行了,执行到

 ********SDIODownloadPkt**********

 

 [MRVL] * ERROR, timeout (12000 sec) for waiting HW Spec!

 EXIT - Enter MrvDrvHalt

 ********sdio_DisableInterrupt  <<return>>**********

 Wait for the end of IstThread...

 ... done

 [Marvell]+CleanUpSingleTxBuffer()EXIT - Leave MrvDrvHalt

 INIT - Leave MrvDrvInitialize fail5

 

[MRVL] * ERROR, timeout (12000 sec) for waiting HW Spec!产生错误。这个地方是InitializeWirelessConfig函数中出现的。

 

 

      再往下面查,

 

在这个地方等待超时。我试着把这个地方不执行,直接返回TRUE。发现出现搜索框了,不过肯定是有问题的了,不能加入到网络,或者不稳定。这个因为有时候无线信号不太好,也没怎么具体试。

这个时候,找到了问题的原因,

 

; 1:SDIO 4 bit mode; 0: SDIO 1 bit mode

   "SetSD4BIT"=dword:1

这个地方需要用4bit模式,以前改过的,现在要改回来。这样就完全可以了。

下面把调试成功的注册表贴在下面

 

[HKEY_LOCAL_MACHINE/SD/State]

   "Exist"=dword:1

;上面这部分是我在检测SD卡,让它认为插入部分的注册表信息

 

; registry keys for the Streams portion of the driver

[HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Custom/MANF-02DF-CARDID-9103-FUNC-1]

   "Dll"="SDIO8686.dll"     ; use the "streams" interface portion to load the NDIS portion

   "Prefix"="NDL"

       ; add instance key for each instance that can be added

   "Instance0"="SDIO8686:SDIO86861" ; "InstanceX" = "<Miniport Name>:<Miniport Instance>"

 

 

;

; Registry keys

;

 

    ; registry keys for the NDIS driver

[HKEY_LOCAL_MACHINE/Comm/SDIO8686]

   "DisplayName"="Marvell SDIO8686 Wireless Card"

   "Group"="NDIS"

   "ImagePath"="SDIO8686.dll"

   "NoDeviceCreate"=dword:1

 

[HKEY_LOCAL_MACHINE/Comm/SDIO8686/Linkage]

   "Route"=multi_sz:"SDIO86861"

 

    ; instance 1 information

[HKEY_LOCAL_MACHINE/Comm/SDIO86861]

   "DisplayName"="Marvell SDIO8686 Wireless Card"

   "Group"="NDIS"

   "ImagePath"="SDIO8686.dll"

    ; instance 1 parameters

[HKEY_LOCAL_MACHINE/Comm/SDIO86861/Parms]

   "BusNumber"=dword:0

   "BusType"=dword:0

 

 

 

    ; TCPIP linkage to instance 1 adapter

[HKEY_LOCAL_MACHINE/Comm/Tcpip/Linkage]

    "Bind"=multi_sz:"ppp","SDIO86861"

 

    ; setup card parameters

[HKEY_LOCAL_MACHINE/Comm/SDIO86861/Parms]

   "UseMfgFw"=dword:0

   "PowerMode"=dword:0

   "FragThsd"=dword:92A

   "RTSThsd"=dword:92A

       ; following is for BT/WLAN multi-functions driver 1:enable BT/WLAN multi-function driver, 0:WLAN only

   "BTMode"=dword:0

       ; adhoc starter default channel

   "AdhocDefaultChannel"=dword:6

       ; adhoc starter WiFi test datarate modify or not 

   "AdhocWiFiDataRate"=dword:0

       ; adhoc default band, 1:G, 0:B

   "AdhocDefaultBand"=dword:1

       ; 1:SDIO 4 bit mode; 0: SDIO 1 bit mode

   "SetSD4BIT"=dword:1

       ;Set the priority of SdioIstThread

   "SdioIstThread"=dword:65

       ;Set the value of AvoidScanTime after connected

   "AvoidScanTime"=dword:2710

       ;Set ACTIVE_ROAMING

   "bActiveRoamingScanOneChannel"=dword:1

   "bLinkLostScanOneChannel"=dword:1

       ;Set NEW_RSSI parameters

   "ulRSSIThresholdTimer"=dword:1388

   "RSSI_Range"=dword:A

       ;Set ACTIVE_ROAMING with BackGround Scan

   "bActiveRoamingwithBGSCAN"=dword:0

       ;Set RoamingMode:NOT_ROAMING_MODE = 1(default),ACTIVE_ROAMING_MODE=2,FAST_ROAMING_MODE

   "RoamingMode"=dword:1

       ;Set the value of Enable80211D

   "Enable80211D"=dword:0

       ;Set the value of LocalListenInterval

   "LocalListenInterval"=dword:0

       ;Set support 32bytes ESSID

   "ESSID_32"=dword:0

       ;Set the value to use GPIO pin as Interrupt pin, 1:use GPIO pin as interrupt source; 0:used SDIO bus interrupt

   "SDGPIOIntEnable"=dword:0

       ;Set the GPIO pin # to be used as Interrupt pin 

   "GPIOIntPinNumber"=dword:4

       ;Setup interrupt trigger edge, 0: Rasing edge, 1:Falling edge

   "GPIOIntTriggerEdge"=dword:1

       ;Setup interrupt pluse width(us)

   "GPIOIntPulsewidth"=dword:5

       ;Set the value of NullPktInterval, 0: unchanged. 

   "NullPktInterval"=dword:0

       ;Set the value of MultipleDTim

   "MultipleDTim"=dword:1

       ;Set the value of AdhocAwakePeriod

   "AdhocAwakePeriod"=dword:1

       ;Set MAC frame type

   "MacFrameType"=dword:0

       ;Set Auto Deep Sleep Time, 2 seconds unit.

   "AutoDeepSleepTime"=dword:0

       ;Set Association fail retry times while asso. fail.

   "AssoRetryTimes"=dword:2

 

;

;Roaming parameters ++

;

;Set the value of RoamSignalStrengthThreshold

"RoamSignalStrengthThreshold"=dword:2d

 

;

;Channel list. Valid value is from 0x00000000 ~ 0x00007ff

; => bit[i]=1, channel[i+1] will be scanned

"RoamChannelScanList"=dword:000007ff

 

; Scan interval per channel(ms)

"RoamMaxScanInterval"=dword:bb8

"RoamMinScanInterval"=dword:c8

 

;RSSI threshold. If the next AP's RSSI is higher more than this value, roam to that AP

"RoamDiffRSSIThreshold"=dword:0f

 

;Scan algorithm

; 0: Use background scan

; 1: Use active scan

"RoamScanAlgorithm"=dword:1

;

;Roaming parameters --

;

 

;Bus power is on/off in D3

"BusPowerInD3"=dword:1

 

;RegsionCode:

; (0x10, 0x20, 0x30, 0x31, 0x32, 0x40)=(USA FCC, Canada IC, Europe ETSI, Spain, France, JP MKK)

"RegionCode"=dword:10

 

 

    ; default TCPIP settings for this instance

[HKEY_LOCAL_MACHINE/Comm/SDIO86861/Parms/TcpIp]

   "EnableDHCP"=dword:1

       ; This should be MULTI_SZ

   "DefaultGateway"=""

       ; Use zero for broadcast address? (or 255.255.255.255)

   "UseZeroBroadcast"=dword:0

       ; Thus should be MULTI_SZ, the IP address list

   "IpAddress"="0.0.0.0"

       ; This should be MULTI_SZ, the subnet masks for the above IP addresses

   "Subnetmask"="255.255.255.0"

 

 

catalog添加选项,我是加了这么多

Native Wi-Fi WLAN Access Point Components
Native Wi-Fi WLAN STA
Wired Local Area Network (802.3, 802.5)
Wireless LAN (802.11) STA - Automatic Configuration and 802.1x
Domain Discovery
NDIS Packet Capturing DLL
Network Driver Architecture (NDIS)
TCP/IP
Internet Explorer 6.0 for Windows CE Components
Internet Explorer 6.0 for Windows CE - Standard Components

Message Queuing (MSMQ)
SDIO Standard Host Controller

SDIO WiFi (SyChip)

 

 

总结一下,其实我主要是前面SD卡检测就犯了错误,但是发现这些错误的一些打印信息还挺常见。正常的话,其实根据厂家提供的驱动,不需要怎么修改就可以成功的运行。

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值