summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
diff options
context:
space:
mode:
authorYisen.Zhuang\(Zhuangyuzeng\) <Yisen.Zhuang@huawei.com>2016-04-23 17:05:11 +0800
committerDavid S. Miller <davem@davemloft.net>2016-04-26 01:09:17 -0400
commit831d828bf2cc8535b74fa33c705a6f83e2e34eec (patch)
tree780720fc2c3062e65fbeceb5459e2612c4fc1524 /drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
parent2e2591b130c43dd241e7aa8b0f2d74dbf3cc334b (diff)
net: hns: separate debug dsaf device from service dsaf device
There are two kinds of dsaf device in hns, one is for service ports, contains crossbar in it, can work under different mode. Another is for debug port, only can work under "single-port" mode. The current code only declared a dsaf device for both service ports and debug ports. This patch separate it to three platform devices. Here is the diagram of all port in one platform device(old): CPU | | DSAF(one platform device) -------------------------------------------------------------- / | | | | | / | PPE PPE PPE | / | | | | | / | | | | | / | crossbar | | | / | | | | |/ | ----------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | MAC MAC MAC MAC MAC MAC MAC MAC | | | | | | | | | | | -------------------------------------------------------------- | | | | | | | | PHY PHY PHY PHY PHY PHY PHY PHY Here is the diagram of separate all ports to three platform(new): CPU | ----------------------------------- | | | ---------------------------------------------- --------- --------- | | | | | | | | | PPE | | PPE | | PPE | | | | | | | | | | | | | | | | | | | | crossbar | | | | | | | | | | | | | | | | | ---------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAC MAC MAC MAC MAC MAC | | MAC | | MAC | | | | | | | | | | | | | | | ---------------------------------------------- --------- --------- | | | | | | \ / | / | PHY PHY PHY PHY PHY PHY \ / PHY / PHY \ / / \ / / DSAF(three platform device) 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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
index 47e768b9ec97..a48ef2644355 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
@@ -278,6 +278,8 @@ struct dsaf_device {
u8 __iomem *ppe_base;
u8 __iomem *io_base;
u8 __iomem *cpld_base;
+ struct regmap *sub_ctrl;
+ phys_addr_t ppe_paddr;
u32 desc_num; /* desc num per queue*/
u32 buf_size; /* ring buffer size */
@@ -290,7 +292,7 @@ struct dsaf_device {
struct ppe_common_cb *ppe_common[DSAF_COMM_DEV_NUM];
struct rcb_common_cb *rcb_common[DSAF_COMM_DEV_NUM];
- struct hns_mac_cb *mac_cb;
+ struct hns_mac_cb *mac_cb[DSAF_MAX_PORT_NUM];
struct dsaf_hw_stats hw_stats[DSAF_NODE_NUM];
struct dsaf_int_stat int_stat;
@@ -362,14 +364,6 @@ static inline void hns_dsaf_tbl_line_addr_cfg(struct dsaf_device *dsaf_dev,
tab_line_addr);
}
-static inline int hns_dsaf_get_comm_idx_by_port(int port)
-{
- if ((port < DSAF_COMM_CHN) || (port == DSAF_MAX_PORT_NUM_PER_CHIP))
- return 0;
- else
- return (port - DSAF_COMM_CHN + 1);
-}
-
static inline struct hnae_vf_cb *hns_ae_get_vf_cb(
struct hnae_handle *handle)
{