apdu_set_progress_cb (int slot, gcry_handler_progress_t cb, void *cb_arg)
{
  int sw;

  if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
    return SW_HOST_NO_DRIVER;

  if (reader_table[slot].set_progress_cb)
    {
      sw = lock_slot (slot);
      if (!sw)
        {
          sw = reader_table[slot].set_progress_cb (slot, cb, cb_arg);
          unlock_slot (slot);
        }
    }
  else
    sw = 0;
  return sw;
}
apdu_set_progress_cb (int slot, gcry_handler_progress_t cb, void *cb_arg)
{
  int sw;

  if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
    return SW_HOST_NO_DRIVER;

  if (reader_table[slot].set_progress_cb)
    {
      sw = lock_slot (slot);
      if (!sw)
        {
          sw = reader_table[slot].set_progress_cb (slot, cb, cb_arg);
          unlock_slot (slot);
        }
    }
  else
    sw = 0;
  return sw;
}