AFHBA404
AFHBA404 connects ACQ2106 to PCI-Express
Classes | Macros | Enumerations | Functions | Variables
acq-fiber-hba.h File Reference
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/init.h>
#include <linux/timex.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <uapi/linux/sched/types.h>
#include "afhba_minor.h"
#include "afhba_debugfs.h"
#include "rtm-t_ioctl.h"

Go to the source code of this file.

Classes

struct  HostBuffer
 
struct  AFHBA_DEV
 
struct  AFHBA_DEV::PciMapping
 
struct  AFHBA_DEV_PATH
 

Macros

#define assert(p)
 
#define MAXDEV   8 /* maximum expected devices .. */
 
#define REGS_BAR   0 /* @@todo assumed */
 
#define MAP_COUNT_MAX   6
 
#define MAP_COUNT_4G1   2
 
#define MAP_COUNT_4G2   4
 
#define MAP_COUNT_4G4   6
 
#define SZM1(field)   (sizeof(field)-1)
 
#define PSZ   (sizeof (struct AFHBA_DEV_PATH))
 
#define PD(file)   ((struct AFHBA_DEV_PATH *)(file)->private_data)
 
#define DEV(file)   (PD(file)->dev)
 
#define pdev(adev)   (&(adev)->pci_dev->dev)
 
#define LOC(adev)   ((adev)->mappings[0].va)
 
#define REM(adev)   ((adev)->remote)
 
#define REGS_BAR   0
 
#define REMOTE_BAR   1
 
#define REMOTE_BAR2   2
 
#define NO_BAR   -1
 
#define FPGA_REVISION_REG   0x0000 /* FPGA Revision Register */
 
#define HOST_PCIE_CONTROL_REG   0x0004 /* Host PCIe Control / Status Register */
 
#define HOST_PCIE_INTERRUPT_REG   0x0008 /* Host PCIe Interrupt Register Register */
 
#define PCI_CONTROL_STATUS_REG   0x000C /* PCI Control / Status Register */
 
#define PCIE_DEVICE_CONTROL_STATUS_REG   0x0010 /* PCIe Control / Status Register */
 
#define PCIE_LINK_CONTROL_STATUS_REG   0x0014 /* PCIe Link Control / Status Register */
 
#define PCIE_CONF_REG   0x0018 /* Host PCIe Configuration Reg */
 
#define PCIE_BUFFER_CTRL_REG   0x001C
 
#define HOST_TEST_REG   0x0020
 
#define HOST_COUNTER_REG   0x0024 /* Heart Beat Counter */
 
#define HOST_PCIE_DEBUG_REG   0x0028 /* Host PCIe Debug Register */
 
#define HOST_PCIE_LATSTATS_1   0x0030
 
#define HOST_PCIE_LATSTATS_2   0x0034
 
#define HOST_SPI_FLASH_CONTROL_REG   0x0040 /* SPI FLASH Control Register */
 
#define HOST_SPI_FLASH_DATA_REG   0x0044 /* SPI FLASH Data Register */
 
#define HOST_MON_REG   0x0048 /* Temperature Monitor/Volts Alarms */
 
#define AURORA_STEP   0x0010 /* Duplicate blocks every STEP */
 
#define AURORA_CONTROL_REGA   0x0080 /* Aurora Control Register */
 
#define AURORA_STATUS_REGA   0x0084 /* Aurora Status Register */
 
#define SFP_I2C_DATA_REGA   0x0088 /* SFP I2C Control and Data Register */
 
#define AURORA_STATUS2_REGA   0x008C
 
#define AURORA_CONTROL_REG(sfp)   (AURORA_CONTROL_REGA + AURORA_STEP*(sfp))
 
#define AURORA_STATUS_REG(sfp)   (AURORA_STATUS_REGA + AURORA_STEP*(sfp))
 
#define AURORA_STATUS2_REG(sfp)   (AURORA_STATUS2_REGA + AURORA_STEP*(sfp))
 
#define SFP_I2C_DATA_REG(sfp)   (SFP_I2C_DATA_REGA + AURORA_STEP*(sfp))
 
#define HOST_COMMS_FIFO_CONTROL_REG   0x00C0 /* ACQ400 Receive Communications FIFO Control Register */
 
#define HOST_COMMS_FIFO_STATUS_REG   0x00C4 /* ACQ400 Receive Communications FIFO Status Register */
 
