Lines Matching refs:buf
248 unsigned char *buf, int size) in ds_recv_status_nodump() argument
256 dev->ep[EP_STATUS]), buf, size, &count, 1000); in ds_recv_status_nodump()
264 memcpy(st, buf, sizeof(*st)); in ds_recv_status_nodump()
269 static inline void ds_print_msg(unsigned char *buf, unsigned char *str, int off) in ds_print_msg() argument
271 pr_info("%45s: %8x\n", str, buf[off]); in ds_print_msg()
274 static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count) in ds_dump_status() argument
280 pr_info("%02x ", buf[i]); in ds_dump_status()
284 ds_print_msg(buf, "enable flag", 0); in ds_dump_status()
285 ds_print_msg(buf, "1-wire speed", 1); in ds_dump_status()
286 ds_print_msg(buf, "strong pullup duration", 2); in ds_dump_status()
287 ds_print_msg(buf, "programming pulse duration", 3); in ds_dump_status()
288 ds_print_msg(buf, "pulldown slew rate control", 4); in ds_dump_status()
289 ds_print_msg(buf, "write-1 low time", 5); in ds_dump_status()
290 ds_print_msg(buf, "data sample offset/write-0 recovery time", in ds_dump_status()
292 ds_print_msg(buf, "reserved (test register)", 7); in ds_dump_status()
293 ds_print_msg(buf, "device status flags", 8); in ds_dump_status()
294 ds_print_msg(buf, "communication command byte 1", 9); in ds_dump_status()
295 ds_print_msg(buf, "communication command byte 2", 10); in ds_dump_status()
296 ds_print_msg(buf, "communication command buffer status", 11); in ds_dump_status()
297 ds_print_msg(buf, "1-wire data output buffer status", 12); in ds_dump_status()
298 ds_print_msg(buf, "1-wire data input buffer status", 13); in ds_dump_status()
299 ds_print_msg(buf, "reserved", 14); in ds_dump_status()
300 ds_print_msg(buf, "reserved", 15); in ds_dump_status()
303 if (buf[i] == RR_DETECT) { in ds_dump_status()
304 ds_print_msg(buf, "new device detect", i); in ds_dump_status()
307 ds_print_msg(buf, "Result Register Value: ", i); in ds_dump_status()
308 if (buf[i] & RR_NRS) in ds_dump_status()
310 if (buf[i] & RR_SH) in ds_dump_status()
312 if (buf[i] & RR_APP) in ds_dump_status()
314 if (buf[i] & RR_VPP) in ds_dump_status()
316 if (buf[i] & RR_CMP) in ds_dump_status()
318 if (buf[i] & RR_CRC) in ds_dump_status()
320 if (buf[i] & RR_RDP) in ds_dump_status()
322 if (buf[i] & RR_EOS) in ds_dump_status()
344 static int ds_recv_data(struct ds_device *dev, unsigned char *buf, int size) in ds_recv_data() argument
360 buf, size, &count, 1000); in ds_recv_data()
362 u8 buf[ST_SIZE]; in ds_recv_data() local
368 count = ds_recv_status_nodump(dev, &st, buf, sizeof(buf)); in ds_recv_data()
369 ds_dump_status(dev, buf, count); in ds_recv_data()
379 printk("%02x ", buf[i]); in ds_recv_data()
386 static int ds_send_data(struct ds_device *dev, unsigned char *buf, int len) in ds_send_data() argument
391 …err = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, dev->ep[EP_DATA_OUT]), buf, len, &count, … in ds_send_data()
407 u8 buf[ST_SIZE];
416 err = ds_recv_status_nodump(dev, &st, buf, sizeof(buf));
459 u8 buf[ST_SIZE]; in ds_wait_status() local
464 err = ds_recv_status_nodump(dev, st, buf, sizeof(buf)); in ds_wait_status()
470 printk("%02x ", buf[i]); in ds_wait_status()
488 ds_dump_status(dev, buf, err); in ds_wait_status()
649 static int ds_read_block(struct ds_device *dev, u8 *buf, int len) in ds_read_block() argument
657 memset(buf, 0xFF, len); in ds_read_block()
659 err = ds_send_data(dev, buf, len); in ds_read_block()
669 memset(buf, 0x00, len); in ds_read_block()
670 err = ds_recv_data(dev, buf, len); in ds_read_block()
675 static int ds_write_block(struct ds_device *dev, u8 *buf, int len) in ds_write_block() argument
680 err = ds_send_data(dev, buf, len); in ds_write_block()
693 err = ds_recv_data(dev, buf, len); in ds_write_block()
727 u64 buf[2*64/8]; in ds9490r_search() local
761 err = ds_recv_data(dev, (u8 *)buf, sizeof(buf)); in ds9490r_search()
767 callback(master, buf[i]); in ds9490r_search()
771 master->search_id = buf[i]; in ds9490r_search()
824 u8 buf[9];
826 memcpy(buf, &init, 8);
827 buf[8] = BRANCH_MAIN;
829 err = ds_send_data(dev, buf, sizeof(buf));
899 static void ds9490r_write_block(void *data, const u8 *buf, int len) in ds9490r_write_block() argument
903 ds_write_block(dev, (u8 *)buf, len); in ds9490r_write_block()
906 static u8 ds9490r_read_block(void *data, u8 *buf, int len) in ds9490r_read_block() argument
911 err = ds_read_block(dev, buf, len); in ds9490r_read_block()