aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire/if_fwe.c
Commit message (Collapse)AuthorAgeFilesLines
* firewire: replace magic numbers with named constantsAbdelkader Boudih2026-07-201-3/+3
| | | | | | | No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58311
* firewire: remove dead code across the subsystemAbdelkader Boudih2026-07-201-32/+0
| | | | | Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58310
* firewire: remove SPL callsAbdelkader Boudih2026-07-171-21/+2
| | | | | | | | SPL is a no-op on amd64. Real locking is already handled by fc_mtx and per-driver mutexes. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D58210
* firewire: per-unit-directory child device supportAbdelkader Boudih2026-07-171-3/+5
| | | | | | | | Added structure to allow multiple device to attach to the same driver. Also removed the deprecation warning from the man page. Differential Revision: https://reviews.freebsd.org/D58201 Reviewed by: adrian
* firewire: extract shared helpers from fwe and fwipAbdelkader Boudih2026-06-191-45/+9
| | | | | | | | | Add fw_net.h with common inline helpers used by both if_fwe and if_fwip: ISO chunk init, TX xfer allocation, xferlist free, send queue drain, and DEVICE_POLLING ioctl handling. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57615
* fix(fwe): add missing net epoch around ether_inputAbdelkader Boudih2026-06-061-0/+3
| | | | | | | | | Wrap the if_input() call in fwe_as_input() with NET_EPOCH_ENTER/EXIT. The network stack requires epoch protection when delivering packets via if_input, and fwe was missing it. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57459
* chore: replace {0, 0} with {DEV,KOBJ}METHOD_ENDEnji Cooper2026-02-251-1/+1
| | | | | | | | | | | | | | Both of the aforementioned macros have been present in FreeBSD for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for `DEVMETHOD_END`. Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END` and `KOBJMETHOD_END` as appropriate. This helps ensure that future adaptations to drivers following patterns documented in driver(9) can be made more easily/without issue. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55414
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-5/+1
| | | | | | | | | | | 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-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Mechanically convert fwe(4) and fwip(4) to IfAPIJustin Hibbits2023-02-061-47/+47
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37850
* firewire: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-091-3/+1
|
* firewire(4): Fix "set but not used" warningsEdward Tomasz Napierala2021-12-201-0/+4
| | | | Sponsored By: EPSRC
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+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
* 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
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Remove NULL checks after M_WAITOK allocations from firewire.Edward Tomasz Napierala2016-05-101-4/+0
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299351
* Remove obsolete compatibility glue and improve firewire code readability.Alexander Kabaev2014-09-271-12/+11
| | | | | | | | | | | Commit my version of style(9) pass over the firewire code. Now that other people have started changing the code carrying this is as a local patch is not longer a viable option. MFC after: 1 month Notes: svn path=/head/; revision=272214
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-6/+6
| | | | Notes: svn path=/head/; revision=271849
* Start the process of cleaning up FreeBSD's firewire driver.Will Andrews2014-09-181-91/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | sys/dev/firewire/firewire.c: sys/dev/firewire/firewire.h: sys/dev/firewire/firewirereg.h: sys/dev/firewire/fwcrom.c: sys/dev/firewire/fwdev.c: sys/dev/firewire/fwdma.c: sys/dev/firewire/fwmem.c: sys/dev/firewire/fwohci.c: sys/dev/firewire/fwohci_pci.c: sys/dev/firewire/fwohcivar.h: sys/dev/firewire/if_fwe.c: sys/dev/firewire/if_fwip.c: sys/dev/firewire/sbp.c: sys/dev/firewire/sbp_targ.c: Unifdef the code, removing support for DragonflyBSD and FreeBSD prior to version 5. Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 1081188 on 2014/08/01 Notes: svn path=/head/; revision=271795
* Use define from if_var.h to access a field inside struct if_data,Gleb Smirnoff2014-08-301-1/+1
| | | | | | | | | that resides in struct ifnet. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270856
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-8/+4
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-4/+8
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Teach every SIOCGIFSTATUS provider to fill in ifs->ascii anyway.Alexander V. Chernikov2014-01-071-7/+3
| | | | | | | | | | | | Remove old bits of data concat for 'ascii' field. Remove special SIOCGIFSTATUS handling from if.c (which Coverity yells at). Reported by: Coverity Coverity CID: 1147174 MFC after: 2 weeks Notes: svn path=/head/; revision=260394
* 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
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo2012-01-071-1/+0
| | | | | | | Reviewed by: yongari Notes: svn path=/head/; revision=229767
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* When user_frac in the polling subsystem is low it is going to busy theAttilio Rao2009-05-301-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not self-initialize a variable.Max Khon2009-02-091-1/+1
| | | | | | | | Found with: Coverity Prevent(tm) CID: 3864, 3865 Notes: svn path=/head/; revision=188394
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.Ruslan Ermilov2008-03-251-12/+4
| | | | | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation. Notes: svn path=/head/; revision=177599
* MFp4: MPSAFE firewire stack.Hidetoshi Shimokawa2007-06-061-24/+30
| | | | | | | | | | | | | | | | - lock its own locks and drop Giant. - create its own taskqueue thread. - split interrupt routine - use interrupt filter as a fast interrupt. - run watchdog timer in taskqueue so that it should be serialized with the bottom half. - add extra sanity check for transaction labels. disable ad-hoc workaround for unknown tlabels. - add sleep/wakeup synchronization primitives - don't reset OHCI in fwohci_stop() Notes: svn path=/head/; revision=170374
* Replace xfer->act.hand with xfer->hand.Hidetoshi Shimokawa2007-03-161-1/+1
| | | | Notes: svn path=/head/; revision=167632
* * Remove xfer->retry_req.Hidetoshi Shimokawa2007-03-161-1/+0
| | | | | | | | It is unnecessary because retry is done by OHCI. Further retry should be done by applications. Notes: svn path=/head/; revision=167630
* Fix typo.Gleb Smirnoff2005-10-111-2/+1
| | | | | | | | Submitted by: maxim MFC after: 3 days Notes: svn path=/head/; revision=151229
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceGleb Smirnoff2005-10-051-0/+3
| | | | | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde Notes: svn path=/head/; revision=150968
* Big polling(4) cleanup.Gleb Smirnoff2005-10-011-29/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb Notes: svn path=/head/; revision=150789
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-0/+25
| | | | | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days Notes: svn path=/head/; revision=148887
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-101-9/+24
| | | | | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam Notes: svn path=/head/; revision=147256
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Assert Giant in fwe_start(), as it is not yet MPSAFE.Robert Watson2004-08-181-0/+2
| | | | Notes: svn path=/head/; revision=133930
* Set IFF_NEEDSGIANT for fwe network interface since the firewireRobert Watson2004-08-121-1/+2
| | | | | | | | | framework isn't yet MPSAFE. Approved by: simokawa Notes: svn path=/head/; revision=133538
* Initialize ifp->if_output for FreeBSD-4.Hidetoshi Shimokawa2004-07-201-0/+3
| | | | Notes: svn path=/head/; revision=132430
* Adjust packet length correctly for FreeBSD-4.Hidetoshi Shimokawa2004-07-201-2/+4
| | | | | | | Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de> Notes: svn path=/head/; revision=132429
* We don't need to initialize if_output, ether_ifattach() does itMaxime Henrion2004-05-231-1/+0
| | | | | | | for us. Notes: svn path=/head/; revision=129616
* Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's toDoug Rabson2004-05-221-1/+1
| | | | | | | uint32_t where appropriate. Notes: svn path=/head/; revision=129585
* Mark the capability of this driver to receive VLAN frames >1500 bytesYaroslav Tykhiy2004-05-211-0/+1
| | | | | | | | | as initially active in if_capenable since it is always on. Reviewed by: simokawa Notes: svn path=/head/; revision=129552
* MFp4: FireWireHidetoshi Shimokawa2004-03-261-21/+31
| | | | | | | | | | | | | | | | | | | | | | * all - s/__FUNCTION__/__func__/. Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> - Compatibility for RELENG_4 and DragonFly. * firewire - Timestamp just before queuing. - Retry bus probe if it fails. - Use device_printf() for debug message. - Invalidiate CROM while update. - Don't process minimum/invalid CROM. * sbp - Add ORB_SHORTAGE flag. - Add sbp.tags tunable. - Revive doorbell support. It's not enabled by default. Notes: svn path=/head/; revision=127468
* * firewireHidetoshi Shimokawa2004-01-081-0/+3
| | | | | | | | | | | | | Add tcode_str[] and improve debug message. * sbp If max_speed is negative, use the maximum speed which the ohci chip supports. The default max_speed is -1. * if_fwe If tx_speed is negative, use the maximum speed which the ohci chip supports. The default tx_speed is 2. Notes: svn path=/head/; revision=124251