linux/drivers/net/ethernet/cavium/liquidio/octeon_device.c

/**********************************************************************
 * 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.
 ***********************************************************************/
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/vmalloc.h>
#include "liquidio_common.h"
#include "octeon_droq.h"
#include "octeon_iq.h"
#include "response_manager.h"
#include "octeon_device.h"
#include "octeon_main.h"
#include "octeon_network.h"
#include "cn66xx_regs.h"
#include "cn66xx_device.h"
#include "cn23xx_pf_device.h"
#include "cn23xx_vf_device.h"

/** Default configuration
 *  for CN66XX OCTEON Models.
 */
static struct octeon_config default_cn66xx_conf =;

/** Default configuration
 *  for CN68XX OCTEON Model.
 */

static struct octeon_config default_cn68xx_conf =;

/** Default configuration
 *  for CN68XX OCTEON Model.
 */
static struct octeon_config default_cn68xx_210nv_conf =;

static struct octeon_config default_cn23xx_conf =;

static struct octeon_config_ptr {} oct_conf_info[MAX_OCTEON_DEVICES] =;

static char oct_dev_state_str[OCT_DEV_STATES + 1][32] =;

static char oct_dev_app_str[CVM_DRV_APP_COUNT + 1][32] =;

static struct octeon_device *octeon_device[MAX_OCTEON_DEVICES];
static atomic_t adapter_refcounts[MAX_OCTEON_DEVICES];
static atomic_t adapter_fw_states[MAX_OCTEON_DEVICES];

static u32 octeon_device_count;
/* locks device array (i.e. octeon_device[]) */
static DEFINE_SPINLOCK(octeon_devices_lock);

static struct octeon_core_setup core_setup[MAX_OCTEON_DEVICES];

static void oct_set_config_info(int oct_id, int conf_type)
{}

void octeon_init_device_list(int conf_type)
{}
EXPORT_SYMBOL_GPL();

static void *__retrieve_octeon_config_info(struct octeon_device *oct,
					   u16 card_type)
{}

static int __verify_octeon_config_info(struct octeon_device *oct, void *conf)
{}

void *oct_get_config_info(struct octeon_device *oct, u16 card_type)
{}

char *lio_get_state_string(atomic_t *state_ptr)
{}
EXPORT_SYMBOL_GPL();

static char *get_oct_app_string(u32 app_mode)
{}

void octeon_free_device_mem(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

static struct octeon_device *octeon_allocate_device_mem(u32 pci_id,
							u32 priv_size)
{}

struct octeon_device *octeon_allocate_device(u32 pci_id,
					     u32 priv_size)
{}
EXPORT_SYMBOL_GPL();

/** Register a device's bus location at initialization time.
 *  @param octeon_dev - pointer to the octeon device structure.
 *  @param bus        - PCIe bus #
 *  @param dev        - PCIe device #
 *  @param func       - PCIe function #
 *  @param is_pf      - TRUE for PF, FALSE for VF
 *  @return reference count of device's adapter
 */
int octeon_register_device(struct octeon_device *oct,
			   int bus, int dev, int func, int is_pf)
{}
EXPORT_SYMBOL_GPL();

/** Deregister a device at de-initialization time.
 *  @param octeon_dev - pointer to the octeon device structure.
 *  @return reference count of device's adapter
 */
int octeon_deregister_device(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

int
octeon_allocate_ioq_vector(struct octeon_device *oct, u32 num_ioqs)
{}
EXPORT_SYMBOL_GPL();

void
octeon_free_ioq_vector(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

/* this function is only for setting up the first queue */
int octeon_setup_instr_queues(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

int octeon_setup_output_queues(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

int octeon_set_io_queues_off(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

void octeon_set_droq_pkt_op(struct octeon_device *oct,
			    u32 q_no,
			    u32 enable)
{}

int octeon_init_dispatch_list(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

void octeon_delete_dispatch_list(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

octeon_dispatch_fn_t
octeon_get_dispatch(struct octeon_device *octeon_dev, u16 opcode,
		    u16 subcode)
{}

/* octeon_register_dispatch_fn
 * Parameters:
 *   octeon_id - id of the octeon device.
 *   opcode    - opcode for which driver should call the registered function
 *   subcode   - subcode for which driver should call the registered function
 *   fn        - The function to call when a packet with "opcode" arrives in
 *		  octeon output queues.
 *   fn_arg    - The argument to be passed when calling function "fn".
 * Description:
 *   Registers a function and its argument to be called when a packet
 *   arrives in Octeon output queues with "opcode".
 * Returns:
 *   Success: 0
 *   Failure: 1
 * Locks:
 *   No locks are held.
 */
int
octeon_register_dispatch_fn(struct octeon_device *oct,
			    u16 opcode,
			    u16 subcode,
			    octeon_dispatch_fn_t fn, void *fn_arg)
{}
EXPORT_SYMBOL_GPL();

int octeon_core_drv_init(struct octeon_recv_info *recv_info, void *buf)
{}
EXPORT_SYMBOL_GPL();

int octeon_get_tx_qsize(struct octeon_device *oct, u32 q_no)

{}
EXPORT_SYMBOL_GPL();

int octeon_get_rx_qsize(struct octeon_device *oct, u32 q_no)
{}
EXPORT_SYMBOL_GPL();

/* Retruns the host firmware handshake OCTEON specific configuration */
struct octeon_config *octeon_get_conf(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

/* scratch register address is same in all the OCT-II and CN70XX models */
#define CNXX_SLI_SCRATCH1

/* Get the octeon device pointer.
 *  @param octeon_id  - The id for which the octeon device pointer is required.
 *  @return Success: Octeon device pointer.
 *  @return Failure: NULL.
 */
struct octeon_device *lio_get_device(u32 octeon_id)
{}
EXPORT_SYMBOL_GPL();

u64 lio_pci_readq(struct octeon_device *oct, u64 addr)
{}
EXPORT_SYMBOL_GPL();

void lio_pci_writeq(struct octeon_device *oct,
		    u64 val,
		    u64 addr)
{}
EXPORT_SYMBOL_GPL();

int octeon_mem_access_ok(struct octeon_device *oct)
{}
EXPORT_SYMBOL_GPL();

int octeon_wait_for_ddr_init(struct octeon_device *oct, u32 *timeout)
{}
EXPORT_SYMBOL_GPL();

/* Get the octeon id assigned to the octeon device passed as argument.
 *  This function is exported to other modules.
 *  @param dev - octeon device pointer passed as a void *.
 *  @return octeon device id
 */
int lio_get_device_id(void *dev)
{}

void lio_enable_irq(struct octeon_droq *droq, struct octeon_instr_queue *iq)
{}
EXPORT_SYMBOL_GPL();