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; }
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; }
inline void releaseSBP2Device(struct SBP2Device *dev){ part_disconnect(dev); scache_kill(dev->cache); }