MACsec Intel® FPGA System Design User Guide

ID 767516
Date 3/31/2024
Public
Document Table of Contents

6.4.1. McDMA Driver Kernel Module

The McDMA Kernel Driver scans the devices and identify McDMA device based on the vendor ID and device ID, enables the bus mastership and maps the BAR area of corresponding devices by using linux existing PCI framework. As part of the probing, a driver creates the Ethernet interface and registers the device to linux network framework.

The McDMA Driver has the following components which include MACsec IP APIs. The MCDMA netdev driver is used with a few additional changes made to incorporate the MACsec IP APIs.

  1. ifc_mcdma_netdev_init_module()

    This is the module init function of McDMA kernel module. It is called when module is inserted and has the following functionalities:

    1. Registers generic netlink family.
    2. Registers McDMA pci driver structure.
    3. Allocated the memory for MACsec IP structure.
  2. ifc_mcdma_netdev_exit_module()

    This is module exit function of McDMA kernel module. It is called when module is removed. It unregisters netlink family and pci driver structure.

  3. ifc_mcdma_probe()
    This is the pci driver hardware probe routine. It does the following:
    1. Scans the devices and identify device based on vendor ID and device ID.
    2. Maps the BAR regions of corresponding devices by using linux existing PCI framework.
    3. Maps available interrupts and registers MACsec interrupt-handler function.
    4. Enables PCI device.
  4. ifc_mcdma_remove()
    This is the pci driver hardware remove routine. It does the following:
    1. Unregisters the interrupts.
    2. Unmaps the BAR regions.
    3. Disables PCI device.
  5. ifc_mcdma_netdev_open()
    This function does the following:
    1. Iterate through exiting interfaces to get MACsec type dev.
    2. Gets linked interface/lower interface of the MACsec interface.
    3. Sets Offload feature and MACsec Ops i.e intel_macsec_ops().
    4. Initialize the MACsec IP i.e to default CSRs and does the soft-reset.