<rt id="m4md3"></rt>
  • <bdo id="m4md3"><meter id="m4md3"></meter></bdo>
  • <label id="m4md3"></label>
      <center id="m4md3"><optgroup id="m4md3"></optgroup></center>
      產(chǎn)品分類

      當前位置: 首頁 > 工業(yè)電子產(chǎn)品 > 其他電子產(chǎn)品 > 開發(fā)板,套件,編程器 > 開發(fā)板

      類型分類:
      科普知識
      數(shù)據(jù)分類:
      開發(fā)板

      Porting ART Driver to OpenWRT

      發(fā)布日期:2022-10-14 點擊率:34

      OpenWRT is a popular wireless router OS, and ART (Atheros Radio Test) is a radio test tool provided by Qualcomm Atheros. If anyone want to test radio performance in OpenWRT OS, one thing has to to be done is that porting ART driver to OpenWRT. A friend of mine was looking for OpenWRT ART driver and I spent a lot of time on porting it. Fortunately, I finally succeeded and I like to share it with the readers of my blog in this post.

      By the way, my English is not very good, if there is any mistake, please correct me.

      Step 1, modify makefile.artmod to match with the specified kernel path and toolchain path.

      KDIR := /home/tom/openwrt/trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.7  
      PWD := $(shell pwd)   
      ROOTDIR := $(PWD)/modules  
      # Default architecture is MIPS  
      ARC :=mips  CROSS_CC :=/home/tom/openwrt/trunk/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-

      Step 2, by not making any code changes, starting compile and I got the error below.

      error: unknown field ‘ioctl’ specified in initialize

      I have encountered similar problem during porting ART driver for Freescale i.MX6 processor. Change ioctl into compat_ioctl of dk_fops structure located in modules/dk_func.c, compile again and there are no errors about ioctl.

      Step 3, a new error as below.

      error: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)

      Modify related code from

      spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;

      to

      DEFINE_SPINLOCK(driver_lock);

      Step 4, compile the source code once again and art.ko kernel module is avilable in modules directory.

      Step 5, upload art.ko to a web server and download it into DUT by wget command.

      Step 6, load DUT by artgui, error is reported in console window as below.

      deviceInit devIndex=0 device_fn=0 pdkInfo=0  
      Opening device /dev/dk0  
      Error: get version ioctl failed !  
      < 6006 ERROR Anwi driver load error.  
      < 7502 CONTROL OFF  
      < 7504 INFO |set|devid||  
      < 7504 INFO |set|mac||  
      < 7504 INFO |set|customer||  
      < 7506 CONTROL DONE load devid=-1; caldata=auto;

      the screenshot is attached below

      Step 7, dk_fop structure is defined as below in higher ART version.

      #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31) 
      static long dk_ioctl_new(struct file *file, unsigned int cmd, unsigned long arg) 
      { struct inode *inode = file->f_path.dentry->d_inode; 
      long ret; 
      ret = dk_ioctl(inode, file, cmd, arg); return ret; } 
      #endif

      A new ioctl is defined and it takes effect when kernel version is above 2.6.31.

      Step 8, modify dk_fops structure defined in lower ART version as below.

      static long dk_ioctl_new(struct file *file, unsigned int cmd, unsigned long arg) { 
      struct inode *inode = file->f_path.dentry->d_inode; 
      long ret; 
      ret = dk_ioctl(inode, file, cmd, arg); return ret; 
      }  
      
      static struct file_operations dk_fops = { 
      owner: THIS_MODULE, 
      open: dk_open, 
      release: dk_release, 
      mmap: dk_mmap, 
      unlocked_ioctl: dk_ioctl_new };

      Step 9, compile again and download art.ko into DUT, using artgui to load DUT and thers is no error in console window as below.

      下一篇: PLC、DCS、FCS三大控

      上一篇: 修改OpenWRT的發(fā)射功

      推薦產(chǎn)品

      更多
      主站蜘蛛池模板: 亚洲国产综合久久天堂| 成人综合久久综合| 国产综合精品在线| 国产精品综合专区中文字幕免费播放| 五月综合激情婷婷六月色窝| 久久综合久久综合九色| 国产综合久久久久鬼色| 亚洲av一综合av一区| 色噜噜狠狠色综合久| 91精品国产综合久久青草| 亚洲伊人久久成综合人影院| 亚洲国产综合精品| 99久久综合狠狠综合久久止| 青青草原综合久久大伊人精品| 狠狠色色综合网站 | 亚洲精品第一综合99久久| 丁香五月天综合缴情网| 天天综合天天做天天综合| 亚洲综合在线观看视频| 国产综合精品女在线观看| 色婷婷久久综合中文久久一本| 狠狠色成人综合首页| 色综合色天天久久婷婷基地| 久久综合精品视频| 亚洲综合国产一区二区三区| 国产精品亚洲综合一区| 激情综合婷婷丁香五月蜜桃| 一本久久综合亚洲鲁鲁五月天| 色偷偷91久久综合噜噜噜| 亚洲欧美成人综合久久久 | 国产成人亚综合91精品首页| 亚洲日韩久久综合中文字幕| 久久综合久久综合亚洲| 曰韩人妻无码一区二区三区综合部| 亚洲综合久久成人69| 伊人yinren6综合网色狠狠| 国产成人综合亚洲绿色| 中文字幕亚洲综合久久男男| 色777狠狠狠综合| 狠狠综合久久av一区二区| 国产综合免费精品久久久|