Skip to content

Commit

Permalink
net: pse-pd: Add support for setup_pi_matrix callback
Browse files Browse the repository at this point in the history
Implement setup_pi_matrix callback to configure the PSE PI matrix. This
functionality is invoked before registering the PSE and following the core
parsing of the pse_pis devicetree subnode.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240417-feature_poe-v9-9-242293fd1900@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Kory Maincent (Dent Project) authored and Jakub Kicinski committed Apr 19, 2024
1 parent b17181a commit 29e28d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/pse-pd/pse_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
if (ret)
return ret;

if (pcdev->ops->setup_pi_matrix) {
ret = pcdev->ops->setup_pi_matrix(pcdev);
if (ret)
return ret;
}

mutex_lock(&pse_list_mutex);
list_add(&pcdev->list, &pse_controller_list);
mutex_unlock(&pse_list_mutex);
Expand Down
2 changes: 2 additions & 0 deletions include/linux/pse-pd/pse.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct pse_control_status {
*
* @ethtool_get_status: get PSE control status for ethtool interface
* @ethtool_set_config: set PSE control configuration over ethtool interface
* @setup_pi_matrix: setup PI matrix of the PSE controller
*/
struct pse_controller_ops {
int (*ethtool_get_status)(struct pse_controller_dev *pcdev,
Expand All @@ -57,6 +58,7 @@ struct pse_controller_ops {
int (*ethtool_set_config)(struct pse_controller_dev *pcdev,
unsigned long id, struct netlink_ext_ack *extack,
const struct pse_control_config *config);
int (*setup_pi_matrix)(struct pse_controller_dev *pcdev);
};

struct module;
Expand Down

0 comments on commit 29e28d1

Please sign in to comment.