X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fthunderx%2Fbase%2Fnicvf_mbox.h;h=d0b294362cc859012654b1b3c24d725174e831e9;hb=18da3c854bb8105818dc23c36eecf3465596052a;hp=084f3a769c3c8b1577ff785fa4ef9138516827c5;hpb=10b0e74f9995e25dd186e4fb0b383bf401624f85;p=dpdk.git diff --git a/drivers/net/thunderx/base/nicvf_mbox.h b/drivers/net/thunderx/base/nicvf_mbox.h index 084f3a769c..d0b294362c 100644 --- a/drivers/net/thunderx/base/nicvf_mbox.h +++ b/drivers/net/thunderx/base/nicvf_mbox.h @@ -1,33 +1,5 @@ -/* - * BSD LICENSE - * - * Copyright (C) Cavium networks Ltd. 2016. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Cavium networks nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016 Cavium, Inc */ #ifndef __THUNDERX_NICVF_MBOX__ @@ -68,16 +40,11 @@ #define NIC_MBOX_MSG_ALLOC_SQS 0x12 /* Allocate secondary Qset */ #define NIC_MBOX_MSG_LOOPBACK 0x16 /* Set interface in loopback */ #define NIC_MBOX_MSG_RESET_STAT_COUNTER 0x17 /* Reset statistics counters */ -#define NIC_MBOX_MSG_CFG_DONE 0x7E /* VF configuration done */ -#define NIC_MBOX_MSG_SHUTDOWN 0x7F /* VF is being shutdown */ -#define NIC_MBOX_MSG_RES_BIT 0x80 /* Reset bit from PF */ +#define NIC_MBOX_MSG_SET_LINK 0x21 /* Set link up/down */ +#define NIC_MBOX_MSG_CFG_DONE 0xF0 /* VF configuration done */ +#define NIC_MBOX_MSG_SHUTDOWN 0xF1 /* VF is being shutdown */ #define NIC_MBOX_MSG_MAX 0x100 /* Maximum number of messages */ -#define NIC_MBOX_MSG_RSS_SIZE_RES_BIT \ - (NIC_MBOX_MSG_RSS_SIZE | NIC_MBOX_MSG_RES_BIT) -#define NIC_MBOX_MSG_ALLOC_SQS_RES_BIT \ - (NIC_MBOX_MSG_ALLOC_SQS | NIC_MBOX_MSG_RES_BIT) - /* Get vNIC VF configuration */ struct nic_cfg_msg { uint8_t msg; @@ -157,6 +124,7 @@ struct rss_cfg_msg { /* Physical interface link status */ struct bgx_link_status { uint8_t msg; + uint8_t mac_type; uint8_t link_up; uint8_t duplex; uint32_t speed; @@ -202,6 +170,13 @@ struct reset_stat_cfg { uint16_t sq_stat_mask; }; +/* Set link up/down */ +struct set_link_state { + uint8_t msg; + uint8_t vf_id; + bool enable; +}; + struct nic_mbx { /* 128 bit shared memory between PF and each VF */ union { @@ -219,6 +194,7 @@ union { struct sqs_alloc sqs_alloc; struct set_loopback lbk; struct reset_stat_cfg reset_stat; + struct set_link_state set_link; }; }; @@ -243,6 +219,7 @@ int nicvf_mbox_rq_sync(struct nicvf *nic); int nicvf_mbox_loopback_config(struct nicvf *nic, bool enable); int nicvf_mbox_reset_stat_counters(struct nicvf *nic, uint16_t rx_stat_mask, uint8_t tx_stat_mask, uint16_t rq_stat_mask, uint16_t sq_stat_mask); +int nicvf_mbox_set_link_up_down(struct nicvf *nic, bool enable); void nicvf_mbox_shutdown(struct nicvf *nic); void nicvf_mbox_cfg_done(struct nicvf *nic);