blob: 8a6d1641fd9bb8d1c3ddc053c479a9f0531b5b18 [file] [log] [blame]
Jiri Pirko007f7902014-11-28 14:34:17 +01001/*
2 * include/net/switchdev.h - Switch device API
3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10#ifndef _LINUX_SWITCHDEV_H_
11#define _LINUX_SWITCHDEV_H_
12
13#include <linux/netdevice.h>
14
15#ifdef CONFIG_NET_SWITCHDEV
16
17int netdev_switch_parent_id_get(struct net_device *dev,
18 struct netdev_phys_item_id *psid);
Scott Feldman38dcf352014-11-28 14:34:20 +010019int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
Jiri Pirko007f7902014-11-28 14:34:17 +010020
21#else
22
23static inline int netdev_switch_parent_id_get(struct net_device *dev,
24 struct netdev_phys_item_id *psid)
25{
26 return -EOPNOTSUPP;
27}
28
Scott Feldman38dcf352014-11-28 14:34:20 +010029static inline int netdev_switch_port_stp_update(struct net_device *dev,
30 u8 state)
31{
32 return -EOPNOTSUPP;
33}
34
Jiri Pirko007f7902014-11-28 14:34:17 +010035#endif
36
37#endif /* _LINUX_SWITCHDEV_H_ */