Lines Matching refs:info

167 static int dev_pci_onboard(sd_device *dev, const LinkInfo *info, NetNames *names) {  in dev_pci_onboard()  argument
175 assert(info); in dev_pci_onboard()
211 if (!isempty(info->phys_port_name)) in dev_pci_onboard()
213 l = strpcpyf(&s, l, "n%s", info->phys_port_name); in dev_pci_onboard()
219 idx, strempty(info->phys_port_name), dev_port, in dev_pci_onboard()
325 static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) { in dev_pci_slot() argument
338 assert(info); in dev_pci_slot()
370 info->iftype == ARPHRD_INFINIBAND && in dev_pci_slot()
388 if (!isempty(info->phys_port_name)) in dev_pci_slot()
390 l = strpcpyf(&s, l, "n%s", info->phys_port_name); in dev_pci_slot()
397 domain, bus, slot, func, strempty(info->phys_port_name), dev_port, in dev_pci_slot()
483 if (!isempty(info->phys_port_name)) in dev_pci_slot()
484 l = strpcpyf(&s, l, "n%s", info->phys_port_name); in dev_pci_slot()
491 … domain, hotplug_slot, func, strempty(info->phys_port_name), dev_port, in dev_pci_slot()
604 static int names_pci(sd_device *dev, const LinkInfo *info, NetNames *names) { in names_pci() argument
612 assert(info); in names_pci()
641 dev_pci_onboard(dev, info, &vf_names); in names_pci()
642 dev_pci_slot(dev, info, &vf_names); in names_pci()
657 dev_pci_onboard(dev, info, names); in names_pci()
658 dev_pci_slot(dev, info, names); in names_pci()
820 static int names_mac(sd_device *dev, const LinkInfo *info) { in names_mac() argument
826 assert(info); in names_mac()
831 if (info->iftype == ARPHRD_INFINIBAND) in names_mac()
834 if (info->hw_addr.length != 6) in names_mac()
837 info->hw_addr.length); in names_mac()
852 static int names_netdevsim(sd_device *dev, const LinkInfo *info, NetNames *names) { in names_netdevsim() argument
862 assert(info); in names_netdevsim()
865 if (isempty(info->phys_port_name)) in names_netdevsim()
878 …if (!snprintf_ok(names->netdevsim_path, sizeof(names->netdevsim_path), "i%un%s", addr, info->phys_… in names_netdevsim()
940 static int ieee_oui(sd_device *dev, const LinkInfo *info, bool test) { in ieee_oui() argument
944 assert(info); in ieee_oui()
946 if (info->hw_addr.length != 6) in ieee_oui()
950 if (info->hw_addr.bytes[0] == 0 && in ieee_oui()
951 info->hw_addr.bytes[1] == 0 && in ieee_oui()
952 info->hw_addr.bytes[2] == 0) in ieee_oui()
956 info->hw_addr.bytes[0], in ieee_oui()
957 info->hw_addr.bytes[1], in ieee_oui()
958 info->hw_addr.bytes[2], in ieee_oui()
959 info->hw_addr.bytes[3], in ieee_oui()
960 info->hw_addr.bytes[4], in ieee_oui()
961 info->hw_addr.bytes[5]); in ieee_oui()
966 _cleanup_(link_info_clear) LinkInfo info = LINK_INFO_NULL; in builtin_net_id()
975 r = link_info_get(rtnl, ifindex, &info); in builtin_net_id()
979 if (!info.phys_port_name_supported) { in builtin_net_id()
984 info.phys_port_name = strdup(s); in builtin_net_id()
985 if (!info.phys_port_name) in builtin_net_id()
990 r = device_cache_sysattr_from_link_info(dev, &info); in builtin_net_id()
995 if (info.ifindex != (int) info.iflink) in builtin_net_id()
999 switch (info.iftype) { in builtin_net_id()
1025 if (names_mac(dev, &info) >= 0) { in builtin_net_id()
1028 … xsprintf(str, "%sx%s", prefix, HW_ADDR_TO_STR_FULL(&info.hw_addr, HW_ADDR_TO_STRING_NO_COLON)); in builtin_net_id()
1031 HW_ADDR_TO_STR(&info.hw_addr), str + strlen(prefix)); in builtin_net_id()
1033 ieee_oui(dev, &info, test); in builtin_net_id()
1064 if (names_netdevsim(dev, &info, &names) >= 0 && names.type == NET_NETDEVSIM) { in builtin_net_id()
1083 if (names_pci(dev, &info, &names) < 0) in builtin_net_id()