[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Kernel Extensions and Device Support Programming Concepts

FCP Subsystem Overview

The main topics covered in this overview are:

This section frequently refers to both a FCP device driver and a FCP adapter device driver. These two distinct device drivers work together in a layered approach to support attachment of a range of FCP devices. The FCP adapter device driver is the lower device driver of the pair, and the FCP device driver is the upper device driver.

Responsibilities of the FCP Adapter Device Driver

The FCP adapter device driver (the lower layer) is the software interface to the system hardware. This hardware includes the FCP transport layer hardware plus any other system I/O hardware required to run an I/O request. The FCP adapter device driver hides the details of the I/O hardware from the FCP device driver. The design of the software interface allows a user with limited knowledge of the system hardware to write the upper device driver.

The FCP adapter device driver manages the FCP transport layer but not the FCP devices. It can send and receive FCP commands, but it cannot interpret the contents of the command. The lower driver also provides recovery and logging for errors related to the FCP transport layer and system I/O hardware. Management of the device specifics is left to the FCP device driver. The interface of the two drivers allows the upper driver to communicate with different FCP transport layer adapters without requiring special code paths for each adapter.

Responsibilities of the FCP Device Driver

The FCP device driver (the upper layer) provides the rest of the operating system with the software interface to a given FCP device or device class. The upper layer recognizes which FCP commands are required to control a particular FCP device or device class. The FCP device driver builds I/O requests containing device FCP commands and sends them to the FCP adapter device driver in the sequence needed to operate the device successfully. The FCP device driver cannot manage adapter resources or give the FCP command to the adapter. Specifics about the adapter and system hardware are left to the lower layer.

The FCP device driver also provides recovery and logging for errors related to the FCP device it controls.

The operating system provides several kernel services allowing the FCP device driver to communicate with FCP adapter device driver entry points without having the actual name or address of those entry points. The description contained in Logical File System Kernel Services can provide more information.

Communication between FCP Devices

When two FCP devices communicate, one assumes the initiator-mode role, and the other assumes the target-mode role. The initiator-mode device generates the FCP command, which requests an operation, and the target-mode device receives the FCP command and acts. It is possible for a FCP device to perform both roles simultaneously.

When writing a new FCP adapter device driver, the writer must know which mode or modes must be supported to meet the requirements of the FCP adapter and any interfaced FCP device drivers.

Initiator-Mode Support

The interface between the FCP device driver and the FCP adapter device driver for initiator-mode support (that is, the attached device acts as a target) is accessed through calls to the FCP adapter device driver open, close, ioctl, and strategy routines. I/O requests are queued to the FCP adapter device driver through calls to its strategy entry point.

Communication between the FCP device driver and the FCP adapter device driver for a particular initiator I/O request is made through the scsi_buf structure, which is passed to and from the strategy routine in the same way a standard driver uses a struct buf structure.

Related Information

Logical File System Kernel Services

Required FCP Adapter Device Driver ioctl Commands

Understanding the Execution of Initiator I/O Requests

FCP Error Recovery

Understanding the scsi_buf Structure


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]