Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 2010 11:05:35 +0100
From:      Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
To:        mav@FreeBSD.org
Cc:        freebsd-scsi@FreeBSD.org, freebsd-current@FreeBSD.org, freebsd-stable@FreeBSD.org, marius@alchemy.franken.de
Subject:   Re: Sense fetching [Was: cdrtools /devel ...]
Message-ID:  <4cdbbfef.v4cr/k2jZr9gdpyF%Joerg.Schilling@fokus.fraunhofer.de>
In-Reply-To: <4CD83535.1010008@FreeBSD.org>
References:  <4CD45209.5010607@FreeBSD.org> <20101105192028.GA68728@alchemy.franken.de> <4cd822df.o/wBtwsNCXiy8xZn%Joerg.Schilling@fokus.fraunhofer.de> <4CD82E2A.3070407@FreeBSD.org> <4cd8320a.U7/OjtLLBVtE4dTy%Joerg.Schilling@fokus.fraunhofer.de> <4CD83535.1010008@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Motin <mav@FreeBSD.org> wrote:

> >>> Given the fact that many drives will probably only return 18 bytes of sense 
> >>> data, this will happen every time libscg is told to fetch more sense than the 
> >>> drive is willing to return.
> >>>
> >>> Is there a way to distinct an old kernel from a new one?
> >> I don't see the problem. Previous kernel in most cases reported
> >> sesnse_resid == 0, lying that there is more sense data then really is.
> >> New one should report real (often positive) value. In both cases
> >> sesnse_resid value measured from the value submitted to the kernel.
> > 
> > Did the old kernel return  a zero sense_resid for any implemented SCSI 
> > transport? Libscg is a generic SCSI transport library and cdrecord is just one 
> > user of this lib.
>
> Not sure I understand your question. Zero sesnse_resid is absolutely
> normal situation if device gave same amount of sense as application
> requested. As I can see, many of SCSI controllers report sesnse_resid
> properly. I may assume that some, like atapicd don't -- in that case
> you'll also see 0 there.

FreeBSD-CAM did try to fetcth more than 18 bytes of sense data and it may be 
that some drives did return only 18 bytes. In this case, I would asume that 
there is a resid > 0.

> > Do you know the CAM behavior for other SCSI transports?
>
> I don't have real SCSI CD to test, but a as I can see, most of SCSI
> controllers return sense data automatically. Sense fetching changes
> should not affect/break anything there.

The question still remains whether the previous implementation did return resid 
> 0 in some cases. In this case, I would need to implement both variants in the 
libscg adaption layer and I would need to know whether I am running on an old 
version or on a new version kernel. Do you know of a simple method to implement 
this distinction?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4cdbbfef.v4cr/k2jZr9gdpyF%Joerg.Schilling>