sources/common/libs/STM32Cube_F4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src/usbd_msc_scsi.c
/**
  * @brief  SCSI_AllowPreventRemovable
  *         Process Allow Prevent Removable medium command
  * @param  lun: Logical unit number
  * @param  params: Command parameters
  * @retval status
  */
@brief  SCSI_AllowPreventRemovable
Process Allow Prevent Removable medium command
@param  lun: Logical unit number
@param  params: Command parameters
@retval status
@brief SCSI_AllowPreventRemovable Process Allow Prevent Removable medium command @param lun : Logical unit number @param params : Command parameters @retval status
static int8_t SCSI_AllowPreventRemovable(USBD_HandleTypeDef *pdev, uint8_t lun, uint8_t *params)
{
  UNUSED(lun);
  USBD_MSC_BOT_HandleTypeDef *hmsc = (USBD_MSC_BOT_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
  if (hmsc == NULL)
  {
    return -1;
  }
  if (params[4] == 0U)
  {
    hmsc->scsi_medium_state = SCSI_MEDIUM_UNLOCKED;
  }
  else
  {
    hmsc->scsi_medium_state = SCSI_MEDIUM_LOCKED;
  }
  hmsc->bot_data_length = 0U;
  return 0;
}
static int8_t SCSI_AllowPreventRemovable ( USBD_HandleTypeDef * pdev , uint8_t lun , uint8_t * params ) { UNUSED ( lun ) ; USBD_MSC_BOT_HandleTypeDef * hmsc = ( USBD_MSC_BOT_HandleTypeDef * ) pdev -> pClassDataCmsit [ pdev -> classId ] ; if ( hmsc == NULL ) { return -1 ; } if ( params [ 4 ] == 0U ) { hmsc -> scsi_medium_state = SCSI_MEDIUM_UNLOCKED ; } else { hmsc -> scsi_medium_state = SCSI_MEDIUM_LOCKED ; } hmsc -> bot_data_length = 0U ; return 0 ; }
@brief  SCSI_AllowPreventRemovable
         Process Allow Prevent Removable medium command
 @param  lun: Logical unit number
 @param  params: Command parameters
 @retval status
@brief SCSI_AllowPreventRemovable Process Allow Prevent Removable medium command @param lun : Logical unit number @param params : Command parameters @retval status