Bootloader MAC fixes from Mike

This commit is contained in:
bsongis
2014-04-08 10:26:08 +02:00
parent a72df4ca16
commit 30111d9299
6 changed files with 73 additions and 6 deletions
@@ -54,7 +54,7 @@ static SBCInquiryData inquiryData = {
SBC_PERIPHERAL_DEVICE_CONNECTED,// Peripheral device is connected
0x00, // Reserved bits
0x01, // Media is removable
SBC_SPC_VERSION_4, // SPC-4 supported
0x02, // SBC_SPC_VERSION_4, // SPC-4 supported
0x2, // Response data format, must be 0x2
0, // Hierarchical addressing not supported
0, // ACA not supported
@@ -94,6 +94,8 @@
#define SBC_VERIFY_10 0x2F
/// Request a list of the possible capacities that can be formatted on medium
#define SBC_READ_FORMAT_CAPACITIES 0x23
#define SBC_START_STOP 0x19
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
@@ -620,6 +622,21 @@ typedef struct {
} __attribute__ ((packed)) SBCReadWriteErrorRecovery; // GCC
//------------------------------------------------------------------------------
/// \brief start/stop command
/// \see
//------------------------------------------------------------------------------
typedef struct {
unsigned char bModeDataLength; //!< Length of mode data to follow
unsigned char bImmediate:1, //!<
bReserved1:7; //!< Reserved bits
unsigned char pReserved[2]; //!< Reserved bytes
unsigned char startStop:1, //!< DPO/FUA bits supported ?
eject:1, //!< Reserved bits
bReserved2:6; //!< Is medium write-protected ?
} __attribute__ ((packed)) SBCStartStop; // GCC
//------------------------------------------------------------------------------
/// \brief Generic structure for holding information about SBC commands
/// \see SBCInquiry
@@ -642,6 +659,7 @@ typedef union {
SBCWrite10 write10; //!< WRITE (10) command
SBCMediumRemoval mediumRemoval; //!< PREVENT/ALLOW MEDIUM REMOVAL command
SBCModeSense6 modeSense6; //!< MODE SENSE (6) command
SBCStartStop startStopCmd; //!< START-STOP command
} SBCCommand;
@@ -1430,7 +1430,7 @@ unsigned char SBC_GetCommandInformation(void *command,
//------------------------------------
case SBC_PREVENT_ALLOW_MEDIUM_REMOVAL:
case 0x1B:
case SBC_START_STOP:
//------------------------------------
(*type) = MSDD_NO_TRANSFER;
break;
@@ -1590,7 +1590,6 @@ unsigned char SBC_ProcessCommand(MSDLun *lun,
//------------------------------------
case SBC_PREVENT_ALLOW_MEDIUM_REMOVAL:
case 0x1B:
//------------------------------------
TRACE_INFO_WP("PrevAllowRem ");
@@ -1600,6 +1599,19 @@ unsigned char SBC_ProcessCommand(MSDLun *lun,
result = MSDD_STATUS_SUCCESS;
break;
case SBC_START_STOP:
TRACE_INFO_WP("StartStop ");
result = command->startStopCmd.startStop ;
if (result == 0) {
lun->status = LUN_EJECTED ;
}
else {
lun->status = LUN_CHANGED ;
}
result = MSDD_STATUS_SUCCESS;
break;
#if 0
//------------------------------------
case SBC_READ_FORMAT_CAPACITIES: