pcscd doesn't initialize pcmcia reader anymore

Asked by Bart

I upgraded from Xubuntu 12.10 to Linux Mint 18 xfce4.
The reader I am using with my laptop is a build-in O2Micro SmartCardBus Reader.
It worked well with Xubuntu 12.10, kernel 3.7.0.7.11 and pcscd 1.8.5-1ubuntu1.
I got a driver from http://gna.org/projects/o2scr (o2scr-1.0.8.tar.bz2) that I modified slightly (see https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/1061947).

I upgraded to Linux Mint 18 xfce4, kernel 4.4.0-21.37, pcscd 1.8.14-1ubuntu1.
I recompiled the driver (had to change 1 line in ozscrlx.c):
  ' iminor(file->f_dentry->d_inode) ' became ' iminor(file->f_path.dentry->d_inode) '
I only got a SSL warning: the module didn't got signed, but no problem since it's not an UEFI machine.
See added 'compile_console_output.txt' file.

As I did with the previous system, I created a group 'pcscd' and added an udev rule:
  ACTION!="add", GOTO="pcscd_rules_end"
  KERNEL=="o2scr0", SUBSYSTEM=="ozscrlx", GROUP="pcscd"
  LABEL="pcscd_rules_end"

The module (o2scr) and the driver (ozscrlx_cs) are loaded and pcscd sees the SmartCard slot, but it doesn't get it initialized.
I have added some logs from the system that works (debug OZSCR ok.txt) and from the system that doesn't (debug OZSCR not_ok.txt).

Any help to get it working is appreciated ...

Bart.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu pcsc-lite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bart (bart2pub) said :
#1

compile_console_output.txt
---------------------------------------