#define ACQ400_COMMS_READ   0x0400 /* ACQ400 Receive Communications FIFO data */
 
#define ASR(acr)   ((acr)+4)
 
#define I2C(acr)   ((acr)+8)
 
#define SFP_I2C_SCL1_R   0
 
#define SFP_I2C_SDA1_R   1
 
#define SFP_I2C_SCL1_W   8
 
#define SFP_I2C_SDA1_W   9
 
#define SFP_I2C_SCL2_R   0
 
#define SFP_I2C_SDA2_R   1
 
#define SFP_I2C_SCL2_W   8
 
#define SFP_I2C_SDA2_W   9
 
#define AFHBA_SPI_BUSY   (1<<31)
 
#define AFHBA_SPI_CTL_START   (1<<7)
 
#define AFHBA_SPI_CS   (1<<0)
 
#define AFHBA_SPI_HOLD   (1<<1)
 
#define AFHBA_SPI_WP   (1<<2)
 
#define AFHBA_AURORA_CTRL_ENA   (1<<31)
 
#define AFHBA_AURORA_CTRL_TXDIS   (1<<16)
 
#define AFHBA_AURORA_CTRL_CLR   (1<<7)
 
#define AFHBA_AURORA_CTRL_PWR_DWN   (1<<4)
 
#define AFHBA_AURORA_CTRL_LOOPBACK   (0x7)
 
#define AFHBA_AURORA_STAT_SFP_PRESENTn   (1<<31)
 
#define AFHBA_AURORA_STAT_SFP_LOS   (1<<30)
 
#define AFHBA_AURORA_STAT_SFP_TX_FAULT   (1<<29)
 
#define AFHBA_AURORA_STAT_HARD_ERR   (1<<6)
 
#define AFHBA_AURORA_STAT_SOFT_ERR   (1<<5)
 
#define AFHBA_AURORA_STAT_FRAME_ERR   (1<<4)
 
#define AFHBA_AURORA_STAT_CHANNEL_UP   (1<<1)
 
#define AFHBA_AURORA_STAT_LANE_UP   (1<<0)
 
#define AFHBA_AURORA_STAT_ERR
 
#define HOST_MON_TEMP_SHL   20
 
#define HOST_MON_USR_TEMP   (1<<5)
 
#define HOST_MON_OVER_TEMP   (1<<4)
 
#define HOST_MON_VOLT_ALARM   0x7
 
#define ZYNQ_BASE   0x0000
 
#define PCIE_BASE   0x1000
 
#define PCIE_CONF_AF_PORT_SHL   16
 
#define DMA_BASE   0x2000
 
#define DMA_PUSH_DESC_FIFO   0x2040
 
#define DMA_PULL_DESC_FIFO   0x2080
 
#define DMA_CTRL_PULL_SHL   16
 
#define DMA_CTRL_PUSH_SHL   0
 
#define DMA_CTRL_EN   0x0001
 
#define DMA_CTRL_FIFO_RST   0x0010
 
#define DMA_CTRL_LOW_LAT   0x0020
 
#define DMA_CTRL_RECYCLE   0x0040
 
#define DMA_CTRL_RAM   0x8000
 
#define DMA_DESCR_ADDR   0xfffffc00
 
#define DMA_DESCR_INTEN   0x00000100
 
#define DMA_DESCR_LEN   0x000000f0
 
#define DMA_DESCR_ID   0x0000000f
 
#define DMA_DATA_FIFO_EMPTY   0x0001
 
#define DMA_DATA_FIFO_FULL   0x0002
 
#define DMA_DATA_FIFO_UNDER   0x0004
 
#define DMA_DATA_FIFO_OVER   0x0008
 
#define DMA_DATA_FIFO_COUNT   0xfff0
 
#define DMA_DATA_FIFO_COUNT_SHL   4
 
#define DMA_DESCR_LEN_BYTES(descr)   ((1<<((descr&DMA_DESCR_LEN)>>4))*1024)
 
#define DMA_PUSH_DESC_RAM   0x6000
 
#define DMA_PULL_DESC_RAM   0x7000
 
#define DMA_DIR_DESC_FIFO(dma_sel)   ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_FIFO: DMA_PULL_DESC_FIFO)
 
#define DMA_DIR_DESC_LEN(dma_sel)   ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_LEN: DMA_PULL_DESC_LEN)
 
#define DMA_DIR_DESC_RAM(dma_sel)   ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_RAM: DMA_PULL_DESC_RAM)
 
#define COMMON_BASE   0xf000
 
#define COM_SOFT_TRIGGER_EN   0x0001
 

Enumerations

enum  ZYNQ_REGS {
  Z_MOD_ID, Z_DMA_CTRL, Z_COMMS_HB, Z_AURORA_CTRL,
  Z_AURORA_SR, Z_IDENT
}
 
enum  PCIE_REGS {
  PCIE_CNTRL = 1, PCIE_INTR, PCI_CSR, PCIE_DEV_CSR,
  PCIE_LINK_CSR, PCIE_CONF, PCIE_BUFFER_CTRL
}
 
enum  DMA_REGS {
  DMA_TEST, DMA_CTRL, DMA_DATA_FIFSTA, DMA_DESC_FIFSTA,
  DMA_PUSH_DESC_STA, DMA_PULL_DESC_STA, DMA_PUSH_DATACOUNT, DMA_PUSH_GAP,
  DMA_PUSH_DESC_LEN, DMA_PULL_DESC_LEN, DMA_REGS_COUNT
}
 
enum  DMA_SEL { DMA_PUSH_SEL = 0x1, DMA_PULL_SEL = 0x2, DMA_BOTH_SEL = 0x3 }
 
enum  COMMON_REGS { COM_SOFT_TRIGGER }
 

Functions

int afhba_registerDevice (struct AFHBA_DEV *tdev)
 
void afhba_deleteDevice (struct AFHBA_DEV *tdev)
 
struct AFHBA_DEVafhba_lookupDevice (int major)
 
struct AFHBA_DEVafhba_lookupDeviceFromClass (struct device *dev)
 
struct AFHBA_DEVafhba_lookupDevicePci (struct pci_dev *pci_dev)
 
struct AFHBA_DEVafhba_lookupDev (struct device *dev)
 
int afhba_release (struct inode *inode, struct file *file)
 
int afhba_stream_drv_init (struct AFHBA_DEV *adev)
 
int afhba_stream_drv_del (struct AFHBA_DEV *adev)
 
void afhba_create_sysfs_class (struct AFHBA_DEV *adev)
 
void afhba_remove_sysfs_class (struct AFHBA_DEV *adev)
 
void afhba_create_sysfs (struct AFHBA_DEV *adev)
 
void afhba_remove_sysfs (struct AFHBA_DEV *adev)
 
void afhba_write_reg (struct AFHBA_DEV *adev, int regoff, u32 value)
 
u32 afhba_read_reg (struct AFHBA_DEV *adev, int regoff)
 

Variables

struct list_head afhba_devices
 

Macro Definition Documentation

◆ ACQ400_COMMS_READ

#define ACQ400_COMMS_READ   0x0400 /* ACQ400 Receive Communications FIFO data */

Definition at line 222 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_CTRL_CLR

#define AFHBA_AURORA_CTRL_CLR   (1<<7)

Definition at line 246 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_CTRL_ENA

#define AFHBA_AURORA_CTRL_ENA   (1<<31)

Definition at line 244 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_CTRL_LOOPBACK

#define AFHBA_AURORA_CTRL_LOOPBACK   (0x7)

Definition at line 248 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_CTRL_PWR_DWN

#define AFHBA_AURORA_CTRL_PWR_DWN   (1<<4)

Definition at line 247 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_CTRL_TXDIS

#define AFHBA_AURORA_CTRL_TXDIS   (1<<16)

Definition at line 245 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_CHANNEL_UP

#define AFHBA_AURORA_STAT_CHANNEL_UP   (1<<1)

Definition at line 256 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_ERR

#define AFHBA_AURORA_STAT_ERR
Value:
AFHBA_AURORA_STAT_HARD_ERR|AFHBA_AURORA_STAT_SOFT_ERR|\
AFHBA_AURORA_STAT_FRAME_ERR)

Definition at line 259 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_FRAME_ERR

#define AFHBA_AURORA_STAT_FRAME_ERR   (1<<4)

Definition at line 255 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_HARD_ERR

#define AFHBA_AURORA_STAT_HARD_ERR   (1<<6)

Definition at line 253 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_LANE_UP

#define AFHBA_AURORA_STAT_LANE_UP   (1<<0)

