openprom.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. /*
  2. * Linux/SPARC PROM Configuration Driver
  3. * Copyright (C) 1996 Thomas K. Dyas (tdyas@noc.rutgers.edu)
  4. * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
  5. *
  6. * This character device driver allows user programs to access the
  7. * PROM device tree. It is compatible with the SunOS /dev/openprom
  8. * driver and the NetBSD /dev/openprom driver. The SunOS eeprom
  9. * utility works without any modifications.
  10. *
  11. * The driver uses a minor number under the misc device major. The
  12. * file read/write mode determines the type of access to the PROM.
  13. * Interrupts are disabled whenever the driver calls into the PROM for
  14. * sanity's sake.
  15. */
  16. /* This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License as
  18. * published by the Free Software Foundation; either version 2 of the
  19. * License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful, but
  22. * WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  24. * General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29. */
  30. #include <linux/module.h>
  31. #include <linux/kernel.h>
  32. #include <linux/errno.h>
  33. #include <linux/slab.h>
  34. #include <linux/mutex.h>
  35. #include <linux/string.h>
  36. #include <linux/miscdevice.h>
  37. #include <linux/init.h>
  38. #include <linux/fs.h>
  39. #include <asm/oplib.h>
  40. #include <asm/prom.h>
  41. #include <linux/uaccess.h>
  42. #include <asm/openpromio.h>
  43. #ifdef CONFIG_PCI
  44. #include <linux/pci.h>
  45. #endif
  46. MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)");
  47. MODULE_DESCRIPTION("OPENPROM Configuration Driver");
  48. MODULE_LICENSE("GPL");
  49. MODULE_VERSION("1.0");
  50. MODULE_ALIAS_MISCDEV(SUN_OPENPROM_MINOR);
  51. /* Private data kept by the driver for each descriptor. */
  52. typedef struct openprom_private_data
  53. {
  54. struct device_node *current_node; /* Current node for SunOS ioctls. */
  55. struct device_node *lastnode; /* Last valid node used by BSD ioctls. */
  56. } DATA;
  57. /* ID of the PROM node containing all of the EEPROM options. */
  58. static DEFINE_MUTEX(openprom_mutex);
  59. static struct device_node *options_node;
  60. /*
  61. * Copy an openpromio structure into kernel space from user space.
  62. * This routine does error checking to make sure that all memory
  63. * accesses are within bounds. A pointer to the allocated openpromio
  64. * structure will be placed in "*opp_p". Return value is the length
  65. * of the user supplied buffer.
  66. */
  67. static int copyin(struct openpromio __user *info, struct openpromio **opp_p)
  68. {
  69. unsigned int bufsize;
  70. if (!info || !opp_p)
  71. return -EFAULT;
  72. if (get_user(bufsize, &info->oprom_size))
  73. return -EFAULT;
  74. if (bufsize == 0)
  75. return -EINVAL;
  76. /* If the bufsize is too large, just limit it.
  77. * Fix from Jason Rappleye.
  78. */
  79. if (bufsize > OPROMMAXPARAM)
  80. bufsize = OPROMMAXPARAM;
  81. if (!(*opp_p = kzalloc(sizeof(int) + bufsize + 1, GFP_KERNEL)))
  82. return -ENOMEM;
  83. if (copy_from_user(&(*opp_p)->oprom_array,
  84. &info->oprom_array, bufsize)) {
  85. kfree(*opp_p);
  86. return -EFAULT;
  87. }
  88. return bufsize;
  89. }
  90. static int getstrings(struct openpromio __user *info, struct openpromio **opp_p)
  91. {
  92. int n, bufsize;
  93. char c;
  94. if (!info || !opp_p)
  95. return -EFAULT;
  96. if (!(*opp_p = kzalloc(sizeof(int) + OPROMMAXPARAM + 1, GFP_KERNEL)))
  97. return -ENOMEM;
  98. (*opp_p)->oprom_size = 0;
  99. n = bufsize = 0;
  100. while ((n < 2) && (bufsize < OPROMMAXPARAM)) {
  101. if (get_user(c, &info->oprom_array[bufsize])) {
  102. kfree(*opp_p);
  103. return -EFAULT;
  104. }
  105. if (c == '\0')
  106. n++;
  107. (*opp_p)->oprom_array[bufsize++] = c;
  108. }
  109. if (!n) {
  110. kfree(*opp_p);
  111. return -EINVAL;
  112. }
  113. return bufsize;
  114. }
  115. /*
  116. * Copy an openpromio structure in kernel space back to user space.
  117. */
  118. static int copyout(void __user *info, struct openpromio *opp, int len)
  119. {
  120. if (copy_to_user(info, opp, len))
  121. return -EFAULT;
  122. return 0;
  123. }
  124. static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
  125. {
  126. const void *pval;
  127. int len;
  128. if (!dp ||
  129. !(pval = of_get_property(dp, op->oprom_array, &len)) ||
  130. len <= 0 || len > bufsize)
  131. return copyout(argp, op, sizeof(int));
  132. memcpy(op->oprom_array, pval, len);
  133. op->oprom_array[len] = '\0';
  134. op->oprom_size = len;
  135. return copyout(argp, op, sizeof(int) + bufsize);
  136. }
  137. static int opromnxtprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
  138. {
  139. struct property *prop;
  140. int len;
  141. if (!dp)
  142. return copyout(argp, op, sizeof(int));
  143. if (op->oprom_array[0] == '\0') {
  144. prop = dp->properties;
  145. if (!prop)
  146. return copyout(argp, op, sizeof(int));
  147. len = strlen(prop->name);
  148. } else {
  149. prop = of_find_property(dp, op->oprom_array, NULL);
  150. if (!prop ||
  151. !prop->next ||
  152. (len = strlen(prop->next->name)) + 1 > bufsize)
  153. return copyout(argp, op, sizeof(int));
  154. prop = prop->next;
  155. }
  156. memcpy(op->oprom_array, prop->name, len);
  157. op->oprom_array[len] = '\0';
  158. op->oprom_size = ++len;
  159. return copyout(argp, op, sizeof(int) + bufsize);
  160. }
  161. static int opromsetopt(struct device_node *dp, struct openpromio *op, int bufsize)
  162. {
  163. char *buf = op->oprom_array + strlen(op->oprom_array) + 1;
  164. int len = op->oprom_array + bufsize - buf;
  165. return of_set_property(options_node, op->oprom_array, buf, len);
  166. }
  167. static int opromnext(void __user *argp, unsigned int cmd, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
  168. {
  169. phandle ph;
  170. BUILD_BUG_ON(sizeof(phandle) != sizeof(int));
  171. if (bufsize < sizeof(phandle))
  172. return -EINVAL;
  173. ph = *((int *) op->oprom_array);
  174. if (ph) {
  175. dp = of_find_node_by_phandle(ph);
  176. if (!dp)
  177. return -EINVAL;
  178. switch (cmd) {
  179. case OPROMNEXT:
  180. dp = dp->sibling;
  181. break;
  182. case OPROMCHILD:
  183. dp = dp->child;
  184. break;
  185. case OPROMSETCUR:
  186. default:
  187. break;
  188. }
  189. } else {
  190. /* Sibling of node zero is the root node. */
  191. if (cmd != OPROMNEXT)
  192. return -EINVAL;
  193. dp = of_find_node_by_path("/");
  194. }
  195. ph = 0;
  196. if (dp)
  197. ph = dp->phandle;
  198. data->current_node = dp;
  199. *((int *) op->oprom_array) = ph;
  200. op->oprom_size = sizeof(phandle);
  201. return copyout(argp, op, bufsize + sizeof(int));
  202. }
  203. static int oprompci2node(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
  204. {
  205. int err = -EINVAL;
  206. if (bufsize >= 2*sizeof(int)) {
  207. #ifdef CONFIG_PCI
  208. struct pci_dev *pdev;
  209. struct device_node *dp;
  210. pdev = pci_get_domain_bus_and_slot(0,
  211. ((int *) op->oprom_array)[0],
  212. ((int *) op->oprom_array)[1]);
  213. dp = pci_device_to_OF_node(pdev);
  214. data->current_node = dp;
  215. *((int *)op->oprom_array) = dp->phandle;
  216. op->oprom_size = sizeof(int);
  217. err = copyout(argp, op, bufsize + sizeof(int));
  218. pci_dev_put(pdev);
  219. #endif
  220. }
  221. return err;
  222. }
  223. static int oprompath2node(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize, DATA *data)
  224. {
  225. phandle ph = 0;
  226. dp = of_find_node_by_path(op->oprom_array);
  227. if (dp)
  228. ph = dp->phandle;
  229. data->current_node = dp;
  230. *((int *)op->oprom_array) = ph;
  231. op->oprom_size = sizeof(int);
  232. return copyout(argp, op, bufsize + sizeof(int));
  233. }
  234. static int opromgetbootargs(void __user *argp, struct openpromio *op, int bufsize)
  235. {
  236. char *buf = saved_command_line;
  237. int len = strlen(buf);
  238. if (len > bufsize)
  239. return -EINVAL;
  240. strcpy(op->oprom_array, buf);
  241. op->oprom_size = len;
  242. return copyout(argp, op, bufsize + sizeof(int));
  243. }
  244. /*
  245. * SunOS and Solaris /dev/openprom ioctl calls.
  246. */
  247. static long openprom_sunos_ioctl(struct file * file,
  248. unsigned int cmd, unsigned long arg,
  249. struct device_node *dp)
  250. {
  251. DATA *data = file->private_data;
  252. struct openpromio *opp = NULL;
  253. int bufsize, error = 0;
  254. static int cnt;
  255. void __user *argp = (void __user *)arg;
  256. if (cmd == OPROMSETOPT)
  257. bufsize = getstrings(argp, &opp);
  258. else
  259. bufsize = copyin(argp, &opp);
  260. if (bufsize < 0)
  261. return bufsize;
  262. mutex_lock(&openprom_mutex);
  263. switch (cmd) {
  264. case OPROMGETOPT:
  265. case OPROMGETPROP:
  266. error = opromgetprop(argp, dp, opp, bufsize);
  267. break;
  268. case OPROMNXTOPT:
  269. case OPROMNXTPROP:
  270. error = opromnxtprop(argp, dp, opp, bufsize);
  271. break;
  272. case OPROMSETOPT:
  273. case OPROMSETOPT2:
  274. error = opromsetopt(dp, opp, bufsize);
  275. break;
  276. case OPROMNEXT:
  277. case OPROMCHILD:
  278. case OPROMSETCUR:
  279. error = opromnext(argp, cmd, dp, opp, bufsize, data);
  280. break;
  281. case OPROMPCI2NODE:
  282. error = oprompci2node(argp, dp, opp, bufsize, data);
  283. break;
  284. case OPROMPATH2NODE:
  285. error = oprompath2node(argp, dp, opp, bufsize, data);
  286. break;
  287. case OPROMGETBOOTARGS:
  288. error = opromgetbootargs(argp, opp, bufsize);
  289. break;
  290. case OPROMU2P:
  291. case OPROMGETCONS:
  292. case OPROMGETFBNAME:
  293. if (cnt++ < 10)
  294. printk(KERN_INFO "openprom_sunos_ioctl: unimplemented ioctl\n");
  295. error = -EINVAL;
  296. break;
  297. default:
  298. if (cnt++ < 10)
  299. printk(KERN_INFO "openprom_sunos_ioctl: cmd 0x%X, arg 0x%lX\n", cmd, arg);
  300. error = -EINVAL;
  301. break;
  302. }
  303. kfree(opp);
  304. mutex_unlock(&openprom_mutex);
  305. return error;
  306. }
  307. static struct device_node *get_node(phandle n, DATA *data)
  308. {
  309. struct device_node *dp = of_find_node_by_phandle(n);
  310. if (dp)
  311. data->lastnode = dp;
  312. return dp;
  313. }
  314. /* Copy in a whole string from userspace into kernelspace. */
  315. static char * copyin_string(char __user *user, size_t len)
  316. {
  317. if ((ssize_t)len < 0 || (ssize_t)(len + 1) < 0)
  318. return ERR_PTR(-EINVAL);
  319. return memdup_user_nul(user, len);
  320. }
  321. /*
  322. * NetBSD /dev/openprom ioctl calls.
  323. */
  324. static int opiocget(void __user *argp, DATA *data)
  325. {
  326. struct opiocdesc op;
  327. struct device_node *dp;
  328. char *str;
  329. const void *pval;
  330. int err, len;
  331. if (copy_from_user(&op, argp, sizeof(op)))
  332. return -EFAULT;
  333. dp = get_node(op.op_nodeid, data);
  334. str = copyin_string(op.op_name, op.op_namelen);
  335. if (IS_ERR(str))
  336. return PTR_ERR(str);
  337. pval = of_get_property(dp, str, &len);
  338. err = 0;
  339. if (!pval || len > op.op_buflen) {
  340. err = -EINVAL;
  341. } else {
  342. op.op_buflen = len;
  343. if (copy_to_user(argp, &op, sizeof(op)) ||
  344. copy_to_user(op.op_buf, pval, len))
  345. err = -EFAULT;
  346. }
  347. kfree(str);
  348. return err;
  349. }
  350. static int opiocnextprop(void __user *argp, DATA *data)
  351. {
  352. struct opiocdesc op;
  353. struct device_node *dp;
  354. struct property *prop;
  355. char *str;
  356. int len;
  357. if (copy_from_user(&op, argp, sizeof(op)))
  358. return -EFAULT;
  359. dp = get_node(op.op_nodeid, data);
  360. if (!dp)
  361. return -EINVAL;
  362. str = copyin_string(op.op_name, op.op_namelen);
  363. if (IS_ERR(str))
  364. return PTR_ERR(str);
  365. if (str[0] == '\0') {
  366. prop = dp->properties;
  367. } else {
  368. prop = of_find_property(dp, str, NULL);
  369. if (prop)
  370. prop = prop->next;
  371. }
  372. kfree(str);
  373. if (!prop)
  374. len = 0;
  375. else
  376. len = prop->length;
  377. if (len > op.op_buflen)
  378. len = op.op_buflen;
  379. if (copy_to_user(argp, &op, sizeof(op)))
  380. return -EFAULT;
  381. if (len &&
  382. copy_to_user(op.op_buf, prop->value, len))
  383. return -EFAULT;
  384. return 0;
  385. }
  386. static int opiocset(void __user *argp, DATA *data)
  387. {
  388. struct opiocdesc op;
  389. struct device_node *dp;
  390. char *str, *tmp;
  391. int err;
  392. if (copy_from_user(&op, argp, sizeof(op)))
  393. return -EFAULT;
  394. dp = get_node(op.op_nodeid, data);
  395. if (!dp)
  396. return -EINVAL;
  397. str = copyin_string(op.op_name, op.op_namelen);
  398. if (IS_ERR(str))
  399. return PTR_ERR(str);
  400. tmp = copyin_string(op.op_buf, op.op_buflen);
  401. if (IS_ERR(tmp)) {
  402. kfree(str);
  403. return PTR_ERR(tmp);
  404. }
  405. err = of_set_property(dp, str, tmp, op.op_buflen);
  406. kfree(str);
  407. kfree(tmp);
  408. return err;
  409. }
  410. static int opiocgetnext(unsigned int cmd, void __user *argp)
  411. {
  412. struct device_node *dp;
  413. phandle nd;
  414. BUILD_BUG_ON(sizeof(phandle) != sizeof(int));
  415. if (copy_from_user(&nd, argp, sizeof(phandle)))
  416. return -EFAULT;
  417. if (nd == 0) {
  418. if (cmd != OPIOCGETNEXT)
  419. return -EINVAL;
  420. dp = of_find_node_by_path("/");
  421. } else {
  422. dp = of_find_node_by_phandle(nd);
  423. nd = 0;
  424. if (dp) {
  425. if (cmd == OPIOCGETNEXT)
  426. dp = dp->sibling;
  427. else
  428. dp = dp->child;
  429. }
  430. }
  431. if (dp)
  432. nd = dp->phandle;
  433. if (copy_to_user(argp, &nd, sizeof(phandle)))
  434. return -EFAULT;
  435. return 0;
  436. }
  437. static int openprom_bsd_ioctl(struct file * file,
  438. unsigned int cmd, unsigned long arg)
  439. {
  440. DATA *data = file->private_data;
  441. void __user *argp = (void __user *)arg;
  442. int err;
  443. mutex_lock(&openprom_mutex);
  444. switch (cmd) {
  445. case OPIOCGET:
  446. err = opiocget(argp, data);
  447. break;
  448. case OPIOCNEXTPROP:
  449. err = opiocnextprop(argp, data);
  450. break;
  451. case OPIOCSET:
  452. err = opiocset(argp, data);
  453. break;
  454. case OPIOCGETOPTNODE:
  455. BUILD_BUG_ON(sizeof(phandle) != sizeof(int));
  456. err = 0;
  457. if (copy_to_user(argp, &options_node->phandle, sizeof(phandle)))
  458. err = -EFAULT;
  459. break;
  460. case OPIOCGETNEXT:
  461. case OPIOCGETCHILD:
  462. err = opiocgetnext(cmd, argp);
  463. break;
  464. default:
  465. err = -EINVAL;
  466. break;
  467. }
  468. mutex_unlock(&openprom_mutex);
  469. return err;
  470. }
  471. /*
  472. * Handoff control to the correct ioctl handler.
  473. */
  474. static long openprom_ioctl(struct file * file,
  475. unsigned int cmd, unsigned long arg)
  476. {
  477. DATA *data = file->private_data;
  478. switch (cmd) {
  479. case OPROMGETOPT:
  480. case OPROMNXTOPT:
  481. if ((file->f_mode & FMODE_READ) == 0)
  482. return -EPERM;
  483. return openprom_sunos_ioctl(file, cmd, arg,
  484. options_node);
  485. case OPROMSETOPT:
  486. case OPROMSETOPT2:
  487. if ((file->f_mode & FMODE_WRITE) == 0)
  488. return -EPERM;
  489. return openprom_sunos_ioctl(file, cmd, arg,
  490. options_node);
  491. case OPROMNEXT:
  492. case OPROMCHILD:
  493. case OPROMGETPROP:
  494. case OPROMNXTPROP:
  495. if ((file->f_mode & FMODE_READ) == 0)
  496. return -EPERM;
  497. return openprom_sunos_ioctl(file, cmd, arg,
  498. data->current_node);
  499. case OPROMU2P:
  500. case OPROMGETCONS:
  501. case OPROMGETFBNAME:
  502. case OPROMGETBOOTARGS:
  503. case OPROMSETCUR:
  504. case OPROMPCI2NODE:
  505. case OPROMPATH2NODE:
  506. if ((file->f_mode & FMODE_READ) == 0)
  507. return -EPERM;
  508. return openprom_sunos_ioctl(file, cmd, arg, NULL);
  509. case OPIOCGET:
  510. case OPIOCNEXTPROP:
  511. case OPIOCGETOPTNODE:
  512. case OPIOCGETNEXT:
  513. case OPIOCGETCHILD:
  514. if ((file->f_mode & FMODE_READ) == 0)
  515. return -EBADF;
  516. return openprom_bsd_ioctl(file,cmd,arg);
  517. case OPIOCSET:
  518. if ((file->f_mode & FMODE_WRITE) == 0)
  519. return -EBADF;
  520. return openprom_bsd_ioctl(file,cmd,arg);
  521. default:
  522. return -EINVAL;
  523. };
  524. }
  525. static long openprom_compat_ioctl(struct file *file, unsigned int cmd,
  526. unsigned long arg)
  527. {
  528. long rval = -ENOTTY;
  529. /*
  530. * SunOS/Solaris only, the NetBSD one's have embedded pointers in
  531. * the arg which we'd need to clean up...
  532. */
  533. switch (cmd) {
  534. case OPROMGETOPT:
  535. case OPROMSETOPT:
  536. case OPROMNXTOPT:
  537. case OPROMSETOPT2:
  538. case OPROMNEXT:
  539. case OPROMCHILD:
  540. case OPROMGETPROP:
  541. case OPROMNXTPROP:
  542. case OPROMU2P:
  543. case OPROMGETCONS:
  544. case OPROMGETFBNAME:
  545. case OPROMGETBOOTARGS:
  546. case OPROMSETCUR:
  547. case OPROMPCI2NODE:
  548. case OPROMPATH2NODE:
  549. rval = openprom_ioctl(file, cmd, arg);
  550. break;
  551. }
  552. return rval;
  553. }
  554. static int openprom_open(struct inode * inode, struct file * file)
  555. {
  556. DATA *data;
  557. data = kmalloc(sizeof(DATA), GFP_KERNEL);
  558. if (!data)
  559. return -ENOMEM;
  560. mutex_lock(&openprom_mutex);
  561. data->current_node = of_find_node_by_path("/");
  562. data->lastnode = data->current_node;
  563. file->private_data = (void *) data;
  564. mutex_unlock(&openprom_mutex);
  565. return 0;
  566. }
  567. static int openprom_release(struct inode * inode, struct file * file)
  568. {
  569. kfree(file->private_data);
  570. return 0;
  571. }
  572. static const struct file_operations openprom_fops = {
  573. .owner = THIS_MODULE,
  574. .llseek = no_llseek,
  575. .unlocked_ioctl = openprom_ioctl,
  576. .compat_ioctl = openprom_compat_ioctl,
  577. .open = openprom_open,
  578. .release = openprom_release,
  579. };
  580. static struct miscdevice openprom_dev = {
  581. .minor = SUN_OPENPROM_MINOR,
  582. .name = "openprom",
  583. .fops = &openprom_fops,
  584. };
  585. static int __init openprom_init(void)
  586. {
  587. int err;
  588. err = misc_register(&openprom_dev);
  589. if (err)
  590. return err;
  591. options_node = of_get_child_by_name(of_find_node_by_path("/"), "options");
  592. if (!options_node) {
  593. misc_deregister(&openprom_dev);
  594. return -EIO;
  595. }
  596. return 0;
  597. }
  598. static void __exit openprom_cleanup(void)
  599. {
  600. misc_deregister(&openprom_dev);
  601. }
  602. module_init(openprom_init);
  603. module_exit(openprom_cleanup);