Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/cpufreq/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 8 kB image not shown  

Quelle  i40e_common.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2013 - 2021 Intel Corporation. */

#include <linux/avf/virtchnl.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/pci.h>
#include "i40e_adminq_cmd.h"
#include "i40e_devids.h"
#include "i40e_prototype.h"
#include "i40e_register.h"

/**
 * i40e_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.
 **/

int i40e_set_mac_type(struct i40e_hw *hw)
{
 int status = 0;

 if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
  switch (hw->device_id) {
  case I40E_DEV_ID_SFP_XL710:
  case I40E_DEV_ID_QEMU:
  case I40E_DEV_ID_KX_B:
  case I40E_DEV_ID_KX_C:
  case I40E_DEV_ID_QSFP_A:
  case I40E_DEV_ID_QSFP_B:
  case I40E_DEV_ID_QSFP_C:
  case I40E_DEV_ID_1G_BASE_T_BC:
  case I40E_DEV_ID_5G_BASE_T_BC:
  case I40E_DEV_ID_10G_BASE_T:
  case I40E_DEV_ID_10G_BASE_T4:
  case I40E_DEV_ID_10G_BASE_T_BC:
  case I40E_DEV_ID_10G_B:
  case I40E_DEV_ID_10G_SFP:
  case I40E_DEV_ID_20G_KR2:
  case I40E_DEV_ID_20G_KR2_A:
  case I40E_DEV_ID_25G_B:
  case I40E_DEV_ID_25G_SFP28:
  case I40E_DEV_ID_X710_N3000:
  case I40E_DEV_ID_XXV710_N3000:
   hw->mac.type = I40E_MAC_XL710;
   break;
  case I40E_DEV_ID_KX_X722:
  case I40E_DEV_ID_QSFP_X722:
  case I40E_DEV_ID_SFP_X722:
  case I40E_DEV_ID_1G_BASE_T_X722:
  case I40E_DEV_ID_10G_BASE_T_X722:
  case I40E_DEV_ID_SFP_I_X722:
  case I40E_DEV_ID_SFP_X722_A:
   hw->mac.type = I40E_MAC_X722;
   break;
  default:
   hw->mac.type = I40E_MAC_GENERIC;
   break;
  }
 } else {
  status = -ENODEV;
 }

 hw_dbg(hw, "i40e_set_mac_type found mac: %d, returns: %d\n",
    hw->mac.type, status);
 return status;
}

/**
 * i40e_debug_aq
 * @hw: debug mask related to admin queue
 * @mask: debug mask
 * @desc: pointer to admin queue descriptor
 * @buffer: pointer to command buffer
 * @buf_len: max length of buffer
 *
 * Dumps debug log about adminq command with descriptor contents.
 **/

void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
     void *buffer, u16 buf_len)
{
 struct libie_aq_desc *aq_desc = (struct libie_aq_desc *)desc;
 u32 effective_mask = hw->debug_mask & mask;
 char prefix[27];
 u16 len;
 u8 *buf = (u8 *)buffer;

 if (!effective_mask || !desc)
  return;

 len = le16_to_cpu(aq_desc->datalen);

 i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR,
     "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
     le16_to_cpu(aq_desc->opcode),
     le16_to_cpu(aq_desc->flags),
     le16_to_cpu(aq_desc->datalen),
     le16_to_cpu(aq_desc->retval));
 i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR,
     "\tcookie (h,l) 0x%08X 0x%08X\n",
     le32_to_cpu(aq_desc->cookie_high),
     le32_to_cpu(aq_desc->cookie_low));
 i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR,
     "\tparam (0,1) 0x%08X 0x%08X\n",
     le32_to_cpu(aq_desc->params.generic.param0),
     le32_to_cpu(aq_desc->params.generic.param1));
 i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR,
     "\taddr (h,l) 0x%08X 0x%08X\n",
     le32_to_cpu(aq_desc->params.generic.addr_high),
     le32_to_cpu(aq_desc->params.generic.addr_low));

 if (buffer && buf_len != 0 && len != 0 &&
     (effective_mask & I40E_DEBUG_AQ_DESC_BUFFER)) {
  i40e_debug(hw, mask, "AQ CMD Buffer:\n");
  if (buf_len < len)
   len = buf_len;

  snprintf(prefix, sizeof(prefix),
    "i40e %02x:%02x.%x: \t0x",
    hw->bus.bus_id,
    hw->bus.device,
    hw->bus.func);

  print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET,
          16, 1, buf, len, false);
 }
}

/**
 * i40e_check_asq_alive
 * @hw: pointer to the hw struct
 *
 * Returns true if Queue is enabled else false.
 **/

bool i40e_check_asq_alive(struct i40e_hw *hw)
{
 /* Check if the queue is initialized */
 if (!hw->aq.asq.count)
  return false;

 return !!(rd32(hw, I40E_PF_ATQLEN) & I40E_PF_ATQLEN_ATQENABLE_MASK);
}

/**
 * i40e_aq_queue_shutdown
 * @hw: pointer to the hw struct
 * @unloading: is the driver unloading itself
 *
 * Tell the Firmware that we're shutting down the AdminQ and whether
 * or not the driver is unloading as well.
 **/

int i40e_aq_queue_shutdown(struct i40e_hw *hw,
      bool unloading)
{
 struct i40e_aqc_queue_shutdown *cmd;
 struct libie_aq_desc desc;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_queue_shutdown);

 cmd = libie_aq_raw(&desc);
 if (unloading)
  cmd->driver_unloading = cpu_to_le32(I40E_AQ_DRIVER_UNLOADING);
 status = i40e_asq_send_command(hw, &desc, NULL, 0, NULL);

 return status;
}

/**
 * i40e_aq_get_set_rss_lut
 * @hw: pointer to the hardware structure
 * @vsi_id: vsi fw index
 * @pf_lut: for PF table set true, for VSI table set false
 * @lut: pointer to the lut buffer provided by the caller
 * @lut_size: size of the lut buffer
 * @set: set true to set the table, false to get the table
 *
 * Internal function to get or set RSS look up table
 **/

static int i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
       u16 vsi_id, bool pf_lut,
       u8 *lut, u16 lut_size,
       bool set)
{
 struct i40e_aqc_get_set_rss_lut *cmd_resp;
 struct libie_aq_desc desc;
 int status;
 u16 flags;

 if (set)
  i40e_fill_default_direct_cmd_desc(&desc,
        i40e_aqc_opc_set_rss_lut);
 else
  i40e_fill_default_direct_cmd_desc(&desc,
        i40e_aqc_opc_get_rss_lut);

 cmd_resp = libie_aq_raw(&desc);
 /* Indirect command */
 desc.flags |= cpu_to_le16((u16)LIBIE_AQ_FLAG_BUF);
 desc.flags |= cpu_to_le16((u16)LIBIE_AQ_FLAG_RD);

 vsi_id = FIELD_PREP(I40E_AQC_SET_RSS_LUT_VSI_ID_MASK, vsi_id) |
   FIELD_PREP(I40E_AQC_SET_RSS_LUT_VSI_VALID, 1);
 cmd_resp->vsi_id = cpu_to_le16(vsi_id);

 if (pf_lut)
  flags = FIELD_PREP(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK,
       I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF);
 else
  flags = FIELD_PREP(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK,
       I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI);

 cmd_resp->flags/* Copyright(c) 2013 - 2021 Intel Corporation. */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 return status;
}

/**
 * i40e_aq_get_rss_lut
 * @hw: pointer to the hardware structure
 * @vsi_id: vsi fw index
 * @pf_lut: for PF table set true, for VSI table set false
 * @lut: pointer to the lut buffer provided by the caller
 * @lut_size: size of the lut buffer
 *
 * get the RSS lookup table, PF or VSI type
 **/

int i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id,
   pf_lut u8*, u16lut_size)
{
 return i40e_aq_get_set_rss_lut :
         false;
}

/**
 * i40e_aq_set_rss_lut
 * @hw: pointer to the hardware structure
 * @vsi_id: vsi fw index
 * @pf_lut: for PF table set true, for VSI table set false
 * @lut: pointer to the lut buffer provided by the caller
 * @lut_size: size of the lut buffer
 *
 * set the RSS lookup table, PF or VSI type
 **/

int i40e_aq_set_rss_lutbreak;
  bool pf_lut *lut, lut_size
{java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  i40e_aq_get_set_rss_lut,vsi_idpf_lut,lut , true
}

/** >mac.type status);
 * i40e_aq_get_set_rss_key
 * @hw: pointer to the hw struct
 * @vsi_id: vsi fw index
 * @key: pointer to key info struct
 * @set: set true to set the key, false to get the key
 *
 * get the RSS key per VSI
 **/

