]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fwctl/bnxt_en: Refactor aux bus functions to be more generic
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Sat, 14 Mar 2026 15:16:02 +0000 (08:16 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 27 Mar 2026 12:12:36 +0000 (09:12 -0300)
commit2c7c85c8c7881d57c5fa1114f4b0dbd7fc53a36f
tree8713bcc8b3685c1f310d4512c0246657de1ff2dc
parent7be18a1fa00eab5283b35c13e26c6b76fcaab9ce
fwctl/bnxt_en: Refactor aux bus functions to be more generic

Up until now there was only one auxiliary device that bnxt
created and that was for RoCE driver. bnxt fwctl is also
going to use an aux bus device that bnxt should create.
This requires some nomenclature changes and refactoring of
the existing bnxt aux dev functions.

Convert 'aux_priv' and 'edev' members of struct bnxt into
arrays where each element contains supported auxbus device's
data. Move struct bnxt_aux_priv from bnxt.h to ulp.h because
that is where it belongs. Make aux bus init/uninit/add/del
functions more generic which will loop through all the aux
device types. Make bnxt_ulp_start/stop functions (the only
other common functions applicable to any aux device) loop
through the aux devices to update their config and states.
Make callers of bnxt_ulp_start() call it only when there
are no errors.

Also, as an improvement in code, bnxt_register_dev() can skip
unnecessary dereferencing of edev from bp, instead use the
edev pointer from the function parameter.

Future patches will reuse these functions to add an aux bus
device for fwctl.

Link: https://patch.msgid.link/r/20260314151605.932749-3-pavan.chebbi@broadcom.com
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
include/linux/bnxt/ulp.h