TianoCore EDK2 master
Loading...
Searching...
No Matches
SmartCardReader.h
Go to the documentation of this file.
1
12#ifndef __SMART_CARD_READER_H__
13#define __SMART_CARD_READER_H__
14
15#define EFI_SMART_CARD_READER_PROTOCOL_GUID \
16 { \
17 0x2a4d1adf, 0x21dc, 0x4b81, {0xa4, 0x2f, 0x8b, 0x8e, 0xe2, 0x38, 0x00, 0x60} \
18 }
19
21
22//
23// Codes for access mode
24//
25#define SCARD_AM_READER 0x0001 // Exclusive access to reader
26#define SCARD_AM_CARD 0x0002 // Exclusive access to card
27//
28// Codes for card action
29//
30#define SCARD_CA_NORESET 0x0000 // Don't reset card
31#define SCARD_CA_COLDRESET 0x0001 // Perform a cold reset
32#define SCARD_CA_WARMRESET 0x0002 // Perform a warm reset
33#define SCARD_CA_UNPOWER 0x0003 // Power off the card
34#define SCARD_CA_EJECT 0x0004 // Eject the card
35//
36// Protocol types
37//
38#define SCARD_PROTOCOL_UNDEFINED 0x0000
39#define SCARD_PROTOCOL_T0 0x0001
40#define SCARD_PROTOCOL_T1 0x0002
41#define SCARD_PROTOCOL_RAW 0x0004
42//
43// Codes for state type
44//
45#define SCARD_UNKNOWN 0x0000 /* state is unknown */
46#define SCARD_ABSENT 0x0001 /* Card is absent */
47#define SCARD_INACTIVE 0x0002 /* Card is present and not powered*/
48#define SCARD_ACTIVE 0x0003 /* Card is present and powered */
49//
50// Macro to generate a ControlCode & PC/SC part 10 control code
51//
52#define SCARD_CTL_CODE(code) (0x42000000 + (code))
53#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
54
88typedef
92 IN UINT32 AccessMode,
93 IN UINT32 CardAction,
94 IN UINT32 PreferredProtocols,
95 OUT UINT32 *ActiveProtocol
96 );
97
117typedef
121 IN UINT32 CardAction
122 );
123
160typedef
164 OUT CHAR16 *ReaderName OPTIONAL,
165 IN OUT UINTN *ReaderNameLength OPTIONAL,
166 OUT UINT32 *State OPTIONAL,
167 OUT UINT32 *CardProtocol OPTIONAL,
168 OUT UINT8 *Atr OPTIONAL,
169 IN OUT UINTN *AtrLength OPTIONAL
170 );
171
204typedef
208 IN UINT8 *CAPDU,
209 IN UINTN CAPDULength,
210 OUT UINT8 *RAPDU,
211 IN OUT UINTN *RAPDULength
212 );
213
253typedef
257 IN UINT32 ControlCode,
258 IN UINT8 *InBuffer OPTIONAL,
259 IN UINTN InBufferLength OPTIONAL,
260 OUT UINT8 *OutBuffer OPTIONAL,
261 IN OUT UINTN *OutBufferLength OPTIONAL
262 );
263
294typedef
298 IN UINT32 Attrib,
299 OUT UINT8 *OutBuffer,
300 IN OUT UINTN *OutBufferLength
301 );
302
309 EFI_SMART_CARD_READER_DISCONNECT SCardDisconnect;
311 EFI_SMART_CARD_READER_TRANSMIT SCardTransmit;
314};
315
316extern EFI_GUID gEfiSmartCardReaderProtocolGuid;
317
318#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_DISCONNECT)(IN EFI_SMART_CARD_READER_PROTOCOL *This, IN UINT32 CardAction)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_STATUS)(IN EFI_SMART_CARD_READER_PROTOCOL *This, OUT CHAR16 *ReaderName OPTIONAL, IN OUT UINTN *ReaderNameLength OPTIONAL, OUT UINT32 *State OPTIONAL, OUT UINT32 *CardProtocol OPTIONAL, OUT UINT8 *Atr OPTIONAL, IN OUT UINTN *AtrLength OPTIONAL)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_GET_ATTRIB)(IN EFI_SMART_CARD_READER_PROTOCOL *This, IN UINT32 Attrib, OUT UINT8 *OutBuffer, IN OUT UINTN *OutBufferLength)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_TRANSMIT)(IN EFI_SMART_CARD_READER_PROTOCOL *This, IN UINT8 *CAPDU, IN UINTN CAPDULength, OUT UINT8 *RAPDU, IN OUT UINTN *RAPDULength)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_CONNECT)(IN EFI_SMART_CARD_READER_PROTOCOL *This, IN UINT32 AccessMode, IN UINT32 CardAction, IN UINT32 PreferredProtocols, OUT UINT32 *ActiveProtocol)
EFI_STATUS(EFIAPI * EFI_SMART_CARD_READER_CONTROL)(IN EFI_SMART_CARD_READER_PROTOCOL *This, IN UINT32 ControlCode, IN UINT8 *InBuffer OPTIONAL, IN UINTN InBufferLength OPTIONAL, OUT UINT8 *OutBuffer OPTIONAL, IN OUT UINTN *OutBufferLength OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213