channels/smartcard: cleanup unpacking of data structures