~ubuntu-branches/ubuntu/hoary/cdrtools/hoary

« back to all changes in this revision

Viewing changes to libscg/scgsettarget.c

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2002-04-09 10:03:06 UTC
  • Revision ID: james.westby@ubuntu.com-20020409100306-t4hagiv7gm0fhggv
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)scgsettarget.c   1.1 00/08/25 Copyright 2000 J. Schilling */
 
2
#ifndef lint
 
3
static  char _sccsid[] =
 
4
        "@(#)scgsettarget.c     1.1 00/08/25 Copyright 2000 J. Schilling";
 
5
#endif
 
6
/*
 
7
 *      scg Library 
 
8
 *      set target SCSI address
 
9
 *
 
10
 *      This is the only place in libscg that is allowed to assign
 
11
 *      values to the scg address structure.
 
12
 *
 
13
 *      Copyright (c) 2000 J. Schilling
 
14
 */
 
15
/*
 
16
 * This program is free software; you can redistribute it and/or modify
 
17
 * it under the terms of the GNU General Public License as published by
 
18
 * the Free Software Foundation; either version 2, or (at your option)
 
19
 * any later version.
 
20
 *
 
21
 * This program is distributed in the hope that it will be useful,
 
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
24
 * GNU General Public License for more details.
 
25
 *
 
26
 * You should have received a copy of the GNU General Public License
 
27
 * along with this program; see the file COPYING.  If not, write to
 
28
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 */
 
30
 
 
31
#include <mconfig.h>
 
32
#include <standard.h>
 
33
#include <schily.h>
 
34
 
 
35
#include <scg/scsitransp.h>
 
36
 
 
37
EXPORT  int     scg_settarget   __PR((SCSI *scgp, int, int, int));
 
38
 
 
39
EXPORT int
 
40
scg_settarget(scgp, busno, tgt, tlun)
 
41
        SCSI    *scgp;
 
42
        int     busno;
 
43
        int     tgt;
 
44
        int     tlun;
 
45
{
 
46
        int fd = -1;
 
47
 
 
48
        if (scgp->ops != NULL)
 
49
                fd = SCGO_FILENO(scgp, busno, tgt, tlun);
 
50
        scgp->fd = fd;
 
51
        scg_scsibus(scgp) = busno;
 
52
        scg_target(scgp)  = tgt;
 
53
        scg_lun(scgp)     = tlun;
 
54
        return (fd);
 
55
}