LCOV - code coverage report
Current view: top level - drivers/net/ionic - ionic_mac_api.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 21 0.0 %
Date: 2025-02-01 18:54:23 Functions: 0 2 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright 2018-2022 Advanced Micro Devices, Inc.
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdbool.h>
       6                 :            : 
       7                 :            : #include "ionic_mac_api.h"
       8                 :            : 
       9                 :            : int32_t
      10                 :          0 : ionic_init_mac(struct ionic_hw *hw)
      11                 :            : {
      12                 :            :         int err = 0;
      13                 :            : 
      14                 :          0 :         IONIC_PRINT_CALL();
      15                 :            : 
      16                 :            :         /*
      17                 :            :          * Set the mac type
      18                 :            :          */
      19                 :          0 :         ionic_set_mac_type(hw);
      20                 :            : 
      21         [ #  # ]:          0 :         switch (hw->mac.type) {
      22                 :            :         case IONIC_MAC_CAPRI:
      23                 :            :                 break;
      24                 :          0 :         default:
      25                 :            :                 err = -EINVAL;
      26                 :          0 :                 break;
      27                 :            :         }
      28                 :            : 
      29                 :          0 :         return err;
      30                 :            : }
      31                 :            : 
      32                 :            : int32_t
      33                 :          0 : ionic_set_mac_type(struct ionic_hw *hw)
      34                 :            : {
      35                 :            :         int err = 0;
      36                 :            : 
      37                 :          0 :         IONIC_PRINT_CALL();
      38                 :            : 
      39         [ #  # ]:          0 :         if (hw->vendor_id != IONIC_PENSANDO_VENDOR_ID) {
      40                 :          0 :                 IONIC_PRINT(ERR, "Unsupported vendor id: %" PRIx32 "",
      41                 :            :                         hw->vendor_id);
      42                 :          0 :                 return -EINVAL;
      43                 :            :         }
      44                 :            : 
      45         [ #  # ]:          0 :         switch (hw->device_id) {
      46                 :          0 :         case IONIC_DEV_ID_ETH_PF:
      47                 :            :         case IONIC_DEV_ID_ETH_VF:
      48                 :            :         case IONIC_DEV_ID_ETH_MGMT:
      49                 :          0 :                 hw->mac.type = IONIC_MAC_CAPRI;
      50                 :          0 :                 break;
      51                 :          0 :         default:
      52                 :            :                 err = -EINVAL;
      53                 :          0 :                 IONIC_PRINT(ERR, "Unsupported device id: %" PRIx32 "",
      54                 :            :                         hw->device_id);
      55                 :          0 :                 break;
      56                 :            :         }
      57                 :            : 
      58                 :          0 :         IONIC_PRINT(INFO, "Mac: %d (%d)",
      59                 :            :                 hw->mac.type, err);
      60                 :            : 
      61                 :          0 :         return err;
      62                 :            : }

Generated by: LCOV version 1.14