环球电气之家-午夜精彩视频-中国专业电气电子产品行业服务网站!

產(chǎn)品分類

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

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

Porting ART Driver to OpenWRT

發(fā)布日期:2022-10-14 點(diǎn)擊率:37

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

更多
主站蜘蛛池模板: 高防护蠕动泵-多通道灌装系统-高防护蠕动泵-www.bjhuiyufluid.com慧宇伟业(北京)流体设备有限公司 | 物和码官网,物和码,免费一物一码数字化营销SaaS平台 | 智慧钢琴-电钢琴-便携钢琴-数码钢琴-深圳市特伦斯乐器有限公司 | 伸缩节_伸缩器_传力接头_伸缩接头_巩义市联通管道厂 | MOOG伺服阀维修,ATOS比例流量阀维修,伺服阀维修-上海纽顿液压设备有限公司 | 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 全国国际学校排名_国际学校招生入学及学费-学校大全网 | 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 | 泥沙分离_泥沙分离设备_泥砂分离机_洛阳隆中重工机械有限公司 | 杭州营业执照代办-公司变更价格-许可证办理流程_杭州福道财务管理咨询有限公司 | sfp光模块,高速万兆光模块工厂-性价比更高的光纤模块制造商-武汉恒泰通 | 武汉刮刮奖_刮刮卡印刷厂_为企业提供门票印刷_武汉合格证印刷_现金劵代金券印刷制作 - 武汉泽雅印刷有限公司 | 超声波分散机-均质机-萃取仪-超声波涂料分散设备-杭州精浩 | 济南画室培训-美术高考培训-山东艺霖艺术培训画室 | 建筑资质代办-建筑企业资质代办机构-建筑资质代办公司 | 活性炭厂家-蜂窝活性炭-粉状/柱状/果壳/椰壳活性炭-大千净化-活性炭 | 海尔生物医疗四川代理商,海尔低温冰箱四川销售-成都壹科医疗器械有限公司 | 123悬赏网_发布悬赏任务_广告任务平台 | 硫酸亚铁-聚合硫酸铁-除氟除磷剂-复合碳源-污水处理药剂厂家—长隆科技 | 杭州可当科技有限公司—流量卡_随身WiFi_AI摄像头一站式解决方案 | 纯水电导率测定仪-万用气体检测仪-低钠测定仪-米沃奇科技(北京)有限公司www.milwaukeeinst.cn 锂辉石检测仪器,水泥成分快速分析仪-湘潭宇科分析仪器有限公司 手术室净化装修-手术室净化工程公司-华锐手术室净化厂家 | 「阿尔法设计官网」工业设计_产品设计_产品外观设计 深圳工业设计公司 | 江苏皓越真空设备有限公司| 企业微信scrm管理系统_客户关系管理平台_私域流量运营工具_CRM、ERP、OA软件-腾辉网络 | 深圳美安可自动化设备有限公司,喷码机,定制喷码机,二维码喷码机,深圳喷码机,纸箱喷码机,东莞喷码机 UV喷码机,日期喷码机,鸡蛋喷码机,管芯喷码机,管内壁喷码机,喷码机厂家 | 上海租车公司_上海包车_奔驰租赁_上海商务租车_上海谐焕租车 | 20年条刷老厂-条刷-抛光-工业毛刷辊-惠众毛刷| 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 | 粒米特测控技术(上海)有限公司-测功机_减速机测试台_电机测试台 | 氢氧化钾厂家直销批发-济南金昊化工有限公司 | 广州印刷厂_广州彩印厂-广州艺彩印务有限公司 | 集装袋吨袋生产厂家-噸袋廠傢-塑料编织袋-纸塑复合袋-二手吨袋-太空袋-曹县建烨包装 | 杭州代理记账多少钱-注册公司代办-公司注销流程及费用-杭州福道财务管理咨询有限公司 | 泰国试管婴儿_泰国第三代试管婴儿费用|成功率|医院—新生代海外医疗 | 钛板_钛管_钛棒_钛盘管-无锡市盛钛科技有限公司 | 超声波乳化机-超声波分散机|仪-超声波萃取仪-超声波均质机-精浩机械|首页 | 生鲜配送系统-蔬菜食材配送管理系统-连锁餐饮订货配送软件-挪挪生鲜供应链管理软件 | 济宁工业提升门|济宁电动防火门|济宁快速堆积门-济宁市统一电动门有限公司 | 粘度计维修,在线粘度计,二手博勒飞粘度计维修|收购-天津市祥睿科技有限公司 | 苹果售后维修点查询,苹果iPhone授权售后维修服务中心 – 修果网 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 珠海网站建设_响应网站建设_珠海建站公司_珠海网站设计与制作_珠海网讯互联 |