aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire/fwmem.c
Commit message (Collapse)AuthorAgeFilesLines
* firewire: replace magic numbers with named constantsAbdelkader Boudih2026-07-201-2/+3
| | | | | | | No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58311
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-1/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+3
| | | | | | | | | | | | | | | | | | | 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
* 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-2/+0
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299351
* 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
* Properly lock accesss to the firewire_comm->devices list.Will Andrews2015-01-211-3/+1
| | | | | | | | | | | | | | | | | | 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
* Remove obsolete compatibility glue and improve firewire code readability.Alexander Kabaev2014-09-271-31/+32
| | | | | | | | | | | 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
* Start the process of cleaning up FreeBSD's firewire driver.Will Andrews2014-09-181-14/+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
* 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
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-291-1/+2
| | | | | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Notes: svn path=/head/; revision=201223
* MFp4: MPSAFE firewire stack.Hidetoshi Shimokawa2007-06-061-14/+27
| | | | | | | | | | | | | | | | - 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
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Fix malloc type in free().Hidetoshi Shimokawa2004-11-101-1/+1
| | | | Notes: svn path=/head/; revision=137503
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-7/+7
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's toDoug Rabson2004-05-221-15/+15
| | | | | | | uint32_t where appropriate. Notes: svn path=/head/; revision=129585
* MFp4: FireWireHidetoshi Shimokawa2004-03-261-6/+14
| | | | | | | | | | | | | | | | | | | | | | * 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
* MFp4:Hidetoshi Shimokawa2004-01-051-2/+4
| | | | | | | | | | | | | | * firewire - Remove pending list. - Ignore timeout for the FWXF_START state. - Define M_FWMEM for debugging. - Comment out DELAY() in fw_asybusy(). - Improve debugging messages * sbp - Freeze simq while bus reset. Notes: svn path=/head/; revision=124145
* Allow shared open of /dev/fwmem* for read-only.Hidetoshi Shimokawa2003-11-071-16/+42
| | | | Notes: svn path=/head/; revision=122228
* Reduce debug messages.Hidetoshi Shimokawa2003-10-231-2/+4
| | | | Notes: svn path=/head/; revision=121381
* Remove wrong usage of BUF_REFCNT().Hidetoshi Shimokawa2003-10-021-1/+0
| | | | | | | Spotted by: phk Notes: svn path=/head/; revision=120664
* MFp4: Change struct fw_xfer to reduce memory copy in fwmem_*() functions.Hidetoshi Shimokawa2003-10-021-143/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And many changes. * all - Major change of struct fw_xfer. o {send,recv}.buf is splitted into hdr and payload. o Remove unnecessary fields. o spd is moved under send and recv. - Remove unnecessary 'volatile' keyword. - Add definition of rtcode and extcode. * firewire.c - Ignore FWDEVINVAL devices in fw_noderesolve_nodeid(). - Check the existance of the bind before call STAILQ_REMOVE(). - Fix bug in the fw_bindadd(). - Change element of struct fw_bind for simplicity. - Check rtcode of response packet. - Reduce split transaction timeout to 200 msec. (100msec is the default value in the spec.) - Set watchdog timer cycle to 10 Hz. - Set xfer->tv just before calling fw_get_tlabel(). * fwohci.c - Simplifies fwohci_get_plen(). * sbp.c - Fix byte order of multibyte scsi_status informations. - Split sbp.c and sbp.h. - Unit number is not necessary for FIFO¤ address. - Reduce LOGIN_DELAY and SCAN_DELAY to 1 sec. - Add some constants defineded in SBP-2 spec. * fwmem.c - Introduce fwmem_strategy() and reduce memory copy. Notes: svn path=/head/; revision=120660
* Use __FBSDID().David E. O'Brien2003-08-241-1/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Fix tsleep/wakup race on FreeBSD-4.Hidetoshi Shimokawa2003-07-011-2/+14
| | | | Notes: svn path=/head/; revision=117104
* Open fwmem device exclusively.Hidetoshi Shimokawa2003-06-031-0/+5
| | | | Notes: svn path=/head/; revision=115786
* MFp4(simokawa_firewire):Hidetoshi Shimokawa2003-04-171-42/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many internal structure changes for the FireWire driver. - Compute CRC in CROM parsing. - Add support for configuration ROM build. - Simplify dummy buffer handling. - busdma conversion - Use swi_taskqueue_giant for -current. Mark the interrupt routine as MPSAFE. - AR buffer handling. Don't reallocate AR buffer but just recycle it. Don't malloc and copy per packet in fwohci_arcv(). Pass packet to fw_rcv() using iovec. Application must prepare receiving buffer in advance. - Change fw_bind API so that application should pre-allocate xfer structure. - Add fw_xfer_unload() for recycling struct fw_xfer. - Add post_busreset hook - Remove unused 'sub' and 'act_type' in struct fw_xfer. - Remove npacket from struct fw_bulkxfer. - Don't call back handlers in fwochi_arcv() if the packet has not drained in AT queue - Make firewire works on big endian platform. - Use native endian for packet header and remove unnecessary ntohX/htonX. - Remove FWXFERQ_PACKET mode. We don't use it anymore. - Remove unnecessary restriction of FWSTMAXCHUNK. - Don't set root node for phy config packet if the root node is not cycle master capable but set myself for root node. We should be the root node after next bus reset. Spotted by: Yoshihiro Tabira <tabira@scd.mei.co.jp> - Improve self id handling Tested on: i386, sparc64 and i386 with forced bounce buffer Notes: svn path=/head/; revision=113584
* - The payload of Write Request Quad and Read Response Quad must beHidetoshi Shimokawa2003-03-241-1/+1
| | | | | | | | | network byte order. - Set ATRetries register after each bus reset because the value is 'undef' in OHCI spec. Notes: svn path=/head/; revision=112523
* - improve timeout handling in fwmem.cHidetoshi Shimokawa2003-03-071-14/+16
| | | | | | | - stop processing of TX db if we reaches the end of active db. Notes: svn path=/head/; revision=111956
* MFp4(simokawa_sbp branch)Hidetoshi Shimokawa2003-02-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | Improve SBP device probeing: - Wait 2 sec before issuing LOGIN ORB expecting the reconnection hold timer expires. - Serialize management ORB and scanning LUN by CAM on each target. This should fix the problem for devices which have multiple LUNs. Test device is donated by: Jaye Mathisen <mrcpu@internetcds.com> - Freeze SIM queue for 2 sec after BUS RESET. - Retry with LOGIN rather than RECONNECT after LOGIN is not completed for BUS RESET. - Use appropriate CAM status for BUS RESET and DEVICE RESET. - Let CAM to scan targets after BUS REST. - Implement CAM scan target function. - Keep our own devq freeze count. - Let CAM to know that SBP does tagged queuing. These should be merged to RELENG_4 before 4.8-RELEASE. Notes: svn path=/head/; revision=111615
* Cleanup of the d_mmap_t interface.Maxime Henrion2003-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Get rid of the useless atop() / pmap_phys_address() detour. The device mmap handlers must now give back the physical address without atop()'ing it. - Don't borrow the physical address of the mapping in the returned int. Now we properly pass a vm_offset_t * and expect it to be filled by the mmap handler when the mapping was successful. The mmap handler must now return 0 when successful, any other value is considered as an error. Previously, returning -1 was the only way to fail. This change thus accidentally fixes some devices which were bogusly returning errno constants which would have been considered as addresses by the device pager. - Garbage collect the poorly named pmap_phys_address() now that it's no longer used. - Convert all the d_mmap_t consumers to the new API. I'm still not sure wheter we need a __FreeBSD_version bump for this, since and we didn't guarantee API/ABI stability until 5.1-RELEASE. Discussed with: alc, phk, jake Reviewed by: peter Compile-tested on: LINT (i386), GENERIC (alpha and sparc64) Runtime-tested on: i386 Notes: svn path=/head/; revision=111462
* Add new ioctl to specify target EUI64 for fwmem.Hidetoshi Shimokawa2003-02-091-8/+26
| | | | Notes: svn path=/head/; revision=110582
* - Detect split transcation timeout.Hidetoshi Shimokawa2003-02-091-4/+6
| | | | | | | | | | | * implement watchdog timer. * check all standing transactions in firewire_xfer_timeout(). - Add firewire_xferq_drain() for fw_busreset(). - Add/improve some debug messages. - Call fw_xfer_done() if retry handler is NULL. Notes: svn path=/head/; revision=110577
* Fix memory leak.Hidetoshi Shimokawa2003-02-061-13/+20
| | | | Notes: svn path=/head/; revision=110465
* Fix for fwmem write part.Hidetoshi Shimokawa2003-02-051-14/+14
| | | | | | | | | - fix typo - don't need to check receive buffer. - don't forget to free xfer on errer. Notes: svn path=/head/; revision=110406
* - Implement write part.Hidetoshi Shimokawa2003-02-041-30/+120
| | | | | | | - Use quad access for aligned 4 byte access. Notes: svn path=/head/; revision=110337
* - Take malloc type as an argument in fw_xfer_alloc().Hidetoshi Shimokawa2003-02-031-1/+1
| | | | | | | | | | | | - Fix overwrite problem of freed buffers. It was rare but could happen when fwohci_arcv() is called before fwohci_txd() is called for the transcation. - Drain AT queues and pend AR queues on SID receive rather than BUS reset to make sure DMA actually stops. - Do agent reset in sbp_timeout(). Notes: svn path=/head/; revision=110269
* Define new malloc type M_FW and use it.Hidetoshi Shimokawa2003-02-011-1/+1
| | | | Notes: svn path=/head/; revision=110195
* Restart cycle master after bus manager election.Hidetoshi Shimokawa2003-01-301-2/+2
| | | | | | | | | | This should fix the IR(and maybe IT) problem when the host becames the bus manager. - rename fw_noderesolve() to fw_noderesolve_eui64() and add fw_noderesolve_nodeid(). Notes: svn path=/head/; revision=110072
* Cosmetic change. s/Firewire/FireWire/.Hidetoshi Shimokawa2002-12-261-1/+1
| | | | Notes: svn path=/head/; revision=108281
* - Add fwmem_xfer_req() and use this in other functions.Hidetoshi Shimokawa2002-11-121-50/+46
| | | | Notes: svn path=/head/; revision=106816
* Use struct fw_device in fwmem.cHidetoshi Shimokawa2002-11-121-19/+78
| | | | | | | | | - specify fwmem target by EUI64. - fw_noderesolve returns struct fw_device rather than dst. - include struct firewire_comm in struct fw_device. Notes: svn path=/head/; revision=106810
* Change interface of fwmem_read_*() functions to be usable from other partHidetoshi Shimokawa2002-11-121-37/+36
| | | | | | | of the module. Notes: svn path=/head/; revision=106804
* Initial import for IEEE1394 OHCI chipdet device driver and SBP-2 (SerialKatsushi Kobayashi2002-09-131-0/+254
Bus Protocol 2:SCSI over IEEE1394) support for CAM. Notes: svn path=/head/; revision=103285