In General, we compile the kernel, the device driver selection in two ways: directly compiled into the kernel, the other is to module hooks.
CS8900 network adapter driver if a module hooks, function init_module is the importers; if you are directly compiled into the kernel, then the function is the importers cs89x0_probe. In this entry function, will complete the network card driver's initialization. If a registered virtual address, device number, interrupt, and various related register initialization. Cs89x0_probe function will call the initialization function cs89x0_probe1 real. Following that the initialization function, you need to complete several important areas: 1, registered virtual address. Registration through the request_region function virtual address. In the inside, our kenel operations register addresses are actually virtual addresses, but each register has a unique virtual addresses and their corresponding physical address because the kernel inside any virtual address flowing through the MMU into physical addresses. So in the kernel, are defined to be used to register, you must use a function ioremap will we have to use the register to the physical address is converted into the kernel, you can manipulate virtual address to be used for specific action, otherwise everything is in vain. Ioaddr = (int) ioremap (BASE_ADDR, 16); net_device structure 2, fill the form. The structure members are and network equipment-related variables. The more important of the two: dev_addr and open. Dev_addr RI to deposit is the host's MAC address, generally is read in from eeproom then hold to that variable, and of course you can also manually according to your needs. for(i=0;iLinxu Security , the latest breaking news and information on security, linux, open source, firewalls
Tuesday, November 30, 2010
Linux driver porting kernel2.6.25 CS8900 network adapter
Labels:
[:]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment