Sign In
Upload
Manuals
Brands
Compaq Manuals
Software
Tru64 UNIX
User Manuals: Compaq Tru64 UNIX 64-bit Operating System
Manuals and User Guides for Compaq Tru64 UNIX 64-bit Operating System. We have
1
Compaq Tru64 UNIX 64-bit Operating System manual available for free PDF download: Installation Manual
Compaq Tru64 UNIX Installation Manual (159 pages)
Writing Network Device Drivers
Brand:
Compaq
| Category:
Software
| Size: 0.44 MB
Table of Contents
Table of Contents
3
About this Manual
11
Scope of this Manual
12
Related Documentation
14
1 Network Device Driver Environment
19
Sections of a Network Device Driver
20
Include Files Section for a Network Driver
21
Declarations Section for a Network Driver
22
External and Forward Declarations
23
Declaring Softc and Controller Data Structure Arrays
24
Declaring and Initializing the Driver Data Structure
25
Defining Driver-Specific Macros
25
Driver-Specific Macros
27
Configure Section for a Network Driver
28
Autoconfiguration Support Section for a Network Driver
28
Initialization Section for a Network Driver
28
Start Section for a Network Driver
28
Watchdog Section for a Network Driver
29
Reset Section for a Network Driver
29
Ioctl Section for a Network Driver
29
Interrupt Section for a Network Driver
29
Output Section for a Network Driver
29
2 Defining Device Register Offsets
31
Interrupt and Status Register Offset Definitions
31
Command Port Register Offset Definitions
32
Window 0 Configuration Register Offset Definitions
34
Window 0 Configuration Registers
35
Window 3 Configuration Register Offset Definitions
37
Window 3 Configuration Registers
38
Window 1 Operational Register Offset Definitions
39
Window 1 Operational Registers
39
Window 4 Diagnostic Register Offset Definitions
41
Window 4 Diagnostic Registers
41
EEPROM Data Structure Definition
43
3 Defining the Softc Data Structure
45
Defining Common Information
46
Typical Softc Data Structure
46
Enabling Support for Enhanced Hardware Management
48
Defining Media State Information
48
Mapping Alternate Names
48
Defining the Base Register
50
Defining Multicast Table Information
50
Defining the Interrupt Handler ID
50
Defining CSR Pointer Information
50
Defining FIFO Maintenance Information
51
Defining Bus-Specific Information
51
Defining the Broadcast Flag
52
Defining the Debug Flag
52
Defining Interrupt and Timeout Statistics
52
Defining Autosense Kernel Thread Context Information
53
Defining the Polling Context Flag
53
Defining a Copy of the W3_Eeprom Data Structure
54
Declaring the Simple Lock Data Structure
54
4 Implementing the Configure Section
55
Declaring Configure-Related Variables and the Cfg_Subsys_Attr_T Data Structure
55
Setting up the El_Configure Routine
57
5 Implementing the Autoconfiguration Support Section (Probe)
59
Implementing the El_Probe Routine
59
Setting up the El_Probe Routine
60
Checking the Maximum Number of Devices that the Driver Supports
62
Performing Bus-Specific Tasks
62
Allocating Memory for the Softc Data Structure
64
Allocating the Ether_Driver Data Structure
65
Initializing the Enhanced Hardware Management Data Structure
66
Computing the CSR Addresses
66
Setting Bus-Specific Data Structure Members
66
Handling First-Time Probe Operations
68
Handling Subsequent Probe Operations
70
Registering the Interrupt Handler
72
Saving the Controller and Softc Data Structure Pointers
74
Trying to Allocate Another Controller Data Structure
74
Registering the Shutdown Routine
75
Implementing the El_Shutdown Routine
75
Implementing the El_Autosense_Thread Routine
75
Setting up the El_Autosense_Thread Routine
77
Blocking until Awakened
77
Testing for the Termination Flag
78
Starting up Statistics
78
Entering the Packet Transmit Loop
78
Saving Counters Prior to the Transmit Operation
79
Allocating Memory for a Test Packet
79
Using the Default from the ROM
79
Setting the Media in the Hardware
80
Building the Test Packet
80
Transmitting the Test Packet
80
Setting a Timer for the Current Kernel Thread
81
Testing for Loss of Carrier
81
Determining Whether Packets Were Transmitted Successfully
82
Printing Debug Information
82
Setting up New Media
82
Establishing the Media
83
6 Implementing the Autoconfiguration Support Section (Attach)
85
Setting up the El_Attach Routine
85
Initializing the Media Address and Media Header Lengths
86
Setting up the Media
87
Initializing Simple Lock Information
89
Printing a Success Message
90
Specifying the Network Driver Interfaces
90
Setting the Baud Rate
92
Attaching to the Packet Filter and the Network Layer
92
Setting Network Attributes and Registering the Adapter
93
Handling the Reinsert Operation
93
Enabling the Interrupt Handler
94
Starting the Polling Process
94
7 Implementing the Unattach Routine
95
Setting up the El_Unattach Routine
95
Verifying that the Interface Has Shut down
96
Obtaining the Simple Lock and Shutting down the Device
96
Disabling the Interrupt Handler
97
Terminating the Autosense Kernel Thread
97
Unregistering the PCMCIA Event Callback Routine
98
Stopping the Polling Process
98
Unregistering the Shutdown Routine
98
Terminating the Simple Lock
98
Unregistering the Card from the Hardware Management Database
99
Freeing Resources
99
8 Implementing the Initialization Section
101
Implementing the El_Init Routine
101
Setting up the El_Init Routine
101
Determining Whether the PCMCIA Card Is Present
102
Setting the IPL and Obtaining the Simple Lock
102
Calling the El_Init_Locked Routine
103
Releasing the Simple Lock and Resetting the IPL
103
Returning the Status from the El_Init_Locked Routine
103
Implementing the El_Init_Locked Routine
103
Resetting the Transmitter and Receiver
104
Clearing Interrupts
104
Starting the Device
105
Ensuring that the 10Base2 Transceiver Is off
105
Setting the LAN Media
106
Setting a LAN Attribute
107
Selecting Memory Mapping
107
Resetting the Transmitter and Receiver Again
107
Setting the LAN Address
108
Processing Special Flags
108
Setting the Debug Flag
109
Enabling TX and RX
109
Enabling Interrupts
110
Setting the Operational Window
110
Marking the Device as Running
110
Starting the Autosense Kernel Thread
111
Starting the Transmit of Pending Packets
111
9 Implementing the Start Section
113
Implementing the El_Start Routine
113
Setting the IPL and Obtaining the Simple Lock
113
Calling the El_Start_Locked Routine
114
Releasing the Simple Lock and Resetting the IPL
114
Implementing the El_Start_Locked Routine
115
PCMCIA Card
115
Removing Packets from the Pending Queue and Preparing
116
The Transmit Buffer
118
Transmitting the Buffer
118
Accounting for Outgoing Bytes
119
Updating Counters, Freeing the Transmit Buffer, and Marking the Output Process as Active
119
Indicating When to Start the Watchdog Routine
120
10 Implementing a Watchdog Section
121
Setting the IPL and Obtaining the Simple Lock
121
Incrementing the Transmit Timeout Counter and Resetting
122
Releasing the Simple Lock and Resetting the IPL
122
Resetting the Unit
122
11 Implementing the Reset Section
123
Implementing the El_Reset Routine
123
Implementing the El_Reset_Locked Routine
124
12 Implementing the Ioctl Section
125
Network Ioctl Commands
125
Setting up the El_Ioctl Routine
126
Determining Whether the User Has Removed the PCMCIA
127
Setting the IPL and Obtaining the Simple Lock
127
Card from the Slot
127
Enabling Loopback Mode (SIOCENABLBACK Ioctl Command)
128
Disabling Loopback Mode (SIOCDISABLBACK Ioctl Command)
128
Reading Current and Default MAC Addresses (SIOCRPHYSADDR Ioctl Command)
129
Setting the Local MAC Address
129
Adding the Device to a Multicast Group (SIOCADDMULTI Ioctl Command)
130
Deleting the Device from a Multicast Group (SIOCDELMULTI Ioctl Command)
131
Accessing Network Counters (SIOCRDCTRS and SIOCRDZCTRS Ioctl Commands)
132
Bringing up the Device (SIOCSIFADDR Ioctl Command)
133
Network Interface Counter Types
133
Using Currently Set Flags (SIOCSIFFLAGS Ioctl Command)
134
Setting the IP MTU (SIOCSIPMTU Ioctl Command)
134
Setting the Media Speed (SIOCSMACSPEED Ioctl Command)
134
Resetting the Device (SIOCIFRESET Ioctl Command)
135
Setting Device Characteristics (SIOCIFSETCHAR Ioctl Command)
135
Releasing the Simple Lock and Resetting the IPL
137
13 Implementing the Interrupt Section
139
Implementing the El_Intr Routine
139
Setting the IPL and Obtaining the Simple Lock
140
Rearming the Next Timeout
140
Reading the Interrupt Status
141
Processing Completed Receive and Transmit Operations
141
Acknowledging the Interrupt
142
Transmitting Pending Frames
142
Releasing the Simple Lock and Resetting the IPL
142
Indicating that the Interrupt was Serviced
143
Implementing the El_Rint Routine
143
Counting the Receive Interrupt and Reading the Receive Status
143
Pulling the Packets from the FIFO Buffer
144
Examining the First Part of the Packet
145
Copying the Received Packet into the Mbuf
146
Discarding a Packet
147
Implementing the El_Tint Routine
148
Counting the Transmit Interrupt
148
Reading the Transmit Status and Counting All Significant Events
148
Managing Excessive Data Collisions
149
Writing to the Status Register to Obtain the Next Value
149
Queuing Other Transmits
150
Implementing the El_Error Routine
150
14 Network Device Driver Configuration
151
Index
153
Advertisement
Advertisement
Related Products
Compaq TP Desktop Connector AA-PVNFG-TE
Compaq Compaq TCP/IP Services for OpenVMS
Compaq Thin Clients
Compaq TruCluster Server AA-RHGWB-TE
Compaq TruCluster Server AA-RHGWC-TE
Compaq TFT8030
Compaq t1000 Series
Compaq TFT450
Compaq STORAGEWORKS TL881
Compaq T1010 - Windows-based Terminals - 48 MB RAM
Compaq Categories
Desktop
Laptop
Server
Monitor
Storage
More Compaq Manuals
Login
Sign In
OR
Sign in with Facebook
Sign in with Google
Upload manual
Upload from disk
Upload from URL