main.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. /*
  2. *
  3. * Intel Management Engine Interface (Intel MEI) Linux driver
  4. * Copyright (c) 2003-2012, Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. */
  16. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  17. #include <linux/module.h>
  18. #include <linux/moduleparam.h>
  19. #include <linux/kernel.h>
  20. #include <linux/device.h>
  21. #include <linux/fs.h>
  22. #include <linux/errno.h>
  23. #include <linux/types.h>
  24. #include <linux/fcntl.h>
  25. #include <linux/aio.h>
  26. #include <linux/pci.h>
  27. #include <linux/poll.h>
  28. #include <linux/init.h>
  29. #include <linux/ioctl.h>
  30. #include <linux/cdev.h>
  31. #include <linux/sched.h>
  32. #include <linux/uuid.h>
  33. #include <linux/compat.h>
  34. #include <linux/jiffies.h>
  35. #include <linux/interrupt.h>
  36. #include <linux/miscdevice.h>
  37. #include <linux/mei.h>
  38. #include "mei_dev.h"
  39. #include "hw-me.h"
  40. #include "client.h"
  41. /**
  42. * mei_open - the open function
  43. *
  44. * @inode: pointer to inode structure
  45. * @file: pointer to file structure
  46. e
  47. * returns 0 on success, <0 on error
  48. */
  49. static int mei_open(struct inode *inode, struct file *file)
  50. {
  51. struct miscdevice *misc = file->private_data;
  52. struct pci_dev *pdev;
  53. struct mei_cl *cl;
  54. struct mei_device *dev;
  55. int err;
  56. err = -ENODEV;
  57. if (!misc->parent)
  58. goto out;
  59. pdev = container_of(misc->parent, struct pci_dev, dev);
  60. dev = pci_get_drvdata(pdev);
  61. if (!dev)
  62. goto out;
  63. mutex_lock(&dev->device_lock);
  64. err = -ENOMEM;
  65. cl = mei_cl_allocate(dev);
  66. if (!cl)
  67. goto out_unlock;
  68. err = -ENODEV;
  69. if (dev->dev_state != MEI_DEV_ENABLED) {
  70. dev_dbg(&dev->pdev->dev, "dev_state != MEI_ENABLED dev_state = %s\n",
  71. mei_dev_state_str(dev->dev_state));
  72. goto out_unlock;
  73. }
  74. err = -EMFILE;
  75. if (dev->open_handle_count >= MEI_MAX_OPEN_HANDLE_COUNT) {
  76. dev_err(&dev->pdev->dev, "open_handle_count exceded %d",
  77. MEI_MAX_OPEN_HANDLE_COUNT);
  78. goto out_unlock;
  79. }
  80. err = mei_cl_link(cl, MEI_HOST_CLIENT_ID_ANY);
  81. if (err)
  82. goto out_unlock;
  83. file->private_data = cl;
  84. mutex_unlock(&dev->device_lock);
  85. return nonseekable_open(inode, file);
  86. out_unlock:
  87. mutex_unlock(&dev->device_lock);
  88. kfree(cl);
  89. out:
  90. return err;
  91. }
  92. /**
  93. * mei_release - the release function
  94. *
  95. * @inode: pointer to inode structure
  96. * @file: pointer to file structure
  97. *
  98. * returns 0 on success, <0 on error
  99. */
  100. static int mei_release(struct inode *inode, struct file *file)
  101. {
  102. struct mei_cl *cl = file->private_data;
  103. struct mei_cl_cb *cb;
  104. struct mei_device *dev;
  105. int rets = 0;
  106. if (WARN_ON(!cl || !cl->dev))
  107. return -ENODEV;
  108. dev = cl->dev;
  109. mutex_lock(&dev->device_lock);
  110. if (cl == &dev->iamthif_cl) {
  111. rets = mei_amthif_release(dev, file);
  112. goto out;
  113. }
  114. if (cl->state == MEI_FILE_CONNECTED) {
  115. cl->state = MEI_FILE_DISCONNECTING;
  116. dev_dbg(&dev->pdev->dev,
  117. "disconnecting client host client = %d, "
  118. "ME client = %d\n",
  119. cl->host_client_id,
  120. cl->me_client_id);
  121. rets = mei_cl_disconnect(cl);
  122. }
  123. mei_cl_flush_queues(cl);
  124. dev_dbg(&dev->pdev->dev, "remove client host client = %d, ME client = %d\n",
  125. cl->host_client_id,
  126. cl->me_client_id);
  127. if (dev->open_handle_count > 0) {
  128. clear_bit(cl->host_client_id, dev->host_clients_map);
  129. dev->open_handle_count--;
  130. }
  131. mei_cl_unlink(cl);
  132. /* free read cb */
  133. cb = NULL;
  134. if (cl->read_cb) {
  135. cb = mei_cl_find_read_cb(cl);
  136. /* Remove entry from read list */
  137. if (cb)
  138. list_del(&cb->list);
  139. cb = cl->read_cb;
  140. cl->read_cb = NULL;
  141. }
  142. file->private_data = NULL;
  143. if (cb) {
  144. mei_io_cb_free(cb);
  145. cb = NULL;
  146. }
  147. kfree(cl);
  148. out:
  149. mutex_unlock(&dev->device_lock);
  150. return rets;
  151. }
  152. /**
  153. * mei_read - the read function.
  154. *
  155. * @file: pointer to file structure
  156. * @ubuf: pointer to user buffer
  157. * @length: buffer length
  158. * @offset: data offset in buffer
  159. *
  160. * returns >=0 data length on success , <0 on error
  161. */
  162. static ssize_t mei_read(struct file *file, char __user *ubuf,
  163. size_t length, loff_t *offset)
  164. {
  165. struct mei_cl *cl = file->private_data;
  166. struct mei_cl_cb *cb_pos = NULL;
  167. struct mei_cl_cb *cb = NULL;
  168. struct mei_device *dev;
  169. int rets;
  170. int err;
  171. if (WARN_ON(!cl || !cl->dev))
  172. return -ENODEV;
  173. dev = cl->dev;
  174. mutex_lock(&dev->device_lock);
  175. if (dev->dev_state != MEI_DEV_ENABLED) {
  176. rets = -ENODEV;
  177. goto out;
  178. }
  179. if (cl == &dev->iamthif_cl) {
  180. rets = mei_amthif_read(dev, file, ubuf, length, offset);
  181. goto out;
  182. }
  183. if (cl->read_cb) {
  184. cb = cl->read_cb;
  185. /* read what left */
  186. if (cb->buf_idx > *offset)
  187. goto copy_buffer;
  188. /* offset is beyond buf_idx we have no more data return 0 */
  189. if (cb->buf_idx > 0 && cb->buf_idx <= *offset) {
  190. rets = 0;
  191. goto free;
  192. }
  193. /* Offset needs to be cleaned for contiguous reads*/
  194. if (cb->buf_idx == 0 && *offset > 0)
  195. *offset = 0;
  196. } else if (*offset > 0) {
  197. *offset = 0;
  198. }
  199. err = mei_cl_read_start(cl, length);
  200. if (err && err != -EBUSY) {
  201. dev_dbg(&dev->pdev->dev,
  202. "mei start read failure with status = %d\n", err);
  203. rets = err;
  204. goto out;
  205. }
  206. if (MEI_READ_COMPLETE != cl->reading_state &&
  207. !waitqueue_active(&cl->rx_wait)) {
  208. if (file->f_flags & O_NONBLOCK) {
  209. rets = -EAGAIN;
  210. goto out;
  211. }
  212. mutex_unlock(&dev->device_lock);
  213. if (wait_event_interruptible(cl->rx_wait,
  214. (MEI_READ_COMPLETE == cl->reading_state ||
  215. MEI_FILE_INITIALIZING == cl->state ||
  216. MEI_FILE_DISCONNECTED == cl->state ||
  217. MEI_FILE_DISCONNECTING == cl->state))) {
  218. if (signal_pending(current))
  219. return -EINTR;
  220. return -ERESTARTSYS;
  221. }
  222. mutex_lock(&dev->device_lock);
  223. if (MEI_FILE_INITIALIZING == cl->state ||
  224. MEI_FILE_DISCONNECTED == cl->state ||
  225. MEI_FILE_DISCONNECTING == cl->state) {
  226. rets = -EBUSY;
  227. goto out;
  228. }
  229. }
  230. cb = cl->read_cb;
  231. if (!cb) {
  232. rets = -ENODEV;
  233. goto out;
  234. }
  235. if (cl->reading_state != MEI_READ_COMPLETE) {
  236. rets = 0;
  237. goto out;
  238. }
  239. /* now copy the data to user space */
  240. copy_buffer:
  241. dev_dbg(&dev->pdev->dev, "buf.size = %d buf.idx= %ld\n",
  242. cb->response_buffer.size, cb->buf_idx);
  243. if (length == 0 || ubuf == NULL || *offset > cb->buf_idx) {
  244. rets = -EMSGSIZE;
  245. goto free;
  246. }
  247. /* length is being truncated to PAGE_SIZE,
  248. * however buf_idx may point beyond that */
  249. length = min_t(size_t, length, cb->buf_idx - *offset);
  250. if (copy_to_user(ubuf, cb->response_buffer.data + *offset, length)) {
  251. rets = -EFAULT;
  252. goto free;
  253. }
  254. rets = length;
  255. *offset += length;
  256. if ((unsigned long)*offset < cb->buf_idx)
  257. goto out;
  258. free:
  259. cb_pos = mei_cl_find_read_cb(cl);
  260. /* Remove entry from read list */
  261. if (cb_pos)
  262. list_del(&cb_pos->list);
  263. mei_io_cb_free(cb);
  264. cl->reading_state = MEI_IDLE;
  265. cl->read_cb = NULL;
  266. out:
  267. dev_dbg(&dev->pdev->dev, "end mei read rets= %d\n", rets);
  268. mutex_unlock(&dev->device_lock);
  269. return rets;
  270. }
  271. /**
  272. * mei_write - the write function.
  273. *
  274. * @file: pointer to file structure
  275. * @ubuf: pointer to user buffer
  276. * @length: buffer length
  277. * @offset: data offset in buffer
  278. *
  279. * returns >=0 data length on success , <0 on error
  280. */
  281. static ssize_t mei_write(struct file *file, const char __user *ubuf,
  282. size_t length, loff_t *offset)
  283. {
  284. struct mei_cl *cl = file->private_data;
  285. struct mei_cl_cb *write_cb = NULL;
  286. struct mei_device *dev;
  287. unsigned long timeout = 0;
  288. int rets;
  289. int id;
  290. if (WARN_ON(!cl || !cl->dev))
  291. return -ENODEV;
  292. dev = cl->dev;
  293. mutex_lock(&dev->device_lock);
  294. if (dev->dev_state != MEI_DEV_ENABLED) {
  295. rets = -ENODEV;
  296. goto out;
  297. }
  298. id = mei_me_cl_by_id(dev, cl->me_client_id);
  299. if (id < 0) {
  300. rets = -ENODEV;
  301. goto out;
  302. }
  303. if (length > dev->me_clients[id].props.max_msg_length || length <= 0) {
  304. rets = -EMSGSIZE;
  305. goto out;
  306. }
  307. if (cl->state != MEI_FILE_CONNECTED) {
  308. dev_err(&dev->pdev->dev, "host client = %d, is not connected to ME client = %d",
  309. cl->host_client_id, cl->me_client_id);
  310. rets = -ENODEV;
  311. goto out;
  312. }
  313. if (cl == &dev->iamthif_cl) {
  314. write_cb = mei_amthif_find_read_list_entry(dev, file);
  315. if (write_cb) {
  316. timeout = write_cb->read_time +
  317. mei_secs_to_jiffies(MEI_IAMTHIF_READ_TIMER);
  318. if (time_after(jiffies, timeout) ||
  319. cl->reading_state == MEI_READ_COMPLETE) {
  320. *offset = 0;
  321. list_del(&write_cb->list);
  322. mei_io_cb_free(write_cb);
  323. write_cb = NULL;
  324. }
  325. }
  326. }
  327. /* free entry used in read */
  328. if (cl->reading_state == MEI_READ_COMPLETE) {
  329. *offset = 0;
  330. write_cb = mei_cl_find_read_cb(cl);
  331. if (write_cb) {
  332. list_del(&write_cb->list);
  333. mei_io_cb_free(write_cb);
  334. write_cb = NULL;
  335. cl->reading_state = MEI_IDLE;
  336. cl->read_cb = NULL;
  337. }
  338. } else if (cl->reading_state == MEI_IDLE)
  339. *offset = 0;
  340. write_cb = mei_io_cb_init(cl, file);
  341. if (!write_cb) {
  342. dev_err(&dev->pdev->dev, "write cb allocation failed\n");
  343. rets = -ENOMEM;
  344. goto out;
  345. }
  346. rets = mei_io_cb_alloc_req_buf(write_cb, length);
  347. if (rets)
  348. goto out;
  349. rets = copy_from_user(write_cb->request_buffer.data, ubuf, length);
  350. if (rets)
  351. goto out;
  352. if (cl == &dev->iamthif_cl) {
  353. rets = mei_amthif_write(dev, write_cb);
  354. if (rets) {
  355. dev_err(&dev->pdev->dev,
  356. "amthif write failed with status = %d\n", rets);
  357. goto out;
  358. }
  359. mutex_unlock(&dev->device_lock);
  360. return length;
  361. }
  362. rets = mei_cl_write(cl, write_cb, false);
  363. out:
  364. mutex_unlock(&dev->device_lock);
  365. if (rets < 0)
  366. mei_io_cb_free(write_cb);
  367. return rets;
  368. }
  369. /**
  370. * mei_ioctl_connect_client - the connect to fw client IOCTL function
  371. *
  372. * @dev: the device structure
  373. * @data: IOCTL connect data, input and output parameters
  374. * @file: private data of the file object
  375. *
  376. * Locking: called under "dev->device_lock" lock
  377. *
  378. * returns 0 on success, <0 on failure.
  379. */
  380. static int mei_ioctl_connect_client(struct file *file,
  381. struct mei_connect_client_data *data)
  382. {
  383. struct mei_device *dev;
  384. struct mei_client *client;
  385. struct mei_cl *cl;
  386. int i;
  387. int rets;
  388. cl = file->private_data;
  389. if (WARN_ON(!cl || !cl->dev))
  390. return -ENODEV;
  391. dev = cl->dev;
  392. if (dev->dev_state != MEI_DEV_ENABLED) {
  393. rets = -ENODEV;
  394. goto end;
  395. }
  396. if (cl->state != MEI_FILE_INITIALIZING &&
  397. cl->state != MEI_FILE_DISCONNECTED) {
  398. rets = -EBUSY;
  399. goto end;
  400. }
  401. /* find ME client we're trying to connect to */
  402. i = mei_me_cl_by_uuid(dev, &data->in_client_uuid);
  403. if (i < 0 || dev->me_clients[i].props.fixed_address) {
  404. dev_dbg(&dev->pdev->dev, "Cannot connect to FW Client UUID = %pUl\n",
  405. &data->in_client_uuid);
  406. rets = -ENODEV;
  407. goto end;
  408. }
  409. cl->me_client_id = dev->me_clients[i].client_id;
  410. cl->state = MEI_FILE_CONNECTING;
  411. dev_dbg(&dev->pdev->dev, "Connect to FW Client ID = %d\n",
  412. cl->me_client_id);
  413. dev_dbg(&dev->pdev->dev, "FW Client - Protocol Version = %d\n",
  414. dev->me_clients[i].props.protocol_version);
  415. dev_dbg(&dev->pdev->dev, "FW Client - Max Msg Len = %d\n",
  416. dev->me_clients[i].props.max_msg_length);
  417. /* if we're connecting to amthif client then we will use the
  418. * existing connection
  419. */
  420. if (uuid_le_cmp(data->in_client_uuid, mei_amthif_guid) == 0) {
  421. dev_dbg(&dev->pdev->dev, "FW Client is amthi\n");
  422. if (dev->iamthif_cl.state != MEI_FILE_CONNECTED) {
  423. rets = -ENODEV;
  424. goto end;
  425. }
  426. clear_bit(cl->host_client_id, dev->host_clients_map);
  427. mei_cl_unlink(cl);
  428. kfree(cl);
  429. cl = NULL;
  430. file->private_data = &dev->iamthif_cl;
  431. client = &data->out_client_properties;
  432. client->max_msg_length =
  433. dev->me_clients[i].props.max_msg_length;
  434. client->protocol_version =
  435. dev->me_clients[i].props.protocol_version;
  436. rets = dev->iamthif_cl.status;
  437. goto end;
  438. }
  439. /* prepare the output buffer */
  440. client = &data->out_client_properties;
  441. client->max_msg_length = dev->me_clients[i].props.max_msg_length;
  442. client->protocol_version = dev->me_clients[i].props.protocol_version;
  443. dev_dbg(&dev->pdev->dev, "Can connect?\n");
  444. rets = mei_cl_connect(cl, file);
  445. end:
  446. return rets;
  447. }
  448. /**
  449. * mei_ioctl - the IOCTL function
  450. *
  451. * @file: pointer to file structure
  452. * @cmd: ioctl command
  453. * @data: pointer to mei message structure
  454. *
  455. * returns 0 on success , <0 on error
  456. */
  457. static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
  458. {
  459. struct mei_device *dev;
  460. struct mei_cl *cl = file->private_data;
  461. struct mei_connect_client_data *connect_data = NULL;
  462. int rets;
  463. if (cmd != IOCTL_MEI_CONNECT_CLIENT)
  464. return -EINVAL;
  465. if (WARN_ON(!cl || !cl->dev))
  466. return -ENODEV;
  467. dev = cl->dev;
  468. dev_dbg(&dev->pdev->dev, "IOCTL cmd = 0x%x", cmd);
  469. mutex_lock(&dev->device_lock);
  470. if (dev->dev_state != MEI_DEV_ENABLED) {
  471. rets = -ENODEV;
  472. goto out;
  473. }
  474. dev_dbg(&dev->pdev->dev, ": IOCTL_MEI_CONNECT_CLIENT.\n");
  475. connect_data = kzalloc(sizeof(struct mei_connect_client_data),
  476. GFP_KERNEL);
  477. if (!connect_data) {
  478. rets = -ENOMEM;
  479. goto out;
  480. }
  481. dev_dbg(&dev->pdev->dev, "copy connect data from user\n");
  482. if (copy_from_user(connect_data, (char __user *)data,
  483. sizeof(struct mei_connect_client_data))) {
  484. dev_dbg(&dev->pdev->dev, "failed to copy data from userland\n");
  485. rets = -EFAULT;
  486. goto out;
  487. }
  488. rets = mei_ioctl_connect_client(file, connect_data);
  489. /* if all is ok, copying the data back to user. */
  490. if (rets)
  491. goto out;
  492. dev_dbg(&dev->pdev->dev, "copy connect data to user\n");
  493. if (copy_to_user((char __user *)data, connect_data,
  494. sizeof(struct mei_connect_client_data))) {
  495. dev_dbg(&dev->pdev->dev, "failed to copy data to userland\n");
  496. rets = -EFAULT;
  497. goto out;
  498. }
  499. out:
  500. kfree(connect_data);
  501. mutex_unlock(&dev->device_lock);
  502. return rets;
  503. }
  504. /**
  505. * mei_compat_ioctl - the compat IOCTL function
  506. *
  507. * @file: pointer to file structure
  508. * @cmd: ioctl command
  509. * @data: pointer to mei message structure
  510. *
  511. * returns 0 on success , <0 on error
  512. */
  513. #ifdef CONFIG_COMPAT
  514. static long mei_compat_ioctl(struct file *file,
  515. unsigned int cmd, unsigned long data)
  516. {
  517. return mei_ioctl(file, cmd, (unsigned long)compat_ptr(data));
  518. }
  519. #endif
  520. /**
  521. * mei_poll - the poll function
  522. *
  523. * @file: pointer to file structure
  524. * @wait: pointer to poll_table structure
  525. *
  526. * returns poll mask
  527. */
  528. static unsigned int mei_poll(struct file *file, poll_table *wait)
  529. {
  530. struct mei_cl *cl = file->private_data;
  531. struct mei_device *dev;
  532. unsigned int mask = 0;
  533. if (WARN_ON(!cl || !cl->dev))
  534. return POLLERR;
  535. dev = cl->dev;
  536. mutex_lock(&dev->device_lock);
  537. if (!mei_cl_is_connected(cl)) {
  538. mask = POLLERR;
  539. goto out;
  540. }
  541. mutex_unlock(&dev->device_lock);
  542. if (cl == &dev->iamthif_cl)
  543. return mei_amthif_poll(dev, file, wait);
  544. poll_wait(file, &cl->tx_wait, wait);
  545. mutex_lock(&dev->device_lock);
  546. if (!mei_cl_is_connected(cl)) {
  547. mask = POLLERR;
  548. goto out;
  549. }
  550. if (MEI_WRITE_COMPLETE == cl->writing_state)
  551. mask |= (POLLIN | POLLRDNORM);
  552. out:
  553. mutex_unlock(&dev->device_lock);
  554. return mask;
  555. }
  556. /*
  557. * file operations structure will be used for mei char device.
  558. */
  559. static const struct file_operations mei_fops = {
  560. .owner = THIS_MODULE,
  561. .read = mei_read,
  562. .unlocked_ioctl = mei_ioctl,
  563. #ifdef CONFIG_COMPAT
  564. .compat_ioctl = mei_compat_ioctl,
  565. #endif
  566. .open = mei_open,
  567. .release = mei_release,
  568. .write = mei_write,
  569. .poll = mei_poll,
  570. .llseek = no_llseek
  571. };
  572. /*
  573. * Misc Device Struct
  574. */
  575. static struct miscdevice mei_misc_device = {
  576. .name = "mei",
  577. .fops = &mei_fops,
  578. .minor = MISC_DYNAMIC_MINOR,
  579. };
  580. int mei_register(struct mei_device *dev)
  581. {
  582. int ret;
  583. mei_misc_device.parent = &dev->pdev->dev;
  584. ret = misc_register(&mei_misc_device);
  585. if (ret)
  586. return ret;
  587. if (mei_dbgfs_register(dev, mei_misc_device.name))
  588. dev_err(&dev->pdev->dev, "cannot register debugfs\n");
  589. return 0;
  590. }
  591. EXPORT_SYMBOL_GPL(mei_register);
  592. void mei_deregister(struct mei_device *dev)
  593. {
  594. mei_dbgfs_deregister(dev);
  595. misc_deregister(&mei_misc_device);
  596. mei_misc_device.parent = NULL;
  597. }
  598. EXPORT_SYMBOL_GPL(mei_deregister);
  599. static int __init mei_init(void)
  600. {
  601. return mei_cl_bus_init();
  602. }
  603. static void __exit mei_exit(void)
  604. {
  605. mei_cl_bus_exit();
  606. }
  607. module_init(mei_init);
  608. module_exit(mei_exit);
  609. MODULE_AUTHOR("Intel Corporation");
  610. MODULE_DESCRIPTION("Intel(R) Management Engine Interface");
  611. MODULE_LICENSE("GPL v2");