rockbox/utils/nwztools/scsitools/para_noise.c
Amaury Pouly 6d04ed343c scsi_tools: add support for nvp reading
There is a vendor specific command to read the NVP of the device,
including the KAS. The trick is that the data is randomly
scrambled using a so-called para_noise array of random values.
There seems to be a problem when retrieving large entries (>1000
bytes typically) which causes sg_pt do behave strangely.

Change-Id: Iefa6140df78ab9c7dcf7ac34cb1170979123ecd7
2012-11-03 04:25:25 +01:00

90 lines
7.2 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2012 Amaury Pouly
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "para_noise.h"
uint8_t para_noise[1024] =
{
0x42, 0xF2, 0x50, 0xFC, 0x97, 0xB1, 0x08, 0x0E, 0x49, 0x72, 0x34, 0x6C, 0xA8, 0xAC, 0x06, 0x92,
0x6A, 0x57, 0x72, 0x82, 0xB1, 0xDD, 0x5F, 0x58, 0x58, 0x72, 0xD9, 0xDF, 0x67, 0xA6, 0xF7, 0x3D,
0x7E, 0x9E, 0x89, 0x95, 0x2D, 0x62, 0x0C, 0x6D, 0xFD, 0xF4, 0x33, 0x54, 0x60, 0xD9, 0x20, 0x9D,
0xB1, 0x65, 0xBA, 0x9A, 0x23, 0x01, 0xD5, 0x5F, 0x29, 0x9D, 0xCE, 0x98, 0xB1, 0x53, 0x60, 0xF3,
0x8B, 0x9B, 0x09, 0xA4, 0xEB, 0x50, 0x60, 0xE1, 0xC2, 0x43, 0x91, 0xD2, 0xA0, 0xF9, 0x21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