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()
533 const struct rtnl_link_ops *ops; in rtnl_link_slave_info_fill() local
540 ops = master_dev->rtnl_link_ops; in rtnl_link_slave_info_fill()
541 if (!ops) in rtnl_link_slave_info_fill()
543 if (nla_put_string(skb, IFLA_INFO_SLAVE_KIND, ops->kind) < 0) in rtnl_link_slave_info_fill()
545 if (ops->fill_slave_info) { in rtnl_link_slave_info_fill()
549 err = ops->fill_slave_info(skb, master_dev, dev); in rtnl_link_slave_info_fill()
564 const struct rtnl_link_ops *ops = dev->rtnl_link_ops; in rtnl_link_info_fill() local
568 if (!ops) in rtnl_link_info_fill()
570 if (nla_put_string(skb, IFLA_INFO_KIND, ops->kind) < 0) in rtnl_link_info_fill()
572 if (ops->fill_xstats) { in rtnl_link_info_fill()
573 err = ops->fill_xstats(skb, dev); in rtnl_link_info_fill()
577 if (ops->fill_info) { in rtnl_link_info_fill()
581 err = ops->fill_info(skb, dev); in rtnl_link_info_fill()
1065 nla_put_string(skb, IFLA_QDISC, dev->qdisc->ops->id)) || in rtnl_fill_ifinfo()
1438 const struct net_device_ops *ops = dev->netdev_ops; in do_setvfinfo() local
1445 if (ops->ndo_set_vf_mac) in do_setvfinfo()
1446 err = ops->ndo_set_vf_mac(dev, ivm->vf, in do_setvfinfo()
1456 if (ops->ndo_set_vf_vlan) in do_setvfinfo()
1457 err = ops->ndo_set_vf_vlan(dev, ivv->vf, ivv->vlan, in do_setvfinfo()
1468 if (ops->ndo_get_vf_config) in do_setvfinfo()
1469 err = ops->ndo_get_vf_config(dev, ivt->vf, &ivf); in do_setvfinfo()
1474 if (ops->ndo_set_vf_rate) in do_setvfinfo()
1475 err = ops->ndo_set_vf_rate(dev, ivt->vf, in do_setvfinfo()
1486 if (ops->ndo_set_vf_rate) in do_setvfinfo()
1487 err = ops->ndo_set_vf_rate(dev, ivt->vf, in do_setvfinfo()
1498 if (ops->ndo_set_vf_spoofchk) in do_setvfinfo()
1499 err = ops->ndo_set_vf_spoofchk(dev, ivs->vf, in do_setvfinfo()
1509 if (ops->ndo_set_vf_link_state) in do_setvfinfo()
1510 err = ops->ndo_set_vf_link_state(dev, ivl->vf, in do_setvfinfo()
1521 if (ops->ndo_set_vf_rss_query_en) in do_setvfinfo()
1522 err = ops->ndo_set_vf_rss_query_en(dev, ivrssq_en->vf, in do_setvfinfo()
1534 const struct net_device_ops *ops; in do_set_master() local
1540 ops = upper_dev->netdev_ops; in do_set_master()
1541 if (ops->ndo_del_slave) { in do_set_master()
1542 err = ops->ndo_del_slave(upper_dev, dev); in do_set_master()
1554 ops = upper_dev->netdev_ops; in do_set_master()
1555 if (ops->ndo_add_slave) { in do_set_master()
1556 err = ops->ndo_add_slave(upper_dev, dev); in do_set_master()
1573 const struct net_device_ops *ops = dev->netdev_ops; in do_setlink() local
1598 if (!ops->ndo_set_config) { in do_setlink()
1616 err = ops->ndo_set_config(dev, &k_map); in do_setlink()
1752 if (!ops->ndo_set_vf_port) in do_setlink()
1767 err = ops->ndo_set_vf_port(dev, vf, port); in do_setlink()
1784 if (ops->ndo_set_vf_port) in do_setlink()
1785 err = ops->ndo_set_vf_port(dev, PORT_SELF_VF, port); in do_setlink()
1875 const struct rtnl_link_ops *ops; in rtnl_group_dellink() local
1878 ops = dev->rtnl_link_ops; in rtnl_group_dellink()
1879 if (!ops || !ops->dellink) in rtnl_group_dellink()
1889 const struct rtnl_link_ops *ops; in rtnl_group_dellink() local
1891 ops = dev->rtnl_link_ops; in rtnl_group_dellink()
1892 ops->dellink(dev, &list_kill); in rtnl_group_dellink()
1903 const struct rtnl_link_ops *ops; in rtnl_dellink() local
1931 ops = dev->rtnl_link_ops; in rtnl_dellink()
1932 if (!ops || !ops->dellink) in rtnl_dellink()
1935 ops->dellink(dev, &list_kill); in rtnl_dellink()
1961 const struct rtnl_link_ops *ops, struct nlattr *tb[]) in rtnl_create_link() argument
1970 else if (ops->get_num_tx_queues) in rtnl_create_link()
1971 num_tx_queues = ops->get_num_tx_queues(); in rtnl_create_link()
1975 else if (ops->get_num_rx_queues) in rtnl_create_link()
1976 num_rx_queues = ops->get_num_rx_queues(); in rtnl_create_link()
1979 dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type, in rtnl_create_link()
1980 ops->setup, num_tx_queues, num_rx_queues); in rtnl_create_link()
1985 dev->rtnl_link_ops = ops; in rtnl_create_link()
2036 const struct rtnl_link_ops *ops; in rtnl_newlink() local
2090 ops = rtnl_link_ops_get(kind); in rtnl_newlink()
2093 ops = NULL; in rtnl_newlink()
2097 struct nlattr *attr[ops ? ops->maxtype + 1 : 1]; in rtnl_newlink()
2103 if (ops) { in rtnl_newlink()
2104 if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) { in rtnl_newlink()
2105 err = nla_parse_nested(attr, ops->maxtype, in rtnl_newlink()
2107 ops->policy); in rtnl_newlink()
2112 if (ops->validate) { in rtnl_newlink()
2113 err = ops->validate(tb, data); in rtnl_newlink()
2146 if (!ops || ops != dev->rtnl_link_ops || in rtnl_newlink()
2147 !ops->changelink) in rtnl_newlink()
2150 err = ops->changelink(dev, tb, data); in rtnl_newlink()
2181 if (!ops) { in rtnl_newlink()
2187 ops = rtnl_link_ops_get(kind); in rtnl_newlink()
2188 if (ops) in rtnl_newlink()
2195 if (!ops->setup) in rtnl_newlink()
2199 snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind); in rtnl_newlink()
2225 name_assign_type, ops, tb); in rtnl_newlink()
2233 if (ops->newlink) { in rtnl_newlink()
2234 err = ops->newlink(link_net ? : net, dev, tb, data); in rtnl_newlink()
2266 if (ops->newlink) { in rtnl_newlink()
2269 ops->dellink(dev, &list_kill); in rtnl_newlink()
2599 const struct net_device_ops *ops = br_dev->netdev_ops; in rtnl_fdb_add() local
2601 err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid, in rtnl_fdb_add()
2701 const struct net_device_ops *ops = br_dev->netdev_ops; in rtnl_fdb_del() local
2703 if (ops->ndo_fdb_del) in rtnl_fdb_del()
2704 err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid); in rtnl_fdb_del()
2790 const struct net_device_ops *ops = NULL; in rtnl_fdb_dump() local
2811 ops = br_dev->netdev_ops; in rtnl_fdb_dump()
2833 cops = ops; in rtnl_fdb_dump()
2974 const struct net_device_ops *ops = dev->netdev_ops; in rtnl_bridge_getlink() local
2986 if (ops->ndo_bridge_getlink) { in rtnl_bridge_getlink()
2988 ops->ndo_bridge_getlink(skb, portid, seq, dev, in rtnl_bridge_getlink()