<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 點擊率:35

      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)品

      更多
      主站蜘蛛池模板: 色综合热无码热国产| 狠狠色狠狠色综合日日不卡| 久久99精品综合国产首页| 久久午夜综合久久| 久久丁香五月天综合网| 久久综合久久自在自线精品自 | 伊人婷婷综合缴情亚洲五月| 亚洲国产aⅴ综合网| 一本大道久久a久久精品综合| 亚洲综合亚洲国产尤物| 色噜噜狠狠色综合中国| 色久综合网精品一区二区| 丁香婷婷激情综合俺也去 | 一本久久知道综合久久| 亚洲国产成人综合| 狠狠色丁香婷婷综合| 久久乐国产综合亚洲精品| 亚洲综合国产一区二区三区| 日韩综合在线视频| 国产成人亚洲综合一区| 狠狠狠色丁香婷婷综合久久俺| 另类小说图片综合网| 亚洲综合一区二区精品久久| 伊人色综合久久天天人守人婷 | 国产精品无码久久综合| 一本久道久久综合多人| 热久久综合这里只有精品电影| 99久久综合狠狠综合久久aⅴ | 亚洲伊人tv综合网色| 伊人婷婷综合缴情亚洲五月| 亚洲精品第一国产综合境外资源 | 色综合色综合色综合| 国产综合久久久久鬼色| 色欲香天天综合网站| 亚洲欧美日韩综合俺去了| 99久久婷婷国产综合精品| 亚洲综合欧美色五月俺也去| 亚洲综合视频在线| 亚洲人成综合网站7777香蕉| 久久精品桃花综合| 亚洲精品第一国产综合精品99|