summaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/files
Commit message (Collapse)AuthorAgeFilesLines
* ip17xx: Keep all state locallyjuhosg2010-06-081-209/+3
| | | | | | | | | | | | | Instead of reading the hardware state every time we want to inspect it or to modify it, maintain it in struct ip175c_state. This simplifies the code significantly. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21722 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Add support for IP175Djuhosg2010-06-081-1/+169
| | | | | | | | | | | | | | | | | | Add support for the IP175D chip. Since the register set is vastly different from the previous models, we cannot not use the register number tables in struct register_mappings (except for VLAN_DEFAULT_TAG_REG), so we supply a different set of low-level functions. Unlike with the previous models, we keep the VLAN setup in our state structure instead of querying the hardware (it would be much harder in case of IP175D, because the mapping between hardware and software state is not 1:1). Therefore, get_flags() and get_state() are no-ops. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21721 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Avoid auto-negotiationjuhosg2010-06-081-3/+5
| | | | | | | | | | | | | | | Let ip175c_config_init() initialize the link state of the PHY and set the PHY state machine directly to the PHY_RUNNING state in order to skip the auto-negotiation phase. Previously, auto-negotiation on PHY 0 (switch port 0) influenced the ethernet driver connected to the CPU port, causing all sorts of weird effects. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21720 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: New chip detectionjuhosg2010-06-081-28/+30
| | | | | | | | | | | | | | Clean up get_model() and make it recognize IP175D using yet another chip ID register. Log the detected model. Also fix a bug in the interface between the PHY layer and our probe function, which caused IP175A devices to be ignored. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21719 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Add VLAN tag fieldjuhosg2010-06-081-1/+44
| | | | | | | | | | | Since IP175D uses tag-based VLANs, we need an ability to set VLAN tag of every VLAN. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21718 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Maintain state->remove_tag incrementallyjuhosg2010-06-081-3/+4
| | | | | | | | | | | | | | So far, state->remove_tag was sometimes updated incrementally, sometimes left to correct_vlan_state() to recalculate. Since I want to avoid use of correct_vlan_state() for IP175D, this patch fixes the only two remaining places which leave state->remove_tag inconsistent with state->add_tag and it drops the recalculation. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21717 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Initialize VLAN state upon resetjuhosg2010-06-081-5/+15
| | | | | | | | | | | | | | | Let VLAN state variables be initialized not only when the enable VLAN bit is toggled, but also upon reset. At this point, this should be a no-op, since the driver reads the current hardware state before doing any modifications anyway, but I plan to keep some state locally in the subsequent patches. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21716 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Introduce vlan arrayjuhosg2010-06-081-12/+14
| | | | | | | | | | Replace vlan_ports array in struct ip175c_state by an array of structures. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21715 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Introduce indirection of low-level operationsjuhosg2010-06-081-49/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces seperation between low-level and high-level parts of the driver. The low-level functions are now called via pointers stored in struct ip175c_regs. The only functional changes are: o correct_vlan_state() is now called as a part of every update_state(). o The order of setting of MODE_REG and resetting switch ports has changed. (These are independent actions, so it should not matter.) o ip175c_set_tagged() sets the tags via update_state() instead of writing directly to the registers. o The same for ip175c_set_pvid(). The only gaps in this abstraction are operations on ports (get_port_speed and friends), which access PHY registers directly. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21714 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Fix use of MODE_VALjuhosg2010-06-081-1/+1
| | | | | | | | | | | | | The value written to MODE_REG in ip175c_reset() should be obviously MODE_VAL, not RESET_VAL. Actually, this change is a NOP, because in the only case where the MODE_REG is used, the two values are identical, but it makes the code more readable. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21713 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Fix indentation in get_state() and update_state()juhosg2010-06-081-76/+76
| | | | | | | | Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21712 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Fixed error handling in ip175c_set_val()juhosg2010-06-081-1/+1
| | | | | | | | | | Upon error, ip175c_set_val() returned 0 instead of -EINVAL. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21711 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Cosmetic cleanupsjuhosg2010-06-081-50/+35
| | | | | | | | | | | Trying to unify capitalization and formatting of comments. Writing of periods at the end of comments is however still inconsistent. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21710 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ip17xx: Consolidate operations with PHY registersjuhosg2010-06-081-47/+40
| | | | | | | | | | | | | | | | Call mdiobus_{read,write} instead of duplicating their code. Introduce ip_phy_write_masked(), which changes a part of a register. Will be used later in this patch series. Please note that it does not hold any lock between reading and writing, so it is up to the caller to serialize. Also add DUMP_MII_IO, which enables logging of all MII accesses. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21709 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: Fix a bug in use of SWITCH_PORT_FLAG_TAGGEDjuhosg2010-06-081-1/+1
| | | | | | | | | | SWITCH_PORT_FLAG_TAGGED is a bit index, not a bit mask. Signed-off-by: Martin Mares <mj@ucw.cz> Signed-off-by: Patrick Horn <patrick.horn@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21708 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [kernel] gpio_buttons: include slab.hlars2010-05-121-0/+1
| | | | | | | | Fixes build with 2.6.34 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21436 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [kernel] fix build error on hifnHIPP spotted by buildbotflorian2010-05-051-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21373 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [generic-2.6] update OCF framework to version 20100325jow2010-05-04164-3645/+65040
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21356 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: fix build with kernel 2.6.34-rc4hauke2010-04-181-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20992 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: Add cpu port index to help output.juhosg2010-04-162-0/+2
| | | | | | | | | | | | | | Let swconfig provide the cpu port index in its help page. This is needed as e.g. Atheros switches have their cpu port at port 0, not port 5. This could allow e.g. luci to get a rough overview of the layout of the switch. Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20939 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [kernel] swconfig: Check vlan/port indexes for validity.florian2010-04-111-0/+4
| | | | | | | | | | | | Swconfig needs to make sure that requested vlans/ports actually exist, else it might read or modify memory not belonging to itself. This patch adds a quick range check in swconfig's kernel part to prevent accidential or intentional memory modification. Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20811 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Generic: Clean up output of AR8216 driver.juhosg2010-04-101-6/+8
| | | | | | | | | | | | | | | | | This patch is rather a cosmetic patch. It fixes the following issues: * Demote the unknown device message to debug level to not spam the log. * Fix the version print of the unknown device message. * Output the 'attach' message only when attaching as switch driver, not when attaching as phy driver. * Correctly return NET_RX_DROP when dropping packets. Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> Cc: bacfire@openwrt.org git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20773 3c298f89-4303-0410-b956-a3cf2f4a3e73
* generic: make chip detection more reliable in the AR8216 driverjuhosg2010-04-091-2/+22
| | | | | | | | | Fixes broken ethernet on the Planex MZK-W04NU/W300NH boards. Cc: bacfire@openwrt.org git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20753 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [PATCH 1/2] Add support for the ar8316 switch.jow2010-04-052-38/+215
| | | | | | | | | | | | | This patch enhances the ar8216 driver with ar8316 support and fixes some minor issues with the ar8216 driver itself. It should not break anything, but isn't tested on ar8216 devices. [PATCH 2/2] ar71xx: Add the ar8316 driver to rs pro/rb-450g. Add the ar8216 driver to the ar71xx target, and add network configurations for the RouterStation Pro and the RouterBoard RB-450G. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20722 3c298f89-4303-0410-b956-a3cf2f4a3e73
* enable IP175A support in the IP175C PHY driver (based on patch from jh in #6733)nbd2010-03-281-20/+46
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20551 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ar8216: fix the mtu register definitionnbd2010-03-091-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20110 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Several small fixes for ar8216 driver (patch by Jonas Gorski)nbd2010-03-092-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Create defines for some magic values/masks. * Change vlan_id to u16, to allow VIDs > 255. * Add a range check to set_pvid as it isn't a VID, but the index in the vlan table. * Set the max VID to 4094, since 4095 is a reserved value and should not be used. * In mangle_rx replace the provided VID with the VID of the table entry of the port, not the index of the table. * In hw_apply, remove a redundant emptyness check (was already checked several lines above). * In no vlan mode do not set the ingress mode to secure, as there are no vlan table entries, but to use the port's destination masks. Otherwise the switch won't forward anything. * In read_status tell that the phy is up (taken from the rtl8306 driver). git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20083 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: add driver for the RTL8366RB switchjuhosg2010-02-242-0/+1773
| | | | | | | Thanks to Andrew Tarabaras. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19837 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: fix typos in the AR8216 header filejuhosg2010-02-241-7/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19834 3c298f89-4303-0410-b956-a3cf2f4a3e73
* rtl8366_smi: sanitize gpio values to a 0/1 booleanjuhosg2010-01-301-5/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19402 3c298f89-4303-0410-b956-a3cf2f4a3e73
* rtl8366s: reset the chip early, this allows ethernet to work as soon as possiblejuhosg2010-01-271-20/+34
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19355 3c298f89-4303-0410-b956-a3cf2f4a3e73
* rtl8366: make it available on all platformsjuhosg2010-01-254-0/+2069
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19329 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: change debounce logic in the gpio-buttons driverjuhosg2010-01-132-21/+25
| | | | | | | * thanks to Nuno Gonçalves git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19115 3c298f89-4303-0410-b956-a3cf2f4a3e73
* deduplicate kernel source files from 2.6.30-2.6.32 by moving them to generic ↵nbd2009-12-258-0/+1334
| | | | | | files/ git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18927 3c298f89-4303-0410-b956-a3cf2f4a3e73
* rtl8306: manage the wan port as a separate phy device with proper link ↵nbd2009-12-091-27/+89
| | | | | | status reading and autonegotiation - the genphy driver does not handle it properly git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18709 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ar71xx: make the rtl8306 switch attach to eth0 instead of eth1 on the ↵nbd2009-12-081-0/+3
| | | | | | wrt160nl, fixes wan port detection (#6309) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18699 3c298f89-4303-0410-b956-a3cf2f4a3e73
* fix link status detection in various switch driversnbd2009-12-084-4/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18698 3c298f89-4303-0410-b956-a3cf2f4a3e73
* move the updated version (for 2.6.30+) of ar8216/mvswitch to the generic ↵nbd2009-09-162-19/+27
| | | | | | files directory and remove patches for older kernel versions (no longer in use) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17594 3c298f89-4303-0410-b956-a3cf2f4a3e73
* add a driver for rtl8306 switchesnbd2009-08-141-0/+993
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17248 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ar8216: rename the vlan attribute to enable_vlan to keep it consistent with ↵nbd2009-07-111-1/+1
| | | | | | other drivers git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16770 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ar8216: fix transmission of large frames by setting the switch mtunbd2009-06-292-0/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16629 3c298f89-4303-0410-b956-a3cf2f4a3e73
* ar8216: add delay for page switching to work around register setting ↵nbd2009-06-142-5/+123
| | | | | | corruption. use packet mangling to fix up the vlan for incoming packets (workaround for hardware bug, which renders normal 802.1q support unusable) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16442 3c298f89-4303-0410-b956-a3cf2f4a3e73
* fix a crash in ip175c attribute enumerationnbd2009-04-301-1/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15506 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Add a driver for Atheros AR8216 switchesnbd2009-04-292-0/+675
| | | | | | Thanks to Vertical Communications, Inc. for providing access to the documentation git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15482 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: add a generic switch reset callnbd2009-04-283-10/+21
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15470 3c298f89-4303-0410-b956-a3cf2f4a3e73
* clean up the ip175c driver some more, add support for setting the pvid and ↵nbd2009-04-201-105/+91
| | | | | | fix querying the phy status git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15308 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: add a generic method for setting the port primary vlan id (used ↵nbd2009-04-202-7/+42
| | | | | | for transparently fixing up pvid for untagged port when setting vlan ports) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15307 3c298f89-4303-0410-b956-a3cf2f4a3e73
* add IC+ IP175C driver (based on Patrick Horn's driver, see #4050)nbd2009-04-201-0/+1342
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15305 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: treat struct switch_attr as constantnbd2009-04-202-13/+13
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15302 3c298f89-4303-0410-b956-a3cf2f4a3e73
* swconfig: remove old debugging stuffnbd2009-04-201-2/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15301 3c298f89-4303-0410-b956-a3cf2f4a3e73