I.MX6 AW-NB177NF WIFI 驱动移植问题

/********************************************************************************
 *                  I.MX6 AW-NB177NF WIFI 驱动移植问题
 * 说明:
 *     之前驱动移植,但看不到有wlan设备产生,于是感觉是wifi驱动出了问题,于是开始
 * 分析厂家提供的wifi驱动,发现id对应的信息不对,经过与FAE确认之后并验证,确实是
 * 这个问题导致的。
 *
 *                                              2016-6-20 深圳 南山平山村 曾剑锋
 *******************************************************************************/

一、参考文档:
    1. AW-NB177NF-DS-BC-Rev0.3_single Ant.pdf
    2. 基于linux-2.6.38.8内核的SDIO/wifi驱动分析(转)
       http://www.cnblogs.com/hoys/archive/2013/01/09/2853715.html

二、wifi 驱动注册设备驱动的id相关代码:
    ......
    static const struct sdio_device_id sdio_ids[] =
    {
    #ifdef CONFIG_RTL8723B
        { SDIO_DEVICE(0x024c, 0xB723),.driver_data = RTL8723B},
    #endif
    #ifdef CONFIG_RTL8188E
        { SDIO_DEVICE(0x024c, 0x8179),.driver_data = RTL8188E},
    #endif //CONFIG_RTL8188E

    #ifdef CONFIG_RTL8821A
        { SDIO_DEVICE(0x024c, 0x8821),.driver_data = RTL8821},
    #endif //CONFIG_RTL8821A

    #ifdef CONFIG_RTL8192E
        { SDIO_DEVICE(0x024c, 0x818B),.driver_data = RTL8192E},
    #endif //CONFIG_RTL8192E

    #if defined(RTW_ENABLE_WIFI_CONTROL_FUNC) /* temporarily add this to accept all sdio wlan id */
        { SDIO_DEVICE_CLASS(SDIO_CLASS_WLAN) },
    #endif
        { /* end: all zeroes */             },
    };
    ......
    #define SDIO_DEVICE(vend,dev) \
        .class = SDIO_ANY_ID, \
        .vendor = (vend), .device = (dev)
    ......
    #define SDIO_ANY_ID (~0)
    ......

三、获取SDIO设备信息代码位置如下:
    static int sdio_init_func(struct mmc_card *card, unsigned int fn)
    {
        int ret;
        struct sdio_func *func;

        BUG_ON(fn > SDIO_MAX_FUNCS);

        func = sdio_alloc_func(card);
        if (IS_ERR(func))
            return PTR_ERR(func);

        func->num = fn;

        if (!(card->quirks & MMC_QUIRK_NONSTD_SDIO)) {
            ret = sdio_read_fbr(func);
            if (ret)
                goto fail;

            ret = sdio_read_func_cis(func);
            if (ret)
                goto fail;
        } else {
            func->vendor = func->card->cis.vendor;
            func->device = func->card->cis.device;
            func->max_blksize = func->card->cis.blksize;
        }

        card->sdio_func[fn - 1] = func;

        printk("check sdio, func->vendor: 0x%x, func->device: 0x%x, func->max_blksize: 0x%x.\n", func->vendor, func->device, func-       >max_blksize);
        return 0;

    fail:
        /*
         * It is okay to remove the function here even though we hold
         * the host lock as we haven't registered the device yet.
         */
        sdio_remove_func(func);
        return ret;
    }

四、SDIO驱动获取到的信息:
    func->vendor: 0x24c, func->device: 0x626, func->max_blksize: 0x200.

五、解决办法:
    { SDIO_DEVICE(0x024c, 0x626),.driver_data = RTL8723B},

六、查看结果:
    root@android:/ # busybox ifconfig -a
    can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:142 

    can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:143 

    ip6tnl0   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              NOARP  MTU:1452  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:4683 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4683 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:703477 (686.9 KiB)  TX bytes:703477 (686.9 KiB)

    sit0      Link encap:IPv6-in-IPv4
              NOARP  MTU:1480  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    tunl0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-10-00-00-00-00-00-00-00-00-00
              NOARP  MTU:1480  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    wlan0     Link encap:Ethernet  HWaddr 80:A5:89:49:6E:81
              BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    root@android:/ #

