On 17/04/2024 17:20, Michal Swiatkowski wrote:
From: Piotr Raczynski <[email protected]>

Implement subfunction driver. It is probe when subfunction port is
activated.

VSI is already created. During the probe VSI is being configured.
MAC unicast and broadcast filter is added to allow traffic to pass.

Reviewed-by: Jiri Pirko <[email protected]>
Signed-off-by: Piotr Raczynski <[email protected]>
Signed-off-by: Michal Swiatkowski <[email protected]>
---
  drivers/net/ethernet/intel/ice/Makefile     |   1 +
  drivers/net/ethernet/intel/ice/ice_main.c   |  10 ++
  drivers/net/ethernet/intel/ice/ice_sf_eth.c | 140 ++++++++++++++++++++
  drivers/net/ethernet/intel/ice/ice_sf_eth.h |   9 ++
  4 files changed, 160 insertions(+)
  create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.c


<...>

+
+/**
+ * ice_sf_driver_register - Register new auxiliary subfunction driver
+ *
+ * Return: zero on success or an error code on failure.
+ */
+int ice_sf_driver_register(void)
+{
+       return auxiliary_driver_register(&ice_sf_driver);
+}
+
+/**
+ * ice_sf_driver_unregister - Unregister new auxiliary subfunction driver
+ *
+ * Return: zero on success or an error code on failure.


this function doesn't return anything...

+ */
+void ice_sf_driver_unregister(void)
+{
+       auxiliary_driver_unregister(&ice_sf_driver);
+}
diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.h 
b/drivers/net/ethernet/intel/ice/ice_sf_eth.h
index a08f8b2bceef..e972c50f96c9 100644
--- a/drivers/net/ethernet/intel/ice/ice_sf_eth.h
+++ b/drivers/net/ethernet/intel/ice/ice_sf_eth.h
@@ -18,4 +18,13 @@ struct ice_sf_priv {
        struct devlink_port devlink_port;
  };
+static inline struct
+ice_sf_dev *ice_adev_to_sf_dev(struct auxiliary_device *adev)
+{
+       return container_of(adev, struct ice_sf_dev, adev);
+}
+
+int ice_sf_driver_register(void);
+void ice_sf_driver_unregister(void);
+
  #endif /* _ICE_SF_ETH_H_ */

Reply via email to