#include <linux/types.h>
#include <asm/byteorder.h>
#include <linux/dma-mapping.h>
#include <linux/if_vlan.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/stddef.h>
#include <linux/workqueue.h>
#include <net/ipv6.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/io.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/qed/qed_ll2_if.h>
#include "qed.h"
#include "qed_cxt.h"
#include "qed_dev_api.h"
#include "qed_hsi.h"
#include "qed_iro_hsi.h"
#include "qed_hw.h"
#include "qed_int.h"
#include "qed_ll2.h"
#include "qed_mcp.h"
#include "qed_ooo.h"
#include "qed_reg_addr.h"
#include "qed_sp.h"
#include "qed_rdma.h"
#define QED_LL2_RX_REGISTERED(ll2) …
#define QED_LL2_TX_REGISTERED(ll2) …
#define QED_LL2_TX_SIZE …
#define QED_LL2_RX_SIZE …
#define QED_LL2_INVALID_STATS_ID …
struct qed_cb_ll2_info { … };
struct qed_ll2_buffer { … };
static u8 qed_ll2_handle_to_stats_id(struct qed_hwfn *p_hwfn,
u8 ll2_queue_type, u8 qid)
{ … }
static void qed_ll2b_complete_tx_packet(void *cxt,
u8 connection_handle,
void *cookie,
dma_addr_t first_frag_addr,
bool b_last_fragment,
bool b_last_packet)
{ … }
static int qed_ll2_alloc_buffer(struct qed_dev *cdev,
u8 **data, dma_addr_t *phys_addr)
{ … }
static int qed_ll2_dealloc_buffer(struct qed_dev *cdev,
struct qed_ll2_buffer *buffer)
{ … }
static void qed_ll2_kill_buffers(struct qed_dev *cdev)
{ … }
static void qed_ll2b_complete_rx_packet(void *cxt,
struct qed_ll2_comp_rx_data *data)
{ … }
static struct qed_ll2_info *__qed_ll2_handle_sanity(struct qed_hwfn *p_hwfn,
u8 connection_handle,
bool b_lock,
bool b_only_active)
{ … }
static struct qed_ll2_info *qed_ll2_handle_sanity(struct qed_hwfn *p_hwfn,
u8 connection_handle)
{ … }
static struct qed_ll2_info *qed_ll2_handle_sanity_lock(struct qed_hwfn *p_hwfn,
u8 connection_handle)
{ … }
static struct qed_ll2_info *qed_ll2_handle_sanity_inactive(struct qed_hwfn
*p_hwfn,
u8 connection_handle)
{ … }
static void qed_ll2_txq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
{ … }
static int qed_ll2_txq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)
{ … }
static void qed_ll2_rxq_parse_gsi(struct qed_hwfn *p_hwfn,
union core_rx_cqe_union *p_cqe,
struct qed_ll2_comp_rx_data *data)
{ … }
static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn,
union core_rx_cqe_union *p_cqe,
struct qed_ll2_comp_rx_data *data)
{ … }
static int
qed_ll2_handle_slowpath(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn,
union core_rx_cqe_union *p_cqe,
unsigned long *p_lock_flags)
{ … }
static int
qed_ll2_rxq_handle_completion(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn,
union core_rx_cqe_union *p_cqe,
unsigned long *p_lock_flags, bool b_last_cqe)
{ … }
static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie)
{ … }
static void qed_ll2_rxq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
{ … }
static bool
qed_ll2_lb_rxq_handler_slowpath(struct qed_hwfn *p_hwfn,
struct core_rx_slow_path_cqe *p_cqe)
{ … }
static int qed_ll2_lb_rxq_handler(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static void
qed_ooo_submit_tx_buffers(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static void
qed_ooo_submit_rx_buffers(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static int qed_ll2_lb_rxq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)
{ … }
static int qed_ll2_lb_txq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)
{ … }
static void qed_ll2_stop_ooo(struct qed_hwfn *p_hwfn)
{ … }
static int qed_sp_ll2_rx_queue_start(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn,
u8 action_on_error)
{ … }
static int qed_sp_ll2_tx_queue_start(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static int qed_sp_ll2_rx_queue_stop(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static int qed_sp_ll2_tx_queue_stop(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static int
qed_ll2_acquire_connection_rx(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_info)
{ … }
static int qed_ll2_acquire_connection_tx(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_info)
{ … }
static int
qed_ll2_acquire_connection_ooo(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_info, u16 mtu)
{ … }
static int
qed_ll2_set_cbs(struct qed_ll2_info *p_ll2_info, const struct qed_ll2_cbs *cbs)
{ … }
static void _qed_ll2_calc_allowed_conns(struct qed_hwfn *p_hwfn,
struct qed_ll2_acquire_data *data,
u8 *start_idx, u8 *last_idx)
{ … }
static enum core_error_handle
qed_ll2_get_error_choice(enum qed_ll2_error_handle err)
{ … }
int qed_ll2_acquire_connection(void *cxt, struct qed_ll2_acquire_data *data)
{ … }
static int qed_ll2_establish_connection_rx(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static void
qed_ll2_establish_connection_ooo(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
static inline u8 qed_ll2_handle_to_queue_id(struct qed_hwfn *p_hwfn,
u8 handle,
u8 ll2_queue_type)
{ … }
int qed_ll2_establish_connection(void *cxt, u8 connection_handle)
{ … }
static void qed_ll2_post_rx_buffer_notify_fw(struct qed_hwfn *p_hwfn,
struct qed_ll2_rx_queue *p_rx,
struct qed_ll2_rx_packet *p_curp)
{ … }
int qed_ll2_post_rx_buffer(void *cxt,
u8 connection_handle,
dma_addr_t addr,
u16 buf_len, void *cookie, u8 notify_fw)
{ … }
static void qed_ll2_prepare_tx_packet_set(struct qed_hwfn *p_hwfn,
struct qed_ll2_tx_queue *p_tx,
struct qed_ll2_tx_packet *p_curp,
struct qed_ll2_tx_pkt_info *pkt,
u8 notify_fw)
{ … }
static void
qed_ll2_prepare_tx_packet_set_bd(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2,
struct qed_ll2_tx_packet *p_curp,
struct qed_ll2_tx_pkt_info *pkt)
{ … }
static void qed_ll2_tx_packet_notify(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
int qed_ll2_prepare_tx_packet(void *cxt,
u8 connection_handle,
struct qed_ll2_tx_pkt_info *pkt,
bool notify_fw)
{ … }
int qed_ll2_set_fragment_of_tx_packet(void *cxt,
u8 connection_handle,
dma_addr_t addr, u16 nbytes)
{ … }
int qed_ll2_terminate_connection(void *cxt, u8 connection_handle)
{ … }
static void qed_ll2_release_connection_ooo(struct qed_hwfn *p_hwfn,
struct qed_ll2_info *p_ll2_conn)
{ … }
void qed_ll2_release_connection(void *cxt, u8 connection_handle)
{ … }
int qed_ll2_alloc(struct qed_hwfn *p_hwfn)
{ … }
void qed_ll2_setup(struct qed_hwfn *p_hwfn)
{ … }
void qed_ll2_free(struct qed_hwfn *p_hwfn)
{ … }
static void _qed_ll2_get_port_stats(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_ll2_stats *p_stats)
{ … }
static void _qed_ll2_get_tstats(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_ll2_info *p_ll2_conn,
struct qed_ll2_stats *p_stats)
{ … }
static void _qed_ll2_get_ustats(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_ll2_info *p_ll2_conn,
struct qed_ll2_stats *p_stats)
{ … }
static void _qed_ll2_get_pstats(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_ll2_info *p_ll2_conn,
struct qed_ll2_stats *p_stats)
{ … }
static int __qed_ll2_get_stats(void *cxt, u8 connection_handle,
struct qed_ll2_stats *p_stats)
{ … }
int qed_ll2_get_stats(void *cxt,
u8 connection_handle, struct qed_ll2_stats *p_stats)
{ … }
static void qed_ll2b_release_rx_packet(void *cxt,
u8 connection_handle,
void *cookie,
dma_addr_t rx_buf_addr,
bool b_last_packet)
{ … }
static void qed_ll2_register_cb_ops(struct qed_dev *cdev,
const struct qed_ll2_cb_ops *ops,
void *cookie)
{ … }
static struct qed_ll2_cbs ll2_cbs = …;
static void qed_ll2_set_conn_data(struct qed_hwfn *p_hwfn,
struct qed_ll2_acquire_data *data,
struct qed_ll2_params *params,
enum qed_ll2_conn_type conn_type,
u8 *handle, bool lb)
{ … }
static int qed_ll2_start_ooo(struct qed_hwfn *p_hwfn,
struct qed_ll2_params *params)
{ … }
static bool qed_ll2_is_storage_eng1(struct qed_dev *cdev)
{ … }
static int __qed_ll2_stop(struct qed_hwfn *p_hwfn)
{ … }
static int qed_ll2_stop(struct qed_dev *cdev)
{ … }
static int __qed_ll2_start(struct qed_hwfn *p_hwfn,
struct qed_ll2_params *params)
{ … }
static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
{ … }
static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb,
unsigned long xmit_flags)
{ … }
static int qed_ll2_stats(struct qed_dev *cdev, struct qed_ll2_stats *stats)
{ … }
const struct qed_ll2_ops qed_ll2_ops_pass = …;
int qed_ll2_alloc_if(struct qed_dev *cdev)
{ … }
void qed_ll2_dealloc_if(struct qed_dev *cdev)
{ … }