Commit Graph

280 Commits

Author SHA1 Message Date
jmc
3b7f83f77f Correct calculating of offsets when memcpy returned data. 2002-12-01 12:05:11 +00:00
jmc
1f366747d4 Tidy up some debug routines and make verbose packet dumps only when sbp2debug>2 2002-11-30 06:18:54 +00:00
jmc
88fe775d19 Print out some more details from incoming packets (tlabel's).
Also, when receiving a write packet, respond with a proper ack if something
was available to process it. (Fixes most of the sbp2 random hangs)
2002-11-30 06:09:42 +00:00
thorpej
c23c86e36b Add ULL to 64-bit integer constants. 2002-11-25 02:30:38 +00:00
jmc
1db8069fe5 First pass (checkpoint checkin) for firewire scsi code.
There are a number of issues here for anyone trying to use this today:

1. On my test drive the command engine on the drive seems to stall after the
   inquire is done. So the mode sense times out for a long time before
   aborting. This obviously needs to be tracked down and fixed.

   However it does do a proper inquire:

scsibus0 at sbpscsi0: 1 target, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <Maxtor, 1394 storage, 60> disk fixed

2. This code is quite ugly in places as debug code was added to test things.
   Definitly needs cleanup/documention in places where it's using command
   structures. The structure for alloc'ing orbs, running them through the
   command engine and getting state back is mostly set but implementation needs
   an overhaul in places.

3. For testing I use the following config options:

fwohci* at cardbus? dev ? function ?    # IEEE1394 Controller
fw*     at fwbus?
options FW_DEBUG
options FWNODE_DEBUG
options P1212_DEBUG
options SBP2_DEBUG
options SBPSCSI_DEBUG
fwnode* at fwbus?
sbpscsi* at fwnode?
scsibus* at sbpscsi?
2002-11-22 16:28:54 +00:00
jmc
77b603bc96 Change structure/usage of interface provided callbacks. (read, write, reset)
Push these up to the ieee1394 softc level and make the naming scheme
consistant.
2002-11-22 16:20:17 +00:00
thorpej
c9b3657ce9 Add trailing ; to CFATTACH_DECL. 2002-10-02 16:33:28 +00:00
thorpej
e9d707fbd5 Use CFATTACH_DECL(). 2002-09-30 21:17:57 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos
0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
itojun
4ca3b72694 remove obsolete use of M_LINK0. it was planned to be used to identify
isosynchronous stream from others, but end up not being used.
From: Hayakawa Koichi <haya@ilink.sony.co.jp>
2002-06-24 00:42:27 +00:00
itojun
be931241b8 rm unneeded #include 2002-06-21 11:43:04 +00:00
itojun
a42ff1111c don't pull in sys/mbuf.h just for prototype decl 2002-06-21 11:22:17 +00:00
jmc
a3c3d336ee Only dump the rom up to ab_retlen in error cases. Also add in
P1212_ALLOW_VENDOR_DIRECTORY_TYPE to the flags passed to the p1212 parser
2002-04-03 04:15:59 +00:00
jmc
7a4d324653 Clean up some comments 2002-03-29 05:06:42 +00:00
jmc
39b8891129 Update copyright date 2002-03-29 05:05:40 +00:00
nathanw
2a72ef3147 Remove a variable that is unused after the previous ALTQ commit. 2002-03-06 05:33:05 +00:00
itojun
ac36f7cb2c bring in latest ALTQ from kjc. ALTQify some of the drivers. 2002-03-05 04:12:57 +00:00
enami
fa5084d17e Make this file compiles w/o FWNODE_DEBUG. 2002-03-01 01:01:18 +00:00
jmc
71b05541b5 Initial layout for SBP2 routines. Mainly just the code yanked from fwnode.c
so it's not lost.
2002-02-27 05:12:11 +00:00
jmc
6cf5c78fa4 Basic prototype/beginning of firewire disk support using sbp2/scsi. Commiting
to have a baseline.
2002-02-27 05:11:27 +00:00
jmc
40cba409bb Change/pretty up some debugging info.
Also, add unit location fields to the ROM image. The p1212 spec requires
unit locations if you have 2 or more unit directories which is the case for
ipv4 and ipv6 compiled into a kernel.
2002-02-27 05:09:15 +00:00
jmc
f04610f130 Move definition of if_fw fifo location to ieee1394reg.h as it's needed for
filling in unit location in the rom.

XXX: This all is really too welded together. The if_fw code should be
decoupled from this and simply be handed a method by which it can provide
the config rom back to the main code.
2002-02-27 05:07:25 +00:00
jmc
d455d6316d Add 3 more macros for extracting info from bus info block 2002-02-27 05:05:39 +00:00
jmc
ea96c58797 Change length values to u_int32_t 2002-02-27 05:04:28 +00:00
jmc
ed05bf459e Rototill fwnode.c to rely on the p1212 routines to parse and validate the ROM 2002-02-27 05:02:25 +00:00
jmc
8140d3a6bb Note done sections related to fwnode/ieee1212 stuff 2002-02-27 05:00:55 +00:00
jmc
2d478bd8d8 Move over from std to here 2002-02-27 05:00:00 +00:00
jmc
a10cd2d55f Print the tcode in hex when debugging like all other debug statements 2002-02-18 09:10:44 +00:00
augustss
a91e01c9ee s/ab_csr/ab_addr/ so it compiles again. 2002-02-11 12:32:43 +00:00
jmc
edd781367c Change some wording on fw's to make it more logical sounding. 2002-02-03 07:29:14 +00:00
jmc
c4bd465ed5 Add IEEE1394_MAX_REC macro 2002-02-03 07:25:11 +00:00
jmc
715f7380b0 Add an unreg function.
Add a uio struct to the abuf so direct uio supporting calls can be setup.

Change all refs of csr in the abuf to addr as thats it's real function.
2002-02-03 07:24:48 +00:00
ichiro
96f25772c6 OCHI -> OHCI 2002-01-26 16:34:27 +00:00
eeh
12fcdc813a Fix illegal pointer manipulations that cause alignment problems. 2002-01-16 01:47:36 +00:00
tsutsui
e6f8529d26 Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-12 16:58:16 +00:00
drochner
f9f119b62a cosmetics: print a "\n" terminated string if no "fw at fwohci" is
configured
2002-01-09 18:50:54 +00:00
ichiro
a926e1d151 done - Make fwohci detach correctly (for cardbus/etc type interfaces) 2001-12-29 12:28:05 +00:00
ichiro
fc50aac093 implement fwohci detach routine. 2001-12-29 12:26:31 +00:00
lukem
2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem
05b019ba0f add RCSID 2001-11-13 12:24:11 +00:00
haya
727e8d4a04 Bugfix: re-order double buffer only when second buffer exists. 2001-10-12 09:27:23 +00:00
tsutsui
7fce932a4d Fix typo in printf format. 2001-09-18 16:11:00 +00:00
haya
c14e80bd30 Bugfix: re-order buffers when they are released. 2001-09-07 11:04:35 +00:00
wiz
251b3464be heirarchy -> hierarchy 2001-08-24 10:24:45 +00:00
onoe
b7ff292c17 make it compilable:
fw_verbose, fw_dump -> fwdebug (DPRINTFN)
	add sc1394_ifsetiso into ieee1394_softc
2001-07-18 02:59:54 +00:00
haya
8a1cc19a9f New Feature: Add isochronous stream input routine. This feature has
been tested on i386.  It does not have any interface for useland to
get isochoronous stream.  The isochoronous acquisition interface
should be determined.
2001-07-17 11:01:03 +00:00
onoe
ff12a4271a performance improvement in fwohci_pkt_get() for asynchronous read. 2001-07-02 11:12:09 +00:00
onoe
a924a0db99 set/reset low level receive handler according to IFF_UP flag of network
interface.
2001-07-02 10:46:03 +00:00
onoe
3a2ef358d9 fix typo: CLear -> Clear 2001-07-02 02:36:48 +00:00
onoe
7605dd5368 FW_DEBUG only: move descriptor dump from DPRINTFN(1) to DPRINTFN(2).
fix indent in packet dump.
2001-07-02 02:26:40 +00:00
onoe
3fc5f5722d Fixes to make if_fw work:
- fwohci_arrq_input: Do not return if next packet is in the buffer,
    or the next packet cannot be received until the next receive interrupt.
- fwohci_uid_collect: XXX change M_WAITOK to M_NOWAIT for now, since there is
    no lock but only one instance must be allowed here.
  split fwohci_uid_req() and retry to get uid.
    XXX need timer to wait some moment between retries...
- Add DELAY(10) for wait loop.
- split fwohci_buf_stop() into _stop_tx() and _stop_rx() because receiver
    should not be stopped at bus-reset.
- split fwohci_buf_input() into _input() and _input_ppb() to improve
    performance slightly.
2001-06-29 14:57:24 +00:00
onoe
8601a37f8c Protect to call fw_start() recursively. 2001-06-29 14:46:54 +00:00
onoe
e88b10865c simplify and localize to access sc_intmask in fwohci_event_thread(). 2001-06-28 14:41:28 +00:00
onoe
3ad99107cb Simplify to update sc_intmask in fwohci_intr(). 2001-06-28 14:38:56 +00:00
onoe
a0eef76f35 FW_DEBUG: split debug printf in fwohci_intr() and fwohci_phy_input() into
fwohci_show_intr() and fwohci_show_phypkt() respectively.
2001-06-28 14:37:56 +00:00
onoe
d38786d61f fix printf to DPRINTFN inside FW_DEBUG 2001-06-25 04:52:26 +00:00
jmc
c2b5ec5220 Add a few nits. Hubs seem problematic on resets sometimes.
Also, make sure fwohci can detach cleanly (for cardbus).
2001-05-17 05:30:37 +00:00
jmc
0aae41bf84 Clean up comment about unregistering callbacks 2001-05-15 06:54:07 +00:00
jmc
c3967bca55 Various small changes.
Clean up one bug in a DPRINTF in arrs_input which could panic on some packets.
Gut the ack/response functionality and clean it up so all packets get checked
correctly and the abuf struct isn't used once the ab_cb has happened (there
still could be ack packets waiting to be processed at that time).
Finally, add some documentation explaining read/write/inreg and their
purpose/argument calling.
2001-05-15 06:52:30 +00:00
jmc
d91da495a9 Back out last change until I get fwohci rototilled better for checking the ack bits. Makes things compile again. 2001-05-15 06:30:30 +00:00
jmc
61ca5f641b Remove ackcb. It's a duplicate of existing functionality. 2001-05-14 06:51:36 +00:00
jmc
98139fa8b9 Make sure and zero out the malloc'd abufs before using them. 2001-05-14 05:46:41 +00:00
jmc
3790f44eac Add a retries counter to abuf 2001-05-13 05:02:08 +00:00
jmc
880b3e6a6f Add locators support 2001-05-13 05:01:42 +00:00
jmc
bfd7dcb931 Add first pass generic ack callback code (to eventually replace mbuf specific code).
Change ab_node's to ab_req.
Fix a bug where setting BIBValid on OHCI 1.0 chips (this is a reserved bit
on 1.0)
2001-05-11 06:10:44 +00:00
jmc
29499573cd Change ab_node's to ab_req.
Use read/write instead of input/output.
Fix a bug in attach where the abuf wasn't getting zero'd out.
2001-05-11 06:09:01 +00:00
jmc
5bf1559a64 Rename input/output to read/write to match ieee1394var.h 2001-05-11 06:07:40 +00:00
jmc
2d235c864f Add some notes 2001-05-11 06:07:02 +00:00
jmc
b4974f0526 Add first pass of generalized hooks for packet completion (i.e. ack) codes. This will eventually replace the mbuf code when it moves back to if_fw.c where it belongs. 2001-05-11 06:06:03 +00:00
jmc
6dc32302f3 Add mask for getting the ACK bits out of the status area of a DMA context descriptor 2001-05-11 06:04:49 +00:00
jmc
b7d6b60f87 Change abuf to include both requestor and responder softc's (for dealing with requests from other nodes later).
Add a callback so the ACK bits can be looked at if wanted.
Change the input/output pointers to proper proto's and rename to read/write.
2001-05-11 06:03:55 +00:00
jmc
32a67a12cd Remove extraneous prototype 2001-05-11 06:00:17 +00:00
augustss
94b7017e7f Point out where the documentation is wrong. 2001-05-09 12:08:44 +00:00
jmc
f29b37329e Change to DPRINTF/DPRINTFN for debug output. 2001-05-03 04:42:11 +00:00
jmc
3aa56ffc5a Retabify to correct style. Also, change to using DPRINTF interface for debug output. 2001-05-03 04:41:34 +00:00
jmc
4e54f2d907 Style police. Got the tab'ing correct 2001-05-03 04:37:43 +00:00
jmc
4dbb3cf591 Add a few more items 2001-05-01 13:57:41 +00:00
enami
37ed68b3e4 Avoid null pointer dereference. 2001-05-01 06:17:23 +00:00
enami
d483a2c9e2 Fix whitespace usage (fow now, previously existing code only just due to
my time shortage):
- Use 8 column for basic indent.
- Use 4 space for 2nd level indent.
- Use tab instead of 8 spaces.
- Don't put space before function call operator.  That's unary operator.
- Wrap lines so that it fits in 80 columns.
2001-05-01 06:15:42 +00:00
jmc
5044375656 Wrap some variable definitions with #ifdef FW_DEBUG that only apply in debug mode. 2001-05-01 05:17:40 +00:00
jmc
f58c020bfc Remove some one-off debug printf's 2001-05-01 05:17:08 +00:00
jmc
af20295c95 Extend ieee1394_abuf to include read/write operations cleanly.
Add ieee1394_attach_args
Add sc1394_configrom_len
Add list links for nodelists from parent bus.
2001-05-01 04:48:11 +00:00
jmc
370ee1f0f0 Add a 64bit version of CSR_BASE 2001-05-01 04:48:10 +00:00
jmc
59c9536fe4 Add proc struct for kthread, interrupt handler flags, and nodelist 2001-05-01 04:48:10 +00:00
jmc
06dd6e0f40 Extensive changes from fwnode integration
Move interrupt routine to simply updating state flags and ack'ing interrupts
Move main processing into kthread
Change IPL level to IPL_BIO and try not to hold splbio very much if at all.
Add baseline support for attaching/detaching/updating fwnode's.
Start adding higher level API which isn't tied to if_fw/mbuf's
2001-05-01 04:48:10 +00:00
jmc
b44a25d8d6 Initial checkin for fwnode code. Needs extensive cleanup 2001-05-01 04:48:10 +00:00
jmc
cd6ceaf2cd Put in the structure for fwnode/fwscsi 2001-05-01 04:48:10 +00:00
jmc
59bde215a7 Initial checkin for fwnode support 2001-05-01 04:46:23 +00:00
jmc
46ebed2ee8 Initial checkin for fwnode support 2001-05-01 04:19:20 +00:00
jmc
b2230effa3 Doesn't need fwohci include's. Change struct device to ieee1394_softc. 2001-05-01 04:18:29 +00:00
jmc
1a5e77115a Place holder until real fwscsi code is fleshed out. 2001-04-30 09:06:27 +00:00
jmc
dfc69462fd First pass at the overall TODO list. Some of these may come off before I get the full code checked in even 2001-04-30 09:05:40 +00:00
jmc
98182717b8 Rework implementation notes/ideas with a more fleshed out example. 2001-04-30 09:02:38 +00:00
jmc
a2d52d0ed4 Add #define for 1394 ROM signature 2001-04-29 08:37:04 +00:00
thorpej
bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
jdolecek
372e5956ef Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
2001-04-11 07:42:31 +00:00
enami
fe99796a13 Make fwohci works on big endian cpu (e.g., powermac g4). 2001-03-15 23:01:33 +00:00
enami
bb839b38fa - Wrap long line.
- Consistently use #define<TAB> instead of #define<SPACE>.
2001-03-15 22:26:03 +00:00
onoe
9b1d7974ba make compilable again without FW_DEBUG. 2001-03-14 06:46:17 +00:00
onoe
e880c0b80b Fix to validate selfid buffer according to the OHCI spec.
1. read 'gen' from first quadlet of the buffer.
	2. raed selfid packets in the buffer.
	3. confirm 'gen' field of the SELFID register matches 1.
