summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
Commit message (Collapse)AuthorAgeFilesLines
* mvsw61xx: enable SerDes on 6176 if requiredJonas Gorski2016-09-262-0/+59
| | | | | | | | If the cpu port is connected through SGMII we need to enable SerDes for it to work. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Felix Fietkau <nbd@nbd.name>
* mvsw61xx: reset phys on probe to enable switch ports on clearfog proJonas Gorski2016-09-262-1/+54
| | | | | | | | The clearfog u-boot does not initialize the switch at all, so we need to power up the phys ourselves. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Felix Fietkau <nbd@nbd.name>
* kernel: owl-loader for delayed Atheros ath9k fixupChristian Lamparter2016-09-191-0/+246
| | | | | | | | | | | | | | | | | | | | | | | | | Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) need to be able to initialize the PCIe wifi device. Normally, this is done during the early stages of booting linux, because the necessary init code is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup. However,this isn't possible for devices which have the init code for the Atheros chip stored on NAND in an UBI volume. Hence, this module can be used to initialze the chip when the user-space is ready to extract the init code. Martin Blumenstingl made a few fixes and added support for lantiq: kernel: owl-loader: add support for OWL emulation PCI devices kernel: owl-loader: don't re-scan the bus when ath9k_pci_fixup failed kernel: owl-loader: use dev_* instead of pr_* logging functions kernel: owl-loader: auto-generate the eeprom filename as fallback kernel: owl-loader: add a debug message when swapping the eeprom data kernel: owl-loader: add missing newlines in log messages kernel: owl-loader: add support for the lantiq platform These patches have been integrated. Thanks! Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
* kernel: b53: force BCM531x5 port 5 link state if enabledRafał Miłecki2016-09-081-0/+13
| | | | | | | | | | | Some devices (e.g. Tenda AC9 based on BCM47189B0) have BCM53125 with port 5 connected to the second Ethernet interface on the SoC. In such case there is no PHY and we need to force link manually. This assumes port 5 can be marked as enabled for such devices. It's not implemented yet unfortunately. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* swconfig: revert the portmapping patches, they seem to cause a segfaultJohn Crispin2016-08-163-0/+92
| | | | | | | | | | | | 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-153-92/+0
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* kernel: adm6996: set carrier statusMathias Kresin2016-08-101-0/+5
| | | | | | | Due to the missing carrier status set, the interface wasn't usable on a BTHOMEHUB2B after ip link down and up as it is done in preinit. Signed-off-by: Mathias Kresin <dev@kresin.me>
* kernel: remove unused morse led trigger driverFelix Fietkau2016-08-041-366/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: silence a false positive uninitialized variable warningFelix Fietkau2016-08-011-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* b53: allow ports with higher numbers than CPU portRafał Miłecki2016-07-241-2/+1
| | | | | | | | | | | | | | Our code was assuming CPU port uses the highest number. My BCM53573 device has eth0 connected to port 8 and eth1 connected to port 5. While working on support for it I tried to: 1) Enable all ports (including port 8) 2) Set CPU port to 5 I noticed port 8 is not accessible anymore. It was just a development process but it seems like something worth fixing anyway. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Jonas Gorski <jonas.gorski@gmail.com>
* ledtrig-usbdev: fix duplicate match detectionFelix Fietkau2016-07-231-4/+5
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ledtrig-usbdev: use upstream function for iterating USB devicesRafał Miłecki2016-07-201-5/+27
| | | | | | This will allow us to drop LEDE patch adding usb_find_device_by_name. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* kernel: rename B53 symbols to avoid upstream kernel conflictRafał Miłecki2016-06-202-18/+18
| | | | | | | | | In kernel 4.7 there is upstreamed b53 driver using (mostly?) the same symbols as our b53 does. Change our symbols so both drivers can coexist in kernel tree. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Jonas Gorski <jonas.gorski@gmail.com>
* kernel: mtdsplit: calculate kernel partition precisely for SeamaRafał Miłecki2016-06-201-2/+2
| | | | | | | | | So far "kernel" partition didn't contain just a kernel. It also included Seama header and meta data. This was making kernel update complex and it wasn't trivial to read kernel size. Fix it by making "kernel" parition contain just a kernel image. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* 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>
* generic: remove brcmfmac-sdio.hBen Whitten2016-06-081-124/+0
| | | | | | This file is present in the kernel so no point overlaying it. Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-0720-22/+22
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: update to wireless-testing 2016-05-12Felix Fietkau2016-05-151-0/+4
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: remove ocf support, cryptodev-linux should be used insteadFelix Fietkau2016-05-12211-94076/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: ath9k: enable GPIO buttonsFelix Fietkau2016-03-051-0/+4
| | | | | | | | | | Enable platform-defined GPIO button support for ath9k device. Key poller is activated for attached platform buttons. Requires ath9k GPIO chip access. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> SVN-Revision: 48921
* AR8216: improve mmd register accessJohn Crispin2016-03-043-13/+17
| | | | | | | | | | | Combine all bus operations for one MMD access in one function. Protecting all these bus operations with one lock also helps to avoid potential issues due to bus operations intercepting the register and data write. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48914
* AR8216: make ARL age time configurableJohn Crispin2016-03-044-4/+80
| | | | | | | | | | | | | | | | | The default TTL for address resolution table entries is 5 minutes for all members of the AR8216 family. This can cause issues if e.g. Wifi clients roam to another AP and their MAC appears on another switch port suddenly. Then the client may not be reachable until the old ARL entry expires. I would have expected the switch to invalidate old entries if it detects the same MAC on another port. But that's not the case. Therefore make the TTL for ARL entries configurable. The effective TTL will always be a multiple of 7 seconds. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48913
* AR8216: remove redundant port number in MIB header lineJohn Crispin2016-03-041-2/+1
| | | | | | | | | The line before includes the port number anyway so there's no need to duplicate the port number in the MIB info header. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48912
* AR8216: complement MIB counters with info in GiB / MiB / KiBJohn Crispin2016-03-041-5/+40
| | | | | | | | | | The decimal values especially for TxByte and RxGoodByte are hard to read once bigger amounts of data have been transferred. Therefore complement the decimal values with info in GiB / MiB / KiB. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48911
* AR8216: don't display MIB counters if all are emptyJohn Crispin2016-03-041-1/+8
| | | | | | | | | | | | For unused switch ports all MIB values are zero. Displaying ~40 empty MIB counters is just confusing and makes it hard to read the output of swconfig dev <dev> show. Therefore, if all MIB counters for a port are zero, just display an info that the MIB counters are empty. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> SVN-Revision: 48910
* mac80211: ath9k: enable platform WLAN LED nameFelix Fietkau2016-03-021-0/+1
| | | | | | | | | Enable platform-supplied WLAN LED name for ath9k device. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> Acked-by: Hartmut Knaack <knaack.h@gmx.de> SVN-Revision: 48879
* switch: allow Ethernet port LEDs to show specific port speeds onlyFelix Fietkau2016-02-251-5/+99
| | | | | | | | | | | | | This patch adds speed_mask special file to LEDs connected to switch ports via 'switch' trigger. It allows to choose which speeds to signal when link is up. If router has more than one LED per port, they may light up differently depending on how fast connection is. Default setting is 'all speeds' so backward compatibility with system scripts (for example uci) is maintained. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> SVN-Revision: 48775
* switch: make LED port_mask file write handler use kstrtoul() functionFelix Fietkau2016-02-251-25/+16
| | | | | | | | | | | This patch changes swconfig_trig_port_mask_store() handler to utilize kstrtoul() function instead of call to obsolete simple_strtoul(). Thanks to this change, new handler takes less memory and makes port_mask special file accept not only hexadecimal, but also decimal and octal numbers. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> SVN-Revision: 48774
* kernel: mtdsplit: support uimage with UBIRafał Miłecki2016-02-241-3/+7
| | | | | | | | This patch adds uimage firmware split support for ubi. Signed-off-by: YounJae Rho <luxflow@live.com> SVN-Revision: 48755
* kernel: mtdsplit: add missing digest field to Seama headerRafał Miłecki2016-02-231-0/+1
| | | | | | | | | | | | | | | | | | | Seama format has 2 similar headers: container (seal) header and entity header. The first one has size always set to 0 and doesn't contain MD5 digest. When dealing with Seama on a flash we deal directly with an entity. You can see mtdsplit_parse_seama reads from offset 0 and expects entity to be there. Seama container is used by bootloader / interface only which extract entity out of it and flash it. That said we should fix our header struct. This is important as we calculate possible rootfs offset assuming it may be placed right after Seama entity. So far calculate offset was always 16B too low. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48754
* b53: support setting port linkRafał Miłecki2016-02-031-0/+31
| | | | | | | | | When dealing with Broadcom hardware we can simply use swconfig's generic helper, we just need to do some validation of requested state. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48623
* b53: provide PHY access to swconfigRafał Miłecki2016-02-033-0/+48
| | | | | | | | | Thanks to this change swconfig can access port PHYs e.g. when setting port link state with a generic helper. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48622
* swconfig: add (PHY) generic helper setting port linkRafał Miłecki2016-02-032-0/+42
| | | | | | | | | | 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
* kernel: mtdsplit: support Seama entity with UBIRafał Miłecki2016-02-012-3/+8
| | | | | | | | | | Some D-Link routers (e.g. DIR-885L) have NAND and use Seama format. It means OpenWrt will want to have UBI in Sseama entity and should be able to detect it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48600
* kernel: mtdsplit: detect UBI partition when looking for rootfsRafał Miłecki2016-02-012-0/+7
| | | | | | | | | This allows mtdsplit parsers work with UBI which is very popular on NAND flases. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48599
* kernel: mtdsplit: modify rootfs helpers to provide partition typeRafał Miłecki2016-02-019-26/+42
| | | | | | | | | | Our mtdsplit parsers may want to create partition with name choice based on partition file system (e.g. SquashFS vs. JFFS2). This patch allows passing extra argument pointing to variable that will be set properly. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48598
* kernel: mtdsplit: document Seama splitter a bitRafał Miłecki2016-01-251-8/+10
| | | | | | | | | | Rename kernel_size variable as it includes whole entity size, not just a kernel size. Also update comments to match it and describe better what are we checking/looking for. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48480
* 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
* ar71xx: add support for Netgear WPN824NJohn Crispin2016-01-191-0/+2
| | | | | | | | | | | | | | | | Add support for Netgear WPN824N. Hardware specs: * AR7240, 4 LAN ports, 1 WAN port * AR9285 WLAN * 32 MB RAM * 4 MB Flash * 16 LEDs (LAN, WAN and Power/Status contain two LEDs for dual color effect) * 3 Buttons (not supported) Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> SVN-Revision: 48356
* b53: update header register difinitionsJonas Gorski2016-01-181-1/+2
| | | | | | | | | BCM531x5 has two pontential cpu ports, and header mode can be enabled independently on both. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 48302
* ar8327: add IGMP Snooping supportFelix Fietkau2016-01-172-0/+232
| | | | | | | | | | | | | | | This add support for IGMP Snooping on atheros switches (disabled by default), which avoids flooding the network with multicast data. Tested on TL-WDR4300: disabling IGMP Snooping results in multicast flooding on each specific port, enabling it back again prevents each port from receiving all multicast packets. Partially based on: http://patchwork.ozlabs.org/patch/418122/ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 48268
* kernel: mtdsplit_squashfs: Align with the erase-block sizeFelix Fietkau2016-01-171-1/+1
| | | | | | | | | | | | | | On most image types the rootfs ends at an erase-block. However, at least with brnImages this is not the case: while the partitions are aligned with the erase-block size there is a 12 byte footer at the end of the partition which must not be touched by any filesystem. This lead to a rootfs_data partition which was not aligned properly (and thus ended up being readonly): 0x000000480000-0x00000085a800 : "rootfs_data" (128 KiB EB) Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48263
* kernel: mtdsplit: add support for EVA imagesFelix Fietkau2016-01-173-0/+102
| | | | | | | | | This allows splitting EVA images (usually found in fritz devices). The firmware will be split into a kernel and a separate rootfs partition. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48262
* kernel: mtdsplit: add support for brnImagesFelix Fietkau2016-01-173-0/+110
| | | | | | | | | | | | | | | | | This adds brnImage (used with the brnboot bootloader) firmware parsing support. brnboot verifies the integrity of the firmware stored on the "Code Image" partitions by looking at the 12 byte footer at the very end of the partition. This footer contains the checksum of the original brnImage (kernel + rootfs/squashfs) and must not be touched (by our JFFS2 rootfs_data - otherwise the image will not be bootable anymore). Big thanks to Mathias Kresin for analyzing the brnImage structure and finding out the information how to keep images valid even when adding a nested rootfs_data partition. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 48261
* swconfig: add API for setting port link speedRafał Miłecki2016-01-062-1/+50
| | | | | | | | | 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
* ledtrig-netdev: don't stop timer on events for different interfacesRafał Miłecki2016-01-021-1/+2
| | | | | | | | | | This fixes regression introduced in my recent ledtrig-netdev commit. Events triggered by different interfaces were stopping timer so it wasn't working for tx/rx mode. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 48072
* ledtrig-netdev: add support for renamed devicesJohn Crispin2016-01-011-2/+3
| | | | | | | | | | | The ppp0 interface is renamed after the connection is established. Due to a missing NETDEV_REGISTER event, the ledtrig-netdev isn't aware of the renamed interface and literally ignores the device (no tx/rx indication, led isn't switched off with 'ifdown wan'). Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 48048
* 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