diff options
author | David S. Miller <davem@davemloft.net> | 2017-06-06 22:20:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-06 22:20:08 -0400 |
commit | 216fe8f021e33c36e3b27c49c9f1951f6b037d7f (patch) | |
tree | a43daec41b4d3955e7a4f8d0ed0654a7c80527ec /net/dsa/dsa.c | |
parent | 9747e2313838ee8f5d8073fd6aa7289255c3c51b (diff) | |
parent | b29794ec95c6856b316c2295904208bf11ffddd9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Just some simple overlapping changes in marvell PHY driver
and the DSA core code.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index fdc448b30e56..517215391514 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -228,6 +228,53 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev, | |||
228 | return 0; | 228 | return 0; |
229 | } | 229 | } |
230 | 230 | ||
231 | #ifdef CONFIG_PM_SLEEP | ||
232 | int dsa_switch_suspend(struct dsa_switch *ds) | ||
233 | { | ||
234 | int i, ret = 0; | ||
235 | |||
236 | /* Suspend slave network devices */ | ||
237 | for (i = 0; i < ds->num_ports; i++) { | ||
238 | if (!dsa_is_port_initialized(ds, i)) | ||
239 | continue; | ||
240 | |||
241 | ret = dsa_slave_suspend(ds->ports[i].netdev); | ||
242 | if (ret) | ||
243 | return ret; | ||
244 | } | ||
245 | |||
246 | if (ds->ops->suspend) | ||
247 | ret = ds->ops->suspend(ds); | ||
248 | |||
249 | return ret; | ||
250 | } | ||
251 | EXPORT_SYMBOL_GPL(dsa_switch_suspend); | ||
252 | |||
253 | int dsa_switch_resume(struct dsa_switch *ds) | ||
254 | { | ||
255 | int i, ret = 0; | ||
256 | |||
257 | if (ds->ops->resume) | ||
258 | ret = ds->ops->resume(ds); | ||
259 | |||
260 | if (ret) | ||
261 | return ret; | ||
262 | |||
263 | /* Resume slave network devices */ | ||
264 | for (i = 0; i < ds->num_ports; i++) { | ||
265 | if (!dsa_is_port_initialized(ds, i)) | ||
266 | continue; | ||
267 | |||
268 | ret = dsa_slave_resume(ds->ports[i].netdev); | ||
269 | if (ret) | ||
270 | return ret; | ||
271 | } | ||
272 | |||
273 | return 0; | ||
274 | } | ||
275 | EXPORT_SYMBOL_GPL(dsa_switch_resume); | ||
276 | #endif | ||
277 | |||
231 | static struct packet_type dsa_pack_type __read_mostly = { | 278 | static struct packet_type dsa_pack_type __read_mostly = { |
232 | .type = cpu_to_be16(ETH_P_XDSA), | 279 | .type = cpu_to_be16(ETH_P_XDSA), |
233 | .func = dsa_switch_rcv, | 280 | .func = dsa_switch_rcv, |