Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 427) sorted by relevance

12345678910>>...18

/device/google/contexthub/contexthubhal/
Dsystem_comms.cpp53 static void readAppName(MessageBuf &buf, hub_app_name_t &name) in readAppName() argument
55 name.id = buf.readU64(); in readAppName()
58 static void writeAppName(MessageBuf &buf, const hub_app_name_t &name) in writeAppName() argument
60 buf.writeU64(name.id); in writeAppName()
63 static void readNanohubMemInfo(MessageBuf &buf, NanohubMemInfo &mi) in readNanohubMemInfo() argument
84 while (buf.getRoom() >= 2) { in readNanohubMemInfo()
85 type = buf.readU8(); in readNanohubMemInfo()
86 len = buf.readU8(); in readNanohubMemInfo()
87 if (buf.getRoom() >= len) { in readNanohubMemInfo()
91 ramFree = buf.readU32(); in readNanohubMemInfo()
[all …]
/device/linaro/poplar/wifi/wpa_supplicant_8_lib/
Ddriver_cmd_wext.c72 char buf[WEXT_CSCAN_BUF_LEN]; in wpa_driver_wext_combo_scan() local
87 os_memcpy(buf, WEXT_CSCAN_HEADER, bp); in wpa_driver_wext_combo_scan()
89 if ((bp + IW_ESSID_MAX_SIZE + 10) >= (int)sizeof(buf)) in wpa_driver_wext_combo_scan()
92 buf[bp++] = WEXT_CSCAN_SSID_SECTION; in wpa_driver_wext_combo_scan()
93 buf[bp++] = params->ssids[i].ssid_len; in wpa_driver_wext_combo_scan()
94 os_memcpy(&buf[bp], params->ssids[i].ssid, params->ssids[i].ssid_len); in wpa_driver_wext_combo_scan()
99 buf[bp++] = WEXT_CSCAN_CHANNEL_SECTION; in wpa_driver_wext_combo_scan()
100 buf[bp++] = 0; in wpa_driver_wext_combo_scan()
103 buf[bp++] = WEXT_CSCAN_PASV_DWELL_SECTION; in wpa_driver_wext_combo_scan()
104 buf[bp++] = (u8)WEXT_CSCAN_PASV_DWELL_TIME; in wpa_driver_wext_combo_scan()
[all …]
Ddriver_cmd_nl80211.c60 int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, in wpa_driver_nl80211_driver_cmd() argument
97 ret = os_snprintf(buf, buf_len, in wpa_driver_nl80211_driver_cmd()
100 os_memcpy(buf, cmd, strlen(cmd) + 1); in wpa_driver_nl80211_driver_cmd()
104 priv_cmd.bufaddr = buf; in wpa_driver_nl80211_driver_cmd()
119 ret = strlen(buf); in wpa_driver_nl80211_driver_cmd()
121 wpa_printf(MSG_DEBUG, "%s %s len = %d, %zu", __func__, buf, ret, strlen(buf)); in wpa_driver_nl80211_driver_cmd()
129 char buf[MAX_DRV_CMD_SIZE]; in wpa_driver_set_p2p_noa() local
131 memset(buf, 0, sizeof(buf)); in wpa_driver_set_p2p_noa()
133 snprintf(buf, sizeof(buf), "P2P_SET_NOA %d %d %d", count, start, duration); in wpa_driver_set_p2p_noa()
134 return wpa_driver_nl80211_driver_cmd(priv, buf, buf, strlen(buf)+1); in wpa_driver_set_p2p_noa()
[all …]
/device/linaro/dragonboard/shared/utils/tqftpserv/
Dtqftpserv.c79 char *buf; in tftp_send_data() local
82 buf = malloc(4 + client->blksize); in tftp_send_data()
83 p = buf; in tftp_send_data()
95 free(buf); in tftp_send_data()
102 len = send(client->sock, buf, p - buf, 0); in tftp_send_data()
104 free(buf); in tftp_send_data()
123 char buf[512]; in tftp_send_oack() local
124 char *p = buf; in tftp_send_oack()
175 return send(sock, buf, p - buf, 0); in tftp_send_oack()
181 char *buf; in tftp_send_error() local
[all …]
/device/generic/opengl-transport/host/commands/emugen/tests/t.001/expected/encoder/
Dfoo_enc.cpp31 unsigned char *buf; in fooAlphaFunc_enc() local
35 buf = stream->alloc(totalSize); in fooAlphaFunc_enc()
36 ptr = buf; in fooAlphaFunc_enc()
43 if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf); in fooAlphaFunc_enc()
58 unsigned char *buf; in fooIsBuffer_enc() local
62 buf = stream->alloc(totalSize); in fooIsBuffer_enc()
63 ptr = buf; in fooIsBuffer_enc()
70 if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf); in fooIsBuffer_enc()
99 unsigned char *buf; in fooDoEncoderFlush_enc() local
103 buf = stream->alloc(totalSize); in fooDoEncoderFlush_enc()
[all …]
/device/linaro/hikey/power/
Dpower_hikey.c108 char buf[80]; in sysfs_write() local
113 strerror_r(errno, buf, sizeof(buf)); in sysfs_write()
114 ALOGE("Error opening %s: %s\n", path, buf); in sysfs_write()
120 strerror_r(errno, buf, sizeof(buf)); in sysfs_write()
121 ALOGE("Error writing to %s: %s\n", path, buf); in sysfs_write()
190 char buf[80]; in interactive_boostpulse() local
198 strerror_r(errno, buf, sizeof(buf)); in interactive_boostpulse()
200 buf); in interactive_boostpulse()
208 strerror_r(errno, buf, sizeof(buf)); in interactive_boostpulse()
210 INTERACTIVE_BOOSTPULSE_PATH, buf); in interactive_boostpulse()
[all …]
/device/google/cuttlefish/common/libs/fs/
Dshared_buf.cc33 ssize_t WriteAll(SharedFD fd, const char* buf, size_t size) { in WriteAll() argument
37 written = fd->Write((void*)&(buf[total_written]), size - total_written); in WriteAll()
50 ssize_t ReadExact(SharedFD fd, char* buf, size_t size) { in ReadExact() argument
54 read = fd->Read((void*)&(buf[total_read]), size - total_read); in ReadExact()
67 ssize_t ReadAll(SharedFD fd, std::string* buf) { in ReadAll() argument
79 *buf = ss.str(); in ReadAll()
80 return buf->size(); in ReadAll()
83 ssize_t ReadExact(SharedFD fd, std::string* buf) { in ReadExact() argument
84 return ReadExact(fd, buf->data(), buf->size()); in ReadExact()
87 ssize_t ReadExact(SharedFD fd, std::vector<char>* buf) { in ReadExact() argument
[all …]
/device/google/contexthub/util/nanoapp_sign/
Dnanoapp_sign.c47 static int getHexEncodedByte(uint8_t *buf, uint32_t *ppos, uint32_t size) in getHexEncodedByte() argument
59 c = buf[pos++]; in getHexEncodedByte()
194 uint8_t *buf = *pbuf; in handleConvertKey() local
203 c = getHexEncodedByte(buf, &pos, bufUsed); in handleConvertKey()
211 buf[i] = c; in handleConvertKey()
215 uint32_t *be32Buf = (uint32_t*)buf; in handleConvertKey()
229 uint8_t *buf = *pbuf; in handleVerify() local
234 struct ImageHeader *image = (struct ImageHeader *)buf; in handleVerify()
262 sha2processBytes(&shaState, buf, bufUsed - sigData); in handleVerify()
264 sigPack = buf + bufUsed - sigData; in handleVerify()
[all …]
/device/google/coral/json-c/
Dprintbuf.c41 if(!(p->buf = (char*)malloc(p->size))) { in printbuf_new()
73 if(!(t = (char*)realloc(p->buf, new_size))) in printbuf_extend()
76 p->buf = t; in printbuf_extend()
80 int printbuf_memappend(struct printbuf *p, const char *buf, int size) in printbuf_memappend() argument
86 memcpy(p->buf + p->bpos, buf, size); in printbuf_memappend()
88 p->buf[p->bpos]= '\0'; in printbuf_memappend()
105 memset(pb->buf + offset, charvalue, len); in printbuf_memset()
120 static int vasprintf(char **buf, const char *fmt, va_list ap) in vasprintf() argument
128 if(!buf) { return -1; } in vasprintf()
146 *buf = b; in vasprintf()
[all …]
Djson_util.c71 char buf[JSON_FILE_BUF_SIZE]; in json_object_from_file() local
84 while((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) { in json_object_from_file()
85 printbuf_memappend(pb, buf, ret); in json_object_from_file()
94 obj = json_tokener_parse(pb->buf); in json_object_from_file()
148 int json_parse_double(const char *buf, double *retval) in json_parse_double() argument
150 return (sscanf(buf, "%lf", retval)==1 ? 0 : 1); in json_parse_double()
179 int json_parse_int64(const char *buf, int64_t *retval) in json_parse_int64() argument
193 while (isspace((int)*buf) && *buf) in json_parse_int64()
194 buf++; in json_parse_int64()
197 if (sscanf(buf, "%" SCNd64, &num64) != 1) in json_parse_int64()
[all …]
/device/google/redbull/json-c/
Dprintbuf.c41 if(!(p->buf = (char*)malloc(p->size))) { in printbuf_new()
73 if(!(t = (char*)realloc(p->buf, new_size))) in printbuf_extend()
76 p->buf = t; in printbuf_extend()
80 int printbuf_memappend(struct printbuf *p, const char *buf, int size) in printbuf_memappend() argument
86 memcpy(p->buf + p->bpos, buf, size); in printbuf_memappend()
88 p->buf[p->bpos]= '\0'; in printbuf_memappend()
105 memset(pb->buf + offset, charvalue, len); in printbuf_memset()
120 static int vasprintf(char **buf, const char *fmt, va_list ap) in vasprintf() argument
128 if(!buf) { return -1; } in vasprintf()
146 *buf = b; in vasprintf()
[all …]
Djson_util.c71 char buf[JSON_FILE_BUF_SIZE]; in json_object_from_file() local
84 while((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) { in json_object_from_file()
85 printbuf_memappend(pb, buf, ret); in json_object_from_file()
94 obj = json_tokener_parse(pb->buf); in json_object_from_file()
148 int json_parse_double(const char *buf, double *retval) in json_parse_double() argument
150 return (sscanf(buf, "%lf", retval)==1 ? 0 : 1); in json_parse_double()
179 int json_parse_int64(const char *buf, int64_t *retval) in json_parse_int64() argument
193 while (isspace((int)*buf) && *buf) in json_parse_int64()
194 buf++; in json_parse_int64()
197 if (sscanf(buf, "%" SCNd64, &num64) != 1) in json_parse_int64()
[all …]
/device/google/sunfish/json-c/
Dprintbuf.c41 if(!(p->buf = (char*)malloc(p->size))) { in printbuf_new()
73 if(!(t = (char*)realloc(p->buf, new_size))) in printbuf_extend()
76 p->buf = t; in printbuf_extend()
80 int printbuf_memappend(struct printbuf *p, const char *buf, int size) in printbuf_memappend() argument
86 memcpy(p->buf + p->bpos, buf, size); in printbuf_memappend()
88 p->buf[p->bpos]= '\0'; in printbuf_memappend()
105 memset(pb->buf + offset, charvalue, len); in printbuf_memset()
120 static int vasprintf(char **buf, const char *fmt, va_list ap) in vasprintf() argument
128 if(!buf) { return -1; } in vasprintf()
146 *buf = b; in vasprintf()
[all …]
Djson_util.c71 char buf[JSON_FILE_BUF_SIZE]; in json_object_from_file() local
84 while((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) { in json_object_from_file()
85 printbuf_memappend(pb, buf, ret); in json_object_from_file()
94 obj = json_tokener_parse(pb->buf); in json_object_from_file()
148 int json_parse_double(const char *buf, double *retval) in json_parse_double() argument
150 return (sscanf(buf, "%lf", retval)==1 ? 0 : 1); in json_parse_double()
179 int json_parse_int64(const char *buf, int64_t *retval) in json_parse_int64() argument
193 while (isspace((int)*buf) && *buf) in json_parse_int64()
194 buf++; in json_parse_int64()
197 if (sscanf(buf, "%" SCNd64, &num64) != 1) in json_parse_int64()
[all …]
/device/google/cuttlefish/host/commands/secure_env/
Dencrypted_serializable.cpp183 uint8_t* buf, const uint8_t* end) const { in Serialize() argument
189 return buf; in Serialize()
195 return buf; in Serialize()
204 return buf; in Serialize()
215 return buf; in Serialize()
222 return buf; in Serialize()
227 buf = serialize_public.Serialize(buf, end); in Serialize()
228 buf = serialize_private.Serialize(buf, end); in Serialize()
229 buf = keymaster::append_uint32_to_buf(buf, end, BLOCK_SIZE); in Serialize()
230 buf = keymaster::append_uint32_to_buf(buf, end, iv.size); in Serialize()
[all …]
Dhmac_serializable.cpp43 uint8_t* HmacSerializable::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument
45 buf = keymaster::append_uint32_to_buf(buf, end, wrapped_size); in Serialize()
46 auto signed_data = buf; in Serialize()
47 buf = wrapped_->Serialize(buf, end); in Serialize()
48 if (buf - signed_data != wrapped_size) { in Serialize()
50 return buf; in Serialize()
55 return buf; in Serialize()
59 return buf; in Serialize()
66 return buf; in Serialize()
71 return buf; in Serialize()
[all …]
Djson_serializable.cpp37 uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const override;
52 uint8_t* JsonSerializable::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument
55 if (end - buf < serialized.size() + sizeof(uint32_t)) { in Serialize()
57 return buf; in Serialize()
60 buf, end, serialized.data(), serialized.size()); in Serialize()
101 uint8_t* buf = data.data(); in WriteProtectedJsonToFile() local
102 uint8_t* buf_end = buf + data.size(); in WriteProtectedJsonToFile()
103 buf = sign_check.Serialize(buf, buf_end); in WriteProtectedJsonToFile()
104 if (buf != (buf_end - 1)) { in WriteProtectedJsonToFile()
149 auto buf = reinterpret_cast<const uint8_t*>(buffer.data()); in ReadProtectedJsonFromFile() local
[all …]
/device/generic/goldfish/sensors/
Dmultihal_sensors_qemu.cpp116 char buf[256]; in parseQemuSensorEventLocked() local
117 const int len = m_sensorsTransport->Receive(buf, sizeof(buf) - 1); in parseQemuSensorEventLocked()
122 buf[len] = 0; in parseQemuSensorEventLocked()
123 const char* end = buf + len; in parseQemuSensorEventLocked()
129 if (const char* values = testPrefix(buf, end, "acceleration", ':')) { in parseQemuSensorEventLocked()
139 } else if (const char* values = testPrefix(buf, end, "acceleration-uncalibrated", ':')) { in parseQemuSensorEventLocked()
152 } else if (const char* values = testPrefix(buf, end, "gyroscope", ':')) { in parseQemuSensorEventLocked()
162 } else if (const char* values = testPrefix(buf, end, "gyroscope-uncalibrated", ':')) { in parseQemuSensorEventLocked()
179 } else if (const char* values = testPrefix(buf, end, "orientation", ':')) { in parseQemuSensorEventLocked()
189 } else if (const char* values = testPrefix(buf, end, "magnetic", ':')) { in parseQemuSensorEventLocked()
[all …]
/device/linaro/dragonboard/shared/utils/rmtfs/
Dqmi_tlv.c19 void *buf; member
40 tlv->buf = tlv->allocated; in qmi_tlv_init()
42 pkt = tlv->buf; in qmi_tlv_init()
51 struct qmi_tlv *qmi_tlv_decode(void *buf, size_t len, unsigned *txn, unsigned msg_type) in qmi_tlv_decode() argument
53 struct qmi_packet *pkt = buf; in qmi_tlv_decode()
62 tlv->buf = buf; in qmi_tlv_decode()
79 pkt = tlv->buf; in qmi_tlv_encode()
83 return tlv->buf; in qmi_tlv_encode()
99 pkt = tlv->buf; in qmi_tlv_get_item()
169 memcpy(newp, tlv->buf, tlv->size); in qmi_tlv_alloc_item()
[all …]
/device/google/cuttlefish/host/frontend/webrtc/
Ddisplay_handler.cpp80 auto buf = std::make_shared<CvdVideoFrameBuffer>(frame_width, frame_height); in DisplayHandler() local
83 libyuv::ARGBToI420(frame_pixels, frame_stride_bytes, buf->DataY(), in DisplayHandler()
84 buf->StrideY(), buf->DataU(), buf->StrideU(), in DisplayHandler()
85 buf->DataV(), buf->StrideV(), frame_width, in DisplayHandler()
89 libyuv::ABGRToI420(frame_pixels, frame_stride_bytes, buf->DataY(), in DisplayHandler()
90 buf->StrideY(), buf->DataU(), buf->StrideU(), in DisplayHandler()
91 buf->DataV(), buf->StrideV(), frame_width, in DisplayHandler()
101 std::static_pointer_cast<webrtc_streaming::VideoFrameBuffer>(buf); in DisplayHandler()
/device/google/cuttlefish/host/commands/tcp_connector/
Dmain.cpp52 void DumpPackets(const char* prefix, char* buf, int size) { in DumpPackets() argument
63 sprintf(bytes_string + (i * 5), "0x%02x ", buf[i]); in DumpPackets()
97 char buf[FLAGS_buffer_size]; in main() local
98 auto read = fifo_in->Read(buf, sizeof(buf)); in main()
104 DumpPackets("Read from FIFO", buf, read); in main()
105 while (cuttlefish::WriteAll(sock, buf, read) == -1) { in main()
117 char buf[FLAGS_buffer_size]; in main() local
118 auto read = sock->Read(buf, sizeof(buf)); in main()
119 DumpPackets("Read from socket", buf, read); in main()
128 auto wrote = cuttlefish::WriteAll(fifo_out, buf, read); in main()
/device/generic/goldfish/MultiDisplayProvider/jni/
Dcom_android_emulator_multidisplay.cpp48 static void fillMsg(std::vector<uint8_t>& buf, uint8_t cmd, uint8_t* data, uint32_t size) { in fillMsg() argument
52 buf.insert(buf.end(), p, p + 4); in fillMsg()
53 buf.push_back(cmd); in fillMsg()
55 buf.insert(buf.end(), data, data + size); in fillMsg()
74 std::vector<uint8_t> buf; in onFrameAvailable() local
75 fillMsg(buf, BIND, (uint8_t*)data, sizeof(data)); in onFrameAvailable()
76 qemu_pipe_write_fully(gFd, buf.data(), buf.size()); in onFrameAvailable()
114 std::vector<uint8_t> buf; in nativeOpen() local
115 fillMsg(buf, QUERY, nullptr, 0); in nativeOpen()
116 qemu_pipe_write_fully(gFd, buf.data(), buf.size()); in nativeOpen()
/device/google/contexthub/util/nanoapp_postprocess/
Dpostprocess_elf.c229 static int finalizeAndWrite(uint8_t *buf, uint32_t bufUsed, uint32_t bufSz, FILE *out, uint32_t lay… in finalizeAndWrite() argument
234 struct BinHdr *bin = (struct BinHdr *) buf; in finalizeAndWrite()
259 memmove(buf + dataOffset, buf + sizeof(*bin), bufUsed - sizeof(*bin)); in finalizeAndWrite()
261 memcpy(buf, &outHeader, sizeof(outHeader)); in finalizeAndWrite()
262 memcpy(buf + sizeof(outHeader), &app, sizeof(app)); in finalizeAndWrite()
284 ret = fwrite(buf, bufUsed, 1, out) == 1 ? 0 : 2; in finalizeAndWrite()
302 uint8_t *buf = *pbuf; in handleApp() local
306 buf = reallocOrDie(buf, bufSz); in handleApp()
307 *pbuf = buf; in handleApp()
310 bin = (struct BinHdr*)buf; in handleApp()
[all …]
/device/google/contexthub/firmware/os/core/
Dprintf.c40 char buf[64]; in StrPrvPrintfEx_number() local
41 uint32_t idx = sizeof(buf) - 1; in StrPrvPrintfEx_number()
48 if (data->fieldWidth > sizeof(buf) - 1) in StrPrvPrintfEx_number()
49 data->fieldWidth = sizeof(buf) - 1; in StrPrvPrintfEx_number()
51 if (data->precision > sizeof(buf) - 1) in StrPrvPrintfEx_number()
52 data->precision = sizeof(buf) - 1; in StrPrvPrintfEx_number()
55 buf[idx--] = 0; //terminate in StrPrvPrintfEx_number()
85 buf[idx--] = chr; in StrPrvPrintfEx_number()
94 buf[idx--] = '0'; in StrPrvPrintfEx_number()
102 if (buf[idx+1] != '0') { in StrPrvPrintfEx_number()
[all …]
/device/google/cuttlefish/guest/commands/bt_vhci_forwarder/
Dmain.cpp60 ssize_t forward(int from_fd, int to_fd, unsigned char* buf) { in forward() argument
61 ssize_t count = TEMP_FAILURE_RETRY(read(from_fd, buf, kBufferSize)); in forward()
71 if (buf[0] == HCI_VENDOR_PKT) { in forward()
75 count = TEMP_FAILURE_RETRY(write(to_fd, buf, count)); in forward()
78 << std::setfill('0') << (unsigned)buf[0]; in forward()
116 unsigned char buf[kBufferSize]; in main() local
157 ssize_t bytes = TEMP_FAILURE_RETRY(read(virtio_fd, buf, kBufferSize)); in main()
164 << "0x" << std::hex << (unsigned)buf[0]; in main()
167 << "0x" << std::hex << (unsigned)buf[0] << " .. 0x" in main()
168 << std::hex << (unsigned)buf[bytes - 1]; in main()
[all …]

12345678910>>...18