Linux OS
The Linux OS component consists of the OS abstraction and PCI subcomponents, as described in the following sections.
OS Abstraction
The transport, HAL, and SLI layers achieve operating system independence through the use of an OS abstraction. The required functionality includes:
-
Defining all common objects (that is, DMA, SLI port, domain, and remote node).
-
Declaring endianess and providing functions for converting between host order and big-endian byte order.
-
Busy-wait or delay function.
-
Memory copy and set routines.
-
Memory allocation, free, and cache coherency functions for both CPU and DMA memory types.
-
Locking for concurrency protection.
-
Linked list and associated operations.
-
Bitmap and associated operations.
-
PCI register access.
In most cases, the OS abstractions have been implemented with macros or in-line functions.
PCI
The ocs_lnx.c file contains code for performing PCI-related operations and interrupt handling. The ocs_pci_probe() and ocs_pci_remove() functions provide two main PCI operations:
-
ocs_pci_probe() – allocates required structures, sets up interrupt handling, and sets up the hardware through the HAL. It also registers callback functions with the HAL, and requests the HAL to bring the port online.
-
ocs_pci_remove() – performs the reverse of ocs_pci_probe(). It requests the HAL to shutdown the port, releases resources, and unregisters the interrupt handler.
Interrupt handling begins with the interrupt service routine, ocs_intr_msix(). This function launches a tasklet to perform interrupt services. This tasklet (ocs_tasklet) calls
ocs_hal_process() in the HAL to process the interrupt.
The ocs_lnx.c file also contains module parameters that can be set when the module is loaded. See the
OneCore Storage Quick Start Guide for a list of available module parameters.