Commit Graph

36 Commits (1634461bd208f4bd108ea5c3d3f1cf9eb56d4a7e)

Author SHA1 Message Date
Hauke Mehrtens e926681387 swconfig: Activate LTO compile option
This decreases the size of the swconfig application by 25% on MIPS BE.

old:
16,916 /sbin/swconfig

new:
12,565 /sbin/swconfig

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Rosen Penev 1e98d985bb swconfig: Add missing include
Fixes these warnings:

swlib.c:455:18: warning: implicit declaration of function 'isspace'
swlib.c:461:9: warning: implicit declaration of function 'isdigit'

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Alexander Couzens b06c447c5f
swconfig: swlib_map_settings(): change return type to void
The return value of the function isn't used anywhere.
Fixes missing return value, CID 1329717.

Found-by: Coverity
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
6 years ago
Alexander Couzens e37ad4e5ca
swconfig: fix un-initialized return value
Fix CID 1330844

Found-by: Coverity
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
6 years ago
Florian Fainelli fe8618a8fe swconfig: Link with libubox
Fixes linking failures observed with external toolchains:

/home/florian/dev/toolchains/stbgcc-4.8-1.5/bin/../lib/gcc/mipsel-linux-gnu/4.8.5/../../../../mipsel-linux-gnu/bin/ld:
warning: libubox.so, needed by
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/lib/libuci.so,
not found (try using -rpath or -rpath-link)
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/lib/libuci.so:
undefined reference to `blobmsg_open_nested'
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/lib/libuci.so:
undefined reference to `blobmsg_parse'
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/lib/libuci.so:
undefined reference to `blob_nest_end'
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/lib/libuci.so:
undefined reference to `blobmsg_add_field'

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Ben Kelly df9e7b1b26 swconfig: Bugfix switch_port uci option parsing
When not defining 'device' or 'vlan' in relevant switch_port uci
sections, behaviour is inconsistent due to *devn, *port and *vlan
pointers not being zero initialized.

Signed-off-by: Ben Kelly <ben@benjii.net>
7 years ago
Felix Fietkau e82c8d6e20 swconfig: replace the shared library with a static one
Reduces binary size

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Alexandru Ardelean b8135a5b96 network/config/swconfig: drop Build/Prepare rule in favor of default one
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
John Crispin 99a1888287 swconfig: revert the portmapping patches, they seem to cause a segfault
Revert "kernel/swconfig: remove obsolete portmapping feature from swconfig"

This reverts commit 675407baa4.

Revert "swconfig: remove obsolete portmapping feature"

This reverts commit fca1eb349e.

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin fca1eb349e swconfig: remove obsolete portmapping feature
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Jo-Philipp Wich dd182011e1 swconfig: improve failure reporting
Report the translated error to the user if a get/set netlink operation failed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 7eeb254cc4 treewide: replace nbd@openwrt.org with nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Rafał Miłecki 6219b3deae swconfig: support setting SWITCH_TYPE_LINK attributes
Supported syntax is inspired by ethtool. Example usages:
swconfig dev switch0 port 2 set link "duplex half speed 100"
swconfig dev switch0 port 2 set link "autoneg on"

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48624
8 years ago
Rafał Miłecki a09e713299 swconfig: support sending SWITCH_TYPE_LINK to kernel
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48141
8 years ago
John Crispin 8536afae6f swconfig: support receiving SWITCH_TYPE_LINK from kernel
When using cli, print link state the same way kernel used to do it.
This will allow kernel switching PORT_LINK from SWITCH_TYPE_STRING.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 47998
9 years ago
Steven Barth e07959cade package: replace ifconfig-usage with ip
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46832
9 years ago
John Crispin d42b6c1afb swconfig: libsw.so should be installed into /usr/lib/
otherwise it's not picked up by toolchain:

staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_musl-1.1.10/lib/gcc/mipsel-openwrt-linux-musl/4.8.3/../../../../mipsel-openwrt-linux-musl/bin/ld: cannot find -lsw

Signed-off-by: Roman Yeryomin <roman@advem.lv>

SVN-Revision: 46406
9 years ago
John Crispin c71ef0499b swconfig: Split libsw out of swconfig for reuse in other packages
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

SVN-Revision: 46358
9 years ago
Felix Fietkau 7a04fd0e3a swconfig: swlib.c: Fix another memleak
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

SVN-Revision: 46275
9 years ago
John Crispin 5da98f3478 swconfig: swlib.c: free name and description of attributes
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

SVN-Revision: 46232
9 years ago
John Crispin 294907aa3a swconfig: swlib.c: free portmaps in swlib_free()
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

SVN-Revision: 46231
9 years ago
John Crispin 2b9bdf4d6f swconfig: swlib.c: remove const qualifier for val.s since this is supposed to be free'd
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

SVN-Revision: 46230
9 years ago
John Crispin 08d4d4921d swconfig: swlib.c: free device name and alias
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

SVN-Revision: 46229
9 years ago
John Crispin 74a3a77bcd license info - revert r43155
turns out that r43155 adds duplicate info.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43167
10 years ago
John Crispin c10d97484a Add more license tags with SPDX identifiers
Note, that licensing stuff is a nightmare: many packages does not clearly
state their licenses, and often multiple source files are simply copied
together - each with different licensing information in the file headers.

I tried hard to ensure, that the license information extracted into the OpenWRT's
makefiles fit the "spirit" of the packages, e.g. such small packages which
come without a dedicated source archive "inherites" the OpenWRT's own license
in my opinion.

However, I can not garantee that I always picked the correct information
and/or did not miss license information.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 43155
10 years ago
Steven Barth bec9d38fa4 Add a few SPDX tags
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 43151
10 years ago
John Crispin 5a9c834a12 package: swconfig: let variable name be local
Let the first parameter of function config_get be local, because there
is a chance that config_get won't export the variable.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>

SVN-Revision: 41000
10 years ago
John Crispin 4810de8e4b swconfig: improve usability when switch device incorrect
http://patchwork.openwrt.org/patch/4701/

Signed-off-by: Andreas Mohr <andim2@users.sf.net>

SVN-Revision: 39229
11 years ago
John Crispin d1156bca0a swconfig: remove useless variables, return -1 on errors
spotted with cppcheck

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>

SVN-Revision: 39170
11 years ago
Hauke Mehrtens e1523b5504 switch: remove old switch driver
The switch driver is not used by brcm47xx any more and can be removed,
instead of this switch driver b53 is used now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 38387
11 years ago
John Crispin 7d7c2ff5f9 swconfig: fix dependency bug introduced by [37304]
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37316
11 years ago
Hauke Mehrtens f8d55e7541 brcm47xx: use b53 phy driver for the switch in kernel 3.10
This makes it possible to use swconfig to controll the switch.

This was tested with devices using b43 and bgmac.
This was not tested on devices using tg3.
This does not support the adm switch used in some very old devices.

SVN-Revision: 37304
11 years ago
John Crispin 04dcd12c91 add portmap support to userland
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36284
11 years ago
John Crispin f13ae9965c add "swconfig list" support
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36282
11 years ago
Gabor Juhos 86cd825c1f package/swconfig: don't use kernel headers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34679
12 years ago
John Crispin a34499e095 move lots of kernel related packages to the new system/ folder
SVN-Revision: 33830
12 years ago