core.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. /*
  2. * Tests for the core driver model code
  3. *
  4. * Copyright (c) 2013 Google, Inc
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.h>
  9. #include <errno.h>
  10. #include <dm.h>
  11. #include <fdtdec.h>
  12. #include <malloc.h>
  13. #include <dm/device-internal.h>
  14. #include <dm/root.h>
  15. #include <dm/ut.h>
  16. #include <dm/util.h>
  17. #include <dm/test.h>
  18. #include <dm/uclass-internal.h>
  19. DECLARE_GLOBAL_DATA_PTR;
  20. enum {
  21. TEST_INTVAL1 = 0,
  22. TEST_INTVAL2 = 3,
  23. TEST_INTVAL3 = 6,
  24. TEST_INTVAL_MANUAL = 101112,
  25. TEST_INTVAL_PRE_RELOC = 7,
  26. };
  27. static const struct dm_test_pdata test_pdata[] = {
  28. { .ping_add = TEST_INTVAL1, },
  29. { .ping_add = TEST_INTVAL2, },
  30. { .ping_add = TEST_INTVAL3, },
  31. };
  32. static const struct dm_test_pdata test_pdata_manual = {
  33. .ping_add = TEST_INTVAL_MANUAL,
  34. };
  35. static const struct dm_test_pdata test_pdata_pre_reloc = {
  36. .ping_add = TEST_INTVAL_PRE_RELOC,
  37. };
  38. U_BOOT_DEVICE(dm_test_info1) = {
  39. .name = "test_drv",
  40. .platdata = &test_pdata[0],
  41. };
  42. U_BOOT_DEVICE(dm_test_info2) = {
  43. .name = "test_drv",
  44. .platdata = &test_pdata[1],
  45. };
  46. U_BOOT_DEVICE(dm_test_info3) = {
  47. .name = "test_drv",
  48. .platdata = &test_pdata[2],
  49. };
  50. static struct driver_info driver_info_manual = {
  51. .name = "test_manual_drv",
  52. .platdata = &test_pdata_manual,
  53. };
  54. static struct driver_info driver_info_pre_reloc = {
  55. .name = "test_pre_reloc_drv",
  56. .platdata = &test_pdata_manual,
  57. };
  58. void dm_leak_check_start(struct dm_test_state *dms)
  59. {
  60. dms->start = mallinfo();
  61. if (!dms->start.uordblks)
  62. puts("Warning: Please add '#define DEBUG' to the top of common/dlmalloc.c\n");
  63. }
  64. int dm_leak_check_end(struct dm_test_state *dms)
  65. {
  66. struct mallinfo end;
  67. int id;
  68. /* Don't delete the root class, since we started with that */
  69. for (id = UCLASS_ROOT + 1; id < UCLASS_COUNT; id++) {
  70. struct uclass *uc;
  71. uc = uclass_find(id);
  72. if (!uc)
  73. continue;
  74. ut_assertok(uclass_destroy(uc));
  75. }
  76. end = mallinfo();
  77. ut_asserteq(dms->start.uordblks, end.uordblks);
  78. return 0;
  79. }
  80. /* Test that binding with platdata occurs correctly */
  81. static int dm_test_autobind(struct dm_test_state *dms)
  82. {
  83. struct udevice *dev;
  84. /*
  85. * We should have a single class (UCLASS_ROOT) and a single root
  86. * device with no children.
  87. */
  88. ut_assert(dms->root);
  89. ut_asserteq(1, list_count_items(&gd->uclass_root));
  90. ut_asserteq(0, list_count_items(&gd->dm_root->child_head));
  91. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_BIND]);
  92. ut_assertok(dm_scan_platdata(false));
  93. /* We should have our test class now at least, plus more children */
  94. ut_assert(1 < list_count_items(&gd->uclass_root));
  95. ut_assert(0 < list_count_items(&gd->dm_root->child_head));
  96. /* Our 3 dm_test_infox children should be bound to the test uclass */
  97. ut_asserteq(3, dm_testdrv_op_count[DM_TEST_OP_POST_BIND]);
  98. /* No devices should be probed */
  99. list_for_each_entry(dev, &gd->dm_root->child_head, sibling_node)
  100. ut_assert(!(dev->flags & DM_FLAG_ACTIVATED));
  101. /* Our test driver should have been bound 3 times */
  102. ut_assert(dm_testdrv_op_count[DM_TEST_OP_BIND] == 3);
  103. return 0;
  104. }
  105. DM_TEST(dm_test_autobind, 0);
  106. /* Test that autoprobe finds all the expected devices */
  107. static int dm_test_autoprobe(struct dm_test_state *dms)
  108. {
  109. int expected_base_add;
  110. struct udevice *dev;
  111. struct uclass *uc;
  112. int i;
  113. ut_assertok(uclass_get(UCLASS_TEST, &uc));
  114. ut_assert(uc);
  115. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_INIT]);
  116. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]);
  117. /* The root device should not be activated until needed */
  118. ut_assert(dms->root->flags & DM_FLAG_ACTIVATED);
  119. /*
  120. * We should be able to find the three test devices, and they should
  121. * all be activated as they are used (lazy activation, required by
  122. * U-Boot)
  123. */
  124. for (i = 0; i < 3; i++) {
  125. ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
  126. ut_assert(dev);
  127. ut_assertf(!(dev->flags & DM_FLAG_ACTIVATED),
  128. "Driver %d/%s already activated", i, dev->name);
  129. /* This should activate it */
  130. ut_assertok(uclass_get_device(UCLASS_TEST, i, &dev));
  131. ut_assert(dev);
  132. ut_assert(dev->flags & DM_FLAG_ACTIVATED);
  133. /* Activating a device should activate the root device */
  134. if (!i)
  135. ut_assert(dms->root->flags & DM_FLAG_ACTIVATED);
  136. }
  137. /* Our 3 dm_test_infox children should be passed to post_probe */
  138. ut_asserteq(3, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]);
  139. /* Also we can check the per-device data */
  140. expected_base_add = 0;
  141. for (i = 0; i < 3; i++) {
  142. struct dm_test_uclass_perdev_priv *priv;
  143. struct dm_test_pdata *pdata;
  144. ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
  145. ut_assert(dev);
  146. priv = dev->uclass_priv;
  147. ut_assert(priv);
  148. ut_asserteq(expected_base_add, priv->base_add);
  149. pdata = dev->platdata;
  150. expected_base_add += pdata->ping_add;
  151. }
  152. return 0;
  153. }
  154. DM_TEST(dm_test_autoprobe, DM_TESTF_SCAN_PDATA);
  155. /* Check that we see the correct platdata in each device */
  156. static int dm_test_platdata(struct dm_test_state *dms)
  157. {
  158. const struct dm_test_pdata *pdata;
  159. struct udevice *dev;
  160. int i;
  161. for (i = 0; i < 3; i++) {
  162. ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
  163. ut_assert(dev);
  164. pdata = dev->platdata;
  165. ut_assert(pdata->ping_add == test_pdata[i].ping_add);
  166. }
  167. return 0;
  168. }
  169. DM_TEST(dm_test_platdata, DM_TESTF_SCAN_PDATA);
  170. /* Test that we can bind, probe, remove, unbind a driver */
  171. static int dm_test_lifecycle(struct dm_test_state *dms)
  172. {
  173. int op_count[DM_TEST_OP_COUNT];
  174. struct udevice *dev, *test_dev;
  175. int pingret;
  176. int ret;
  177. memcpy(op_count, dm_testdrv_op_count, sizeof(op_count));
  178. ut_assertok(device_bind_by_name(dms->root, false, &driver_info_manual,
  179. &dev));
  180. ut_assert(dev);
  181. ut_assert(dm_testdrv_op_count[DM_TEST_OP_BIND]
  182. == op_count[DM_TEST_OP_BIND] + 1);
  183. ut_assert(!dev->priv);
  184. /* Probe the device - it should fail allocating private data */
  185. dms->force_fail_alloc = 1;
  186. ret = device_probe(dev);
  187. ut_assert(ret == -ENOMEM);
  188. ut_assert(dm_testdrv_op_count[DM_TEST_OP_PROBE]
  189. == op_count[DM_TEST_OP_PROBE] + 1);
  190. ut_assert(!dev->priv);
  191. /* Try again without the alloc failure */
  192. dms->force_fail_alloc = 0;
  193. ut_assertok(device_probe(dev));
  194. ut_assert(dm_testdrv_op_count[DM_TEST_OP_PROBE]
  195. == op_count[DM_TEST_OP_PROBE] + 2);
  196. ut_assert(dev->priv);
  197. /* This should be device 3 in the uclass */
  198. ut_assertok(uclass_find_device(UCLASS_TEST, 3, &test_dev));
  199. ut_assert(dev == test_dev);
  200. /* Try ping */
  201. ut_assertok(test_ping(dev, 100, &pingret));
  202. ut_assert(pingret == 102);
  203. /* Now remove device 3 */
  204. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_PRE_REMOVE]);
  205. ut_assertok(device_remove(dev));
  206. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_PRE_REMOVE]);
  207. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_UNBIND]);
  208. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_PRE_UNBIND]);
  209. ut_assertok(device_unbind(dev));
  210. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_UNBIND]);
  211. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_PRE_UNBIND]);
  212. return 0;
  213. }
  214. DM_TEST(dm_test_lifecycle, DM_TESTF_SCAN_PDATA | DM_TESTF_PROBE_TEST);
  215. /* Test that we can bind/unbind and the lists update correctly */
  216. static int dm_test_ordering(struct dm_test_state *dms)
  217. {
  218. struct udevice *dev, *dev_penultimate, *dev_last, *test_dev;
  219. int pingret;
  220. ut_assertok(device_bind_by_name(dms->root, false, &driver_info_manual,
  221. &dev));
  222. ut_assert(dev);
  223. /* Bind two new devices (numbers 4 and 5) */
  224. ut_assertok(device_bind_by_name(dms->root, false, &driver_info_manual,
  225. &dev_penultimate));
  226. ut_assert(dev_penultimate);
  227. ut_assertok(device_bind_by_name(dms->root, false, &driver_info_manual,
  228. &dev_last));
  229. ut_assert(dev_last);
  230. /* Now remove device 3 */
  231. ut_assertok(device_remove(dev));
  232. ut_assertok(device_unbind(dev));
  233. /* The device numbering should have shifted down one */
  234. ut_assertok(uclass_find_device(UCLASS_TEST, 3, &test_dev));
  235. ut_assert(dev_penultimate == test_dev);
  236. ut_assertok(uclass_find_device(UCLASS_TEST, 4, &test_dev));
  237. ut_assert(dev_last == test_dev);
  238. /* Add back the original device 3, now in position 5 */
  239. ut_assertok(device_bind_by_name(dms->root, false, &driver_info_manual,
  240. &dev));
  241. ut_assert(dev);
  242. /* Try ping */
  243. ut_assertok(test_ping(dev, 100, &pingret));
  244. ut_assert(pingret == 102);
  245. /* Remove 3 and 4 */
  246. ut_assertok(device_remove(dev_penultimate));
  247. ut_assertok(device_unbind(dev_penultimate));
  248. ut_assertok(device_remove(dev_last));
  249. ut_assertok(device_unbind(dev_last));
  250. /* Our device should now be in position 3 */
  251. ut_assertok(uclass_find_device(UCLASS_TEST, 3, &test_dev));
  252. ut_assert(dev == test_dev);
  253. /* Now remove device 3 */
  254. ut_assertok(device_remove(dev));
  255. ut_assertok(device_unbind(dev));
  256. return 0;
  257. }
  258. DM_TEST(dm_test_ordering, DM_TESTF_SCAN_PDATA);
  259. /* Check that we can perform operations on a device (do a ping) */
  260. int dm_check_operations(struct dm_test_state *dms, struct udevice *dev,
  261. uint32_t base, struct dm_test_priv *priv)
  262. {
  263. int expected;
  264. int pingret;
  265. /* Getting the child device should allocate platdata / priv */
  266. ut_assertok(testfdt_ping(dev, 10, &pingret));
  267. ut_assert(dev->priv);
  268. ut_assert(dev->platdata);
  269. expected = 10 + base;
  270. ut_asserteq(expected, pingret);
  271. /* Do another ping */
  272. ut_assertok(testfdt_ping(dev, 20, &pingret));
  273. expected = 20 + base;
  274. ut_asserteq(expected, pingret);
  275. /* Now check the ping_total */
  276. priv = dev->priv;
  277. ut_asserteq(DM_TEST_START_TOTAL + 10 + 20 + base * 2,
  278. priv->ping_total);
  279. return 0;
  280. }
  281. /* Check that we can perform operations on devices */
  282. static int dm_test_operations(struct dm_test_state *dms)
  283. {
  284. struct udevice *dev;
  285. int i;
  286. /*
  287. * Now check that the ping adds are what we expect. This is using the
  288. * ping-add property in each node.
  289. */
  290. for (i = 0; i < ARRAY_SIZE(test_pdata); i++) {
  291. uint32_t base;
  292. ut_assertok(uclass_get_device(UCLASS_TEST, i, &dev));
  293. /*
  294. * Get the 'reg' property, which tells us what the ping add
  295. * should be. We don't use the platdata because we want
  296. * to test the code that sets that up (testfdt_drv_probe()).
  297. */
  298. base = test_pdata[i].ping_add;
  299. debug("dev=%d, base=%d\n", i, base);
  300. ut_assert(!dm_check_operations(dms, dev, base, dev->priv));
  301. }
  302. return 0;
  303. }
  304. DM_TEST(dm_test_operations, DM_TESTF_SCAN_PDATA);
  305. /* Remove all drivers and check that things work */
  306. static int dm_test_remove(struct dm_test_state *dms)
  307. {
  308. struct udevice *dev;
  309. int i;
  310. for (i = 0; i < 3; i++) {
  311. ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
  312. ut_assert(dev);
  313. ut_assertf(dev->flags & DM_FLAG_ACTIVATED,
  314. "Driver %d/%s not activated", i, dev->name);
  315. ut_assertok(device_remove(dev));
  316. ut_assertf(!(dev->flags & DM_FLAG_ACTIVATED),
  317. "Driver %d/%s should have deactivated", i,
  318. dev->name);
  319. ut_assert(!dev->priv);
  320. }
  321. return 0;
  322. }
  323. DM_TEST(dm_test_remove, DM_TESTF_SCAN_PDATA | DM_TESTF_PROBE_TEST);
  324. /* Remove and recreate everything, check for memory leaks */
  325. static int dm_test_leak(struct dm_test_state *dms)
  326. {
  327. int i;
  328. for (i = 0; i < 2; i++) {
  329. struct udevice *dev;
  330. int ret;
  331. int id;
  332. dm_leak_check_start(dms);
  333. ut_assertok(dm_scan_platdata(false));
  334. ut_assertok(dm_scan_fdt(gd->fdt_blob, false));
  335. /* Scanning the uclass is enough to probe all the devices */
  336. for (id = UCLASS_ROOT; id < UCLASS_COUNT; id++) {
  337. for (ret = uclass_first_device(UCLASS_TEST, &dev);
  338. dev;
  339. ret = uclass_next_device(&dev))
  340. ;
  341. ut_assertok(ret);
  342. }
  343. ut_assertok(dm_leak_check_end(dms));
  344. }
  345. return 0;
  346. }
  347. DM_TEST(dm_test_leak, 0);
  348. /* Test uclass init/destroy methods */
  349. static int dm_test_uclass(struct dm_test_state *dms)
  350. {
  351. struct uclass *uc;
  352. ut_assertok(uclass_get(UCLASS_TEST, &uc));
  353. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_INIT]);
  354. ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_DESTROY]);
  355. ut_assert(uc->priv);
  356. ut_assertok(uclass_destroy(uc));
  357. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_INIT]);
  358. ut_asserteq(1, dm_testdrv_op_count[DM_TEST_OP_DESTROY]);
  359. return 0;
  360. }
  361. DM_TEST(dm_test_uclass, 0);
  362. /**
  363. * create_children() - Create children of a parent node
  364. *
  365. * @dms: Test system state
  366. * @parent: Parent device
  367. * @count: Number of children to create
  368. * @key: Key value to put in first child. Subsequence children
  369. * receive an incrementing value
  370. * @child: If not NULL, then the child device pointers are written into
  371. * this array.
  372. * @return 0 if OK, -ve on error
  373. */
  374. static int create_children(struct dm_test_state *dms, struct udevice *parent,
  375. int count, int key, struct udevice *child[])
  376. {
  377. struct udevice *dev;
  378. int i;
  379. for (i = 0; i < count; i++) {
  380. struct dm_test_pdata *pdata;
  381. ut_assertok(device_bind_by_name(parent, false,
  382. &driver_info_manual, &dev));
  383. pdata = calloc(1, sizeof(*pdata));
  384. pdata->ping_add = key + i;
  385. dev->platdata = pdata;
  386. if (child)
  387. child[i] = dev;
  388. }
  389. return 0;
  390. }
  391. #define NODE_COUNT 10
  392. static int dm_test_children(struct dm_test_state *dms)
  393. {
  394. struct udevice *top[NODE_COUNT];
  395. struct udevice *child[NODE_COUNT];
  396. struct udevice *grandchild[NODE_COUNT];
  397. struct udevice *dev;
  398. int total;
  399. int ret;
  400. int i;
  401. /* We don't care about the numbering for this test */
  402. dms->skip_post_probe = 1;
  403. ut_assert(NODE_COUNT > 5);
  404. /* First create 10 top-level children */
  405. ut_assertok(create_children(dms, dms->root, NODE_COUNT, 0, top));
  406. /* Now a few have their own children */
  407. ut_assertok(create_children(dms, top[2], NODE_COUNT, 2, NULL));
  408. ut_assertok(create_children(dms, top[5], NODE_COUNT, 5, child));
  409. /* And grandchildren */
  410. for (i = 0; i < NODE_COUNT; i++)
  411. ut_assertok(create_children(dms, child[i], NODE_COUNT, 50 * i,
  412. i == 2 ? grandchild : NULL));
  413. /* Check total number of devices */
  414. total = NODE_COUNT * (3 + NODE_COUNT);
  415. ut_asserteq(total, dm_testdrv_op_count[DM_TEST_OP_BIND]);
  416. /* Try probing one of the grandchildren */
  417. ut_assertok(uclass_get_device(UCLASS_TEST,
  418. NODE_COUNT * 3 + 2 * NODE_COUNT, &dev));
  419. ut_asserteq_ptr(grandchild[0], dev);
  420. /*
  421. * This should have probed the child and top node also, for a total
  422. * of 3 nodes.
  423. */
  424. ut_asserteq(3, dm_testdrv_op_count[DM_TEST_OP_PROBE]);
  425. /* Probe the other grandchildren */
  426. for (i = 1; i < NODE_COUNT; i++)
  427. ut_assertok(device_probe(grandchild[i]));
  428. ut_asserteq(2 + NODE_COUNT, dm_testdrv_op_count[DM_TEST_OP_PROBE]);
  429. /* Probe everything */
  430. for (ret = uclass_first_device(UCLASS_TEST, &dev);
  431. dev;
  432. ret = uclass_next_device(&dev))
  433. ;
  434. ut_assertok(ret);
  435. ut_asserteq(total, dm_testdrv_op_count[DM_TEST_OP_PROBE]);
  436. /* Remove a top-level child and check that the children are removed */
  437. ut_assertok(device_remove(top[2]));
  438. ut_asserteq(NODE_COUNT + 1, dm_testdrv_op_count[DM_TEST_OP_REMOVE]);
  439. dm_testdrv_op_count[DM_TEST_OP_REMOVE] = 0;
  440. /* Try one with grandchildren */
  441. ut_assertok(uclass_get_device(UCLASS_TEST, 5, &dev));
  442. ut_asserteq_ptr(dev, top[5]);
  443. ut_assertok(device_remove(dev));
  444. ut_asserteq(1 + NODE_COUNT * (1 + NODE_COUNT),
  445. dm_testdrv_op_count[DM_TEST_OP_REMOVE]);
  446. /* Try the same with unbind */
  447. ut_assertok(device_unbind(top[2]));
  448. ut_asserteq(NODE_COUNT + 1, dm_testdrv_op_count[DM_TEST_OP_UNBIND]);
  449. dm_testdrv_op_count[DM_TEST_OP_UNBIND] = 0;
  450. /* Try one with grandchildren */
  451. ut_assertok(uclass_get_device(UCLASS_TEST, 5, &dev));
  452. ut_asserteq_ptr(dev, top[6]);
  453. ut_assertok(device_unbind(top[5]));
  454. ut_asserteq(1 + NODE_COUNT * (1 + NODE_COUNT),
  455. dm_testdrv_op_count[DM_TEST_OP_UNBIND]);
  456. return 0;
  457. }
  458. DM_TEST(dm_test_children, 0);
  459. /* Test that pre-relocation devices work as expected */
  460. static int dm_test_pre_reloc(struct dm_test_state *dms)
  461. {
  462. struct udevice *dev;
  463. /* The normal driver should refuse to bind before relocation */
  464. ut_asserteq(-EPERM, device_bind_by_name(dms->root, true,
  465. &driver_info_manual, &dev));
  466. /* But this one is marked pre-reloc */
  467. ut_assertok(device_bind_by_name(dms->root, true,
  468. &driver_info_pre_reloc, &dev));
  469. return 0;
  470. }
  471. DM_TEST(dm_test_pre_reloc, 0);
  472. static int dm_test_uclass_before_ready(struct dm_test_state *dms)
  473. {
  474. struct uclass *uc;
  475. ut_assertok(uclass_get(UCLASS_TEST, &uc));
  476. memset(gd, '\0', sizeof(*gd));
  477. ut_asserteq_ptr(NULL, uclass_find(UCLASS_TEST));
  478. return 0;
  479. }
  480. DM_TEST(dm_test_uclass_before_ready, 0);
  481. static int dm_test_device_get_uclass_id(struct dm_test_state *dms)
  482. {
  483. struct udevice *dev;
  484. ut_assertok(uclass_get_device(UCLASS_TEST, 0, &dev));
  485. ut_asserteq(UCLASS_TEST, device_get_uclass_id(dev));
  486. return 0;
  487. }
  488. DM_TEST(dm_test_device_get_uclass_id, DM_TESTF_SCAN_PDATA);