Lines Matching refs:data
5 * Test transmitting data over a PTY/TTY line discipline and reading from the
7 * data is in flight to try to cause a race between the netdev being deleted
10 * For SLCAN we check stack data is not leaked in the frame padding
16 * 3. Send data on ptmx and read packets from socket
31 * - For SLIP frames we just write the data followed by a delimiter char
65 uint8_t data[CAN_MAX_DLEN] __attribute__((aligned(8)));
135 static ssize_t try_async_write(int fd, const char *data, ssize_t size,
139 ssize_t ret = write(fd, data + off, size - off);
151 static ssize_t try_async_read(int fd, char *data, ssize_t size,
155 ssize_t ret = read(fd, data + off, size - off);
167 static ssize_t retry_async_write(int fd, const char *data, ssize_t size)
171 return TST_RETRY_FUNC(try_async_write(fd, data, size, &done),
175 static ssize_t retry_async_read(int fd, char *data, ssize_t size)
179 return TST_RETRY_FUNC(try_async_read(fd, data, size, &done),
185 char *data;
198 data = tst_alloc(len);
202 memset(data, '_', len - 1);
203 data[len - 1] = 0300;
206 memcpy(data, SLCAN_FRAME, len);
210 ret = retry_async_write(ptmx, data, len);
215 ret = retry_async_write(ptmx, data, len);
224 ret = retry_async_read(ptmx, data, len);
232 if (retry_async_read(ptmx, data, len) < 0)
235 if (retry_async_write(ptmx, data, len) < 0)
280 const char *data, ssize_t len)
289 memcpy(&frm, data, len);
305 tst_res_hexd(TFAIL, data + i,
306 offsetof(struct can_frame, data) - i,
307 "Padding bytes may contain stack data");
311 i = offsetof(struct can_frame, data);
317 } while (data[i++] == '_');
321 while (j < len && j - i < 65 && data[j++] != '_')
325 tst_res_hexd(TFAIL, data + i, j - i,
326 "Corrupt data (max 64 of %ld bytes shown): data[%ld..%ld] = ",
331 tst_res(TINFO, "Will continue test without data checking");
334 static ssize_t try_sync_read(int fd, char *data, ssize_t size)
340 ret = read(fd, data + n, size - n);
354 static ssize_t try_sync_write(int fd, const char *data, ssize_t size)
360 ret = write(fd, data + n, size - n);
377 char *data;
387 data = tst_alloc(plen);
391 TEST(try_sync_read(sk, data, plen));
394 check_data(ldisc, data, plen);
397 TEST(try_sync_read(sk, data, plen));
400 check_data(ldisc, data, plen);
403 TEST(try_sync_write(sk, data, plen));
410 if (try_sync_write(sk, data, plen) < 0)
413 if ((rlen = try_sync_read(sk, data, plen)) < 0)
415 check_data(ldisc, data, rlen);