]> git.baikalelectronics.ru Git - kernel.git/commit
ice: split ice_parse_caps into separate functions
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 9 Jul 2020 16:16:01 +0000 (09:16 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 23 Jul 2020 21:46:33 +0000 (14:46 -0700)
commitd12d8d9b49127c04d98554cdd86a11234fd06275
tree2eb5d455961e8e2f0479113a57bc87eff6868633
parente65905e58b836084db9e66ef0e7823199a2eb06f
ice: split ice_parse_caps into separate functions

The ice_parse_caps function is used to convert the capability block data
coming from firmware into a structured format used by other parts of the
code.

The current implementation directly updates the hw->func_caps and
hw->dev_caps structures. It is directly called from within
ice_aq_discover_caps. This causes the discover_caps function to have the
side effect of modifying the HW capability structures, which is not
intuitive.

Split this function into ice_parse_dev_caps and ice_parse_func_caps.
These functions will take a pointer to the dev_caps and func_caps
respectively. Also create an ice_parse_common_caps for sharing the
capability logic that is common to device and function.

Doing so enables a future refactor to allow reading and parsing
capabilities into a local caps structure instead of modifying the
members of the HW structure directly.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c