aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/etherswitch/rtl8366
Commit message (Collapse)AuthorAgeFilesLines
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-211-1/+1
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* etherswitch: Cleanup detach and delete of child devices during detachJohn Baldwin2025-01-021-4/+5
| | | | | | | Call bus_generic_detach first and return any error. Remove no longer needed individual device_delete_child calls. Differential Revision: https://reviews.freebsd.org/D47970
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-3/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* Replace calls to bus_generic_probe with bus_identify_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47674
* newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-6/+0
| | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* etherswitch: Clean up whitespace after IfAPI conversionJustin Hibbits2023-01-311-2/+2
| | | | | Sponsored by: Juniper Networks, Inc. Fixes: 2e6a8c1ae
* Mechanically convert etherswitch drivers to IfAPIJustin Hibbits2023-01-241-12/+12
| | | | | | Reviewed by: kd Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37813
* etherswitch drivers: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-091-2/+1
|
* Remove unused etherswitch_devclass.John Baldwin2022-05-091-1/+1
|
* Remove unused mdio_devclass.John Baldwin2022-05-061-1/+1
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-061-1/+1
|
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* [etherswitch] fix LINT build for rtl8366rbMichael Zhilin2018-01-251-1/+1
| | | | | | | | | | | Build with rtl8366rb has been broken due to incorrect retrieval of pointer to device_t. Reported by: lwhsu Differential Revision: https://reviews.freebsd.org/D14044 Notes: svn path=/head/; revision=328389
* [etherswitch] check if_alloc returns NULLMichael Zhilin2018-01-241-0/+6
| | | | | | | | | | | This patch is cosmetic. It checks if allocation of ifnet structure failed. It's better to have this check rather than assume positive scenario. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Notes: svn path=/head/; revision=328377
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* [etherswitch] [rtl8366] add phy4cpu setting and support mdioproxyMichael Zhilin2017-05-282-33/+80
| | | | | | | | | | Tested on WZR-HP-G301NH(RTL8366RB) and WZR-HP-G300NH(RTL8366SR). Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D10740 Notes: svn path=/head/; revision=319070
* [etherswitch] add RTL8366SR supportMichael Zhilin2016-11-152-220/+333
| | | | | | | | | | | | | Add RTL8366SR support at etherswitch driver. Tested on RTL8366RB and RTL8366SR. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: adrian, mizhka Approved by: adrian(mentor) Differential Revision: https://reviews.freebsd.org/D6796 Notes: svn path=/head/; revision=308700
* Revert r268543.Rui Paulo2014-07-121-1/+1
| | | | | | | We should probably fix sys/gpio.h instead. Notes: svn path=/head/; revision=268564
* Move iic.h to sys/ so that it's automatically installed in /usr/include/sys.Rui Paulo2014-07-121-1/+1
| | | | | | | | | | This lets us call iic(4) ioctls without needing the kernel source code and follows the same model of GPIO. MFC after: 3 weeks Notes: svn path=/head/; revision=268543
* Allow the PVID setting on CPU port.Luiz Otavio O Souza2014-07-051-2/+8
| | | | | | | | | Return our static list of supported media for the CPU port. Tested on TP-Link 1043ND. Notes: svn path=/head/; revision=268294
* Initialize the switch vlan table at attachment.Luiz Otavio O Souza2014-07-031-7/+33
| | | | | | | | | | | | | | | | | | Update some comments on code, specifying the correct vlans used on switch setup. Advertise the proper switch operation mode (the rtl8366rb only support dot1q vlans). This fixes the breakage that i introduced on r249752 and make the rtl8366rb switch works again with etherswitchcfg(8). Tested on TP-Link 1043ND. Tested by: me, Harm Weites (harm at weites.com) Notes: svn path=/head/; revision=268233
* Fix the reported status for the switch CPU port which was (wrongly)Luiz Otavio O Souza2014-07-012-2/+2
| | | | | | | | | reporting half-duplex link. Tested on TP-Link WR1043ND. Notes: svn path=/head/; revision=268094
* Add the CPU port flag to the CPU port on rtl8366 (port 5).Luiz Otavio O Souza2014-07-012-4/+8
| | | | | | | | | Do not allow any media change on the switch CPU port. Tested on TP-Link WR1043ND. Notes: svn path=/head/; revision=268093
* Fix the build of TP-WN1043ND kernel. Provide necessary includes and removeLuiz Otavio O Souza2013-10-291-2/+4
| | | | | | | | | unnecessary includes for rtl8366rb. Approved by: adrian (mentor) Notes: svn path=/head/; revision=257346
* Add a new flag (ETHERSWITCH_VID_VALID) to say what vlangroups are in use.Luiz Otavio O Souza2013-07-231-1/+1
| | | | | | | | | | | | | | | | | This fix the case when etherswitch is printing the information of port 0 vlan group (in port based vlan mode) with no member ports. Add the ETHERSWITCH_VID_VALID support to ip17x driver. Add the ETHERSWITCH_VID_VALID support to rt8366 driver. arswitch doesn't need to be updated as it doesn't support vlans management yet. Approved by: adrian (mentor) Notes: svn path=/head/; revision=253569
* Convert over the etherswitch framework to use VLAN IDs per port, ratherAdrian Chadd2013-04-221-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | than VLAN groups. Some chips (eg this rtl8366rb) has a VLAN group per port - you first define a set of VLANs in a vlan group, then you assign a VLAN group to a port. Other chips (eg the AR8xxx switch chips) have a VLAN ID array per port - there's no group per se, just a list of vlans that can be configured. So for now, the switch API will use the latter and rely on drivers doing the heavy lifting if one wishes to use the VLAN group method. Maybe later on both can be supported. PR: kern/177878 PR: kern/177873 Submitted by: Luiz Otavio O Souza <loos.br@gmail.com> Reviewed by: ray Notes: svn path=/head/; revision=249752
* Commit the first pass of the etherswitch support.Adrian Chadd2012-05-112-0/+931
This is designed to support the very basic ethernet switch chip behaviour, specifically: * accessing switch register space; * accessing per-PHY registers (for switches that actually expose PHYs); * basic vlan group support, which applies for the rtl8366 driver but not for the atheros switches. This also includes initial support for: * rtl8366rb support - which is a 10/100/1000 switch which supports vlan groups; * Initial Atheros AR8316 switch support - which is a 10/100/1000 switch which supports an alternate vlan configuration (so the vlan group methods are stubbed.) The general idea here is that the switch driver may speak to a variety of backend busses (mdio, i2c, spi, whatever) and expose: * If applicable, one or more MDIO busses which ethernet interfaces can then attach PHYs to via miiproxy/mdioproxy; * exposes miibusses, one for each port at the moment, so .. * .. a PHY can be exposed on each miibus, for each switch port, with all of the existing MII/ifnet framework. However: * The ifnet is manually created for now, and it isn't linked into the interface list, nor can you (currently) send/receive frames on this ifnet. At some point in the future there may be _some_ support for this, for switches with a multi-port, isolated mode. * I'm still in the process of sorting out correct(er) locking. TODO: * ray's switch code in zrouter (zrouter.org) includes a much more developed newbus API that covers the various switch methods, as well as a capability API so drivers, the switch layer and the userland utility can properly control the subset of supported features. The plan is to sort that out later, once the rest of ray's switch drivers are brought over and extended to export MII busses and PHYs. Submitted by: Stefan Bethke <stb@lassitu.de> Reviewed by: ray Notes: svn path=/head/; revision=235288