aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire
Commit message (Collapse)AuthorAgeFilesLines
* cam: prefer cam_sim_softc() over accessing cam_sim structure directly.Warner Losh2021-06-031-2/+2
| | | | | | | | | Use the accessor function to get the softc for this sim. This also drops an unneeded cast. Sponsored by: Netflix Reviewed by: mav@, hselasky@ Differential Revision: https://reviews.freebsd.org/D30360
* fwip(4): fixing kernel panic when receiving unicast packetTai-hwa Liang2021-04-151-1/+5
| | | | | | | | Wrapping fwip_unicast_input() with NET_EPOCH_{ENTER,EXIT} to avoid a NET_EPOCH_ASSERT() in netisr_dispatch(). Reviewed by: hselasky MFC after: 2 weeks
* fwohci: Cast bitfield to uint32_t before passing it to roundup2().John Baldwin2021-02-171-1/+1
| | | | | | | | | | The fallback for __align_up() used by roundup2() uses __typeof__() which doesn't work for bitfields. This fixes the build on GCC which uses the fallback. Reviewed by: arichardson, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D28599
* fwohci(4): remove support for Sun PCIO-2 FireWire controllersMarius Strobl2020-12-252-14/+0
| | | | | It's no longer used since 58aa35d42975c298ca0adba705c042596303c9f5 and r357455 respectively.
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.Edward Tomasz Napierala2020-11-231-3/+3
| | | | | | | | | | | Reviewed by: imp, mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26843 Notes: svn path=/head/; revision=367953
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-265-8/+10
| | | | | | | | | | | | | | | | | | | 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
* Remove sparc64 kernel supportWarner Losh2020-02-031-4/+0
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* Widen NET_EPOCH coverage.Gleb Smirnoff2019-10-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When epoch(9) was introduced to network stack, it was basically dropped in place of existing locking, which was mutexes and rwlocks. For the sake of performance mutex covered areas were as small as possible, so became epoch covered areas. However, epoch doesn't introduce any contention, it just delays memory reclaim. So, there is no point to minimise epoch covered areas in sense of performance. Meanwhile entering/exiting epoch also has non-zero CPU usage, so doing this less often is a win. Not the least is also code maintainability. In the new paradigm we can assume that at any stage of processing a packet, we are inside network epoch. This makes coding both input and output path way easier. On output path we already enter epoch quite early - in the ip_output(), in the ip6_output(). This patch does the same for the input path. All ISR processing, network related callouts, other ways of packet injection to the network stack shall be performed in net_epoch. Any leaf function that walks network configuration now asserts epoch. Tricky part is configuration code paths - ioctls, sysctls. They also call into leaf functions, so some need to be changed. This patch would introduce more epoch recursions (see EPOCH_TRACE) than we had before. They will be cleaned up separately, as several of them aren't trivial. Note, that unlike a lock recursion the epoch recursion is safe and just wastes a bit of resources. Reviewed by: gallatin, hselasky, cy, adrian, kristof Differential Revision: https://reviews.freebsd.org/D19111 Notes: svn path=/head/; revision=353292
* style(9): remove extraneous empty linesGleb Smirnoff2019-09-251-1/+0
| | | | Notes: svn path=/head/; revision=352725
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-202-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* Use https over http for FreeBSD pagesEitan Adler2018-07-271-1/+1
| | | | Notes: svn path=/head/; revision=336757
* The Uninorth ID was really for Uninorth 2.Warner Losh2018-04-012-3/+3
| | | | | | | | Submitted by: Sevan Janiyan Differential Revision: https://reviews.freebsd.org/D14919 Notes: svn path=/head/; revision=331858
* fwohcireg.h is 99% the same between the boot loader and theWarner Losh2018-03-311-0/+2
| | | | | | | | kernel. Delete it and fix up the 1% difference because there's no need for them to be different. Notes: svn path=/head/; revision=331852
* Garbage collect IFCAP_POLLING_NOCOUNT. It wasn't used since veryGleb Smirnoff2017-12-062-5/+1
| | | | | | | | 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-2713-0/+26
| | | | | | | | | | | | | | | 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
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-1811-0/+22
| | | | | | | | | | | | | | | | | | | | 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
* firewire/sbp: try to improve locking, plus a few style nitsAndriy Gapon2017-03-071-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change tries to fix the most obvious locking problems. sbp_cam_scan_lun() is never called with the sbp lock held, so the lock needs to be acquired internally (if it's needed at all). Without this change a kernel with INVARIANTS panics when a firewire disk is connected: panic: mutex sbp not owned at /usr/src/sys/dev/firewire/sbp.c:967 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff80420bbb = db_trace_self_wrapper+0x2b/frame 0xfffffe0504df0930 kdb_backtrace() at 0xffffffff80670359 = kdb_backtrace+0x39/frame 0xfffffe0504df09e0 vpanic() at 0xffffffff8063986c = vpanic+0x14c/frame 0xfffffe0504df0a20 panic() at 0xffffffff806395b3 = panic+0x43/frame 0xfffffe0504df0a80 __mtx_assert() at 0xffffffff8061c40d = __mtx_assert+0xed/frame 0xfffffe0504df0ac0 sbp_cam_scan_lun() at 0xffffffff80474667 = sbp_cam_scan_lun+0x37/frame 0xfffffe0504df0af0 xpt_done_process() at 0xffffffff802aacfa = xpt_done_process+0x2da/frame 0xfffffe0504df0b30 xpt_done_td() at 0xffffffff802ac2e5 = xpt_done_td+0xd5/frame 0xfffffe0504df0b80 fork_exit() at 0xffffffff805ff72f = fork_exit+0xdf/frame 0xfffffe0504df0bf0 fork_trampoline() at 0xffffffff8082483e = fork_trampoline+0xe/frame 0xfffffe0504df0bf0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Also, I tried to reduce the scope of the sbp lock to avoid holding it while doing bus_dma allocations. The code badly needs some re-engineering. SBP really should implement a CAM transport, so that it avoids control flow inversion when re-scanning the bus. Also, the sbp lock seems to be too coarse. Additionally, the commit includes some changes not related to locking. - sbp_cam_scan_lun: restore CAM_DEV_QFREEZE before re-queueing the ccb because xpt_setup_ccb resets ccb_h.flags - sbp_post_busreset: call xpt_release_simq only if it's actually frozen - don't place private SIMQ_FREEZED flag (sic, "freezed") into sim->flags, use sbp->flags for that - some style fixes and control flow enhancements Reviewed by: sbruno MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9898 Notes: svn path=/head/; revision=314864
* Remove some locking not needed for modern CAM.Alexander Motin2017-02-281-13/+1
| | | | | | | | | | This driver is full of LORs. This change allows to reduce deadlock chance from 100% to level that allows some tests to be done. MFC after: 2 weeks Notes: svn path=/head/; revision=314375
* Add safety check against too long CDB.Alexander Motin2017-02-281-0/+5
| | | | | | | | | | | SBP-2 specification defined maximum CDB length as 12 bytes. Newer SBP-3 specification allows CDB of any size, but this driver is too old. Proper solution would be to look on maximal ORB size supported by the target. MFC after: 1 week Notes: svn path=/head/; revision=314374
* Announce that sbp_targ(4) does not support initiator mode.Alexander Motin2017-02-271-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=314358
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-1/+1
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ inRavi Pokala2017-01-051-4/+4
| | | | | | | | | several more drivers. Sponsored by: Panasas Notes: svn path=/head/; revision=311351
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-042-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* firewire: initialize tag label to -1 in fw_xfer_alloc()Andriy Gapon2016-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zero can be confused for a potentially valid value. For example, if I load and unload sbp driver I get a lot of messages like the following: fw_tl_free: the xfer is not in the queue (tlabel=0, flag=0x0) send: dst=0x00 tl=0x00 rt=0 tcode=0x0 pri=0x0 src=0x000 recv: dst=0x01 tl=0x21 rt=1 tcode=0x1 pri=0x0 src=0xffc0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe04464407e0 fw_tl_free() at fw_tl_free+0x18d/frame 0xfffffe0446440820 fw_xfer_unload() at fw_xfer_unload+0xca/frame 0xfffffe0446440840 fw_xferlist_remove() at fw_xferlist_remove+0x2f/frame 0xfffffe0446440870 sbp_detach() at sbp_detach+0x1e0/frame 0xfffffe04464408e0 device_detach() at device_detach+0x80/frame 0xfffffe0446440900 devclass_driver_deleted() at devclass_driver_deleted+0x6a/frame 0xfffffe0446440940 devclass_delete_driver() at devclass_delete_driver+0x7d/frame 0xfffffe0446440980 driver_module_handler() at driver_module_handler+0xff/frame 0xfffffe04464409d0 module_unload() at module_unload+0x32/frame 0xfffffe04464409f0 linker_file_unload() at linker_file_unload+0x24b/frame 0xfffffe0446440a40 kern_kldunload() at kern_kldunload+0xbc/frame 0xfffffe0446440a70 amd64_syscall() at amd64_syscall+0x314/frame 0xfffffe0446440bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0446440bf0 MFC after: 2 weeks Notes: svn path=/head/; revision=309093
* fwohci: report whether PhysicalUpperBound register is implementedAndriy Gapon2016-11-241-0/+10
| | | | | | | | | | | | | | | | | Please see section 5.15 of 1394 OHCI Specification. If the register is not implemented, then the physical response unit is limited to the first 4GB of the physical memory. In that case the non-cooperative debugging over firewire (using /dev/fwmem) can not be expected to work if a target has more RAM than that. The method is described in gdb.4 and the Developer's Handbook. It seems that most of the consumer hardware does not implement PhysicalUpperBound register. MFC after: 1 week Notes: svn path=/head/; revision=309092
* Remove NULL checks after M_WAITOK allocations from firewire.Edward Tomasz Napierala2016-05-105-22/+0
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299351
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-035-9/+9
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Make it explicit that D_MEM cdevsw d_flag is to signify that theKonstantin Belousov2016-05-011-1/+0
| | | | | | | | | | | | | | | | driver is (or behaves identically to) /dev/mem. Remove the D_MEM flag from random drivers. Note that currently the D_MEM flag does not affect any behaviour, but this going to change in the next commit. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week X-Differential revision: https://reviews.freebsd.org/D6149 Notes: svn path=/head/; revision=298890
* Don't assume bio_cmd is a bit field.Warner Losh2016-03-101-1/+1
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5594 Notes: svn path=/head/; revision=296591
* firewire: fix a mismatch introduced in r230558.Pedro F. Giffuni2016-02-191-1/+1
| | | | | | | | | Found by: PVS Static Analysis Reviewed by: sbruno MFC after: 1 month Notes: svn path=/head/; revision=295810
* Fix remote DMA based firewire debugging when targetingWill Andrews2015-01-211-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | systems with more than 4GB of physical memory. To remotely debug the system 'stealthy' which has a kernel with this change installed and firewire properly configured: % fwcontrol -m stealthy (or stealthy's firewire EUI64) % kgdb kernel /dev/fwmem0.0 sys/dev/firewire/fwohci.c: Rather than hard code the upper limit for hw based automatic responses to remote DMA requests at 4GB, program the hardware using Maxmem, the page number one higher than the highest physical page detected in the system. While here, garbage collect more useless splfw() calls. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110994 on 2015/01/06 Notes: svn path=/head/; revision=277511
* Fix firewire panic when issuing a reply to an unhandledWill Andrews2015-01-211-0/+1
| | | | | | | | | | | | | | | | | asynchronous remote dma request (DMA request that the hardware cannot automatically handle). sys/dev/firewire/firewire.c In fw_rcv(), add missing early return in the error path for DMA requests to unregistered regions. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110993 on 2015/01/06 Notes: svn path=/head/; revision=277510
* Properly lock accesss to the firewire_comm->devices list.Will Andrews2015-01-212-16/+6
| | | | | | | | | | | | | | | | | | sys/dev/firewire/firewire.c: Add missing FW_GLOCK/UNLOCK() usage to fw_noderesolve_nodeid(). sys/dev/firewire/firewire.c: sys/dev/firewire/fwmem.c: Remove no-op splfw() calls from functions that have been audited for proper lock usage. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110992 on 2015/01/06 Notes: svn path=/head/; revision=277509
* Fix panic in firewire and creation of invalid config ROM.Will Andrews2015-01-211-10/+19
| | | | | | | | | | | | | | | | | | | | sys/boot/i386/libfirewire/firewire.c: sys/dev/firewire/firewire.c: Fix configuration ROM generation count wrapping logic so that the generation count is never outside of allowed limits (0x2 -> 0xF). sys/dev/firewire/firewire.c: In fw_xfer_unload(), xfer->fc may be NULL. Protect against this before taking the fc lock. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110685 on 2015/01/05 Notes: svn path=/head/; revision=277508
* Fix a FWXF_INQ race in the firewire driver.Will Andrews2015-01-211-10/+2
| | | | | | | | | | | | | | | sys/dev/firewire/firewire.c: In fw_xfer_unload() expand lock coverage so that the test for FWXF_INQ doesn't race with it being cleared in another thread. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110207 on 2015/01/02 Notes: svn path=/head/; revision=277507
* Fix one cause of firewire panics.Will Andrews2015-01-211-0/+1
| | | | | | | | | | | | | | | | | | | sys/dev/firewire/firewire.c: In fw_xfer_unload(), clear the FWXF_INQ flag on the xfer under protection of the FW_GMTX, after the xfer is removeed from the tx/rx queue. Otherwise it is possible for the xfer to be removed again (corrupting the list or immediately panicing) from another thread that has found this xfer in the transaction label table. Submitted by: gibbs MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1110200 on 2015/01/02 Notes: svn path=/head/; revision=277506
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=274819
* Do not pass whole descriptor block size as align to fwdma_malloc_multisegAlexander Kabaev2014-09-271-1/+1
| | | | | | | | | | | | Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately to contigalloc. In addition to being wrong, this causes insta-panic in certain cases due to safety assertion - the alignment is required to be the power of two and the value we calculate here seldom is. MFC after: 1 month Notes: svn path=/head/; revision=272215
* Remove obsolete compatibility glue and improve firewire code readability.Alexander Kabaev2014-09-2719-1014/+939
| | | | | | | | | | | 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-192-16/+16
| | | | Notes: svn path=/head/; revision=271849
* Start the process of cleaning up FreeBSD's firewire driver.Will Andrews2014-09-1814-432/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Silence noisy firewire logging.Will Andrews2014-09-182-17/+0
| | | | | | | | | MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 974594 on 2013/08/02 Notes: svn path=/head/; revision=271793
* 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-284-33/+18
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-274-18/+33
| | | | | | | | | | | | | 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-274-33/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Set target->sbp field to valid value when sbp device is created.Alexander Kabaev2014-06-201-1/+1
| | | | | | | | | | | | | | | The sbp_cam_detach_target can be called from sbp_post_explore function on the first target that is not really attached and it was written with the corresponding safety check in place to tolerate that. Unfortunately the recent locking cleanup did add a locking assertion that tries to dereference the target->sbp pointer unconditionally, which causes less than desirable outcome. Since the assertion is useful, just initialize the target sbp pointer once when sbp device is being initialized instead of when the target is being attached. This makes assertion work in all cases and fixes the crash on boot. Notes: svn path=/head/; revision=267660
* Various cleanups and fixes:John Baldwin2014-05-271-172/+102
| | | | | | | | | | | | | | - Switch from timeout() to callout_*() for per-request timers. - Use device_find_child() in the identify routine. - Use device_printf() instead of passing device_get_nameunit() to printf(). - Expand the SBP_LOCK coverage simplifying the locking. - Uninline STAILQ_FOREACH_SAFE(). Tested by: sbruno Notes: svn path=/head/; revision=266772
* Remove some unused variables.Christian Brueffer2014-05-161-2/+0
| | | | | | | | Found with: Clang Static Analyzer MFC after: 2 weeks Notes: svn path=/head/; revision=266270