diff --git a/lib/FreeBSD/freebsd.c b/lib/FreeBSD/freebsd.c index e223c195..097bc6d2 100644 --- a/lib/FreeBSD/freebsd.c +++ b/lib/FreeBSD/freebsd.c @@ -1,5 +1,5 @@ /* - $Id: freebsd.c,v 1.27 2004/07/24 06:06:22 rocky Exp $ + $Id: freebsd.c,v 1.28 2004/07/24 11:50:50 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: freebsd.c,v 1.27 2004/07/24 06:06:22 rocky Exp $"; +static const char _rcsid[] = "$Id: freebsd.c,v 1.28 2004/07/24 11:50:50 rocky Exp $"; #include "freebsd.h" @@ -230,7 +230,7 @@ _eject_media_freebsd (void *user_data) { _img_private_t *p_env = user_data; - return (env->access_mode == _AM_IOCTL) + return (p_env->access_mode == _AM_IOCTL) ? eject_media_freebsd_ioctl(p_env) : eject_media_freebsd_cam(p_env); } @@ -306,11 +306,26 @@ get_drive_cap_freebsd (const void *p_user_data, } +/*! + Run a SCSI MMC command. + + p_user_data internal CD structure. + i_timeout time in milliseconds we will wait for the command + to complete. If this value is -1, use the default + time-out value. + i_cdb Size of p_cdb + p_cdb CDB bytes. + e_direction direction the transfer is to go. + i_buf Size of buffer + p_buf Buffer for data, both sending and receiving + + Return 0 if no error. + */ static int scsi_mmc_run_cmd_freebsd( const void *p_user_data, int i_timeout, unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb, scsi_mmc_direction_t e_direction, - unsigned int i_buf, /*out*/ void *p_buf ) + unsigned int i_buf, /*in/out*/ void *p_buf ) { const _img_private_t *p_env = p_user_data; diff --git a/lib/FreeBSD/freebsd.h b/lib/FreeBSD/freebsd.h index b5077ec7..7bcd0e19 100644 --- a/lib/FreeBSD/freebsd.h +++ b/lib/FreeBSD/freebsd.h @@ -1,5 +1,5 @@ /* - $Id: freebsd.h,v 1.16 2004/07/24 05:57:21 rocky Exp $ + $Id: freebsd.h,v 1.17 2004/07/24 11:50:50 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -201,6 +201,28 @@ int read_mode2_sectors_freebsd_cam (_img_private_t *env, void *buf, bool read_toc_freebsd_ioctl (_img_private_t *env); +/*! + Run a SCSI MMC command. + + p_user_data internal CD structure. + i_timeout time in milliseconds we will wait for the command + to complete. If this value is -1, use the default + time-out value. + i_cdb Size of p_cdb + p_cdb CDB bytes. + e_direction direction the transfer is to go. + i_buf Size of buffer + p_buf Buffer for data, both sending and receiving + + Return 0 if no error. + */ +int scsi_mmc_run_cmd_freebsd_cam( const void *p_user_data, int i_timeout, + unsigned int i_cdb, + const scsi_mmc_cdb_t *p_cdb, + scsi_mmc_direction_t e_direction, + unsigned int i_buf, + /*in/out*/ void *p_buf ); + /*! Return the size of the CD in logical block address (LBA) units. */ diff --git a/lib/FreeBSD/freebsd_cam.c b/lib/FreeBSD/freebsd_cam.c index a032a438..f1c965e3 100644 --- a/lib/FreeBSD/freebsd_cam.c +++ b/lib/FreeBSD/freebsd_cam.c @@ -1,5 +1,5 @@ /* - $Id: freebsd_cam.c,v 1.22 2004/07/24 05:42:09 rocky Exp $ + $Id: freebsd_cam.c,v 1.23 2004/07/24 11:50:50 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.22 2004/07/24 05:42:09 rocky Exp $"; +static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.23 2004/07/24 11:50:50 rocky Exp $"; #ifdef HAVE_FREEBSD_CDROM @@ -52,7 +52,7 @@ static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.22 2004/07/24 05:42:09 rock Return 0 if no error. */ -static int +int scsi_mmc_run_cmd_freebsd_cam( const void *p_user_data, int i_timeout, unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb, scsi_mmc_direction_t e_direction, @@ -164,7 +164,7 @@ free_freebsd_cam (void *user_data) */ char * -get_mcn_freebsd_cam (_img_private_t *p_env) +get_mcn_freebsd_cam (const _img_private_t *p_env) { scsi_mmc_cdb_t cdb = {{0, }}; char buf[28] = { 0, };