zoukankan      html  css  js  c++  java
  • [译]5.2. Device Registration and Initialization 设备注册和初始化

    目录:http://www.cnblogs.com/WuCountry/archive/2008/11/15/1333960.html
     
    [不提供插图,读者最好从网上下载源书]
       
    5.2. Device Registration and Initialization 设备注册和初始化
    For a network device to be usable, it must be recognized by the kernel and associated with the correct driver. The driver stores, in private data structures, all the information needed to drive the device and interact with other kernel components that require the device. The registration and initialization tasks are taken care of partially by the core kernel and partially by the device driver. Let's go over the initialization phases:
    让一个网络设备要正常的使用,必须要让内核可以识别它,而且必须与正确的驱动相关联。在驱动的私有数据结构中,驱动程序保存了所有的用于驱动设备的必要信息以及与内核交互时必须的组件信息。设备的注册和初始化就做这样的事,部份与内核相关,部份与设备驱动相关。让我们大概的看一下初始化的几个阶段:

    Hardware initialization 硬件初始化

    This is done by the device driver in cooperation with the generic bus layer (e.g., PCI or USB). The driver, sometimes alone and sometimes with the help of user-supplied parameters, configures such features of each device as the IRQ and I/O address so that they can interact with the kernel. Because this activity is closer to the device drivers than to the higher-layer protocols and features, we will not spend much time on it. We will see one example for the PCI layer.

    这是通用总线层(例如PCI或者USB)与设备驱动共同合作完成的。驱动有时候是独立的,有时候与用户提供的参数一起,用于配置每个设备的特性,例如IRQ和I/O地址。这样,这些设备就可以与内核交互。因为比起上层的高层协议和特性而言,这些确实更贴近设备驱动一些,因此我们将不会花太的时间在这上面。我们会看到一个关于PCI层的例子。

    Software initialization 软件初始化

    Before the device can be used, depending on what network protocols are enabled and configured, the user may need to provide some other configuration parameters, such as IP addresses. This task is addressed in other chapters.
    在设备可以使用以前,当然设备的使用是依赖于网络协议的使能和配置的,用户可能须要提供一些其它的配置参数,例如IP地址。这一章会讲这些。

    Feature initialization 特性初始化

    The Linux kernel comes with lots of networking options. Because some of them need per-device configuration, the device initialization boot sequence must take care of them. One example is Traffic Control, the subsystem that implements Quality of Service (QoS) and that decides, therefore, how packets are queued on and dequeued from the device egress's queue (and with some limitations, also queued on and dequeued from the ingress's queue).
    Linux内核有很多网络选项,因为它们其中的一些在每个都设备上都要配置,因此设备初始化启动顺序必须小心的应负它们。其中一个例子就是流量控制,实现QoQ的子系统和决策,也就是一个包是如何从出口队列中取出的,以及加入到这个队列上的(其中有一些限制,在入口队列中也是一样有入队和出队问题)。

    We already saw in Chapter 2 that the net_device data structure includes a set of function pointers that the kernel uses to interact with the device driver and special kernel features. The initialization of these functions depends in part on the type of device (e.g., Ethernet) and in part on the device's make and model. Given the popularity of Ethernet, this chapter focuses on the initialization of Ethernet devices (but other devices are handled very similarly).
    我们已经在第2章中看到,net_device数据结构包括了一系列的函数指针,内核用这些指针与这些设备驱动和特殊的内核特性交互。这些函数的初始化有一部份取决于设备的类型(例如以太网),而且还部份取决于设备的制作和模式。给一个最流行的以太网,这一章集中在以太网设备的初始化上(但其它的设备处理是很相似的)。

    Chapter 8 goes into more detail on how device drivers register their devices with the networking code.
    第8章会更用网络代码详细的说明设备驱动是如何注册它们的设备的。

  • 相关阅读:
    在Apache下开启SSI配置支持include shtml html和快速配置服务器
    GitHub命令精简教程
    php读取excel,以及php打包文件夹为zip文件
    Firebug中命令行栏(Commandlinie)的使用介绍和总结
    javascript判断设备类型-手机(mobile)、安卓(android)、电脑(pc)、其他(ipad/iPod/Windows)等
    jquery返回顶部-ie6配合css表达式。
    jquery.cycle.js简单用法实例
    原生javascript操作class-元素查找-元素是否存在-添加class-移除class
    常用css表达式-最小宽度-上下居中
    div模块变灰
  • 原文地址:https://www.cnblogs.com/WuCountry/p/1355601.html
Copyright © 2011-2022 走看看