OSDN Git Service

bnxt_en: Define the doorbell offsets on 57500 chips.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 4 May 2020 08:50:35 +0000 (04:50 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2020 17:44:11 +0000 (10:44 -0700)
Define the 57500 chip doorbell offsets instead of using the magic
values in the C file.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 5919f72..2e56402 100644 (file)
@@ -5355,9 +5355,9 @@ static void bnxt_set_db(struct bnxt *bp, struct bnxt_db_info *db, u32 ring_type,
 {
        if (bp->flags & BNXT_FLAG_CHIP_P5) {
                if (BNXT_PF(bp))
-                       db->doorbell = bp->bar1 + 0x10000;
+                       db->doorbell = bp->bar1 + DB_PF_OFFSET_P5;
                else
-                       db->doorbell = bp->bar1 + 0x4000;
+                       db->doorbell = bp->bar1 + DB_VF_OFFSET_P5;
                switch (ring_type) {
                case HWRM_RING_ALLOC_TX:
                        db->db_key64 = DBR_PATH_L2 | DBR_TYPE_SQ;
index 1dbc3ae..a3b8040 100644 (file)
@@ -537,6 +537,9 @@ struct nqe_cn {
 #define DBR_TYPE_NQ_ARM                                        (0xbULL << 60)
 #define DBR_TYPE_NULL                                  (0xfULL << 60)
 
+#define DB_PF_OFFSET_P5                                        0x10000
+#define DB_VF_OFFSET_P5                                        0x4000
+
 #define INVALID_HW_RING_ID     ((u16)-1)
 
 /* The hardware supports certain page sizes.  Use the supported page sizes