ibmasmfs.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. /*
  2. * IBM ASM Service Processor Device Driver
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. * Copyright (C) IBM Corporation, 2004
  19. *
  20. * Author: Max Asböck <amax@us.ibm.com>
  21. *
  22. */
  23. /*
  24. * Parts of this code are based on an article by Jonathan Corbet
  25. * that appeared in Linux Weekly News.
  26. */
  27. /*
  28. * The IBMASM file virtual filesystem. It creates the following hierarchy
  29. * dymamically when mounted from user space:
  30. *
  31. * /ibmasm
  32. * |-- 0
  33. * | |-- command
  34. * | |-- event
  35. * | |-- reverse_heartbeat
  36. * | `-- remote_video
  37. * | |-- connected
  38. * | |-- depth
  39. * | |-- events
  40. * | |-- height
  41. * | `-- width
  42. * .
  43. * .
  44. * .
  45. * `-- n
  46. * |-- command
  47. * |-- event
  48. * |-- reverse_heartbeat
  49. * `-- remote_video
  50. * |-- connected
  51. * |-- depth
  52. * |-- events
  53. * |-- height
  54. * `-- width
  55. *
  56. * For each service processor the following files are created:
  57. *
  58. * command: execute dot commands
  59. * write: execute a dot command on the service processor
  60. * read: return the result of a previously executed dot command
  61. *
  62. * events: listen for service processor events
  63. * read: sleep (interruptible) until an event occurs
  64. * write: wakeup sleeping event listener
  65. *
  66. * reverse_heartbeat: send a heartbeat to the service processor
  67. * read: sleep (interruptible) until the reverse heartbeat fails
  68. * write: wakeup sleeping heartbeat listener
  69. *
  70. * remote_video/width
  71. * remote_video/height
  72. * remote_video/width: control remote display settings
  73. * write: set value
  74. * read: read value
  75. *
  76. * remote_video/connected
  77. * read: return "1" if web browser VNC java applet is connected,
  78. * "0" otherwise
  79. *
  80. * remote_video/events
  81. * read: sleep until a remote mouse or keyboard event occurs, then return
  82. * then event.
  83. */
  84. #include <linux/fs.h>
  85. #include <linux/pagemap.h>
  86. #include <asm/uaccess.h>
  87. #include <asm/io.h>
  88. #include "ibmasm.h"
  89. #include "remote.h"
  90. #include "dot_command.h"
  91. #define IBMASMFS_MAGIC 0x66726f67
  92. static LIST_HEAD(service_processors);
  93. static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode);
  94. static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root);
  95. static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent);
  96. static struct super_block *ibmasmfs_get_super(struct file_system_type *fst,
  97. int flags, const char *name, void *data)
  98. {
  99. return get_sb_single(fst, flags, data, ibmasmfs_fill_super);
  100. }
  101. static struct super_operations ibmasmfs_s_ops = {
  102. .statfs = simple_statfs,
  103. .drop_inode = generic_delete_inode,
  104. };
  105. static struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
  106. static struct file_system_type ibmasmfs_type = {
  107. .owner = THIS_MODULE,
  108. .name = "ibmasmfs",
  109. .get_sb = ibmasmfs_get_super,
  110. .kill_sb = kill_litter_super,
  111. };
  112. static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent)
  113. {
  114. struct inode *root;
  115. struct dentry *root_dentry;
  116. sb->s_blocksize = PAGE_CACHE_SIZE;
  117. sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
  118. sb->s_magic = IBMASMFS_MAGIC;
  119. sb->s_op = &ibmasmfs_s_ops;
  120. sb->s_time_gran = 1;
  121. root = ibmasmfs_make_inode (sb, S_IFDIR | 0500);
  122. if (!root)
  123. return -ENOMEM;
  124. root->i_op = &simple_dir_inode_operations;
  125. root->i_fop = ibmasmfs_dir_ops;
  126. root_dentry = d_alloc_root(root);
  127. if (!root_dentry) {
  128. iput(root);
  129. return -ENOMEM;
  130. }
  131. sb->s_root = root_dentry;
  132. ibmasmfs_create_files(sb, root_dentry);
  133. return 0;
  134. }
  135. static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
  136. {
  137. struct inode *ret = new_inode(sb);
  138. if (ret) {
  139. ret->i_mode = mode;
  140. ret->i_uid = ret->i_gid = 0;
  141. ret->i_blksize = PAGE_CACHE_SIZE;
  142. ret->i_blocks = 0;
  143. ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
  144. }
  145. return ret;
  146. }
  147. static struct dentry *ibmasmfs_create_file (struct super_block *sb,
  148. struct dentry *parent,
  149. const char *name,
  150. struct file_operations *fops,
  151. void *data,
  152. int mode)
  153. {
  154. struct dentry *dentry;
  155. struct inode *inode;
  156. dentry = d_alloc_name(parent, name);
  157. if (!dentry)
  158. return NULL;
  159. inode = ibmasmfs_make_inode(sb, S_IFREG | mode);
  160. if (!inode) {
  161. dput(dentry);
  162. return NULL;
  163. }
  164. inode->i_fop = fops;
  165. inode->u.generic_ip = data;
  166. d_add(dentry, inode);
  167. return dentry;
  168. }
  169. static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
  170. struct dentry *parent,
  171. const char *name)
  172. {
  173. struct dentry *dentry;
  174. struct inode *inode;
  175. dentry = d_alloc_name(parent, name);
  176. if (!dentry)
  177. return NULL;
  178. inode = ibmasmfs_make_inode(sb, S_IFDIR | 0500);
  179. if (!inode) {
  180. dput(dentry);
  181. return NULL;
  182. }
  183. inode->i_op = &simple_dir_inode_operations;
  184. inode->i_fop = ibmasmfs_dir_ops;
  185. d_add(dentry, inode);
  186. return dentry;
  187. }
  188. int ibmasmfs_register(void)
  189. {
  190. return register_filesystem(&ibmasmfs_type);
  191. }
  192. void ibmasmfs_unregister(void)
  193. {
  194. unregister_filesystem(&ibmasmfs_type);
  195. }
  196. void ibmasmfs_add_sp(struct service_processor *sp)
  197. {
  198. list_add(&sp->node, &service_processors);
  199. }
  200. /* struct to save state between command file operations */
  201. struct ibmasmfs_command_data {
  202. struct service_processor *sp;
  203. struct command *command;
  204. };
  205. /* struct to save state between event file operations */
  206. struct ibmasmfs_event_data {
  207. struct service_processor *sp;
  208. struct event_reader reader;
  209. int active;
  210. };
  211. /* struct to save state between reverse heartbeat file operations */
  212. struct ibmasmfs_heartbeat_data {
  213. struct service_processor *sp;
  214. struct reverse_heartbeat heartbeat;
  215. int active;
  216. };
  217. static int command_file_open(struct inode *inode, struct file *file)
  218. {
  219. struct ibmasmfs_command_data *command_data;
  220. if (!inode->u.generic_ip)
  221. return -ENODEV;
  222. command_data = kmalloc(sizeof(struct ibmasmfs_command_data), GFP_KERNEL);
  223. if (!command_data)
  224. return -ENOMEM;
  225. command_data->command = NULL;
  226. command_data->sp = inode->u.generic_ip;
  227. file->private_data = command_data;
  228. return 0;
  229. }
  230. static int command_file_close(struct inode *inode, struct file *file)
  231. {
  232. struct ibmasmfs_command_data *command_data = file->private_data;
  233. if (command_data->command)
  234. command_put(command_data->command);
  235. kfree(command_data);
  236. return 0;
  237. }
  238. static ssize_t command_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  239. {
  240. struct ibmasmfs_command_data *command_data = file->private_data;
  241. struct command *cmd;
  242. int len;
  243. unsigned long flags;
  244. if (*offset < 0)
  245. return -EINVAL;
  246. if (count == 0 || count > IBMASM_CMD_MAX_BUFFER_SIZE)
  247. return 0;
  248. if (*offset != 0)
  249. return 0;
  250. spin_lock_irqsave(&command_data->sp->lock, flags);
  251. cmd = command_data->command;
  252. if (cmd == NULL) {
  253. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  254. return 0;
  255. }
  256. command_data->command = NULL;
  257. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  258. if (cmd->status != IBMASM_CMD_COMPLETE) {
  259. command_put(cmd);
  260. return -EIO;
  261. }
  262. len = min(count, cmd->buffer_size);
  263. if (copy_to_user(buf, cmd->buffer, len)) {
  264. command_put(cmd);
  265. return -EFAULT;
  266. }
  267. command_put(cmd);
  268. return len;
  269. }
  270. static ssize_t command_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
  271. {
  272. struct ibmasmfs_command_data *command_data = file->private_data;
  273. struct command *cmd;
  274. unsigned long flags;
  275. if (*offset < 0)
  276. return -EINVAL;
  277. if (count == 0 || count > IBMASM_CMD_MAX_BUFFER_SIZE)
  278. return 0;
  279. if (*offset != 0)
  280. return 0;
  281. /* commands are executed sequentially, only one command at a time */
  282. if (command_data->command)
  283. return -EAGAIN;
  284. cmd = ibmasm_new_command(count);
  285. if (!cmd)
  286. return -ENOMEM;
  287. if (copy_from_user(cmd->buffer, ubuff, count)) {
  288. command_put(cmd);
  289. return -EFAULT;
  290. }
  291. spin_lock_irqsave(&command_data->sp->lock, flags);
  292. if (command_data->command) {
  293. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  294. command_put(cmd);
  295. return -EAGAIN;
  296. }
  297. command_data->command = cmd;
  298. spin_unlock_irqrestore(&command_data->sp->lock, flags);
  299. ibmasm_exec_command(command_data->sp, cmd);
  300. ibmasm_wait_for_response(cmd, get_dot_command_timeout(cmd->buffer));
  301. return count;
  302. }
  303. static int event_file_open(struct inode *inode, struct file *file)
  304. {
  305. struct ibmasmfs_event_data *event_data;
  306. struct service_processor *sp;
  307. if (!inode->u.generic_ip)
  308. return -ENODEV;
  309. sp = inode->u.generic_ip;
  310. event_data = kmalloc(sizeof(struct ibmasmfs_event_data), GFP_KERNEL);
  311. if (!event_data)
  312. return -ENOMEM;
  313. ibmasm_event_reader_register(sp, &event_data->reader);
  314. event_data->sp = sp;
  315. event_data->active = 0;
  316. file->private_data = event_data;
  317. return 0;
  318. }
  319. static int event_file_close(struct inode *inode, struct file *file)
  320. {
  321. struct ibmasmfs_event_data *event_data = file->private_data;
  322. ibmasm_event_reader_unregister(event_data->sp, &event_data->reader);
  323. kfree(event_data);
  324. return 0;
  325. }
  326. static ssize_t event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  327. {
  328. struct ibmasmfs_event_data *event_data = file->private_data;
  329. struct event_reader *reader = &event_data->reader;
  330. struct service_processor *sp = event_data->sp;
  331. int ret;
  332. unsigned long flags;
  333. if (*offset < 0)
  334. return -EINVAL;
  335. if (count == 0 || count > IBMASM_EVENT_MAX_SIZE)
  336. return 0;
  337. if (*offset != 0)
  338. return 0;
  339. spin_lock_irqsave(&sp->lock, flags);
  340. if (event_data->active) {
  341. spin_unlock_irqrestore(&sp->lock, flags);
  342. return -EBUSY;
  343. }
  344. event_data->active = 1;
  345. spin_unlock_irqrestore(&sp->lock, flags);
  346. ret = ibmasm_get_next_event(sp, reader);
  347. if (ret <= 0)
  348. goto out;
  349. if (count < reader->data_size) {
  350. ret = -EINVAL;
  351. goto out;
  352. }
  353. if (copy_to_user(buf, reader->data, reader->data_size)) {
  354. ret = -EFAULT;
  355. goto out;
  356. }
  357. ret = reader->data_size;
  358. out:
  359. event_data->active = 0;
  360. return ret;
  361. }
  362. static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
  363. {
  364. struct ibmasmfs_event_data *event_data = file->private_data;
  365. if (*offset < 0)
  366. return -EINVAL;
  367. if (count != 1)
  368. return 0;
  369. if (*offset != 0)
  370. return 0;
  371. ibmasm_cancel_next_event(&event_data->reader);
  372. return 0;
  373. }
  374. static int r_heartbeat_file_open(struct inode *inode, struct file *file)
  375. {
  376. struct ibmasmfs_heartbeat_data *rhbeat;
  377. if (!inode->u.generic_ip)
  378. return -ENODEV;
  379. rhbeat = kmalloc(sizeof(struct ibmasmfs_heartbeat_data), GFP_KERNEL);
  380. if (!rhbeat)
  381. return -ENOMEM;
  382. rhbeat->sp = (struct service_processor *)inode->u.generic_ip;
  383. rhbeat->active = 0;
  384. ibmasm_init_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat);
  385. file->private_data = rhbeat;
  386. return 0;
  387. }
  388. static int r_heartbeat_file_close(struct inode *inode, struct file *file)
  389. {
  390. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  391. kfree(rhbeat);
  392. return 0;
  393. }
  394. static ssize_t r_heartbeat_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  395. {
  396. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  397. unsigned long flags;
  398. int result;
  399. if (*offset < 0)
  400. return -EINVAL;
  401. if (count == 0 || count > 1024)
  402. return 0;
  403. if (*offset != 0)
  404. return 0;
  405. /* allow only one reverse heartbeat per process */
  406. spin_lock_irqsave(&rhbeat->sp->lock, flags);
  407. if (rhbeat->active) {
  408. spin_unlock_irqrestore(&rhbeat->sp->lock, flags);
  409. return -EBUSY;
  410. }
  411. rhbeat->active = 1;
  412. spin_unlock_irqrestore(&rhbeat->sp->lock, flags);
  413. result = ibmasm_start_reverse_heartbeat(rhbeat->sp, &rhbeat->heartbeat);
  414. rhbeat->active = 0;
  415. return result;
  416. }
  417. static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
  418. {
  419. struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
  420. if (*offset < 0)
  421. return -EINVAL;
  422. if (count != 1)
  423. return 0;
  424. if (*offset != 0)
  425. return 0;
  426. if (rhbeat->active)
  427. ibmasm_stop_reverse_heartbeat(&rhbeat->heartbeat);
  428. return 1;
  429. }
  430. static int remote_settings_file_open(struct inode *inode, struct file *file)
  431. {
  432. file->private_data = inode->u.generic_ip;
  433. return 0;
  434. }
  435. static int remote_settings_file_close(struct inode *inode, struct file *file)
  436. {
  437. return 0;
  438. }
  439. static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  440. {
  441. void __iomem *address = (void __iomem *)file->private_data;
  442. unsigned char *page;
  443. int retval;
  444. int len = 0;
  445. unsigned int value;
  446. if (*offset < 0)
  447. return -EINVAL;
  448. if (count == 0 || count > 1024)
  449. return 0;
  450. if (*offset != 0)
  451. return 0;
  452. page = (unsigned char *)__get_free_page(GFP_KERNEL);
  453. if (!page)
  454. return -ENOMEM;
  455. value = readl(address);
  456. len = sprintf(page, "%d\n", value);
  457. if (copy_to_user(buf, page, len)) {
  458. retval = -EFAULT;
  459. goto exit;
  460. }
  461. *offset += len;
  462. retval = len;
  463. exit:
  464. free_page((unsigned long)page);
  465. return retval;
  466. }
  467. static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
  468. {
  469. void __iomem *address = (void __iomem *)file->private_data;
  470. char *buff;
  471. unsigned int value;
  472. if (*offset < 0)
  473. return -EINVAL;
  474. if (count == 0 || count > 1024)
  475. return 0;
  476. if (*offset != 0)
  477. return 0;
  478. buff = kmalloc (count + 1, GFP_KERNEL);
  479. if (!buff)
  480. return -ENOMEM;
  481. memset(buff, 0x0, count + 1);
  482. if (copy_from_user(buff, ubuff, count)) {
  483. kfree(buff);
  484. return -EFAULT;
  485. }
  486. value = simple_strtoul(buff, NULL, 10);
  487. writel(value, address);
  488. kfree(buff);
  489. return count;
  490. }
  491. static int remote_event_file_open(struct inode *inode, struct file *file)
  492. {
  493. struct service_processor *sp;
  494. unsigned long flags;
  495. struct remote_queue *q;
  496. file->private_data = inode->u.generic_ip;
  497. sp = file->private_data;
  498. q = &sp->remote_queue;
  499. /* allow only one event reader */
  500. spin_lock_irqsave(&sp->lock, flags);
  501. if (q->open) {
  502. spin_unlock_irqrestore(&sp->lock, flags);
  503. return -EBUSY;
  504. }
  505. q->open = 1;
  506. spin_unlock_irqrestore(&sp->lock, flags);
  507. enable_mouse_interrupts(sp);
  508. return 0;
  509. }
  510. static int remote_event_file_close(struct inode *inode, struct file *file)
  511. {
  512. struct service_processor *sp = file->private_data;
  513. disable_mouse_interrupts(sp);
  514. wake_up_interruptible(&sp->remote_queue.wait);
  515. sp->remote_queue.open = 0;
  516. return 0;
  517. }
  518. static ssize_t remote_event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
  519. {
  520. struct service_processor *sp = file->private_data;
  521. struct remote_queue *q = &sp->remote_queue;
  522. size_t data_size;
  523. struct remote_event *reader = q->reader;
  524. size_t num_events;
  525. if (*offset < 0)
  526. return -EINVAL;
  527. if (count == 0 || count > 1024)
  528. return 0;
  529. if (*offset != 0)
  530. return 0;
  531. if (wait_event_interruptible(q->wait, q->reader != q->writer))
  532. return -ERESTARTSYS;
  533. /* only get multiples of struct remote_event */
  534. num_events = min((count/sizeof(struct remote_event)), ibmasm_events_available(q));
  535. if (!num_events)
  536. return 0;
  537. data_size = num_events * sizeof(struct remote_event);
  538. if (copy_to_user(buf, reader, data_size))
  539. return -EFAULT;
  540. ibmasm_advance_reader(q, num_events);
  541. return data_size;
  542. }
  543. static struct file_operations command_fops = {
  544. .open = command_file_open,
  545. .release = command_file_close,
  546. .read = command_file_read,
  547. .write = command_file_write,
  548. };
  549. static struct file_operations event_fops = {
  550. .open = event_file_open,
  551. .release = event_file_close,
  552. .read = event_file_read,
  553. .write = event_file_write,
  554. };
  555. static struct file_operations r_heartbeat_fops = {
  556. .open = r_heartbeat_file_open,
  557. .release = r_heartbeat_file_close,
  558. .read = r_heartbeat_file_read,
  559. .write = r_heartbeat_file_write,
  560. };
  561. static struct file_operations remote_settings_fops = {
  562. .open = remote_settings_file_open,
  563. .release = remote_settings_file_close,
  564. .read = remote_settings_file_read,
  565. .write = remote_settings_file_write,
  566. };
  567. static struct file_operations remote_event_fops = {
  568. .open = remote_event_file_open,
  569. .release = remote_event_file_close,
  570. .read = remote_event_file_read,
  571. };
  572. static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root)
  573. {
  574. struct list_head *entry;
  575. struct service_processor *sp;
  576. list_for_each(entry, &service_processors) {
  577. struct dentry *dir;
  578. struct dentry *remote_dir;
  579. sp = list_entry(entry, struct service_processor, node);
  580. dir = ibmasmfs_create_dir(sb, root, sp->dirname);
  581. if (!dir)
  582. continue;
  583. ibmasmfs_create_file(sb, dir, "command", &command_fops, sp, S_IRUSR|S_IWUSR);
  584. ibmasmfs_create_file(sb, dir, "event", &event_fops, sp, S_IRUSR|S_IWUSR);
  585. ibmasmfs_create_file(sb, dir, "reverse_heartbeat", &r_heartbeat_fops, sp, S_IRUSR|S_IWUSR);
  586. remote_dir = ibmasmfs_create_dir(sb, dir, "remote_video");
  587. if (!remote_dir)
  588. continue;
  589. ibmasmfs_create_file(sb, remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR);
  590. ibmasmfs_create_file(sb, remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR);
  591. ibmasmfs_create_file(sb, remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR);
  592. ibmasmfs_create_file(sb, remote_dir, "connected", &remote_settings_fops, (void *)vnc_status(sp), S_IRUSR);
  593. ibmasmfs_create_file(sb, remote_dir, "events", &remote_event_fops, (void *)sp, S_IRUSR);
  594. }
  595. }