hid-uclogic-core.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * HID driver for UC-Logic devices not fully compliant with HID standard
  4. *
  5. * Copyright (c) 2010-2014 Nikolai Kondrashov
  6. * Copyright (c) 2013 Martin Rusko
  7. */
  8. /*
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the Free
  11. * Software Foundation; either version 2 of the License, or (at your option)
  12. * any later version.
  13. */
  14. #include <linux/device.h>
  15. #include <linux/hid.h>
  16. #include <linux/module.h>
  17. #include <linux/timer.h>
  18. #include "usbhid/usbhid.h"
  19. #include "hid-uclogic-params.h"
  20. #include "hid-ids.h"
  21. /**
  22. * uclogic_inrange_timeout - handle pen in-range state timeout.
  23. * Emulate input events normally generated when pen goes out of range for
  24. * tablets which don't report that.
  25. *
  26. * @t: The timer the timeout handler is attached to, stored in a struct
  27. * uclogic_drvdata.
  28. */
  29. static void uclogic_inrange_timeout(struct timer_list *t)
  30. {
  31. struct uclogic_drvdata *drvdata = from_timer(drvdata, t,
  32. inrange_timer);
  33. struct input_dev *input = drvdata->pen_input;
  34. if (input == NULL)
  35. return;
  36. input_report_abs(input, ABS_PRESSURE, 0);
  37. /* If BTN_TOUCH state is changing */
  38. if (test_bit(BTN_TOUCH, input->key)) {
  39. input_event(input, EV_MSC, MSC_SCAN,
  40. /* Digitizer Tip Switch usage */
  41. 0xd0042);
  42. input_report_key(input, BTN_TOUCH, 0);
  43. }
  44. input_report_key(input, BTN_TOOL_PEN, 0);
  45. input_sync(input);
  46. }
  47. static const __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  48. unsigned int *rsize)
  49. {
  50. struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
  51. if (drvdata->desc_ptr != NULL) {
  52. *rsize = drvdata->desc_size;
  53. return drvdata->desc_ptr;
  54. }
  55. return rdesc;
  56. }
  57. static int uclogic_input_mapping(struct hid_device *hdev,
  58. struct hid_input *hi,
  59. struct hid_field *field,
  60. struct hid_usage *usage,
  61. unsigned long **bit,
  62. int *max)
  63. {
  64. struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
  65. struct uclogic_params *params = &drvdata->params;
  66. /* Discard invalid pen usages */
  67. if (params->pen.usage_invalid && (field->application == HID_DG_PEN))
  68. return -1;
  69. /* Let hid-core decide what to do */
  70. return 0;
  71. }
  72. static int uclogic_input_configured(struct hid_device *hdev,
  73. struct hid_input *hi)
  74. {
  75. struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
  76. struct uclogic_params *params = &drvdata->params;
  77. const char *suffix = NULL;
  78. struct hid_field *field;
  79. size_t i;
  80. const struct uclogic_params_frame *frame;
  81. /* no report associated (HID_QUIRK_MULTI_INPUT not set) */
  82. if (!hi->report)
  83. return 0;
  84. /*
  85. * If this is the input corresponding to the pen report
  86. * in need of tweaking.
  87. */
  88. if (hi->report->id == params->pen.id) {
  89. /* Remember the input device so we can simulate events */
  90. drvdata->pen_input = hi->input;
  91. }
  92. /* If it's one of the frame devices */
  93. for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) {
  94. frame = &params->frame_list[i];
  95. if (hi->report->id == frame->id) {
  96. /* Assign custom suffix, if any */
  97. suffix = frame->suffix;
  98. /*
  99. * Disable EV_MSC reports for touch ring interfaces to
  100. * make the Wacom driver pickup touch ring extents
  101. */
  102. if (frame->touch_byte > 0)
  103. __clear_bit(EV_MSC, hi->input->evbit);
  104. }
  105. }
  106. if (!suffix) {
  107. field = hi->report->field[0];
  108. switch (field->application) {
  109. case HID_GD_KEYBOARD:
  110. suffix = "Keyboard";
  111. break;
  112. case HID_GD_MOUSE:
  113. suffix = "Mouse";
  114. break;
  115. case HID_GD_KEYPAD:
  116. suffix = "Pad";
  117. break;
  118. case HID_DG_PEN:
  119. case HID_DG_DIGITIZER:
  120. suffix = "Pen";
  121. break;
  122. case HID_CP_CONSUMER_CONTROL:
  123. suffix = "Consumer Control";
  124. break;
  125. case HID_GD_SYSTEM_CONTROL:
  126. suffix = "System Control";
  127. break;
  128. }
  129. } else {
  130. hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
  131. "%s %s", hdev->name, suffix);
  132. if (!hi->input->name)
  133. return -ENOMEM;
  134. }
  135. return 0;
  136. }
  137. static int uclogic_probe(struct hid_device *hdev,
  138. const struct hid_device_id *id)
  139. {
  140. int rc;
  141. struct uclogic_drvdata *drvdata = NULL;
  142. bool params_initialized = false;
  143. if (!hid_is_usb(hdev))
  144. return -EINVAL;
  145. /*
  146. * libinput requires the pad interface to be on a different node
  147. * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
  148. */
  149. hdev->quirks |= HID_QUIRK_MULTI_INPUT;
  150. hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE;
  151. /* Allocate and assign driver data */
  152. drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
  153. if (drvdata == NULL) {
  154. rc = -ENOMEM;
  155. goto failure;
  156. }
  157. timer_setup(&drvdata->inrange_timer, uclogic_inrange_timeout, 0);
  158. drvdata->re_state = U8_MAX;
  159. drvdata->quirks = id->driver_data;
  160. hid_set_drvdata(hdev, drvdata);
  161. /* Initialize the device and retrieve interface parameters */
  162. rc = uclogic_params_init(&drvdata->params, hdev);
  163. if (rc != 0) {
  164. hid_err(hdev, "failed probing parameters: %d\n", rc);
  165. goto failure;
  166. }
  167. params_initialized = true;
  168. hid_dbg(hdev, "parameters:\n");
  169. uclogic_params_hid_dbg(hdev, &drvdata->params);
  170. if (drvdata->params.invalid) {
  171. hid_info(hdev, "interface is invalid, ignoring\n");
  172. rc = -ENODEV;
  173. goto failure;
  174. }
  175. /* Generate replacement report descriptor */
  176. rc = uclogic_params_get_desc(&drvdata->params,
  177. &drvdata->desc_ptr,
  178. &drvdata->desc_size);
  179. if (rc) {
  180. hid_err(hdev,
  181. "failed generating replacement report descriptor: %d\n",
  182. rc);
  183. goto failure;
  184. }
  185. rc = hid_parse(hdev);
  186. if (rc) {
  187. hid_err(hdev, "parse failed\n");
  188. goto failure;
  189. }
  190. rc = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
  191. if (rc) {
  192. hid_err(hdev, "hw start failed\n");
  193. goto failure;
  194. }
  195. return 0;
  196. failure:
  197. /* Assume "remove" might not be called if "probe" failed */
  198. if (params_initialized)
  199. uclogic_params_cleanup(&drvdata->params);
  200. return rc;
  201. }
  202. #ifdef CONFIG_PM
  203. static int uclogic_resume(struct hid_device *hdev)
  204. {
  205. int rc;
  206. struct uclogic_params params;
  207. /* Re-initialize the device, but discard parameters */
  208. rc = uclogic_params_init(&params, hdev);
  209. if (rc != 0)
  210. hid_err(hdev, "failed to re-initialize the device\n");
  211. else
  212. uclogic_params_cleanup(&params);
  213. return rc;
  214. }
  215. #endif
  216. /**
  217. * uclogic_exec_event_hook - if the received event is hooked schedules the
  218. * associated work.
  219. *
  220. * @p: Tablet interface report parameters.
  221. * @event: Raw event.
  222. * @size: The size of event.
  223. *
  224. * Returns:
  225. * Whether the event was hooked or not.
  226. */
  227. static bool uclogic_exec_event_hook(struct uclogic_params *p, u8 *event, int size)
  228. {
  229. struct uclogic_raw_event_hook *curr;
  230. if (!p->event_hooks)
  231. return false;
  232. list_for_each_entry(curr, &p->event_hooks->list, list) {
  233. if (curr->size == size && memcmp(curr->event, event, size) == 0) {
  234. schedule_work(&curr->work);
  235. return true;
  236. }
  237. }
  238. return false;
  239. }
  240. /**
  241. * uclogic_raw_event_pen - handle raw pen events (pen HID reports).
  242. *
  243. * @drvdata: Driver data.
  244. * @data: Report data buffer, can be modified.
  245. * @size: Report data size, bytes.
  246. *
  247. * Returns:
  248. * Negative value on error (stops event delivery), zero for success.
  249. */
  250. static int uclogic_raw_event_pen(struct uclogic_drvdata *drvdata,
  251. u8 *data, int size)
  252. {
  253. struct uclogic_params_pen *pen = &drvdata->params.pen;
  254. WARN_ON(drvdata == NULL);
  255. WARN_ON(data == NULL && size != 0);
  256. /* If in-range reports are inverted */
  257. if (pen->inrange ==
  258. UCLOGIC_PARAMS_PEN_INRANGE_INVERTED) {
  259. /* Invert the in-range bit */
  260. data[1] ^= 0x40;
  261. }
  262. /*
  263. * If report contains fragmented high-resolution pen
  264. * coordinates
  265. */
  266. if (size >= 10 && pen->fragmented_hires) {
  267. u8 pressure_low_byte;
  268. u8 pressure_high_byte;
  269. /* Lift pressure bytes */
  270. pressure_low_byte = data[6];
  271. pressure_high_byte = data[7];
  272. /*
  273. * Move Y coord to make space for high-order X
  274. * coord byte
  275. */
  276. data[6] = data[5];
  277. data[5] = data[4];
  278. /* Move high-order X coord byte */
  279. data[4] = data[8];
  280. /* Move high-order Y coord byte */
  281. data[7] = data[9];
  282. /* Place pressure bytes */
  283. data[8] = pressure_low_byte;
  284. data[9] = pressure_high_byte;
  285. }
  286. /* If we need to emulate in-range detection */
  287. if (pen->inrange == UCLOGIC_PARAMS_PEN_INRANGE_NONE) {
  288. /* Set in-range bit */
  289. data[1] |= 0x40;
  290. /* (Re-)start in-range timeout */
  291. mod_timer(&drvdata->inrange_timer,
  292. jiffies + msecs_to_jiffies(100));
  293. }
  294. /* If we report tilt and Y direction is flipped */
  295. if (size >= 12 && pen->tilt_y_flipped)
  296. data[11] = -data[11];
  297. return 0;
  298. }
  299. /**
  300. * uclogic_raw_event_frame - handle raw frame events (frame HID reports).
  301. *
  302. * @drvdata: Driver data.
  303. * @frame: The parameters of the frame controls to handle.
  304. * @data: Report data buffer, can be modified.
  305. * @size: Report data size, bytes.
  306. *
  307. * Returns:
  308. * Negative value on error (stops event delivery), zero for success.
  309. */
  310. static int uclogic_raw_event_frame(
  311. struct uclogic_drvdata *drvdata,
  312. const struct uclogic_params_frame *frame,
  313. u8 *data, int size)
  314. {
  315. WARN_ON(drvdata == NULL);
  316. WARN_ON(data == NULL && size != 0);
  317. /* If need to, and can, set pad device ID for Wacom drivers */
  318. if (frame->dev_id_byte > 0 && frame->dev_id_byte < size) {
  319. /* If we also have a touch ring and the finger left it */
  320. if (frame->touch_byte > 0 && frame->touch_byte < size &&
  321. data[frame->touch_byte] == 0) {
  322. data[frame->dev_id_byte] = 0;
  323. } else {
  324. data[frame->dev_id_byte] = 0xf;
  325. }
  326. }
  327. /* If need to, and can, read rotary encoder state change */
  328. if (frame->re_lsb > 0 && frame->re_lsb / 8 < size) {
  329. unsigned int byte = frame->re_lsb / 8;
  330. unsigned int bit = frame->re_lsb % 8;
  331. u8 change;
  332. u8 prev_state = drvdata->re_state;
  333. /* Read Gray-coded state */
  334. u8 state = (data[byte] >> bit) & 0x3;
  335. /* Encode state change into 2-bit signed integer */
  336. if ((prev_state == 1 && state == 0) ||
  337. (prev_state == 2 && state == 3)) {
  338. change = 1;
  339. } else if ((prev_state == 2 && state == 0) ||
  340. (prev_state == 1 && state == 3)) {
  341. change = 3;
  342. } else {
  343. change = 0;
  344. }
  345. /* Write change */
  346. data[byte] = (data[byte] & ~((u8)3 << bit)) |
  347. (change << bit);
  348. /* Remember state */
  349. drvdata->re_state = state;
  350. }
  351. /* If need to, and can, transform the touch ring reports */
  352. if (frame->touch_byte > 0 && frame->touch_byte < size) {
  353. __s8 value = data[frame->touch_byte];
  354. if (value != 0) {
  355. if (frame->touch_flip_at != 0) {
  356. value = frame->touch_flip_at - value;
  357. if (value <= 0)
  358. value = frame->touch_max + value;
  359. }
  360. data[frame->touch_byte] = value - 1;
  361. }
  362. }
  363. /* If need to, and can, transform the bitmap dial reports */
  364. if (frame->bitmap_dial_byte > 0 && frame->bitmap_dial_byte < size) {
  365. if (data[frame->bitmap_dial_byte] == 2)
  366. data[frame->bitmap_dial_byte] = -1;
  367. }
  368. return 0;
  369. }
  370. static int uclogic_raw_event(struct hid_device *hdev,
  371. struct hid_report *report,
  372. u8 *data, int size)
  373. {
  374. unsigned int report_id = report->id;
  375. struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
  376. struct uclogic_params *params = &drvdata->params;
  377. struct uclogic_params_pen_subreport *subreport;
  378. struct uclogic_params_pen_subreport *subreport_list_end;
  379. size_t i;
  380. /* Do not handle anything but input reports */
  381. if (report->type != HID_INPUT_REPORT)
  382. return 0;
  383. if (uclogic_exec_event_hook(params, data, size))
  384. return 0;
  385. while (true) {
  386. /* Tweak pen reports, if necessary */
  387. if ((report_id == params->pen.id) && (size >= 2)) {
  388. subreport_list_end =
  389. params->pen.subreport_list +
  390. ARRAY_SIZE(params->pen.subreport_list);
  391. /* Try to match a subreport */
  392. for (subreport = params->pen.subreport_list;
  393. subreport < subreport_list_end; subreport++) {
  394. if (subreport->value != 0 &&
  395. subreport->value == data[1]) {
  396. break;
  397. }
  398. }
  399. /* If a subreport matched */
  400. if (subreport < subreport_list_end) {
  401. /* Change to subreport ID, and restart */
  402. report_id = data[0] = subreport->id;
  403. continue;
  404. } else {
  405. return uclogic_raw_event_pen(drvdata, data, size);
  406. }
  407. }
  408. /* Tweak frame control reports, if necessary */
  409. for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) {
  410. if (report_id == params->frame_list[i].id) {
  411. return uclogic_raw_event_frame(
  412. drvdata, &params->frame_list[i],
  413. data, size);
  414. }
  415. }
  416. break;
  417. }
  418. return 0;
  419. }
  420. static void uclogic_remove(struct hid_device *hdev)
  421. {
  422. struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
  423. del_timer_sync(&drvdata->inrange_timer);
  424. hid_hw_stop(hdev);
  425. kfree(drvdata->desc_ptr);
  426. uclogic_params_cleanup(&drvdata->params);
  427. }
  428. static const struct hid_device_id uclogic_devices[] = {
  429. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  430. USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
  431. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  432. USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
  433. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  434. USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
  435. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  436. USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) },
  437. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  438. USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
  439. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  440. USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) },
  441. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  442. USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) },
  443. { HID_USB_DEVICE(USB_VENDOR_ID_HUION,
  444. USB_DEVICE_ID_HUION_TABLET) },
  445. { HID_USB_DEVICE(USB_VENDOR_ID_HUION,
  446. USB_DEVICE_ID_HUION_TABLET2) },
  447. { HID_USB_DEVICE(USB_VENDOR_ID_TRUST,
  448. USB_DEVICE_ID_TRUST_PANORA_TABLET) },
  449. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  450. USB_DEVICE_ID_HUION_TABLET) },
  451. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  452. USB_DEVICE_ID_YIYNOVA_TABLET) },
  453. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  454. USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_81) },
  455. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  456. USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_45) },
  457. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  458. USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_47) },
  459. { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
  460. USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) },
  461. { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER,
  462. USB_DEVICE_ID_UGTIZER_TABLET_GP0610) },
  463. { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER,
  464. USB_DEVICE_ID_UGTIZER_TABLET_GT5040) },
  465. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  466. USB_DEVICE_ID_UGEE_PARBLO_A610_PRO) },
  467. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  468. USB_DEVICE_ID_UGEE_TABLET_G5) },
  469. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  470. USB_DEVICE_ID_UGEE_TABLET_EX07S) },
  471. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  472. USB_DEVICE_ID_UGEE_TABLET_RAINBOW_CV720) },
  473. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  474. USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540) },
  475. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  476. USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640) },
  477. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  478. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01) },
  479. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  480. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2) },
  481. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  482. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) },
  483. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  484. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_MW),
  485. .driver_data = UCLOGIC_MOUSE_FRAME_QUIRK | UCLOGIC_BATTERY_QUIRK },
  486. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  487. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S) },
  488. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  489. USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_SW),
  490. .driver_data = UCLOGIC_MOUSE_FRAME_QUIRK | UCLOGIC_BATTERY_QUIRK },
  491. { HID_USB_DEVICE(USB_VENDOR_ID_UGEE,
  492. USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06) },
  493. { }
  494. };
  495. MODULE_DEVICE_TABLE(hid, uclogic_devices);
  496. static struct hid_driver uclogic_driver = {
  497. .name = "uclogic",
  498. .id_table = uclogic_devices,
  499. .probe = uclogic_probe,
  500. .remove = uclogic_remove,
  501. .report_fixup = uclogic_report_fixup,
  502. .raw_event = uclogic_raw_event,
  503. .input_mapping = uclogic_input_mapping,
  504. .input_configured = uclogic_input_configured,
  505. #ifdef CONFIG_PM
  506. .resume = uclogic_resume,
  507. .reset_resume = uclogic_resume,
  508. #endif
  509. };
  510. module_hid_driver(uclogic_driver);
  511. MODULE_AUTHOR("Martin Rusko");
  512. MODULE_AUTHOR("Nikolai Kondrashov");
  513. MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID standard");
  514. MODULE_LICENSE("GPL");
  515. MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID standard");
  516. #ifdef CONFIG_HID_KUNIT_TEST
  517. #include "hid-uclogic-core-test.c"
  518. #endif