Skip to content

Commit

Permalink
Remove portname
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Aug 28, 2019
1 parent b06d273 commit 090d339
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/autoyast-rnc/networking.rnc
Expand Up @@ -100,6 +100,7 @@ device =
element type { text }? &
element layer2 { BOOLEAN}? &
element chanids { text }? &
# ignored, present for backward compatibility
element portname { text }? &
element protocol { text }? &
element router { text }?
Expand Down
27 changes: 6 additions & 21 deletions src/include/network/lan/hardware.rb
Expand Up @@ -98,19 +98,10 @@ def S390Dialog(builder:)
HSpacing(2),
VBox(
VSpacing(1),
HBox(
# TextEntry label
InputField(
Id(:qeth_portname),
Opt(:hstretch),
_("&Port Name"),
LanItems.qeth_portname
),
ComboBox(
Id(:qeth_portnumber),
_("Port Number"),
[Item(Id("0"), "0", true), Item(Id("1"), "1")]
)
ComboBox(
Id(:qeth_portnumber),
_("Port Number"),
[Item(Id("0"), "0", true), Item(Id("1"), "1")]
),
VSpacing(1),
# TextEntry label
Expand Down Expand Up @@ -166,12 +157,8 @@ def S390Dialog(builder:)
),
HSpacing(6)
)
# S/390 dialog help: QETH Port name
# S/390 dialog help: QETH Options
helptext = _(
"<p>Enter the <b>Port Name</b> for this interface (case-sensitive).</p>"
) +
# S/390 dialog help: QETH Options
_(
"<p>Enter any additional <b>Options</b> for this interface (separated by spaces).</p>"
) +
_(
Expand Down Expand Up @@ -353,7 +340,7 @@ def S390Dialog(builder:)

id = case builder.type.short_name
when "hsi" then :qeth_options
when "qeth" then :qeth_portname
when "qeth" then :qeth_options
when "iucv" then :iucv_user
else :chan_mode
end
Expand Down Expand Up @@ -415,8 +402,6 @@ def S390Dialog(builder:)
LanItems.qeth_portnumber = Convert.to_string(
UI.QueryWidget(Id(:qeth_portnumber), :Value)
)
LanItems.qeth_portname = Convert.to_string(
UI.QueryWidget(Id(:qeth_portname), :Value)
)
end
read = Convert.to_string(UI.QueryWidget(Id(:qeth_chan_read), :Value))
Expand Down
4 changes: 0 additions & 4 deletions src/include/network/lan/s390.rb
Expand Up @@ -58,7 +58,6 @@ def s390_ReadQethAttribute(devname, attrib)
#
# Currently loaded attributes are:
# QETH_LAYER2 yes/no string.
# QETH_PORTNAME portname or empty string
# QETH_PORTNUMBER portnumber or empty string
# QETH_CHANIDS read/write/control channel ids separated by space (compatibility requirement)
#
Expand All @@ -74,9 +73,6 @@ def s390_ReadQethConfig(devname)
qeth_layer2 = s390_ReadQethAttribute(devname, "layer2") == "1" ? "yes" : "no"
result = Builtins.add(result, "QETH_LAYER2", qeth_layer2)

qeth_portname = s390_ReadQethAttribute(devname, "portname")
result = Builtins.add(result, "QETH_PORTNAME", qeth_portname)

qeth_portno = s390_ReadQethAttribute(devname, "portno")
result = Builtins.add(result, "QETH_PORTNUMBER", qeth_portno)

Expand Down
15 changes: 0 additions & 15 deletions src/modules/LanItems.rb
Expand Up @@ -166,7 +166,6 @@ def main
@wl_bitrates = nil

# s390 options
@qeth_portname = ""
@qeth_portnumber = ""
# * ctc as PROTOCOL (or ctc mode, number in { 0, 1, .., 4 }, default: 0)
@chan_mode = "0"
Expand Down Expand Up @@ -1601,7 +1600,6 @@ def SetS390Vars(devmap, defaults)
return if !Arch.s390
d = defaults.merge(devmap)

@qeth_portname = d["QETH_PORTNAME"]
@qeth_portnumber = d["QETH_PORTNUMBER"]
@qeth_layer2 = d["QETH_LAYER2"] == "yes"
@qeth_chanids = d["QETH_CHANIDS"]
Expand Down Expand Up @@ -2054,7 +2052,6 @@ def createS390Device(dev_attrs = {})
@type = dev_attrs["type"] || ""
@qeth_chanids = dev_attrs["chanids"] || ""
@qeth_layer2 = dev_attrs.fetch("layer2", false)
@qeth_portname = dev_attrs["portname"] || ""
@chan_mode = dev_attrs["protocol"] || ""
@iucv_user = dev_attrs["router"] || ""
end
Expand All @@ -2071,11 +2068,6 @@ def createS390Device(dev_attrs = {})
else
""
end
@portname_param = if Ops.greater_than(Builtins.size(@qeth_portname), 0)
Builtins.sformat("-p %1", @qeth_portname.shellescape)
else
""
end
@options_param = if Ops.greater_than(Builtins.size(@qeth_options), 0)
Builtins.sformat("-o %1", @qeth_options.shellescape)
else
Expand All @@ -2085,7 +2077,6 @@ def createS390Device(dev_attrs = {})
"/sbin/qeth_configure %1 %2 %3 %4 %5 1",
@options_param,
@qeth_layer2 ? "-l" : "",
@portname_param,
@portnumber_param,
@qeth_chanids
)
Expand Down Expand Up @@ -2487,10 +2478,6 @@ def export_udevs(devices)
end

# we already know that kernel device exist, otherwise next above would apply
# FIXME: It seems that it is not always the case (bsc#1124002)
portname_file = "/sys/class/net/#{device}/device/portname"
portname = ::File.exist?(portname_file) ? ::File.read(portname_file).strip : ""

protocol_file = "/sys/class/net/#{device}/device/protocol"
protocol = ::File.exist?(protocol_file) ? ::File.read(protocol_file).strip : ""

Expand All @@ -2504,7 +2491,6 @@ def export_udevs(devices)
layer2 = layer2_ret == 0
Ops.set(ay, ["s390-devices", device], "type" => device_type)
Ops.set(ay, ["s390-devices", device, "chanids"], chanids) if !chanids.empty?
Ops.set(ay, ["s390-devices", device, "portname"], portname) if !portname.empty?
Ops.set(ay, ["s390-devices", device, "protocol"], protocol) if !protocol.empty?
Ops.set(ay, ["s390-devices", device, "layer2"], true) if layer2
port0 = SCR.Execute(
Expand Down Expand Up @@ -2630,7 +2616,6 @@ def yast_config
publish_variable :wl_enc_modes, "list <string>"
publish_variable :wl_channels, "list <string>"
publish_variable :wl_bitrates, "list <string>"
publish_variable :qeth_portname, "string"
publish_variable :qeth_portnumber, "string"
publish_variable :chan_mode, "string"
publish_variable :qeth_options, "string"
Expand Down

0 comments on commit 090d339

Please sign in to comment.