MCPcopy Create free account
hub / github.com/F-Stack/f-stack / platform_bus_scan

Function platform_bus_scan

dpdk/drivers/bus/platform/platform.c:154–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154static int
155platform_bus_scan(void)
156{
157 const struct dirent *ent;
158 const char *dev_name;
159 int ret = 0;
160 DIR *dp;
161
162 dp = opendir(PLATFORM_BUS_DEVICES_PATH);
163 if (dp == NULL) {
164 PLATFORM_LOG(INFO, "failed to open %s\n", PLATFORM_BUS_DEVICES_PATH);
165 return -errno;
166 }
167
168 while ((ent = readdir(dp))) {
169 dev_name = ent->d_name;
170 if (dev_name[0] == '.')
171 continue;
172
173 if (!dev_allowed(dev_name))
174 continue;
175
176 if (!dev_is_bound_vfio_platform(dev_name))
177 continue;
178
179 ret = dev_add(dev_name);
180 if (ret)
181 break;
182 }
183
184 closedir(dp);
185
186 return ret;
187}
188
189static int
190device_map_resource_offset(struct rte_platform_device *pdev, struct rte_platform_resource *res,

Callers

nothing calls this directly

Calls 6

opendirFunction · 0.85
readdirFunction · 0.85
dev_allowedFunction · 0.85
dev_addFunction · 0.85
closedirFunction · 0.85

Tested by

no test coverage detected