hci_h5.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. /*
  2. *
  3. * Bluetooth HCI Three-wire UART driver
  4. *
  5. * Copyright (C) 2012 Intel Corporation
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #include <linux/kernel.h>
  24. #include <linux/errno.h>
  25. #include <linux/skbuff.h>
  26. #include <net/bluetooth/bluetooth.h>
  27. #include <net/bluetooth/hci_core.h>
  28. #include "hci_uart.h"
  29. #define HCI_3WIRE_ACK_PKT 0
  30. #define HCI_3WIRE_LINK_PKT 15
  31. #define H5_TXWINSIZE 4
  32. #define H5_ACK_TIMEOUT msecs_to_jiffies(250)
  33. #define H5_SYNC_TIMEOUT msecs_to_jiffies(100)
  34. /*
  35. * Maximum Three-wire packet:
  36. * 4 byte header + max value for 12-bit length + 2 bytes for CRC
  37. */
  38. #define H5_MAX_LEN (4 + 0xfff + 2)
  39. /* Convenience macros for reading Three-wire header values */
  40. #define H5_HDR_SEQ(hdr) ((hdr)[0] & 0x07)
  41. #define H5_HDR_ACK(hdr) (((hdr)[0] >> 3) & 0x07)
  42. #define H5_HDR_CRC(hdr) (((hdr)[0] >> 6) & 0x01)
  43. #define H5_HDR_RELIABLE(hdr) (((hdr)[0] >> 7) & 0x01)
  44. #define H5_HDR_PKT_TYPE(hdr) ((hdr)[1] & 0x0f)
  45. #define H5_HDR_LEN(hdr) ((((hdr)[1] >> 4) & 0xff) + ((hdr)[2] << 4))
  46. #define SLIP_DELIMITER 0xc0
  47. #define SLIP_ESC 0xdb
  48. #define SLIP_ESC_DELIM 0xdc
  49. #define SLIP_ESC_ESC 0xdd
  50. struct h5 {
  51. struct sk_buff_head unack; /* Unack'ed packets queue */
  52. struct sk_buff_head rel; /* Reliable packets queue */
  53. struct sk_buff_head unrel; /* Unreliable packets queue */
  54. struct sk_buff *rx_skb; /* Receive buffer */
  55. size_t rx_pending; /* Expecting more bytes */
  56. bool rx_esc; /* SLIP escape mode */
  57. u8 rx_ack; /* Last ack number received */
  58. int (*rx_func) (struct hci_uart *hu, u8 c);
  59. struct timer_list timer; /* Retransmission timer */
  60. bool tx_ack_req; /* Pending ack to send */
  61. u8 tx_seq; /* Next seq number to send */
  62. u8 tx_ack; /* Next ack number to send */
  63. bool sleeping;
  64. };
  65. static void h5_reset_rx(struct h5 *h5);
  66. static void h5_timed_event(unsigned long arg)
  67. {
  68. struct hci_uart *hu = (struct hci_uart *) arg;
  69. struct h5 *h5 = hu->priv;
  70. struct sk_buff *skb;
  71. unsigned long flags;
  72. BT_DBG("hu %p retransmitting %u pkts", hu, h5->unack.qlen);
  73. spin_lock_irqsave_nested(&h5->unack.lock, flags, SINGLE_DEPTH_NESTING);
  74. while ((skb = __skb_dequeue_tail(&h5->unack)) != NULL) {
  75. h5->tx_seq = (h5->tx_seq - 1) & 0x07;
  76. skb_queue_head(&h5->rel, skb);
  77. }
  78. spin_unlock_irqrestore(&h5->unack.lock, flags);
  79. hci_uart_tx_wakeup(hu);
  80. }
  81. static void h5_link_control(struct hci_uart *hu, const void *data, size_t len)
  82. {
  83. struct h5 *h5 = hu->priv;
  84. struct sk_buff *nskb;
  85. nskb = alloc_skb(3, GFP_ATOMIC);
  86. if (!nskb)
  87. return;
  88. bt_cb(nskb)->pkt_type = HCI_3WIRE_LINK_PKT;
  89. memcpy(skb_put(nskb, len), data, len);
  90. skb_queue_tail(&h5->unrel, nskb);
  91. }
  92. static int h5_open(struct hci_uart *hu)
  93. {
  94. struct h5 *h5;
  95. const unsigned char sync[] = { 0x01, 0x7e };
  96. BT_DBG("hu %p", hu);
  97. h5 = kzalloc(sizeof(*h5), GFP_KERNEL);
  98. if (!h5)
  99. return -ENOMEM;
  100. hu->priv = h5;
  101. skb_queue_head_init(&h5->unack);
  102. skb_queue_head_init(&h5->rel);
  103. skb_queue_head_init(&h5->unrel);
  104. h5_reset_rx(h5);
  105. init_timer(&h5->timer);
  106. h5->timer.function = h5_timed_event;
  107. h5->timer.data = (unsigned long) hu;
  108. set_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags);
  109. /* Send initial sync request */
  110. h5_link_control(hu, sync, sizeof(sync));
  111. mod_timer(&h5->timer, jiffies + H5_SYNC_TIMEOUT);
  112. return 0;
  113. }
  114. static int h5_close(struct hci_uart *hu)
  115. {
  116. struct h5 *h5 = hu->priv;
  117. skb_queue_purge(&h5->unack);
  118. skb_queue_purge(&h5->rel);
  119. skb_queue_purge(&h5->unrel);
  120. del_timer(&h5->timer);
  121. kfree(h5);
  122. return 0;
  123. }
  124. static void h5_pkt_cull(struct h5 *h5)
  125. {
  126. struct sk_buff *skb, *tmp;
  127. unsigned long flags;
  128. int i, to_remove;
  129. u8 seq;
  130. spin_lock_irqsave(&h5->unack.lock, flags);
  131. to_remove = skb_queue_len(&h5->unack);
  132. if (to_remove == 0)
  133. goto unlock;
  134. seq = h5->tx_seq;
  135. while (to_remove > 0) {
  136. if (h5->rx_ack == seq)
  137. break;
  138. to_remove--;
  139. seq = (seq - 1) % 8;
  140. }
  141. if (seq != h5->rx_ack)
  142. BT_ERR("Controller acked invalid packet");
  143. i = 0;
  144. skb_queue_walk_safe(&h5->unack, skb, tmp) {
  145. if (i++ >= to_remove)
  146. break;
  147. __skb_unlink(skb, &h5->unack);
  148. kfree_skb(skb);
  149. }
  150. if (skb_queue_empty(&h5->unack))
  151. del_timer(&h5->timer);
  152. unlock:
  153. spin_unlock_irqrestore(&h5->unack.lock, flags);
  154. }
  155. static void h5_handle_internal_rx(struct hci_uart *hu)
  156. {
  157. struct h5 *h5 = hu->priv;
  158. const unsigned char sync_req[] = { 0x01, 0x7e };
  159. const unsigned char sync_rsp[] = { 0x02, 0x7d };
  160. const unsigned char conf_req[] = { 0x03, 0xfc, 0x01 };
  161. const unsigned char conf_rsp[] = { 0x04, 0x7b, 0x01 };
  162. const unsigned char wakeup_req[] = { 0x05, 0xfa };
  163. const unsigned char woken_req[] = { 0x06, 0xf9 };
  164. const unsigned char sleep_req[] = { 0x07, 0x78 };
  165. const unsigned char *hdr = h5->rx_skb->data;
  166. const unsigned char *data = &h5->rx_skb->data[4];
  167. BT_DBG("%s", hu->hdev->name);
  168. if (H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT)
  169. return;
  170. if (H5_HDR_LEN(hdr) < 2)
  171. return;
  172. if (memcmp(data, sync_req, 2) == 0) {
  173. h5_link_control(hu, sync_rsp, 2);
  174. } else if (memcmp(data, sync_rsp, 2) == 0) {
  175. h5_link_control(hu, conf_req, 3);
  176. } else if (memcmp(data, conf_req, 2) == 0) {
  177. h5_link_control(hu, conf_rsp, 2);
  178. h5_link_control(hu, conf_req, 3);
  179. } else if (memcmp(data, conf_rsp, 2) == 0) {
  180. BT_DBG("Three-wire init sequence complete");
  181. hci_uart_init_ready(hu);
  182. return;
  183. } else if (memcmp(data, sleep_req, 2) == 0) {
  184. BT_DBG("Peer went to sleep");
  185. h5->sleeping = true;
  186. h5_link_control(hu, wakeup_req, 2);
  187. } else if (memcmp(data, woken_req, 2) == 0) {
  188. BT_DBG("Peer woke up");
  189. h5->sleeping = false;
  190. return;
  191. } else {
  192. BT_DBG("Link Control: 0x%02hhx 0x%02hhx", data[0], data[1]);
  193. return;
  194. }
  195. hci_uart_tx_wakeup(hu);
  196. }
  197. static void h5_complete_rx_pkt(struct hci_uart *hu)
  198. {
  199. struct h5 *h5 = hu->priv;
  200. const unsigned char *hdr = h5->rx_skb->data;
  201. if (H5_HDR_RELIABLE(hdr)) {
  202. h5->tx_ack = (h5->tx_ack + 1) % 8;
  203. h5->tx_ack_req = true;
  204. hci_uart_tx_wakeup(hu);
  205. }
  206. h5->rx_ack = H5_HDR_ACK(hdr);
  207. h5_pkt_cull(h5);
  208. switch (H5_HDR_PKT_TYPE(hdr)) {
  209. case HCI_EVENT_PKT:
  210. case HCI_ACLDATA_PKT:
  211. case HCI_SCODATA_PKT:
  212. bt_cb(h5->rx_skb)->pkt_type = H5_HDR_PKT_TYPE(hdr);
  213. /* Remove Three-wire header */
  214. skb_pull(h5->rx_skb, 4);
  215. hci_recv_frame(h5->rx_skb);
  216. h5->rx_skb = NULL;
  217. break;
  218. default:
  219. h5_handle_internal_rx(hu);
  220. break;
  221. }
  222. h5_reset_rx(h5);
  223. }
  224. static int h5_rx_crc(struct hci_uart *hu, unsigned char c)
  225. {
  226. struct h5 *h5 = hu->priv;
  227. h5_complete_rx_pkt(hu);
  228. h5_reset_rx(h5);
  229. return 0;
  230. }
  231. static int h5_rx_payload(struct hci_uart *hu, unsigned char c)
  232. {
  233. struct h5 *h5 = hu->priv;
  234. const unsigned char *hdr = h5->rx_skb->data;
  235. if (H5_HDR_CRC(hdr)) {
  236. h5->rx_func = h5_rx_crc;
  237. h5->rx_pending = 2;
  238. } else {
  239. h5_complete_rx_pkt(hu);
  240. h5_reset_rx(h5);
  241. }
  242. return 0;
  243. }
  244. static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c)
  245. {
  246. struct h5 *h5 = hu->priv;
  247. const unsigned char *hdr = h5->rx_skb->data;
  248. BT_DBG("%s rx: seq %u ack %u crc %u rel %u type %u len %u",
  249. hu->hdev->name, H5_HDR_SEQ(hdr), H5_HDR_ACK(hdr),
  250. H5_HDR_CRC(hdr), H5_HDR_RELIABLE(hdr), H5_HDR_PKT_TYPE(hdr),
  251. H5_HDR_LEN(hdr));
  252. if (((hdr[0] + hdr[1] + hdr[2] + hdr[3]) & 0xff) != 0xff) {
  253. BT_ERR("Invalid header checksum");
  254. h5_reset_rx(h5);
  255. return 0;
  256. }
  257. if (H5_HDR_RELIABLE(hdr) && H5_HDR_SEQ(hdr) != h5->tx_ack) {
  258. BT_ERR("Out-of-order packet arrived (%u != %u)",
  259. H5_HDR_SEQ(hdr), h5->tx_ack);
  260. h5_reset_rx(h5);
  261. return 0;
  262. }
  263. h5->rx_func = h5_rx_payload;
  264. h5->rx_pending = H5_HDR_LEN(hdr);
  265. return 0;
  266. }
  267. static int h5_rx_pkt_start(struct hci_uart *hu, unsigned char c)
  268. {
  269. struct h5 *h5 = hu->priv;
  270. if (c == SLIP_DELIMITER)
  271. return 1;
  272. h5->rx_func = h5_rx_3wire_hdr;
  273. h5->rx_pending = 4;
  274. h5->rx_skb = bt_skb_alloc(H5_MAX_LEN, GFP_ATOMIC);
  275. if (!h5->rx_skb) {
  276. BT_ERR("Can't allocate mem for new packet");
  277. h5_reset_rx(h5);
  278. return -ENOMEM;
  279. }
  280. h5->rx_skb->dev = (void *) hu->hdev;
  281. return 0;
  282. }
  283. static int h5_rx_delimiter(struct hci_uart *hu, unsigned char c)
  284. {
  285. struct h5 *h5 = hu->priv;
  286. if (c == SLIP_DELIMITER)
  287. h5->rx_func = h5_rx_pkt_start;
  288. return 1;
  289. }
  290. static void h5_unslip_one_byte(struct h5 *h5, unsigned char c)
  291. {
  292. const u8 delim = SLIP_DELIMITER, esc = SLIP_ESC;
  293. const u8 *byte = &c;
  294. if (!h5->rx_esc && c == SLIP_ESC) {
  295. h5->rx_esc = true;
  296. return;
  297. }
  298. if (h5->rx_esc) {
  299. switch (c) {
  300. case SLIP_ESC_DELIM:
  301. byte = &delim;
  302. break;
  303. case SLIP_ESC_ESC:
  304. byte = &esc;
  305. break;
  306. default:
  307. BT_ERR("Invalid esc byte 0x%02hhx", c);
  308. h5_reset_rx(h5);
  309. return;
  310. }
  311. h5->rx_esc = false;
  312. }
  313. memcpy(skb_put(h5->rx_skb, 1), byte, 1);
  314. h5->rx_pending--;
  315. BT_DBG("unsliped 0x%02hhx, rx_pending %zu", *byte, h5->rx_pending);
  316. }
  317. static void h5_reset_rx(struct h5 *h5)
  318. {
  319. if (h5->rx_skb) {
  320. kfree_skb(h5->rx_skb);
  321. h5->rx_skb = NULL;
  322. }
  323. h5->rx_func = h5_rx_delimiter;
  324. h5->rx_pending = 0;
  325. h5->rx_esc = false;
  326. }
  327. static int h5_recv(struct hci_uart *hu, void *data, int count)
  328. {
  329. struct h5 *h5 = hu->priv;
  330. unsigned char *ptr = data;
  331. BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending,
  332. count);
  333. while (count > 0) {
  334. int processed;
  335. if (h5->rx_pending > 0) {
  336. if (*ptr == SLIP_DELIMITER) {
  337. BT_ERR("Too short H5 packet");
  338. h5_reset_rx(h5);
  339. continue;
  340. }
  341. h5_unslip_one_byte(h5, *ptr);
  342. ptr++; count--;
  343. continue;
  344. }
  345. processed = h5->rx_func(hu, *ptr);
  346. if (processed < 0)
  347. return processed;
  348. ptr += processed;
  349. count -= processed;
  350. }
  351. return 0;
  352. }
  353. static int h5_enqueue(struct hci_uart *hu, struct sk_buff *skb)
  354. {
  355. struct h5 *h5 = hu->priv;
  356. if (skb->len > 0xfff) {
  357. BT_ERR("Packet too long (%u bytes)", skb->len);
  358. kfree_skb(skb);
  359. return 0;
  360. }
  361. switch (bt_cb(skb)->pkt_type) {
  362. case HCI_ACLDATA_PKT:
  363. case HCI_COMMAND_PKT:
  364. skb_queue_tail(&h5->rel, skb);
  365. break;
  366. case HCI_SCODATA_PKT:
  367. skb_queue_tail(&h5->unrel, skb);
  368. break;
  369. default:
  370. BT_ERR("Unknown packet type %u", bt_cb(skb)->pkt_type);
  371. kfree_skb(skb);
  372. break;
  373. }
  374. return 0;
  375. }
  376. static void h5_slip_delim(struct sk_buff *skb)
  377. {
  378. const char delim = SLIP_DELIMITER;
  379. memcpy(skb_put(skb, 1), &delim, 1);
  380. }
  381. static void h5_slip_one_byte(struct sk_buff *skb, u8 c)
  382. {
  383. const char esc_delim[2] = { SLIP_ESC, SLIP_ESC_DELIM };
  384. const char esc_esc[2] = { SLIP_ESC, SLIP_ESC_ESC };
  385. switch (c) {
  386. case SLIP_DELIMITER:
  387. memcpy(skb_put(skb, 2), &esc_delim, 2);
  388. break;
  389. case SLIP_ESC:
  390. memcpy(skb_put(skb, 2), &esc_esc, 2);
  391. break;
  392. default:
  393. memcpy(skb_put(skb, 1), &c, 1);
  394. }
  395. }
  396. static struct sk_buff *h5_build_pkt(struct hci_uart *hu, bool rel, u8 pkt_type,
  397. const u8 *data, size_t len)
  398. {
  399. struct h5 *h5 = hu->priv;
  400. struct sk_buff *nskb;
  401. u8 hdr[4];
  402. int i;
  403. /*
  404. * Max len of packet: (original len + 4 (H5 hdr) + 2 (crc)) * 2
  405. * (because bytes 0xc0 and 0xdb are escaped, worst case is when
  406. * the packet is all made of 0xc0 and 0xdb) + 2 (0xc0
  407. * delimiters at start and end).
  408. */
  409. nskb = alloc_skb((len + 6) * 2 + 2, GFP_ATOMIC);
  410. if (!nskb)
  411. return NULL;
  412. bt_cb(nskb)->pkt_type = pkt_type;
  413. h5_slip_delim(nskb);
  414. hdr[0] = h5->tx_ack << 3;
  415. h5->tx_ack_req = false;
  416. if (rel) {
  417. hdr[0] |= 1 << 7;
  418. hdr[0] |= h5->tx_seq;
  419. h5->tx_seq = (h5->tx_seq + 1) % 8;
  420. }
  421. hdr[1] = pkt_type | ((len & 0x0f) << 4);
  422. hdr[2] = len >> 4;
  423. hdr[3] = ~((hdr[0] + hdr[1] + hdr[2]) & 0xff);
  424. BT_DBG("%s tx: seq %u ack %u crc %u rel %u type %u len %u",
  425. hu->hdev->name, H5_HDR_SEQ(hdr), H5_HDR_ACK(hdr),
  426. H5_HDR_CRC(hdr), H5_HDR_RELIABLE(hdr), H5_HDR_PKT_TYPE(hdr),
  427. H5_HDR_LEN(hdr));
  428. for (i = 0; i < 4; i++)
  429. h5_slip_one_byte(nskb, hdr[i]);
  430. for (i = 0; i < len; i++)
  431. h5_slip_one_byte(nskb, data[i]);
  432. h5_slip_delim(nskb);
  433. return nskb;
  434. }
  435. static struct sk_buff *h5_prepare_pkt(struct hci_uart *hu, u8 pkt_type,
  436. const u8 *data, size_t len)
  437. {
  438. bool rel;
  439. switch (pkt_type) {
  440. case HCI_ACLDATA_PKT:
  441. case HCI_COMMAND_PKT:
  442. rel = true;
  443. break;
  444. case HCI_SCODATA_PKT:
  445. case HCI_3WIRE_LINK_PKT:
  446. case HCI_3WIRE_ACK_PKT:
  447. rel = false;
  448. break;
  449. default:
  450. BT_ERR("Unknown packet type %u", pkt_type);
  451. return NULL;
  452. }
  453. return h5_build_pkt(hu, rel, pkt_type, data, len);
  454. }
  455. static struct sk_buff *h5_dequeue(struct hci_uart *hu)
  456. {
  457. struct h5 *h5 = hu->priv;
  458. unsigned long flags;
  459. struct sk_buff *skb, *nskb;
  460. if ((skb = skb_dequeue(&h5->unrel)) != NULL) {
  461. nskb = h5_prepare_pkt(hu, bt_cb(skb)->pkt_type,
  462. skb->data, skb->len);
  463. if (nskb) {
  464. kfree_skb(skb);
  465. return nskb;
  466. }
  467. skb_queue_head(&h5->unrel, skb);
  468. BT_ERR("Could not dequeue pkt because alloc_skb failed");
  469. }
  470. spin_lock_irqsave_nested(&h5->unack.lock, flags, SINGLE_DEPTH_NESTING);
  471. if (h5->unack.qlen >= H5_TXWINSIZE)
  472. goto unlock;
  473. if ((skb = skb_dequeue(&h5->rel)) != NULL) {
  474. nskb = h5_prepare_pkt(hu, bt_cb(skb)->pkt_type,
  475. skb->data, skb->len);
  476. if (nskb) {
  477. __skb_queue_tail(&h5->unack, skb);
  478. mod_timer(&h5->timer, jiffies + H5_ACK_TIMEOUT);
  479. spin_unlock_irqrestore(&h5->unack.lock, flags);
  480. return nskb;
  481. }
  482. skb_queue_head(&h5->rel, skb);
  483. BT_ERR("Could not dequeue pkt because alloc_skb failed");
  484. }
  485. unlock:
  486. spin_unlock_irqrestore(&h5->unack.lock, flags);
  487. if (h5->tx_ack_req)
  488. return h5_prepare_pkt(hu, HCI_3WIRE_ACK_PKT, NULL, 0);
  489. return NULL;
  490. }
  491. static int h5_flush(struct hci_uart *hu)
  492. {
  493. BT_DBG("hu %p", hu);
  494. return 0;
  495. }
  496. static struct hci_uart_proto h5p = {
  497. .id = HCI_UART_3WIRE,
  498. .open = h5_open,
  499. .close = h5_close,
  500. .recv = h5_recv,
  501. .enqueue = h5_enqueue,
  502. .dequeue = h5_dequeue,
  503. .flush = h5_flush,
  504. };
  505. int __init h5_init(void)
  506. {
  507. int err = hci_uart_register_proto(&h5p);
  508. if (!err)
  509. BT_INFO("HCI Three-wire UART (H5) protocol initialized");
  510. else
  511. BT_ERR("HCI Three-wire UART (H5) protocol init failed");
  512. return err;
  513. }
  514. int __exit h5_deinit(void)
  515. {
  516. return hci_uart_unregister_proto(&h5p);
  517. }