Blame libusal/usalsettarget.c

Packit 45fded
/*
Packit 45fded
 * This file has been modified for the cdrkit suite.
Packit 45fded
 *
Packit 45fded
 * The behaviour and appearence of the program code below can differ to a major
Packit 45fded
 * extent from the version distributed by the original author(s).
Packit 45fded
 *
Packit 45fded
 * For details, see Changelog file distributed with the cdrkit package. If you
Packit 45fded
 * received this file from another source then ask the distributing person for
Packit 45fded
 * a log of modifications.
Packit 45fded
 *
Packit 45fded
 */
Packit 45fded
Packit 45fded
/* @(#)usalsettarget.c	1.2 04/01/14 Copyright 2000 J. Schilling */
Packit 45fded
/*
Packit 45fded
 *	usal Library
Packit 45fded
 *	set target SCSI address
Packit 45fded
 *
Packit 45fded
 *	This is the only place in libusal that is allowed to assign
Packit 45fded
 *	values to the usal address structure.
Packit 45fded
 *
Packit 45fded
 *	Copyright (c) 2000 J. Schilling
Packit 45fded
 */
Packit 45fded
/*
Packit 45fded
 * This program is free software; you can redistribute it and/or modify
Packit 45fded
 * it under the terms of the GNU General Public License version 2
Packit 45fded
 * as published by the Free Software Foundation.
Packit 45fded
 *
Packit 45fded
 * This program is distributed in the hope that it will be useful,
Packit 45fded
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 45fded
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 45fded
 * GNU General Public License for more details.
Packit 45fded
 *
Packit 45fded
 * You should have received a copy of the GNU General Public License along with
Packit 45fded
 * this program; see the file COPYING.  If not, write to the Free Software
Packit 45fded
 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Packit 45fded
 */
Packit 45fded
Packit 45fded
#include <mconfig.h>
Packit 45fded
#include <standard.h>
Packit 45fded
#include <schily.h>
Packit 45fded
Packit 45fded
#include <usal/scsitransp.h>
Packit 45fded
Packit 45fded
int	usal_settarget(SCSI *usalp, int, int, int);
Packit 45fded
Packit 45fded
int
Packit 45fded
usal_settarget(SCSI *usalp, int busno, int tgt, int tlun)
Packit 45fded
{
Packit 45fded
	int fd = -1;
Packit 45fded
Packit 45fded
	if (usalp->ops != NULL)
Packit 45fded
		fd = SCGO_FILENO(usalp, busno, tgt, tlun);
Packit 45fded
	usalp->fd = fd;
Packit 45fded
	usal_scsibus(usalp) = busno;
Packit 45fded
	usal_target(usalp)  = tgt;
Packit 45fded
	usal_lun(usalp)	  = tlun;
Packit 45fded
	return (fd);
Packit 45fded
}