Wireless network card device driver solution designed by ARM

Publisher:钱老李Latest update time:2011-06-08 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 implemented 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 the wireless network card of USB device is 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 (UARTs), 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.

2 USB Wireless Network Card Driver
2.1 Linux USB Driver Module Structure

For the USB wireless network card connected to the 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 driver and the USB device driver. In terms of the host control machine, there are mainly two specifications: UHCI and OHCI.
The upper-level 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 device connections, 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) for data transmission between USB device class drivers and USBD, and between USBD and HCD.
2.2 LinUX network driver structure
All Linux network drivers follow a common interface. The object-oriented approach is 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 most important task in the network driver is to complete the device driver layer function to meet the required functions.
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, but 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 importance to USB devices. 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 device endpoint 0, and saves the properties of these resources after parsing in preparation for data transmission.

2.2.2 Design of USB network device driver
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 registers and unregisters the module by calling module_init to initialize a module through the initialization and elimination functions of the display module, and calls the module_exit function when uninstalling.


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 Compilation of 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, the rt73.ko driver module is downloaded to the development board. Since Linux supports dynamic loading of modules, it is very convenient to load the module into the kernel with "insmod". Check the loaded module through "lstood", and then 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, receiving sensitivity, access mode, wireless network standard, and encryption switch.
Finally, write the wireless network startup and self-configuration program to automatically configure the 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 test bandwidth 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 reasons are being analyzed. The test results are shown in Figure 3.

4 Conclusion
Linux is the operating system with the highest usage rate in embedded systems in the market today. Its driver mode supports module stacking technology, and kernel developers have provided some general 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:Wireless network card device driver solution designed by ARM

Previous article:Hardware system structure and software flow of Bluetooth access point based on ARM7
Next article:FPGA driver development for ARM920T based on Linux platform

Recommended ReadingLatest update time:2024-11-17 00:00

Detailed explanation of ARM processing registers and user mode
37 registers The ARM processor has a total of 37 registers, which are divided into several groups (BANK). These registers include: 31 general-purpose registers: including program counter (PC pointer), all 32-bit registers. 6 status registers: used to identify the working status of the CPU and the running status o
[Microcontroller]
Design of GPS Navigation Terminal Based on ARM9 Processor S3C2440
0 Introduction With the popularity of various vehicles such as cars, the demand for vehicle navigation equipment has become increasingly strong. As a vehicle-mounted device, it must not only have reliable performance, but also be portable, low power consumption and low price. The design of a GPS navigation terminal t
[Microcontroller]
Design of GPS Navigation Terminal Based on ARM9 Processor S3C2440
Sharing of design ideas for embedded intelligent monitoring system based on ARM
Combined with the rapid development of ARM embedded systems and intelligent monitoring equipment, an intelligent image monitoring system for abnormal behavior of the elderly based on embedded systems can be realized. The design is different from the traditional monitoring system. It fully combines the advantages of Li
[Microcontroller]
Accelerate automotive software development on NXP S32K3 MCUs with NXP S32DS and IAR for Arm
Accelerate automotive software development on NXP S32K3 MCUs with NXP S32DS and IAR Embedded Workbench for Arm A case study on how to combine the advantages of the original MCU development environment with industry-leading software tools to accelerate the development of mission-critical applications
[Embedded]
Accelerate automotive software development on NXP S32K3 MCUs with NXP S32DS and IAR for Arm
ARM-Linux driver--DM9000 network card driver analysis (Part 3)
ARM-Linux driver--DM9000 network card driver analysis (Part 2) Hardware platform: FL2440 (s3c2440) Kernel version: 2.6.35 Host platform: Ubuntu 11.04 Kernel version: 2.6.39 Cross compiler: arm-linuc-gcc4.3.2 Original work, please indicate the source when reprinting http://blog.csdn.net/yming0221/article/detail
[Microcontroller]
ARM-Linux driver--DM9000 network card driver analysis (Part 3)
The configuration process of external interrupts in ARM is for reference
Recently I looked at the configuration of ARM's external interrupts. The specific configuration is as follows: 1) Enable the port clock; 2) Configure the required port as an input port. The specific registers are: port configuration low register (GPIOx_CRL) and port configuration high register (GPIOx_CRH). For exa
[Microcontroller]
22 commonly used concepts of ARM!
1. Explanation of some common English abbreviations in ARM MSB: most significant bit; LSB: least significant bit; AHB: Advanced High-Performance Bus; VPB: VLSI peripheral bus that connects on-chip and off-chip functions; EMC: External Memory Controller; MAM: Memory Acceleration Module; VIC: Vectored Inte
[Microcontroller]
Application of ARM9 system in intelligent monitoring system of wireless transmitter
1. Overview Guangxi Radio and Television Information Network Co., Ltd. has developed a wireless transmitter remote network monitoring and management system in accordance with the design idea of ​​"someone is left behind, no one is on duty", which conducts remote centralized monitoring and management of 16 r
[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号