Commit Graph

27 Commits

Author SHA1 Message Date
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
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.
2017-11-27 14:52:40 +00:00
Alexander Kabaev
23667f089d Remove obsolete compatibility glue and improve firewire code readability.
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
2014-09-27 16:50:21 +00:00
Eitan Adler
7a22215c53 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.

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.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Sean Bruno
d717909f5a Update comments around various structs.
Add speeds S800, S1600 and S3200
2009-02-12 03:05:42 +00:00
Hidetoshi Shimokawa
0cf4488ab4 MFp4: Improve asynchronous packet receive process.
- 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
2007-04-30 14:06:30 +00:00
Marius Strobl
c44123e174 Recognize the integrated (though not necessarily enabled) FireWire
controllers of Sun PCIO-2 chips which are used onboard in most of
the newer PCI-based sun4u machines (cosmetic change as they were also
already probed as generic FWOHCI without this). As with gem(4), hme(4)
and ohci(4) detect whether their intpin register is valid and correct
it if necessary, i.e. set the respective IVAR to the right value for
allocating the IRQ resource, as some of them come up having it set
to 0 (in fact in all machines I'm currently aware of the FireWire
part being enabled). This fixes attaching affected controllers.

Apporved by:	simokawa
Tested by:	Michiel Boland <michiel@boland.org>
MFC after:	1 month
2005-05-20 12:37:16 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Hidetoshi Shimokawa
433dd56b71 Fix and add deivce ID's.
Obtained from: DragonFly BSD
2004-08-04 12:18:39 +00:00
Hidetoshi Shimokawa
6e2b0d0b25 Add some PCI IDs for OHCI chips.
Obtained from: DragonFly BSD
2004-07-17 09:41:20 +00:00
Doug Rabson
03161bbcf6 Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's to
uint32_t where appropriate.
2004-05-22 16:14:17 +00:00
John Baldwin
3094dfd106 Use the PCIR_BAR() macro rather than a magic number to specify the BAR
for controller memory.
2004-02-12 20:47:03 +00:00
Hidetoshi Shimokawa
dbc80c7bf2 Add NEC uPD72873.
Submitted by: Christian Laursen <xi@borderworlds.dk>
2004-01-30 14:30:19 +00:00
Hidetoshi Shimokawa
c3e840a89b Fix register mis-alignment introduced in rev1.12. 2004-01-06 14:24:01 +00:00
Hidetoshi Shimokawa
c4778b5d1c MFp4: Change struct fw_xfer to reduce memory copy in fwmem_*() functions.
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.
2003-10-02 04:06:56 +00:00
Hidetoshi Shimokawa
a1c9e73ab8 Fill reserved fields of transmitting packets header with zero.
This fixes the if_fwe problem with 1394b chip.

PR and Tested by: nork
2003-08-20 03:11:37 +00:00
Peter Wemm
abe9725e8c Fix some recently introduced warnings. 'Declaration does not declare
anything' etc.
2003-07-26 03:47:56 +00:00
Hidetoshi Shimokawa
3be95df6a0 Add id for TI's 1394b link chip. 2003-06-04 04:26:14 +00:00
Hidetoshi Shimokawa
8fd36d4aa6 Add some IEEE 1394 OHCI chips.
Partially submitted by: Tetsuya Ryuchi <ryuchi@ryuchi.org>
PR: misc/51336
2003-04-24 07:29:52 +00:00
Hidetoshi Shimokawa
77ee030b5f MFp4(simokawa_firewire):
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
2003-04-17 03:38:03 +00:00
Hidetoshi Shimokawa
69f034dae4 Use pci_get_devid(). 2003-02-18 10:01:44 +00:00
Hidetoshi Shimokawa
12f2a2958b Add 'uPD72871/2 IEEE1394 1-Chip OHCI Host Controller'. 2003-02-18 09:46:52 +00:00
Hidetoshi Shimokawa
53f1eb8620 - Split db.desc.cmd into desc.control and desc.reqcount.
- remove unncessary descriptor updates.
2003-01-26 18:38:06 +00:00
Hidetoshi Shimokawa
bce5729a9d - Remove speed_map API because speed_map is obsoleted by 1394a.
- Add definition of OHCI_HCC_BIBIV in fwohcireg.h.
2003-01-04 16:03:50 +00:00
Hidetoshi Shimokawa
7895313547 Fix and add several device IDs. 2002-12-31 13:43:44 +00:00
Hidetoshi Shimokawa
ac9f66922b firewire.c
- Fix permission of device node.

fwochi.c, fwohcireg.h
- Detect phy access failure correct way.
- Set root hold-off bit before initiating bus reset.
	This should fix the problem with VIA6306.

fwohcivar.h
- Fix over-allocation of array. (fwohcivar.h)

sbp.c
- Return CAM_DEV_NOT_THERE rather than CAM_TID_INVALID to prevent retry.
2002-12-26 03:17:59 +00:00
Katsushi Kobayashi
a9c9b6989c Firewire device support for Apple eMac with PPC kernel.
Contributed by Peter Grehan <grehan@freebsd.org>
2002-09-17 12:50:43 +00:00
Katsushi Kobayashi
3c60ba66c4 Initial import for IEEE1394 OHCI chipdet device driver and SBP-2 (Serial
Bus Protocol 2:SCSI over IEEE1394) support for CAM.
2002-09-13 12:31:56 +00:00