fix wrong setting of LAN designator
simplify and drop global variables
Merge remote-tracking branch 'tlf/master'
Merge branch 'master' into foc

- fix wrong setting of LAN designator