X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=src%2Frfid.c;h=fb5b9c376d412cad1784e2139dfd9ad4693ef7f5;hb=a7c201deb99239d6d98a45b3cc642d8554231a22;hp=ba166a2db5cd425bd0915a1059bcf33ca6c7a004;hpb=d405140edf9bdb25465ba7ddb203280d50a96b4d;p=librfid diff --git a/src/rfid.c b/src/rfid.c index ba166a2..fb5b9c3 100644 --- a/src/rfid.c +++ b/src/rfid.c @@ -12,19 +12,27 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include +#include #include -#include -#include #include #include #include #include +#ifdef LIBRFID_STATIC +struct rfid_asic_handle rfid_ah; +struct rfid_layer2_handle rfid_l2h; +struct rfid_protocol_handle rfid_ph; +struct rfid_asic_transport_handle rfid_ath; +struct rfid_reader_handle rfid_rh; +#endif + +#ifndef LIBRFID_FIRMWARE const char * rfid_hexdump(const void *data, unsigned int len) { @@ -41,6 +49,9 @@ rfid_hexdump(const void *data, unsigned int len) } return string; } +#else +#define rfid_hexdump(x, y) hexdump(x, y) +#endif #if 0 int rfid_setopt(struct rfid_handle *rh, unsigned int level, @@ -48,9 +59,8 @@ int rfid_setopt(struct rfid_handle *rh, unsigned int level, const void *opt, unsigned int *optlen) { switch (level) { - case RFID_LEVEL_ASIC: case RFID_LEVEL_READER: - return -EINVAL; + return rfid_reader_setopt(optname, opt, optlen); break; case RFID_LEVEL_LAYER2: return rfid_layer2_setopt(optname, opt, optlen); @@ -58,6 +68,7 @@ int rfid_setopt(struct rfid_handle *rh, unsigned int level, case RFID_LEVEL_LAYER3: return rfid_layer3_setopt(optname, opt, optlen); break; + case RFID_LEVEL_ASIC: default: return -EINVAL; break; @@ -71,9 +82,8 @@ int rfid_getopt(struct rfid_handle *rh, unsigned int level, void *opt, unsigned int *optlen) { switch (level) { - case RFID_LEVEL_ASIC: case RFID_LEVEL_READER: - return -EINVAL; + return rfid_reader_getopt(optname, opt, optlen); break; case RFID_LEVEL_LAYER2: return rfid_layer2_getopt(optname, opt, optlen); @@ -81,6 +91,7 @@ int rfid_getopt(struct rfid_handle *rh, unsigned int level, case RFID_LEVEL_LAYER3: return rfid_layer3_getopt(optname, opt, optlen); break; + case RFID_LEVEL_ASIC: default: return -EINVAL; break; @@ -92,14 +103,6 @@ int rfid_getopt(struct rfid_handle *rh, unsigned int level, int rfid_init() { - rfid_reader_register(&rfid_reader_cm5121); - rfid_reader_register(&rfid_reader_openpcd); - rfid_layer2_register(&rfid_layer2_iso14443a); - rfid_layer2_register(&rfid_layer2_iso14443b); - rfid_protocol_register(&rfid_protocol_tcl); - rfid_protocol_register(&rfid_protocol_mful); - rfid_protocol_register(&rfid_protocol_mfcl); - return 0; }