Definition at line 257 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_SFP_LOS

#define AFHBA_AURORA_STAT_SFP_LOS   (1<<30)

Definition at line 251 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_SFP_PRESENTn

#define AFHBA_AURORA_STAT_SFP_PRESENTn   (1<<31)

Definition at line 250 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_SFP_TX_FAULT

#define AFHBA_AURORA_STAT_SFP_TX_FAULT   (1<<29)

Definition at line 252 of file acq-fiber-hba.h.

◆ AFHBA_AURORA_STAT_SOFT_ERR

#define AFHBA_AURORA_STAT_SOFT_ERR   (1<<5)

Definition at line 254 of file acq-fiber-hba.h.

◆ AFHBA_SPI_BUSY

#define AFHBA_SPI_BUSY   (1<<31)

Definition at line 238 of file acq-fiber-hba.h.

◆ AFHBA_SPI_CS

#define AFHBA_SPI_CS   (1<<0)

Definition at line 240 of file acq-fiber-hba.h.

◆ AFHBA_SPI_CTL_START

#define AFHBA_SPI_CTL_START   (1<<7)

Definition at line 239 of file acq-fiber-hba.h.

◆ AFHBA_SPI_HOLD

#define AFHBA_SPI_HOLD   (1<<1)

Definition at line 241 of file acq-fiber-hba.h.

◆ AFHBA_SPI_WP

#define AFHBA_SPI_WP   (1<<2)

Definition at line 242 of file acq-fiber-hba.h.

◆ ASR

#define ASR (   acr)    ((acr)+4)

Definition at line 225 of file acq-fiber-hba.h.

◆ assert

