]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Retrieve the hardware bridge mode from the firmware.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 24 Jul 2017 16:34:21 +0000 (12:34 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Sep 2017 04:41:50 +0000 (21:41 -0700)
Orabug: 26726982

Retrieve and store the hardware bridge mode, so that we can implement
ndo_bridge_{get|set)link methods in the next patch.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 32e8239c9138a050bc1feeea7cf41f27d79e6664)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 7a510e4ab73ff4117d303f66884ff6024e95a7ba..e4634963029cf397dbb0eb376f93d860038a37f0 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/mii.h>
 #include <linux/if.h>
 #include <linux/if_vlan.h>
+#include <linux/if_bridge.h>
 #include <linux/rtc.h>
 #include <net/ip.h>
 #include <net/tcp.h>
@@ -4631,6 +4632,13 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
                bp->port_partition_type = resp->port_partition_type;
                break;
        }
+       if (bp->hwrm_spec_code < 0x10707 ||
+           resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEB)
+               bp->br_mode = BRIDGE_MODE_VEB;
+       else if (resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEPA)
+               bp->br_mode = BRIDGE_MODE_VEPA;
+       else
+               bp->br_mode = BRIDGE_MODE_UNDEF;
 
 func_qcfg_exit:
        mutex_unlock(&bp->hwrm_cmd_lock);
index d97004cc11a45c2a37337fdf9dd3a12e557f13dd..0453a6b741a874b328734f9f395538604d7716df 100644 (file)
@@ -1154,6 +1154,7 @@ struct bnxt {
        u8                      nge_port_cnt;
        __le16                  nge_fw_dst_port_id;
        u8                      port_partition_type;
+       u16                     br_mode;
 
        u16                     rx_coal_ticks;
        u16                     rx_coal_ticks_irq;