part.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2001
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #include <common.h>
  7. #include <command.h>
  8. #include <errno.h>
  9. #include <ide.h>
  10. #include <malloc.h>
  11. #include <part.h>
  12. #include <ubifs_uboot.h>
  13. #undef PART_DEBUG
  14. #ifdef PART_DEBUG
  15. #define PRINTF(fmt,args...) printf (fmt ,##args)
  16. #else
  17. #define PRINTF(fmt,args...)
  18. #endif
  19. /* Check all partition types */
  20. #define PART_TYPE_ALL -1
  21. static struct part_driver *part_driver_lookup_type(struct blk_desc *dev_desc)
  22. {
  23. struct part_driver *drv =
  24. ll_entry_start(struct part_driver, part_driver);
  25. const int n_ents = ll_entry_count(struct part_driver, part_driver);
  26. struct part_driver *entry;
  27. if (dev_desc->part_type == PART_TYPE_UNKNOWN) {
  28. for (entry = drv; entry != drv + n_ents; entry++) {
  29. int ret;
  30. ret = entry->test(dev_desc);
  31. if (!ret) {
  32. dev_desc->part_type = entry->part_type;
  33. return entry;
  34. }
  35. }
  36. } else {
  37. for (entry = drv; entry != drv + n_ents; entry++) {
  38. if (dev_desc->part_type == entry->part_type)
  39. return entry;
  40. }
  41. }
  42. /* Not found */
  43. return NULL;
  44. }
  45. #ifdef CONFIG_HAVE_BLOCK_DEVICE
  46. static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
  47. {
  48. struct blk_desc *dev_desc;
  49. int ret;
  50. dev_desc = blk_get_devnum_by_typename(ifname, dev);
  51. if (!dev_desc) {
  52. debug("%s: No device for iface '%s', dev %d\n", __func__,
  53. ifname, dev);
  54. return NULL;
  55. }
  56. ret = blk_dselect_hwpart(dev_desc, hwpart);
  57. if (ret) {
  58. debug("%s: Failed to select h/w partition: err-%d\n", __func__,
  59. ret);
  60. return NULL;
  61. }
  62. return dev_desc;
  63. }
  64. struct blk_desc *blk_get_dev(const char *ifname, int dev)
  65. {
  66. return get_dev_hwpart(ifname, dev, 0);
  67. }
  68. #else
  69. struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
  70. {
  71. return NULL;
  72. }
  73. struct blk_desc *blk_get_dev(const char *ifname, int dev)
  74. {
  75. return NULL;
  76. }
  77. #endif
  78. #ifdef CONFIG_HAVE_BLOCK_DEVICE
  79. /* ------------------------------------------------------------------------- */
  80. /*
  81. * reports device info to the user
  82. */
  83. #ifdef CONFIG_LBA48
  84. typedef uint64_t lba512_t;
  85. #else
  86. typedef lbaint_t lba512_t;
  87. #endif
  88. /*
  89. * Overflowless variant of (block_count * mul_by / div_by)
  90. * when div_by > mul_by
  91. */
  92. static lba512_t lba512_muldiv(lba512_t block_count, lba512_t mul_by, lba512_t div_by)
  93. {
  94. lba512_t bc_quot, bc_rem;
  95. /* x * m / d == x / d * m + (x % d) * m / d */
  96. bc_quot = block_count / div_by;
  97. bc_rem = block_count - div_by * bc_quot;
  98. return bc_quot * mul_by + (bc_rem * mul_by) / div_by;
  99. }
  100. void dev_print (struct blk_desc *dev_desc)
  101. {
  102. lba512_t lba512; /* number of blocks if 512bytes block size */
  103. if (dev_desc->type == DEV_TYPE_UNKNOWN) {
  104. puts ("not available\n");
  105. return;
  106. }
  107. switch (dev_desc->if_type) {
  108. case IF_TYPE_SCSI:
  109. printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n",
  110. dev_desc->target,dev_desc->lun,
  111. dev_desc->vendor,
  112. dev_desc->product,
  113. dev_desc->revision);
  114. break;
  115. case IF_TYPE_ATAPI:
  116. case IF_TYPE_IDE:
  117. case IF_TYPE_SATA:
  118. printf ("Model: %s Firm: %s Ser#: %s\n",
  119. dev_desc->vendor,
  120. dev_desc->revision,
  121. dev_desc->product);
  122. break;
  123. case IF_TYPE_SD:
  124. case IF_TYPE_MMC:
  125. case IF_TYPE_USB:
  126. case IF_TYPE_NVME:
  127. printf ("Vendor: %s Rev: %s Prod: %s\n",
  128. dev_desc->vendor,
  129. dev_desc->revision,
  130. dev_desc->product);
  131. break;
  132. case IF_TYPE_DOC:
  133. puts("device type DOC\n");
  134. return;
  135. case IF_TYPE_UNKNOWN:
  136. puts("device type unknown\n");
  137. return;
  138. default:
  139. printf("Unhandled device type: %i\n", dev_desc->if_type);
  140. return;
  141. }
  142. puts (" Type: ");
  143. if (dev_desc->removable)
  144. puts ("Removable ");
  145. switch (dev_desc->type & 0x1F) {
  146. case DEV_TYPE_HARDDISK:
  147. puts ("Hard Disk");
  148. break;
  149. case DEV_TYPE_CDROM:
  150. puts ("CD ROM");
  151. break;
  152. case DEV_TYPE_OPDISK:
  153. puts ("Optical Device");
  154. break;
  155. case DEV_TYPE_TAPE:
  156. puts ("Tape");
  157. break;
  158. default:
  159. printf ("# %02X #", dev_desc->type & 0x1F);
  160. break;
  161. }
  162. puts ("\n");
  163. if (dev_desc->lba > 0L && dev_desc->blksz > 0L) {
  164. ulong mb, mb_quot, mb_rem, gb, gb_quot, gb_rem;
  165. lbaint_t lba;
  166. lba = dev_desc->lba;
  167. lba512 = (lba * (dev_desc->blksz/512));
  168. /* round to 1 digit */
  169. /* 2048 = (1024 * 1024) / 512 MB */
  170. mb = lba512_muldiv(lba512, 10, 2048);
  171. mb_quot = mb / 10;
  172. mb_rem = mb - (10 * mb_quot);
  173. gb = mb / 1024;
  174. gb_quot = gb / 10;
  175. gb_rem = gb - (10 * gb_quot);
  176. #ifdef CONFIG_LBA48
  177. if (dev_desc->lba48)
  178. printf (" Supports 48-bit addressing\n");
  179. #endif
  180. #if defined(CONFIG_SYS_64BIT_LBA)
  181. printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%llu x %lu)\n",
  182. mb_quot, mb_rem,
  183. gb_quot, gb_rem,
  184. lba,
  185. dev_desc->blksz);
  186. #else
  187. printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%lu x %lu)\n",
  188. mb_quot, mb_rem,
  189. gb_quot, gb_rem,
  190. (ulong)lba,
  191. dev_desc->blksz);
  192. #endif
  193. } else {
  194. puts (" Capacity: not available\n");
  195. }
  196. }
  197. #endif
  198. #ifdef CONFIG_HAVE_BLOCK_DEVICE
  199. void part_init(struct blk_desc *dev_desc)
  200. {
  201. struct part_driver *drv =
  202. ll_entry_start(struct part_driver, part_driver);
  203. const int n_ents = ll_entry_count(struct part_driver, part_driver);
  204. struct part_driver *entry;
  205. blkcache_invalidate(dev_desc->if_type, dev_desc->devnum);
  206. dev_desc->part_type = PART_TYPE_UNKNOWN;
  207. for (entry = drv; entry != drv + n_ents; entry++) {
  208. int ret;
  209. ret = entry->test(dev_desc);
  210. debug("%s: try '%s': ret=%d\n", __func__, entry->name, ret);
  211. if (!ret) {
  212. dev_desc->part_type = entry->part_type;
  213. break;
  214. }
  215. }
  216. }
  217. static void print_part_header(const char *type, struct blk_desc *dev_desc)
  218. {
  219. #if CONFIG_IS_ENABLED(MAC_PARTITION) || \
  220. CONFIG_IS_ENABLED(DOS_PARTITION) || \
  221. CONFIG_IS_ENABLED(ISO_PARTITION) || \
  222. CONFIG_IS_ENABLED(AMIGA_PARTITION) || \
  223. CONFIG_IS_ENABLED(EFI_PARTITION)
  224. puts ("\nPartition Map for ");
  225. switch (dev_desc->if_type) {
  226. case IF_TYPE_IDE:
  227. puts ("IDE");
  228. break;
  229. case IF_TYPE_SATA:
  230. puts ("SATA");
  231. break;
  232. case IF_TYPE_SCSI:
  233. puts ("SCSI");
  234. break;
  235. case IF_TYPE_ATAPI:
  236. puts ("ATAPI");
  237. break;
  238. case IF_TYPE_USB:
  239. puts ("USB");
  240. break;
  241. case IF_TYPE_DOC:
  242. puts ("DOC");
  243. break;
  244. case IF_TYPE_MMC:
  245. puts ("MMC");
  246. break;
  247. case IF_TYPE_HOST:
  248. puts ("HOST");
  249. break;
  250. case IF_TYPE_NVME:
  251. puts ("NVMe");
  252. break;
  253. default:
  254. puts ("UNKNOWN");
  255. break;
  256. }
  257. printf (" device %d -- Partition Type: %s\n\n",
  258. dev_desc->devnum, type);
  259. #endif /* any CONFIG_..._PARTITION */
  260. }
  261. void part_print(struct blk_desc *dev_desc)
  262. {
  263. struct part_driver *drv;
  264. drv = part_driver_lookup_type(dev_desc);
  265. if (!drv) {
  266. printf("## Unknown partition table type %x\n",
  267. dev_desc->part_type);
  268. return;
  269. }
  270. PRINTF("## Testing for valid %s partition ##\n", drv->name);
  271. print_part_header(drv->name, dev_desc);
  272. if (drv->print)
  273. drv->print(dev_desc);
  274. }
  275. #endif /* CONFIG_HAVE_BLOCK_DEVICE */
  276. int part_get_info(struct blk_desc *dev_desc, int part,
  277. disk_partition_t *info)
  278. {
  279. #ifdef CONFIG_HAVE_BLOCK_DEVICE
  280. struct part_driver *drv;
  281. #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
  282. /* The common case is no UUID support */
  283. info->uuid[0] = 0;
  284. #endif
  285. #ifdef CONFIG_PARTITION_TYPE_GUID
  286. info->type_guid[0] = 0;
  287. #endif
  288. drv = part_driver_lookup_type(dev_desc);
  289. if (!drv) {
  290. debug("## Unknown partition table type %x\n",
  291. dev_desc->part_type);
  292. return -EPROTONOSUPPORT;
  293. }
  294. if (!drv->get_info) {
  295. PRINTF("## Driver %s does not have the get_info() method\n",
  296. drv->name);
  297. return -ENOSYS;
  298. }
  299. if (drv->get_info(dev_desc, part, info) == 0) {
  300. PRINTF("## Valid %s partition found ##\n", drv->name);
  301. return 0;
  302. }
  303. #endif /* CONFIG_HAVE_BLOCK_DEVICE */
  304. return -1;
  305. }
  306. int part_get_info_whole_disk(struct blk_desc *dev_desc, disk_partition_t *info)
  307. {
  308. info->start = 0;
  309. info->size = dev_desc->lba;
  310. info->blksz = dev_desc->blksz;
  311. info->bootable = 0;
  312. strcpy((char *)info->type, BOOT_PART_TYPE);
  313. strcpy((char *)info->name, "Whole Disk");
  314. #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
  315. info->uuid[0] = 0;
  316. #endif
  317. #ifdef CONFIG_PARTITION_TYPE_GUID
  318. info->type_guid[0] = 0;
  319. #endif
  320. return 0;
  321. }
  322. int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
  323. struct blk_desc **dev_desc)
  324. {
  325. char *ep;
  326. char *dup_str = NULL;
  327. const char *dev_str, *hwpart_str;
  328. int dev, hwpart;
  329. hwpart_str = strchr(dev_hwpart_str, '.');
  330. if (hwpart_str) {
  331. dup_str = strdup(dev_hwpart_str);
  332. dup_str[hwpart_str - dev_hwpart_str] = 0;
  333. dev_str = dup_str;
  334. hwpart_str++;
  335. } else {
  336. dev_str = dev_hwpart_str;
  337. hwpart = 0;
  338. }
  339. dev = simple_strtoul(dev_str, &ep, 16);
  340. if (*ep) {
  341. printf("** Bad device specification %s %s **\n",
  342. ifname, dev_str);
  343. dev = -EINVAL;
  344. goto cleanup;
  345. }
  346. if (hwpart_str) {
  347. hwpart = simple_strtoul(hwpart_str, &ep, 16);
  348. if (*ep) {
  349. printf("** Bad HW partition specification %s %s **\n",
  350. ifname, hwpart_str);
  351. dev = -EINVAL;
  352. goto cleanup;
  353. }
  354. }
  355. *dev_desc = get_dev_hwpart(ifname, dev, hwpart);
  356. if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
  357. debug("** Bad device %s %s **\n", ifname, dev_hwpart_str);
  358. dev = -ENOENT;
  359. goto cleanup;
  360. }
  361. #ifdef CONFIG_HAVE_BLOCK_DEVICE
  362. /*
  363. * Updates the partition table for the specified hw partition.
  364. * Does not need to be done for hwpart 0 since it is default and
  365. * already loaded.
  366. */
  367. if(hwpart != 0)
  368. part_init(*dev_desc);
  369. #endif
  370. cleanup:
  371. free(dup_str);
  372. return dev;
  373. }
  374. #define PART_UNSPECIFIED -2
  375. #define PART_AUTO -1
  376. int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
  377. struct blk_desc **dev_desc,
  378. disk_partition_t *info, int allow_whole_dev)
  379. {
  380. int ret = -1;
  381. const char *part_str;
  382. char *dup_str = NULL;
  383. const char *dev_str;
  384. int dev;
  385. char *ep;
  386. int p;
  387. int part;
  388. disk_partition_t tmpinfo;
  389. #ifdef CONFIG_SANDBOX
  390. /*
  391. * Special-case a pseudo block device "hostfs", to allow access to the
  392. * host's own filesystem.
  393. */
  394. if (0 == strcmp(ifname, "hostfs")) {
  395. *dev_desc = NULL;
  396. info->start = 0;
  397. info->size = 0;
  398. info->blksz = 0;
  399. info->bootable = 0;
  400. strcpy((char *)info->type, BOOT_PART_TYPE);
  401. strcpy((char *)info->name, "Sandbox host");
  402. #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
  403. info->uuid[0] = 0;
  404. #endif
  405. #ifdef CONFIG_PARTITION_TYPE_GUID
  406. info->type_guid[0] = 0;
  407. #endif
  408. return 0;
  409. }
  410. #endif
  411. #ifdef CONFIG_CMD_UBIFS
  412. /*
  413. * Special-case ubi, ubi goes through a mtd, rathen then through
  414. * a regular block device.
  415. */
  416. if (0 == strcmp(ifname, "ubi")) {
  417. if (!ubifs_is_mounted()) {
  418. printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
  419. return -1;
  420. }
  421. *dev_desc = NULL;
  422. memset(info, 0, sizeof(*info));
  423. strcpy((char *)info->type, BOOT_PART_TYPE);
  424. strcpy((char *)info->name, "UBI");
  425. #if CONFIG_IS_ENABLED(PARTITION_UUIDS)
  426. info->uuid[0] = 0;
  427. #endif
  428. return 0;
  429. }
  430. #endif
  431. /* If no dev_part_str, use bootdevice environment variable */
  432. if (!dev_part_str || !strlen(dev_part_str) ||
  433. !strcmp(dev_part_str, "-"))
  434. dev_part_str = env_get("bootdevice");
  435. /* If still no dev_part_str, it's an error */
  436. if (!dev_part_str) {
  437. printf("** No device specified **\n");
  438. goto cleanup;
  439. }
  440. /* Separate device and partition ID specification */
  441. part_str = strchr(dev_part_str, ':');
  442. if (part_str) {
  443. dup_str = strdup(dev_part_str);
  444. dup_str[part_str - dev_part_str] = 0;
  445. dev_str = dup_str;
  446. part_str++;
  447. } else {
  448. dev_str = dev_part_str;
  449. }
  450. /* Look up the device */
  451. dev = blk_get_device_by_str(ifname, dev_str, dev_desc);
  452. if (dev < 0)
  453. goto cleanup;
  454. /* Convert partition ID string to number */
  455. if (!part_str || !*part_str) {
  456. part = PART_UNSPECIFIED;
  457. } else if (!strcmp(part_str, "auto")) {
  458. part = PART_AUTO;
  459. } else {
  460. /* Something specified -> use exactly that */
  461. part = (int)simple_strtoul(part_str, &ep, 16);
  462. /*
  463. * Less than whole string converted,
  464. * or request for whole device, but caller requires partition.
  465. */
  466. if (*ep || (part == 0 && !allow_whole_dev)) {
  467. printf("** Bad partition specification %s %s **\n",
  468. ifname, dev_part_str);
  469. goto cleanup;
  470. }
  471. }
  472. /*
  473. * No partition table on device,
  474. * or user requested partition 0 (entire device).
  475. */
  476. if (((*dev_desc)->part_type == PART_TYPE_UNKNOWN) ||
  477. (part == 0)) {
  478. if (!(*dev_desc)->lba) {
  479. printf("** Bad device size - %s %s **\n", ifname,
  480. dev_str);
  481. goto cleanup;
  482. }
  483. /*
  484. * If user specified a partition ID other than 0,
  485. * or the calling command only accepts partitions,
  486. * it's an error.
  487. */
  488. if ((part > 0) || (!allow_whole_dev)) {
  489. printf("** No partition table - %s %s **\n", ifname,
  490. dev_str);
  491. goto cleanup;
  492. }
  493. (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
  494. part_get_info_whole_disk(*dev_desc, info);
  495. ret = 0;
  496. goto cleanup;
  497. }
  498. /*
  499. * Now there's known to be a partition table,
  500. * not specifying a partition means to pick partition 1.
  501. */
  502. if (part == PART_UNSPECIFIED)
  503. part = 1;
  504. /*
  505. * If user didn't specify a partition number, or did specify something
  506. * other than "auto", use that partition number directly.
  507. */
  508. if (part != PART_AUTO) {
  509. ret = part_get_info(*dev_desc, part, info);
  510. if (ret) {
  511. printf("** Invalid partition %d **\n", part);
  512. goto cleanup;
  513. }
  514. } else {
  515. /*
  516. * Find the first bootable partition.
  517. * If none are bootable, fall back to the first valid partition.
  518. */
  519. part = 0;
  520. for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
  521. ret = part_get_info(*dev_desc, p, info);
  522. if (ret)
  523. continue;
  524. /*
  525. * First valid partition, or new better partition?
  526. * If so, save partition ID.
  527. */
  528. if (!part || info->bootable)
  529. part = p;
  530. /* Best possible partition? Stop searching. */
  531. if (info->bootable)
  532. break;
  533. /*
  534. * We now need to search further for best possible.
  535. * If we what we just queried was the best so far,
  536. * save the info since we over-write it next loop.
  537. */
  538. if (part == p)
  539. tmpinfo = *info;
  540. }
  541. /* If we found any acceptable partition */
  542. if (part) {
  543. /*
  544. * If we searched all possible partition IDs,
  545. * return the first valid partition we found.
  546. */
  547. if (p == MAX_SEARCH_PARTITIONS + 1)
  548. *info = tmpinfo;
  549. } else {
  550. printf("** No valid partitions found **\n");
  551. ret = -1;
  552. goto cleanup;
  553. }
  554. }
  555. if (strncmp((char *)info->type, BOOT_PART_TYPE, sizeof(info->type)) != 0) {
  556. printf("** Invalid partition type \"%.32s\""
  557. " (expect \"" BOOT_PART_TYPE "\")\n",
  558. info->type);
  559. ret = -1;
  560. goto cleanup;
  561. }
  562. (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
  563. ret = part;
  564. goto cleanup;
  565. cleanup:
  566. free(dup_str);
  567. return ret;
  568. }
  569. int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
  570. disk_partition_t *info, int part_type)
  571. {
  572. struct part_driver *part_drv;
  573. int ret;
  574. int i;
  575. part_drv = part_driver_lookup_type(dev_desc);
  576. if (!part_drv)
  577. return -1;
  578. for (i = 1; i < part_drv->max_entries; i++) {
  579. ret = part_drv->get_info(dev_desc, i, info);
  580. if (ret != 0) {
  581. /* no more entries in table */
  582. break;
  583. }
  584. if (strcmp(name, (const char *)info->name) == 0) {
  585. /* matched */
  586. return i;
  587. }
  588. }
  589. return -1;
  590. }
  591. int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
  592. disk_partition_t *info)
  593. {
  594. return part_get_info_by_name_type(dev_desc, name, info, PART_TYPE_ALL);
  595. }
  596. void part_set_generic_name(const struct blk_desc *dev_desc,
  597. int part_num, char *name)
  598. {
  599. char *devtype;
  600. switch (dev_desc->if_type) {
  601. case IF_TYPE_IDE:
  602. case IF_TYPE_SATA:
  603. case IF_TYPE_ATAPI:
  604. devtype = "hd";
  605. break;
  606. case IF_TYPE_SCSI:
  607. devtype = "sd";
  608. break;
  609. case IF_TYPE_USB:
  610. devtype = "usbd";
  611. break;
  612. case IF_TYPE_DOC:
  613. devtype = "docd";
  614. break;
  615. case IF_TYPE_MMC:
  616. case IF_TYPE_SD:
  617. devtype = "mmcsd";
  618. break;
  619. default:
  620. devtype = "xx";
  621. break;
  622. }
  623. sprintf(name, "%s%c%d", devtype, 'a' + dev_desc->devnum, part_num);
  624. }