Lines Matching refs:buf
202 static void dump_buffer(u8 *buf, uint32_t count) in dump_buffer() argument
209 pr_info("%2x ", *(buf + i)); in dump_buffer()
311 u8 *buf, u32 count) in handle_pci_cfg_write() argument
321 mdev_state->vconfig[0x3c] = buf[0]; in handle_pci_cfg_write()
341 cfg_addr = *(u32 *)buf; in handle_pci_cfg_write()
365 u16 offset, u8 *buf, u32 count) in handle_bar_write() argument
367 u8 data = *buf; in handle_bar_write()
533 u16 offset, u8 *buf, u32 count) in handle_bar_read() argument
540 *buf = (u8)mdev_state->s[index].divisor; in handle_bar_read()
548 *buf = mdev_state->s[index].rxtx.fifo[ in handle_bar_read()
573 *buf = (u8)(mdev_state->s[index].divisor >> 8); in handle_bar_read()
576 *buf = mdev_state->s[index].uart_reg[offset] & 0x0f; in handle_bar_read()
582 *buf = 0; in handle_bar_read()
587 *buf |= UART_IIR_RLSI; in handle_bar_read()
593 *buf |= UART_IIR_RDI; in handle_bar_read()
599 *buf |= UART_IIR_THRI; in handle_bar_read()
605 *buf |= UART_IIR_MSI; in handle_bar_read()
608 if (*buf == 0) in handle_bar_read()
609 *buf = UART_IIR_NO_INT; in handle_bar_read()
612 *buf |= 0xC0; in handle_bar_read()
619 *buf = mdev_state->s[index].uart_reg[offset]; in handle_bar_read()
642 *buf = lsr; in handle_bar_read()
646 *buf = UART_MSR_DSR | UART_MSR_DDSR | UART_MSR_DCD; in handle_bar_read()
654 *buf |= UART_MSR_CTS | UART_MSR_DCTS; in handle_bar_read()
656 *buf |= UART_MSR_CTS | UART_MSR_DCTS; in handle_bar_read()
662 *buf = mdev_state->s[index].uart_reg[offset]; in handle_bar_read()
707 static ssize_t mdev_access(struct mdev_state *mdev_state, u8 *buf, size_t count, in mdev_access() argument
714 if (!buf) in mdev_access()
729 dump_buffer(buf, count); in mdev_access()
730 handle_pci_cfg_write(mdev_state, offset, buf, count); in mdev_access()
732 memcpy(buf, (mdev_state->vconfig + offset), count); in mdev_access()
733 dump_buffer(buf, count); in mdev_access()
743 dump_buffer(buf, count); in mdev_access()
748 *buf, mdev_state->s[index].dlab); in mdev_access()
750 handle_bar_write(index, mdev_state, offset, buf, count); in mdev_access()
752 handle_bar_read(index, mdev_state, offset, buf, count); in mdev_access()
753 dump_buffer(buf, count); in mdev_access()
758 *buf, mdev_state->s[index].dlab); in mdev_access()
884 static ssize_t mtty_save_read(struct file *filp, char __user *buf, in mtty_save_read() argument
911 if (copy_to_user(buf, (void *)&migf->data + *pos, len)) { in mtty_save_read()
1020 static ssize_t mtty_resume_write(struct file *filp, const char __user *buf, in mtty_resume_write() argument
1047 if (copy_from_user((void *)&migf->data + *pos, buf, len)) { in mtty_resume_write()
1417 static ssize_t mtty_read(struct vfio_device *vdev, char __user *buf, in mtty_read() argument
1436 if (copy_to_user(buf, &val, sizeof(val))) in mtty_read()
1448 if (copy_to_user(buf, &val, sizeof(val))) in mtty_read()
1460 if (copy_to_user(buf, &val, sizeof(val))) in mtty_read()
1469 buf += filled; in mtty_read()
1478 static ssize_t mtty_write(struct vfio_device *vdev, const char __user *buf, in mtty_write() argument
1492 if (copy_from_user(&val, buf, sizeof(val))) in mtty_write()
1504 if (copy_from_user(&val, buf, sizeof(val))) in mtty_write()
1516 if (copy_from_user(&val, buf, sizeof(val))) in mtty_write()
1529 buf += filled; in mtty_write()
1906 char *buf) in sample_mdev_dev_show() argument
1908 return sprintf(buf, "This is MDEV %s\n", dev_name(dev)); in sample_mdev_dev_show()