Lines Matching refs:ops

281 	const struct rtnl_link_ops *ops;  in rtnl_link_ops_get()  local
283 list_for_each_entry(ops, &link_ops, list) { in rtnl_link_ops_get()
284 if (!strcmp(ops->kind, kind)) in rtnl_link_ops_get()
285 return ops; in rtnl_link_ops_get()
300 int __rtnl_link_register(struct rtnl_link_ops *ops) in __rtnl_link_register() argument
302 if (rtnl_link_ops_get(ops->kind)) in __rtnl_link_register()
310 if (ops->setup && !ops->dellink) in __rtnl_link_register()
311 ops->dellink = unregister_netdevice_queue; in __rtnl_link_register()
313 list_add_tail(&ops->list, &link_ops); in __rtnl_link_register()
324 int rtnl_link_register(struct rtnl_link_ops *ops) in rtnl_link_register() argument
329 err = __rtnl_link_register(ops); in rtnl_link_register()
335 static void __rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops) in __rtnl_kill_links() argument
341 if (dev->rtnl_link_ops == ops) in __rtnl_kill_links()
342 ops->dellink(dev, &list_kill); in __rtnl_kill_links()
353 void __rtnl_link_unregister(struct rtnl_link_ops *ops) in __rtnl_link_unregister() argument
358 __rtnl_kill_links(net, ops); in __rtnl_link_unregister()
360 list_del(&ops->list); in __rtnl_link_unregister()
396 void rtnl_link_unregister(struct rtnl_link_ops *ops) in rtnl_link_unregister() argument
401 __rtnl_link_unregister(ops); in rtnl_link_unregister()
410 const struct rtnl_link_ops *ops; in rtnl_link_get_slave_info_data_size() local
415 ops = master_dev->rtnl_link_ops; in rtnl_link_get_slave_info_data_size()
416 if (!ops || !ops->get_slave_size) in rtnl_link_get_slave_info_data_size()
420 ops->get_slave_size(master_dev, dev); in rtnl_link_get_slave_info_data_size()
425 const struct rtnl_link_ops *ops = dev->rtnl_link_ops; in rtnl_link_get_size() local
428 if (!ops) in rtnl_link_get_size()
432 nla_total_size(strlen(ops->kind) + 1); /* IFLA_INFO_KIND */ in rtnl_link_get_size()
434 if (ops->get_size) in rtnl_link_get_size()
437 ops->get_size(dev); in rtnl_link_get_size()
439 if (ops->get_xstats_size) in rtnl_link_get_size()
441 size += nla_total_size(ops->get_xstats_size(dev)); in rtnl_link_get_size()
452 const struct rtnl_af_ops *ops; in rtnl_af_lookup() local
454 list_for_each_entry(ops, &rtnl_af_ops, list) { in rtnl_af_lookup()
455 if (ops->family == family) in rtnl_af_lookup()
456 return ops; in rtnl_af_lookup()
468 void rtnl_af_register(struct rtnl_af_ops *ops) in rtnl_af_register() argument
471 list_add_tail(&ops->list, &rtnl_af_ops); in rtnl_af_register()
482 void __rtnl_af_unregister(struct rtnl_af_ops *ops) in __rtnl_af_unregister() argument
484 list_del(&ops->list); in __rtnl_af_unregister()
492 void rtnl_af_unregister(struct rtnl_af_ops *ops) in rtnl_af_unregister() argument
495 __rtnl_af_unregister(ops); in rtnl_af_unregister()
534 const struct rtnl_link_ops *ops; in rtnl_link_slave_info_fill() local
541 ops = master_dev->rtnl_link_ops; in rtnl_link_slave_info_fill()
542 if (!ops) in rtnl_link_slave_info_fill()
544 if (nla_put_string(skb, IFLA_INFO_SLAVE_KIND, ops->kind) < 0) in rtnl_link_slave_info_fill()
546 if (ops->fill_slave_info) { in rtnl_link_slave_info_fill()
550 err = ops->fill_slave_info(skb, master_dev, dev); in rtnl_link_slave_info_fill()
565 const struct rtnl_link_ops *ops = dev->rtnl_link_ops; in rtnl_link_info_fill() local
569 if (!ops) in rtnl_link_info_fill()
571 if (nla_put_string(skb, IFLA_INFO_KIND, ops->kind) < 0) in rtnl_link_info_fill()
573 if (ops->fill_xstats) { in rtnl_link_info_fill()
574 err = ops->fill_xstats(skb, dev); in rtnl_link_info_fill()
578 if (ops->fill_info) { in rtnl_link_info_fill()
582 err = ops->fill_info(skb, dev); in rtnl_link_info_fill()
1235 nla_put_string(skb, IFLA_QDISC, dev->qdisc->ops->id)) || in rtnl_fill_ifinfo()
1541 const struct net_device_ops *ops = dev->netdev_ops; in do_setvfinfo() local
1548 if (ops->ndo_set_vf_mac) in do_setvfinfo()
1549 err = ops->ndo_set_vf_mac(dev, ivm->vf, in do_setvfinfo()
1559 if (ops->ndo_set_vf_vlan) in do_setvfinfo()
1560 err = ops->ndo_set_vf_vlan(dev, ivv->vf, ivv->vlan, in do_setvfinfo()
1571 if (ops->ndo_get_vf_config) in do_setvfinfo()
1572 err = ops->ndo_get_vf_config(dev, ivt->vf, &ivf); in do_setvfinfo()
1577 if (ops->ndo_set_vf_rate) in do_setvfinfo()
1578 err = ops->ndo_set_vf_rate(dev, ivt->vf, in do_setvfinfo()
1589 if (ops->ndo_set_vf_rate) in do_setvfinfo()
1590 err = ops->ndo_set_vf_rate(dev, ivt->vf, in do_setvfinfo()
1601 if (ops->ndo_set_vf_spoofchk) in do_setvfinfo()
1602 err = ops->ndo_set_vf_spoofchk(dev, ivs->vf, in do_setvfinfo()
1612 if (ops->ndo_set_vf_link_state) in do_setvfinfo()
1613 err = ops->ndo_set_vf_link_state(dev, ivl->vf, in do_setvfinfo()
1624 if (ops->ndo_set_vf_rss_query_en) in do_setvfinfo()
1625 err = ops->ndo_set_vf_rss_query_en(dev, ivrssq_en->vf, in do_setvfinfo()
1635 if (ops->ndo_set_vf_trust) in do_setvfinfo()
1636 err = ops->ndo_set_vf_trust(dev, ivt->vf, ivt->setting); in do_setvfinfo()
1647 const struct net_device_ops *ops; in do_set_master() local
1653 ops = upper_dev->netdev_ops; in do_set_master()
1654 if (ops->ndo_del_slave) { in do_set_master()
1655 err = ops->ndo_del_slave(upper_dev, dev); in do_set_master()
1667 ops = upper_dev->netdev_ops; in do_set_master()
1668 if (ops->ndo_add_slave) { in do_set_master()
1669 err = ops->ndo_add_slave(upper_dev, dev); in do_set_master()
1686 const struct net_device_ops *ops = dev->netdev_ops; in do_setlink() local
1711 if (!ops->ndo_set_config) { in do_setlink()
1729 err = ops->ndo_set_config(dev, &k_map); in do_setlink()
1865 if (!ops->ndo_set_vf_port) in do_setlink()
1883 err = ops->ndo_set_vf_port(dev, vf, port); in do_setlink()
1900 if (ops->ndo_set_vf_port) in do_setlink()
1901 err = ops->ndo_set_vf_port(dev, PORT_SELF_VF, port); in do_setlink()
1999 const struct rtnl_link_ops *ops; in rtnl_group_dellink() local
2002 ops = dev->rtnl_link_ops; in rtnl_group_dellink()
2003 if (!ops || !ops->dellink) in rtnl_group_dellink()
2013 const struct rtnl_link_ops *ops; in rtnl_group_dellink() local
2015 ops = dev->rtnl_link_ops; in rtnl_group_dellink()
2016 ops->dellink(dev, &list_kill); in rtnl_group_dellink()
2026 const struct rtnl_link_ops *ops; in rtnl_delete_link() local
2029 ops = dev->rtnl_link_ops; in rtnl_delete_link()
2030 if (!ops || !ops->dellink) in rtnl_delete_link()
2033 ops->dellink(dev, &list_kill); in rtnl_delete_link()
2093 const struct rtnl_link_ops *ops, struct nlattr *tb[]) in rtnl_create_link() argument
2102 else if (ops->get_num_tx_queues) in rtnl_create_link()
2103 num_tx_queues = ops->get_num_tx_queues(); in rtnl_create_link()
2107 else if (ops->get_num_rx_queues) in rtnl_create_link()
2108 num_rx_queues = ops->get_num_rx_queues(); in rtnl_create_link()
2111 dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type, in rtnl_create_link()
2112 ops->setup, num_tx_queues, num_rx_queues); in rtnl_create_link()
2117 dev->rtnl_link_ops = ops; in rtnl_create_link()
2168 const struct rtnl_link_ops *ops; in rtnl_newlink() local
2222 ops = rtnl_link_ops_get(kind); in rtnl_newlink()
2225 ops = NULL; in rtnl_newlink()
2229 struct nlattr *attr[ops ? ops->maxtype + 1 : 1]; in rtnl_newlink()
2235 if (ops) { in rtnl_newlink()
2236 if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) { in rtnl_newlink()
2237 err = nla_parse_nested(attr, ops->maxtype, in rtnl_newlink()
2239 ops->policy); in rtnl_newlink()
2244 if (ops->validate) { in rtnl_newlink()
2245 err = ops->validate(tb, data); in rtnl_newlink()
2278 if (!ops || ops != dev->rtnl_link_ops || in rtnl_newlink()
2279 !ops->changelink) in rtnl_newlink()
2282 err = ops->changelink(dev, tb, data); in rtnl_newlink()
2313 if (!ops) { in rtnl_newlink()
2319 ops = rtnl_link_ops_get(kind); in rtnl_newlink()
2320 if (ops) in rtnl_newlink()
2327 if (!ops->setup) in rtnl_newlink()
2331 snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind); in rtnl_newlink()
2357 name_assign_type, ops, tb); in rtnl_newlink()
2365 if (ops->newlink) { in rtnl_newlink()
2366 err = ops->newlink(link_net ? : net, dev, tb, data); in rtnl_newlink()
2398 if (ops->newlink) { in rtnl_newlink()
2401 ops->dellink(dev, &list_kill); in rtnl_newlink()
2731 const struct net_device_ops *ops = br_dev->netdev_ops; in rtnl_fdb_add() local
2733 err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid, in rtnl_fdb_add()
2833 const struct net_device_ops *ops = br_dev->netdev_ops; in rtnl_fdb_del() local
2835 if (ops->ndo_fdb_del) in rtnl_fdb_del()
2836 err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid); in rtnl_fdb_del()
2922 const struct net_device_ops *ops = NULL; in rtnl_fdb_dump() local
2943 ops = br_dev->netdev_ops; in rtnl_fdb_dump()
2965 cops = ops; in rtnl_fdb_dump()
3119 const struct net_device_ops *ops = dev->netdev_ops; in rtnl_bridge_getlink() local
3133 if (ops->ndo_bridge_getlink) { in rtnl_bridge_getlink()
3135 err = ops->ndo_bridge_getlink(skb, portid, in rtnl_bridge_getlink()