CCID descriptor statistics: dwFeatures
Article from the serie "CCID descriptor statistics".
The dwFeatures field is a number value from the CCID USB descriptor:
This value indicates what intelligent features the CCID has. The value is a bitwise OR operation performed on the following values:Only one of the following values may be present to select a level of exchange:
- 00000000h No special characteristics
- 00000002h Automatic parameter configuration based on ATR data
- 00000004h Automatic activation of ICC on inserting
- 00000008h Automatic ICC voltage selection
- 00000010h Automatic ICC clock frequency change according to active parameters provided by the Host or self determined
- 00000020h Automatic baud rate change according to active parameters provided by the Host or self determined
- 00000040h Automatic parameters negotiation made by the CCID (use of warm or cold resets or PPS according to a manufacturer proprietary algorithm to select the communication parameters with the ICC)
- 00000080h Automatic PPS made by the CCID according to the active parameters
- 00000100h CCID can set ICC in clock stop mode
- 00000200h NAD value other than 00 accepted (T=1 protocol in use)
- 00000400h Automatic IFSD exchange as first exchange (T=1 protocol in use)
Only one of the values 00000040h and 00000080h may be present. When value 00000040h is present the host shall not try to change the FI, DI, and protocol currently selected.
- 00010000h TPDU level exchanges with CCID
- 00020000h Short APDU level exchange with CCID
- 00040000h Short and Extended APDU level exchange with CCID
- If none of those values is indicated the level of exchange is character.
When an APDU level for exchanges is selected, one of the values 00000040h or 00000080h must be present, as well as the value 00000002h.
To support selective suspend:When bit 20th, as shown above, is set bit D5 in bmAttributes of the Standard Configuration Descriptor must be set to 1.
- 00100000h USB Wake up signaling supported on card insertion and removal
dwFeatures | # | % |
---|---|---|
0x00010230 | 36 | 14.17 % |
0x000100BA | 27 | 10.63 % |
0x00020840 | 20 | 7.87 % |
0x000207B2 | 19 | 7.48 % |
0x00010030 | 18 | 7.09 % |
0x000204BA | 11 | 4.33 % |
0x0002047E | 10 | 3.94 % |
0x000404B2 | 10 | 3.94 % |
0x000406BA | 10 | 3.94 % |
0x000404BE | 9 | 3.54 % |
0x000404BA | 8 | 3.15 % |
0x000204BE | 6 | 2.36 % |
0x00010330 | 5 | 1.97 % |
0x00040042 | 5 | 1.97 % |
0x000101BA | 4 | 1.57 % |
0x000102BA | 4 | 1.57 % |
0x00000840 | 3 | 1.18 % |
0x000100B6 | 3 | 1.18 % |
0x00020472 | 3 | 1.18 % |
0x000400FE | 3 | 1.18 % |
0x00000030 | 2 | 0.79 % |
0x0001007A | 2 | 0.79 % |
0x00010200 | 2 | 0.79 % |
0x0001023C | 2 | 0.79 % |
0x00020040 | 2 | 0.79 % |
0x00020672 | 2 | 0.79 % |
0x000206BA | 2 | 0.79 % |
0x0004047E | 2 | 0.79 % |
0x000404B0 | 2 | 0.79 % |
0x000004B2 | 1 | 0.39 % |
0x00010000 | 1 | 0.39 % |
0x00010002 | 1 | 0.39 % |
0x00010070 | 1 | 0.39 % |
0x00010130 | 1 | 0.39 % |
0x00010138 | 1 | 0.39 % |
0x00010238 | 1 | 0.39 % |
0x0001023A | 1 | 0.39 % |
0x000102B8 | 1 | 0.39 % |
0x000103B1 | 1 | 0.39 % |
0x000104BA | 1 | 0.39 % |
0x00020042 | 1 | 0.39 % |
0x0002004E | 1 | 0.39 % |
0x0002005E | 1 | 0.39 % |
0x00020430 | 1 | 0.39 % |
0x000204B2 | 1 | 0.39 % |
0x000205B2 | 1 | 0.39 % |
0x000205B8 | 1 | 0.39 % |
0x00020870 | 1 | 0.39 % |
0x000405F2 | 1 | 0.39 % |
0x00040672 | 1 | 0.39 % |
0x00040840 | 1 | 0.39 % |
The dwFeatures field is the most complex field in a CCID descriptor. The numerical value is not really informative. You have to parse the value to extract every bit of information.
We will now parse dwFeatures field by field. I will not explain each possible value. Have a look at the CCID specification or my CCID driver file ifdhandler.c in the function
IFDHSetProtocolParameters()
.No special characteristics: 00000000h
No reader.Undocumented bit: 00000001h
1 reader: OMNIKEY CardMan 1021Automatic parameter configuration based on ATR data: 00000002h
151 readersAutomatic activation of ICC on inserting: 00000004h
37 readersAutomatic ICC voltage selection: 00000008h
108 readersAutomatic ICC clock frequency change according to active parameters provided by the Host or self determined: 00000010h
217 readersAutomatic baud rate change according to active parameters provided by the Host or self determined: 00000020h
216 readersAutomatic parameters negotiation made by the CCID: 00000040h
60 readersAutomatic PPS made by the CCID according to the active parameters: 00000080h
126 readersCCID can set ICC in clock stop mode: 00000100h
34 readersNAD value other than 00 accepted (T=1 protocol in use): 00000200h
87 readersAutomatic IFSD exchange as first exchange (T=1 protocol in use): 00000400h
102 readersICCD: 00000800h
25 readerslevel of exhange
dwFeatures | # | % |
---|---|---|
Character | 6 | 2.36 % |
TPDU | 113 | 44.49 % |
Short APDU | 83 | 32.68 % |
Short and Extended APDU | 52 | 20.47 % |
USB Wake up signaling supported on card insertion and removal: 00100000h
No readerData analysis
It is difficult to say if a reader should or should not support a particular feature.One easy case is the level of exchange. As explained in Extended APDU support not all readers can support extended APDUs. If your application and your card is using extended APDU you shall use a reader with extended APDU support. That is either a TPDU or a short and extended APDU reader. 44.49 % + 20.47 % = 64.96% of the readers support extended APDU.
Regarding the other features the choice is between:
- a feature implemented by the reader
- Simpler driver
- Impossible to patch in the driver if the reader firmware or a smart card is bogus
- a feature implemented by the driver
- More complex driver
- Possible to modify the driver to adapt the feature to special cases (bogus reader firmware or bogus smart card)
My CCID driver is already "complex" with support of most the features. Some features are not yet supported but nobody asked from them. So I imagine they are not important.
So, except for the extended APDU support, the other features presented here are not so important. It may be more important for you to check if the reader supports the communication speed of your smart card, or the voltage of your card.