#define assert (   p)
Value:
do { \
if (!(p)) { \
printk(KERN_CRIT "BUG at %s:%d assert(%s)\n", \
__FILE__, __LINE__, #p); \
BUG(); \
} \
} while (0)

Definition at line 56 of file acq-fiber-hba.h.

◆ AURORA_CONTROL_REG

#define AURORA_CONTROL_REG (   sfp)    (AURORA_CONTROL_REGA + AURORA_STEP*(sfp))

Definition at line 215 of file acq-fiber-hba.h.

◆ AURORA_CONTROL_REGA

#define AURORA_CONTROL_REGA   0x0080 /* Aurora Control Register */

Definition at line 210 of file acq-fiber-hba.h.

◆ AURORA_STATUS2_REG

#define AURORA_STATUS2_REG (   sfp)    (AURORA_STATUS2_REGA + AURORA_STEP*(sfp))

Definition at line 217 of file acq-fiber-hba.h.

◆ AURORA_STATUS2_REGA

#define AURORA_STATUS2_REGA   0x008C

Definition at line 213 of file acq-fiber-hba.h.

◆ AURORA_STATUS_REG

#define AURORA_STATUS_REG (   sfp)    (AURORA_STATUS_REGA + AURORA_STEP*(sfp))

Definition at line 216 of file acq-fiber-hba.h.

◆ AURORA_STATUS_REGA

#define AURORA_STATUS_REGA   0x0084 /* Aurora Status Register */

Definition at line 211 of file acq-fiber-hba.h.

◆ AURORA_STEP

#define AURORA_STEP   0x0010 /* Duplicate blocks every STEP */

Definition at line 209 of file acq-fiber-hba.h.

◆ COM_SOFT_TRIGGER_EN

#define COM_SOFT_TRIGGER_EN   0x0001

Definition at line 399 of file acq-fiber-hba.h.

◆ COMMON_BASE

#define COMMON_BASE   0xf000

Definition at line 394 of file acq-fiber-hba.h.

◆ DEV

#define DEV (   file)    (PD(file)->dev)

Definition at line 175 of file acq-fiber-hba.h.

◆ DMA_BASE

#define DMA_BASE   0x2000

Definition at line 298 of file acq-fiber-hba.h.

◆ DMA_CTRL_EN

#define DMA_CTRL_EN   0x0001

Definition at line 339 of file acq-fiber-hba.h.

◆ DMA_CTRL_FIFO_RST

#define DMA_CTRL_FIFO_RST   0x0010

Definition at line 340 of file acq-fiber-hba.h.

◆ DMA_CTRL_LOW_LAT

#define DMA_CTRL_LOW_LAT   0x0020

Definition at line 341 of file acq-fiber-hba.h.

◆ DMA_CTRL_PULL_SHL

#define DMA_CTRL_PULL_SHL   16

Definition at line 336 of file acq-fiber-hba.h.

◆ DMA_CTRL_PUSH_SHL

#define DMA_CTRL_PUSH_SHL   0

Definition at line 337 of file acq-fiber-hba.h.

◆ DMA_CTRL_RAM

#define DMA_CTRL_RAM   0x8000

Definition at line 343 of file acq-fiber-hba.h.

◆ DMA_CTRL_RECYCLE

#define DMA_CTRL_RECYCLE   0x0040

Definition at line 342 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_COUNT

#define DMA_DATA_FIFO_COUNT   0xfff0

Definition at line 354 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_COUNT_SHL

#define DMA_DATA_FIFO_COUNT_SHL   4

Definition at line 355 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_EMPTY

#define DMA_DATA_FIFO_EMPTY   0x0001

Definition at line 350 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_FULL

#define DMA_DATA_FIFO_FULL   0x0002

Definition at line 351 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_OVER

#define DMA_DATA_FIFO_OVER   0x0008

Definition at line 353 of file acq-fiber-hba.h.

◆ DMA_DATA_FIFO_UNDER

#define DMA_DATA_FIFO_UNDER   0x0004

Definition at line 352 of file acq-fiber-hba.h.

◆ DMA_DESCR_ADDR

#define DMA_DESCR_ADDR   0xfffffc00

Definition at line 345 of file acq-fiber-hba.h.

◆ DMA_DESCR_ID

#define DMA_DESCR_ID   0x0000000f

Definition at line 348 of file acq-fiber-hba.h.

◆ DMA_DESCR_INTEN

#define DMA_DESCR_INTEN   0x00000100

Definition at line 346 of file acq-fiber-hba.h.

◆ DMA_DESCR_LEN

#define DMA_DESCR_LEN   0x000000f0

Definition at line 347 of file acq-fiber-hba.h.

◆ DMA_DESCR_LEN_BYTES

#define DMA_DESCR_LEN_BYTES (   descr)    ((1<<((descr&DMA_DESCR_LEN)>>4))*1024)

Definition at line 357 of file acq-fiber-hba.h.

◆ DMA_DIR_DESC_FIFO

#define DMA_DIR_DESC_FIFO (   dma_sel)    ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_FIFO: DMA_PULL_DESC_FIFO)

Definition at line 363 of file acq-fiber-hba.h.

◆ DMA_DIR_DESC_LEN

#define DMA_DIR_DESC_LEN (   dma_sel)    ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_LEN: DMA_PULL_DESC_LEN)

Definition at line 366 of file acq-fiber-hba.h.

◆ DMA_DIR_DESC_RAM

#define DMA_DIR_DESC_RAM (   dma_sel)    ((dma_sel)==DMA_PUSH_SEL? DMA_PUSH_DESC_RAM: DMA_PULL_DESC_RAM)

Definition at line 369 of file acq-fiber-hba.h.

◆ DMA_PULL_DESC_FIFO

#define DMA_PULL_DESC_FIFO   0x2080

Definition at line 332 of file acq-fiber-hba.h.

◆ DMA_PULL_DESC_RAM

#define DMA_PULL_DESC_RAM   0x7000

Definition at line 360 of file acq-fiber-hba.h.

◆ DMA_PUSH_DESC_FIFO

#define DMA_PUSH_DESC_FIFO   0x2040

Definition at line 331 of file acq-fiber-hba.h.

◆ DMA_PUSH_DESC_RAM

#define DMA_PUSH_DESC_RAM   0x6000

Definition at line 359 of file acq-fiber-hba.h.

◆ FPGA_REVISION_REG

#define FPGA_REVISION_REG   0x0000 /* FPGA Revision Register */

Definition at line 190 of file acq-fiber-hba.h.

◆ HOST_COMMS_FIFO_CONTROL_REG

#define HOST_COMMS_FIFO_CONTROL_REG   0x00C0 /* ACQ400 Receive Communications FIFO Control Register */

Definition at line 220 of file acq-fiber-hba.h.

◆ HOST_COMMS_FIFO_STATUS_REG

#define HOST_COMMS_FIFO_STATUS_REG   0x00C4 /* ACQ400 Receive Communications FIFO Status Register */

Definition at line 221 of file acq-fiber-hba.h.

◆ HOST_COUNTER_REG

#define HOST_COUNTER_REG   0x0024 /* Heart Beat Counter */

Definition at line 199 of file acq-fiber-hba.h.

◆ HOST_MON_OVER_TEMP

#define HOST_MON_OVER_TEMP   (1<<4)

Definition at line 267 of file acq-fiber-hba.h.

◆ HOST_MON_REG

#define HOST_MON_REG   0x0048 /* Temperature Monitor/Volts Alarms */

Definition at line 207 of file acq-fiber-hba.h.

◆ HOST_MON_TEMP_SHL

#define HOST_MON_TEMP_SHL   20

Definition at line 265 of file acq-fiber-hba.h.

◆ HOST_MON_USR_TEMP

#define HOST_MON_USR_TEMP   (1<<5)

Definition at line 266 of file acq-fiber-hba.h.

◆ HOST_MON_VOLT_ALARM

#define HOST_MON_VOLT_ALARM   0x7

Definition at line 268 of file acq-fiber-hba.h.

◆ HOST_PCIE_CONTROL_REG

#define HOST_PCIE_CONTROL_REG   0x0004 /* Host PCIe Control / Status Register */

Definition at line 191 of file acq-fiber-hba.h.

◆ HOST_PCIE_DEBUG_REG

#define HOST_PCIE_DEBUG_REG   0x0028 /* Host PCIe Debug Register */

Definition at line 200 of file acq-fiber-hba.h.

◆ HOST_PCIE_INTERRUPT_REG

#define HOST_PCIE_INTERRUPT_REG   0x0008 /* Host PCIe Interrupt Register Register */

Definition at line 192 of file acq-fiber-hba.h.

◆ HOST_PCIE_LATSTATS_1

#define HOST_PCIE_LATSTATS_1   0x0030

Definition at line 202 of file acq-fiber-hba.h.

◆ HOST_PCIE_LATSTATS_2

#define HOST_PCIE_LATSTATS_2   0x0034

Definition at line 203 of file acq-fiber-hba.h.

◆ HOST_SPI_FLASH_CONTROL_REG

#define HOST_SPI_FLASH_CONTROL_REG   0x0040 /* SPI FLASH Control Register */

Definition at line 205 of file acq-fiber-hba.h.

◆ HOST_SPI_FLASH_DATA_REG

#define HOST_SPI_FLASH_DATA_REG   0x0044 /* SPI FLASH Data Register */

Definition at line 206 of file acq-fiber-hba.h.

◆ HOST_TEST_REG

#define HOST_TEST_REG   0x0020

Definition at line 198 of file acq-fiber-hba.h.

◆ I2C

#define I2C (   acr)    ((acr)+8)

Definition at line 226 of file acq-fiber-hba.h.

◆ LOC

#define LOC (   adev)    ((adev)->mappings[0].va)

Definition at line 179 of file acq-fiber-hba.h.

◆ MAP_COUNT_4G1

#define MAP_COUNT_4G1   2

Definition at line 80 of file acq-fiber-hba.h.

◆ MAP_COUNT_4G2

#define MAP_COUNT_4G2   4

Definition at line 81 of file acq-fiber-hba.h.

◆ MAP_COUNT_4G4

#define MAP_COUNT_4G4   6

Definition at line 83 of file acq-fiber-hba.h.

◆ MAP_COUNT_MAX

#define MAP_COUNT_MAX   6

Definition at line 78 of file acq-fiber-hba.h.

◆ MAXDEV

#define MAXDEV   8 /* maximum expected devices .. */

Definition at line 66 of file acq-fiber-hba.h.

◆ NO_BAR

#define NO_BAR   -1

Definition at line 185 of file acq-fiber-hba.h.

◆ PCI_CONTROL_STATUS_REG

#define PCI_CONTROL_STATUS_REG   0x000C /* PCI Control / Status Register */

Definition at line 193 of file acq-fiber-hba.h.

◆ PCIE_BASE

#define PCIE_BASE   0x1000

Definition at line 284 of file acq-fiber-hba.h.

◆ PCIE_BUFFER_CTRL_REG

#define PCIE_BUFFER_CTRL_REG   0x001C

Definition at line 197 of file acq-fiber-hba.h.

◆ PCIE_CONF_AF_PORT_SHL

#define PCIE_CONF_AF_PORT_SHL   16

Definition at line 296 of file acq-fiber-hba.h.

◆ PCIE_CONF_REG

#define PCIE_CONF_REG   0x0018 /* Host PCIe Configuration Reg */

Definition at line 196 of file acq-fiber-hba.h.

◆ PCIE_DEVICE_CONTROL_STATUS_REG

#define PCIE_DEVICE_CONTROL_STATUS_REG   0x0010 /* PCIe Control / Status Register */

Definition at line 194 of file acq-fiber-hba.h.

◆ PCIE_LINK_CONTROL_STATUS_REG

#define PCIE_LINK_CONTROL_STATUS_REG   0x0014 /* PCIe Link Control / Status Register */

Definition at line 195 of file acq-fiber-hba.h.

◆ PD

#define PD (   file)    ((struct AFHBA_DEV_PATH *)(file)->private_data)

Definition at line 174 of file acq-fiber-hba.h.

◆ pdev

#define pdev (   adev)    (&(adev)->pci_dev->dev)

Definition at line 177 of file acq-fiber-hba.h.

◆ PSZ

#define PSZ   (sizeof (struct AFHBA_DEV_PATH))

Definition at line 173 of file acq-fiber-hba.h.

◆ REGS_BAR [1/2]

#define REGS_BAR   0 /* @@todo assumed */

Definition at line 182 of file acq-fiber-hba.h.

◆ REGS_BAR [2/2]

#define REGS_BAR   0

Definition at line 182 of file acq-fiber-hba.h.

◆ REM

#define REM (   adev)    ((adev)->remote)

Definition at line 180 of file acq-fiber-hba.h.

◆ REMOTE_BAR

#define REMOTE_BAR   1

Definition at line 183 of file acq-fiber-hba.h.

◆ REMOTE_BAR2

#define REMOTE_BAR2   2

Definition at line 184 of file acq-fiber-hba.h.

◆ SFP_I2C_DATA_REG

#define SFP_I2C_DATA_REG (   sfp)    (SFP_I2C_DATA_REGA + AURORA_STEP*(sfp))

Definition at line 218 of file acq-fiber-hba.h.

◆ SFP_I2C_DATA_REGA

#define SFP_I2C_DATA_REGA   0x0088 /* SFP I2C Control and Data Register */

Definition at line 212 of file acq-fiber-hba.h.

◆ SFP_I2C_SCL1_R

#define SFP_I2C_SCL1_R   0

Definition at line 229 of file acq-fiber-hba.h.

◆ SFP_I2C_SCL1_W

#define SFP_I2C_SCL1_W   8

Definition at line 231 of file acq-fiber-hba.h.

◆ SFP_I2C_SCL2_R

#define SFP_I2C_SCL2_R   0

Definition at line 233 of file acq-fiber-hba.h.

◆ SFP_I2C_SCL2_W

#define SFP_I2C_SCL2_W   8

Definition at line 235 of file acq-fiber-hba.h.

◆ SFP_I2C_SDA1_R

#define SFP_I2C_SDA1_R   1

Definition at line 230 of file acq-fiber-hba.h.

◆ SFP_I2C_SDA1_W

#define SFP_I2C_SDA1_W   9

Definition at line 232 of file acq-fiber-hba.h.

◆ SFP_I2C_SDA2_R

#define SFP_I2C_SDA2_R   1

Definition at line 234 of file acq-fiber-hba.h.

◆ SFP_I2C_SDA2_W

#define SFP_I2C_SDA2_W   9

Definition at line 236 of file acq-fiber-hba.h.

◆ SZM1

#define SZM1 (   field)    (sizeof(field)-1)

Definition at line 154 of file acq-fiber-hba.h.

◆ ZYNQ_BASE

#define ZYNQ_BASE   0x0000

Definition at line 271 of file acq-fiber-hba.h.

Enumeration Type Documentation

◆ COMMON_REGS

Enumerator
COM_SOFT_TRIGGER 

Definition at line 394 of file acq-fiber-hba.h.

◆ DMA_REGS

enum DMA_REGS
Enumerator
DMA_TEST 
DMA_CTRL 
DMA_DATA_FIFSTA 
DMA_DESC_FIFSTA 
DMA_PUSH_DESC_STA 
DMA_PULL_DESC_STA 
DMA_PUSH_DATACOUNT 
DMA_PUSH_GAP 
DMA_PUSH_DESC_LEN 
DMA_PULL_DESC_LEN 
DMA_REGS_COUNT 

Definition at line 298 of file acq-fiber-hba.h.

◆ DMA_SEL

enum DMA_SEL
Enumerator
DMA_PUSH_SEL 
DMA_PULL_SEL 
DMA_BOTH_SEL 

Definition at line 314 of file acq-fiber-hba.h.

◆ PCIE_REGS

enum PCIE_REGS
Enumerator
PCIE_CNTRL 
PCIE_INTR 
PCI_CSR 
PCIE_DEV_CSR 
PCIE_LINK_CSR 
PCIE_CONF 
PCIE_BUFFER_CTRL 

Definition at line 285 of file acq-fiber-hba.h.

◆ ZYNQ_REGS

enum ZYNQ_REGS
Enumerator
Z_MOD_ID 
Z_DMA_CTRL 
Z_COMMS_HB 
Z_AURORA_CTRL 
Z_AURORA_SR 
Z_IDENT 

Definition at line 272 of file acq-fiber-hba.h.

Function Documentation

◆ afhba_create_sysfs()

void afhba_create_sysfs ( struct AFHBA_DEV adev)

Definition at line 590 of file afhba_sysfs.c.

◆ afhba_create_sysfs_class()

void afhba_create_sysfs_class ( struct AFHBA_DEV adev)

Definition at line 624 of file afhba_sysfs.c.

◆ afhba_deleteDevice()

void afhba_deleteDevice ( struct AFHBA_DEV tdev)

Definition at line 34 of file afhba_devman.c.

◆ afhba_lookupDev()

struct AFHBA_DEV* afhba_lookupDev ( struct device *  dev)

Definition at line 78 of file afhba_devman.c.

◆ afhba_lookupDevice()

struct AFHBA_DEV* afhba_lookupDevice ( int  major)

Definition at line 39 of file afhba_devman.c.

◆ afhba_lookupDeviceFromClass()

struct AFHBA_DEV* afhba_lookupDeviceFromClass ( struct device *  dev)

Definition at line 52 of file afhba_devman.c.

◆ afhba_lookupDevicePci()

struct AFHBA_DEV* afhba_lookupDevicePci ( struct pci_dev *  pci_dev)

Definition at line 65 of file afhba_devman.c.

◆ afhba_read_reg()

u32 afhba_read_reg ( struct AFHBA_DEV adev,
int  regoff 
)

Definition at line 48 of file afhba_core.c.

◆ afhba_registerDevice()

int afhba_registerDevice ( struct AFHBA_DEV tdev)

Definition at line 27 of file afhba_devman.c.

◆ afhba_release()

int afhba_release ( struct inode *  inode,
struct file *  file 
)

Definition at line 241 of file acq-fiber-hba.c.

◆ afhba_remove_sysfs()

void afhba_remove_sysfs ( struct AFHBA_DEV adev)

Definition at line 600 of file afhba_sysfs.c.

◆ afhba_remove_sysfs_class()

void afhba_remove_sysfs_class ( struct AFHBA_DEV adev)

Definition at line 642 of file afhba_sysfs.c.

◆ afhba_stream_drv_del()

int afhba_stream_drv_del ( struct AFHBA_DEV adev)

Definition at line 2246 of file afhba_stream_drv.c.

◆ afhba_stream_drv_init()

int afhba_stream_drv_init ( struct AFHBA_DEV adev)

Definition at line 2229 of file afhba_stream_drv.c.

◆ afhba_write_reg()

void afhba_write_reg ( struct AFHBA_DEV adev,
int  regoff,
u32  value 
)

Definition at line 40 of file afhba_core.c.

Variable Documentation

◆ afhba_devices

struct list_head afhba_devices
AFHBA_AURORA_STAT_SOFT_ERR
#define AFHBA_AURORA_STAT_SOFT_ERR
Definition: acq-fiber-hba.h:253
AFHBA_AURORA_STAT_SFP_LOS
#define AFHBA_AURORA_STAT_SFP_LOS
Definition: acq-fiber-hba.h:250
AFHBA_AURORA_STAT_SFP_TX_FAULT
#define AFHBA_AURORA_STAT_SFP_TX_FAULT
Definition: acq-fiber-hba.h:251