Hello,
On 09.03.2011 09:39, jons...@terra.es wrote: > Trying to optimize DNIe card driver, I'd like to cache current df to avoid > extra select_file()'s > > DNIe card cannot handle select_file(SC_PATH_TYPE_PATH) directly: it has to be > splitted into > recursive calls to select_file(SC_PATH_TYPE_FILE_ID). > > Studying other card drivers i figure that the way to do is by mean of > sc_card_cache structure, > but I've not seen a common way to handle it. Some drivers doesn't make any > use, other ones > doesn't handle nor current_df neither current_ef, but works with current_path. Current_df and current_ef are used to cache not only the current path, but also the FCI of the files, for example, for the analysis of ACLs . Current_df and current_ef were implemented after the 'current_path', when this one has been already used by number of drivers. That's why the both actually coexist. > > Also, I've noticed that sc_(un)lock() clears sc_card_cache. Is this correct?. > I cannot see > the reason on this behaviour Afais, it's not true. In sc_lock() cache is invalidated after the SC_ERROR_CARD_RESET and SC_ERROR_READER_REATTACHED errors. In sc_ulock() cache invalidation is disabled by the non-defined 'define' macro. > > Any ideas?. Actually I'm working wiht cache code from card-flex.c, but unsure > if there is > a better approach for "my" card As for me, the current_df/ef is more general solution, but if you don't need to cache FCI -- the current_path is more simple. > > https://forja.cenatic.es/plugins/scmsvn/viewcvs.php/?root=opendnie > > BTW: Martin: We are working in a "DNIe hackfest meeting" next month, and > would like > to invite some people from OpenSC team to come to Spain to get a roadmap for > DNIe > integration into OpenSC mainstream > > Juan Antonio > > > _______________________________________________ > opensc-devel mailing list > opensc-devel@lists.opensc-project.org > http://www.opensc-project.org/mailman/listinfo/opensc-devel -- Viktor Tarasov <viktor.tara...@opentrust.com> _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel