Device Registration and Initialization
来源:互联网 发布:值得买的电子产品知乎 编辑:程序博客网 时间:2024/06/05 16:05
When a Device Is Registered
Loading an NIC’s device driver
An NIC’s device driver is initialized at boot time if it is built into the kernel, and at runtime if it is loaded as a module. Whenever initialization occurs, all the NICs controlled by that driver are registered.
Inserting a hot-pluggable network device
When a user inserts a hot-pluggable NIC, the kernel notifies its driver, which then registers the device. (For the sake of simplicity, we’ll assume the device driver is already loaded.)
When a Device Is Unregistered
Unloading an NIC device driver
This can be done only for drivers loaded as modules, of course, not for those built into the kernel. When the administrator unloads an NIC’s device driver, all the associated NICs must be unregistered.
Removing a hot-pluggable network device
When a user removes a hot-pluggable NIC from a system whose running kernel has support for hot-pluggable devices, the network device is unregistered
Allocating net_device Structures
Network devices are defined with net_device structures.These data structures are allocated with alloc_netdev, defined in net/core/dev.c, which requires three input parameters:
Size of private data structure
the net_device data structure can be extended by device drivers with a private data block to store the driver’s parameters. This parameter specifies the size of the block.
Device name
This may be a partial name that the kernel will complete through some scheme that ensures unique device names.
Setup routine
This routine is used to initialize a portion of the net_device’s fields.
The return value is a pointer to the net_device structure allocated, or NULL in case of errors.
Every device is assigned a name that depends on the device type and that, to be unique, contains a number that is assigned sequentially as devices of the same type are registered. Ethernet devices, for instance, are called eth0, eth1, and so on. A single device may be called with different names depending on the order with which the www.it-devices are registered. For instance, if you had two cards handled by two different modules, the names of the devices would depend on the order in which the two modules were loaded. Hot-pluggable devices lend themselves particularly to unanticipated name changes.
Skeleton of NIC Registration and Unregistration
Device Initialization
- Device Registration and Initialization
- Device Registration and Initialization
- Network Device Initialization
- Chapter 5. Network Device Initialization
- Insight Segmentation and Registration Toolkit
- Rest API registration and login
- Control Initialization and Layout
- 6: Initialization and Cleanup
- Registration
- Registration
- ZigBee 3.0 《Base-Device-Behavior-Specification》--Initialization
- Video4Linux2 part 2: registration and open()
- Microservice Registration and Discovery with Spri
- Compound device and Composite device
- LDD3_NO.5:Initialization and Shutdown
- Cable Modem Initialization and Reinitialization
- Linux Init and System Initialization
- C++ classes and uniform initialization
- .net中使用母版页后获取服务器控件的ID
- Yu Ji
- 正则表达式中最常见的符号和字符
- Spring框架之Filter应用
- Cocos2d-x Sprite 执行 CCFade~ 这类透明度变化动作的一些问题
- Device Registration and Initialization
- IOCP一:AcceptEx
- ZOJ 3787 Access System 模拟
- 界面超漂亮的桌面时钟
- 固定DIV不随滚动条滚动
- 卖票
- STL源码剖析 算法 set
- 查询oracle隐含参数
- 最长不下降子序列