aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire/firewire.c
Commit message (Collapse)AuthorAgeFilesLines
* Protect transaction labels by its own lock to reduce lock contention.Hidetoshi Shimokawa2007-07-201-12/+16
| | | | | | | Approved by: re (rwatson) Notes: svn path=/head/; revision=171513
* Improve acquisition of transaction labels.Hidetoshi Shimokawa2007-07-151-20/+16
| | | | | | | | | | | - Keep last transaction label for each destination. - If the next label is not free, just give up. - This should reduce CPU load for TX on if_fwip under heavy load. Approved by: re (hrs) Notes: svn path=/head/; revision=171457
* Fix a bug of retrieving configuration ROM.Hidetoshi Shimokawa2007-07-081-2/+2
| | | | | | | | | | | | | - Handle directories and leaves other than unit directories and text leaves correctly. - Now we can retrieve CROM of iSight correctly. Approved by: re (hrs) Tested by: flz MFC after: 3 days Notes: svn path=/head/; revision=171302
* Timestamp after sent.Hidetoshi Shimokawa2007-06-081-4/+3
| | | | Notes: svn path=/head/; revision=170427
* Fix a race after a bus reset.Hidetoshi Shimokawa2007-06-081-11/+12
| | | | | | | | - We are in FWBUSINIT state just after SID interrupt. - Do not pass normal xfers before bus probe is done. Notes: svn path=/head/; revision=170425
* MFp4: MPSAFE firewire stack.Hidetoshi Shimokawa2007-06-061-69/+214
| | | | | | | | | | | | | | | | - 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
* Make sure fwsid is not NULL.Hidetoshi Shimokawa2007-05-211-1/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=169829
* MFp4: Simplify the bus probe routin using a kthread.Hidetoshi Shimokawa2007-05-211-331/+232
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=169806
* MFp4:Hidetoshi Shimokawa2007-04-301-9/+11
| | | | | | | | | | - Update state in fw_xferq_dorain() after removed from the send queue. - Remove unnecessary 'goto err;". MFC after: 1 week Notes: svn path=/head/; revision=169131
* MFp4: Fix broken userland API for async packets.Hidetoshi Shimokawa2007-04-301-54/+45
| | | | | | | | | | | - Introduce fw_xferlist_add/remove(). - Introduce fw_read/write_async(). - Remove unused FWACT_CH. MFC after: 1 week Notes: svn path=/head/; revision=169130
* MFp4: Fix typo in recv spd.Hidetoshi Shimokawa2007-04-301-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=169127
* MFp4: remove unused fw_asybusy().Hidetoshi Shimokawa2007-04-301-14/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=169122
* MFp4: Simplify tlabel handlingHidetoshi Shimokawa2007-04-301-33/+27
| | | | | | | | | | | - Remove struct tl_label and runtime malloc() for it. - Include tl_lable list in struct fw_xfer. - Don't free unallocated tlabel. MFC after: 1 week Notes: svn path=/head/; revision=169119
* Initialize configuration ROM before a bus reset.Hidetoshi Shimokawa2007-04-301-2/+3
| | | | | | | MFC: after 3 days Notes: svn path=/head/; revision=169117
* Free tlabel in fw_xfer_done().Hidetoshi Shimokawa2007-03-301-2/+1
| | | | Notes: svn path=/head/; revision=168051
* - Don't call fw_busreset() in firewire_attach().Hidetoshi Shimokawa2007-03-301-1/+0
| | | | | | | | | | This should fix the problem that the first bus reset is sometimes ignored because of FWBUSRESET status. MFC after: 3 days Notes: svn path=/head/; revision=168050
* Replace xfer->act.hand with xfer->hand.Hidetoshi Shimokawa2007-03-161-16/+16
| | | | Notes: svn path=/head/; revision=167632
* Remove retry_count.Hidetoshi Shimokawa2007-03-161-1/+0
| | | | Notes: svn path=/head/; revision=167631
* * Remove xfer->retry_req.Hidetoshi Shimokawa2007-03-161-30/+2
| | | | | | | | It is unnecessary because retry is done by OHCI. Further retry should be done by applications. Notes: svn path=/head/; revision=167630
* Fix panic when we cannot find self-id of probing nodes.Hidetoshi Shimokawa2005-11-251-1/+3
| | | | | | | | | | | | This shouldn't happen as far as the self-id buffer is vaild but some people have this problem. PR: kern/83999 Submitted by: Markus Wild <fbsd-lists@dudes.ch> MFC after: 3 days Notes: svn path=/head/; revision=152792
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* return after freeing data element, instead of falling through, and usingJohn-Mark Gurney2005-01-041-0/+1
| | | | | | | | | the free'd element, and ultimate NULL deref of the failed allocation. MFC after: 1 week Notes: svn path=/head/; revision=139680
* Avoid casts as lvalues.Alexander Kabaev2004-07-281-1/+1
| | | | Notes: svn path=/head/; revision=132771
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-07-151-0/+2
| | | | | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything". Notes: svn path=/head/; revision=132199
* If we run out of transmission labels, just re-queue the packet for laterDoug Rabson2004-06-141-3/+4
| | | | | | | | instead of printing endless error messages on the console and discarding the packet. Notes: svn path=/head/; revision=130460
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's toDoug Rabson2004-05-221-36/+36
| | | | | | | uint32_t where appropriate. Notes: svn path=/head/; revision=129585
* Fix spelling.Doug Rabson2004-05-211-5/+5
| | | | Notes: svn path=/head/; revision=129541
* Don't use the node id as an index into the topology map. This breaksDoug Rabson2004-05-161-2/+21
| | | | | | | | if a node on the bus has more than three ports (like my cheapo six port hub). Notes: svn path=/head/; revision=129274
* MFp4: FireWireHidetoshi Shimokawa2004-03-261-20/+45
| | | | | | | | | | | | | | | | | | | | | | * 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
* Check that xfer != NULL before dereferencing it, not after.Colin Percival2004-02-221-2/+2
| | | | | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor) Notes: svn path=/head/; revision=126102
* Use device_identify and bus_add_child methods to add a firewireHidetoshi Shimokawa2004-01-301-4/+13
| | | | | | | | bus on fwohci. This should fix attach failure caused by a race between firewire and fwochi initialization for the kernel module. Notes: svn path=/head/; revision=125238
* * firewireHidetoshi Shimokawa2004-01-081-17/+26
| | | | | | | | | | | | | 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
* Remove __P().Hidetoshi Shimokawa2004-01-061-19/+19
| | | | Notes: svn path=/head/; revision=124169
* MFp4:Hidetoshi Shimokawa2004-01-051-23/+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. Notes: svn path=/head/; revision=124145
* - Implement selwakeuppri() which allows raising the priority of aSeigo Tanimura2003-11-091-1/+1
| | | | | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current Notes: svn path=/head/; revision=122352
* Move validity check of 'xfer->fc != NULL' to right place.Hidetoshi Shimokawa2003-10-251-4/+4
| | | | Notes: svn path=/head/; revision=121505
* Don't check timeout just after booted.Hidetoshi Shimokawa2003-10-241-3/+15
| | | | | | | | Some transactions could be considered wrongly to be timeout bacause interrupts are disabled during boot process. Notes: svn path=/head/; revision=121463
* - Introduce hw.firewire.hold_count sysctl MIB by popular demand.Hidetoshi Shimokawa2003-10-061-18/+24
| | | | | | | | | | This MIB specifies how many bus resets should be observed before the lost device entry is removed. The default value is 3. You can set this value to 0 if you want a SBP device to be detached from CAM layer as soon as the device is physically detached like USB. Notes: svn path=/head/; revision=120850
* MFp4: Change struct fw_xfer to reduce memory copy in fwmem_*() functions.Hidetoshi Shimokawa2003-10-021-210/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Comment out verbose debug messages.Hidetoshi Shimokawa2003-08-221-0/+2
| | | | Notes: svn path=/head/; revision=119289
* Change device name notation.Hidetoshi Shimokawa2003-08-051-42/+41
| | | | | | | | | - /dev/fw{,mem}X.Y represents the Y'th unit on the X'th bus. - /dev/fw{,mem}X is an alias of fw{,mem}X.0 for compatibility. - Clone devices. Notes: svn path=/head/; revision=118455
* Clean up include files.Hidetoshi Shimokawa2003-07-181-3/+0
| | | | Notes: svn path=/head/; revision=117732
* Add some debug messages.Hidetoshi Shimokawa2003-07-181-4/+6
| | | | Notes: svn path=/head/; revision=117716
* Configuraiton ROM fix:Hidetoshi Shimokawa2003-07-091-8/+26
| | | | | | | | | - Don't bump the generation if ROM has not changed and keep it between 0x2 and 0xf. - Refetch the ROM if CRC of the businfo block has changed. Notes: svn path=/head/; revision=117350
* Include file clean up.Hidetoshi Shimokawa2003-06-301-2/+3
| | | | Notes: svn path=/head/; revision=117067
* Fix several problems related to resume:Hidetoshi Shimokawa2003-06-281-2/+16
| | | | | | | | | | | - 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. Notes: svn path=/head/; revision=116978
* - Enable support for building Configuration ROM.Hidetoshi Shimokawa2003-06-151-16/+100
| | | | | | | - Improve probe message for S800 chips. Notes: svn path=/head/; revision=116376
* Allocate zeroed space for fwdev.Hidetoshi Shimokawa2003-06-031-1/+2
| | | | Notes: svn path=/head/; revision=115787
* - Use moderate gap counts listed in IEEE1394a.Hidetoshi Shimokawa2003-05-111-28/+32
| | | | | | | | | | | - Simplify and correct the bus manager election process. - Check link_active when choosing cycle master. - Fix location of the cmr bit. Approved by: re (scottl) Notes: svn path=/head/; revision=114909