src/dpdk/drivers/net/qede/qede_debug.c
static void qed_read_storm_fw_info(struct ecore_hwfn *p_hwfn,
				   struct ecore_ptt *p_ptt,
				   u8 storm_id, struct fw_info *fw_info)
{
	struct storm_defs *storm = &s_storm_defs[storm_id];
	struct fw_info_location fw_info_location;
	u32 addr, i, *dest;

	memset(&fw_info_location, 0, sizeof(fw_info_location));
	memset(fw_info, 0, sizeof(*fw_info));

	/* Read first the address that points to fw_info location.
	 * The address is located in the last line of the Storm RAM.
	 */
	addr = storm->sem_fast_mem_addr + SEM_FAST_REG_INT_RAM +
	    DWORDS_TO_BYTES(SEM_FAST_REG_INT_RAM_SIZE) -
	    sizeof(fw_info_location);

	dest = (u32 *)&fw_info_location;

	for (i = 0; i < BYTES_TO_DWORDS(sizeof(fw_info_location));
	     i++, addr += BYTES_IN_DWORD)
		dest[i] = ecore_rd(p_hwfn, p_ptt, addr);

	/* Read FW version info from Storm RAM */
	if (fw_info_location.size > 0 && fw_info_location.size <=
	    sizeof(*fw_info)) {
		addr = fw_info_location.grc_addr;
		dest = (u32 *)fw_info;
		for (i = 0; i < BYTES_TO_DWORDS(fw_info_location.size);
		     i++, addr += BYTES_IN_DWORD)
			dest[i] = ecore_rd(p_hwfn, p_ptt, addr);
	}
}
/* Reads the FW info structure for the specified Storm from the chip,
 * and writes it to the specified fw_info pointer.
 */
Reads the FW info structure for the specified Storm from the chip,
and writes it to the specified fw_info pointer.
Reads the FW info structure for the specified Storm from the chip and writes it to the specified fw_info pointer .
static void qed_read_storm_fw_info(struct ecore_hwfn *p_hwfn,
				   struct ecore_ptt *p_ptt,
				   u8 storm_id, struct fw_info *fw_info)
{
	struct storm_defs *storm = &s_storm_defs[storm_id];
	struct fw_info_location fw_info_location;
	u32 addr, i, *dest;
	memset(&fw_info_location, 0, sizeof(fw_info_location));
	memset(fw_info, 0, sizeof(*fw_info));
	addr = storm->sem_fast_mem_addr + SEM_FAST_REG_INT_RAM +
	    DWORDS_TO_BYTES(SEM_FAST_REG_INT_RAM_SIZE) -
	    sizeof(fw_info_location);
	dest = (u32 *)&fw_info_location;
	for (i = 0; i < BYTES_TO_DWORDS(sizeof(fw_info_location));
	     i++, addr += BYTES_IN_DWORD)
		dest[i] = ecore_rd(p_hwfn, p_ptt, addr);
	if (fw_info_location.size > 0 && fw_info_location.size <=
	    sizeof(*fw_info)) {
		addr = fw_info_location.grc_addr;
		dest = (u32 *)fw_info;
		for (i = 0; i < BYTES_TO_DWORDS(fw_info_location.size);
		     i++, addr += BYTES_IN_DWORD)
			dest[i] = ecore_rd(p_hwfn, p_ptt, addr);
	}
}
static void qed_read_storm_fw_info ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u8 storm_id , struct fw_info * fw_info ) { struct storm_defs * storm = & s_storm_defs [ storm_id ] ; struct fw_info_location fw_info_location ; u32 addr , i , * dest ; memset ( & fw_info_location , 0 , sizeof ( fw_info_location ) ) ; memset ( fw_info , 0 , sizeof ( * fw_info ) ) ; addr = storm -> sem_fast_mem_addr + SEM_FAST_REG_INT_RAM + DWORDS_TO_BYTES ( SEM_FAST_REG_INT_RAM_SIZE ) - sizeof ( fw_info_location ) ; dest = ( u32 * ) & fw_info_location ; for ( i = 0 ; i < BYTES_TO_DWORDS ( sizeof ( fw_info_location ) ) ; i ++ , addr += BYTES_IN_DWORD ) dest [ i ] = ecore_rd ( p_hwfn , p_ptt , addr ) ; if ( fw_info_location . size > 0 && fw_info_location . size <= sizeof ( * fw_info ) ) { addr = fw_info_location . grc_addr ; dest = ( u32 * ) fw_info ; for ( i = 0 ; i < BYTES_TO_DWORDS ( fw_info_location . size ) ; i ++ , addr += BYTES_IN_DWORD ) dest [ i ] = ecore_rd ( p_hwfn , p_ptt , addr ) ; } }
Reads the FW info structure for the specified Storm from the chip,
 and writes it to the specified fw_info pointer.
Reads the FW info structure for the specified Storm from the chip and writes it to the specified fw_info pointer .
/* Read first the address that points to fw_info location.
	 * The address is located in the last line of the Storm RAM.
	 */ /* Read FW version info from Storm RAM */