|
5 | 5 |
|
6 | 6 | try:
|
7 | 7 | import time
|
8 |
| - import os |
9 | 8 | from sonic_sfp.sfputilbase import SfpUtilBase
|
10 | 9 | except ImportError as e:
|
11 | 10 | raise ImportError("%s - required module not found" % str(e))
|
@@ -47,32 +46,6 @@ def __init__(self):
|
47 | 46 |
|
48 | 47 | SfpUtilBase.__init__(self)
|
49 | 48 |
|
50 |
| - def get_presence(self, port_name): |
51 |
| - # modify by zhw to get sfp presence |
52 |
| - # Check for invalid port_num |
53 |
| - port_num = int(port_name[8:]) |
54 |
| - |
55 |
| - if port_num < (self.port_start+1) or port_num > (self.port_end+1): |
56 |
| - return False |
57 |
| - |
58 |
| - # cpld info from "CPLD Register for es5800A2.2(V1.1)" |
59 |
| - cpld_map = {0: '0x82', 1: '0x83', 2: '0x84', |
60 |
| - 3: '0x85', 4: '0x86', 5: '0x87', 6: '0x8E'} |
61 |
| - cpld_key = (port_num - 1)/8 |
62 |
| - cpld_mask = (1 << (port_num - 1) % 8) |
63 |
| - |
64 |
| - # use i2cget cmd to get cpld data |
65 |
| - output = os.popen('i2cdetect -l | grep CP') |
66 |
| - bus_num = output.read()[4] |
67 |
| - cmd = "i2cget -y "+bus_num+" 0x5 "+cpld_map[cpld_key] |
68 |
| - tmp = os.popen(cmd).read().replace("\n", "") |
69 |
| - cpld_value = int(tmp, 16) |
70 |
| - |
71 |
| - if cpld_value & cpld_mask == 0: |
72 |
| - return True |
73 |
| - else: |
74 |
| - return False |
75 |
| - |
76 | 49 | def get_low_power_mode(self, port_num):
|
77 | 50 | '''
|
78 | 51 | # Check for invalid port_num
|
|
0 commit comments