aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:33:03 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 08:44:55 -0400
commit64131a87f2aae2ed9e05d8227c5b009ca6c50d98 (patch)
treefdea23fd59216120bf54a48c60ca24489a733f14 /include/net/switchdev.h
parent676ee36be04985062522804c2de04f0764212be6 (diff)
parent2c33ce009ca2389dbf0535d0672214d09738e35e (diff)
Merge branch 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux into v4l_for_linus
* 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux: (9717 commits) media-bus: Fixup RGB444_1X12, RGB565_1X16, and YUV8_1X24 media bus format hexdump: avoid warning in test function fs: take i_mutex during prepare_binprm for set[ug]id executables smp: Fix error case handling in smp_call_function_*() iommu-common: Fix PARISC compile-time warnings sparc: Make LDC use common iommu poll management functions sparc: Make sparc64 use scalable lib/iommu-common.c functions Break up monolithic iommu table/lock into finer graularity pools and lock sparc: Revert generic IOMMU allocator. tools/power turbostat: correct dumped pkg-cstate-limit value tools/power turbostat: calculate TSC frequency from CPUID(0x15) on SKL tools/power turbostat: correct DRAM RAPL units on recent Xeon processors tools/power turbostat: Initial Skylake support tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile tools/power turbostat: modprobe msr, if needed tools/power turbostat: dump MSR_TURBO_RATIO_LIMIT2 tools/power turbostat: use new MSR_TURBO_RATIO_LIMIT names Bluetooth: hidp: Fix regression with older userspace and flags validation config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected perf/x86/intel/pt: Fix and clean up error handling in pt_event_add() ... That solves several merge conflicts: Documentation/DocBook/media/v4l/subdev-formats.xml Documentation/devicetree/bindings/vendor-prefixes.txt drivers/staging/media/mn88473/mn88473.c include/linux/kconfig.h include/uapi/linux/media-bus-format.h The ones at subdev-formats.xml and media-bus-format.h are not trivial. That's why we opted to merge from DRM.
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index cfcdac2e5d25..d2e69ee3019a 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * include/net/switchdev.h - Switch device API 2 * include/net/switchdev.h - Switch device API
3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us> 3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
4 * Copyright (c) 2014-2015 Scott Feldman <sfeldma@gmail.com>
4 * 5 *
5 * This program is free software; you can redistribute it and/or modify 6 * 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 * it under the terms of the GNU General Public License as published by
@@ -13,6 +14,35 @@
13#include <linux/netdevice.h> 14#include <linux/netdevice.h>
14#include <linux/notifier.h> 15#include <linux/notifier.h>
15 16
17struct fib_info;
18
19/**
20 * struct switchdev_ops - switchdev operations
21 *
22 * @swdev_parent_id_get: Called to get an ID of the switch chip this port
23 * is part of. If driver implements this, it indicates that it
24 * represents a port of a switch chip.
25 *
26 * @swdev_port_stp_update: Called to notify switch device port of bridge
27 * port STP state change.
28 *
29 * @swdev_fib_ipv4_add: Called to add/modify IPv4 route to switch device.
30 *
31 * @swdev_fib_ipv4_del: Called to delete IPv4 route from switch device.
32 */
33struct swdev_ops {
34 int (*swdev_parent_id_get)(struct net_device *dev,
35 struct netdev_phys_item_id *psid);
36 int (*swdev_port_stp_update)(struct net_device *dev, u8 state);
37 int (*swdev_fib_ipv4_add)(struct net_device *dev, __be32 dst,
38 int dst_len, struct fib_info *fi,
39 u8 tos, u8 type, u32 nlflags,
40 u32 tb_id);
41 int (*swdev_fib_ipv4_del)(struct net_device *dev, __be32 dst,
42 int dst_len, struct fib_info *fi,
43 u8 tos, u8 type, u32 tb_id);
44};
45
16enum netdev_switch_notifier_type { 46enum netdev_switch_notifier_type {
17 NETDEV_SWITCH_FDB_ADD = 1, 47 NETDEV_SWITCH_FDB_ADD = 1,
18 NETDEV_SWITCH_FDB_DEL, 48 NETDEV_SWITCH_FDB_DEL,
@@ -51,6 +81,12 @@ int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
51 struct nlmsghdr *nlh, u16 flags); 81 struct nlmsghdr *nlh, u16 flags);
52int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev, 82int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
53 struct nlmsghdr *nlh, u16 flags); 83 struct nlmsghdr *nlh, u16 flags);
84int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
85 u8 tos, u8 type, u32 nlflags, u32 tb_id);
86int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
87 u8 tos, u8 type, u32 tb_id);
88void netdev_switch_fib_ipv4_abort(struct fib_info *fi);
89
54#else 90#else
55 91
56static inline int netdev_switch_parent_id_get(struct net_device *dev, 92static inline int netdev_switch_parent_id_get(struct net_device *dev,
@@ -109,6 +145,25 @@ static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *
109 return 0; 145 return 0;
110} 146}
111 147
148static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
149 struct fib_info *fi,
150 u8 tos, u8 type,
151 u32 nlflags, u32 tb_id)
152{
153 return 0;
154}
155
156static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
157 struct fib_info *fi,
158 u8 tos, u8 type, u32 tb_id)
159{
160 return 0;
161}
162
163static inline void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
164{
165}
166
112#endif 167#endif
113 168
114#endif /* _LINUX_SWITCHDEV_H_ */ 169#endif /* _LINUX_SWITCHDEV_H_ */