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

Function bcmfs_vdev_probe

dpdk/drivers/crypto/bcmfs/bcmfs_device.c:235–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234
235static int
236bcmfs_vdev_probe(struct rte_vdev_device *vdev)
237{
238 struct bcmfs_device *fsdev;
239 char top_dirpath[BCMFS_MAX_PATH_LEN];
240 char sub_dirpath[BCMFS_MAX_PATH_LEN];
241 char out_dirpath[BCMFS_MAX_PATH_LEN];
242 char out_dirname[BCMFS_MAX_PATH_LEN];
243 uint32_t fsdev_dev[BCMFS_MAX_NODES];
244 enum bcmfs_device_type dtype;
245 int err;
246 int i = 0;
247 int dev_idx;
248 int count = 0;
249 bool found = false;
250
251 sprintf(top_dirpath, "%s", SYSFS_BCM_PLTFORM_DEVICES);
252 while (strlen(dev_table[i].name)) {
253 found = fsdev_find_sub_dir(top_dirpath,
254 dev_table[i].name,
255 sub_dirpath);
256 if (found)
257 break;
258 i++;
259 }
260 if (!found) {
261 BCMFS_LOG(ERR, "No supported bcmfs dev found");
262 return -ENODEV;
263 }
264
265 dev_idx = i;
266 dtype = dev_table[i].type;
267
268 snprintf(out_dirpath, sizeof(out_dirpath), "%s/%s",
269 top_dirpath, sub_dirpath);
270 count = fsdev_find_all_devs(out_dirpath,
271 dev_table[dev_idx].suffix,
272 fsdev_dev);
273 if (!count) {
274 BCMFS_LOG(ERR, "No supported bcmfs dev found");
275 return -ENODEV;
276 }
277
278 i = 0;
279 while (count) {
280 /* format the device name present in the patch */
281 snprintf(out_dirname, sizeof(out_dirname), "%x.%s",
282 fsdev_dev[i], dev_table[dev_idx].suffix);
283 fsdev = fsdev_allocate_one_dev(vdev, out_dirpath,
284 out_dirname, dtype);
285 if (!fsdev) {
286 count--;
287 i++;
288 continue;
289 }
290 break;
291 }
292 if (fsdev == NULL) {

Callers

nothing calls this directly

Calls 7

sprintfFunction · 0.85
fsdev_find_sub_dirFunction · 0.85
snprintfFunction · 0.85
fsdev_find_all_devsFunction · 0.85
fsdev_allocate_one_devFunction · 0.85
bcmfs_sym_dev_createFunction · 0.85
fsdev_releaseFunction · 0.85

Tested by

no test coverage detected