Commit 17161c34 authored by Rob Herring's avatar Rob Herring Committed by David S. Miller

dt-bindings: net: ethernet-controller: Rework 'fixed-link' schema

While the if/then schemas mostly work, there's a few issues. The 'allOf'
schema will also be true if 'fixed-link' is not an array or object as a
false 'if' schema (without an 'else') will be true. In the array case
doesn't set the type (uint32-array) in the 'then' clause. In the node case,
'additionalProperties' is missing.

Rework the schema to use oneOf with each possible type.
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b20a7ca8
...@@ -167,70 +167,65 @@ properties: ...@@ -167,70 +167,65 @@ properties:
- in-band-status - in-band-status
fixed-link: fixed-link:
allOf: oneOf:
- if: - $ref: /schemas/types.yaml#/definitions/uint32-array
type: array deprecated: true
then: items:
deprecated: true - minimum: 0
items: maximum: 31
- minimum: 0 description:
maximum: 31 Emulated PHY ID, choose any but unique to the all
description: specified fixed-links
Emulated PHY ID, choose any but unique to the all
specified fixed-links - enum: [0, 1]
description:
- enum: [0, 1] Duplex configuration. 0 for half duplex or 1 for
description: full duplex
Duplex configuration. 0 for half duplex or 1 for
full duplex - enum: [10, 100, 1000, 2500, 10000]
description:
- enum: [10, 100, 1000, 2500, 10000] Link speed in Mbits/sec.
description:
Link speed in Mbits/sec. - enum: [0, 1]
description:
- enum: [0, 1] Pause configuration. 0 for no pause, 1 for pause
description:
Pause configuration. 0 for no pause, 1 for pause - enum: [0, 1]
description:
- enum: [0, 1] Asymmetric pause configuration. 0 for no asymmetric
description: pause, 1 for asymmetric pause
Asymmetric pause configuration. 0 for no asymmetric - type: object
pause, 1 for asymmetric pause additionalProperties: false
properties:
speed:
- if: description:
type: object Link speed.
then: $ref: /schemas/types.yaml#/definitions/uint32
properties: enum: [10, 100, 1000, 2500, 10000]
speed:
description: full-duplex:
Link speed. $ref: /schemas/types.yaml#/definitions/flag
$ref: /schemas/types.yaml#/definitions/uint32 description:
enum: [10, 100, 1000, 2500, 10000] Indicates that full-duplex is used. When absent, half
duplex is assumed.
full-duplex:
$ref: /schemas/types.yaml#/definitions/flag pause:
description: $ref: /schemas/types.yaml#definitions/flag
Indicates that full-duplex is used. When absent, half description:
duplex is assumed. Indicates that pause should be enabled.
pause: asym-pause:
$ref: /schemas/types.yaml#definitions/flag $ref: /schemas/types.yaml#/definitions/flag
description: description:
Indicates that pause should be enabled. Indicates that asym_pause should be enabled.
asym-pause: link-gpios:
$ref: /schemas/types.yaml#/definitions/flag maxItems: 1
description: description:
Indicates that asym_pause should be enabled. GPIO to determine if the link is up
link-gpios: required:
maxItems: 1 - speed
description:
GPIO to determine if the link is up
required:
- speed
additionalProperties: true additionalProperties: true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment