Commit 5dc5303c authored by Franco Fichtner's avatar Franco Fichtner

interfaces: more stuff ported, IFCAP_* and IFF_* flags are gone

It's actually better to not pull any ABI stuff into a scripting
language.  It's so much easier to work with strings and command
line tooles.  The timing isn't criticial here...
parent f5e93272
...@@ -3037,38 +3037,14 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven ...@@ -3037,38 +3037,14 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
/* skip vlans for checksumming and polling */ /* skip vlans for checksumming and polling */
if (!stristr($realif, "_vlan") && is_array($options)) { if (!stristr($realif, "_vlan") && is_array($options)) {
$flags_on = 0; legacy_interface_flags($realhwif, sprintf(
$flags_off = 0; '%stxcsum %srxcsum %stso %slro %spolling',
if(isset($config['system']['disablechecksumoffloading'])) { isset($config['system']['disablechecksumoffloading']) ? '-' : '',
if (isset($options['encaps']['txcsum'])) isset($config['system']['disablechecksumoffloading']) ? '-' : '',
$flags_off |= IFCAP_TXCSUM; isset($config['system']['disablesegmentationoffloading']) ? '-' : '',
if (isset($options['encaps']['rxcsum'])) isset($config['system']['disablelargereceiveoffloading']) ? '-' : '',
$flags_off |= IFCAP_RXCSUM; isset($config['system']['polling']) ? '' : '-'
} else { ));
if (isset($options['caps']['txcsum']))
$flags_on |= IFCAP_TXCSUM;
if (isset($options['caps']['rxcsum']))
$flags_on |= IFCAP_RXCSUM;
}
if(isset($config['system']['disablesegmentationoffloading']))
$flags_off |= IFCAP_TSO;
else if (isset($options['caps']['tso']) || isset($options['caps']['tso4']) || isset($options['caps']['tso6']))
$flags_on |= IFCAP_TSO;
if(isset($config['system']['disablelargereceiveoffloading']))
$flags_off |= IFCAP_LRO;
else if (isset($options['caps']['lro']))
$flags_on |= IFCAP_LRO;
/* if the NIC supports polling *AND* it is enabled in the GUI */
if (!isset($config['system']['polling']))
$flags_off |= IFCAP_POLLING;
else if (isset($options['caps']['polling']))
$flags_on |= IFCAP_POLLING;
pfSense_interface_capabilities($realhwif, -$flags_off);
pfSense_interface_capabilities($realhwif, $flags_on);
} }
/* invalidate interface/ip/sn cache */ /* invalidate interface/ip/sn cache */
......
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