2001-03-12 23:39:35 +00:00
onoe
4536167cac Reinitialize context match register at fwohci_hw_init()
to receive asynchronous stream data after suspend/resume.
2001-03-12 23:36:09 +00:00
onoe
2cff6cf490 use OHCI_BITVAL(val, name), instead of
((val) & (name##_MASK)) >> name##_BITPOS
2001-03-12 23:27:53 +00:00
onoe
1c4a0d3428 change fw_verbose inside #ifdef FW_DEBUG
0) no verbose messages.
	1) print non-fatal errors, nodeid, unique ID for other nodes.
	2) extra printfs.
2001-03-12 23:22:37 +00:00
onoe
4cbaa2a213 show 16 byte ifaddr instead of EUI-64 at attach. 2001-03-03 02:21:26 +00:00
onoe
9ad90c81ef Do not require GUID ROM, which is optional according to the OHCI spec.
Use Global UID register as is, it should be initialized by firmware.
If it is not initialized (i.e. 0), try to read GUID ROM if exists.
On my VAIO PCG-N505AS, the version register says it implement GUID ROM,
but reading GUID ROM returns all zero bytes.  I'm not sure where the bug is.
2001-03-03 02:04:54 +00:00
onoe
f48ed8355a fix length calculation not to overrun in receiving packets around MHLEN. 2001-03-03 00:52:58 +00:00
lukem
3aeb5f2f29 whitespace police 2001-02-24 01:59:46 +00:00
thorpej
64778c5e5c XXX ALTQ (not done in 1394 layer yet). 2000-12-14 07:03:50 +00:00
enami
b31ace33b7 Add RCS Id. 2000-12-13 11:30:14 +00:00
thorpej
c5293456da Adapt to bpfattach() changes, and further centralize the bpfattach()
and bpfdetach() calls into link-type subroutines where possible.
2000-12-12 18:00:22 +00:00
enami
99a39489d8 Pass the right size of object (in this case, a trailer) to fwohci_buf_pktget.
Since the fp_trail is a pointer to trailer, we have to pass sizeof(*fp_trail)
instead of sizeof(fp_trail).
2000-11-30 06:59:08 +00:00
enami
a89beb967d Make this file compiles on alpha even if FW_DEBUG is defined. 2000-11-30 06:42:26 +00:00
enami
4792308b32 Pass the right max segment size to bus_dmamap_create. 2000-11-30 06:36:43 +00:00
takemura
3c9d9276dc Add new powerhook argument values, PWR_SOFTSUSPEND, PWR_SOFTSTANDBY and
PWR_SOFTRESUME. Apm calls powerhook with the values in normal interrupt
priority level while others are protected with splhigh().
2000-11-26 11:08:57 +00:00
onoe
2819c7b688 Use DMA from mbuf instead of copy in transmit.
Still use memcpy in receiving because we must use buffer fill mode
	and many packets may share single receive buffer.

