diff options
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma.h')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h index 1b51e67a26d7..24fe248fb35a 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma.h @@ -197,6 +197,7 @@ struct ocrdma_dev { int id; struct ocrdma_mr *stag_arr[OCRDMA_MAX_STAG]; u16 pvid; + u32 asic_id; }; struct ocrdma_cq { @@ -443,4 +444,16 @@ static inline int ocrdma_get_eq_table_index(struct ocrdma_dev *dev, return -EINVAL; } +static inline u8 ocrdma_get_asic_type(struct ocrdma_dev *dev) +{ + if (dev->nic_info.dev_family == 0xF && !dev->asic_id) { + pci_read_config_dword( + dev->nic_info.pdev, + OCRDMA_SLI_ASIC_ID_OFFSET, &dev->asic_id); + } + + return (dev->asic_id & OCRDMA_SLI_ASIC_GEN_NUM_MASK) >> + OCRDMA_SLI_ASIC_GEN_NUM_SHIFT; +} + #endif |