// SPDX-License-Identifier: GPL-2.0
/*
* DPAA2 Ethernet Switch driver
*
* Copyright 2014-2016 Freescale Semiconductor Inc.
* Copyright 2017-2018 NXP
*
*/
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/msi.h>
#include <linux/kthread.h>
#include <linux/workqueue.h>
#include <linux/fsl/mc.h>
#include "ethsw.h"
static struct workqueue_struct *ethsw_owq;
/* Minimal supported DPSW version */
#define DPSW_MIN_VER_MAJOR 8
#define DPSW_MIN_VER_MINOR 0
#define DEFAULT_VLAN_ID 1
static int ethsw_add_vlan(struct ethsw_core *ethsw, u16 vid)
{
int err;
struct dpsw_vlan_cfg vcfg = {
.fdb_id = 0,
};
if (ethsw->vlans[vid]) {
dev_err(ethsw->dev, "VLAN already configured\n");
return -EEXIST;
}
err = dpsw_vlan_add(ethsw->mc_io, 0,