net: hns: set debug port irq index to 0
authorDaode Huang <huangdaode@hisilicon.com>
Sat, 23 Apr 2016 09:05:06 +0000 (17:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Apr 2016 05:09:17 +0000 (01:09 -0400)
As debug ports are moved from service dsaf to debug dsaf,
the interrupts offset should start from 0, So this patch
re-defines the offset index of debug ports.

Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h

index 121ba4e56dc4ea813d4f799f27d9e6b20c9963d7..054f391a3eeb7c20148a711c8ea170fa11655a37 100644 (file)
@@ -445,20 +445,14 @@ static int hns_rcb_get_port_in_comm(
 
 #define SERVICE_RING_IRQ_IDX(v1) \
        ((v1) ? HNS_SERVICE_RING_IRQ_IDX : HNSV2_SERVICE_RING_IRQ_IDX)
-#define DEBUG_RING_IRQ_IDX(v1) \
-       ((v1) ? HNS_DEBUG_RING_IRQ_IDX : HNSV2_DEBUG_RING_IRQ_IDX)
-#define DEBUG_RING_IRQ_OFFSET(v1) \
-       ((v1) ? HNS_DEBUG_RING_IRQ_OFFSET : HNSV2_DEBUG_RING_IRQ_OFFSET)
 static int hns_rcb_get_base_irq_idx(struct rcb_common_cb *rcb_common)
 {
-       int comm_index = rcb_common->comm_index;
        bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver);
 
        if (!HNS_DSAF_IS_DEBUG(rcb_common->dsaf_dev))
                return SERVICE_RING_IRQ_IDX(is_ver1);
        else
-               return  DEBUG_RING_IRQ_IDX(is_ver1) +
-                       (comm_index - 1) * DEBUG_RING_IRQ_OFFSET(is_ver1);
+               return  HNS_DEBUG_RING_IRQ_IDX;
 }
 
 #define RCB_COMM_BASE_TO_RING_BASE(base, ringid)\
index cffd244f1ded57f02ee319587d1d8d10737a5bf9..87826087f08b4077fdbd0573141c6aab4d3dc5d8 100644 (file)
 #ifndef _DSAF_REG_H_
 #define _DSAF_REG_H_
 
-#define HNS_DEBUG_RING_IRQ_IDX 55
+#define HNS_DEBUG_RING_IRQ_IDX 0
 #define HNS_SERVICE_RING_IRQ_IDX 59
-#define HNS_DEBUG_RING_IRQ_OFFSET 2
-#define HNSV2_DEBUG_RING_IRQ_IDX 409
 #define HNSV2_SERVICE_RING_IRQ_IDX 25
-#define HNSV2_DEBUG_RING_IRQ_OFFSET 9
 
 #define DSAF_MAX_PORT_NUM_PER_CHIP 8
 #define DSAF_SERVICE_PORT_NUM_PER_DSAF 6