Exemple #1
0
// 新しいデバイスの発見
void pro100_new(struct pci_device *dev)
{
	PRO100_CTX *ctx = SeZeroMalloc(sizeof(PRO100_CTX));

	printf ("pro100_new\n");

#ifdef VTD_TRANS
        if (iommu_detected) {
                add_remap(dev->address.bus_no ,dev->address.device_no ,dev->address.func_no,
                          vmm_start_inf() >> 12, (vmm_term_inf()-vmm_start_inf()) >> 12, PERM_DMA_RW) ;
        }
#endif // of VTD_TRANS

	ctx->dev = dev;
	ctx->lock = SeNewLock();
	dev->host = ctx;

	pro100_alloc_recv_buffer(ctx);

	if (pro100_ctx == NULL)
	{
		pro100_ctx = ctx;
	}
	else
	{
		printf("Error: Two or more pro100 devices found.\n");
		pro100_beep(1234, 5000);
	}
}
Exemple #2
0
// 新しいデバイスの発見
void pro100_new(struct pci_device *dev)
{
	PRO100_CTX *ctx = SeZeroMalloc(sizeof(PRO100_CTX));

	debugprint ("pro100_new\n");

#ifdef VTD_TRANS
        if (iommu_detected) {
                add_remap(dev->address.bus_no ,dev->address.device_no ,dev->address.func_no,
                          vmm_start_inf() >> 12, (vmm_term_inf()-vmm_start_inf()) >> 12, PERM_DMA_RW) ;
        }
#endif // of VTD_TRANS

	ctx->dev = dev;
	spinlock_init (&ctx->lock);
	dev->host = ctx;
	dev->driver->options.use_base_address_mask_emulation = 1;

	pro100_alloc_recv_buffer(ctx);

	if (pro100_ctx == NULL)
	{
		pro100_ctx = ctx;
	}
	else
	{
		debugprint("Error: Two or more pro100 devices found.\n");
		pro100_beep(1234, 5000);
	}
}
Exemple #3
0
// I/O ハンドラ: 未使用
int pro100_io_handler(core_io_t io, union mem *data, void *arg)
{
	// I/O アクセスは発生しないはずだが、一応発生を監視して beep 音を出す。

	//printf("IO port=%u, size=%u, dir=%u\n", (UINT)io.port, (UINT)io.size, (UINT)io.dir);

	pro100_beep(880, 200);

	return CORE_IO_RET_DEFAULT;
}
Exemple #4
0
PRO100_CTX *pro100_get_ctx()
{
	if (pro100_ctx == NULL)
	{
		printf("Error: No PRO/100 Devices!\n");
		pro100_beep(1234, 10000);
		while (true);
	}

	return pro100_ctx;
}