ARM-based wireless network card device driver solution

Publisher:MysticalGlowLatest update time:2012-12-29 Source: 21ic Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the access of wireless LAN in embedded systems, wireless control and data transmission of embedded systems can be realized, and some special application occasions can be met. Here, through the in-depth understanding and analysis of the Linux device driver of the USB wireless network card, it was successfully transplanted on the Atmel 9261 ARM processor. Wireless LAN access of embedded systems is realized. Using this platform, the handheld data acquisition system of medical gamma cameras and small SPECT equipment can be further designed and improved, so that the control personnel can stay away from the data acquisition site and control the field data and various control signals through the remote terminal, which better solves the security problem.

1 Hardware system composition

1.1 Introduction to USB wireless network card

Wireless network card is an important part of wireless local area network (WLAN). The physical layer and MAC layer of WLAN are completed by the hardware and software of wireless network card, while all layers above LLC layer are realized by computer software. WLAN includes network interface card (referred to as wireless network card) and access point/bridge (AP/bridge) for communication. Among them, wireless network card provides the interface between end-user equipment (handheld device) and access point/bridge. At present, wireless network card is widely used in the form of PCMCIA and CompactFlash (CF) card. Most of the available wireless network cards are based on Intersil Prism or Lucent Hermes chipset, among which wireless network cards for USB devices are supported by Ateml chipset. This system uses D-Link's WLG-122 wireless network card, with Prism2 chipset, which is connected through USB host port.

1.2 System composition

The main controller uses Atmel 9261, with an operating frequency of 180 MHz, 16 KB data cache and 16 KB instruction cache, external 64 MBNAND FLASH and 64 MB SDRAM, and the peripheral interface consists of 10/100 Mb/s adaptive Ethernet card, 3 USB 2.0 interfaces, 2 universal asynchronous receivers and transmitters (UART), LCD interface and serial peripheral interface (SPI), which can be easily connected to external working devices. The operating system uses Linux 2.6.15; the bootloader uses U-boot; the root file system uses ramdisk. After the system starts, the yaffs file system is mounted. The system uses Atmel 9261 development board of Ateml company. The peripheral interface includes 2 USB host interfaces, one of which is connected to an external USB wireless network card. The wireless router uses Cisco-Linksys's WRTl60N, which supports 802.11g standard, TCP protocol and TFTP protocol, as shown in Figure 1.

Figure 1 Hardware structure

2 USB wireless network card driver

2.1 Linux USB driver module structure

For the USB wireless network card in the access system, from the perspective of the CPU, the first thing you see is the USB bus, and then the network card chip, so the USB driver must be implemented before the network card driver. The USB device interface is divided into the host side and the device side, so the USB driver is also divided into the USB host side driver and the USB device side driver. In terms of the host control machine, there are mainly two specifications: UHCI and OHCI.

The upper application software accesses the system's USB devices in the form of a file system. Each USB device connected to the system bus can correspond to one or more drivers at the same time, that is, each USB device can set one or more nodes on the Linux system for application use.

Since the USB interface is a master-slave mode and a tree-like network structure with multiple devices connected, the USB host must have the function of configuring and managing all different types of USB devices connected to the bus. The Linux USB host driver can support multiple USB bus functions at the same time, and each USB bus works independently. The USB host driver consists of three parts: the USB host controller driver (HCD), the USB driver (USBD), and different USB device type drivers. Figure 2 describes the structure of the Linux USB driver. Linux defines a universal request block (URB) to transfer data between the USB device class driver and USBD, and between USBD and HCD.

2.2 LinUX Network Driver Structure

All Linux network drivers follow a common interface. Object-oriented methods are used in design, that is, a device is an object (net device structure), which has its own data and methods. The most basic methods of a network device are initialization, sending and receiving. The structure of the Linux network driver can be divided into four layers: network protocol interface, network device interface, device driver function and network media. The main task of the network driver is to complete the device driver layer function to meet the required functions. [page]

Figure 2 LinUX network driver structure

2.2.1 Access and control of USB wireless network card driver devices

Unlike PCI, ISA and other devices, new generation buses such as USB and 1394 do not have IO/MEM mapping, interrupt and DMA hardware resources. Instead, they are replaced by abstract hardware resource concepts. For USB devices, resources mainly include configuration, interface and endpoint. Among these resources, endpoints are of the most important significance to USB devices. The actual data transmission is achieved through the reading and writing of endpoints. The driver obtains these resources through descriptors. During initialization, the USB driver reads the descriptor from the device endpoint 0, and saves the properties of these resources after parsing to prepare for data transmission.

2.2.2 USB network device driver design

The USB wireless network card driver first registers itself with the USB subsystem, and then uses the vendor id and device id to determine whether the hardware device has been inserted into the bus. The camera driver needs to create a

When the wireless network card is inserted into the USB bus, the USB core will call the Probe method to detect the information passed in to determine whether the wireless network card device matches the driver, and fill in the struct net_device to complete the initialization of the network device. When the wireless network card is unplugged, the USB core will call the Disconnect method to complete the cleanup. The driver initializes a module by calling module_init through the initialization and elimination functions of the display module, and calls the module_exit function when uninstalling. [page]

Among them, the open function mainly completes the initialization of the pAd data structure describing the network card hardware, including the urb packet receiving function, the interface configuration function, the initialization of the send and receive data structure and the MAC address copy function, and finally the net_dev data send and receive function. The RTMPSend-Packets function is responsible for sending the packaged network data packets. The communication between the wireless network card driver and the USB core is transmitted through interrupt/batch mode.

