/*****************************************************************************
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing permissions
* and limitations under the License.
*
*****************************************************************************/
#ifndef _MM_H
#define _MM_H
/*
This define is relevant for MS compilers.
So the main purpose here is to comply with older MS compilers
as well as non-MS compilers
*/
#ifndef FORCEINLINE
#else
#endif /* _MSC_VER */
#endif /* !FORCEINLINE */
/* common lpme callback used by multiple platforms */
const u8_t b_fw_access,
const u8_t b_queue_for_fw);
/* mm_i2c for special elink query */
/* query system time - for time stamps */
u64_t mm_query_system_time(void);
#if defined(UEFI)
#include "mm_uefi.h"
#include "mm_dos.h"
#include "mm_linux.h"
#include "mm_solaris.h"
#elif defined(__USER_MODE_DEBUG)
#include "mm_user_mode_debug.h"
#include "mm_vbd.h"
#include "mm_ndismono.h"
#endif
#define MM_WRITE_DOORBELL(/* struct _lm_device_t* */PDEV, /* u32_t */BAR, /* u32_t */CID, /* u32_t */VAL) \
#define MM_REGISTER_LPME(/* struct _lm_device_t* */_pdev, /* lm_generic_workitem_function */_func, /* u8_t */_b_fw_access, /* u8_t */_b_queue_for_fw) \
#define MM_ACQUIRE_REQUEST_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_ACQUIRE_REQUEST_LOCK_DPC_IMP(pdev)
#define MM_RELEASE_REQUEST_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_RELEASE_REQUEST_LOCK_DPC_IMP(pdev)
#define MM_ACQUIRE_ISLES_CONTROL_LOCK(/* struct _lm_device_t* */pdev) MM_ACQUIRE_ISLES_CONTROL_LOCK_IMP(pdev)
#define MM_RELEASE_ISLES_CONTROL_LOCK(/* struct _lm_device_t* */pdev) MM_RELEASE_ISLES_CONTROL_LOCK_IMP(pdev)
#define MM_ACQUIRE_ISLES_CONTROL_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_ACQUIRE_ISLES_CONTROL_LOCK_DPC_IMP(pdev)
#define MM_RELEASE_ISLES_CONTROL_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_RELEASE_ISLES_CONTROL_LOCK_DPC_IMP(pdev)
#define MM_ACQUIRE_RAMROD_COMP_LOCK(/* struct _lm_device_t* */pdev) MM_ACQUIRE_RAMROD_COMP_LOCK_IMP(pdev)
#define MM_RELEASE_RAMROD_COMP_LOCK(/* struct _lm_device_t* */pdev) MM_RELEASE_RAMROD_COMP_LOCK_IMP(pdev)
#define MM_ACQUIRE_SP_REQ_MGR_LOCK(/* struct _lm_device_t* */pdev) MM_ACQUIRE_SP_REQ_MGR_LOCK_IMP(pdev)
#define MM_RELEASE_SP_REQ_MGR_LOCK(/* struct _lm_device_t* */pdev) MM_RELEASE_SP_REQ_MGR_LOCK_IMP(pdev)
#define MM_ACQUIRE_SB_LOCK(/* struct _lm_device_t* */pdev, /* u8_t */sb_idx) MM_ACQUIRE_SB_LOCK_IMP(pdev, sb_idx)
#define MM_RELEASE_SB_LOCK(/* struct _lm_device_t* */pdev, /* u8_t */sb_idx) MM_RELEASE_SB_LOCK_IMP(pdev, sb_idx)
#ifdef _VBD_
#if defined(NTDDI_WIN8)
#endif
#endif
#ifdef _VBD_
#if defined(NTDDI_WIN8)
#endif
#endif
#ifdef VF_INVOLVED
#define MM_ACQUIRE_VFS_STATS_LOCK(/* struct _lm_device_t* */pdev) MM_ACQUIRE_VFS_STATS_LOCK_IMP(pdev)
#define MM_RELEASE_VFS_STATS_LOCK(/* struct _lm_device_t* */pdev) MM_RELEASE_VFS_STATS_LOCK_IMP(pdev)
#define MM_ACQUIRE_VFS_STATS_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_ACQUIRE_VFS_STATS_LOCK_DPC_IMP(pdev)
#define MM_RELEASE_VFS_STATS_LOCK_DPC(/* struct _lm_device_t* */pdev) MM_RELEASE_VFS_STATS_LOCK_DPC_IMP(pdev)
#endif /* VF_INVOLVED */
/* Busy delay for the specified microseconds. */
/* Read a PCI configuration register (must be 32-bit aligned) */
/* Write a PCI configuration register (must be 32-bit aligned) */
/*
* Map the base address of the device registers to system address space so
* that registers are accessible. The base address will be unmapped when the
* driver unloads.
*/
/* Read driver configuration. It is called from lm_get_dev_info. */
/* Get the size of a packet descriptor. */
#define DESC_TYPE_L2TX_PACKET 0
/* XXX
mm_map_io_space(struct _lm_device_t * pLM,
lm_address_t physAddr,
u8_t bar,
u32_t offset,
u32_t size,
void * pHandle);
*/
#ifdef __SunOS
void *
#else
void *
#endif
void *virt_addr,
const char* sz_file,
const unsigned long line,
const char* sz_file,
const unsigned long line,
mm_alloc_phys_mem_imp((_pdev), (_mem_size), (_phys_mem), (_mem_type), __FILE_STRIPPED__, __LINE__, (cli_idx));
const char* sz_file,
const unsigned long line,
const char* sz_file,
const unsigned long line,
mm_alloc_phys_mem_align_imp((_pdev), (_mem_size), (_phys_mem), (_alignment), (_mem_type), __FILE_STRIPPED__, __LINE__, (cli_idx));
const char* sz_file,
const unsigned long line,
mm_rt_alloc_phys_mem_imp((_pdev), (_mem_size), (_phys_mem), (_flush_type), __FILE_STRIPPED__, __LINE__, (cli_idx));
#define PHYS_MEM_TYPE_UNSPECIFIED 0
void *mem_virt,
void *virt_mem,
/* Returns current high-definition time. */
/*
* This routine is called to indicate completion of a transmit request.
* If 'packet' is not NULL, all the packets in the completion queue will
* be indicated. Otherwise, only 'packet' will be indicated.
*/
/**
* @brief
* a function that enables lm to indicate rx packets
* directly. In regular rx indication flow, the call is
* made from UM -> Um request the rx packets and then
* indicates them. This function, at time of writing, was
* used just for aborting packets but may be used for any
* kind of indication.
*
* @param pdev
* @param chain_idx
* @param packet_list
* @param ind_status - SUCCESS / ABORTED
*/
/* Indicate the current phy link status. */
/* Indicate a critical HW error that requires to completely
stop all access to the device */
/* Call the lm_task_cb_t callback function after the specified delay. */
void *param);
/* XXX needs description... */
void *cookie);
struct sq_pending_command;
struct sq_pending_command * pending);
const lm_log_id_t lm_log_id,
const lm_log_id_t lm_log_id,
...);
void mm_print_bdf(int, void*);
/* common alloc and zero memory routine used for all platforms */
{
void * ptr;
if (ptr)
{
}
return ptr;
}
#ifdef VF_INVOLVED
#ifndef VF_TO_PF_STANDARD_BLOCK_ID
#endif
struct _lm_vf_pf_message_t;
struct _lm_vf_info_t;
struct _lm_sriov_info_t;
struct _lm_vf_pf_message_t *mess);
void *buffer,
void *buffer,
void *virt_buffer,
void *virt_buffer,
struct _lm_sriov_info_t *info);
struct _lm_vf_info_t *vf_info,
struct _lm_vf_info_t *vf_info,
struct _lm_vf_info_t *vf_info,
#endif /* ifdef VF_INVOLVED */
#ifdef BIG_ENDIAN
// LE
// BE
#else /* LITTLE_ENDIAN */
// LE
// BE
#endif /* ifdef BIG_ENDIAN */
#define mm_get_bar_offset(/* struct _lm_device_t* */pdev, /* u8_t */bar_num, /* lm_address_t* */bar_addr) \
#endif /* _MM_H */