apdu_check_pinpad (int slot, int command, pininfo_t *pininfo)
{
  if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
    return SW_HOST_NO_DRIVER;

  if (opt.enable_pinpad_varlen)
    pininfo->fixedlen = 0;

  if (reader_table[slot].check_pinpad)
    {
      int sw;

      if ((sw = lock_slot (slot)))
        return sw;

      sw = reader_table[slot].check_pinpad (slot, command, pininfo);
      unlock_slot (slot);
      return sw;
    }
  else
    return SW_HOST_NOT_SUPPORTED;
}
apdu_check_pinpad (int slot, int command, pininfo_t *pininfo)
{
  if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
    return SW_HOST_NO_DRIVER;

  if (opt.enable_pinpad_varlen)
    pininfo->fixedlen = 0;

  if (reader_table[slot].check_pinpad)
    {
      int sw;

      if ((sw = lock_slot (slot)))
        return sw;

      sw = reader_table[slot].check_pinpad (slot, command, pininfo);
      unlock_slot (slot);
      return sw;
    }
  else
    return SW_HOST_NOT_SUPPORTED;
}