七、Linux kernel log:
    RTL871X: module init start
    RTL871X: rtl8723bs v4.3.16_13854.20150410_BTCOEX20150119-5844
    RTL871X: build time: Jun 20 2016 09:05:58
    RTL871X: rtl8723bs BT-Coex version = BTCOEX20150119-5844
    RTL871X: module init ret=0
    ......
    check sdio, func->vendor: 0x24c, func->device: 0x626, func->max_blksize: 0x200.
    mmc2: new high speed SDIO card at address 0001
    ......
    RTL871X: register rtw_netdev_ops to netdev_ops
    RTL871X: rtw_hal_config_rftype RF_Type is 3 TotalTxPath is 1
    RTL871X: Chip Version Info: CHIP_8723B_Normal_Chip_TSMC_B_CUT_1T1R_RomVer(0)
    RTL871X: EEPROM type is E-FUSE
    RTL871X: SetHwReg8723B: bMacPwrCtrlOn=1
    RTL871X: PowerOnCheck: val_mix:0x0000063f, res:0x0000063f
    RTL871X: PowerOnCheck: 0x100 the result of cmd52 and cmd53 is the same.
    RTL871X: PowerOnCheck: 0x1B8 test Pass.
    RTL871X: _ReadAdapterInfo8723BS, 0x4e=0xe2
    RTL871X: hal_EfuseSwitchToBank: Efuse switch bank to 0
    RTL871X: hal_ReadEFuse_WiFi: data end at address=0xad
    RTL871X: Efuse Realmap:
    08 28 00 62 07 0D 45 10 02 00 00
    29 29 29 29 28 28 2F 2F 2F 2E 2E E0 FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF 2D 2D 2D 2D 2D 2D
    2D 2D 2D 2D 2D E0 FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF 20 2C 20 00 00 00 FF FF
    FF 29 20 11 00 00 00 FF 00 FF 12 FF FF FF FF FF
    3E 10 01 02 23 00 00 FF 20 04 4C 02 26 06 21 02
    0C 00 22 04 00 08 00 32 FF 21 02 0C 00 22 2A 01
    01 00 00 00 00 00 00 00 00 00 00 00 02 00 FF FF
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 EB 00 6E 01 00 00 00 00 FF 80 A5 89 49 6E 81
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    RTL871X: Hal_EfuseParseBTCoexistInfo_8723B: Enable BT-coex, ant_num=1
    RTL871X: Hal_EfuseParsePackageType_8723B phy efuse read 0x1FB =fc
    RTL871X: PackageType = 0x4
    RTL871X: Hal_EfuseParseVoltage_8723B hwinfo[EEPROM_Voltage_ADDR_8723B] =62
    EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
    RTL871X: Hal_EfuseParseVoltage_8723B pHalData->adjuseVoltageVal =6
    RTL871X: AutoloadFail =0,
    RTL871X: pHalData->EEPROMRFGainVal=f0
    RTL871X: EEPRORFGainOffset = 0x29
    RTL871X: SetHwReg8723B: bMacPwrCtrlOn=0
    RTL871X: <==== _ReadAdapterInfo8723BS in 300 ms
    RTL871X: Hal_ChannelPlanToRegulation ChannelPlan:0x20,Regulation(2_4G/5G):0x03,0x03
    RTL871X: init_channel_set ChannelPlan ID 20 Chan num:13
    EXT4-fs (mmcblk0p4): warning: checktime reached, running e2fsck is recommended
    RTL871X: rtw_alloc_macid(eth%d) if1, hwaddr:ff:ff:ff:ff:ff:ff macid:1
    RTL871X: rtw_register_early_suspend
    RTL871X: Init_ODM_ComInfo_8723b(): fab_ver=0 cut_ver=0
    RTL871X: rtw_macaddr_cfg mac addr:80:a5:89:49:6e:81
    RTL871X: bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0
    RTL871X: rtw_ndev_init(wlan0)
    RTL871X: _rtw_drv_register_netdev, MAC Address (if1) = 80:a5:89:49:6e:81
    ......
八、Linux 命令行打开wifi:
    root@android:/ # netcfg
    lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00
    can0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    can1     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    tunl0    DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    wlan0    DOWN                                   0.0.0.0/0   0x00001002 80:a5:89:49:6e:81
    root@android:/ # busybox ifconfig wlan0 up
    RTL871X: +871x_drv - drv_open, bup=0
    RTL871X: FW does not exist before power on!!
    RTL871X: SetHwReg8723B: bMacPwrCtrlOn=1
    RTL871X: PowerOnCheck: val_mix:0x0000063f, res:0x0000063f
    RTL871X: PowerOnCheck: 0x100 the result of cmd52 and cmd53 is the same.
    RTL871X: PowerOnCheck: 0x1B8 test Pass.
    RTL871X: Power on ok!
    RTL871X: rtl8723b_FirmwareDownload fw: FW_NIC, size: 32108
    RTL871X: rtl8723b_FirmwareDownload: fw_ver=23 fw_subver=0000 sig=0x5301, Month=03, Date=26, Hour=14, Minute=35
    RTL871X: rtl8723b_FirmwareDownload(): Shift for fw header!
    RTL871X: polling_fwdl_chksum: Checksum report OK! (1, 0ms), REG_MCUFWDL:0x00070305
    RTL871X: _8051Reset8723: Finish
    RTL871X: _FWFreeToGo: Polling FW ready OK! (297, 30ms), REG_MCUFWDL:0x000702c6
    RTL871X: FWDL success. write_fw:1, 300ms
    RTL871X:  <=== rtl8723b_FirmwareDownload()
    RTL871X: HalDetectPwrDownMode(): PDN=0
    RTL871X: Set RF Chip ID to RF_6052 and RF type to 3.
    RTL871X: _init_available_page_threshold(): Enable Tx FIFO Page Threshold H:0x7a7a,N:0x7575,L:0x7575
    RTL871X: ===>phy_SwChnl8723B: Channel = 1
    RTL871X: pDM_Odm TxPowerTrackControl = 1
    RTL871X: ===>phy_SwChnl8723B: Channel = 1
    RTL871X: #### hw_var_set_opmode() -5250 iface_type(0) mode = 2 ####
    RTL871X: Using the default RF gain.
    RTL871X: MAC Address = 80:a5:89:49:6e:81
    RTL871X: start rtl8723bs_xmit_thread(wlan0)
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=9 seq=0 len=7
    RTL871X: -871x_drv - drv_open, bup=1
    ADDRCONF(NETDEV_UP): wlan0: link is not ready
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=1 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=2 len=7
    root@android:/ # RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=3 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=4 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=5 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=6 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=7 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=8 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=9 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=10 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=11 len=7
    RTL871X: rtl8723b_c2h_packet_handler: C2H, ID=11 seq=12 len=7
    RTL871X: IsBtDisabled=0, IsBtControlLps=0
    RTL871X: ==>rtw_ps_processor .fw_state(8)
    RTL871X: ==>ips_enter cnts:1
    RTL871X: nolinked power save enter
    RTL871X: ===> rtw_ips_pwr_down...................
    RTL871X: ====> rtw_ips_dev_unload...
    RTL871X: rtl8723bs_hal_deinit: issue H2C to FW when entering IPS
    RTL871X: rtl8723b_set_FwPwrModeInIPS_cmd()
    RTL871X: rtl8723bs_hal_deinit  polling REG_HMETFR=0x4, cnt=1
    RTL871X: rtl8723bs_hal_deinit  polling REG_HMETFR=0x0, cnt=2
    RTL871X: rtl8723bs_hal_deinit: write rpwm=81
    RTL871X: rtl8723bs_hal_deinit  polling 0x100=0xea, cnt=1
    RTL871X: polling done when entering IPS, check result : 0x100=0xea, cnt=1, MAC_1cc=0xea
    RTL871X: <=== rtw_ips_pwr_down..................... in 70ms

    root@android:/ # netcfg
    lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00
    can0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    can1     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    tunl0    DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
    wlan0    UP                                     0.0.0.0/0   0x00001043 80:a5:89:49:6e:81

 

时间: 2024-10-28 10:42:02

I.MX6 AW-NB177NF WIFI 驱动移植问题的相关文章

I.MX6 WIFI wireless_tools 移植

