Lines Matching +full:post +full:- +full:silicon

3  *  BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2000-2001 Qualcomm Incorporated
6 * Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
7 * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
65 int (*post) (int fd, struct uart_t *u, struct termios *ti); member
153 return -errno; in set_speed()
156 return -errno; in set_speed()
159 return -errno; in set_speed()
173 return -1; in read_hci_event()
180 return -1; in read_hci_event()
188 r = read(fd, buf + count, 3 - count); in read_hci_event()
190 return -1; in read_hci_event()
195 if (buf[2] < (size - 3)) in read_hci_event()
198 remain = size - 3; in read_hci_event()
200 while ((count - 3) < remain) { in read_hci_event()
201 r = read(fd, buf + count, remain - (count - 3)); in read_hci_event()
203 return -1; in read_hci_event()
224 switch (u->speed) {
251 u->speed = 57600;
252 fprintf(stderr, "Invalid speed requested, using %d bps instead\n", u->speed);
259 return -1;
280 switch (u->speed) {
289 u->speed = 115200;
296 return -1;
315 return texasalt_init(fd, u->speed, ti);
327 if (res != -1) { in read_check()
329 count -= res; in read_check()
334 return -1; in read_check()
393 if (set_speed(fd, ti, u->speed) < 0) { in bcsp()
395 return -1; in bcsp()
398 ti->c_cflag |= PARENB; in bcsp()
399 ti->c_cflag &= ~(PARODD); in bcsp()
403 return -1; in bcsp()
419 if (read_check(fd, &byte, 1) == -1){ in bcsp()
421 return -1; in bcsp()
426 if ( read_check(fd, &bcsph[0], 1) == -1){ in bcsp()
428 return -1; in bcsp()
432 if ( read_check(fd, &bcsph[1], 3) == -1){ in bcsp()
434 return -1; in bcsp()
442 if (read_check(fd, &bcspp, 4) == -1){ in bcsp()
444 return -1; in bcsp()
449 return -1; in bcsp()
463 if (read_check(fd, &byte, 1) == -1){ in bcsp()
465 return -1; in bcsp()
470 if (read_check(fd, &bcsph[0], 1) == -1){ in bcsp()
472 return -1; in bcsp()
476 if (read_check(fd, &bcsph[1], 3) == -1){ in bcsp()
478 return -1; in bcsp()
487 if (read_check(fd, &bcspp, 4) == -1){ in bcsp()
489 return -1; in bcsp()
502 return -errno; in bcsp()
515 * Jean Tourrilhes <jt@hpl.hp.com> - 14.11.01
519 struct timespec tm = {0, 10000000}; /* 10ms - be generous */
533 * this is more complex but at least it works ;-)
548 cmd[5] = 0x00; /* type = GET-REQ */
549 cmd[6] = 0x00; /* - msB */
551 cmd[8] = 0x00; /* - msB */
553 cmd[10] = (csr_seq >> 8) & 0xFF; /* - msB */
556 cmd[12] = 0x28; /* - msB */
558 cmd[14] = 0x00; /* - msB */
566 return -1;
572 return -1;
575 /* Event code 0xFF is for vendor-specific events, which is
584 sprintf(temp + (i*3), "-%02X", resp[i]);
587 // 04-FF-13-FF-01-00-09-00-00-00-19-28-00-00-73-00-00-00-00-00-00-00
591 fprintf(stderr, "CSR build ID 0x%02X-0x%02X\n",
596 /* -- HCI header */
598 /* -- CSR BCC header -- */
600 cmd[10] = (csr_seq >> 8) & 0xFF; /* - msB */
603 cmd[12] = 0x68; /* - msB */
610 return -1;
616 return -1;
619 /* Event code 0xFF is for vendor-specific events, which is
627 sprintf(temp + (i*3), "-%02X", resp[i]);
632 if (u->speed > 1500000) {
634 u->speed, u->init_speed);
635 u->speed = u->init_speed;
636 } else if (u->speed != 57600 && uart_speed(u->speed) == B57600) {
639 u->speed, u->init_speed);
640 u->speed = u->init_speed;
642 if (u->speed == u->init_speed)
647 cmd[5] = 0x02; /* type = SET-REQ */
648 cmd[6] = 0x00; /* - msB */
650 cmd[10] = (csr_seq >> 8) & 0xFF;/* - msB */
653 divisor = (u->speed*64+7812)/15625;
655 /* No parity, one stop bit -> divisor |= 0x0000; */
657 cmd[16] = (divisor >> 8) & 0xFF; /* - msB */
665 sprintf(temp + (i*3), "-%02X", cmd[i]);
668 // 01-00-FC-13-C2-02-00-09-00-03-00-02-68-00-00-BF-0E-00-00-00-00-00-00
669 // 01-00-FC-13-C2-02-00-09-00-01-00-02-68-00-00-D8-01-00-00-00-00-00-00
676 return -1;
684 * Silicon Wave specific initialization
693 // Silicon Wave set baud rate command
694 // see HCI Vendor Specific Interface from Silicon Wave
709 switch (u->speed) {
723 u->speed = 115200;
731 return -1;
758 return -1;
771 perror("Can't write Silicon Wave reset cmd.");
772 return -1;
777 // now the uart baud rate on the silicon wave module is set and effective.
782 // data, error handling. BTW: all param access in Silicon Wave is done this way.
803 switch (u->speed) {
830 u->speed = 115200;
837 return -1;
859 if (set_speed(fd, ti, u->speed) < 0) {
861 return -1;
871 return -1;
880 str2ba(u->bdaddr, &bdaddr);
888 str2ba(u->bdaddr, &bdaddr);
913 return -1;
919 return -1;
922 if (u->bdaddr != NULL) {
930 str2ba(u->bdaddr, (bdaddr_t *) (cmd + 4));
935 return -1;
941 return -1;
957 return -1;
963 return -1;
978 return -1;
984 return -1;
994 switch (u->speed) {
1023 return -1;
1028 return -1;
1038 …uart with init speed:%d, final_speed:%d, type:HCI UART %s\n", u->init_speed, u->speed, (u->proto =… in realtek_init()
1039 return rtk_init(fd, u->proto, u->speed, ti); in realtek_init()
1044 fprintf(stderr, "Realtek Bluetooth post process\n"); in realtek_post()
1045 return rtk_post(fd, u->proto, ti); in realtek_post()
1066 /* Silicon Wave kits */
1109 /* Sitecom CN-504 PCMCIA Card */
1164 return -1; in init_uart()
1171 return -1; in init_uart()
1177 if (u->flags & FLOW_CTL) in init_uart()
1184 return -1; in init_uart()
1188 if (set_speed(fd, &ti, u->init_speed) < 0) { in init_uart()
1190 return -1; in init_uart()
1200 if (u->init && u->init(fd, u, &ti) < 0) in init_uart()
1201 return -1; in init_uart()
1206 if (set_speed(fd, &ti, u->speed) < 0) { in init_uart()
1208 return -1; in init_uart()
1215 return -1; in init_uart()
1220 return -1; in init_uart()
1223 if (ioctl(fd, HCIUARTSETPROTO, u->proto) < 0) { in init_uart()
1225 return -1; in init_uart()
1228 if (u->post && u->post(fd, u, &ti) < 0) in init_uart()
1229 return -1; in init_uart()
1236 printf("hciattach - HCI UART driver initialization utility\n"); in usage()
1238 …printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] … in usage()
1239 printf("\thciattach -l\n"); in usage()
1283 printf("%-10s0x%04x,0x%04x\n", uart[i].type, in main()
1298 n = argc - optind; in main()
1334 u->speed = atoi(argv[optind]); in main()
1339 u->flags |= FLOW_CTL; in main()
1341 u->flags &= ~FLOW_CTL; in main()
1346 u->pm = ENABLE_PM; in main()
1348 u->pm = DISABLE_PM; in main()
1352 u->bdaddr = argv[optind]; in main()
1365 u->init_speed = init_speed; in main()