About rt3070 driver compilation (2)

Source: Internet
Author: User

Some time ago, I also compiled an rt3070 driver. The Development Board is mini2440 and kernel 2.6.32. Many problems have been encountered, but all of them have been solved. For details, please refer to the blog. In the past few days, because we have to transplant the Driver Board sam9x5 and kernel 2.3.39 to another board, we thought it would be very easy because of our previous experience. I did not expect any problems, I have never met one before. However, after the effort, we can still solve the problem. The modification of makefile and config. mk will not be discussed step by step. The previous blog has explained the same things. Let's talk about the problem.

At the beginning, I chose platform = IXP. I didn't know much about platform selection. I only knew it was related to the chip, but each platform represented the chip of the manufacturer, if you have any knowledge, please let me know in the comments. Thank you first, because we have also chosen this platform for the use of the Atmel chip on the Internet. The following error occurs during compilation:

Mcuzone/WiFi/rt3070sta/OS/Linux/.../../common/cm_mac_usb.c: In function 'nicinitrec ':
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 789: 3: Error: Implicit declaration of function 'usb _ buffer_alloc'
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 789: 30: Warning: Assignment makes pointer from integer without a cast
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 818: 4: Error: Implicit declaration of function 'usb _ buffer_free'
Make [2]: *** [/mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.o] Error 1
Make [1]: *** [_ module _/mcuzone/WiFi/rt3070sta/OS/Linux] Error 2
Make [1]: Leaving directory '/mcuzone/work/linux-2.6.39'
Make: *** [Linux] Error 2

In the past, similar problems appeared during compilation. I remember the reason why the kernel was not compiled, So I compiled the kernel over and over again, but it was not solved. For more information about Kernel configuration, visit http://blog.csdn.net/unsigned_/article/details/6123876. If you think about the platform, it may be because the platform is different, and the cflag is different. Therefore, we chose the platform that we used previously as platform = pc. The following problems occur during compilation:

/Mcuzone/WiFi/rt3070sta/OS/Linux/.../../common/cm_mac_usb.c: In function 'nicinitrec ':
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 789: 3: Error: Implicit declaration of function 'usb _ buffer_alloc'
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 789: 30: Warning: Assignment makes pointer from integer without a cast
/Mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.c: 818: 4: Error: Implicit declaration of function 'usb _ buffer_free'
Make [2]: *** [/mcuzone/WiFi/rt3070sta/OS/Linux/.../common/cm_mac_usb.o] Error 1
Make [1]: *** [_ module _/mcuzone/WiFi/rt3070sta/OS/Linux] Error 2
Make [1]: Leaving directory '/mcuzone/work/linux-2.6.39'
Make: *** [Linux] Error 2

Because I have configured all the kernel configurations, I don't need to compile them into modules, So I exclude the kernel. This problem was not found in 2.6.32 in the past. This time it was in version 2.3.39, which may be caused by kernel version differences. After efforts have been made to find the 2.6.35 kernel, usb_buffer_alloc
And usb_buffer_free are replaced with usb_alloc_coherent and usb_free_coherent. Therefore, an error is reported during compilation. Modify the include/OS/rt_linux.h file. As follows:

# Define
Rtusb_urb_alloc_buffer (pusb_dev, bufsize, pdma_addr) usb_buffer_alloc (pusb_dev, bufsize, gfp_atomic, pdma_addr)
# Define rtusb_urb_free_buffer (pusb_dev, bufsize, ptransferbuf, dma_addr) usb_buffer_free (pusb_dev, bufsize, ptransferbuf,
Dma_addr)
Replace:
# Define rtusb_urb_alloc_buffer (pusb_dev, bufsize, pdma_addr) usb_alloc_coherent (pusb_dev, bufsize, gfp_atomic, pdma_addr)
# Define rtusb_urb_free_buffer (pusb_dev, bufsize, ptransferbuf, dma_addr) usb_free_coherent (pusb_dev, bufsize, ptransferbuf,
Dma_addr)

Then in make. Pass. The first problem is platform.
= IXP. If you have any experience in solving this problem, please let me know.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.