mdev_state        156 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state;
mdev_state        203 samples/vfio-mdev/mbochs.c static struct page *__mbochs_get_page(struct mdev_state *mdev_state,
mdev_state        205 samples/vfio-mdev/mbochs.c static struct page *mbochs_get_page(struct mdev_state *mdev_state,
mdev_state        218 samples/vfio-mdev/mbochs.c static void mbochs_create_config_space(struct mdev_state *mdev_state)
mdev_state        220 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_VENDOR_ID],
mdev_state        222 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_DEVICE_ID],
mdev_state        224 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_SUBSYSTEM_VENDOR_ID],
mdev_state        226 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_SUBSYSTEM_ID],
mdev_state        229 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_COMMAND],
mdev_state        231 samples/vfio-mdev/mbochs.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_CLASS_DEVICE],
mdev_state        233 samples/vfio-mdev/mbochs.c 	mdev_state->vconfig[PCI_CLASS_REVISION] =  0x01;
mdev_state        235 samples/vfio-mdev/mbochs.c 	STORE_LE32((u32 *) &mdev_state->vconfig[PCI_BASE_ADDRESS_0],
mdev_state        239 samples/vfio-mdev/mbochs.c 	mdev_state->bar_mask[0] = ~(mdev_state->memsize) + 1;
mdev_state        241 samples/vfio-mdev/mbochs.c 	STORE_LE32((u32 *) &mdev_state->vconfig[PCI_BASE_ADDRESS_2],
mdev_state        244 samples/vfio-mdev/mbochs.c 	mdev_state->bar_mask[2] = ~(MBOCHS_MMIO_BAR_SIZE) + 1;
mdev_state        247 samples/vfio-mdev/mbochs.c static int mbochs_check_framebuffer(struct mdev_state *mdev_state,
mdev_state        250 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        251 samples/vfio-mdev/mbochs.c 	u16 *vbe = mdev_state->vbe;
mdev_state        254 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        286 samples/vfio-mdev/mbochs.c 	if (mode->offset + mode->size > mdev_state->memsize) {
mdev_state        305 samples/vfio-mdev/mbochs.c static void handle_pci_cfg_write(struct mdev_state *mdev_state, u16 offset,
mdev_state        308 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        318 samples/vfio-mdev/mbochs.c 			cfg_addr = (cfg_addr & mdev_state->bar_mask[index]);
mdev_state        326 samples/vfio-mdev/mbochs.c 		cfg_addr |= (mdev_state->vconfig[offset] &
mdev_state        328 samples/vfio-mdev/mbochs.c 		STORE_LE32(&mdev_state->vconfig[offset], cfg_addr);
mdev_state        333 samples/vfio-mdev/mbochs.c static void handle_mmio_write(struct mdev_state *mdev_state, u16 offset,
mdev_state        336 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        348 samples/vfio-mdev/mbochs.c 		if (index < ARRAY_SIZE(mdev_state->vbe))
mdev_state        349 samples/vfio-mdev/mbochs.c 			mdev_state->vbe[index] = reg16;
mdev_state        363 samples/vfio-mdev/mbochs.c static void handle_mmio_read(struct mdev_state *mdev_state, u16 offset,
mdev_state        366 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        373 samples/vfio-mdev/mbochs.c 		edid = &mdev_state->edid_regs;
mdev_state        379 samples/vfio-mdev/mbochs.c 		memcpy(buf, mdev_state->edid_blob + offset, count);
mdev_state        385 samples/vfio-mdev/mbochs.c 		if (index < ARRAY_SIZE(mdev_state->vbe))
mdev_state        386 samples/vfio-mdev/mbochs.c 			reg16 = mdev_state->vbe[index];
mdev_state        400 samples/vfio-mdev/mbochs.c static void handle_edid_regs(struct mdev_state *mdev_state, u16 offset,
mdev_state        403 samples/vfio-mdev/mbochs.c 	char *regs = (void *)&mdev_state->edid_regs;
mdev_state        405 samples/vfio-mdev/mbochs.c 	if (offset + count > sizeof(mdev_state->edid_regs))
mdev_state        427 samples/vfio-mdev/mbochs.c static void handle_edid_blob(struct mdev_state *mdev_state, u16 offset,
mdev_state        430 samples/vfio-mdev/mbochs.c 	if (offset + count > mdev_state->edid_regs.edid_max_size)
mdev_state        433 samples/vfio-mdev/mbochs.c 		memcpy(mdev_state->edid_blob + offset, buf, count);
mdev_state        435 samples/vfio-mdev/mbochs.c 		memcpy(buf, mdev_state->edid_blob + offset, count);
mdev_state        441 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        448 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        452 samples/vfio-mdev/mbochs.c 			handle_pci_cfg_write(mdev_state, pos, buf, count);
mdev_state        454 samples/vfio-mdev/mbochs.c 			memcpy(buf, (mdev_state->vconfig + pos), count);
mdev_state        461 samples/vfio-mdev/mbochs.c 			handle_mmio_write(mdev_state, pos, buf, count);
mdev_state        463 samples/vfio-mdev/mbochs.c 			handle_mmio_read(mdev_state, pos, buf, count);
mdev_state        470 samples/vfio-mdev/mbochs.c 			handle_edid_regs(mdev_state, pos, buf, count, is_write);
mdev_state        473 samples/vfio-mdev/mbochs.c 			handle_edid_blob(mdev_state, pos, buf, count, is_write);
mdev_state        478 samples/vfio-mdev/mbochs.c 		   MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) {
mdev_state        481 samples/vfio-mdev/mbochs.c 		pg = __mbochs_get_page(mdev_state, pos >> PAGE_SHIFT);
mdev_state        501 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state        508 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        509 samples/vfio-mdev/mbochs.c 	u32 size64k = mdev_state->memsize / (64 * 1024);
mdev_state        512 samples/vfio-mdev/mbochs.c 	for (i = 0; i < ARRAY_SIZE(mdev_state->vbe); i++)
mdev_state        513 samples/vfio-mdev/mbochs.c 		mdev_state->vbe[i] = 0;
mdev_state        514 samples/vfio-mdev/mbochs.c 	mdev_state->vbe[VBE_DISPI_INDEX_ID] = VBE_DISPI_ID5;
mdev_state        515 samples/vfio-mdev/mbochs.c 	mdev_state->vbe[VBE_DISPI_INDEX_VIDEO_MEMORY_64K] = size64k;
mdev_state        523 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state;
mdev_state        530 samples/vfio-mdev/mbochs.c 	mdev_state = kzalloc(sizeof(struct mdev_state), GFP_KERNEL);
mdev_state        531 samples/vfio-mdev/mbochs.c 	if (mdev_state == NULL)
mdev_state        534 samples/vfio-mdev/mbochs.c 	mdev_state->vconfig = kzalloc(MBOCHS_CONFIG_SPACE_SIZE, GFP_KERNEL);
mdev_state        535 samples/vfio-mdev/mbochs.c 	if (mdev_state->vconfig == NULL)
mdev_state        538 samples/vfio-mdev/mbochs.c 	mdev_state->memsize = type->mbytes * 1024 * 1024;
mdev_state        539 samples/vfio-mdev/mbochs.c 	mdev_state->pagecount = mdev_state->memsize >> PAGE_SHIFT;
mdev_state        540 samples/vfio-mdev/mbochs.c 	mdev_state->pages = kcalloc(mdev_state->pagecount,
mdev_state        543 samples/vfio-mdev/mbochs.c 	if (!mdev_state->pages)
mdev_state        547 samples/vfio-mdev/mbochs.c 		 kobj->name, type->mbytes, mdev_state->pagecount);
mdev_state        549 samples/vfio-mdev/mbochs.c 	mutex_init(&mdev_state->ops_lock);
mdev_state        550 samples/vfio-mdev/mbochs.c 	mdev_state->mdev = mdev;
mdev_state        551 samples/vfio-mdev/mbochs.c 	mdev_set_drvdata(mdev, mdev_state);
mdev_state        552 samples/vfio-mdev/mbochs.c 	INIT_LIST_HEAD(&mdev_state->dmabufs);
mdev_state        553 samples/vfio-mdev/mbochs.c 	mdev_state->next_id = 1;
mdev_state        555 samples/vfio-mdev/mbochs.c 	mdev_state->type = type;
mdev_state        556 samples/vfio-mdev/mbochs.c 	mdev_state->edid_regs.max_xres = type->max_x;
mdev_state        557 samples/vfio-mdev/mbochs.c 	mdev_state->edid_regs.max_yres = type->max_y;
mdev_state        558 samples/vfio-mdev/mbochs.c 	mdev_state->edid_regs.edid_offset = MBOCHS_EDID_BLOB_OFFSET;
mdev_state        559 samples/vfio-mdev/mbochs.c 	mdev_state->edid_regs.edid_max_size = sizeof(mdev_state->edid_blob);
mdev_state        560 samples/vfio-mdev/mbochs.c 	mbochs_create_config_space(mdev_state);
mdev_state        567 samples/vfio-mdev/mbochs.c 	kfree(mdev_state->vconfig);
mdev_state        568 samples/vfio-mdev/mbochs.c 	kfree(mdev_state);
mdev_state        574 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        576 samples/vfio-mdev/mbochs.c 	mbochs_used_mbytes -= mdev_state->type->mbytes;
mdev_state        578 samples/vfio-mdev/mbochs.c 	kfree(mdev_state->pages);
mdev_state        579 samples/vfio-mdev/mbochs.c 	kfree(mdev_state->vconfig);
mdev_state        580 samples/vfio-mdev/mbochs.c 	kfree(mdev_state);
mdev_state        700 samples/vfio-mdev/mbochs.c static struct page *__mbochs_get_page(struct mdev_state *mdev_state,
mdev_state        703 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        705 samples/vfio-mdev/mbochs.c 	if (!mdev_state->pages[pgoff]) {
mdev_state        706 samples/vfio-mdev/mbochs.c 		mdev_state->pages[pgoff] =
mdev_state        708 samples/vfio-mdev/mbochs.c 		if (!mdev_state->pages[pgoff])
mdev_state        712 samples/vfio-mdev/mbochs.c 	get_page(mdev_state->pages[pgoff]);
mdev_state        713 samples/vfio-mdev/mbochs.c 	return mdev_state->pages[pgoff];
mdev_state        716 samples/vfio-mdev/mbochs.c static struct page *mbochs_get_page(struct mdev_state *mdev_state,
mdev_state        721 samples/vfio-mdev/mbochs.c 	if (WARN_ON(pgoff >= mdev_state->pagecount))
mdev_state        724 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        725 samples/vfio-mdev/mbochs.c 	page = __mbochs_get_page(mdev_state, pgoff);
mdev_state        726 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state        731 samples/vfio-mdev/mbochs.c static void mbochs_put_pages(struct mdev_state *mdev_state)
mdev_state        733 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        736 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        738 samples/vfio-mdev/mbochs.c 	for (i = 0; i < mdev_state->pagecount; i++) {
mdev_state        739 samples/vfio-mdev/mbochs.c 		if (!mdev_state->pages[i])
mdev_state        741 samples/vfio-mdev/mbochs.c 		put_page(mdev_state->pages[i]);
mdev_state        742 samples/vfio-mdev/mbochs.c 		mdev_state->pages[i] = NULL;
mdev_state        751 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = vma->vm_private_data;
mdev_state        754 samples/vfio-mdev/mbochs.c 	if (page_offset >= mdev_state->pagecount)
mdev_state        757 samples/vfio-mdev/mbochs.c 	vmf->page = mbochs_get_page(mdev_state, page_offset);
mdev_state        770 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        776 samples/vfio-mdev/mbochs.c 	if (vma->vm_end - vma->vm_start > mdev_state->memsize)
mdev_state        782 samples/vfio-mdev/mbochs.c 	vma->vm_private_data = mdev_state;
mdev_state        806 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(dmabuf->mdev_state->mdev);
mdev_state        821 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(dmabuf->mdev_state->mdev);
mdev_state        838 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(dmabuf->mdev_state->mdev);
mdev_state        867 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(dmabuf->mdev_state->mdev);
mdev_state        878 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = dmabuf->mdev_state;
mdev_state        879 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        887 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        891 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state        917 samples/vfio-mdev/mbochs.c static struct mbochs_dmabuf *mbochs_dmabuf_alloc(struct mdev_state *mdev_state,
mdev_state        923 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        930 samples/vfio-mdev/mbochs.c 	dmabuf->id = mdev_state->next_id++;
mdev_state        939 samples/vfio-mdev/mbochs.c 		dmabuf->pages[pg] = __mbochs_get_page(mdev_state,
mdev_state        945 samples/vfio-mdev/mbochs.c 	dmabuf->mdev_state = mdev_state;
mdev_state        946 samples/vfio-mdev/mbochs.c 	list_add(&dmabuf->next, &mdev_state->dmabufs);
mdev_state        961 samples/vfio-mdev/mbochs.c mbochs_dmabuf_find_by_mode(struct mdev_state *mdev_state,
mdev_state        966 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        968 samples/vfio-mdev/mbochs.c 	list_for_each_entry(dmabuf, &mdev_state->dmabufs, next)
mdev_state        976 samples/vfio-mdev/mbochs.c mbochs_dmabuf_find_by_id(struct mdev_state *mdev_state, u32 id)
mdev_state        980 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state        982 samples/vfio-mdev/mbochs.c 	list_for_each_entry(dmabuf, &mdev_state->dmabufs, next)
mdev_state        991 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = dmabuf->mdev_state;
mdev_state        992 samples/vfio-mdev/mbochs.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        996 samples/vfio-mdev/mbochs.c 	WARN_ON(!mutex_is_locked(&mdev_state->ops_lock));
mdev_state       1024 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state;
mdev_state       1026 samples/vfio-mdev/mbochs.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state       1027 samples/vfio-mdev/mbochs.c 	if (!mdev_state)
mdev_state       1042 samples/vfio-mdev/mbochs.c 		region_info->size   = mdev_state->memsize;
mdev_state       1095 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state       1117 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state       1121 samples/vfio-mdev/mbochs.c 		ret = mbochs_check_framebuffer(mdev_state, &mode);
mdev_state       1132 samples/vfio-mdev/mbochs.c 	dmabuf = mbochs_dmabuf_find_by_mode(mdev_state, &mode);
mdev_state       1134 samples/vfio-mdev/mbochs.c 		mbochs_dmabuf_alloc(mdev_state, &mode);
mdev_state       1136 samples/vfio-mdev/mbochs.c 		mutex_unlock(&mdev_state->ops_lock);
mdev_state       1149 samples/vfio-mdev/mbochs.c 	    mdev_state->active_id != plane->dmabuf_id) {
mdev_state       1151 samples/vfio-mdev/mbochs.c 			mdev_state->active_id, plane->dmabuf_id);
mdev_state       1152 samples/vfio-mdev/mbochs.c 		mdev_state->active_id = plane->dmabuf_id;
mdev_state       1154 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state       1161 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state       1164 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state       1166 samples/vfio-mdev/mbochs.c 	dmabuf = mbochs_dmabuf_find_by_id(mdev_state, id);
mdev_state       1168 samples/vfio-mdev/mbochs.c 		mutex_unlock(&mdev_state->ops_lock);
mdev_state       1175 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state       1311 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state       1314 samples/vfio-mdev/mbochs.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state       1316 samples/vfio-mdev/mbochs.c 	list_for_each_entry_safe(dmabuf, tmp, &mdev_state->dmabufs, next) {
mdev_state       1325 samples/vfio-mdev/mbochs.c 	mbochs_put_pages(mdev_state);
mdev_state       1327 samples/vfio-mdev/mbochs.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state       1336 samples/vfio-mdev/mbochs.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state       1338 samples/vfio-mdev/mbochs.c 	return sprintf(buf, "%d MB\n", mdev_state->type->mbytes);
mdev_state        112 samples/vfio-mdev/mdpy.c static void mdpy_create_config_space(struct mdev_state *mdev_state)
mdev_state        114 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_VENDOR_ID],
mdev_state        116 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_DEVICE_ID],
mdev_state        118 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_SUBSYSTEM_VENDOR_ID],
mdev_state        120 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_SUBSYSTEM_ID],
mdev_state        123 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_COMMAND],
mdev_state        125 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_STATUS],
mdev_state        127 samples/vfio-mdev/mdpy.c 	STORE_LE16((u16 *) &mdev_state->vconfig[PCI_CLASS_DEVICE],
mdev_state        129 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig[PCI_CLASS_REVISION] =  0x01;
mdev_state        131 samples/vfio-mdev/mdpy.c 	STORE_LE32((u32 *) &mdev_state->vconfig[PCI_BASE_ADDRESS_0],
mdev_state        135 samples/vfio-mdev/mdpy.c 	mdev_state->bar_mask = ~(mdev_state->memsize) + 1;
mdev_state        138 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig[PCI_CAPABILITY_LIST]       = MDPY_VENDORCAP_OFFSET;
mdev_state        139 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig[MDPY_VENDORCAP_OFFSET + 0] = 0x09; /* vendor cap */
mdev_state        140 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig[MDPY_VENDORCAP_OFFSET + 1] = 0x00; /* next ptr */
mdev_state        141 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig[MDPY_VENDORCAP_OFFSET + 2] = MDPY_VENDORCAP_SIZE;
mdev_state        142 samples/vfio-mdev/mdpy.c 	STORE_LE32((u32 *) &mdev_state->vconfig[MDPY_FORMAT_OFFSET],
mdev_state        143 samples/vfio-mdev/mdpy.c 		   mdev_state->type->format);
mdev_state        144 samples/vfio-mdev/mdpy.c 	STORE_LE32((u32 *) &mdev_state->vconfig[MDPY_WIDTH_OFFSET],
mdev_state        145 samples/vfio-mdev/mdpy.c 		   mdev_state->type->width);
mdev_state        146 samples/vfio-mdev/mdpy.c 	STORE_LE32((u32 *) &mdev_state->vconfig[MDPY_HEIGHT_OFFSET],
mdev_state        147 samples/vfio-mdev/mdpy.c 		   mdev_state->type->height);
mdev_state        150 samples/vfio-mdev/mdpy.c static void handle_pci_cfg_write(struct mdev_state *mdev_state, u16 offset,
mdev_state        153 samples/vfio-mdev/mdpy.c 	struct device *dev = mdev_dev(mdev_state->mdev);
mdev_state        161 samples/vfio-mdev/mdpy.c 			cfg_addr = (cfg_addr & mdev_state->bar_mask);
mdev_state        168 samples/vfio-mdev/mdpy.c 		cfg_addr |= (mdev_state->vconfig[offset] &
mdev_state        170 samples/vfio-mdev/mdpy.c 		STORE_LE32(&mdev_state->vconfig[offset], cfg_addr);
mdev_state        178 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        182 samples/vfio-mdev/mdpy.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        186 samples/vfio-mdev/mdpy.c 			handle_pci_cfg_write(mdev_state, pos, buf, count);
mdev_state        188 samples/vfio-mdev/mdpy.c 			memcpy(buf, (mdev_state->vconfig + pos), count);
mdev_state        192 samples/vfio-mdev/mdpy.c 		    MDPY_MEMORY_BAR_OFFSET + mdev_state->memsize)) {
mdev_state        195 samples/vfio-mdev/mdpy.c 			memcpy(mdev_state->memblk, buf, count);
mdev_state        197 samples/vfio-mdev/mdpy.c 			memcpy(buf, mdev_state->memblk, count);
mdev_state        210 samples/vfio-mdev/mdpy.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state        217 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        221 samples/vfio-mdev/mdpy.c 	stride = mdev_state->type->width * mdev_state->type->bytepp;
mdev_state        222 samples/vfio-mdev/mdpy.c 	for (i = 0; i < mdev_state->type->height; i++)
mdev_state        223 samples/vfio-mdev/mdpy.c 		memset(mdev_state->memblk + i * stride,
mdev_state        224 samples/vfio-mdev/mdpy.c 		       i * 255 / mdev_state->type->height,
mdev_state        233 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state;
mdev_state        239 samples/vfio-mdev/mdpy.c 	mdev_state = kzalloc(sizeof(struct mdev_state), GFP_KERNEL);
mdev_state        240 samples/vfio-mdev/mdpy.c 	if (mdev_state == NULL)
mdev_state        243 samples/vfio-mdev/mdpy.c 	mdev_state->vconfig = kzalloc(MDPY_CONFIG_SPACE_SIZE, GFP_KERNEL);
mdev_state        244 samples/vfio-mdev/mdpy.c 	if (mdev_state->vconfig == NULL) {
mdev_state        245 samples/vfio-mdev/mdpy.c 		kfree(mdev_state);
mdev_state        253 samples/vfio-mdev/mdpy.c 	mdev_state->memblk = vmalloc_user(fbsize);
mdev_state        254 samples/vfio-mdev/mdpy.c 	if (!mdev_state->memblk) {
mdev_state        255 samples/vfio-mdev/mdpy.c 		kfree(mdev_state->vconfig);
mdev_state        256 samples/vfio-mdev/mdpy.c 		kfree(mdev_state);
mdev_state        262 samples/vfio-mdev/mdpy.c 	mutex_init(&mdev_state->ops_lock);
mdev_state        263 samples/vfio-mdev/mdpy.c 	mdev_state->mdev = mdev;
mdev_state        264 samples/vfio-mdev/mdpy.c 	mdev_set_drvdata(mdev, mdev_state);
mdev_state        266 samples/vfio-mdev/mdpy.c 	mdev_state->type    = type;
mdev_state        267 samples/vfio-mdev/mdpy.c 	mdev_state->memsize = fbsize;
mdev_state        268 samples/vfio-mdev/mdpy.c 	mdpy_create_config_space(mdev_state);
mdev_state        277 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        283 samples/vfio-mdev/mdpy.c 	vfree(mdev_state->memblk);
mdev_state        284 samples/vfio-mdev/mdpy.c 	kfree(mdev_state->vconfig);
mdev_state        285 samples/vfio-mdev/mdpy.c 	kfree(mdev_state);
mdev_state        409 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        415 samples/vfio-mdev/mdpy.c 	if (vma->vm_end - vma->vm_start > mdev_state->memsize)
mdev_state        421 samples/vfio-mdev/mdpy.c 					   mdev_state->memblk, 0,
mdev_state        429 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state;
mdev_state        431 samples/vfio-mdev/mdpy.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state        432 samples/vfio-mdev/mdpy.c 	if (!mdev_state)
mdev_state        449 samples/vfio-mdev/mdpy.c 		region_info->size   = mdev_state->memsize;
mdev_state        482 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        494 samples/vfio-mdev/mdpy.c 	plane->drm_format     = mdev_state->type->format;
mdev_state        495 samples/vfio-mdev/mdpy.c 	plane->width	      = mdev_state->type->width;
mdev_state        496 samples/vfio-mdev/mdpy.c 	plane->height	      = mdev_state->type->height;
mdev_state        497 samples/vfio-mdev/mdpy.c 	plane->stride	      = (mdev_state->type->width *
mdev_state        498 samples/vfio-mdev/mdpy.c 				 mdev_state->type->bytepp);
mdev_state        499 samples/vfio-mdev/mdpy.c 	plane->size	      = mdev_state->memsize;
mdev_state        517 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state;
mdev_state        519 samples/vfio-mdev/mdpy.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state        538 samples/vfio-mdev/mdpy.c 		memcpy(&mdev_state->dev_info, &info, sizeof(info));
mdev_state        580 samples/vfio-mdev/mdpy.c 		    (info.index >= mdev_state->dev_info.num_irqs))
mdev_state        643 samples/vfio-mdev/mdpy.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        646 samples/vfio-mdev/mdpy.c 		       mdev_state->type->width,
mdev_state        647 samples/vfio-mdev/mdpy.c 		       mdev_state->type->height);
mdev_state        155 samples/vfio-mdev/mtty.c static int mtty_trigger_interrupt(struct mdev_state *mdev_state);
mdev_state        173 samples/vfio-mdev/mtty.c static void mtty_create_config_space(struct mdev_state *mdev_state)
mdev_state        176 samples/vfio-mdev/mtty.c 	STORE_LE32((u32 *) &mdev_state->vconfig[0x0], 0x32534348);
mdev_state        179 samples/vfio-mdev/mtty.c 	STORE_LE16((u16 *) &mdev_state->vconfig[0x4], 0x0001);
mdev_state        182 samples/vfio-mdev/mtty.c 	STORE_LE16((u16 *) &mdev_state->vconfig[0x6], 0x0200);
mdev_state        185 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x8] =  0x10;
mdev_state        188 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x9] =  0x02;
mdev_state        191 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0xa] =  0x00;
mdev_state        194 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0xb] =  0x07;
mdev_state        198 samples/vfio-mdev/mtty.c 	STORE_LE32((u32 *) &mdev_state->vconfig[0x10], 0x000001);
mdev_state        199 samples/vfio-mdev/mtty.c 	mdev_state->bar_mask[0] = ~(MTTY_IO_BAR_SIZE) + 1;
mdev_state        201 samples/vfio-mdev/mtty.c 	if (mdev_state->nr_ports == 2) {
mdev_state        203 samples/vfio-mdev/mtty.c 		STORE_LE32((u32 *) &mdev_state->vconfig[0x14], 0x000001);
mdev_state        204 samples/vfio-mdev/mtty.c 		mdev_state->bar_mask[1] = ~(MTTY_IO_BAR_SIZE) + 1;
mdev_state        208 samples/vfio-mdev/mtty.c 	STORE_LE32((u32 *) &mdev_state->vconfig[0x2c], 0x32534348);
mdev_state        210 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x34] =  0x00;   /* Cap Ptr */
mdev_state        211 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x3d] =  0x01;   /* interrupt pin (INTA#) */
mdev_state        214 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x40] =  0x23;
mdev_state        215 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x43] =  0x80;
mdev_state        216 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x44] =  0x23;
mdev_state        217 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x48] =  0x23;
mdev_state        218 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x4c] =  0x23;
mdev_state        220 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x60] =  0x50;
mdev_state        221 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x61] =  0x43;
mdev_state        222 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x62] =  0x49;
mdev_state        223 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x63] =  0x20;
mdev_state        224 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x64] =  0x53;
mdev_state        225 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x65] =  0x65;
mdev_state        226 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x66] =  0x72;
mdev_state        227 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x67] =  0x69;
mdev_state        228 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x68] =  0x61;
mdev_state        229 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x69] =  0x6c;
mdev_state        230 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x6a] =  0x2f;
mdev_state        231 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x6b] =  0x55;
mdev_state        232 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x6c] =  0x41;
mdev_state        233 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x6d] =  0x52;
mdev_state        234 samples/vfio-mdev/mtty.c 	mdev_state->vconfig[0x6e] =  0x54;
mdev_state        237 samples/vfio-mdev/mtty.c static void handle_pci_cfg_write(struct mdev_state *mdev_state, u16 offset,
mdev_state        248 samples/vfio-mdev/mtty.c 		mdev_state->vconfig[0x3c] = buf[0];
mdev_state        263 samples/vfio-mdev/mtty.c 		if ((mdev_state->nr_ports == 1) && (bar_index == 1)) {
mdev_state        264 samples/vfio-mdev/mtty.c 			STORE_LE32(&mdev_state->vconfig[offset], 0);
mdev_state        272 samples/vfio-mdev/mtty.c 			bar_mask = mdev_state->bar_mask[bar_index];
mdev_state        276 samples/vfio-mdev/mtty.c 		cfg_addr |= (mdev_state->vconfig[offset] & 0x3ul);
mdev_state        277 samples/vfio-mdev/mtty.c 		STORE_LE32(&mdev_state->vconfig[offset], cfg_addr);
mdev_state        282 samples/vfio-mdev/mtty.c 		STORE_LE32(&mdev_state->vconfig[offset], 0);
mdev_state        291 samples/vfio-mdev/mtty.c static void handle_bar_write(unsigned int index, struct mdev_state *mdev_state,
mdev_state        300 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].dlab) {
mdev_state        301 samples/vfio-mdev/mtty.c 			mdev_state->s[index].divisor |= data;
mdev_state        305 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        308 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].rxtx.count <
mdev_state        309 samples/vfio-mdev/mtty.c 				mdev_state->s[index].max_fifo_size) {
mdev_state        310 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.fifo[
mdev_state        311 samples/vfio-mdev/mtty.c 					mdev_state->s[index].rxtx.head] = data;
mdev_state        312 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.count++;
mdev_state        313 samples/vfio-mdev/mtty.c 			CIRCULAR_BUF_INC_IDX(mdev_state->s[index].rxtx.head);
mdev_state        314 samples/vfio-mdev/mtty.c 			mdev_state->s[index].overrun = false;
mdev_state        320 samples/vfio-mdev/mtty.c 			if ((mdev_state->s[index].uart_reg[UART_IER] &
mdev_state        322 samples/vfio-mdev/mtty.c 			   (mdev_state->s[index].rxtx.count ==
mdev_state        323 samples/vfio-mdev/mtty.c 				    mdev_state->s[index].intr_trigger_level)) {
mdev_state        329 samples/vfio-mdev/mtty.c 				mtty_trigger_interrupt(mdev_state);
mdev_state        335 samples/vfio-mdev/mtty.c 			mdev_state->s[index].overrun = true;
mdev_state        341 samples/vfio-mdev/mtty.c 			if (mdev_state->s[index].uart_reg[UART_IER] &
mdev_state        343 samples/vfio-mdev/mtty.c 				mtty_trigger_interrupt(mdev_state);
mdev_state        345 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        350 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].dlab)
mdev_state        351 samples/vfio-mdev/mtty.c 			mdev_state->s[index].divisor |= (u16)data << 8;
mdev_state        353 samples/vfio-mdev/mtty.c 			mdev_state->s[index].uart_reg[offset] = data;
mdev_state        354 samples/vfio-mdev/mtty.c 			mutex_lock(&mdev_state->rxtx_lock);
mdev_state        356 samples/vfio-mdev/mtty.c 			    (mdev_state->s[index].rxtx.head ==
mdev_state        357 samples/vfio-mdev/mtty.c 					mdev_state->s[index].rxtx.tail)) {
mdev_state        362 samples/vfio-mdev/mtty.c 				mtty_trigger_interrupt(mdev_state);
mdev_state        365 samples/vfio-mdev/mtty.c 			mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        371 samples/vfio-mdev/mtty.c 		mdev_state->s[index].fcr = data;
mdev_state        373 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        376 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.count = 0;
mdev_state        377 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.head = 0;
mdev_state        378 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.tail = 0;
mdev_state        380 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        384 samples/vfio-mdev/mtty.c 			mdev_state->s[index].intr_trigger_level = 1;
mdev_state        388 samples/vfio-mdev/mtty.c 			mdev_state->s[index].intr_trigger_level = 4;
mdev_state        392 samples/vfio-mdev/mtty.c 			mdev_state->s[index].intr_trigger_level = 8;
mdev_state        396 samples/vfio-mdev/mtty.c 			mdev_state->s[index].intr_trigger_level = 14;
mdev_state        405 samples/vfio-mdev/mtty.c 		mdev_state->s[index].intr_trigger_level = 1;
mdev_state        407 samples/vfio-mdev/mtty.c 			mdev_state->s[index].max_fifo_size = MAX_FIFO_SIZE;
mdev_state        409 samples/vfio-mdev/mtty.c 			mdev_state->s[index].max_fifo_size = 1;
mdev_state        410 samples/vfio-mdev/mtty.c 			mdev_state->s[index].intr_trigger_level = 1;
mdev_state        417 samples/vfio-mdev/mtty.c 			mdev_state->s[index].dlab = true;
mdev_state        418 samples/vfio-mdev/mtty.c 			mdev_state->s[index].divisor = 0;
mdev_state        420 samples/vfio-mdev/mtty.c 			mdev_state->s[index].dlab = false;
mdev_state        422 samples/vfio-mdev/mtty.c 		mdev_state->s[index].uart_reg[offset] = data;
mdev_state        426 samples/vfio-mdev/mtty.c 		mdev_state->s[index].uart_reg[offset] = data;
mdev_state        428 samples/vfio-mdev/mtty.c 		if ((mdev_state->s[index].uart_reg[UART_IER] & UART_IER_MSI) &&
mdev_state        433 samples/vfio-mdev/mtty.c 			mtty_trigger_interrupt(mdev_state);
mdev_state        436 samples/vfio-mdev/mtty.c 		if ((mdev_state->s[index].uart_reg[UART_IER] & UART_IER_MSI) &&
mdev_state        441 samples/vfio-mdev/mtty.c 			mtty_trigger_interrupt(mdev_state);
mdev_state        451 samples/vfio-mdev/mtty.c 		mdev_state->s[index].uart_reg[offset] = data;
mdev_state        459 samples/vfio-mdev/mtty.c static void handle_bar_read(unsigned int index, struct mdev_state *mdev_state,
mdev_state        466 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].dlab) {
mdev_state        467 samples/vfio-mdev/mtty.c 			*buf  = (u8)mdev_state->s[index].divisor;
mdev_state        471 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        473 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].rxtx.head !=
mdev_state        474 samples/vfio-mdev/mtty.c 				 mdev_state->s[index].rxtx.tail) {
mdev_state        475 samples/vfio-mdev/mtty.c 			*buf = mdev_state->s[index].rxtx.fifo[
mdev_state        476 samples/vfio-mdev/mtty.c 						mdev_state->s[index].rxtx.tail];
mdev_state        477 samples/vfio-mdev/mtty.c 			mdev_state->s[index].rxtx.count--;
mdev_state        478 samples/vfio-mdev/mtty.c 			CIRCULAR_BUF_INC_IDX(mdev_state->s[index].rxtx.tail);
mdev_state        481 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].rxtx.head ==
mdev_state        482 samples/vfio-mdev/mtty.c 				mdev_state->s[index].rxtx.tail) {
mdev_state        490 samples/vfio-mdev/mtty.c 			if (mdev_state->s[index].uart_reg[UART_IER] &
mdev_state        492 samples/vfio-mdev/mtty.c 				mtty_trigger_interrupt(mdev_state);
mdev_state        494 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        499 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].dlab) {
mdev_state        500 samples/vfio-mdev/mtty.c 			*buf = (u8)(mdev_state->s[index].divisor >> 8);
mdev_state        503 samples/vfio-mdev/mtty.c 		*buf = mdev_state->s[index].uart_reg[offset] & 0x0f;
mdev_state        508 samples/vfio-mdev/mtty.c 		u8 ier = mdev_state->s[index].uart_reg[UART_IER];
mdev_state        511 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        513 samples/vfio-mdev/mtty.c 		if ((ier & UART_IER_RLSI) && mdev_state->s[index].overrun)
mdev_state        518 samples/vfio-mdev/mtty.c 		    (mdev_state->s[index].rxtx.count >=
mdev_state        519 samples/vfio-mdev/mtty.c 		      mdev_state->s[index].intr_trigger_level))
mdev_state        524 samples/vfio-mdev/mtty.c 		    (mdev_state->s[index].rxtx.head ==
mdev_state        525 samples/vfio-mdev/mtty.c 				mdev_state->s[index].rxtx.tail))
mdev_state        530 samples/vfio-mdev/mtty.c 		    (mdev_state->s[index].uart_reg[UART_MCR] &
mdev_state        540 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        546 samples/vfio-mdev/mtty.c 		*buf = mdev_state->s[index].uart_reg[offset];
mdev_state        553 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        555 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].rxtx.head !=
mdev_state        556 samples/vfio-mdev/mtty.c 				 mdev_state->s[index].rxtx.tail)
mdev_state        560 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].overrun)
mdev_state        564 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].rxtx.head ==
mdev_state        565 samples/vfio-mdev/mtty.c 				 mdev_state->s[index].rxtx.tail)
mdev_state        568 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        575 samples/vfio-mdev/mtty.c 		mutex_lock(&mdev_state->rxtx_lock);
mdev_state        577 samples/vfio-mdev/mtty.c 		if (mdev_state->s[index].uart_reg[UART_MCR] &
mdev_state        579 samples/vfio-mdev/mtty.c 			if (mdev_state->s[index].rxtx.count <
mdev_state        580 samples/vfio-mdev/mtty.c 					mdev_state->s[index].max_fifo_size)
mdev_state        584 samples/vfio-mdev/mtty.c 		mutex_unlock(&mdev_state->rxtx_lock);
mdev_state        589 samples/vfio-mdev/mtty.c 		*buf = mdev_state->s[index].uart_reg[offset];
mdev_state        597 samples/vfio-mdev/mtty.c static void mdev_read_base(struct mdev_state *mdev_state)
mdev_state        607 samples/vfio-mdev/mtty.c 		if (!mdev_state->region_info[index].size)
mdev_state        610 samples/vfio-mdev/mtty.c 		start_lo = (*(u32 *)(mdev_state->vconfig + pos)) &
mdev_state        612 samples/vfio-mdev/mtty.c 		mem_type = (*(u32 *)(mdev_state->vconfig + pos)) &
mdev_state        617 samples/vfio-mdev/mtty.c 			start_hi = (*(u32 *)(mdev_state->vconfig + pos + 4));
mdev_state        629 samples/vfio-mdev/mtty.c 		mdev_state->region_info[index].start = ((u64)start_hi << 32) |
mdev_state        637 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state        645 samples/vfio-mdev/mtty.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state        646 samples/vfio-mdev/mtty.c 	if (!mdev_state) {
mdev_state        651 samples/vfio-mdev/mtty.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        664 samples/vfio-mdev/mtty.c 			handle_pci_cfg_write(mdev_state, offset, buf, count);
mdev_state        666 samples/vfio-mdev/mtty.c 			memcpy(buf, (mdev_state->vconfig + offset), count);
mdev_state        673 samples/vfio-mdev/mtty.c 		if (!mdev_state->region_info[index].start)
mdev_state        674 samples/vfio-mdev/mtty.c 			mdev_read_base(mdev_state);
mdev_state        682 samples/vfio-mdev/mtty.c 				*buf, mdev_state->s[index].dlab);
mdev_state        684 samples/vfio-mdev/mtty.c 			handle_bar_write(index, mdev_state, offset, buf, count);
mdev_state        686 samples/vfio-mdev/mtty.c 			handle_bar_read(index, mdev_state, offset, buf, count);
mdev_state        692 samples/vfio-mdev/mtty.c 				*buf, mdev_state->s[index].dlab);
mdev_state        706 samples/vfio-mdev/mtty.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state        713 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state        732 samples/vfio-mdev/mtty.c 	mdev_state = kzalloc(sizeof(struct mdev_state), GFP_KERNEL);
mdev_state        733 samples/vfio-mdev/mtty.c 	if (mdev_state == NULL)
mdev_state        736 samples/vfio-mdev/mtty.c 	mdev_state->nr_ports = nr_ports;
mdev_state        737 samples/vfio-mdev/mtty.c 	mdev_state->irq_index = -1;
mdev_state        738 samples/vfio-mdev/mtty.c 	mdev_state->s[0].max_fifo_size = MAX_FIFO_SIZE;
mdev_state        739 samples/vfio-mdev/mtty.c 	mdev_state->s[1].max_fifo_size = MAX_FIFO_SIZE;
mdev_state        740 samples/vfio-mdev/mtty.c 	mutex_init(&mdev_state->rxtx_lock);
mdev_state        741 samples/vfio-mdev/mtty.c 	mdev_state->vconfig = kzalloc(MTTY_CONFIG_SPACE_SIZE, GFP_KERNEL);
mdev_state        743 samples/vfio-mdev/mtty.c 	if (mdev_state->vconfig == NULL) {
mdev_state        744 samples/vfio-mdev/mtty.c 		kfree(mdev_state);
mdev_state        748 samples/vfio-mdev/mtty.c 	mutex_init(&mdev_state->ops_lock);
mdev_state        749 samples/vfio-mdev/mtty.c 	mdev_state->mdev = mdev;
mdev_state        750 samples/vfio-mdev/mtty.c 	mdev_set_drvdata(mdev, mdev_state);
mdev_state        752 samples/vfio-mdev/mtty.c 	mtty_create_config_space(mdev_state);
mdev_state        755 samples/vfio-mdev/mtty.c 	list_add(&mdev_state->next, &mdev_devices_list);
mdev_state        763 samples/vfio-mdev/mtty.c 	struct mdev_state *mds, *tmp_mds;
mdev_state        764 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state = mdev_get_drvdata(mdev);
mdev_state        769 samples/vfio-mdev/mtty.c 		if (mdev_state == mds) {
mdev_state        770 samples/vfio-mdev/mtty.c 			list_del(&mdev_state->next);
mdev_state        772 samples/vfio-mdev/mtty.c 			kfree(mdev_state->vconfig);
mdev_state        773 samples/vfio-mdev/mtty.c 			kfree(mdev_state);
mdev_state        785 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state        790 samples/vfio-mdev/mtty.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state        791 samples/vfio-mdev/mtty.c 	if (!mdev_state)
mdev_state        920 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state        925 samples/vfio-mdev/mtty.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state        926 samples/vfio-mdev/mtty.c 	if (!mdev_state)
mdev_state        929 samples/vfio-mdev/mtty.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state        940 samples/vfio-mdev/mtty.c 				if (mdev_state->intx_evtfd)
mdev_state        941 samples/vfio-mdev/mtty.c 					eventfd_ctx_put(mdev_state->intx_evtfd);
mdev_state        956 samples/vfio-mdev/mtty.c 					mdev_state->intx_evtfd = evt;
mdev_state        957 samples/vfio-mdev/mtty.c 					mdev_state->irq_fd = fd;
mdev_state        958 samples/vfio-mdev/mtty.c 					mdev_state->irq_index = index;
mdev_state        973 samples/vfio-mdev/mtty.c 				if (mdev_state->msi_evtfd)
mdev_state        974 samples/vfio-mdev/mtty.c 					eventfd_ctx_put(mdev_state->msi_evtfd);
mdev_state        976 samples/vfio-mdev/mtty.c 				mdev_state->irq_index = VFIO_PCI_INTX_IRQ_INDEX;
mdev_state        986 samples/vfio-mdev/mtty.c 				if (mdev_state->msi_evtfd)
mdev_state        994 samples/vfio-mdev/mtty.c 				mdev_state->msi_evtfd = evt;
mdev_state        995 samples/vfio-mdev/mtty.c 				mdev_state->irq_fd = fd;
mdev_state        996 samples/vfio-mdev/mtty.c 				mdev_state->irq_index = index;
mdev_state       1012 samples/vfio-mdev/mtty.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state       1016 samples/vfio-mdev/mtty.c static int mtty_trigger_interrupt(struct mdev_state *mdev_state)
mdev_state       1020 samples/vfio-mdev/mtty.c 	if ((mdev_state->irq_index == VFIO_PCI_MSI_IRQ_INDEX) &&
mdev_state       1021 samples/vfio-mdev/mtty.c 	    (!mdev_state->msi_evtfd))
mdev_state       1023 samples/vfio-mdev/mtty.c 	else if ((mdev_state->irq_index == VFIO_PCI_INTX_IRQ_INDEX) &&
mdev_state       1024 samples/vfio-mdev/mtty.c 		 (!mdev_state->intx_evtfd)) {
mdev_state       1029 samples/vfio-mdev/mtty.c 	if (mdev_state->irq_index == VFIO_PCI_MSI_IRQ_INDEX)
mdev_state       1030 samples/vfio-mdev/mtty.c 		ret = eventfd_signal(mdev_state->msi_evtfd, 1);
mdev_state       1032 samples/vfio-mdev/mtty.c 		ret = eventfd_signal(mdev_state->intx_evtfd, 1);
mdev_state       1048 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state       1054 samples/vfio-mdev/mtty.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state       1055 samples/vfio-mdev/mtty.c 	if (!mdev_state)
mdev_state       1062 samples/vfio-mdev/mtty.c 	mutex_lock(&mdev_state->ops_lock);
mdev_state       1072 samples/vfio-mdev/mtty.c 		if (mdev_state->nr_ports == 2)
mdev_state       1080 samples/vfio-mdev/mtty.c 	mdev_state->region_info[bar_index].size = size;
mdev_state       1081 samples/vfio-mdev/mtty.c 	mdev_state->region_info[bar_index].vfio_offset =
mdev_state       1088 samples/vfio-mdev/mtty.c 	mutex_unlock(&mdev_state->ops_lock);
mdev_state       1132 samples/vfio-mdev/mtty.c 	struct mdev_state *mdev_state;
mdev_state       1137 samples/vfio-mdev/mtty.c 	mdev_state = mdev_get_drvdata(mdev);
mdev_state       1138 samples/vfio-mdev/mtty.c 	if (!mdev_state)
mdev_state       1158 samples/vfio-mdev/mtty.c 		memcpy(&mdev_state->dev_info, &info, sizeof(info));
mdev_state       1200 samples/vfio-mdev/mtty.c 		    (info.index >= mdev_state->dev_info.num_irqs))
mdev_state       1224 samples/vfio-mdev/mtty.c 						mdev_state->dev_info.num_irqs,
mdev_state       1335 samples/vfio-mdev/mtty.c 	struct mdev_state *mds;