RT3070 imx28 SoftAP功能移植。

RT3070 imx28 SoftAP功能移植。

分类: LINUX

/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-linux-strip udhcpd
1.#PATH=$PATH:/etc/apache/bin
/home/liyun/work/ltib/rpm/BUILD/linux-2.6.35.3
/home/liyun/maye9/ltib/rpm/BUILD

一:DHCP服务器端:(编译器)
1. 修改Makefile: 添加:     CROSS_COMPILE=arm-linux-
2. #make , 把生成的dhcpd文件下载到板子上.
make LDFLAGS="-static"
我编译时提示有个C文件出错,是因为文件中switch case 少了个break。
使用/usr/local/arm/2.95.3/bin/arm-linux-strip处理一下,
3. #cp samples/udhcpd.conf    /etc/                #copy udhcp/samples下的文件到目标板子的 /etc目录
4. # vi /etc/udhcpd.conf: 修改如下:
3 # The start and end of the IP lease block
4
5 start       192.168.1.20    #default: 192.168.0.20   为winXP的ip地址范围
6 end        192.168.1.25    #default: 192.168.0.254

9 # The interface that udhcpd will use
10
11 interface   wlan0       #default: eth 0#目标板子上的无线网卡wlan0 ,按照实际情况改写如ra0等
85 #Examles
86 opt dns 222.201.130.30 222.201.130.33   #dns服务器
87 option subnet 255.255.255.0
88 opt router 192.168.1.10                       #wlan的 ip地址,做为网关地址
89 #opt    wins    192.168.10.10              #注释掉
90 option dns 192.168.1.10 # appened to above DNS servers for a total of 3
91 option domain local
92 option lease   864000      # 10 days of seconds
5# ./dhcpd //运行dhcpd服务器
到此DHCP服务器运行成功。
 
 
二:SoftAP功能移植。
参考 http://my.oschina.net/wuying/blog/54939中博客。在此感谢分享。
/
//environment:
//       compile system:Ubantu 10.04
//       target system:   imx28
//       resource:            RT3070_SoftAP_v2.4.0.rar
                                   ltib --- L2.6.35_10.11.01_ER_source.tar.gz 
//       cross compile:   arm-none-linux-gnueabi-   
//ps :                           My English is the primary level(most of YouDao) --   Welcome Guidance
//reference:               http://blog.csdn.net/king_sundi/article/details/6158475
                                   http://blog.csdn.net/linfeng999/article/details/6410224                                       
//
/compile rt3070ap///
("-" remove row, "+" add row )
$ cd 2010_0203_RT3070_SoftAP_v2.4.0.1_DPA
$ vim MODULE/Makefile
   -PLATFORM = PC
   +PLATFORM = SMDK
    ifeq ($(PLATFORM),SMDK)
    -LINUX_SRC = /home/bhushan/itcenter/may28/linux-2.6-samsung
    -CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
    +LINUX_SRC = /home/lin/Desktop/linux-2.6.35.3
    +CROSS_COMPILE = /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
     endif
$ vim NETIF/Makefile
$ vim UTIL/Makefile
  repair the same as MODULE/Makefile
 
