-
-/* The following functions are local */
-
-#if defined(__linux__) && defined(HAVE_LINUX_VERSION_H)
-/*****************************************************************************
- * Eject using SCSI commands. Return 0 if successful
- *****************************************************************************/
-/**
- * \brief Ejects the CD /DVD using SCSI commands
- * \ingroup vlc_interface
- * This function is local
- * \param i_fd a device nummber
- * \return 0 on success, VLC_EGENERIC on failure
- */
-static int EjectSCSI( int i_fd )
-{
- int i_status;
-
- struct sdata
- {
- int inlen;
- int outlen;
- char cmd[256];
- } scsi_cmd;
-
- scsi_cmd.inlen = 0;
- scsi_cmd.outlen = 0;
- scsi_cmd.cmd[0] = ALLOW_MEDIUM_REMOVAL;
- scsi_cmd.cmd[1] = 0;
- scsi_cmd.cmd[2] = 0;
- scsi_cmd.cmd[3] = 0;
- scsi_cmd.cmd[4] = 0;
- scsi_cmd.cmd[5] = 0;
- i_status = ioctl( i_fd, SCSI_IOCTL_SEND_COMMAND, (void *)&scsi_cmd );
- if( i_status != 0 )
- {
- return VLC_EGENERIC;
- }
-
- scsi_cmd.inlen = 0;
- scsi_cmd.outlen = 0;
- scsi_cmd.cmd[0] = START_STOP;
- scsi_cmd.cmd[1] = 0;
- scsi_cmd.cmd[2] = 0;
- scsi_cmd.cmd[3] = 0;
- scsi_cmd.cmd[4] = 1;
- scsi_cmd.cmd[5] = 0;
- i_status = ioctl( i_fd, SCSI_IOCTL_SEND_COMMAND, (void *)&scsi_cmd );
- if( i_status != 0 )
- {
- return VLC_EGENERIC;
- }
-
- scsi_cmd.inlen = 0;
- scsi_cmd.outlen = 0;
- scsi_cmd.cmd[0] = START_STOP;
- scsi_cmd.cmd[1] = 0;
- scsi_cmd.cmd[2] = 0;
- scsi_cmd.cmd[3] = 0;
- scsi_cmd.cmd[4] = 2;
- scsi_cmd.cmd[5] = 0;
- i_status = ioctl( i_fd, SCSI_IOCTL_SEND_COMMAND, (void *)&scsi_cmd );
- if( i_status != 0 )
- {
- return VLC_EGENERIC;
- }
-
- /* Force kernel to reread partition table when new disc inserted */
- i_status = ioctl( i_fd, BLKRRPART );
-
- return i_status;
-}
-#endif
-