3 Compilation and testing

3.1 Compiling the wireless network card driver

The Linux kernel version of this system is 2.6.15. Configure the kernel on the host machine, remove unnecessary functions in the kernel through "make menuconfig", and add support for WLAN. Click Device Driver→Network device support→Wireless LAN (non-hamradio)→Select Wireless Lan driners (non-hamradio) & Wireless Extensions; then enter the source code of the general USB-WLAN driver, modify the makefile, relocate the kernel folder option to the Linux kernel just compiled, and compile and generate the rt73.ko driver module in this folder through "make".

There are many ways to transfer files in ARM embedded Linux development, such as TFTP service and NFS file system. Here we download the rt73.ko driver module to the development board. Since Linux supports dynamic loading of modules, it is very convenient to load the module into the kernel using "insmod". The loaded module can be checked through "lstood". After that, the rt73 module has been successfully loaded.

Add wireless management applications, iwconfig, iwapy, iwlist, etc. to the development board file system to configure frequency, network, ID, ES-SID, reception sensitivity, access mode, wireless network standard, and encryption switch.

Finally, write the wireless network startup and self-configuration program to realize automatic configuration of IP address and wireless network card. At this point, the entire wireless network card driver has been compiled.

3.2 Test results and analysis

Start the wireless network and write a bandwidth test program. The test program adopts the C/S design mode. The client runs on the ARM development board and the server runs on a Linux PC in the local area network. The workflow of the test program is as follows: the client sends byte streams of different sizes, and the server processes and calculates the corresponding bandwidth to obtain a broadband curve, and then obtains the maximum bandwidth that the network can actually achieve. After repeated tests, the wireless network card can work stably. The bandwidth is 6 Mb/s within a radius of 50 m from the AP, which is still a certain distance from the theoretical value of 54 Mb/s. The specific reason is being analyzed. The test results are shown in Figure 3.

Figure 3 Wireless network broadband test results

4 Conclusion

Linux is the operating system with the highest proportion of embedded systems in the market today. Its driver mode supports module stacking technology, and kernel developers have provided some common modules. Starting from engineering applications, we have studied and transplanted the device driver of USB wireless network card under Linux. Based on this, we can build embedded wireless LAN, and it can also be used in places where wired network cannot be extended or difficult to install, and where there are requirements for flexible mobility and temporary use, such as adding cameras and image processing chips. It can also be used for remote wireless video monitoring in industrial sites.

Keywords:ARM Reference address:ARM-based wireless network card device driver solution

Previous article:Data communication design scheme between ARM and DSP in embedded machine vision system
Next article:Design of fingerprint recognition access control system based on ARM

Recommended ReadingLatest update time:2024-11-16 15:00

Arm: Wu Xiong'ang refused to resign and tried to block Chinese chip companies and Arm's technology
Bloomberg reported that in response to an open letter from Arm China employees, Arm said that the company adheres to its beliefs and commitments, supports Arm China and its employees, and continues to promote innovation and development of China's semiconductor industry. In early June, Arm experienced the much-talked-a
[Mobile phone portable]
Design of portable multi-parameter gas detector for mines based on ARM
0 Preface During the mining process of coal mines, a large amount of toxic and harmful gases and flammable gases, such as CH4, CO, and H2S, will be released. When these gases accumulate to a certain concentration, it will cause breathing difficulties, suffocation and death, and even cause gas explosion accidents, se
[Microcontroller]
Design of portable multi-parameter gas detector for mines based on ARM
Research on infrared vehicle speed management system based on ARM
introduction Vehicles should drive at a speed that matches the road conditions on the highway. Driving too fast is prone to accidents, and driving too slow will become a stumbling block for the following vehicles. However, some drivers often violate traffic rules by not driving at the prescribed speed, resultin
[Microcontroller]
Research on infrared vehicle speed management system based on ARM
Introduction to ARM Cortex-M0 LPC1114
LPC1114 is a 32-bit microcontroller based on the ARM Cortex-M0 core launched by NXP. Its main frequency can reach up to 50MHz, and it has an internal clock generation unit, which can work without an external crystal oscillator. It has an internal 32KB FALSH program memory, 8K SRAM data memory, a fast I2C interface, an
[Microcontroller]
arm BOOT reading notes
[Microcontroller]
9. Learn ARM Cortex-A9 LED assembly and C language driver programming from scratch
0. Introduction Generally, when we buy a development board, the manufacturer will provide the corresponding circuit diagram file, and we can find the corresponding peripherals by searching the corresponding name. For driver engineers, we only need to know some data lines and signal lines for the interaction between th
[Microcontroller]
9. Learn ARM Cortex-A9 LED assembly and C language driver programming from scratch
ARM920T_ kernel und and svc abnormal mode analysis
1. Undefined exception mode 0. When executing undefined instructions, enter und mode and enter the process: The CPU jumps to address 0x4 to execute the code, and automatically saves the CPSR register value to the SPSR register. What we need to do is jump to another code at 0x4, use this code to complete the scene pr
[Microcontroller]
ARM920T_ kernel und and svc abnormal mode analysis
Dynamic Configuration of Interrupt Vector Table in ARM Embedded System
Generally, the interrupt vector table of a 32-bit ARM embedded system is set before the program is compiled. When writing the interrupt service program of a 32-bit ARM embedded system, setting and modifying the interrupt vector table of the ARM architecture, it is often quite troublesome and you have to modify the a
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号