net/ice/base: support NVM access commands
Add a new structure, ice_nvm_access, used to request access to read or
write certain NVM related registers.
The structure is used by NVM Update to request read or write of specific
NVM registers in order to perform updates.
Additionally, there is a command to request the driver "features"
structure which represents data about what features of the NVM access
interface the driver supports.
Implement ice_handle_nvm_access to parse the access request and perform
the necessary function.
This function verifies that the access request is valid. If so, the
function will delegate to perform the register read, register write, or
copying of the driver ice_nvm_features structure.
If the request is invalid, the function will report a suitable error
codition that can be propagated out.
Only a subset of registers is accessible, and all other registers will
be rejected with ICE_ERR_OUT_OF_RANGE.
When reading, the contents of the variable sized data buffer will be
used as storage for returning the register value. When writing, the
contents will be used as input for the value to write to the register.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>