aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/Kconfig22
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/Makefile14
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c6
3 files changed, 24 insertions, 18 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/Kconfig b/target/linux/generic/files/drivers/net/phy/b53/Kconfig
index 67e053ea0f..08287e7adf 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/Kconfig
+++ b/target/linux/generic/files/drivers/net/phy/b53/Kconfig
@@ -1,4 +1,4 @@
-menuconfig B53
+menuconfig SWCONFIG_B53
tristate "Broadcom bcm53xx managed switch support"
depends on SWCONFIG
help
@@ -6,32 +6,32 @@ menuconfig B53
BCM5325E, BCM5365, BCM539x, BCM53115 and BCM53125 as well as BCM63XX
integrated switches.
-config B53_SPI_DRIVER
+config SWCONFIG_B53_SPI_DRIVER
tristate "B53 SPI connected switch driver"
- depends on B53 && SPI
+ depends on SWCONFIG_B53 && SPI
help
Select to enable support for registering switches configured through SPI.
-config B53_PHY_DRIVER
+config SWCONFIG_B53_PHY_DRIVER
tristate "B53 MDIO connected switch driver"
- depends on B53
- select B53_PHY_FIXUP
+ depends on SWCONFIG_B53
+ select SWCONFIG_B53_PHY_FIXUP
help
Select to enable support for registering switches configured through MDIO.
-config B53_MMAP_DRIVER
+config SWCONFIG_B53_MMAP_DRIVER
tristate "B53 MMAP connected switch driver"
- depends on B53
+ depends on SWCONFIG_B53
help
Select to enable support for memory-mapped switches like the BCM63XX
integrated switches.
-config B53_SRAB_DRIVER
+config SWCONFIG_B53_SRAB_DRIVER
tristate "B53 SRAB connected switch driver"
- depends on B53
+ depends on SWCONFIG_B53
help
Select to enable support for memory-mapped Switch Register Access
Bridge Registers (SRAB) like it is found on the BCM53010
-config B53_PHY_FIXUP
+config SWCONFIG_B53_PHY_FIXUP
bool
diff --git a/target/linux/generic/files/drivers/net/phy/b53/Makefile b/target/linux/generic/files/drivers/net/phy/b53/Makefile
index 7cc39c7628..13ff366448 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/Makefile
+++ b/target/linux/generic/files/drivers/net/phy/b53/Makefile
@@ -1,10 +1,10 @@
-obj-$(CONFIG_B53) += b53_common.o
+obj-$(CONFIG_SWCONFIG_B53) += b53_common.o
-obj-$(CONFIG_B53_PHY_FIXUP) += b53_phy_fixup.o
+obj-$(CONFIG_SWCONFIG_B53_PHY_FIXUP) += b53_phy_fixup.o
-obj-$(CONFIG_B53_MMAP_DRIVER) += b53_mmap.o
-obj-$(CONFIG_B53_SRAB_DRIVER) += b53_srab.o
-obj-$(CONFIG_B53_PHY_DRIVER) += b53_mdio.o
-obj-$(CONFIG_B53_SPI_DRIVER) += b53_spi.o
+obj-$(CONFIG_SWCONFIG_B53_MMAP_DRIVER) += b53_mmap.o
+obj-$(CONFIG_SWCONFIG_B53_SRAB_DRIVER) += b53_srab.o
+obj-$(CONFIG_SWCONFIG_B53_PHY_DRIVER) += b53_mdio.o
+obj-$(CONFIG_SWCONFIG_B53_SPI_DRIVER) += b53_spi.o
-ccflags-y += -Werror
+ccflags-y += -Werror
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index b556510aef..c70ca74cad 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -635,6 +635,9 @@ swconfig_set_attr(struct sk_buff *skb, struct genl_info *info)
struct switch_val val;
int err = -EINVAL;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
dev = swconfig_get_dev(info);
if (!dev)
return -EINVAL;
@@ -1022,16 +1025,19 @@ static struct genl_ops swconfig_ops[] = {
},
{
.cmd = SWITCH_CMD_SET_GLOBAL,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},
{
.cmd = SWITCH_CMD_SET_VLAN,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},
{
.cmd = SWITCH_CMD_SET_PORT,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},