Back to home page

OSCL-LXR

 
 

    


0001 /**********************************************************************
0002  * Author: Cavium, Inc.
0003  *
0004  * Contact: support@cavium.com
0005  *          Please include "LiquidIO" in the subject.
0006  *
0007  * Copyright (c) 2003-2016 Cavium, Inc.
0008  *
0009  * This file is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License, Version 2, as
0011  * published by the Free Software Foundation.
0012  *
0013  * This file is distributed in the hope that it will be useful, but
0014  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
0015  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
0016  * NONINFRINGEMENT.  See the GNU General Public License for more details.
0017  ***********************************************************************/
0018 /*! \file  cn23xx_device.h
0019  * \brief Host Driver: Routines that perform CN23XX specific operations.
0020  */
0021 
0022 #ifndef __CN23XX_PF_DEVICE_H__
0023 #define __CN23XX_PF_DEVICE_H__
0024 
0025 #include "cn23xx_pf_regs.h"
0026 
0027 /* Register address and configuration for a CN23XX devices.
0028  * If device specific changes need to be made then add a struct to include
0029  * device specific fields as shown in the commented section
0030  */
0031 struct octeon_cn23xx_pf {
0032     /** PCI interrupt summary register */
0033     u8 __iomem *intr_sum_reg64;
0034 
0035     /** PCI interrupt enable register */
0036     u8 __iomem *intr_enb_reg64;
0037 
0038     /** The PCI interrupt mask used by interrupt handler */
0039     u64 intr_mask64;
0040 
0041     struct octeon_config *conf;
0042 };
0043 
0044 #define CN23XX_SLI_DEF_BP           0x40
0045 
0046 struct oct_vf_stats {
0047     u64 rx_packets;
0048     u64 tx_packets;
0049     u64 rx_bytes;
0050     u64 tx_bytes;
0051     u64 broadcast;
0052     u64 multicast;
0053 };
0054 
0055 int setup_cn23xx_octeon_pf_device(struct octeon_device *oct);
0056 
0057 int validate_cn23xx_pf_config_info(struct octeon_device *oct,
0058                    struct octeon_config *conf23xx);
0059 
0060 u32 cn23xx_pf_get_oq_ticks(struct octeon_device *oct, u32 time_intr_in_us);
0061 
0062 void cn23xx_dump_pf_initialized_regs(struct octeon_device *oct);
0063 
0064 int cn23xx_sriov_config(struct octeon_device *oct);
0065 
0066 int cn23xx_fw_loaded(struct octeon_device *oct);
0067 
0068 void cn23xx_tell_vf_its_macaddr_changed(struct octeon_device *oct, int vfidx,
0069                     u8 *mac);
0070 
0071 int cn23xx_get_vf_stats(struct octeon_device *oct, int ifidx,
0072             struct oct_vf_stats *stats);
0073 #endif