// repair usb_buffer_free and usb_buffer_allow error
$ vim UTIL/os/linux/rt_usb_util.c
  repair following:
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
  void *rausb_buffer_alloc(struct usb_device *dev,
         size_t size,
         gfp_t mem_flags,
         dma_addr_t *dma)
  {
   - return usb_buffer_alloc(dev, size, mem_flags, dma);
   + return usb_alloc_coherent(dev, size, mem_flags, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_alloc); 
  void rausb_buffer_free(struct usb_device *dev,
         size_t size,
         void *addr,
         dma_addr_t dma)
  {
   - usb_buffer_free(dev, size, addr, dma);
   + usb_free_coherent(dev, size, addr, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_free);
  #endif // LINUX_VERSION_CODE //
 
//repair rt3070ap: module license 'RALINK' taints kernel.
$ vim NETIF/os/linux/usb_main_dev.c
     +MODULE_LICENSE("GPL");
$ vim MODULE/common/rtmp_init.c
  repair following:
  #ifdef RTMP_MAC_USB
  - MODULE_LICENSE("RALINK");
  + MODULE_LICENSE("GPL");
  #endif // RTMP_MAC_USB //
 
  + #ifndef RTMP_MAC_USB
  + MODULE_LICENSE("GPL");
  + #endif
 
$ sudo make ARCH=arm KBUILD_NOPEDANTIC=1
//compile dhcpd
$ cd ltib/
$ ./ltib -c
Package list  --->
 [*] dhcp                                                     
   [*]   Include DHCP server                            
   [*]   Include DHCP client support
$ cp rootfs/usr/sbin/dhcpd   @target rootfs/usr/local/bin/dhcpd
//configuration dhcpd/
reference google (dhcpd 配置)
example:
ddns-update-style ad-hoc;
deny client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
default-lease-time 21600;
max-lease-time 43200;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address  192.168.1.255;
option domain-name " http://my.oschina.net/wuying";
option domain-name-servers 192.169.1.10;
option netbios-name-servers     192.168.1.10;
option www-server               192.168.1.10;
range  192.168.1.20 192.168.1.25;
}
$ mkdir -p @target rootfs/var/state/dhcp/
$ touch @target rootfs/var/state/dhcp/dhcpd.leases
 
//powerboot/
// cp *.ko to filesystem
$ tar -jxvf rootfs.tar.bz2 /tftpboot/
$ sudo make -p /tftpboot/usr/local/module
$ sudo cp MODULE/os/linux/*.ko /tftpboot/usr/local/module
$ sudo cp NETIF/os/linux/*.ko /tftpboot/usr/local/module
$ sudo cp UTIL/os/linux/*.ko /tftpboot/usr/local/module
// cp ap-set.dat to filesystem
$ sudo make -p /tftpboot/etc/Wireless/RT2870AP
$ sudo cp MODULE/RT2870AP.dat /tftpboot/etc/Wireless/RT2870AP/

// set ap argument
$ vim /tftpboot/etc/Wireless/RT2870AP/RT2870AP.dat
// set powerboot
$ vim /etc/rc.d/rcS
----Added to the last line of behind
+ #install rc3070ap
+ insmod /usr/local/module/rtutil3070ap.ko
+ insmod /usr/local/module/rt3070ap.ko
+ insmod /usr/local/module/rtnet3070ap.ko
+ #run rc3070ap
+ ifconfig ra0 192.168.1.19
+ /usr/local/bin/dhcpd
 
在移植的过程中insmod时出现,如下错误
代码:
# dmesg | grep atl1c
atl1c: disagrees about version of symbol alloc_etherdev_mqs
atl1c: Unknown symbol alloc_etherdev_mqs (err -22)
atl1c: disagrees about version of symbol __vlan_hwaccel_rx
atl1c: Unknown symbol __vlan_hwaccel_rx (err -22)
atl1c: disagrees about version of symbol skb_put
atl1c: Unknown symbol skb_put (err -22)
atl1c: disagrees about version of symbol consume_skb
atl1c: Unknown symbol consume_skb (err -22)
atl1c: disagrees about version of symbol __netif_schedule
atl1c: Unknown symbol __netif_schedule (err -22)
atl1c: disagrees about version of symbol unregister_netdev
atl1c: Unknown symbol unregister_netdev (err -22)
atl1c: disagrees about version of symbol ___pskb_trim
atl1c: Unknown symbol ___pskb_trim (err -22)
atl1c: disagrees about version of symbol eth_validate_addr
atl1c: Unknown symbol eth_validate_addr (err -22)
atl1c: disagrees about version of symbol pskb_expand_head
atl1c: Unknown symbol pskb_expand_head (err -22)
atl1c: disagrees about version of symbol eth_type_trans
atl1c: Unknown symbol eth_type_trans (err -22)
atl1c: disagrees about version of symbol __napi_schedule
atl1c: Unknown symbol __napi_schedule (err -22)
atl1c: disagrees about version of symbol ethtool_op_set_sg
atl1c: Unknown symbol ethtool_op_set_sg (err -22)
atl1c: disagrees about version of symbol netif_device_detach
atl1c: Unknown symbol netif_device_detach (err -22)
atl1c: disagrees about version of symbol netif_device_attach
atl1c: Unknown symbol netif_device_attach (err -22)
atl1c: disagrees about version of symbol dev_kfree_skb_irq
atl1c: Unknown symbol dev_kfree_skb_irq (err -22)
atl1c: disagrees about version of symbol dev_kfree_skb_any
atl1c: Unknown symbol dev_kfree_skb_any (err -22)
atl1c: disagrees about version of symbol netif_napi_add
atl1c: Unknown symbol netif_napi_add (err -22)
atl1c: disagrees about version of symbol netif_receive_skb
atl1c: Unknown symbol netif_receive_skb (err -22)
atl1c: disagrees about version of symbol register_netdev
atl1c: Unknown symbol register_netdev (err -22)
atl1c: disagrees about version of symbol free_netdev
atl1c: Unknown symbol free_netdev (err -22)
atl1c: disagrees about version of symbol ethtool_op_get_link
atl1c: Unknown symbol ethtool_op_get_link (err -22)
atl1c: disagrees about version of symbol dev_alloc_skb
atl1c: Unknown symbol dev_alloc_skb (err -22)
atl1c: disagrees about version of symbol netif_carrier_off
atl1c: Unknown symbol netif_carrier_off (err -22)
atl1c: disagrees about version of symbol ethtool_op_get_sg
atl1c: Unknown symbol ethtool_op_get_sg (err -22)
atl1c: disagrees about version of symbol netif_carrier_on
atl1c: Unknown symbol netif_carrier_on (err -22)
atl1c: disagrees about version of symbol napi_complete
atl1c: Unknown symbol napi_complete (err -22)

搜索到解决方法:
The "disagrees about version of symbol" errors seem to imply that your kernel and atl1c modules were built with different compiler versions or very different configurations.
Try rebuilding the kernel (including the Atheros/Attansic modules) from scratch:
make clean
make
make modules_install
Strange, the --clean argument should have helped. But perhaps doing the following will make a difference:
1. back up your kernel .config file (cp /usr/src/linux/.config /usr/src/my.config)
2. cd /usr/src/linux; make mrproper
3. restore the .config file (cp /usr/src/my.config /usr/src/linux/.config)
4. and finally, run genkernel.
是因为用错了kernel,要保持和编译过的kernel移植,包括编译器版本。
把udhcpd.conf中的 interface   wlan0       #default: eth 0 改为ra0.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值