summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/swconfig.c
Commit message (Collapse)AuthorAgeFilesLines
* swconfig: revert the portmapping patches, they seem to cause a segfaultJohn Crispin2016-08-161-0/+76
| | | | | | | | | | | | Revert "kernel/swconfig: remove obsolete portmapping feature from swconfig" This reverts commit 675407baa44a8700de20b6b2857009a552a807ba. Revert "swconfig: remove obsolete portmapping feature" This reverts commit fca1eb349ef31b133a62880cbd562d6bf17500aa. Signed-off-by: John Crispin <john@phrozen.org>
* kernel/swconfig: remove obsolete portmapping feature from swconfigJohn Crispin2016-08-151-76/+0
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* kernel: require admin permissions for swconfig set operationsFelix Fietkau2016-06-121-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: deny swconfig set requests for unprivileged usersJo-Philipp Wich2016-06-111-0/+3
| | | | | | | | | | | | | | | | | The swconfig kernel infrastructure fails to do any permissions checks when changing settings. As such an ordinary user account on a device with a switch can change switch settings without any special permissions. Routers generally have few non-admin users so this isn't a big hole, but it is a security hole. Likely the greatest danger is for multifunction devices which have a lot of extra daemons, compromising a low-security daemon would allow one to modify switch settings and cause the router/switch to appear to lock-up (or cause other sorts of troublesome nyetwork behavior). Implement a check for CAP_NET_ADMIN in swconfig_set_attr() and deny any requests originating from user contexts lacking this capability. Reported-by: Elliott Mitchell <ehem+openwrt@m5p.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-071-2/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* swconfig: add (PHY) generic helper setting port linkRafał Miłecki2016-02-031-0/+36
| | | | | | | | | | It's quite common for switches to have PHY per port so adding a generic helper setting link state will help many drivers. It just needs an API to access PHYs which this patch also adds. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48621
* swconfig: simplify init codeJonas Gorski2016-01-241-6/+1
| | | | | | | | | Directly return the return value of genl_register_family_with_ops() instead of storing it in a temporary variable, then returning it. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 48472
* swconfig: drop linux < 3.13 code pathsJonas Gorski2016-01-241-20/+0
| | | | | | | | | The oldest kernel we support is 3.18, no need to keep code paths for older kernels. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 48471
* swconfig: add API for setting port link speedRafał Miłecki2016-01-061-1/+48
| | | | | | | | | Some switches can force link speed for a port. Let's add API that will allow drivers to export this feature. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48142
* swconfig: switch kernel PORT_LINK support to SWITCH_TYPE_LINKJohn Crispin2015-12-231-47/+4
| | | | | | | | | As explained earlier, using SWITCH_TYPE_LINK gives more flexibility, it doesn't require e.g. string parsing to read some data. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 47999
* swconfig: add SWITCH_TYPE_LINK and support sending link info to user spaceJohn Crispin2015-12-231-0/+56
| | | | | | | | | | | | | So far we were sending link data as a string. It got some drawbacks: 1) Didn't allow writing clean user space apps reading link state. It was needed to do some screen scraping. 2) Forced whole PORT_LINK communication to be string based. Adding support for *setting* port link required passing string and parting it in the kernel space. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 47997
* swconfig: fix build with linux 4.0John Crispin2015-03-061-3/+6
| | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 44617
* ar8216: add 802.3az EEE info to swconfig get_link attributeFelix Fietkau2015-01-181-1/+3
| | | | | | | | | | | | | AR8327/AR8337 allow to read the result of EEE autonegotiation. If EEE is autonegotiated between the link partners, display this as part of the swconfig get_link attribute. eee100: 100MBit EEE supported by both link partners eee1000: 1GBit EEE supported by both link partners Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 44022
* swconfig: last vs tailJohn Crispin2014-10-291-1/+1
| | | | | | | | sorry ..... Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43107
* swconfig: "swconfig list" shows devices in reverse orderJohn Crispin2014-10-291-1/+1
| | | | | | | | | Boards that have more than one swconfig enabled switch will show the devices in reverse order when call swconfig list. Fix this by using list_add_tail(). Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43106
* kernel: fix warning in swconfig.c with kernel 3.14Hauke Mehrtens2014-05-081-6/+10
| | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 40733
* modules: swconfig.c: update the error path on 3.13, and behave nicely with ↵Zoltan Herpai2014-01-211-3/+2
| | | | | | | | return Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> SVN-Revision: 39360
* modules: update swconfig.c to compile on 3.13 (compile-tested)Zoltan Herpai2014-01-211-0/+8
| | | | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu> SVN-Revision: 39359
* kernel: make swconfig checkpath compliantFlorian Fainelli2013-10-241-35/+40
| | | | | | | | Fix the warnings and errors reported by checkpatch on swconfig.c Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 38523
* unbreak portmapping - typo fixJohn Crispin2013-04-091-1/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36293
* allow loading port maps from OFJohn Crispin2013-04-091-0/+73
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36283
* swconfig: make it compatible with 3.7Gabor Juhos2012-11-211-3/+3
| | | | | | | | | | | | | | | | | | | swconfig does not compile with 3.7 because struct netlink_notify->pid has been renamed to struct netlink_notify->portid and struct genl_info->snd_pid has been renamed to struct genl_info->snd_portid Use the new names and add compatibility patches to 3.3 and 3.6. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34288
* swconfig: get rid of the NLA_PUT_* macrosFlorian Fainelli2012-10-241-17/+33
| | | | | | | Upstream kernel 3.6 has removed this usage, use the plain functions directly as intended. SVN-Revision: 33906
* swconfig: use a mutex instead of a spinlock, many swconfig calls sleepFelix Fietkau2012-03-151-5/+5
| | | | SVN-Revision: 30952
* generic: swconfig: add a generic get_port_link implementationGabor Juhos2012-03-071-0/+79
| | | | SVN-Revision: 30839
* kernel: swconfig: introduce a generic switch LED triggerGabor Juhos2011-12-311-0/+8
| | | | SVN-Revision: 29627
* kernel: swconfig: add a missing unlock in error pathGabor Juhos2011-11-041-1/+3
| | | | SVN-Revision: 28753
* swconfig: Add generic switch identifiersJonas Gorski2011-07-271-5/+30
| | | | | | | | Also make switches available under a generic name "switch<num>" for device name agnostic access. The old device name is used as an alias for backward compatibility. SVN-Revision: 27800
* swconfig: Replace SPIN_LOCK_UNLOCKED with DEFINE_SPINLOCKFelix Fietkau2011-04-261-1/+1
| | | | | | | | | SPIN_LOCK_UNLOCKED has been deprecated since 2.6.19 and will get removed in 2.6.39, so replace it with DEFINE_SPINLOCK(). Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> SVN-Revision: 26770
* swconfig: cleanup of kernel drivers and interface - add some comments to a ↵Felix Fietkau2010-08-041-25/+29
| | | | | | few data structures - add a switch_dev_ops data structure for attributes and callback to replace the stupid template memcpy - get rid of the switch_dev.priv pointer - using container_of() is better SVN-Revision: 22476
* rename target/linux/generic-2.6 to genericFelix Fietkau2010-06-261-0/+925
SVN-Revision: 21952