aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/smc
Commit message (Collapse)AuthorAgeFilesLines
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-4/+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: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-2/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* 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-123-3/+3
| | | | | | | | | 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
* Mechanically convert smc(4) to IfAPIJustin Hibbits2023-02-062-62/+62
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37824
* smc: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-093-8/+2
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-061-1/+1
|
* smc: Rename constants for control register from CTR* to CTRL*.John Baldwin2022-04-132-12/+12
| | | | | This avoids a conflict with the recently-added CTR macro in <sys/ktr.h>.
* smc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-10/+9
| | | | Notes: svn path=/head/; revision=365152
* Add an ACPI attachment for if_smcAndrew Turner2020-07-284-43/+107
| | | | | | | | | | This is needed by some of the Arm simulators as they implement a smc based network interface, but use ACPI rather than FDT. Sponsored by: Innovate UK Notes: svn path=/head/; revision=363636
* Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that processGleb Smirnoff2020-02-111-1/+1
| | | | | | | | | | incoming packets in taskqueue context. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D23518 Notes: svn path=/head/; revision=357772
* Use callout_func_t instead of the deprecated timeout_t.John Baldwin2019-12-101-1/+1
| | | | | | | | Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D22752 Notes: svn path=/head/; revision=355601
* Do pass removing some write-only variables from the kernel.Alexander Kabaev2017-12-251-10/+1
| | | | | | | | | | | | This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports. Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385 Notes: svn path=/head/; revision=327173
* Garbage collect IFCAP_POLLING_NOCOUNT. It wasn't used since veryGleb Smirnoff2017-12-061-2/+0
| | | | | | | | beginning of polling(4). The module always ignored return value from driver polling handler. Notes: svn path=/head/; revision=326642
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-0/+6
| | | | | | | | | | | | | | | 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
* Make this compile with DEVICE_POLLING set.Nick Hibma2017-09-281-2/+3
| | | | | | | | | | | smc_poll had the wrong prototype. It returns 0 as it does not check anything but submits a taskqueue. Reviewed by: benno MFC after: 2 weeks Notes: svn path=/head/; revision=324088
* Remove taskqueue_enqueue_fast().John Baldwin2016-03-011-8/+8
| | | | | | | | | | | | | taskqueue_enqueue() was changed to support both fast and non-fast taskqueues 10 years ago in r154167. It has been a compat shim ever since. It's time for the compat shim to go. Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: sephe Differential Revision: https://reviews.freebsd.org/D5131 Notes: svn path=/head/; revision=296272
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-4/+4
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* o Correct the calculation how many pages we needRuslan Bukin2015-02-131-3/+22
| | | | | | | | | | | | | | o Ensure we use correct bank for MSK register o Save and restore current bank in interrupt handler o Stop TX watchdog on fatal errors o Use right register for EPH status This fixes operation on ARMv8 Foundation Model Reviewed by: benno@ Notes: svn path=/head/; revision=278671
* In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson2015-01-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276750
* Fx a type from r271817; it's IFCOUNTER_* not IFNET_*.Bjoern A. Zeeb2014-09-181-1/+1
| | | | Notes: svn path=/head/; revision=271841
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-181-10/+9
| | | | Notes: svn path=/head/; revision=271817
* Move if_smc_fdt.c to live in sys/dev/smc. It's not specific to the ARMAndrew Turner2014-09-101-0/+135
| | | | | | | Versatile hardware. Notes: svn path=/head/; revision=271377
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Disable interrupts in filter in order to avoid interrupt storm andOleksandr Tymoshenko2012-12-131-7/+4
| | | | | | | CPU starvation Notes: svn path=/head/; revision=244169
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-2/+2
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* - Do not reinitialize the card if it is already running.Stanislav Sedov2012-04-071-2/+3
| | | | | | | | | | This fixes bootp on if_smc, as bootp code perform SIOCSIFADDR ioctl call immediately after sending the request (which causes if_init being called) which causes the adapter to drop all the packets received in the meantime. Notes: svn path=/head/; revision=233991
* - Import the common MII bitbang'ing code from NetBSD and convert drivers toMarius Strobl2011-11-011-88/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | take advantage of it instead of duplicating it. This reduces the size of the i386 GENERIC kernel by about 4k. The only potential in-tree user left unconverted is xe(4), which generally should be changed to use miibus(4) instead of implementing PHY handling on its own, as otherwise it makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just for the MII bitbang'ing code. The common MII bitbang'ing code also is useful in the embedded space for using GPIO pins to implement MII access. - Based on lessons learnt with dc(4) (see r185750), add bus barriers to the MII bitbang read and write functions of the other drivers converted in order to ensure the intended ordering. Given that register access via an index register as well as register bank/window switching is subject to the same problem, also add bus barriers to the respective functions of smc(4), tl(4) and xl(4). - Sprinkle some const. Thanks to the following testers: Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4)) Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4). Reviewed by: yongari (subset of drivers) Obtained from: NetBSD (partially) Notes: svn path=/head/; revision=226995
* - Fix NULL pointer dereference when a packet of uneven size is beingStanislav Sedov2011-09-021-1/+4
| | | | | | | | | | transmitted. Approved by: re (kib) MFC after: 3 days Notes: svn path=/head/; revision=225354
* Converted the remainder of the NIC drivers to use the mii_attach()Marius Strobl2010-10-151-2/+3
| | | | | | | | | | introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari Notes: svn path=/head/; revision=213894
* Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev2010-05-031-1/+1
| | | | | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month Notes: svn path=/head/; revision=207554
* strict kobj signatures: fix assortment of miibus_writereg implsAndriy Gapon2009-06-112-2/+3
| | | | | | | | | | return type should be int, not void Reviewed by: imp, current@ Approved by: jhb (mentor) Notes: svn path=/head/; revision=194024
* When user_frac in the polling subsystem is low it is going to busy theAttilio Rao2009-05-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=193096
* - Move ether_ifdetach earlier.Benno Rice2008-06-171-2/+7
| | | | | | | | | - Drain callouts after ether_ifdetach. Suggested by: jhb Notes: svn path=/head/; revision=179837
* Use callout_init_mtx to simplify locking somewhat. While we're here, rearrangeBenno Rice2008-06-132-35/+18
| | | | | | | | | some operations in smc_detach to remove the need for the smc_shutdown variable. Suggested by: jhb Notes: svn path=/head/; revision=179770
* Make sure we drain our taskqueues and stop our callouts in detach.Benno Rice2008-06-122-7/+37
| | | | Notes: svn path=/head/; revision=179744
* Switch to using a normal mutex instead of a spin mutex.Benno Rice2008-06-112-22/+30
| | | | | | | | | | | | | | We still use the interrupt filter due to performance problems that show up if we don't. The main problem seen is that, due to the interrupt being edge triggered, we occasionally miss interrupts which leads us to not notice that we can transmit more packets. Using the new approach, which just schedules a task on a taskqueue, we are guaranteed to have the task run even if the interrupt arrived while we were already executing. If we were to use an ithread the system would mask the interrupt while the handler is run and we'd miss interrupts. Notes: svn path=/head/; revision=179719
* Convert bus_space_{read,write}_* calls to bus_{read,write}_* calls.Benno Rice2008-06-112-30/+18
| | | | | | | Suggested by: jhb Notes: svn path=/head/; revision=179718
* This is a rewritten driver for the SMSC LAN91C111. It's based in part on theBenno Rice2008-06-063-0/+1660
sn(4) driver and also looking at newer drivers. The reason for the rewrite is to support MII and to try and resolve some performance issues found when trying to use the sn(4) driver on the Gumstix network boards. For reference, the SMSC LAN91C111 is a non-PCI ethernet part whose lineage dates back to Ye Olde Days of ISA. It seems to get some use in the embedded space these days on parts lacking on-board MACs or on-board PCI controllers, such as the XScale PXA line of ARM CPUs. This also includes a driver for the SMSC LAN83C183 10/100 PHY. Man page to follow. Notes: svn path=/head/; revision=179592