Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 May 2013 10:16:06 -0600
From:      Ian Lepore <ian@FreeBSD.org>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r250298 - head/sys/cam/ata
Message-ID:  <1367856966.1180.168.camel@revolution.hippie.lan>
In-Reply-To: <201305061558.r46Fws6i056327@svn.freebsd.org>
References:  <201305061558.r46Fws6i056327@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2013-05-06 at 15:58 +0000, Alexander Motin wrote:
> Author: mav
> Date: Mon May  6 15:58:53 2013
> New Revision: 250298
> URL: http://svnweb.freebsd.org/changeset/base/250298
> 
> Log:
>   Fix byte order of ATA WWN when converting it to SCSI LUN ID.
> 
> Modified:
>   head/sys/cam/ata/ata_xpt.c
> 
> Modified: head/sys/cam/ata/ata_xpt.c
> ==============================================================================
> --- head/sys/cam/ata/ata_xpt.c	Mon May  6 15:30:34 2013	(r250297)
> +++ head/sys/cam/ata/ata_xpt.c	Mon May  6 15:58:53 2013	(r250298)
> @@ -834,6 +834,7 @@ noerror:
>  	{
>  		struct ccb_pathinq cpi;
>  		int16_t *ptr;
> +		int i;
>  
>  		ident_buf = &softc->ident_data;
>  		for (ptr = (int16_t *)ident_buf;
> @@ -913,8 +914,10 @@ noerror:
>  					path->device->device_id_len = 16;
>  					bcopy(&fake_device_id_hdr,
>  					    path->device->device_id, 8);
> -					bcopy(ident_buf->wwn,
> -					    path->device->device_id + 8, 8);
> +					for (i = 0; i < 4; i++) {
> +						ptr = (int16_t *)(path->device->device_id + 8);
> +						ptr[i] = bswap16(ident_buf->wwn[i]);
> +					}
>  				}
>  			}
>  

Shouldn't this use ata_bswap()?  If not that, then shouldn't it be one
of the conditional swap routines (be16dec() or similar)?

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1367856966.1180.168.camel>