diff options
author | Himanshu Madhani <himanshu.madhani@qlogic.com> | 2013-01-01 03:20:18 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-02 02:43:26 -0800 |
commit | a15ebd371992dbadb8a30367fd80cb5cd73b8fb1 (patch) | |
tree | 26323d75ebb7488410d52c52e7a6f9514625e2c6 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | |
parent | 7e2cf4feba058476324dc545e3d1b316998c91e6 (diff) |
qlcnic: macros for common register access
Refactor 82xx driver to support new adapter - Qlogic 83XX CNA
Use QLC_SHARED_REG_RD32 and QLC__SHARED_REG_WR32 macros
for 82xx and 83xx common register access.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h index 2b9537d8c167..937d75f939aa 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h @@ -28,6 +28,14 @@ enum qlcnic_regs { QLCNIC_FLASH_UNLOCK, }; +/* Read from an address offset from BAR0, existing registers */ +#define QLC_SHARED_REG_RD32(a, addr) \ + readl(((a)->ahw->pci_base0) + ((a)->ahw->reg_tbl[addr])) + +/* Write to an address offset from BAR0, existing registers */ +#define QLC_SHARED_REG_WR32(a, addr, value) \ + writel(value, ((a)->ahw->pci_base0) + ((a)->ahw->reg_tbl[addr])) + #define QLCNIC_CMD_CONFIGURE_IP_ADDR 0x1 #define QLCNIC_CMD_CONFIG_INTRPT 0x2 #define QLCNIC_CMD_CREATE_RX_CTX 0x7 |