static int i40e_aq_get_set_rss_key(struct i40e_hw *hw,
       u16 vsi_id,
       struct i40e_aqc_get_set_rss_key_data *key,
       java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
{
 u16 * @desc: pointer to admin queue descriptor
 struct i40e_aqc_get_set_rss_key *cmd_resp * @buf_len: max length of buffer
 struct libie_aq_desc desc;
 int status;

 if  *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  i40e_fill_default_direct_cmd_desc&,
        i40e_aqc_opc_set_rss_key);
 else
  i40e_fill_default_direct_cmd_descvoid*, u16 buf_len
      i40e_aqc_opc_get_rss_key

 cmd_respchar prefix[27];
 Indirect command*
 .flags | cpu_to_le16((u16LIBIE_AQ_FLAG_BUF;
 if(effective_mask|!)

 len =le16_to_cpuaq_desc-datalen;
  FIELD_PREP(I40E_AQC_SET_RSS_KEY_VSI_VALID1;
resp- = cpu_to_le16vsi_idjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

status (hw,&desc, key key_size NULL);

 return status;
}

/**
 * i40e_aq_get_rss_key
 * @hw: pointer to the hw struct
 * @vsi_id: vsi fw index
 * @key: pointer to key info struct
 *
 **/

int i40e_aq_get_rss_key(struct i40e_hw *hw,
   u16 vsi_id,
  structi40e_aqc_get_set_rss_key_data*)
{
 return i40e_aq_get_set_rss_key(hw, vsi_idkey false;
}

/**
 * i40e_aq_set_rss_key
 * @hw: pointer to the hw struct
 * @vsi_id: vsi fw index
 * @key: pointer to key info struct
 *
 * set the RSS key per VSI
 **/

int i40e_aq_set_rss_key(struct i40e_hw *hw,
   u16 vsi_id,
   struct i40e_aqc_get_set_rss_key_data *    (aq_desc->paramsgeneric.param0),
{
 4e_debug, mask&I40E_DEBUG_AQ_DESCRIPTOR
}

/**
 * i40e_init_shared_code - Initialize the shared code
 * @hw: pointer to hardware structure
 *
 * This assigns the MAC type and PHY code and inits the NVM.
 * Does not touch the hardware. This function must be called prior to any
 * other function in the shared code. The i40e_hw structure should be
 * memset to 0 prior to calling this function.  The following fields in
 * hw structure should be filled in prior to calling this function:
 * hw_addr, back, device_id, vendor_id, subsystem_device_id,
 * subsystem_vendor_id, and revision_id
 **/

int i40e_init_shared_code(struct i40e_hw *hw)
{
 u32 port, ari, func_rid;
 int status =java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0

 i40e_set_mac_type(hw);

 switch (hw->mac.type) {
 case I40E_MAC_XL710:
 case I40E_MAC_X722:
  break;
 efault
 r -ENODEV
}

 hw->phy.get_link_info = true;

 /* Determine port number and PF number*/ hw-.bus_id
 port FIELD_GET(,
    rd32>bus);
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 =(,
   rd32(hw, I40E_GLPCI_CAPSUP
 func_rid
 if (ari)
 * Returns true if Queue 
else
  hw->pf_id = (u8)(func_rid & 0x7);

 status (hw;
 return status;
}


  -Retrieve  addresses
 * @hw
  @: a  indicator what were to  addr
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 * or not the driver
 */
static int
i40e_aq_mac_address_read i40e_hw*w
    u16 *flags,
uct 4e_aqc_mac_address_read_data*ddrs
     i40e_asq_cmd_detailscmd_details
{
 struct intstatus
 structlibie_aq_desc desc;
i status;

 i40e_fill_default_direct_cmd_desc, i40e_aqc_opc_mac_address_read
 cmd_data libie_aq_raw(&desc;
.flags| cpu_to_le16java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

 status = i40e_asq_send_commandjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    * @hw: pointer to the hardware 
 * * @pf_lut: for PF table set true,  * @lut: pointer to the lut buffer * @lut_size: size of the * @set: set true to set the table *

 return status;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/**
 * i40e_aq_mac_address_write - Change the MAC addresses
 * @hw: pointer to the hw struct
 * @flags: indicates which MAC to be written
 * @mac_addr: address to write
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_mac_address_writeint;
         flags, u8 *ac_addr
        struct *cmd_details
{
 struct i40e_aqc_mac_address_write *cmd_data
 struct libie_aq_desc desc
 intstatus

 i40e_fill_default_direct_cmd_desc      i40e_aqc_opc_get_rss_lut);
  write);
 cmd_data libie_aq_raw&desc);
 cmd_data->command_flags=cpu_to_le16flags;
 cmd_data->mac_sah cpu_to_le16()mac_addr[]< 8|mac_addr1];
 cmd_data-  = FIELD_PREPI40E_AQC_SET_RSS_LUT_VSI_ID_MASK vsi_id|
     ((u32)mac_addr[3] << 16) |
     ((u32)mac_addr[4] << 8) |
     mac_addr[5]);

 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);

 return status FIELD_PREPI40E_AQC_SET_RSS_LUT_VSI_VALID 1;
}

/**
 * i40e_get_mac_addr - get MAC address
 * @hw: pointer to the HW structure
 * @mac_addr: pointer to MAC address
 *
 * Reads the adapter's MAC address from register
 **/

inti40e_get_mac_addr i40e_hw*w, *mac_addr
{
 tructi40e_aqc_mac_address_read_data addrs;
  flags=0;
 int status cmd_resp-flags = cpu_to_le16flags

 status = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL)

 if (flags & * @lut: pointer to the lut buffer provided by the caller
  ether_addr_copy(mac_addr, addrs.pf_lan_mac);

 return status;
}

/**
 * i40e_get_port_mac_addr - get Port MAC address
 * @hw: pointer to the HW structure
 * @mac_addr: pointer to Port MAC address
 *
 * Reads the adapter's Port MAC address
 **/

int i40e_get_port_mac_addr(struct i40e_hw * @lut_size: size of the lut buffer
{
 struct i40e_aqc_mac_address_read_data addrs;
 u16 = 0;
intstatus

  = i40e_aq_mac_address_readhw, &, &addrs NULL)
  (status
  return

 if * @hw: pointer to the hardware structure
  ether_addr_copy * @pf_lut: for PF table set true * @lut: pointer to the lut buffer provided by the
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  status = -EINVAL;

return;
}

/**
 * i40e_pre_tx_queue_cfg - pre tx queue configure
 * @hw: pointer to the HW structure
 * @queue: target PF queue index
 * @enable: state change request
 *
 * Handles hw requirement to indicate intention to enable
 * or disable target queue.
 **/

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 u32 abs_queue_idx = hw-      vsi_id
 u32reg_block=0
 u32 reg_val;

 if (abs_queue_idx> 18){
  reg_block = abs_queue_idx / 128;
  abs_queue_idx %= 128;
 }

 reg_val = rd32(hw, I40E_GLLAN_TXPRE_QDIS(reg_block));
 reg_val {
 reg_val |= (abs_queue_idx << I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT);

ble
 reg_val|=I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK
 int status
 if(et

 wr32(hw, I40E_GLLAN_TXPRE_QDIS(reg_block), reg_val);
}

/**
 *  i40e_get_pba_string - Reads part number string from EEPROM
 *  @hw: pointer to hardware structure
 *
 *  Reads the part number string from the EEPROM and stores it
 *  into newly allocated buffer and saves resulting pointer
 *  to i40e_hw->pba_id field.
 **/

void i40e_get_pba_string(struct i40e_hw *hw)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  0java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 u16 = ;
 u16 pba_sizevsi_id=(, ) |
= ;
i status
   = (,&, , key_size NULL
 u16;

 status * i40e_aq_get_rss_key hw struct
 if (status) {
  hw_dbg(hw, "Failed to read PBA flags.\n");
  return;
 }
 if *
 hw_dbghw " block present.n);
  return;
 }

 status = i40e_read_nvm_word(hw, I40E_SR_PBA_BLOCK_PTR, &pba_ptr);
 if (status) {
  hw_dbg(hw,   i40e_aqc_get_set_rss_key_datakey
  eturn
 }

 status * set the  
() java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 (Failedn)
  return;
 }

 /* Subtract one to get PBA word count (PBA Size word is included in
 * total size) and advance pointer to first PBA word.
 */

 pba_size--;
 pba_ptr++;
 if (!pba_size) {
 * memset to 0 prior to calling this function.  The following fields * hw structure should be filled in prior to calling this function:
 ;
 }

ptrdevm_kzalloc(hw  *2+1,);
 if (!ptr status =0
  return;
 hw->ba_idptr

 for (i = 0; i < pba_size; i++) {
 break
  if    -NODEV
    hw->phyget_link_info ;
  devm_kfree((hw,hw-);
  ort=(,
  return;
  }

 * i40e_aq_mac_address_read - Retrieve the * @hw: pointer to the hw * @flags: a return indicator of what addresses were added to the addr * @addrs: the requestor's * @cmd_details: pointer to command details structure or
  *ptr++ java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

}

/**
 * i40e_get_media_type - Gets media type
 * @hw: pointer to the hardware structure
 **/

static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
{
 enum i40e_media_type media;

 switch
40E_PHY_TYPE_10GBASE_SR:
 case I40E_PHY_TYPE_10GBASE_LR:
 case I40E_PHY_TYPE_1000BASE_SX:
 case I40E_PHY_TYPE_1000BASE_LX
 case I40E_PHY_TYPE_40GBASE_SR4
 case I40E_PHY_TYPE_40GBASE_LR4:
 case I40E_PHY_TYPE_25GBASE_LR
 case 
  = I40E_MEDIA_TYPE_FIBER;
  break
  I40E_PHY_TYPE_100BASE_TX
 ase:
   @: pointerto details or
 int (struct *wjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
 case I40E_PHY_TYPE_10GBASE_T:
  = I40E_MEDIA_TYPE_BASET;
 b;
  I40E_PHY_TYPE_10GBASE_CR1_CU
 case I40E_PHY_TYPE_40GBASE_CR4_CU
 case  cmd_data-  ((2mac_addr]<< 4java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 * @mac_addr
 :
 case I40E_PHY_TYPE_40GBASE_AOC;
   =(, flags, NULL;
 case I40E_PHY_TYPE_25GBASE_CR:
 case I40E_PHY_TYPE_25GBASE_AOC:
case:
 
  break;
 case  * @mac_addr
I40E_PHY_TYPE_10GBASE_KX4
 case I40E_PHY_TYPE_10GBASE_KR  flags=;
c I40E_PHY_TYPE_40GBASE_KR4
 case I40E_PHY_TYPE_20GBASE_KR2
 case I40E_PHY_TYPE_25GBASE_KR:
  media = I40E_MEDIA_TYPE_BACKPLANE;
  break;
 case I40E_PHY_TYPE_SGMII:
 case I40E_PHY_TYPE_XAUI:
 case I40E_PHY_TYPE_XFI:
 case I40E_PHY_TYPE_XLAUI:
:
 default:
 mediaI40E_MEDIA_TYPE_UNKNOWN
  break;
}

 ;
}

/**
 * i40e_poll_globr - Poll for Global Reset completion
 * @hw: pointer to the hardware structure
 * @retry_limit: how many times to retry before failure
 **/

static int i40e_poll_globr * or disable target queue.
      retry_limit
{
u32,reg 0

forcnt 0c <java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (!( &))
   return 0;
 msleep0;
 }

 hw_dbg(hw, "Global reset failed.\n");
hw_dbg," xxn, );

 return -EIO;  | ;
}

#define  wr32(hw, I40E_GLLAN_TXPRE_QDIS,);
#define I40E_PF_RESET_WAIT_COUNT 2
/**
 * i40e_pf_reset - Reset the PF
 * @hw: pointer to the hardware structure
 *
 * Assuming someone else has triggered a global reset,
 * assure the global reset is complete and then reset the PF
 **/

int i40e_pf_reset(structdefine 0xFAFA
{
 u32 cnt pba_ptr;
 u32 cnt1 =char *tr
 u32 reg
 3 ;

 /* Poll for Global Reset steady state in case of recent GRST.
 * The grst delay value is in 100ms units, and we'll wait a
 * couple counts longer to be sure we don't just miss the end.
 */

 java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
     ( ))java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 /* It can take upto 15 secs for GRST steady state.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 * Bump it to 16 secs max to be safe.
 */

  >  ;

 for
,I40E_GLGEN_RSTAT
 (&)
   break
  msleep(10java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
 if (reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
  hw_dbg
 return-;
 }

 /* Now Wait for the FW to be ready */I40E_PHY_TYPE_1000BASE_SX
 for  :
  =rd32, )
  reg :
   I40E_GLNVM_ULD_CONF_GLOBAL_DONE_MASK;
  if (reg :
      )){
   hw_dbg(hw, "Core and Global modules ready % java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
   break
 
    :
}
 !(reg  |
AL_DONE_MASK) java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
:
  hw_dbg(hw, "I40E_GLNVM_ULD = 0x%x\n", reg);
  return -EIO;
 }

 /* If there was a Global Reset in progress when we got here,
 * we don't need to do the PF Reset
 */

i !) java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
   case:
  if (hw->revision_id == 0)
   cnt case:
  
   cnt defaul:
  reg = rd32(hw, I40E_PFGEN_CTRL);
  wr32(hw, java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      reg|));
  for (; cnt; 
   reg = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
   if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
    break;
   static int i40e_poll_globr(struct i40e_hw *hw,
if )
  reg(,)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
   usleep_range
  }
  ifjava.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
  (hw, ))
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   hw_dbg(hw 2
    * Assuming * assure the global reset
  }
 }

()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

return0
}

/**
 * i40e_clear_hw - clear out any left over hw state
 * @hw: pointer to the hw struct
 *
 * Clear queues and interrupts, typically called at init time,
 * but after the capabilities have been found so we know how many
 * queues and msix vectors have been allocated.
 **/

void i40e_clear_hw(struct i40e_hw *hw)
{
  num_queues, base_queue
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 s32 num_vf_int;
 u32 num_vfs java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 s32 for ( =  <grst_del ++) {
 u32 j;
 u32 val;
 u32 eol = 0x7ff;

, queuesand *
 hw)
num_pf_int(,val
   (10)

  =rd32,I40E_PFLAN_QALLOC)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 base_queue = FIELD_GET(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 j=(, );
 if (val & I40E_PFLAN_QALLOC_VALID_MASK && j >= base_queue)
   =(  ) +;
else
  );

);
 i = FIELD_GET(  I40E_GLNVM_ULD_CONF_GLOBAL_DONE_MASK
(I40E_PF_VT_PFALLOC_LASTVF_MASK)
 ifval  &&j = i
  num_vfs  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 else
  num_vfs;

 /* stop all the interrupts */
wr32  )
 val  hw_dbghw,"0 = xxn,reg;
 for (i = 0; i < num_pf_int - 2; i++)
  wr32(hw,

 /* Set the FIRSTQ_INDX field to 0x7FF in PFINT_LNKLSTx */
 val = eol <java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 wr32 (>revision_id )
 for(  0;i <  -2 +java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  wr32(hw,  reg (hwI40E_PFGEN_CTRL
 valwr32(, ,
 or  ;i<num_vfsi+java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  wr32(hw   (hw);
   ((  I40E_PFGEN_CTRL_PFSWR_MASK
     ;

/
 for (i = 0; i < num_queues; i++) {
  u32 abs_queue_idx
  u32 reg_block  usleep_range(00 200;

  if(bs_queue_idx= 2){
   reg_block = abs_queue_idx / 128;
 abs_queue_idx =18
  }

  val = rd32(hw, I40E_GLLAN_TXPRE_QDIS(reg_block));
LLAN_TXPRE_QDIS_QINDX_MASK
  val |  (hw " reset to complete\";
  val |= I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK

  wr32(hwi40e_clear_pxe_mode();
 }
 udelay(400);

 /* stop all the queues */
 for (i * i40e_clear_hw - clear out any left over hw state
  wr32(hw, * Clear queues and interrupts, typically called at init time * but after the capabilities have been found so we know * queues and msix vectors have been
 wr32, I40E_QTX_ENA() 0;
32hwI40E_QINT_RQCTL) )
 wr32, I40E_QRX_ENA) )java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 }

 /* short wait for all queue disables to settle */
 udelay(50);
}

/**
 * i40e_clear_pxe_mode - clear pxe operations mode
 * @hw: pointer to the hw struct
 *
 * Make sure all PXE mode settings are cleared, including things
 * like descriptor fetch/write-back mode.
 **/

void i40e_clear_pxe_mode(struct i40e_hw *hw)
{
u32 ;

 if(4e_check_asq_alive)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  i40e_aq_clear_pxe_mode = 0;

 /* Clear single descriptor fetch/write-back mode */
  = rd32, I40E_GLLAN_RCTL_0

ion_id == 0) {
  /* As a work around clear PXE_MODE instead of setting it */
  wr32(hw, I40E_GLLAN_RCTL_0, ( j =FIELD_GET(I40E_PF_VT_PFALLOC_LASTVF_MASK,val;
 } else {
  wr32(hw, I40E_GLLAN_RCTL_0, (reg | I40E_GLLAN_RCTL_0_PXE_MODE_MASK));
 }
}

/**
 * i40e_led_is_mine - helper to find matching led
 * @hw: pointer to the hw struct
 * @idx: index into GPIO registers
 *
 * returns: 0 if no match, otherwise the value of the GPIO_CTL register
 */

static u32 i40e_led_is_mine(struct i40e_hw *hw
{
u32 = 0java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 u32;

 if (!I40E_IS_X710TL_DEVICE(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
     !  =  < I40E_PFINT_LNKLST0_FIRSTQ_INDX_SHIFT
   0;
 for ( =0  < -2 +)
 port=FIELD_GET, gpio_val;

 /* if PRT_NUM_NA is 1 then this LED is not port specific, OR
 * if it is not our port then ignore
 */

 if ((gpio_val & I40E_GLGEN_GPIO_CTL_PRT_NUM_NA_MASK) ||
     ( wr32(hw (i) );
  return;

 returngpio_val;
}

#define   (i = ;i<; i+){
#define I40E_LED_MODE_VALID abs_queue_idx  +i
        I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT)

#define I40E_LED0 22

#efineI40E_PIN_FUNC_SDP
#define I40E_PIN_FUNC_LED 0x1  % 2;


  val |= java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * @hw: pointer to the hw struct
 *
 * The value returned is the 'mode' field as defined in  for( =0 i <num_queues i+)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 * GPIO register definitions: 0x0 =   (hw,(i, )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 * values are variations
 *blink, and.
 **/
u32( i40e_hw*)

 u32 mode = 0/**
int i;

/* as per the documentation GPIO 22-29 are the LED
 * GPIO pins named LED0..LED7
 */

 for ( *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  u32 gpio_val = i40e_led_is_mine(hw,  = rd32, );

   !)
   continue;

  mode = FIELD_GET(I40E_GLGEN_GPIO_CTL_LED_MODE_MASK, gpio_val);
  break;
}

 return mode;
}

/**
 * i40e_led_set - set new on/off mode
 * @hw: pointer to the hw struct
 * @mode: 0=off, 0xf=on (else see manual for mode details)
 * @blink: true if the LED should blink when on, false if steady
 *
 * if this function is used to turn on the blink it should
 * be used to disable the blink when restoring the original state.
 **/

void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
{
 int i;

 if (mode & ~I40E_LED_MODE_VALID) {
  hw_dbg(hw ;
  ;
 }

 /* as per the documentation GPIO 22-29 are the LED
 * GPIO pins named LED0..LED7
 */

 for (i = I40E_LED0; i < 
  u32 =i40e_led_is_mine, i)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

   (gpio_val
   ;

  ((hw-)) {
   u32 pin_funcdefine ( > \

    ( &)
    pin_func = I40E_PIN_FUNC_SDP;
  else
    pin_func = I40E_PIN_FUNC_LED;

  0x0
    |=
    FIELD_PREP(I40E_GLGEN_GPIO_CTL_PIN_FUNC_MASK,
  
  }
  gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK;
  /* this & is a bit of paranoia, but serves as a range check */ *
  gpio_val  * GPIO register definitions: 0x0 = off, 0xf * values are variations of possible behaviors relating to * blink, link, and wire.
           mode);

  if (blink)
   gpio_val |= /* as per the documentation GPIO 22-29 are the LED
else
gpio_val &= ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);

wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val);
break;
}
}

/* Admin command wrappers */


/**
 * i40e_aq_get_phy_capabilities
 * @hw: pointer to the hw struct
 * @abilities: structure for PHY capabilities to be filled
 * @qualified_modules: report Qualified Modules
 * @report_init: report init capabilities (active are default)
 * @cmd_details: pointer to command details structure or NULL
 *
 * Returns the various PHY abilities supported on the Port.
 **/

int
i40e_aq_get_phy_capabilities(struct i40e_hw * @blink: true if the LED should  *
        bool qualified_modules, bool report_init,
        structi40e_aq_get_phy_abilities_resp*,
        struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp);
u16  , total_delay ;
 struct  ;
 int java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 if (!abilities)
  return -EINVAL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 do
  i40e_fill_default_direct_cmd_desc(&desc,  (gpio_val
           i40e_aqc_opc_get_phy_abilities

  desc  ((hw-device_id java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  if java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 0
   desc.flags pin_func ;

  if (qualified_modulespin_func =I40E_PIN_FUNC_LED
   desc.params  gpio_val=~;
    |=

  if report_init
   desc.params.generic.param0 |=
   cpu_to_le32java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  status = i40e_asq_send_command(hw, &desc, abilities,
            abilities_size        mode

 switchhw-.asq_last_status java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 c LIBIE_AQ_RC_EIO
   status = -EIO;
  ;
  case ;
   usleep_range(1000, 2000);
   total_delay++;
   status
   break;
  /* also covers LIBIE_AQ_RC_OK */
  default:
   break;
  }

 } while (
  (total_delay < max_delay));

 if (status)
  return status;

 if (report_init) {
 if (hw->ac.ype=  I40E_MAC_XL710 &&
      i40e_is_aq_api_ver_ge(hw, I40E_FW_API_VERSION_MAJOR,
       I40E_MINOR_VER_GET_LINK_INFO_XL710)) {
   status = i40e_aq_get_link_info(hw, true, NULL, NULL);
  }  {
   hw->phy.phy_types = le32_to_cpu(abilities->phy_type);
    u16 abilities_size=sizeof(structi40e_aq_get_phy_abilities_resp;
     ((u64)abilities->phy_type_ext << 32);
   u16 max_delay  I40E_MAX_PHY_TIMEOUT total_delay = ;
 }

 return status;
}

/**
 * i40e_aq_set_phy_config
 * @hw: pointer to the hw struct
 * @config: structure with PHY configuration to be set
 * @cmd_details: pointer to command details structure or NULL
 *
 * Set the various PHY configuration parameters
 * supported on the Port.One or more of the Set PHY config parameters may be
 * ignored in an MFP mode as the PF may not have the privilege to set some
 * of the PHY Config parameters. This status will be indicated by the
 * command response.
 **/

int i40e_aq_set_phy_config(structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      .lags| cpu_to_le16());
      struct   ()
{
 struct cpu_t(I40E_AQ_PHY_REPORT_QUALIFIED_MODULES
 
 int  if report_init

 if (  (I40E_AQ_PHY_REPORT_INITIAL_VALUES
  return - status = i40e_a(, &desc,abilities

 i40e_fill_default_direct_cmd_desc(&desc,
     );

 cmd = libie_aq_raw(&desc)  status-;
 cmd *onfig;

 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);

 return status;
}

static noinline_for_stack int */
i40e_set_fc_status(struct i40e_hw *hw,
     struct i40e_aq_get_phy_abilities_resp * ;
     bool atomic_restart)
{
 truct config
 enum i40e_fc_mode fc_mode = hw-if status
 u8 pause_mask = 0x0

 switch (fc_mode) {
 case:
  pause_mask |=      40(hwI40E_FW_API_VERSION_MAJOR
  pause_mask=;
  break;
  :
  pause_mask |= java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 10
 
 case I40E_FC_TX_PAUSE:
  pause_mask |= I40E_AQ_PHY_FLAG_PAUSE_TX}
  break;
 default:
  break;
 }

 memset(&config, 0, sizeof(struct i40e_aq_set_phy_config));
 /* clear the old pause settings */
 config.abilities  * Set the various PHY configuration parameters
      ~(I40E_AQ_PHY_FLAG_PAUSE_RX);
 /* set the new abilities */
 config.abilities |= pause_mask;
 /* If the abilities have changed, then set the new config */
ifconfig. ==>)
  return 0;

 /* Auto restart link so settings take effect */
 if (atomic_restart)
  config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK  *;
 /* Copy over all the old settings */
 config.phy_type = abilities->phy_type;
 configjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
 .link_speed=abilities->link_speed
 config.eee_capability   i40e_aqc_opc_set_phy_config
 config.eeer = abilities->eeer_val;
 config.low_power_ctrl = abilities->d3_lpan;
 config.fec_config = abilities->java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
       I40E_AQ_PHY_FEC_CONFIG_MASK;

 return i40e_aq_set_phy_config(hw, &config, NULL);
}

/**
 * i40e_set_fc
 * @hw: pointer to the hw struct
 * @aq_failures: buffer to return AdminQ failure information
 * @atomic_restart: whether to enable atomic link restart
 *
 * Set the requested flow control mode using set_phy_config.
 **/

int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
  bool atomic_restart)
{
 struct i40e_aq_get_phy_abilities_resp abilities;
 int status;

   pause_mask 0;

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
statusi40e_aq_get_phy_capabilitieshw,falsefalse&,
 pause_mask=I40E_AQ_PHY_FLAG_PAUSE_TX
if () {
  reak
   status
 }

 status =  case I40E_FC_TX_PAUSE
if()
  *aq_failures |= I40E_SET_FC_AQ_FAIL_SET;

 /* Update the link info */
statusi40e_update_link_info();
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  /* Wait a little bit (on 40G cards it sometimes takes a really
 * long time for link to come back from the atomic reset)
 * and try once more
 */

  msleep(1  (.abilities= >)
  = i40e_update_link_info(hw);
 }
 if (status)
  *aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE;

 return status;
}

/**
 * i40e_aq_set_mac_config - Configure MAC settings
 * @hw: pointer to the hw struct
 * @max_frame_size: Maximum Frame Size to be supported by the port
 * @cmd_details: pointer to command details structure or NULL
 *
 * Set MAC configuration (0x0603). Note that max_frame_size must be greater
 * than zero.
 *
 * Return: 0 on success, or a negative error code on failure.
 */

int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size,
      struct i40e_asq_cmd_details *cmd_details)
{
 struct .link_speed abilities->link_speed;
 struct libie_aq_desc desc;

c =libie_aq_raw&);

 if( == 0
  returnconfig = abilities->_;

 i40e_fill_default_direct_cmd_desc    ;

 cmd->max_frame_size   i40e_aq_set_phy_confighw &, );
 cmd->params

define 0x7FFF
 cmd->fc_refresh_threshold *@w:pointer the struct
  cpu_to_le16*

 return i40e_asq_send_command(hw, &desc i40e_set_fc i40e_hwhwu8,
}

/**
 * i40e_aq_clear_pxe_mode
 * @hw: pointer to the hw struct
 * @cmd_details: pointer to command details structure or NULL
 *
 * Tell the firmware that the driver is taking over from PXE
 **/

int i40e_aq_clear_pxe_mode( status = i40e_aq_get_phy_capabilitieshwfalse,false,&bilities,
      struct i40e_asq_cmd_details *cmd_details)
{
 i40e_aqc_clear_pxe;
 struct libie_aq_desc * |=I40E_SET_FC_AQ_FAIL_GET
 int status;

 i40e_fill_default_direct_cmd_desc(  = i40e_set_fc_status(, &, atomic_restart)
     i40e_aqc_opc_clear_pxe_mode

 cmd = libie_aq_raw(&desc);
 cmd->rx_cnt = 0

status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);

wr32(hw, I40E_GLLAN_RCTL_0, 0x1);

return status;
}

/**
 * i40e_aq_set_link_restart_an
 * @hw: pointer to the hw struct
 * @enable_link: if true: enable link, if false: disable link
 * @cmd_details: pointer to command details structure or NULL
 *
 * Sets up the link and restarts the Auto-Negotiation over the link.
 **/

int i40e_aq_set_link_restart_an =;
    bool java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 15
    struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_set_link_restart_an *cmd;
 struct libie_aq_desc desc;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_set_link_restart_an);

 cmd = libie_aq_raw(&desc);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 if (enable_linkjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  cmd->command |= I40E_AQ_PHY_LINK_ENABLE;
 else
  cmd->command &= ~I40E_AQ_PHY_LINK_ENABLE;

 status = i40e_asq_send_commandreturn EINVAL

 return;
}


 * md- = I40E_AQ_SET_MAC_CONFIG_CRC_EN;
 * @hw: pointer to the #efineI40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD
 * @enable_lse: enable/disable LinkStatusEvent reporting
 * @link: pointer to link status structure - optional
 *@cmd_details  to details or
 *
 * Returns   i40e_asq_send_command, desc,NULL,0 cmd_details;
 **/
int i40e_aq_get_link_info(struct i40e_hw *hw,
     bool enable_lse, struct i40e_link_status * i40e_aq_clear_pxe_mode
     struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_link_status *hw_link_info * Tell the firmware that the driver is taking over from PXE
 structi40e_aqc_get_link_statusresp
 struct libie_aq_desc desc;
 bool tx_pause, rx_pause;
 u16 command_flags;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_link_status);

 resp  ;
 if (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
rx_cntjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 else
  command_flags = I40E_AQ_LSE_DISABLE;
 resp-command_flags=cpu_to_le16command_flags;

 status =  wr32(hw, I40E_GLLAN_RCTL_0)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

 if (}
  goto aq_get_link_info_exit;

 /* save off old link status information */
 hw->phy.link_info_old = *hw_link_info;

 /* update link status */
 hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type;
 hw->phy.media_type *
 hw_link_info->link_speed = (enum i40e_aq_link_speed)resp->link_speed;
int(struct *wjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 hw_link_info->an_info = resp->  *;
  struct libie_aq_desc
         status
 hw_link_info->ext_info = resp->ext_info;
 hw_link_info->loopback = resp->loopback & java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 41
 hw_link_info-> = (resp-max_frame_size
 hw_link_info-> >command=I40E_AQ_PHY_RESTART_AN

 /* update fc info */
 tx_pause
 rx_pause !resp-> & I40E_AQ_LINK_PAUSE_RX;
 if (tx_pause & rx_pause)
  hw->fc.current_mode = I40E_FC_FULL;
 else if (tx_pause)
 h>fccurrent_mode ;
 else if (rx_pause)
  hw->fc.current_mode = I40E_FC_RX_PAUSE
 else
  hw->fc * i40e_aq_get_link_info

 if (resp->config & I40E_AQ_CONFIG_CRC_ENA)
  hw_link_info->crc_enable = true;
 else
  hw_link_info->crc_enable = false;

 if (int i40e_aq_get_link_info i40e_hw*hw,
  hw_link_info->lse_enable = true;
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 

 if (hw->mac.type == I40E_MAC_XL710  i40e_aqc_get_link_status;
     hw_link_info-> ;
  hw_link_info-

 if (test_bit(I40E_HW_CAP_AQ_PHY_ACCESS
     resp(desc
  __le32 tmp;

  memcpy(&tmp, resp-command_flags =;
  hw->command_flags (command_flags
  hw->phy.phy_types =i40e_asq_send_command,&, , 0cmd_details
 }

 /* save link status information */
 if (link)
  *link>phy.ink_info_old=*;

 /* flag cleared so helper functions don't call AQ again */
hw-.get_link_info= ;

h>phymedia_type=i40e_get_media_type);
  ;
}

/**
 * i40e_aq_set_phy_int_mask
 * @hw: pointer to the hw struct
 * @mask: interrupt mask to be set
 * @cmd_details: pointer to command details structure or NULL
 *
 * Set link interrupt mask.
 **/

int>max_frame_size (resp->ax_frame_size);
        mask
        struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_set_phy_int_mask * =!(esp-an_info );
 struct  desc;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
      i40e_aqc_opc_set_phy_int_mask);

 cmd = libie_aq_raw(&desc);
 cmd->event_mask = cpu_to_le16(mask);

= i40e_asq_send_command, &, NULL0 cmd_details;

  status
}

/**
 * i40e_aq_set_mac_loopback
 * @hw: pointer to the HW struct
 * @ena_lpbk: Enable or Disable loopback
 * @cmd_details: pointer to command details structure or NULL
 *
 * Enable/disable loopback on a given port
 */

0e_hw*,  ena_lpbk
         hw_link_info> = true
{
 struct i40e_aqc_set_lb_mode *cmd;
 struct libie_aq_desc desc;

 i40e_fill_default_direct_cmd_desc>phy_type=0)
  = libie_aq_raw(desc

if>nvm =java.lang.StringIndexOutOfBoundsException: Range [37, 34) out of bounds for length 37
   cmd-hw-. =tmp
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
   /* save link status information */
 * =*;

  /* flag cleared so helper functions don't call AQ again */
}

/**
 * i40e_aq_set_phy_debug
 * @hw: pointer to the hw struct
 * @cmd_flags: debug command flags
 * @cmd_details: pointer to command details structure or NULL
 *
 * Reset the external PHY.
 **/

int i40e_aq_set_phy_debug(struct i40e_hw * *
     struct i40e_asq_cmd_details i40e_aq_set_phy_int_maskstruct i40e_hwhw
{
 struct i40e_aqc_set_phy_debug *cmd
 struct libie_aq_desc desc;
  ;

 i40e_fill_default_direct_cmd_desc(&descjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
       i40e_aqc_opc_set_phy_debug);

  =libie_aq_rawdesc;
 cmd->command_flags java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 status = eturn;

 return status;
}

/**
 * i40e_aq_add_vsi
 * @hw: pointer to the hw struct
 * @vsi_ctx: pointer to a vsi context struct
 * @cmd_details: pointer to command details structure or NULL
 *
 * Add a VSI context to the hardware.
**/

int i40e_aq_add_vsi(struct i40e_hw *hw,
    *,
      struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_add_get_update_vsi_completion *;
 struct i40e_aqc_add_get_update_vsi cmd=libie_aq_raw&desc);
 structlibie_aq_desc desc
 int;

 (&desc,
       i40e_aqc_opc_add_vsi);

 resp =libie_aq_raw(desc;
 cmd = libie_aq_raw(&desc);
 cmd->uplink_seid = cpu_to_le16(vsi_ctx-
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 cmd->vf_id = vsi_ctx-
 cmd->vsi_flags = cpu_to_le16 * i40e_aq_set_phy_debug

 desc.flags |= cpu_to_le16((u16 * @cmd_details: pointer to command details structure or NULL *

 status (hwdesc>info
   sizeof>info
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 if (status)
  goto aq_add_vsi_exit;

 vsi_ctx->seid = le16_to_cpu(resp->seid);
 vsi_ctx-cmd =libie_aq_rawdesc
 vsi_ctx- =(>vsi_used;
 vsi_ctx->vsis_unallocated = le16_to_cpu(resp->vsi_free  (, desc, ,cmd_detailsjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

aq_add_vsi_exit
 return status;
}

/**
 * i40e_aq_set_default_vsi
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_set_default_vsi(struct i40e_hw *hw,
       u16 seid,
       struct i40e_asq_cmd_details *cmd_detailsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 struct i40e_aqc_set_vsi_promiscuous_modes *cmd status
 struct    )
 int status;

(&,
 >  >connection_type

 cmd = libie_aq_raw(&desc);
 cmd->promiscuous_flags =  cmd->vsi_flags = cpu_to_le16(vsi_ctx-=(vsi_ctx-);
 .flags| (()( |);
 cmd->seid = cpu_to_le16(seid);

 status sizeof(vsi_ctx->info),

 return status;
}

/**
 * i40e_aq_clear_default_vsi
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @cmd_details: pointer to command details structure or NULL
 **/

 (  *,
         u16 (>);
         struct *)
{
 struct i40e_aqc_set_vsi_promiscuous_modes *cmd;
 struct libie_aq_desc desc;
 int status

 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_set_vsi_promiscuous_modes);

 cmd = libie_aq_raw(
 int (struct *hw
 cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_DEFAULT      i40e_asq_cmd_details *)
 cmd->seid = cpu_to_le16(seid);

 status =struct  desc

 return status;
}

/**
 * i40e_aq_set_vsi_unicast_promiscuous
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @set: set unicast promiscuous enable/disable
 * @cmd_details: pointer to command details structure or NULL
 * @rx_only_promisc: flag to decide if egress traffic gets mirrored in promisc
 **/

 i40e_aq_set_vsi_unicast_promiscuous i40e_hw *w,
     u16 seid, bool set,
     struct
    bool)
{
 struct i40e_aqc_set_vsi_promiscuous_modes *cmd;
 struct libie_aq_desc desc;
 u16 * i40e_aq_clear_default_vsi
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
     i40e_aqc_opc_set_vsi_promiscuous_modesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

cmd libie_aq_raw(desc
 if (set) {
  flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
  if (rx_only_promisc && i40e_is_aq_api_ver_ge(hw,  libie_aq_desc ;
   flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
 }

 cmd->promiscuous_flags =    );

 cmd->cmd  libie_aq_raw&);
 if(i40e_is_aq_api_ver_ge(hw 1,5)
c>valid_flags |=
    cmd-seidcpu_to_le16);

 cmd->seid = cpu_to_le16(seid);
 status =i40e_asq_send_command,&, NULL,0 );

 returnstatus;
}

/**
 * i40e_aq_set_vsi_multicast_promiscuous
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @set: set multicast promiscuous enable/disable
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw * @cmd_details: pointer to command details structure or NULL
       u16 seid, bool set,
       struct i40e_asq_cmd_details *cmd_details
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
 struct i40e_aqc_set_vsi_promiscuous_modes *cmd;
 struct libie_aq_desc desc;
 u16 flags = 0;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
     i40e_aqc_opc_set_vsi_promiscuous_modes);

 cmd = libie_aq_raw status;
 if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  =I40E_AQC_SET_VSI_PROMISC_MULTICAST

 cmd-  ;

 cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_MULTICAST);

 cmd->seid = cpu_to_le16
_commandhw&, NULL );

 ;
}

/**
 * i40e_aq_set_vsi_mc_promisc_on_vlan
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
 * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_set_vsi_mc_promisc_on_vlan ;
           u16
           u16 vid,
           struct * @seid: vsi number
{
 struct i40e_aqc_set_vsi_promiscuous_modesint(  *,
   desc
 u16   i40e_asq_cmd_details)
 int status;  java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 i40e_fill_default_direct_cmd_desc&,
     4);

 cmd = libie_aq_rawcmdlibie_aq_raw);
 if (enable)
  flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST;

 cmd->promiscuous_flags = cpu_to_le16(flags
> =();
 cmd->seid = cpu_to_le16(seid);
 cmd->vlan_tag = cpu_to_le16(vid 

  = i40e_asq_send_command(, &, NULL , cmd_details);
           cmd_details, truereturnstatus

 return status;
}

/**
 * i40e_aq_set_vsi_uc_promisc_on_vlan
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
 * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
         u16,  enable
           u16 vid,
           struct i40e_asq_cmd_details       structi40e_asq_cmd_details*md_details
{
vsi_promiscuous_modes;
struct desc
 u16 status
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_set_vsi_promiscuous_modes);

 cmd = libie_aq_raw(&desc) flags ;
 if (enable) {
  flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
  (i40e_is_aq_api_ver_ge(hw 1,5)
   flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY;
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 cmd->java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
 cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST       , true
 if (i40e_is_aq_api_ver_ge(hw
  cmd->valid_flags |=
   cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY);
 cmd->seid = cpu_to_le16 * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
 int( i40e_hw*w,

statusi40e_asq_send_command_atomic(hw, &desc, NULL, 0,
           cmd_details, true);

 return status;
}

/**
 * i40e_aq_set_vsi_bc_promisc_on_vlan
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @enable: set broadcast promiscuous enable/disable for a given VLAN
 * @vid: The VLAN tag filter - capture any broadcast packet with this VLAN tag
 * @cmd_details: pointer to command details structure or NULL
 **/

int i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw,
           u16 seid, bool enable, u16 vid,
           struct i40e_asq_cmd_details *cmd_details)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct i40e_aqc_set_vsi_promiscuous_modes((hw ,5)
struct desc
 u16 flags =0;
 int status;

 i40e_fill_default_direct_cmd_descdesc,
     i40e_aqc_opc_set_vsi_promiscuous_modes cmd-> =cpu_to_le16I40E_AQC_SET_VSI_PROMISC_UNICAST);

 if (enable)
  flags |= I40E_AQC_SET_VSI_PROMISC_BROADCAST;

 cmd = libie_aq_raw(&desc);
 cmd->promiscuous_flags = cpu_to_le16(flags);
 cmd- >seid=(seid)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 cmd->seid = cpu_to_le16(seid);
 cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID);

 status = i40e_asq_send_command         cmd_details true);

 return status;
}

/**
 * i40e_aq_set_vsi_broadcast
 * @hw: pointer to the hw struct
 * @seid: vsi number
 * @set_filter: true to set filter, false to clear filter
 * @cmd_details: pointer to command details structure or NULL
 *
 * Set or clear the broadcast promiscuous flag (filter) for a given VSI.
 **/

int i40e_aq_set_vsi_broadcast(struct i40e_hw *
   u16seid, ,
         struct i40e_asq_cmd_details *cmd_details)
{
 struct         structcmd_details
  ;
 ;

 i40e_fill_default_direct_cmd_desc;
     i40e_fill_default_direct_cmd_desc

  )

  cmd-> cmd = libie_aq_raw
|()
 > ()
  cmd->promiscuous_flags  ( java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 &(~40);

 cmd->valid_flags
 cmd->seid = cpu_to_le16(seid);
 status =* @seid: vsi number

 return status *
}

/**
 * i40e_aq_get_vsi_params - get VSI configuration info
 * @hw: pointer to the hw struct
 * @vsi_ctx: pointer to a vsi context struct
 * @cmd_details: pointer to command details structure or NULL
 **/

int( i40e_hwhw,
      struct i40e_vsi_context   | cpu_to_le16);
      struct i40e_asq_cmd_details>promiscuous_flags
{
 struct
  i40e_aqc_add_get_update_vsi;
struct ;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
    );

   ()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 cmd = * i40e_aq_get_vsi_params - get VSI configuration info
 cmd-uplink_seid=cpu_to_le16(vsi_ctx-);

 desc.flags |= cpu_to_le16((u16)LIBIE_AQ_FLAG_BUF);

 status = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
        sizeof(vsi_ctx->info), NULL  i40e_aqc_add_get_update_vsi;

 if (status)
  goto aq_get_vsi_params_exit  status

 vsi_ctx->seid );
 vsi_ctx-> l()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 vsi_ctx->cmd->uplink_seid = cpu_to_le16(vsi_ctx->seid);
 vsi_ctx->vsis_unallocated =

aq_get_vsi_params_exit:
 ;
}

/**
 * i40e_aq_update_vsi_params
 * @hw: pointer to the hw struct
 * @vsi_ctx: pointer to a vsi context struct
 * @cmd_details: pointer to command details structure or NULL
 *
 * Update a VSI context.
 **/

int i40e_aq_update_vsi_params(struct
         struct i40e_vsi_context
  * @hw: pointer to the  a vsi context struct
{
 struct i40e_aqc_add_get_update_vsi_completion  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct i40e_aqc_add_get_update_vsi *cmd;
 struct libie_aq_desc desc
  ;

 i40e_fill_default_direct_cmd_desc(&desc,
    i40e_aqc_opc_update_vsi_parameters)
 resp = libie_aq_raw(&desc);
 cmd = libie_aq_raw(&desc);
 cmd- (&desc

 descresp libie_aq_raw(desc);

 status =  cmd->uplink_seid = cpu_to_le16(vsi_ctx-
           sizeof(vsi_ctx-. =cpu_to_le16LIBIE_AQ_FLAG_BUF)
       ,);

vsis_allocatedresp-
 ,true);

 
}

/**
 * i40e_aq_get_switch_config
 * @hw: pointer to the hardware structure
 * @buf: pointer to the result buffer
 * @buf_size: length of input buffer
 * @start_seid: seid to start for the report, 0 == beginning
 * @cmd_details: pointer to command details structure or NULL
 *
 * Fill the buf with switch configuration returned from AdminQ command
 **/

int i40e_aq_get_switch_config(struct i40e_hw *hw,
         struct i40e_aqc_get_switch_config_resp *buf,
         u16 buf_size, u16 *start_seid,
         struct (struct hw
{
 *;
 struct libie_aq_desc desc;
 int status;

i0(&desc
       i40e_aqc_opc_get_switch_config);
 scfg = libie_aq_raw(&desc);
 desc.flags |= cpu_to_le16((u16
 if (buf_size 4e_fill_default_direct_cmd_desc(&desc,
  desc.flags |= cpu_to_le16((u16)LIBIE_AQ_FLAG_LB = (&desc
 scfg- = cpu_to_le16*);

 status = i40e_asq_send_command(hw, &desc, buf, buf_size, cmd_details);
 *start_seid = le16_to_cpu(scfg->seid);

 return status;
}

/**
 * i40e_aq_set_switch_config
 * @hw: pointer to the hardware structure
 * @flags: bit flag values to set
 * @mode: cloud filter mode
 * @valid_flags: which bit flags to set
 * @mode: cloud filter mode
 * @cmd_details: pointer to command details structure or NULL
 *
 * Set switch configuration bits
 **/

int i40e_aq_set_switch_config(struct i40e_hw *hw,
         u16 flags,
         u16 valid_flags, u8 mode,
         struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_set_switch_config *scfg;
 struct libie_aq_desc desc;
 int status;

 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_set_switch_config);
 scfg =libie_aq_rawdesc
 scfg->flags = cpu_to_le16(flags);
 scfg->valid_flags = cpu_to_le16(valid_flags);
 scfg->mode = mode;
, hw->)) {
  scfg->switch_tag {
  scfg->first_tag i40e_aqc_set_switch_config;
  scfg->second_tag = cpu_to_le16(hw- struct  desc
 }
 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);

 return status;
}

/**
 * i40e_aq_get_firmware_version
 * @hw: pointer to the hw struct
 * @fw_major_version: firmware major version
 * @fw_minor_version: firmware minor version
 * @fw_build: firmware build number
 * @api_major_version: major queue version
 * @api_minor_version: minor queue version
 * @cmd_details: pointer to command details structure or NULL
 *
 * Get the firmware version from the admin queue commands
 **/

int i40e_aq_get_firmware_version}
     u16 *fw_major_version, u16 *fw_minor_version,
     u32 *fw_build,
    u16 *, u16*pi_minor_version
     struct i40e_asq_cmd_details *cmd_details)
{
 struct }
 struct libie_aq_desc desc;
 int status;

 resp = libie_aq_raw(&desc);
 i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_version);

 * @api_major_version: major queue version

 if (!status) {
  if (fw_major_version)
   *fw_major_version = le16_to_cpu(resp->fw_major);
  if (fw_minor_version)
   *fw_minor_version = le16_to_cpu(resp->fw_minor);
   *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   *fw_build = le32_to_cpu(resp->fw_build);
  ()
   *api_major_version = le16_to_cpu(resp->api_major);
  if (api_minor_version)
  *pi_minor_version =le16_to_cpuresp-api_minor;
 }

 return status;
}

/**
 * i40e_aq_send_driver_version
 * @hw: pointer to the hw struct
 * @dv: driver's major, minor version
 * @cmd_details: pointer to command details structure or NULL
 *
 * Send the driver version to the firmware
 **/

int i40e_aq_send_driver_version(struct i40e_hw *hw,
    struct i40e_driver_version *dv,
    struct (!status
{  fw_major_version
 struct *;
 struct libie_aq_desc if()
 int status;
 u16;

 if (dv == NULL)
  return -EINVAL;

 =(desc
  * = (resp-;

 desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_BUF }
 cmd->major_ver = dv->major_version;
 cmd->minor_ver = dv->minor_version;java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 cmd->build_ver = dv->build_version;
 cmd->subbuild_ver = dv->subbuild_version * @dv: driver's major, minor version

 len * Send the driver version to the firmware
 while (inti4e_aq_send_driver_version i40e_hwh,
        dv-[len x80&
        dv->driver_string[len])
 len;
 status = i40e_asq_send_command(hw, &desc, dv->driver_string,
           len, cmd_details);

 return status;
}

/**
 * i40e_get_link_status - get status of the HW network link
 * @hw: pointer to the hw struct
 * @link_up: pointer to bool (true/false = linkup/linkdown)
 *
 * Variable link_up true if link is up, false if link is down.
 * The variable link_up is invalid if returned value of status != 0
 *
 * Side effect: LinkStatusEvent reporting becomes enabled
 **/

int i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
{
 int status = 0;

 if (hw->phy.get_link_info) {
  status=(hw

  ()
   i40e_debugcmd- = >minor_version
 );
 }

 *link_up

  status
}

/**
 * i40e_update_link_info - update status of the HW network link
 * @hw: pointer to the hw struct
 **/

  ( i40e_hw
{
 structi40e_aq_get_phy_abilities_resp abilities;
 int status = 0;

 status = i40e_aq_get_link_info(hw, true, NULL, NULL
 if (status)
  return status;

 /* extra checking needed to ensure link info to user is timely */ * i40e_get_link_status - get status of the HW java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 32
 if ( * The variable link_up is invalid if returned value of status *
     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
  statusstatus
            &abilities ifhw-.get_link_infojava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  if (status)
   returnstatus;

 if abilitiesfec_cfg_curr_mod_ext_info
      I40E_AQ_ENABLE_FEC_AUTO)
   hw->phy.link_info.req_fec_info =
    (I40E_AQ_REQUEST_FEC_KR |
     I40E_AQ_REQUEST_FEC_RS link_up hw-phy.link_infolink_info&I40E_AQ_LINK_UP
  else
  hw->phylink_inforeq_fec_info=
    abilities.fec_cfg_curr_mod_ext_info &
    (I40E_AQ_REQUEST_FEC_KR |
    * i40e_update_link_info - update status of the HW network link

  memcpy(hw->noinline_for_stack inti40e_update_link_info i40e_hwhw)
sizeof>..module_typejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 }

 return status /* extra checking needed to ensure link info to user is timely */
}

/**
 * i40e_aq_add_veb - Insert a VEB between the VSI and the MAC
 * @hw: pointer to the hw struct
 * @uplink_seid: the MAC or other gizmo SEID
 * @downlink_seid: the VSI SEID
 * @enabled_tc: bitmap of TCs to be enabled
 * @default_port: true for default port VSI, false for control port
 * @veb_seid: pointer to where to put the resulting VEB SEID
 * @enable_stats: true to turn on VEB stats
 * @cmd_details: pointer to command details structure or NULL
 *
 * This asks the FW to add a VEB between the uplink and downlink
 * elements.  If the uplink SEID is 0, this will be a floating VEB.
 **/

int i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
      u16 downlink_seid, u8 enabled_tc,
      bool  if(.fec_cfg_curr_mod_ext_info
      bool enable_stats,
      structi40e_asq_cmd_details*md_details
{
 struct i40e_aqc_add_veb_completion *resp;
 struct i40e_aqc_add_veb *cmd;
 truct desc
 u16 veb_flags   else
 int status;

java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
 if (!! (I40E_AQ_REQUEST_FEC_KR
  return  I40E_AQ_REQUEST_FEC_RS)

 resp (&desc);
 cmd = libie_aq_raw(&desc);
 i40e_fill_default_direct_cmd_desc&, i40e_aqc_opc_add_veb)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

 cmd->
 cmd->downlink_seid = cpu_to_le16(downlink_seid);
 cmd->enable_tcs = enabled_tc;
 if (!uplink_seid)
  veb_flags |= I40E_AQC_ADD_VEB_FLOATING;
 if (default_port)
  veb_flags |= I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT;
 else
  veb_flags |= I40E_AQC_ADD_VEB_PORT_TYPE_DATA;

 /* reverse logic here: set the bitflag to disable the stats */
 if (!enable_stats)
  veb_flags |= I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS;

 cmd->veb_flags = cpu_to_le16(veb_flags);

 status = i40e_asq_send_command(hw, &desc, NULL, * This asks the FW to add a VEB between the uplinand downlink

 if (!status &&int i40e_aq_add_veb( i40e_hw *hw u16 uplink_seid
 *eb_seid le16_to_cpu(>veb_seidjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

 return status;
}

/**
 * i40e_aq_get_veb_parameters - Retrieve VEB parameters
 * @hw: pointer to the hw struct
 * @veb_seid: the SEID of the VEB to query
 * @switch_id: the uplink switch id
 * @floating: set to true if the VEB is floating
 * @statistic_index: index of the stats counter block for this VEB
 * @vebs_used: number of VEB's used by function
 * @vebs_free: total VEB's not reserved by any function
 * @cmd_details: pointer to command details structure or NULL
 *
 * This retrieves the parameters for a particular VEB, specified by
 * uplink_seid, and returns them to the caller.
 **/

int i40e_aq_get_veb_parametersstructi40e_hw*wjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
          u16 veb_seid, u16 *switch_id,
          bool *floatingresp=libie_aq_raw&);
          u16*ebs_used u16*vebs_free,
          struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_get_veb_parameters_completion *cmd_resp;
 struct libie_aq_desc desc;
 int status;

 if (veb_seid == 0)
  return - cmd->enable_tcsenabled_tc;

 cmd_resp = libie_aq_raw veb_flags|I40E_AQC_ADD_VEB_FLOATING;
 i40e_fill_default_direct_cmd_desc(&desc,
       i40e_aqc_opc_get_veb_parameters);
 cmd_resp->seid = cpu_to_le16(veb_seid);

 status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details | ;
 if (status)
  goto get_veb_exit;

 if (switch_id)
  *switch_id =le16_to_cpu(cmd_resp-);
 if (statistic_index)
  *statistic_index = le16_to_cpu(cmd_resp->statistic_index);
 if (vebs_used)
  *vebs_used = le16_to_cpu(cmd_resp->vebs_used);
 if (ebs_free
  *vebs_free = le16_to_cpu(cmd_resp->vebs_free);
 if (floating) {
  u16 flags = le16_to_cpu(cmd_resp->veb_flags);

  if (flags & I40E_AQC_ADD_VEB_FLOATING)
   *floating = true ;
  else
   * * i40e_aq_get_veb_parameters - Retrieve VEB parameters
 }

get_veb_exit:
 return status;
}

/**
 * i40e_prepare_add_macvlan
 * @mv_list: list of macvlans to be added
 * @desc: pointer to AQ descriptor structure
 * @count: length of the list
 * @seid: VSI for the mac address
 *
 * Internal helper function that prepares the add macvlan request
 * and returns the buffer size.
 **/

static u16
i40e_prepare_add_macvlan(struct i40e_aqc_add_macvlan_element_data *mv_list * This retrieves the parameters for a particular VEB, specified by
 inti40e_aq_get_veb_parametersstruct *hw
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct i40e_aqc_macvlan *cmd  structi40e_asq_cmd_details*)
 u16 buf_size;
 int i;

  =count(*v_list)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 /* prep the rest of the request */
 i40e_fill_default_direct_cmd_desc(desc, returnEINVAL
 cmd->num_addresses = cpu_to_le16(count);
 cmd->seid[0] = cpu_to_le16( i40e_fill_default_direct_cmd_desc(&desc
 cmd->seid[1] = 0;
 cmd-seid2  ;

 for (i = 
 ifis_multicast_ether_addri.))
   mv_list[i].flags |=
          cpu_to_le16(I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC);

 desc->flags |= cpu_to_le16((u16)(LIBIE_AQ_FLAG_BUF | LIBIE_AQ_FLAG_RD));
 if( >I40E_AQ_LARGE_BUF
  desc->flags |= java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 15

 ;
}

/**
 * i40e_aq_add_macvlan
 * @hw: pointer to the hw struct
 * @seid: VSI for the mac address
 * @mv_list: list of macvlans to be added
 * @count: length of the list
 * @cmd_details: pointer to command details structure or NULL
 *
 * Add MAC/VLAN addresses to the HW filtering
 **/

int
i40e_aq_add_macvlan(struct i40e_hw *hw,  * @count: length of the list
 *
      u16 count, struct i40e_asq_cmd_details *cmd_details * and returns the buffer size.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct
 u16;

 if  ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 buf_size = i40e_prepare_add_macvlan(mv_list, &desc, count, seid);

return(hw desc, buf_size
         cmd_details, );
}

/**
 * i40e_aq_add_macvlan_v2
 * @hw: pointer to the hw struct
 * @seid: VSI for the mac address
 * @mv_list: list of macvlans to be added
 * @count: length of the list
 * @cmd_details: pointer to command details structure or NULL
 * @aq_status: pointer to Admin Queue status return value
 *
 * Add MAC/VLAN addresses to the HW filtering.
 * The _v2 version returns the last Admin Queue status in aq_status
 * to avoid race conditions in access to hw->aq.asq_last_status.
 * It also calls _v2 versions of asq_send_command functions to
 * get the aq_status on the stack.
 **/

int
i40e_aq_add_macvlan_v2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         struct i40e_aqc_add_macvlan_element_data *mv_list, * i40e_aq_add_macvlan
         u16 count, struct i40e_asq_cmd_details * @seid: VSI for the mac address
         enum libie_aq_err *aq_status)
{
 struct libie_aq_desc desc;
 u16 buf_size;

 if (count == 0 || !mv_list || !hw)i40e_aq_add_macvlan(truct *hwu16,
  return -EINVAL;

 buf_size

 return buf_size
            cmd_detailsif( =  |! ||hw
}

/**
 * i40e_aq_remove_macvlan
 * @hw: pointer to the hw struct
 * @seid: VSI for the mac address
 * @mv_list: list of macvlans to be removed
 * @count: length of the list
 * @cmd_details: pointer to command details structure or NULL
 *
 * Remove MAC/VLAN addresses from the HW filtering
 **/

int
i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
         struct i40e_aqc_remove_macvlan_element_data *mv_list,
         u16 count, struct i40e_asq_cmd_details *cmd_details)
{
 struct i40e_aqc_macvlan *cmd;
 struct libie_aq_desc desc;
 u16 buf_size 
i

  count0 |! ||!)
  return -EINVAL;

buf_size *sizeof();

 /* prep the rest of the request */
 i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_remove_macvlan
 cmd = libie_aq_raw(&desc);
 cmd->num_addresses = cpu_to_le16
cmd-0=cpu_to_le16 | seidjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
 cmd->seid[1] = 0;
cmd-[2  0

 desc           cmd_details,true )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 if (buf_size
  desc.flags |= cpu_to_le16 * @hw: pointer to the hw struct

 status = i40e_asq_send_command_atomic(hw, &desc, mv_list,  * @count: length of the list
           cmd_details, true);

 return status;
}

/**
 * i40e_aq_remove_macvlan_v2
 * @hw: pointer to the hw struct
 * @seid: VSI for the mac address
 * @mv_list: list of macvlans to be removed
 * @count: length of the list
 * @cmd_details: pointer to command details structure or NULL
 * @aq_status: pointer to Admin Queue status return value
 *
 * Remove MAC/VLAN addresses from the HW filtering.
 * The _v2 version returns the last Admin Queue status in aq_status
 * to avoid race conditions in access to hw->aq.asq_last_status.
 * It also calls _v2 versions of asq_send_command functions to
 * get the aq_status on the stack.
 **/

 .| (()(  ))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
      =i40e_asq_send_command_atomic, descmv_list,
            , true
     enum libie_aq_err *aq_status)
{
 struct i40e_aqc_macvlan *cmd;
 struct libie_aq_desc desc;
 u16 buf_size;

--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=96 H=93 G=94

¤ Dauer der Verarbeitung: 0.25 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.