~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to src/scsi-test-unit-ready.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2008-11-18 11:30:50 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: james.westby@ubuntu.com-20081118113050-yhrskmatlel0gzfm
Tags: upstream-0.8.3
ImportĀ upstreamĀ versionĀ 0.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
/*
 
3
 * brasero
 
4
 * Copyright (C) Philippe Rouquier 2007-2008 <bonfire-app@wanadoo.fr>
 
5
 * 
 
6
 *  Brasero is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 * 
 
11
 * brasero is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
 * See the GNU General Public License for more details.
 
15
 * 
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with brasero.  If not, write to:
 
18
 *      The Free Software Foundation, Inc.,
 
19
 *      51 Franklin Street, Fifth Floor
 
20
 *      Boston, MA  02110-1301, USA.
 
21
 */
 
22
 
 
23
#ifdef HAVE_CONFIG_H
 
24
#  include <config.h>
 
25
#endif
 
26
 
 
27
#include "scsi-error.h"
 
28
#include "scsi-utils.h"
 
29
#include "scsi-base.h"
 
30
#include "scsi-command.h"
 
31
#include "scsi-opcodes.h"
 
32
 
 
33
struct _BraseroTestUnitReadyCDB {
 
34
        uchar opcode;
 
35
        uchar reserved          [4];
 
36
        uchar ctl;
 
37
};
 
38
 
 
39
typedef struct _BraseroTestUnitReadyCDB BraseroTestUnitReadyCDB;
 
40
 
 
41
BRASERO_SCSI_COMMAND_DEFINE (BraseroTestUnitReadyCDB,
 
42
                             TEST_UNIT_READY,
 
43
                             BRASERO_SCSI_READ);
 
44
 
 
45
BraseroScsiResult
 
46
brasero_spc1_test_unit_ready (BraseroDeviceHandle *handle,
 
47
                              BraseroScsiErrCode *error)
 
48
{
 
49
        BraseroTestUnitReadyCDB *cdb;
 
50
        BraseroScsiResult res;
 
51
 
 
52
        cdb = brasero_scsi_command_new (&info, handle);
 
53
        res = brasero_scsi_command_issue_sync (cdb,
 
54
                                               NULL,
 
55
                                               0,
 
56
                                               error);
 
57
        brasero_scsi_command_free (cdb);
 
58
        return res;
 
59
}
 
60
 
 
61