📄 security.h
字号:
/*============================================================================
____________________________________________________________________________
______________________________________________
SSSS M M CCCC Standard Microsystems Corporation
S MM MM SSSS C Austin Design Center
SSS M M M S C 11000 N. Mopac Expressway
S M M SSS C Stonelake Bldg. 6, Suite 500
SSSS M M S CCCC Austin, Texas 78759
SSSS ______________________________________________
____________________________________________________________________________
Copyright(C) 1999, Standard Microsystems Corporation
All Rights Reserved.
This program code listing is proprietary to SMSC and may not be copied,
distributed, or used without a license to do so. Such license may have
Limited or Restricted Rights. Please refer to the license for further
clarification.
____________________________________________________________________________
Notice: The program contained in this listing is a proprietary trade
secret of SMSC, Hauppauge, New York, and is copyrighted
under the United States Copyright Act of 1976 as an unpublished work,
pursuant to Section 104 and Section 408 of Title XVII of the United
States code. Unauthorized copying, adaption, distribution, use, or
display is prohibited by this law.
____________________________________________________________________________
Use, duplication, or disclosure by the Government is subject to
restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
in Technical Data and Computer Software clause at DFARS 52.227-7013.
Contractor/Manufacturer is Standard Microsystems Corporation,
80 Arkay Drive, Hauppauge, New York, 1178-8847.
____________________________________________________________________________
____________________________________________________________________________
security.h - the device manager implementarion
____________________________________________________________________________
in this function, process all password-related cbs in one function to avoid accidentally
exposes functionality through export symbols
at end of function, we must somehow let caller know if we've dispatched the cb or not.
in addition, this code must be isr agnostic, and cannot be a dfa, since the cb may or may
not be a high-priority cb. (high priority cb's must process the security cb, but don't
actually make a dfa call to dispatch the cb, therefore we can't issue a dfa call here or
else we'll negate that optimization)
____________________________________________________________________________
Revision History
Date Who Comment
________ ___ _____________________________________________________________
10/07/02 cds initial version
10/17/02 cds - new macro: _sec_is_password_validated() moved to security.h from lun.h
- project-wide lun data & vtbl paging to reduce code space.
- removed g_active_media from _lun_data, _lun_() virtual functions
- added _lun_data_rd() and _lun_data_wr() macros to bypass lun paging
- added lun_set_active(log_lun) function to switch luns
===========================================================================*/
// macro to check if password has been validated
#define _sec_is_password_validated() ((g_password_validated)?k_true:k_false)
//+-----------------------------------------------------------------------------
// Name:
// sec_process_cb
//
// Declaration:
// void dfa_lun_write(void);
//
// Purpose:
// security SCSI CB hook. This function is called before any other CBs
// are notified of a CBW, including read/writes. This function is
// interrupt safe.
//
// Arguments:
// None.
// Uses _lun_data and g_bot_cbw to get its parameters.
// Uses _result to store pass/fail status.
//
// Return:
// k_success: cb has been fully processed... do not propogate processing
// on exit the DFA's argument pointer is written with a t_csw_status indicating:
// k_command_passed - command completed.
// k_command_failed - an error occurred.
//
// k_ignored: cb ignored. It should be sent on to the default lun processing.
//
// Notes:
// This is a function, not a dfa
// This function is interrupt-safe.
//
// Since:
// fmc-1.0
//------------------------------------------------------------------------------
extern t_result sec_process_cb() reentrant;
// global bit to indicate if password has been validated or not
extern bit g_password_validated;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -