Adaptec 1737100 Programmer Manual - Page 161
Sample Driver
UPC - 760884136362
View all Adaptec 1737100 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 161 highlights
8 w w w w Sample Driver The following sample driver documentation is intended as a guide for the software developer writing a device driver for the Adaptec AIC-6915 Ethernet Network Controller. It is designed to complement the driver source code in the DDK and to serve as a basic checklist for driver development. Initialization of the controller, receive and transmit queues, and interrupt handling are covered in this document. All register fields discussed here must be initialized by the driver to provide basic functionality. Although the examples contained in this section are based on the Windows NT environment, the concepts may be ported to any operating system. These examples have been simplified here for clarity and do not necessarily represent code which can be compiled. Refer to the source code in the DDK for complete source code. Code Conventions The code examples shown in this documentation utilize several C macros to demonstrate driver initialization of the AIC-6915. The actual implementation of these macros is operating system-specific. These macros include the following: s AIC6915_READ_REG (AIC-6915 Register, & LocalVariable) s This macro reads from the register located at address AIC-6915REGISTER, and returns the value in LOCALVARIABLE. In the NT environment, this macro is defined as a call to NDISREADREGISTERULONG. s AIC6915_WRITE_REG (AIC-6915 Register, LocalVariable) s This macro writes the value LOCALVARIABLE to address AIC-6915REGISTER. In the NT environment, this macro is defined as a call to NDISWRITEREGISTERULONG. s AIC6915_ALLOC_MEMORY (Status, & Address, Length) s This macro translates to an operating system-specific call to allocate memory for buffer or completion descriptors. A block of memory of size LENGTH is returned in variable ADDRESS. s Adapter structure This structure contains device-specific information that must be maintained globally. The element REGISTERBASEVA points to the beginning of the AIC-6915 register address space, and is a structure that contains all AIC-6915 registers. 8-1