Lines Matching +full:tp +full:- +full:link

2 # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
15 Verify and convert command-line arguments to the ynl-compatible request.
18 valid_attrs.remove('header') # not user-provided
42 Pretty-print a set of fields from the reply. desc specifies the
50 field, name, tp = spec
53 tp = 'int'
56 if tp == 'yn':
58 elif tp == 'bool' or isinstance(value, bool):
67 Print out the speed-like strings from the value dict.
69 speed_re = re.compile(r'[0-9]+base[^/]+/.+')
79 'dev-name': args.device,
96 if msg['header']['dev-name'] == args.device:
108 Convert ynl-formatted bitmask to a dict of bit=value.
125 parser.add_argument('--json', action=argparse.BooleanOptionalAction)
126 parser.add_argument('--show-priv-flags', action=argparse.BooleanOptionalAction)
127 parser.add_argument('--set-priv-flags', action=argparse.BooleanOptionalAction)
128 parser.add_argument('--show-eee', action=argparse.BooleanOptionalAction)
129 parser.add_argument('--set-eee', action=argparse.BooleanOptionalAction)
130 parser.add_argument('-a', '--show-pause', action=argparse.BooleanOptionalAction)
131 parser.add_argument('-A', '--set-pause', action=argparse.BooleanOptionalAction)
132 parser.add_argument('-c', '--show-coalesce', action=argparse.BooleanOptionalAction)
133 parser.add_argument('-C', '--set-coalesce', action=argparse.BooleanOptionalAction)
134 parser.add_argument('-g', '--show-ring', action=argparse.BooleanOptionalAction)
135 parser.add_argument('-G', '--set-ring', action=argparse.BooleanOptionalAction)
136 parser.add_argument('-k', '--show-features', action=argparse.BooleanOptionalAction)
137 parser.add_argument('-K', '--set-features', action=argparse.BooleanOptionalAction)
138 parser.add_argument('-l', '--show-channels', action=argparse.BooleanOptionalAction)
139 parser.add_argument('-L', '--set-channels', action=argparse.BooleanOptionalAction)
140 parser.add_argument('-T', '--show-time-stamping', action=argparse.BooleanOptionalAction)
141 parser.add_argument('-S', '--statistics', action=argparse.BooleanOptionalAction)
142 # TODO: --show-tunnels tunnel-info-get
143 # TODO: --show-module module-get
144 # TODO: --get-plca-cfg plca-get
145 # TODO: --get-plca-status plca-get-status
146 # TODO: --show-mm mm-get
147 # TODO: --show-fec fec-get
148 # TODO: --dump-module-eerpom module-eeprom-get
149 # TODO: pse-get
150 # TODO: rss-get
160 '../../../Documentation/netlink/genetlink-legacy.yaml')
170 return doit(ynl, args, 'eee-set')
173 return doit(ynl, args, 'pause-set')
176 return doit(ynl, args, 'coalesce-set')
184 return doit(ynl, args, 'channels-set')
187 return doit(ynl, args, 'rings-set')
190 flags = bits_to_dict(dumpit(ynl, args, 'privflags-get')['flags'])
195 eee = dumpit(ynl, args, 'eee-get')
196 ours = bits_to_dict(eee['modes-ours'])
197 peer = bits_to_dict(eee['modes-peer'])
202 status = status + ' - active'
204 status = status + ' - inactive'
209 print_field(eee, ('tx-lpi-timer', 'Tx LPI'))
210 print_speed('Advertised EEE link modes', ours)
211 print_speed('Link partner advertised EEE link modes', peer)
216 print_field(dumpit(ynl, args, 'pause-get'),
223 print_field(dumpit(ynl, args, 'coalesce-get'))
227 reply = dumpit(ynl, args, 'features-get')
254 reply = dumpit(ynl, args, 'channels-get')
257 print(f'Pre-set maximums:')
259 ('rx-max', 'RX'),
260 ('tx-max', 'TX'),
261 ('other-max', 'Other'),
262 ('combined-max', 'Combined'))
266 ('rx-count', 'RX'),
267 ('tx-count', 'TX'),
268 ('other-count', 'Other'),
269 ('combined-count', 'Combined'))
274 reply = dumpit(ynl, args, 'channels-get')
278 print(f'Pre-set maximums:')
280 ('rx-max', 'RX'),
281 ('rx-mini-max', 'RX Mini'),
282 ('rx-jumbo-max', 'RX Jumbo'),
283 ('tx-max', 'TX'))
288 ('rx-mini', 'RX Mini'),
289 ('rx-jumbo', 'RX Jumbo'),
293 ('rx-buf-len', 'RX Buf Len'),
294 ('cqe-size', 'CQE Size'),
295 ('tx-push', 'TX Push', 'bool'))
303 strset = dumpit(ynl, args, 'strset-get')
313 #{ 'name': 'eth-phy', 'value': True },
314 { 'name': 'eth-mac', 'value': True },
315 #{ 'name': 'eth-ctrl', 'value': True },
322 rsp = dumpit(ynl, args, 'stats-get', req)
333 tsinfo = dumpit(ynl, args, 'tsinfo-get', req)
340 print(f'PTP Hardware Clock: {tsinfo["phc-index"]}')
343 [print(f'\t{v}') for v in bits_to_dict(tsinfo['tx-types'])]
346 [print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])]
353 linkmodes = dumpit(ynl, args, 'linkmodes-get')
356 supported_ports = ('TP', 'AUI', 'BNC', 'MII', 'FIBRE', 'Backplane')
360 print_speed('Supported link modes', ours)
363 print_field(ours, ('Autoneg', 'Supports auto-negotiation', 'yn'))
390 print(f'Auto-negotiation: {autoneg}')
401 linkinfo = dumpit(ynl, args, 'linkinfo-get')
416 mdix = mdix_ctrl.get(linkinfo['tp-mdix-ctrl'], None)
420 mdix = mdix_ctrl.get(linkinfo['tp-mdix'], 'Unknown (auto)')
421 print(f'MDI-X: {mdix}')
423 debug = dumpit(ynl, args, 'debug-get')
427 linkstate = dumpit(ynl, args, 'linkstate-get')
432 # TODO: wol-get
433 detected = detected_states.get(linkstate['link'], 'unknown')
434 print(f'Link detected: {detected}')