5.3. Basic goals of NIC initialization basic purpose of NIC Initialization

Source: Internet
Author: User

Directory: http://www.cnblogs.com/WuCountry/archive/2008/11/15/1333960.html
 
[Do not provide illustrations. You are advised to download the source book from the Internet]

5.3. Basic goals of NIC initialization basic purpose of NIC Initialization
Each network device is represented in the Linux kernel by an instance of the net_device data structure. in chapter 8, you will see how net_device data structures are allocated and how their fields are initialized, partly by the device driver and partly by core kernel routines. in this chapter, we focus on how device drivers allocate the resources needed to establish device/kernel communication, such:
Each network device must be represented in the form of a net_device data structure in the Linux kernel. In Chapter 8th, you will see how the net_device data structure is allocated and how the fields are initialized. A part is driven by the device.ProgramInitialize, one part is initialized by the kernel routine. In this chapter, we focus on how device drivers allocate resources that are required for device/kernel Interaction: for example:

IRQ line

As you will see in the section "interaction between devices and kernel," Connecting need to be assigned an IRQ and to use it to call for the kernel's attention when needed. virtual Devices, however, do not need to be assigned an IRQ: the loopback device is an example because its activity is totally internal (see the later section "Virtual Devices ").
As you can see in "interaction between devices and kernel", Nic needs to specify an IRQ so that the kernel can call it as necessary. However, you do not need to specify an IRQ for a virtual device. The loopback device is an example because it is actually completely internal (see "Virtual Devices" in the following section ").

The two functions used to request and release IRQ lines are introduced in the later section "Hardware interrupts. "As you will see in the later section" Tuning via/proc filesystem, "The/proc/interrupts file can be used to view the status of the current assignments.

In the subsequent section "Hardware interrupts.", we will introduce two functions used to apply for and release the IRQ line. You will see in "Tuning via/proc filesystem," that you can see the specified (interrupted) Status of the current system through the/proc/interrupts file.

I/O Ports and memory registration I/O port and memory Registration

It is common for a driver to map an area of its device's memory (its configuration registers, for example) into the system memory so that read/write operations by the driver will be made on system memory addresses directly; this can simplify the code. i/O Ports and memory are registered and released with request_region and release_region, respectively.

Generally, a device maps a piece of its own device memory (for example, its configuration Registration) in the system memory, so that the device's read and write operations can be completed by directly accessing the memory; this simplifiesCode. The I/O port and memory are registered and released respectively through request_region and release_region.

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.