iavf: delete unused iavf_mac_info fields
authorMichal Schmidt <mschmidt@redhat.com>
Wed, 18 Oct 2023 11:15:27 +0000 (13:15 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Oct 2023 11:23:14 +0000 (13:23 +0200)
'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused.
'type' is write-only. Delete all three.

The function iavf_set_mac_type that sets 'type' also checks if the PCI
vendor ID is Intel. This is unnecessary. Delete the whole function.

If in the future there's a need for the MAC type (or other PCI
ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[]
for this purpose.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231018111527.78194-1-mschmidt@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/intel/iavf/iavf_common.c
drivers/net/ethernet/intel/iavf/iavf_main.c
drivers/net/ethernet/intel/iavf/iavf_prototype.h
drivers/net/ethernet/intel/iavf/iavf_type.h

index 1afd761d8052080942ce796e560fa7478bbf3a1b..8091e6feca0141e8c4f556b8b1b7b580e759a2e1 100644 (file)
@@ -6,38 +6,6 @@
 #include "iavf_prototype.h"
 #include <linux/avf/virtchnl.h>
 
-/**
- * iavf_set_mac_type - Sets MAC type
- * @hw: pointer to the HW structure
- *
- * This function sets the mac type of the adapter based on the
- * vendor ID and device ID stored in the hw structure.
- **/
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
-{
-       enum iavf_status status = 0;
-
-       if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
-               switch (hw->device_id) {
-               case IAVF_DEV_ID_X722_VF:
-                       hw->mac.type = IAVF_MAC_X722_VF;
-                       break;
-               case IAVF_DEV_ID_VF:
-               case IAVF_DEV_ID_VF_HV:
-               case IAVF_DEV_ID_ADAPTIVE_VF:
-                       hw->mac.type = IAVF_MAC_VF;
-                       break;
-               default:
-                       hw->mac.type = IAVF_MAC_GENERIC;
-                       break;
-               }
-       } else {
-               status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
-       }
-
-       return status;
-}
-
 /**
  * iavf_aq_str - convert AQ err code to a string
  * @hw: pointer to the HW structure
index 43c47c633162675ff10e41855606e99b69aeabb0..7fb7dfe6e13f62637311528e70520362d7e94d58 100644 (file)
@@ -2356,11 +2356,6 @@ static void iavf_startup(struct iavf_adapter *adapter)
        /* driver loaded, probe complete */
        adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED;
        adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
-       status = iavf_set_mac_type(hw);
-       if (status) {
-               dev_err(&pdev->dev, "Failed to set MAC type (%d)\n", status);
-               goto err;
-       }
 
        ret = iavf_check_reset_complete(hw);
        if (ret) {
index 940cb4203fbe8370929e12b9b8540a776190f960..4a48e6171405fc44bfe86dd5c3b2e976b533d544 100644 (file)
@@ -45,8 +45,6 @@ enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
 enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
                                     struct iavf_aqc_get_set_rss_key_data *key);
 
-enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
-
 extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
 
 static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
index 9f1f523807c4e6ada3d3394819f9e538c07382eb..2b6a207fa441dedb2c32af31738651ab377bc707 100644 (file)
@@ -69,15 +69,6 @@ enum iavf_debug_mask {
  * the Firmware and AdminQ are intended to insulate the driver from most of the
  * future changes, but these structures will also do part of the job.
  */
-enum iavf_mac_type {
-       IAVF_MAC_UNKNOWN = 0,
-       IAVF_MAC_XL710,
-       IAVF_MAC_VF,
-       IAVF_MAC_X722,
-       IAVF_MAC_X722_VF,
-       IAVF_MAC_GENERIC,
-};
-
 enum iavf_vsi_type {
        IAVF_VSI_MAIN   = 0,
        IAVF_VSI_VMDQ1  = 1,
@@ -110,11 +101,8 @@ struct iavf_hw_capabilities {
 };
 
 struct iavf_mac_info {
-       enum iavf_mac_type type;
        u8 addr[ETH_ALEN];
        u8 perm_addr[ETH_ALEN];
-       u8 san_addr[ETH_ALEN];
-       u16 max_fcoeq;
 };
 
 /* PCI bus types */