$ make clean

  make -C src/ozctapi clean
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  rm -f *.o *.so
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  make -C src/ozscrlx clean
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'
  make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` clean
  make[2]: Entering directory '/usr/src/linux-headers-4.4.0-21-generic'
    CLEAN /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/.tmp_versions
    CLEAN /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/Module.symvers
  make[2]: Leaving directory '/usr/src/linux-headers-4.4.0-21-generic'
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'

$ make all

  make -C src/ozctapi
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  cc -Wall -O2 -I/usr/include/PCSC -fPIC -c -o ctapi.o ctapi.c
  cc -Wall -O2 -I/usr/include/PCSC -fPIC -c -o ifdhandler.o ifdhandler.c
  cc -shared ctapi.o ifdhandler.o -o lib_OZSCR.so
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  make -C src/ozscrlx
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'
  make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules
  make[2]: Entering directory '/usr/src/linux-headers-4.4.0-21-generic'
    CC [M] /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/ozscrlx.o
    LD [M] /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/o2scr.o
    Building modules, stage 2.
    MODPOST 1 modules
    CC /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/o2scr.mod.o
    LD [M] /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/o2scr.ko
  make[2]: Leaving directory '/usr/src/linux-headers-4.4.0-21-generic'
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'

$ sudo make install

  make -C src/ozctapi install
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  install -D lib_OZSCR.so /usr/local/o2micro/lib_OZSCR.so
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozctapi'
  make -C src/ozscrlx install
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'
  make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules_install
  make[2]: Entering directory '/usr/src/linux-headers-4.4.0-21-generic'
    INSTALL /mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx/o2scr.ko

  At main.c:222:
  - SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:175
  - SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:178
  sign-file: certs/signing_key.pem: No such file or directory
    DEPMOD 4.4.0-21-generic

  make[2]: Leaving directory '/usr/src/linux-headers-4.4.0-21-generic'
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/src/ozscrlx'
  make -C etc install
  make[1]: Entering directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/etc'
  install -D -m644 reader.conf /etc/reader.conf.d/o2scr.conf
  make[1]: Leaving directory '/mnt/Data/Temp/LinRepo/o2scr-1.0.8/etc'

Revision history for this message
Bart (bart2pub) said :
#2

debug OZSCR ok.txt
----------------------------

XUBUNTU 12.10
kernel 3.7.0.7.11
pcscd 1.8.5-1ubuntu1

--------------------------------------------------

$ sudo pccardctl -vv ls

Socket 0 Bridge: [yenta_cardbus] (bus ID: 0000:38:03.0)
 Configuration: state: on ready: yes

   Available IRQs: 3, 4, 7, 10, 11
   Available ioports: 0x00000100 - 0x0000021f
      0x00000228 - 0x000003af
      0x000003e0 - 0x000003ff
      0x00000490 - 0x000004cf
      0x000004d8 - 0x000004ff
      0x00000820 - 0x000008ff
      0x00000a00 - 0x00000aff
      0x00000c00 - 0x00000cf7
      0x00005100 - 0x000053ff
      0x00005500 - 0x000057ff
      0x00005900 - 0x00005bff
      0x00005d00 - 0x00005fff

   Available iomem: 0x000d0000 - 0x000dffff
      0xf2610000 - 0xf26fffff

Socket 1 Bridge: [yenta_cardbus] (bus ID: 0000:38:03.1)
 Configuration: state: on ready: yes

   Voltage: 5.0V
 Vcc: 5.0V
 Vpp: 5.0V

   Available IRQs: 3, 4, 7, 10, 11
   Available ioports: 0x00000100 - 0x0000021f
      0x00000228 - 0x000003af
      0x000003e0 - 0x000003ff
      0x00000490 - 0x000004cf
      0x000004d8 - 0x000004ff
      0x00000820 - 0x000008ff
      0x00000a00 - 0x00000aff
      0x00000c00 - 0x00000cf7
      0x00005100 - 0x000053ff
      0x00005500 - 0x000057ff
      0x00005900 - 0x00005bff
      0x00005d00 - 0x00005fff

   Available iomem: 0xf2610000 - 0xf26fdfff
      0x000d0000 - 0x000dffff

Socket 1 Device 0: [ozscrlx_cs] (bus ID: 1.0)
 Configuration: state: on
   [io 0x5100-0x511f flags 0x108]
   [io 0x0000 flags 0x100]
   [mem 0xf2611000-0xf2611fff flags 0x207]
   [mem 0x00000000 flags 0x200]
   [mem 0x00000000 flags 0x200]
   [mem 0x00000000 flags 0x200]

 Product Name: O2Micro
 SmartCardBus Reader
 V1.0

 Identification: manf_id: 0xffff card_id: 0x0001
   prod_id(1): "O2Micro
" (0x94f31211)
   prod_id(2): "SmartCardBus Reader
" (0x4f67a249)
   prod_id(3): "V1.0
" (0xf28411a8)
   prod_id(4): --- (---)

--------------------------------------------------

$ sudo /etc/init.d/pcscd stop
$ sudo pcscd -adfx

00000000 pcscdaemon.c:233:main() pcscd set to foreground with debug send to stdout
00000015 pcscdaemon.c:303:main() Auto exit after 60 seconds of inactivity
00000047 configfile.l:245:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000014 configfile.l:257:DBGetReaderListDir() Skipping non regular file: ..
00000004 configfile.l:257:DBGetReaderListDir() Skipping non regular file: .
00000006 configfile.l:298:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000032 configfile.l:298:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/o2scr.conf
00000037 configfile.l:298:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/openct
00000030 readerfactory.c:978:RFInitializeReader() Attempting startup of O2Micro SmartCardBus Reader 00 00 using /usr/local/o2micro/lib_OZSCR.so
00000065 dyn_unix.c:81:DYN_GetAddress() IFDHCreateChannelByName: /usr/local/o2micro/lib_OZSCR.so: undefined symbol: IFDHCreateChannelByName
00000008 readerfactory.c:836:RFBindFunctions() Loading IFD Handler 2.0
00000024 readerfactory.c:327:RFAddReader() Using the pcscd polling thread
00000034 pcscdaemon.c:516:main() pcsc-lite 1.8.5 daemon ready.
00001525 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/003/001
00000121 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/004/001
00000122 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/005/001
00000122 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000096 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000100 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0409, PID: 0x005A, path: /dev/bus/usb/001/002
00000102 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000105 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0D8C, PID: 0x0103, path: /dev/bus/usb/001/004
00000103 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0D8C, PID: 0x0103, path: /dev/bus/usb/001/004
00000097 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000106 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1C4F, PID: 0x0002, path: /dev/bus/usb/001/005
00000104 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1C4F, PID: 0x0002, path: /dev/bus/usb/001/005
00000099 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000102 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0E8F, PID: 0x0020, path: /dev/bus/usb/001/006
00000101 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0E8F, PID: 0x0020, path: /dev/bus/usb/001/006
00000099 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000095 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x0409, PID: 0x005A, path: /dev/bus/usb/001/002
00000125 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000092 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000098 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x08FF, PID: 0x2550, path: /dev/bus/usb/006/002
00000122 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/007/001
00000121 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/008/001
00000123 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000095 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000139 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB186, path: /dev/bus/usb/002/003
00000109 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB186, path: /dev/bus/usb/002/003

--------------------------------------------------

/etc/reader.conf.d/o2scr.conf

# Configuration file for pcsc-lite
#
# This file has to be configured for serial and PCMCIA readers only.
# normal USB readers shall _not_ be configured here!
#
# David Corcoran <email address hidden>

FRIENDLYNAME "O2Micro SmartCardBus Reader"
DEVICENAME /dev/o2scr0
LIBPATH /usr/local/o2micro/lib_OZSCR.so
CHANNELID 0xF10000

# End of file

Revision history for this message
Bart (bart2pub) said :
#3

debug OZSCR not_ok.txt
----------------------------

LINUX MINT 18 XFCE4
kernel 4.4.0-21.37
pcscd 1.8.14-1ubuntu1

--------------------------------------------------

$ sudo pccardctl -vv ls

Socket 0 Bridge: [yenta_cardbus] (bus ID: 0000:38:03.0)
 Configuration: state: on ready: yes

   Available IRQs: 3, 4, 7, 10, 11
   Available ioports: 0x00000100 - 0x000003af
      0x000003e0 - 0x000004ff
      0x00000820 - 0x000008ff
      0x00000a00 - 0x00000aff
      0x00000c00 - 0x00000cf7
      0x00005000 - 0x00005fff

   Available iomem: 0x000d0000 - 0x000dffff
      0xf2610000 - 0xf26fffff

Socket 1 Bridge: [yenta_cardbus] (bus ID: 0000:38:03.1)
 Configuration: state: on ready: yes

   Voltage: 5.0V
 Vcc: 5.0V
 Vpp: 5.0V

   Available IRQs: 3, 4, 7, 10, 11
   Available ioports: 0x00000100 - 0x000003af
      0x000003e0 - 0x000004ff
      0x00000820 - 0x000008ff
      0x00000a00 - 0x00000aff
      0x00000c00 - 0x00000cf7
      0x00005000 - 0x00005fff

   Available iomem: 0xf2610000 - 0xf26fdfff
      0x000d0000 - 0x000dffff

Socket 1 Device 0: [ozscrlx_cs] (bus ID: 1.0)
 Configuration: state: on
   [io 0x5100-0x511f flags 0x108]
   [io 0x0000 flags 0x100]
   [mem 0xf2611000-0xf2611fff flags 0x207]
   [mem 0x00000000 flags 0x200]
   [mem 0x00000000 flags 0x200]
   [mem 0x00000000 flags 0x200]

 Product Name: O2Micro
 SmartCardBus Reader
 V1.0

 Identification: manf_id: 0xffff card_id: 0x0001
   prod_id(1): "O2Micro
" (0x94f31211)
   prod_id(2): "SmartCardBus Reader
" (0x4f67a249)
   prod_id(3): "V1.0
" (0xf28411a8)
   prod_id(4): --- (---)

--------------------------------------------------

$ sudo /etc/init.d/pcscd stop
$ sudo pcscd -adfx

00000000 pcscdaemon.c:263:main() pcscd set to foreground with debug send to stdout
00000024 pcscdaemon.c:333:main() Auto exit after 60 seconds of inactivity
00000042 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000021 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00000010 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/o2scr.conf
00000034 configfile.l:212:evaluatetoken() Add reader: O2Micro SmartCardBus Reader
00000017 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000022 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00000019 readerfactory.c:1012:RFInitializeReader() Attempting startup of O2Micro SmartCardBus Reader 00 00 using /usr/local/o2micro/lib_OZSCR.so
00000061 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/local/o2micro/lib_OZSCR.so: undefined symbol: IFDHCreateChannelByName
00000012 readerfactory.c:865:RFBindFunctions() Loading IFD Handler 2.0
ifdhandler.c:121:IFDHCreateChannel Lun 0, Channel 0
ctapi.c:130:CT_init CT_init enter
ctapi.c:161:CT_init CT_init exit (-11)
00000046 readerfactory.c:1043:RFInitializeReader() Open Port 0x0 Failed (/dev/o2scr0)
00000009 readerfactory.c:335:RFAddReader() O2Micro SmartCardBus Reader init failed.
00000013 readerfactory.c:558:RFRemoveReader() UnrefReader() count was: 1
00000009 readerfactory.c:1063:RFUnInitializeReader() Attempting shutdown of O2Micro SmartCardBus Reader 00 00.
00000009 readerfactory.c:934:RFUnloadReader() Unloading reader driver.
00000021 pcscdaemon.c:569:main() pcsc-lite 1.8.14 daemon ready.
00004068 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/003/001
00000143 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/004/001
00000137 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/005/001
00000137 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000095 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000104 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0409, PID: 0x005A, path: /dev/bus/usb/001/002
00000102 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000114 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0D8C, PID: 0x0103, path: /dev/bus/usb/001/004
00000113 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0D8C, PID: 0x0103, path: /dev/bus/usb/001/004
00000101 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000120 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1C4F, PID: 0x0002, path: /dev/bus/usb/001/005
00000114 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1C4F, PID: 0x0002, path: /dev/bus/usb/001/005
00000107 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000112 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0E8F, PID: 0x0020, path: /dev/bus/usb/001/006
00000121 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0E8F, PID: 0x0020, path: /dev/bus/usb/001/006
00000102 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x058F, PID: 0x9254, path: /dev/bus/usb/001/003
00000108 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0409, PID: 0x005A, path: /dev/bus/usb/001/002
00000130 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000102 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/006/001
00000096 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x08FF, PID: 0x2550, path: /dev/bus/usb/006/002
00000131 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/007/001
00000136 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/008/001
00000134 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000117 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/002/001
00000097 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB186, path: /dev/bus/usb/002/003
00000108 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x04F2, PID: 0xB186, path: /dev/bus/usb/002/003

--------------------------------------------------

/etc/reader.conf.d/o2scr.conf

# Configuration file for pcsc-lite
#
# This file has to be configured for serial and PCMCIA readers only.
# normal USB readers shall _not_ be configured here!
#
# David Corcoran <email address hidden>

FRIENDLYNAME "O2Micro SmartCardBus Reader"
DEVICENAME /dev/o2scr0
LIBPATH /usr/local/o2micro/lib_OZSCR.so
CHANNELID 0xF10000

# End of file

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Linux Mint isnt supported here. I suggest you post on the Mint forum:
https://forums.linuxmint.com

None of the "Ubuntu based" distributions are supported here

Can you help with this problem?

Provide an answer of your own, or ask Bart for more information if necessary.

To post a message you must log in.