diff options
author | Yisen.Zhuang\(Zhuangyuzeng\) <Yisen.Zhuang@huawei.com> | 2016-04-23 05:05:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-26 01:09:17 -0400 |
commit | 422c3107ed2cc6297f051109f3d4b6d855eaae14 (patch) | |
tree | e1af39edb4ce41bd32fd8df02f28010851ecbc69 /drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | |
parent | 406adee9a9fc38c11671f26180e694976f45237c (diff) |
net: hns: add attribute reset-field-offset for dsaf node
Add the subctrl reset offset for dsaf, this property is used to reset
xge/ge ports for different dsaf. If this attribute is not present,
default value 0 will be used.
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.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c index 769285375341..b418d4201290 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | |||
@@ -36,6 +36,7 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev) | |||
36 | int ret, i; | 36 | int ret, i; |
37 | u32 desc_num; | 37 | u32 desc_num; |
38 | u32 buf_size; | 38 | u32 buf_size; |
39 | u32 reset_offset = 0; | ||
39 | const char *mode_str; | 40 | const char *mode_str; |
40 | struct device_node *np = dsaf_dev->dev->of_node; | 41 | struct device_node *np = dsaf_dev->dev->of_node; |
41 | 42 | ||
@@ -119,6 +120,13 @@ int hns_dsaf_get_cfg(struct dsaf_device *dsaf_dev) | |||
119 | } | 120 | } |
120 | dsaf_dev->desc_num = desc_num; | 121 | dsaf_dev->desc_num = desc_num; |
121 | 122 | ||
123 | ret = of_property_read_u32(np, "reset-field-offset", &reset_offset); | ||
124 | if (ret < 0) { | ||
125 | dev_dbg(dsaf_dev->dev, | ||
126 | "get reset-field-offset fail, ret=%d!\r\n", ret); | ||
127 | } | ||
128 | dsaf_dev->reset_offset = reset_offset; | ||
129 | |||
122 | ret = of_property_read_u32(np, "buf-size", &buf_size); | 130 | ret = of_property_read_u32(np, "buf-size", &buf_size); |
123 | if (ret < 0) { | 131 | if (ret < 0) { |
124 | dev_err(dsaf_dev->dev, | 132 | dev_err(dsaf_dev->dev, |