ClearFoundation Tracker - ClearCenter
View Issue Details
0001605ClearCentereziodpublic2014-03-11 20:082016-04-29 12:41
dloper 
dsokoloski 
lowtweaksometimes
assignedopen 
6.5.0 Updates 
 
0001605: eziod does not properly work with bypass when bus segment is not 0
The kmod-network-bypass detects the bypass on different and varying busses. On ClearBOX gen1 and gen2 this was bus 0 for whenever a module board was not in the box. On gen3 it can be 6 ... or 14. Basically, the function of the eziod which allows front-panel access to the network bypass needs to search the bus in order to properly address the functions of the bypass.

In the past this bus was 0 so the path was /sys/bus/i2c/devices/0-0026 for bypass 1 and /sys/bus/i2c/devices/0-0022 for bypass 2. But if the bypass is on bus 6 it will be on /sys/bus/i2c/devices/6-0022/bypass0 for bypass 2.

Logic needs to be programmed to search the /sys/bus/i2c/devices/ directory for items that match the following "-0026", "-0022", "-0020", "-0024". For each of those it will need to lookup /sys/bus/i2c/devices/XX-00xx/bypass0. If that file is found then a bypass segment exist for the bypass1, 2, 3, and/or 4.
No tags attached.
Issue History
2014-03-11 20:08dloperNew Issue
2014-03-12 10:07user2ProjectClearOS => ClearCenter
2014-03-12 10:08user2Statusnew => confirmed
2014-03-12 10:08user2Categoryapp-clearcenter - ClearCenter Core => eziod
2014-03-12 10:08user2Target Version => 6.5.0 Updates
2014-03-12 10:10user2Assigned To => dsokoloski
2014-03-12 10:10user2Statusconfirmed => assigned
2014-03-12 11:44dsokoloskiNote Added: 0001158
2014-04-30 09:30user2Target Version6.5.0 Updates =>
2016-04-29 12:41dloperNote Added: 0003141

Notes
(0001158)
dsokoloski   
2014-03-12 11:44   
I have a very old ClearBOX 300 which I believe is Gen1. I just wanted to make note that the i2c bus assignments don't seem to be hardware related, but kernel related. For example, my bypass devices used to be on bus zero (0-0026, and 0-0022). But now, with kernel 2.6.32-431, they are on bus 6 but have the same IDs (6-0026, and 6-0022).

So would the logic be dynamically find these devices, in reversed order, such as:

# find /sys/devices/ -name 'bypass0' | sort -nr
(0003141)
dloper   
2016-04-29 12:41   
[root@gateway etc]# diff eziod.conf eziod.conf.orig
307,322d306
< f = io.open("/sys/bus/i2c/devices/6-0026/bypass0")
< if f ~= nil then
< for line in f:lines() do
< _, _, bp1 = string.find(line, "^(%d+)")
< break
< end
< io.close(f)
< end
< f = io.open("/sys/bus/i2c/devices/6-0022/bypass0")
< if f ~= nil then
< for line in f:lines() do
< _, _, bp2 = string.find(line, "^(%d+)")
< break
< end
< io.close(f)
< end
330,342d313
< local bpfile1
< local bpfile2
< local q
< bpfile1 = "/sys/bus/i2c/devices/0-0026/bypass0"
< bpfile2 = "/sys/bus/i2c/devices/0-0026/bypass0"
< q = io.open("/sys/bus/i2c/devices/6-0026/bypass0","r")
< if q then bpfile1 = "/sys/bus/i2c/devices/6-0026/bypass0" end
< q = io.open("/sys/bus/i2c/devices/6-0022/bypass0","r")
< if q then bpfile2 = "/sys/bus/i2c/devices/6-0022/bypass0" end
< q = io.open("/sys/bus/i2c/devices/9-0026/bypass0","r")
< if q then bpfile1 = "/sys/bus/i2c/devices/9-0026/bypass0" end
< q = io.open("/sys/bus/i2c/devices/9-0022/bypass0","r")
< if q then bpfile2 = "/sys/bus/i2c/devices/9-0022/bypass0" end
344c315
< f = io.open(bpfile1, "w")
---
> f = io.open("/sys/bus/i2c/devices/0-0026/bypass0", "w")
346c317
< f = io.open(bpfile2, "w")
---
> f = io.open("/sys/bus/i2c/devices/0-0022/bypass0", "w")