Lines Matching refs:cmd
65 static void load_hci_ps_hdr(uint8_t *cmd, uint8_t ps_op, int len, int index) in load_hci_ps_hdr() argument
67 hci_command_hdr *ch = (void *)cmd; in load_hci_ps_hdr()
72 cmd += HCI_COMMAND_HDR_SIZE; in load_hci_ps_hdr()
74 cmd[0] = ps_op; in load_hci_ps_hdr()
75 cmd[1] = index; in load_hci_ps_hdr()
76 cmd[2] = index >> 8; in load_hci_ps_hdr()
77 cmd[3] = len; in load_hci_ps_hdr()
86 static int send_hci_cmd_sync(int dev, uint8_t *cmd, int len, uint8_t **event) in send_hci_cmd_sync() argument
97 if (write(dev, (unsigned char *)cmd, len) != len) in send_hci_cmd_sync()
173 uint8_t cmd[HCI_MAX_CMD_SIZE]; in write_ps_cmd() local
178 load_hci_ps_hdr(cmd, opcode, 0, 0x00); in write_ps_cmd()
180 if (write_cmd(fd, cmd, HCI_PS_CMD_HDR_LEN) < 0) in write_ps_cmd()
185 load_hci_ps_hdr(cmd, opcode, PS_RESET_PARAM_LEN, 0x00); in write_ps_cmd()
187 cmd[7] = 0x00; in write_ps_cmd()
188 cmd[PS_RESET_CMD_LEN - 2] = ps_param & PS_ID_MASK; in write_ps_cmd()
189 cmd[PS_RESET_CMD_LEN - 1] = (ps_param >> 8) & PS_ID_MASK; in write_ps_cmd()
191 if (write_cmd(fd, cmd, PS_RESET_CMD_LEN) < 0) in write_ps_cmd()
197 load_hci_ps_hdr(cmd, opcode, ps_list[i].len, in write_ps_cmd()
200 memcpy(&cmd[HCI_PS_CMD_HDR_LEN], ps_list[i].data, in write_ps_cmd()
203 if (write_cmd(fd, cmd, ps_list[i].len + in write_ps_cmd()
470 uint8_t cmd[20]; in set_patch_ram() local
474 uint8_t *loc_ptr = &cmd[7]; in set_patch_ram()
481 load_hci_ps_hdr(cmd, SET_PATCH_RAM_ID, ADDRESS_LEN, 0); in set_patch_ram()
490 err = send_hci_cmd_sync(dev, cmd, SET_PATCH_RAM_CMD_SIZE, &event); in set_patch_ram()
531 uint8_t cmd[HCI_MAX_CMD_SIZE]; in ps_patch_download() local
546 load_hci_ps_hdr(cmd, WRITE_PATCH, patch.len, patch_count); in ps_patch_download()
547 memcpy(&cmd[HCI_PS_CMD_HDR_LEN], patch.data, patch.len); in ps_patch_download()
549 if (write_cmd(fd, cmd, patch.len + HCI_PS_CMD_HDR_LEN) < 0) in ps_patch_download()
612 uint8_t cmd[7]; in get_ath3k_crc() local
616 load_hci_ps_hdr(cmd, VERIFY_CRC, 0, PS_REGION | PATCH_REGION); in get_ath3k_crc()
618 err = send_hci_cmd_sync(dev, cmd, sizeof(cmd), &event); in get_ath3k_crc()
635 uint8_t cmd[8]; in get_device_type() local
639 uint8_t *ptr = cmd; in get_device_type()
640 hci_command_hdr *ch = (void *)cmd; in get_device_type()
653 err = send_hci_cmd_sync(dev, cmd, sizeof(cmd), &event); in get_device_type()
678 uint8_t cmd[3]; in read_ath3k_version() local
682 hci_command_hdr *ch = (void *)cmd; in read_ath3k_version()
688 err = send_hci_cmd_sync(pConfig, cmd, sizeof(cmd), &event); in read_ath3k_version()
743 uint8_t cmd[13]; in write_bdaddr() local
744 uint8_t *ptr = cmd; in write_bdaddr()
745 hci_command_hdr *ch = (void *)cmd; in write_bdaddr()
747 memset(cmd, 0, sizeof(cmd)); in write_bdaddr()
761 err = send_hci_cmd_sync(pConfig, cmd, sizeof(cmd), &event); in write_bdaddr()
924 unsigned char cmd[MAX_CMD_LEN], rsp[HCI_MAX_EVENT_SIZE]; in set_cntrlr_baud() local
925 unsigned char *ptr = cmd + 1; in set_cntrlr_baud()
928 cmd[0] = HCI_COMMAND_PKT; in set_cntrlr_baud()
931 ptr = cmd + 1; in set_cntrlr_baud()
941 if (write(fd, cmd, WRITE_BAUD_CMD_LEN) != WRITE_BAUD_CMD_LEN) { in set_cntrlr_baud()
964 unsigned char cmd[MAX_CMD_LEN], rsp[HCI_MAX_EVENT_SIZE]; in ath3k_init() local
965 unsigned char *ptr = cmd + 1; in ath3k_init()
968 cmd[0] = HCI_COMMAND_PKT; in ath3k_init()
1002 if (write(fd, cmd, WRITE_BDADDR_CMD_LEN) != in ath3k_init()
1017 cmd[1] = 0x03; in ath3k_init()
1018 cmd[2] = 0x0C; in ath3k_init()
1019 cmd[3] = 0x00; in ath3k_init()
1021 r = write(fd, cmd, 4); in ath3k_init()