示例#1
0
文件: usb_driver.c 项目: sp193/ps2sdk
int mass_stor_disconnect(int devId) {
	mass_dev* dev;
	dev = mass_stor_findDevice(devId, 0);

	printf("USBHDFSD: disconnect: devId=%i\n", devId);

	if (dev == NULL)
	{
		printf("USBHDFSD: Error - disconnect: no device storage!\n");
		return 0;
	}

	if (dev->status & USBMASS_DEV_STAT_CONN)
	{
		mass_stor_release(dev);
		part_disconnect(dev);
		scache_kill(dev->cache);
		dev->cache = NULL;
		dev->devId = -1;

		DeleteSema(dev->ioSema);

		if(dev->callback != NULL) dev->callback(USBMASS_DEV_EV_DISCONN);
	}

	return 0;
}
示例#2
0
int mass_stor_disconnect(int devId) {
	mass_dev* dev;
	dev = mass_stor_findDevice(devId, 0);

	printf("USBHDFSD: disconnect: devId=%i\n", devId);

    if (dev == NULL)
    {
        printf("USBHDFSD: Error - disconnect: no device storage!\n");
        return 0;
    }
    
	if ((dev->status & DEVICE_DETECTED) && devId == dev->devId)
	{
		mass_stor_release(dev);
		part_disconnect(dev);
		scache_kill(dev->cache);
		dev->cache = NULL;
		dev->devId = -1;
	}
	return 0;
}
示例#3
0
文件: scsi.c 项目: AKuHAK2/ps2sdk
inline void releaseSBP2Device(struct SBP2Device *dev){
	part_disconnect(dev);
	scache_kill(dev->cache);
}