XXX: Workaround(?) for CXD3222: it fails to DMA for selfid packet according
to code placement. I'm not sure about the reason (cache? timing? bug?).

Fixed the bug: transmitter sometimes stop and OACTIVE bit of if_fw
never be cleared.
Fixed the bug: freeing free buffer.

Enable ieee1394_drain and ieee1394_watchdog for loss of fragment.
2000-11-20 12:12:18 +00:00
matt
617742b256 Add a fwlynx device. Move the file for fwohci to files.ieee1394 2000-11-14 23:37:20 +00:00
onoe
f1c77e81db Add support for link fragmentation and reassemble for IEEE-1394.
XXX: drain is still not yet implemented, thus memory leak will occur
    in case of any of fragment lost.
2000-11-14 11:14:55 +00:00
enami
da071ce468 Remove lonely splx in fw_detach. 2000-11-10 03:45:09 +00:00
onoe
5b19fc8512 Add powerhook and shutdownhook to support Notebook.
Use PAGE_SIZE instead of OHCI_PAGE_SIZE for each DMA mem.
	OHCI_PAGE_SIZE(2kB) will be round up PAGE_SIZE, anyway.
	XXX: need more sophisticated way to manage buffer.
Clear IntEvent first not to lose SelfIDCompleted in multiple bus reset.
Be careful not to clear BusReset int event in SelfID duration to follow
the OHCI spec.
Initiate BusReset if selfid is not completed within 3sec after busreset.
2000-11-08 06:00:18 +00:00
onoe
5d7a16ff8c make it compilable with FW_DEBUG 2000-11-05 23:04:00 +00:00
matt
f0bd09f42d Merge in my some of my stuff. 2000-11-05 22:35:56 +00:00
jdolecek
0f1770e08d make compilable without FW_DEBUG 2000-11-05 19:43:32 +00:00
onoe
e83458422f First Prototype implementation of network interface part for IEEE1394 (if_fw).
Current status:
	Only OHCI chip is supported (fwohci).
	ping (IPv4) works with Sony's implementation (SmartConnect) on Win98.
	sometimes works but not stable.
Not implemented yet:
	IRM (Isochronous Resource Manager) functionality.
	Link layer fragmentation.
	Topology map.
More to do:
	clean ups
	MCAP
	charactor device part
	dhcp

There is no entry in GENERIC config file yet.
Follow sys/dev/ieee1394/IMPLEMENTATION to enable if_fw.
2000-11-05 17:17:12 +00:00
matt
28b0517c9c random thoughts on how i'm implementing this. 2000-05-31 03:42:34 +00:00
matt
ede7ab9361 Install ieee1394reg.h since user application (someday) will need it. 2000-05-30 22:52:02 +00:00
matt
e621957503 add more speeds (up to 3.2Gb/s) 2000-05-30 14:56:59 +00:00
augustss
b85fe33276 Make this file compile. (I know it's just a placeholder, but I couldn't
resist trying it.)
2000-05-30 08:31:57 +00:00
matt
e78793c612 Beginning of a IEEE 1394 framework. An attachment for PCI OHCI controllers
and bus-independent module that just begins to print things out.  No real
code behind it.  THIS IS A WORK IN PROGRESS.  The *reg.h are woefully
incomplete.
2000-05-30 06:56:13 +00:00