diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2015-08-10 09:09:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-11 15:03:19 -0400 |
commit | 2a778e1b58990e15de5cba4badec1fa7ecb87e80 (patch) | |
tree | 574827e465061bb9ca63255176b756fc13e3a60f /net/dsa | |
parent | c5723ac51f2a1eaa69d831b919129a3c2b7efeee (diff) |
net: dsa: change FDB routines prototypes
Change the prototype of port_getnext to include a vid parameter.
This is necessary to introduce the support for VLAN.
Also rename the fdb_{add,del,getnext} function pointers to
port_fdb_{add,del,getnext} since they are specific to a given port.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 0010c690cc67..3d341b694ecf 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -208,8 +208,8 @@ static int dsa_slave_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
208 | struct dsa_switch *ds = p->parent; | 208 | struct dsa_switch *ds = p->parent; |
209 | int ret = -EOPNOTSUPP; | 209 | int ret = -EOPNOTSUPP; |
210 | 210 | ||
211 | if (ds->drv->fdb_add) | 211 | if (ds->drv->port_fdb_add) |
212 | ret = ds->drv->fdb_add(ds, p->port, addr, vid); | 212 | ret = ds->drv->port_fdb_add(ds, p->port, addr, vid); |
213 | 213 | ||
214 | return ret; | 214 | return ret; |
215 | } | 215 | } |
@@ -222,8 +222,8 @@ static int dsa_slave_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], | |||
222 | struct dsa_switch *ds = p->parent; | 222 | struct dsa_switch *ds = p->parent; |
223 | int ret = -EOPNOTSUPP; | 223 | int ret = -EOPNOTSUPP; |
224 | 224 | ||
225 | if (ds->drv->fdb_del) | 225 | if (ds->drv->port_fdb_del) |
226 | ret = ds->drv->fdb_del(ds, p->port, addr, vid); | 226 | ret = ds->drv->port_fdb_del(ds, p->port, addr, vid); |
227 | 227 | ||
228 | return ret; | 228 | return ret; |
229 | } | 229 | } |
@@ -272,22 +272,24 @@ static int dsa_slave_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, | |||
272 | struct dsa_slave_priv *p = netdev_priv(dev); | 272 | struct dsa_slave_priv *p = netdev_priv(dev); |
273 | struct dsa_switch *ds = p->parent; | 273 | struct dsa_switch *ds = p->parent; |
274 | unsigned char addr[ETH_ALEN] = { 0 }; | 274 | unsigned char addr[ETH_ALEN] = { 0 }; |
275 | u16 vid = 0; | ||
275 | int ret; | 276 | int ret; |
276 | 277 | ||
277 | if (!ds->drv->fdb_getnext) | 278 | if (!ds->drv->port_fdb_getnext) |
278 | return -EOPNOTSUPP; | 279 | return -EOPNOTSUPP; |
279 | 280 | ||
280 | for (; ; idx++) { | 281 | for (; ; idx++) { |
281 | bool is_static; | 282 | bool is_static; |
282 | 283 | ||
283 | ret = ds->drv->fdb_getnext(ds, p->port, addr, &is_static); | 284 | ret = ds->drv->port_fdb_getnext(ds, p->port, addr, &vid, |
285 | &is_static); | ||
284 | if (ret < 0) | 286 | if (ret < 0) |
285 | break; | 287 | break; |
286 | 288 | ||
287 | if (idx < cb->args[0]) | 289 | if (idx < cb->args[0]) |
288 | continue; | 290 | continue; |
289 | 291 | ||
290 | ret = dsa_slave_fill_info(dev, skb, addr, 0, | 292 | ret = dsa_slave_fill_info(dev, skb, addr, vid, |
291 | is_static, | 293 | is_static, |
292 | NETLINK_CB(cb->skb).portid, | 294 | NETLINK_CB(cb->skb).portid, |
293 | cb->nlh->nlmsg_seq, | 295 | cb->nlh->nlmsg_seq, |