/******************************************************************************** * I.MX6 WIFI wireless_tools 移植 * 说明: * 移植完了wifi驱动,现在要能够测试wifi驱动了,但是Android中间层好像出了点 * 问题,所以需要有工具能够直接测试wifi功能,于是找了这个工具移植一下. * * 2016-6-20 深圳 南山平山村 曾剑锋 *******************

wi-fi-请教:在Linux3.0.8 移植usb wifi驱动rtl8189es

问题描述 请教:在Linux3.0.8 移植usb wifi驱动rtl8189es 在Linux3.0.8 移植usb wifi驱动rtl8189es, 采用的非模块加载,直接编进kernel一起烧录: 目前卡在: 不会出现 usbcore: registered new interface driver rtl8189es SDIO卡已经初始化和识卡成功: [ 3.035470] mmc1: new high speed SDIO card at address 0001 网络设备已成功初始化

I.MX6 SHT20 Linux 驱动移植

/*********************************************************************** * I.MX6 SHT20 Linux 驱动移植 * 说明: * 本来打算使用SHT10来做湿度检测,发现其并不是I2C接口,当然也使用 * GPIO能获取到相关数据了,不过由于不小心将其烧坏了,所以换成SHT20. * * 2016-10-10 深圳 南山平山村 曾剑锋 ****************************************

小米随身wifi驱动安装失败解决方法

  小米随身wifi支持windows xp, windows vista 32/64位,windows 7 32/64位 ,windows 8 32/64位usb 2.0接口;符合ieee 802.11n协议,兼容ieee 802.11g和ieee 802.11b标准; 下面,我们就来看看小米随身wifi驱动无法安装的解决方法. 米随身wifi驱动安装失败解决方法: 1.下载最新版本的小米随身wifi驱动,重新安装后,换个usb口重新连接小米随身wifi可以了. 2.安装时,用系统默认的就路径

小米随身wifi驱动怎么安装

  小米随身wifi是小米推出的一款硬件产品,与360随身wifi类似.小米随身wifi需要安装驱动程序才能够正常使用,当插入小米随身wifi时,程序不能自动加载驱动程序,您就需要手动进入小米官网下载并安装驱动了. 小米随身wifi驱动下载安装方法 有时候,在一些电脑中,您的小米随身wifi无法正常工作.这也许是因为管理员限制了相关的电脑操作,此时您就需要自己下载并安装小米随身wifi的驱动程序软件了. 如图所示.进入网站后,您会发现小米随身wifi的驱动下载出现在了小米路由器的页面中,在此您可

win8.1系统怎么安装小米随身wifi驱动?

  win8.1系统安装小米随身wifi驱动教程来啦~很多朋友在win8.1系统中安装小米随身wifi驱动后,都不能正常启动,这是怎么回事呢?下文小编就为大家带来win8.1系统安装小米随身wifi驱动的详细教程,一起去学习下吧. win8.1系统安装小米随身wifi驱动教程: 1.首先下载小米随身WIFI驱动 2.电脑点击打开下载的随身WIFI驱动,这时可以在安装页面选择安装位置,你可以安装在C盘或者其它盘,点击"开始安装",安装完毕点击"开始体验". 这时在电脑

小米随身wifi驱动创建失败怎么办

  大家在使用小米随身wifi驱动的时候会遇到小米随身wifi驱动创建失败的问题,那么应该怎么解决呢?可能是网络的问题也可能是设置的问题,下面有四个方法可以解决小米随身wifi驱动创建失败的问题哦,下面就和小编一起来看看具体怎么操作吧. 小米随身wifi驱动创建失败解决方法一: 1.插上小米随身wifi,电脑会自动生成一个本地连接或者无线网络连接;   2.出现的连接,可能是网线网络链接2或者3或者是其他的,而现在是无线网络连接6; 3.等待小米创建wifi,看到上图就表示小米wifi创建无线网

小米随身wifi驱动安装的正确步骤

  小米随身wifi是很多网友都会选择wifi软,可以将电脑的网络发射成WiFi信号,让手机.平板电脑等其他平台设备进行信号的共享.不过,最近有网友表示,下载的小米随身wifi驱动安装不了,不知道是什么原因.如果您也遇到这个问题,就一起来了解一下今天的小米随身wifi驱动安装的正确步骤! 小米随身wifi 小米随身wifi驱动安装不了是怎么回事? 小米随身wifi支持windows xp, windows vista 32/64位,windows 7 32/64位 ,windows 8 32/6

360随身WiFi驱动安装使用图文教程

  一个小小的USB路由器,只因为是360出的,引起了业内的广泛关注,那么这个360随身WiFi是怎么用的?需要安装驱动吗? 第1步:请点击这里下载驱动(暂不支持Windows8操作系统) 360随身WiFi驱动下载 第2步:将360随身WiFi插入电脑USB接口 第3步:电脑屏幕中会出现免费WLAN名称提示 第4步:在手机上将WiFi设置打开,选择360-xxxx,输入密码连接