1 static unsigned int fsdi_table[] = { 16, 24, 32, 40, 48, 64, 96, 128, 256 };
3 int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi)
5 /* ISO 14443-4:2000(E) Section 5.1. */
6 if (fsdi > sizeof(fsdi_table)/sizeof(unsigned int))
9 *fsd = fsdi_table[fsdi];
13 int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd)
17 for (i = 0; i < sizeof(fsdi_table)/sizeof(unsigned int); i++) {
18 if (fsdi_table[i] == fsd) {
27 /* calculate the fsd that is equal or the closest smaller value
28 * that can be coded as fsd */
29 unsigned int iso14443_fsd_approx(unsigned int fsd)
31 unsigned int tbl_size = sizeof(fsdi_table)/sizeof(unsigned int);
34 for (i = tbl_size-1; i >= 0; i--) {
35 if (fsdi_table[i] <= fsd)
38 /* not reached: return smallest possible FSD */