Skip to content

Commit

Permalink
Update Barefoot kdrv (#4355)
Browse files Browse the repository at this point in the history
  • Loading branch information
msosyak committed Apr 14, 2020
1 parent 2872d80 commit 530c9fc
Show file tree
Hide file tree
Showing 3 changed files with 832 additions and 567 deletions.
67 changes: 45 additions & 22 deletions platform/barefoot/bfn-modules/modules/bf_ioctl.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) 2018-2018 Barefoot Networks, Inc.
*
* NOTICE: All information contained herein is, and remains the property of
* Barefoot Networks, Inc. and its suppliers, if any. The intellectual and
* technical concepts contained herein are proprietary to Barefoot Networks,
* Inc.
* and its suppliers and may be covered by U.S. and Foreign Patents, patents in
* process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material is
* strictly forbidden unless prior written permission is obtained from
* Barefoot Networks, Inc.
*
* No warranty, explicit or implicit is provided, unless granted under a
* written agreement with Barefoot Networks, Inc.
*
* $Id: $
*
******************************************************************************/
Barefoot Networks Switch ASIC Linux driver
Copyright(c) 2015 - 2019 Barefoot Networks, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
info@barefootnetworks.com
Barefoot Networks, 4750 Patrick Henry Drive, Santa Clara CA 95054
*******************************************************************************/
#ifndef _BF_IOCTL_H_
#define _BF_IOCTL_H_

Expand All @@ -35,15 +38,35 @@ typedef uint64_t phys_addr_t;
#endif /* __KERNEL__ */

#define BF_IOC_MAGIC 'b'
#define BF_TBUS_MSIX_INDICES_MAX 3

typedef struct bf_dma_bus_map_s
typedef struct bf_dma_bus_map_s
{
phys_addr_t phy_addr;
void *dma_addr;
size_t size;
} bf_dma_bus_map_t;

typedef struct bf_tbus_msix_indices_s
{
int cnt;
int indices[BF_TBUS_MSIX_INDICES_MAX];
} bf_tbus_msix_indices_t;

enum bf_intr_mode {
BF_INTR_MODE_NONE = 0,
BF_INTR_MODE_LEGACY,
BF_INTR_MODE_MSI,
BF_INTR_MODE_MSIX,
};

typedef struct bf_intr_mode_s {
enum bf_intr_mode intr_mode;
} bf_intr_mode_t;

#define BF_IOCMAPDMAADDR _IOWR(BF_IOC_MAGIC, 0, bf_dma_bus_map_t)
#define BF_IOCUNMAPDMAADDR _IOW(BF_IOC_MAGIC, 0, bf_dma_bus_map_t)
#define BF_IOCUNMAPDMAADDR _IOW(BF_IOC_MAGIC, 1, bf_dma_bus_map_t)
#define BF_TBUS_MSIX_INDEX _IOW(BF_IOC_MAGIC, 2, bf_tbus_msix_indices_t)
#define BF_GET_INTR_MODE _IOR(BF_IOC_MAGIC, 3, bf_intr_mode_t)

#endif /* _BF_IOCTL_H_ */
Loading

0 comments on commit 530c9fc

Please sign in to comment.