port.c (e77bc7dc9af0ec53996367b2053dfafee83b7edb) port.c (ffb68fc58e9640762be891f9aebe4f5aac615ab3)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Handling of a single switch port
4 *
5 * Copyright (c) 2017 Savoir-faire Linux Inc.
6 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
7 */
8

--- 411 unchanged lines hidden (view full) ---

420
421 if (!ds->ops->port_fdb_dump)
422 return -EOPNOTSUPP;
423
424 return ds->ops->port_fdb_dump(ds, port, cb, data);
425}
426
427int dsa_port_mdb_add(const struct dsa_port *dp,
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Handling of a single switch port
4 *
5 * Copyright (c) 2017 Savoir-faire Linux Inc.
6 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
7 */
8

--- 411 unchanged lines hidden (view full) ---

420
421 if (!ds->ops->port_fdb_dump)
422 return -EOPNOTSUPP;
423
424 return ds->ops->port_fdb_dump(ds, port, cb, data);
425}
426
427int dsa_port_mdb_add(const struct dsa_port *dp,
428 const struct switchdev_obj_port_mdb *mdb,
429 struct switchdev_trans *trans)
428 const struct switchdev_obj_port_mdb *mdb)
430{
431 struct dsa_notifier_mdb_info info = {
432 .sw_index = dp->ds->index,
433 .port = dp->index,
429{
430 struct dsa_notifier_mdb_info info = {
431 .sw_index = dp->ds->index,
432 .port = dp->index,
434 .trans = trans,
435 .mdb = mdb,
436 };
437
438 return dsa_port_notify(dp, DSA_NOTIFIER_MDB_ADD, &info);
439}
440
441int dsa_port_mdb_del(const struct dsa_port *dp,
442 const struct switchdev_obj_port_mdb *mdb)
443{
444 struct dsa_notifier_mdb_info info = {
445 .sw_index = dp->ds->index,
446 .port = dp->index,
447 .mdb = mdb,
448 };
449
450 return dsa_port_notify(dp, DSA_NOTIFIER_MDB_DEL, &info);
451}
452
453int dsa_port_vlan_add(struct dsa_port *dp,
433 .mdb = mdb,
434 };
435
436 return dsa_port_notify(dp, DSA_NOTIFIER_MDB_ADD, &info);
437}
438
439int dsa_port_mdb_del(const struct dsa_port *dp,
440 const struct switchdev_obj_port_mdb *mdb)
441{
442 struct dsa_notifier_mdb_info info = {
443 .sw_index = dp->ds->index,
444 .port = dp->index,
445 .mdb = mdb,
446 };
447
448 return dsa_port_notify(dp, DSA_NOTIFIER_MDB_DEL, &info);
449}
450
451int dsa_port_vlan_add(struct dsa_port *dp,
454 const struct switchdev_obj_port_vlan *vlan,
455 struct switchdev_trans *trans)
452 const struct switchdev_obj_port_vlan *vlan)
456{
457 struct dsa_notifier_vlan_info info = {
458 .sw_index = dp->ds->index,
459 .port = dp->index,
453{
454 struct dsa_notifier_vlan_info info = {
455 .sw_index = dp->ds->index,
456 .port = dp->index,
460 .trans = trans,
461 .vlan = vlan,
462 };
463
464 return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_ADD, &info);
465}
466
467int dsa_port_vlan_del(struct dsa_port *dp,
468 const struct switchdev_obj_port_vlan *vlan)

--- 344 unchanged lines hidden ---
457 .vlan = vlan,
458 };
459
460 return dsa_port_notify(dp, DSA_NOTIFIER_VLAN_ADD, &info);
461}
462
463int dsa_port_vlan_del(struct dsa_port *dp,
464 const struct switchdev_obj_port_vlan *vlan)

--- 344 unchanged lines hidden ---