brasero r1060 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1060 - in trunk: . src
- Date: Fri, 8 Aug 2008 13:09:20 +0000 (UTC)
Author: philippr
Date: Fri Aug 8 13:09:19 2008
New Revision: 1060
URL: http://svn.gnome.org/viewvc/brasero?rev=1060&view=rev
Log:
Fix #543377 â No multisession
we have to make sure the drive has TAO mode set (so we set it) before
retrieving NWA
Also:
- changes flags to open devices (no opened in RW mode)
- remove one useless member in commands definition
* src/Makefile.am:
* src/burn-medium.c (brasero_medium_track_get_nwa):
* src/scsi-cam.c:
* src/scsi-command.h:
* src/scsi-eject.c:
* src/scsi-get-configuration.c:
* src/scsi-get-performance.c:
* src/scsi-mech-status.c:
* src/scsi-mode-pages.h:
* src/scsi-mode-sense.c:
* src/scsi-opcodes.h:
* src/scsi-read-capacity.c:
* src/scsi-read-cd.c:
* src/scsi-read-disc-info.c:
* src/scsi-read-disc-structure.c:
* src/scsi-read-format-capacities.c:
* src/scsi-read-toc-pma-atip.c:
* src/scsi-read-track-information.c:
* src/scsi-sg.c:
* src/scsi-spc1.h:
* src/scsi-uscsi.c:
Modified:
trunk/ChangeLog
trunk/src/Makefile.am
trunk/src/burn-medium.c
trunk/src/scsi-cam.c
trunk/src/scsi-command.h
trunk/src/scsi-eject.c
trunk/src/scsi-get-configuration.c
trunk/src/scsi-get-performance.c
trunk/src/scsi-mech-status.c
trunk/src/scsi-mode-pages.h
trunk/src/scsi-mode-sense.c
trunk/src/scsi-opcodes.h
trunk/src/scsi-read-capacity.c
trunk/src/scsi-read-cd.c
trunk/src/scsi-read-disc-info.c
trunk/src/scsi-read-disc-structure.c
trunk/src/scsi-read-format-capacities.c
trunk/src/scsi-read-toc-pma-atip.c
trunk/src/scsi-read-track-information.c
trunk/src/scsi-sg.c
trunk/src/scsi-spc1.h
trunk/src/scsi-uscsi.c
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Fri Aug 8 13:09:19 2008
@@ -266,7 +266,10 @@
brasero-video-project.h \
brasero-video-project.c \
brasero-video-tree-model.c \
- brasero-video-tree-model.h
+ brasero-video-tree-model.h \
+ scsi-write-page.h \
+ scsi-mode-select.h \
+ scsi-mode-select.c
if BUILD_INOTIFY
brasero_SOURCES += brasero-file-monitor.c brasero-file-monitor.h
Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c (original)
+++ trunk/src/burn-medium.c Fri Aug 8 13:09:19 2008
@@ -45,6 +45,7 @@
#include "scsi-utils.h"
#include "scsi-mode-pages.h"
#include "scsi-status-page.h"
+#include "scsi-write-page.h"
#include "scsi-q-subchannel.h"
#include "scsi-dvd-structures.h"
#include "burn-volume.h"
@@ -1112,7 +1113,9 @@
BraseroDeviceHandle *handle,
BraseroScsiErrCode *code)
{
+ BraseroScsiModeData *data = NULL;
BraseroScsiTrackInfo track_info;
+ BraseroScsiWritePage *wrt_page;
BraseroMediumPrivate *priv;
BraseroScsiResult result;
gint track_num;
@@ -1128,6 +1131,32 @@
return BRASERO_BURN_OK;
}
+ /* make sure the current write mode is TAO. Otherwise the drive will
+ * return the first sector of the pregap instead of the first user
+ * accessible sector. */
+ result = brasero_spc1_mode_sense_get_page (handle,
+ BRASERO_SPC_PAGE_WRITE,
+ &data,
+ &size,
+ code);
+ if (result != BRASERO_SCSI_OK) {
+ g_free (data);
+
+ BRASERO_BURN_LOG ("MODE SENSE failed");
+ return BRASERO_BURN_ERR;
+ }
+
+ wrt_page = (BraseroScsiWritePage *) &data->page;
+ wrt_page->write_type = BRASERO_SCSI_WRITE_TAO;
+
+ result = brasero_spc1_mode_select (handle, data, size, code);
+ g_free (data);
+
+ if (result != BRASERO_SCSI_OK) {
+ BRASERO_BURN_LOG ("MODE SELECT failed");
+ return BRASERO_BURN_ERR;
+ }
+
/* at this point we know the type of the disc that's why we set the
* size according to this type. That may help to avoid outrange address
* errors. */
Modified: trunk/src/scsi-cam.c
==============================================================================
--- trunk/src/scsi-cam.c (original)
+++ trunk/src/scsi-cam.c Fri Aug 8 13:09:19 2008
@@ -62,7 +62,7 @@
#define BRASERO_SCSI_CMD_OPCODE_OFF 0
#define BRASERO_SCSI_CMD_SET_OPCODE(command) (command->cmd [BRASERO_SCSI_CMD_OPCODE_OFF] = command->info->opcode)
-#define OPEN_FLAGS O_RDONLY /*|O_EXCL */|O_NONBLOCK
+#define OPEN_FLAGS O_RDWR /*|O_EXCL */|O_NONBLOCK
BraseroScsiResult
brasero_scsi_command_issue_sync (gpointer command,
Modified: trunk/src/scsi-command.h
==============================================================================
--- trunk/src/scsi-command.h (original)
+++ trunk/src/scsi-command.h Fri Aug 8 13:09:19 2008
@@ -45,18 +45,15 @@
struct _BraseroScsiCmdInfo {
int size;
uchar opcode;
-
- int o_flags;
BraseroScsiDirection direction;
};
typedef struct _BraseroScsiCmdInfo BraseroScsiCmdInfo;
-#define BRASERO_SCSI_COMMAND_DEFINE(cdb, name, fd_flags, direction) \
+#define BRASERO_SCSI_COMMAND_DEFINE(cdb, name, direction) \
static const BraseroScsiCmdInfo info = \
{ /* SCSI commands always end by 1 byte of ctl */ \
G_STRUCT_OFFSET (cdb, ctl) + 1, \
BRASERO_##name##_OPCODE, \
- fd_flags, \
direction \
}
Modified: trunk/src/scsi-eject.c
==============================================================================
--- trunk/src/scsi-eject.c (original)
+++ trunk/src/scsi-eject.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -82,7 +84,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroLoadCDCDB,
LOAD_CD,
- O_RDONLY,
BRASERO_SCSI_READ);
BraseroScsiResult
Modified: trunk/src/scsi-get-configuration.c
==============================================================================
--- trunk/src/scsi-get-configuration.c (original)
+++ trunk/src/scsi-get-configuration.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -75,7 +77,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroGetConfigCDB,
GET_CONFIGURATION,
- O_RDONLY,
BRASERO_SCSI_READ);
typedef enum {
Modified: trunk/src/scsi-get-performance.c
==============================================================================
--- trunk/src/scsi-get-performance.c (original)
+++ trunk/src/scsi-get-performance.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <glib.h>
#include "burn-debug.h"
@@ -83,7 +86,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroGetPerformanceCDB,
GET_PERFORMANCE,
- O_RDONLY,
BRASERO_SCSI_READ);
/* used to choose which GET PERFORMANCE response we want */
Modified: trunk/src/scsi-mech-status.c
==============================================================================
--- trunk/src/scsi-mech-status.c (original)
+++ trunk/src/scsi-mech-status.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -47,7 +49,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroScsiMechStatusCDB,
MECH_STATUS,
- O_RDONLY,
BRASERO_SCSI_READ);
BraseroScsiResult
Modified: trunk/src/scsi-mode-pages.h
==============================================================================
--- trunk/src/scsi-mode-pages.h (original)
+++ trunk/src/scsi-mode-pages.h Fri Aug 8 13:09:19 2008
@@ -76,6 +76,7 @@
typedef enum {
BRASERO_SPC_PAGE_NULL = 0x00,
+ BRASERO_SPC_PAGE_WRITE = 0x05,
BRASERO_SPC_PAGE_STATUS = 0x2a,
} BraseroSPCPageType;
Modified: trunk/src/scsi-mode-sense.c
==============================================================================
--- trunk/src/scsi-mode-sense.c (original)
+++ trunk/src/scsi-mode-sense.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -75,15 +77,12 @@
uchar ctl;
};
-#define BRASERO_MODE_DATA_SET_BYTE_ORDER(data) data
-
#endif
typedef struct _BraseroModeSenseCDB BraseroModeSenseCDB;
BRASERO_SCSI_COMMAND_DEFINE (BraseroModeSenseCDB,
MODE_SENSE,
- O_RDONLY,
BRASERO_SCSI_READ);
#define BRASERO_MODE_DATA(data) ((BraseroScsiModeData *) (data))
Modified: trunk/src/scsi-opcodes.h
==============================================================================
--- trunk/src/scsi-opcodes.h (original)
+++ trunk/src/scsi-opcodes.h Fri Aug 8 13:09:19 2008
@@ -36,6 +36,7 @@
#define BRASERO_TEST_UNIT_READY_OPCODE 0x00
#define BRASERO_INQUIRY_OPCODE 0x12
#define BRASERO_MODE_SENSE_OPCODE 0x5a
+#define BRASERO_MODE_SELECT_OPCODE 0x55
/**
Modified: trunk/src/scsi-read-capacity.c
==============================================================================
--- trunk/src/scsi-read-capacity.c (original)
+++ trunk/src/scsi-read-capacity.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -72,7 +74,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroReadCapacityCDB,
READ_CAPACITY,
- O_RDONLY,
BRASERO_SCSI_READ);
BraseroScsiResult
Modified: trunk/src/scsi-read-cd.c
==============================================================================
--- trunk/src/scsi-read-cd.c (original)
+++ trunk/src/scsi-read-cd.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -91,7 +93,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroReadCDCDB,
READ_CD,
- O_RDONLY,
BRASERO_SCSI_READ);
BraseroScsiResult
Modified: trunk/src/scsi-read-disc-info.c
==============================================================================
--- trunk/src/scsi-read-disc-info.c (original)
+++ trunk/src/scsi-read-disc-info.c Fri Aug 8 13:09:19 2008
@@ -22,8 +22,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -73,7 +71,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroRdDiscInfoCDB,
READ_DISC_INFORMATION,
- O_RDONLY,
BRASERO_SCSI_READ);
typedef enum {
Modified: trunk/src/scsi-read-disc-structure.c
==============================================================================
--- trunk/src/scsi-read-disc-structure.c (original)
+++ trunk/src/scsi-read-disc-structure.c Fri Aug 8 13:09:19 2008
@@ -22,8 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -84,7 +85,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroReadDiscStructureCDB,
READ_DISC_STRUCTURE,
- O_RDONLY,
BRASERO_SCSI_READ);
typedef enum {
Modified: trunk/src/scsi-read-format-capacities.c
==============================================================================
--- trunk/src/scsi-read-format-capacities.c (original)
+++ trunk/src/scsi-read-format-capacities.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -44,7 +46,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroRdFormatCapacitiesCDB,
READ_FORMAT_CAPACITIES,
- O_RDONLY,
BRASERO_SCSI_READ);
BraseroScsiResult
Modified: trunk/src/scsi-read-toc-pma-atip.c
==============================================================================
--- trunk/src/scsi-read-toc-pma-atip.c (original)
+++ trunk/src/scsi-read-toc-pma-atip.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -77,7 +79,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroRdTocPmaAtipCDB,
READ_TOC_PMA_ATIP,
- O_RDONLY,
BRASERO_SCSI_READ);
typedef enum {
Modified: trunk/src/scsi-read-track-information.c
==============================================================================
--- trunk/src/scsi-read-track-information.c (original)
+++ trunk/src/scsi-read-track-information.c Fri Aug 8 13:09:19 2008
@@ -22,7 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-#include <fcntl.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <glib.h>
@@ -75,7 +77,6 @@
BRASERO_SCSI_COMMAND_DEFINE (BraseroRdTrackInfoCDB,
READ_TRACK_INFORMATION,
- O_RDONLY,
BRASERO_SCSI_READ);
typedef enum {
Modified: trunk/src/scsi-sg.c
==============================================================================
--- trunk/src/scsi-sg.c (original)
+++ trunk/src/scsi-sg.c Fri Aug 8 13:09:19 2008
@@ -59,7 +59,7 @@
#define BRASERO_SCSI_CMD_OPCODE_OFF 0
#define BRASERO_SCSI_CMD_SET_OPCODE(command) (command->cmd [BRASERO_SCSI_CMD_OPCODE_OFF] = command->info->opcode)
-#define OPEN_FLAGS O_RDONLY /*|O_EXCL */|O_NONBLOCK
+#define OPEN_FLAGS O_RDWR /*|O_EXCL */|O_NONBLOCK
/**
* This is to send a command
Modified: trunk/src/scsi-spc1.h
==============================================================================
--- trunk/src/scsi-spc1.h (original)
+++ trunk/src/scsi-spc1.h Fri Aug 8 13:09:19 2008
@@ -41,6 +41,12 @@
int *data_size,
BraseroScsiErrCode *error);
+BraseroScsiResult
+brasero_spc1_mode_select (BraseroDeviceHandle *handle,
+ BraseroScsiModeData *data,
+ int size,
+ BraseroScsiErrCode *error);
+
G_END_DECLS
#endif /* _BURN_SPC1_H */
Modified: trunk/src/scsi-uscsi.c
==============================================================================
--- trunk/src/scsi-uscsi.c (original)
+++ trunk/src/scsi-uscsi.c Fri Aug 8 13:09:19 2008
@@ -58,7 +58,7 @@
#define BRASERO_SCSI_CMD_OPCODE_OFF 0
#define BRASERO_SCSI_CMD_SET_OPCODE(command) (command->cmd [BRASERO_SCSI_CMD_OPCODE_OFF] = command->info->opcode)
-#define OPEN_FLAGS O_RDONLY /*|O_EXCL */|O_NONBLOCK
+#define OPEN_FLAGS O_RDWR /*|O_EXCL */|O_NONBLOCK
/**
* This is to send a command
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]