linux/drivers/net/ethernet/cavium/liquidio/octeon_network.h

/**********************************************************************
 * Author: Cavium, Inc.
 *
 * Contact: [email protected]
 *          Please include "LiquidIO" in the subject.
 *
 * Copyright (c) 2003-2016 Cavium, Inc.
 *
 * This file is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, Version 2, as
 * published by the Free Software Foundation.
 *
 * This file is distributed in the hope that it will be useful, but
 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
 * NONINFRINGEMENT.  See the GNU General Public License for more
 * details.
 **********************************************************************/

/*!  \file  octeon_network.h
 *   \brief Host NIC Driver: Structure and Macro definitions used by NIC Module.
 */

#ifndef __OCTEON_NETWORK_H__
#define __OCTEON_NETWORK_H__
#include <linux/ptp_clock_kernel.h>

#define LIO_MAX_MTU_SIZE
#define LIO_MIN_MTU_SIZE

/* Bit mask values for lio->ifstate */
#define LIO_IFSTATE_DROQ_OPS
#define LIO_IFSTATE_REGISTERED
#define LIO_IFSTATE_RUNNING
#define LIO_IFSTATE_RX_TIMESTAMP_ENABLED
#define LIO_IFSTATE_RESETTING

struct liquidio_if_cfg_resp {};

#define LIO_IFCFG_WAIT_TIME
#define LIQUIDIO_NDEV_STATS_POLL_TIME_MS

/* Structure of a node in list of gather components maintained by
 * NIC driver for each network device.
 */
struct octnic_gather {};

struct oct_nic_stats_resp {};

struct oct_nic_vf_stats_resp {};

struct oct_nic_stats_ctrl {};

struct oct_nic_seapi_resp {};

/** LiquidIO per-interface network private data */
struct lio {};

#define LIO_SIZE
#define GET_LIO(netdev)

#define LIO_MAX_CORES

/**
 * \brief Enable or disable feature
 * @param netdev    pointer to network device
 * @param cmd       Command that just requires acknowledgment
 * @param param1    Parameter to command
 */
int liquidio_set_feature(struct net_device *netdev, int cmd, u16 param1);

int setup_rx_oom_poll_fn(struct net_device *netdev);

void cleanup_rx_oom_poll_fn(struct net_device *netdev);

/**
 * \brief Link control command completion callback
 * @param nctrl_ptr pointer to control packet structure
 *
 * This routine is called by the callback function when a ctrl pkt sent to
 * core app completes. The nctrl_ptr contains a copy of the command type
 * and data sent to the core app. This routine is only called if the ctrl
 * pkt was sent successfully to the core app.
 */
void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr);

int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx,
			     u32 num_iqs, u32 num_oqs);

irqreturn_t liquidio_msix_intr_handler(int irq __attribute__((unused)),
				       void *dev);

int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs);

void lio_fetch_stats(struct work_struct *work);

int lio_wait_for_clean_oq(struct octeon_device *oct);
/**
 * \brief Register ethtool operations
 * @param netdev    pointer to network device
 */
void liquidio_set_ethtool_ops(struct net_device *netdev);

void lio_delete_glists(struct lio *lio);

int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_qs);

int liquidio_get_speed(struct lio *lio);
int liquidio_set_speed(struct lio *lio, int speed);
int liquidio_get_fec(struct lio *lio);
int liquidio_set_fec(struct lio *lio, int on_off);

/**
 * \brief Net device change_mtu
 * @param netdev network device
 */
int liquidio_change_mtu(struct net_device *netdev, int new_mtu);
#define LIO_CHANGE_MTU_SUCCESS
#define LIO_CHANGE_MTU_FAIL

#define SKB_ADJ_MASK
#define SKB_ADJ

#define MIN_SKB_SIZE
#define LIO_RXBUFFER_SZ

static inline void
*recv_buffer_alloc(struct octeon_device *oct,
		   struct octeon_skb_page_info *pg_info)
{}

static inline void
*recv_buffer_fast_alloc(u32 size)
{}

static inline int
recv_buffer_recycle(struct octeon_device *oct, void *buf)
{}

static inline void
*recv_buffer_reuse(struct octeon_device *oct, void *buf)
{}

static inline void
recv_buffer_destroy(void *buffer, struct octeon_skb_page_info *pg_info)
{}

static inline void recv_buffer_free(void *buffer)
{}

static inline void
recv_buffer_fast_free(void *buffer)
{}

static inline void tx_buffer_free(void *buffer)
{}

#define lio_dma_alloc(oct, size, dma_addr)
#define lio_dma_free(oct, size, virt_addr, dma_addr)

static inline
void *get_rbd(struct sk_buff *skb)
{}

static inline u64
lio_map_ring(void *buf)
{}

static inline void
lio_unmap_ring(struct pci_dev *pci_dev,
	       u64 buf_ptr)

{}

static inline void *octeon_fast_packet_alloc(u32 size)
{}

static inline void octeon_fast_packet_next(struct octeon_droq *droq,
					   struct sk_buff *nicbuf,
					   int copy_len,
					   int idx)
{}

/**
 * \brief check interface state
 * @param lio per-network private data
 * @param state_flag flag state to check
 */
static inline int ifstate_check(struct lio *lio, int state_flag)
{}

/**
 * \brief set interface state
 * @param lio per-network private data
 * @param state_flag flag state to set
 */
static inline void ifstate_set(struct lio *lio, int state_flag)
{}

/**
 * \brief clear interface state
 * @param lio per-network private data
 * @param state_flag flag state to clear
 */
static inline void ifstate_reset(struct lio *lio, int state_flag)
{}

/**
 * \brief wait for all pending requests to complete
 * @param oct Pointer to Octeon device
 *
 * Called during shutdown sequence
 */
static inline int wait_for_pending_requests(struct octeon_device *oct)
{}

/**
 * \brief Stop Tx queues
 * @param netdev network device
 */
static inline void stop_txqs(struct net_device *netdev)
{}

/**
 * \brief Wake Tx queues
 * @param netdev network device
 */
static inline void wake_txqs(struct net_device *netdev)
{}

/**
 * \brief Start Tx queues
 * @param netdev network device
 */
static inline void start_txqs(struct net_device *netdev)
{}

static inline int skb_iq(struct octeon_device *oct, struct sk_buff *skb)
{}

/**
 * Remove the node at the head of the list. The list would be empty at
 * the end of this call if there are no more nodes in the list.
 */
static inline struct list_head *lio_list_delete_head(struct list_head *root)
{}

#endif