summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwohci.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r258779,r258780,r258787,r258822:eadler2014-02-041-2/+2
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-1/+1
| | | | malloc(9) flags in sys/dev.
* When we see an interrupt status of 0xffffffff, check to see if theimp2011-06-211-2/+3
| | | | | | child is still present. If not, return 'handled' and don't print anything (this is expected behavior). We expect an interrupt on eject, power-down and/or shutdown.
* Allocate the DMA memory shared between the host and the controller asmarius2011-03-111-2/+2
| | | | | | coherent. MFC after: 2 weeks
* Fix grammar.brucec2010-10-181-2/+2
|
* Remove redundant while () from loop.sbruno2009-02-131-1/+1
| | | | | Submitted by: Ganbold <ganbold@micom.mng.net> Reviewed by: scottl
* Enhance debug messages and attempt to unify them into one format where possible.sbruno2009-02-121-10/+12
| | | | Reviewed by: scottl
* Some updates and bug squashing in the firewire stack.sbruno2009-02-011-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the interupt handler to a driver_intr_t type function as it was trying to do way to much for a lightweight filter interrupt function. Introduce much more locking around fc->mtx. Tested this for lock reversals and other such lockups. Locking seems to be working better, but there is much more to do with regard to locking. The most significant lock is in the BUS RESET handler. It was possible, before this checkin, to set a bus reset via "fwcontrol -r" and have the BUS RESET handler fire before the code responsible for asserting BUS RESET was complete. This locking fixes that issue. Move some of the memory allocations in the fc struct to the attach function in firewire.c Rework the businfo.generation indicator to be merely a on/off bit now. It's purpose according to spec is to notify the bus that the config ROM has changed. That's it. Catch and squash a possible panic in SBP where in the SBP_LOCK was held during a possible error case. The error handling code would definitely panic as it would try to acquire the SBP_LOCK on entrance. Catch and squash a camcontrol/device lockup when firewire drives go away. When a firewire device was powered off or disconnected from the firewire bus, a "camcontrol rescan all" would hang trying to poll removed devices as they were not properly detached. Don't do that. Approved by: scottl MFC after: 2 weeks
* - Fix panic on detach.simokawa2008-05-101-3/+0
| | | | | | - Fix a comment. MFC after: 2 weeks
* - Disable interrupts on suspend to eliminate excessivesimokawa2008-05-101-4/+9
| | | | | | | 'device physically ejected?' message on resume. - Fix memory leak on resume reported by kiyohara at netbsd.org. MFC after: 2 weeks
* Timestamp after sent.simokawa2007-06-081-0/+1
|
* Fix a race after a bus reset.simokawa2007-06-081-3/+4
| | | | | - We are in FWBUSINIT state just after SID interrupt. - Do not pass normal xfers before bus probe is done.
* Add a tunable hw.firewire.phydma_enable.simokawa2007-06-071-6/+11
| | | | | | | | This is enabled by default. It should be disabled for those who are uneasy with peeking/poking from FireWire. Please note sbp(4) and dcons(4) over FireWire need this feature.
* MFp4: MPSAFE firewire stack.simokawa2007-06-061-243/+252
| | | | | | | | | | | | | - 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()
* MFp4: Improve asynchronous packet receive process.simokawa2007-04-301-32/+68
| | | | | | | | - Wake up DMA engine after adding a new receive buffer. - Skip buffers which have unknown state after error. - More rigid error detection. MFC after: 1 week
* MFp4: Add a sysctl knob to disable cycle master mode and add some comments.simokawa2007-04-301-1/+9
| | | | MFC after: 1 week
* Initialize configuration ROM before a bus reset.simokawa2007-04-301-1/+1
| | | | MFC: after 3 days
* Wait SCLK to be stable after LPS enabled.simokawa2007-03-191-0/+2
| | | | | | | This should fix NMI problem in fwphy_rddata(). PR: kern/94146 kern/100356 MFC: after 3 days
* * Remove xfer->retry_req.simokawa2007-03-161-6/+2
| | | | | It is unnecessary because retry is done by OHCI. Further retry should be done by applications.
* Less verbose debug messages.simokawa2007-03-161-3/+3
|
* Detect cycle lost.simokawa2007-03-161-0/+18
|
* Use pause() rather than tsleep() on stack variables and function pointers.jhb2007-02-271-4/+2
|
* fix potential null ptr derefsam2005-03-291-4/+4
| | | | Submitted by: Coverity Prevent analysis tool
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Don't output too many debug messages for bootverbose.simokawa2004-07-201-11/+11
| | | | This driver seems to be fairly stable now.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Initialise OHCI_CROMHDR and OHCI_BUS_OPT in fwohci_ibr to make sure thatdfr2004-05-231-0/+7
| | | | they have the right values at the first bus reset.
* Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's todfr2004-05-221-59/+59
| | | | uint32_t where appropriate.
* Fix spelling.dfr2004-05-211-7/+7
|
* MFp4: FireWiresimokawa2004-03-261-13/+22
| | | | | | | | | | | | | | | | | | | * 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.
* Use device_identify and bus_add_child methods to add a firewiresimokawa2004-01-301-1/+0
| | | | | bus on fwohci. This should fix attach failure caused by a race between firewire and fwochi initialization for the kernel module.
* Add missing free() in exception handlers.simokawa2004-01-221-0/+1
| | | | Reported by: Stanford Metacompilation research group
* Sync type of linkspeed with firewire.c.simokawa2004-01-111-1/+1
|
* Remove __P().simokawa2004-01-061-30/+30
|
* MFp4:simokawa2004-01-051-2/+7
| | | | | | | | | | | * 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.
* Catch a few places where NULL (pointer) was used where 0 (integer) waspeter2003-12-231-4/+4
| | | | expected.
* Reject too large OHCI version number.simokawa2003-10-311-4/+5
| | | | | Invalid OHCI version indicates OHCI registers are not mapped correctly in PCI or CardBus layer.
* MFp4: Change struct fw_xfer to reduce memory copy in fwmem_*() functions.simokawa2003-10-021-81/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Comment out verbose debug messages.simokawa2003-08-221-0/+2
|
* Fill reserved fields of transmitting packets header with zero.simokawa2003-08-201-10/+22
| | | | | | This fixes the if_fwe problem with 1394b chip. PR and Tested by: nork
* Remove unused code.simokawa2003-08-191-2/+0
|
* Allow to access phy registers via ioctl().simokawa2003-08-191-1/+16
|
* Validate number of iso. DMA channels.simokawa2003-08-121-0/+2
|
* - Don't mess with TX queue in fwohci_stop() if we failed to attach the device.simokawa2003-08-041-1/+7
| | | | | | | | Tested by: wilko - Detect memory mapping failure of registers by checking OHCI version. Tested by: KONDOU, Kazuhiro <kazuhiro@alib.jp>
* Clean up fwdev.simokawa2003-08-011-0/+7
| | | | | Allocate iso DMA channel dynamically. This allows us to have more /dev/fw* than number of DMA channels for asyn. transactions and etc.
* Clean up include files.simokawa2003-07-181-13/+0
|
* Add compatibility for FreeBSD-4.simokawa2003-07-041-1/+4
|
* Mega busdma API commit.scottl2003-07-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Include file clean up.simokawa2003-06-301-2/+4
|
* Fix several problems related to resume:simokawa2003-06-281-2/+20
| | | | | | | | - Initialize fc->status to process bus reset correctly after resume. - Initialize AT ring buffer pointer. - Requeue stdma to stfree for active IR buffer. - Stop DMA before suspend for safe. - Set powerstate after resume.
OpenPOWER on IntegriCloud