Topic: true, there is no hot-plug support for FPGAs implemented. I understood that it's not safe since auto-detecting routines between different board types collide, i.e. if you scan on serial port X for a single and have actually an Icarus attached, you'd hang in a loop (or vice-versa, not sure).
Hmm, I would have thought the autodetect routines for FPGAs are fine in cgminer. My command line for 2 Singles looks something like this:
cgminer -o <pool> -u <user> -p <pass> --disable-gpu -S COM6 -S COM7
Notice there is nothing in that command line to tell cgminer that I have a Single, an Icarus, or Ztex. But cgminer detects and starts the Singles on COM6 and COM7 fine.
The detection code is quite straight forward for each FPGA.
If you wish to force it to be specifically BFL or ICA you can e.g. "-S bitforce:COM6" or "-S icarus:COM6"
ZTX detection is completely different so there is no real overlap (you don't specify the ztex devices, it always directly detects them)
It checks for BFL first:
It sends it a command (ZGX) which the BFL replies and is checked for the string "SHA256" in it - part of the reply is also where the "Model" in the API command 'devdetails' comes from
Next it checks for Icarus:
It simply just sends it some work and waits 0.1s for the answer
(I checked the block chain for a low nonce and found Ozcoin block 171874 nonce = (0xa2870100) = 0x000187a2 takes ~0.53ms on Rev3 Icarus to be the lowest nonce in the thousands I got a script to look at until the script bugged out)
This is mandatory for ICA since there is no identification anywhere other than the USB device identification
(which course could be used by other non Icarus devices since it's not unique)
Thus with that code (above) the ordering naturally should be BFL first and ICA 2nd if you don't specify "-S bitforce:COM6" or "-S icarus:COM6"
ZTX is detect third since that was added 3rd (though I might consider moving it up to first since it's very direct how it works and unlikely to ever affect any other device)
You don't specify -S for ZTX
Edit: for auto detection of course ZTX is always auto
ICA doesn't ever do auto
BFL does auto only in linux and only when you specify -S auto - however it has 2 methods:
1) where it looks in /dev/serial/by-id (which can sometimes only show 1 BFL on some linux versions if you have more than 1 BFL)
2) by libudev checking the USB Model when libudev is compiled in