Commit Graph

422 Commits

Author SHA1 Message Date
imp
e9df6b7a14 All current uses of pci_set_powerstate are bogus, at least in theory.
However, they are presently necessary due to bigger bogusness in the
pci bus layer not doing the right thing on suspend/resume or on
initial device probe.  This is exactly the sort of thing that the
BURN_BRIDGES option was invented for.  Mark all of them as
BURN_BRIDGES.  As soon as I have the powerstate stuff properly
integrated into the pci bus code, I intend to remove all these
workarounds.
2003-07-03 14:00:57 +00:00
scottl
4d495abb9d Mega busdma API commit.
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
2003-07-01 15:52:06 +00:00
simokawa
7c05940aff Fix tsleep/wakup race on FreeBSD-4. 2003-07-01 12:03:54 +00:00
simokawa
fd6a432df0 Include file clean up. 2003-06-30 06:33:18 +00:00
simokawa
065a386bdc Fix several problems related to resume:
- 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.
2003-06-28 11:11:36 +00:00
simokawa
4f840cc67f - Use fwohci_poll() instead of fwohci_intr() to process the first bus reest.
- Wait 2 cycles before starting the process for fast machines.
2003-06-27 00:27:33 +00:00
simokawa
34a8115079 Bound check for broken Configuration ROM. 2003-06-16 08:43:22 +00:00
simokawa
d30e2638a5 Fix for big endian. 2003-06-16 08:29:24 +00:00
simokawa
b70380d374 Revert previos change for prior release/branch. 2003-06-16 03:44:36 +00:00
simokawa
34e694d8f5 - Enable support for building Configuration ROM.
- Improve probe message for S800 chips.
2003-06-15 04:09:26 +00:00
simokawa
28eeb9781f Fix crom_add_simple_text().
Bytewap Configuration ROM image.
2003-06-15 03:22:30 +00:00
simokawa
e89024c604 Add CSRVAL_VENDOR_PRIVATE. 2003-06-15 03:19:55 +00:00
simokawa
11be88d043 White space fix. 2003-06-15 00:17:38 +00:00
njl
ea1ca84312 Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by:	scottl
2003-06-14 22:17:41 +00:00
simokawa
7b62f180d5 Fix typo in the previous revision. 2003-06-10 12:08:58 +00:00
simokawa
d07e95246d Fix struct bus_info on big-endian machines. 2003-06-10 02:29:10 +00:00
simokawa
fae8fb052d Add tx_speed sysctl variable. 2003-06-10 02:27:39 +00:00
simokawa
ec49fe4651 Add id for TI's 1394b link chip. 2003-06-04 04:26:14 +00:00
simokawa
196e6d627e Don't call sbp_do_attach() recursively after agent reset
while device probing.
2003-06-03 23:01:43 +00:00
simokawa
402bb3520a Allocate zeroed space for fwdev. 2003-06-03 22:58:22 +00:00
simokawa
8c022bf81b Open fwmem device exclusively. 2003-06-03 22:52:55 +00:00
scottl
e2a13c1ed2 Remove the redundant declaration of bus_dmasync_op_t. 2003-05-27 16:34:52 +00:00
simokawa
6d94cd1e18 Make it compiled on 4-stable.
Approved by: re (scottl)
2003-05-12 00:42:28 +00:00
simokawa
2d4780fd3a - Use moderate gap counts listed in IEEE1394a.
- 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)
2003-05-11 10:32:20 +00:00
simokawa
d6a0f92ee3 Write to RESET_START register if TARGET_RESET ORB doesn't work for timeout. 2003-05-05 14:50:24 +00:00
simokawa
0e30d7422e Don't panic for FWXF_START state in fw_xfer_unload(). 2003-05-05 10:14:52 +00:00
jake
ffe5115e13 Fix printf format errors. 2003-05-02 17:21:07 +00:00
simokawa
f5248132d5 Fix printf warning caused by recent CAM change. 2003-05-01 03:38:04 +00:00
simokawa
b656a86ad5 Release devq before detach. 2003-04-30 10:32:32 +00:00
simokawa
592c5992f5 Set status to FWDEVINVAL if probe failed. 2003-04-30 10:20:24 +00:00
simokawa
c761300afa Add missing crom_next() in the previous revision. 2003-04-29 23:40:04 +00:00
simokawa
fb8a76f7b3 Set recv.len to zero if we get no response. 2003-04-29 15:02:34 +00:00
simokawa
a40d8c9bb0 Get correct firmware/model information for multiple unit directories. 2003-04-29 15:01:01 +00:00
simokawa
c911493bf1 Fix indentation. 2003-04-29 14:05:17 +00:00
simokawa
4e1e1a4c31 Move CSR definitions to iec*.h from firewirereg.h. 2003-04-29 13:27:13 +00:00
simokawa
beff3ce218 Make compiled on RELEGN_4 2003-04-28 03:12:16 +00:00
simokawa
b380739760 - Improve configuration ROM parser for multiple unit directory.
- Remove getcsrdata().
- Don't print device type, this can be obtained by fwcontrol.

Tested with: Maxtor 5000XT
Tested by: Daniel O'Connor <doconnor@gsoft.com.au>
2003-04-26 16:45:40 +00:00
simokawa
0998f1bbfe Fix printf warnings for i386 with PAE.
Submitted by: harti
2003-04-24 15:27:06 +00:00
simokawa
5f3a7ead43 Fix printf warning for RELENG_4. 2003-04-24 09:27:17 +00:00
simokawa
453509aad1 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
simokawa
bedf79949f Set the local bus address in xfer->dst.
Submitted by: Buzz Slye <buzz@gaia.arc.nasa.gov>
2003-04-22 02:31:31 +00:00
simokawa
980817bfc5 Remove unused code. 2003-04-21 16:41:20 +00:00
simokawa
29b43e58e3 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
mdodd
261178d14f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
simokawa
1cfbbefd6c Panic if bus_dmamap_load() doesn't respect maxsegsz. 2003-04-14 14:17:49 +00:00
simokawa
83afdb9439 - The payload of Write Request Quad must be network byte order. 2003-03-24 04:11:21 +00:00
simokawa
5a06ca07d7 - The payload of Write Request Quad and Read Response Quad must be
network byte order.
- Set ATRetries register after each bus reset because the value is 'undef'
	in OHCI spec.
2003-03-24 04:06:21 +00:00
simokawa
176bfd0826 Safe PCI configuration.
- Clear PCIM_CMD_MWRICEN:
	some chips seem to have problem with write invalidate.
	clearing this bit fixes SBP timeout problem.

Tested by: Michael Reifenberger <Michael.Reifenberger@Plaut.de>

- Set PCIM_CMD_SERRESPEN and PCIM_CMD_PERRESPEN
- Moderate value for latency timer.
2003-03-24 03:47:36 +00:00
simokawa
e63e5ae336 Clear channel and tag bits before set them.
This should fix the problem that if_fwe doesn't work after DV receiving.
2003-03-19 07:04:11 +00:00
simokawa
b3ae94d916 Put back including sys/devicestat.h for 4-stable. 2003-03-12 10:36:53 +00:00
phk
e01fc931cf Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.
2003-03-08 08:01:31 +00:00
simokawa
1b3633143f - improve timeout handling in fwmem.c
- stop processing of TX db if we reaches the end of active db.
2003-03-07 02:51:59 +00:00
simokawa
c00efc4a64 MFp4(simokawa_sbp)
Improve if_fwe performance.
- Simplify mbuf handling by using bulkxfer.
	Now, it uses mbuf clusters for RX buffer as usual ethernet drivers.
- Recycle struct xfer buffer and don't call malloc at runtime.
- Count input and output errors.
- Handle a mbuf chain longer than 6 correctly.
- Increase queue length.
2003-03-06 05:06:44 +00:00
simokawa
2a8b565223 Set ldesc after dbch->ndesc has initialized. 2003-03-05 01:50:57 +00:00
simokawa
0cd251e418 Fix printf warning on RELENG_4. 2003-03-04 06:47:17 +00:00
simokawa
303b5cebb7 Simplify ORB queue management.
Don't send doorbell and send ORB pointer only if it's necessary.
This reduces bus traffic and interrupts much.
2003-03-03 15:27:29 +00:00
phk
0ae911eb0e Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
simokawa
ba9b8f5cfc Defer allowing async. requests after self ID's have received.
This should fix some problem of SBP2 device probing.

Prior to rev 1.41, we keep writing the register while bus reset phase.
But in rev 1.41, we ignore successive bus reset events and some chips seem to
clear the register after we write to it.

Tested by: Michael Reifenberger <root@nihil.reifenberger.com>
2003-03-03 04:10:56 +00:00
phk
9dc0ca1650 Use canonical format for cdevsw initialization. 2003-03-02 18:51:46 +00:00
des
2756b6c964 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
simokawa
126aa198b3 Don't reset agent before processing OCB has done. 2003-03-01 16:50:40 +00:00
simokawa
15b70bcd2e MFp4(simokawa_sbp branch)
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.
2003-02-27 12:51:24 +00:00
mux
541937cf73 Cleanup of the d_mmap_t interface.
- 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
2003-02-25 03:21:22 +00:00
simokawa
bb54e155c8 Oops, forgot to put back debug level. 2003-02-21 02:27:13 +00:00
simokawa
ee8a893969 remove unused code. 2003-02-21 02:14:00 +00:00
simokawa
1c11426517 Fix typo
Submitted by: Masahiro Ito <m_itoh@mub.biglobe.ne.jp>
2003-02-21 02:09:39 +00:00
simokawa
b27f883037 Don't scan lun by myself while boot process leave it CAM to scan the bus.
Some drives seem to be confused by simultaneous probes.

Tested by: marcel

As a side effect, logical units whose lun is greater than 0 might not be
probed correctly if the lun of 0 doesn't exist in the target because
CAM doesn't scan such luns.
I have a SCSI-FireWire bridge which maps SCSI-ID to LUN and it is an
example of such targets.
2003-02-21 02:09:04 +00:00
imp
cf874b345d Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
simokawa
ccc0127ea3 Fix fwdev memory leak on detaching. 2003-02-18 10:56:00 +00:00
simokawa
9f3122a719 Use pci_get_devid(). 2003-02-18 10:01:44 +00:00
simokawa
c8473ad138 Add 'uPD72871/2 IEEE1394 1-Chip OHCI Host Controller'. 2003-02-18 09:46:52 +00:00
simokawa
3b267173bf * firewire.c
- Fix memory leak in detaching.
- Initialize fc->status to other than FWBUSREST.

* fwohci.c
- Ignore BUS reset events while BUS reset phase. We can't clear that flag
	during bus reset phase.
2003-02-18 09:39:48 +00:00
simokawa
4461b7347a * firewire.c
- Don't initiate bus reset even if probe failed for some nodes to prevent
	infinite bus reset loop.

Problem Reported by: Pierre Beyssac <pb@fasterix.frmug.org>

- Protect timeout routine with splfw() for 4-stable.

* sbp.c

- Make sure to release devq when start request.
2003-02-17 14:24:06 +00:00
simokawa
12452d3510 Protect calling fwohci_intr() with splfw() for 4-stable. 2003-02-15 01:25:39 +00:00
simokawa
40dca7e24f - Increase split transaction timeout from 2 sec to 6 sec.
Problem reported by: Michael Reifenberger <root@nihil.reifenberger.com>

- Improve debug message.
2003-02-15 00:54:10 +00:00
simokawa
698ee2e678 Clear the bus reset event flag as soon as possible after
the initialization has completed to start transactions even when
interrupt is disabled during the boot process.
2003-02-14 15:52:32 +00:00
simokawa
ee568cc79e - Though I got a feedback from the originator of kern/48129 that the
previous revision fixed the panic, I found the problem exits in
another part of the function by investigating the crom dump sent by him.
The search was started in the middle of bus info block and the
routine misunderstood the EUI64 as a crom entry. This problem is fixed.

PR: kern/48129

Fix incorrect type mask included in a logical unit number and check
the validity of the lun.
2003-02-14 03:09:59 +00:00
simokawa
cad5969811 firewire/fwohci
- Drain fwohci TX queue first then drain xfer queue which has not started.
- Check validity of the received packet length.
- Don't allocate too large buffer for xfer receive buf.

sbp
- Fix panic for some CROM which doesn't have a text leaf.
	This could fix the PR kern/48129 but no feedback has been gotten from
	the originator yet.
- Put back some M_NOWAIT flags into malloc which could be called
	in interrupt context for 4-stable.
2003-02-13 13:35:57 +00:00
simokawa
d40dbd1c8c Increase atrq.ndesc for if_fwe. 2003-02-09 17:11:55 +00:00
simokawa
51e766f699 Add new ioctl to specify target EUI64 for fwmem. 2003-02-09 10:14:22 +00:00
simokawa
36ad849baa Remove unnecessary check for OCB_ACT_CMD. 2003-02-09 07:40:27 +00:00
simokawa
edadda996a - Detect split transcation timeout.
* 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.
2003-02-09 07:16:01 +00:00
simokawa
fc5f5fef96 Remove debug message. 2003-02-07 09:46:30 +00:00
simokawa
65fd97f7e7 Fix memory leak. 2003-02-06 17:23:01 +00:00
simokawa
a2b80d2be8 Fix for fwmem write part.
- fix typo
- don't need to check receive buffer.
- don't forget to free xfer on errer.
2003-02-05 17:19:34 +00:00
simokawa
ef78581d72 - Implement write part.
- Use quad access for aligned 4 byte access.
2003-02-04 17:09:59 +00:00
simokawa
485435e319 - Improve recovery after timeout.
* reset agent first then reset target.
	* untimeout all ccbs.
- Try reconnect first if the device has been seen.
- Fix for ORB_FUN_ATA.
2003-02-04 17:08:45 +00:00
simokawa
57fd1b57b9 Remove unnecessary M_NOWAIT. 2003-02-03 09:41:42 +00:00
simokawa
d15a58ad27 Add missing 'static'. 2003-02-03 08:10:50 +00:00
simokawa
afb9eb67e2 - Take malloc type as an argument in fw_xfer_alloc().
- 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().
2003-02-03 07:33:31 +00:00
simokawa
1071276d73 Define new malloc type M_FW and use it. 2003-02-01 15:04:33 +00:00
simokawa
5790015ee5 - replace timeout with callout_*.
- replace TAILQ with STAILQ for device list.
- some clean up.
2003-02-01 14:42:49 +00:00
simokawa
1c5753d03f Check status FIFO more closely to report error. 2003-02-01 12:06:57 +00:00
simokawa
095827745e Add basic support for device wiring down to specific (CAM)
target id. It still needs to be hard-coded now but will
be changed to be configured by tunables or device hints.
2003-02-01 08:55:33 +00:00
simokawa
551f94c8c8 Sort device list by eui64 in acendent order correctly. 2003-02-01 06:34:36 +00:00
simokawa
bfede02c1b function name change. 2003-01-31 14:14:45 +00:00
simokawa
30013fce11 SBP related changes.
- Issue LOGOUT command on detach and shutdown.
- Rename some functions.
2003-01-31 14:11:22 +00:00
simokawa
2088790fbc SBP related changes.
- Set dual phase retry BUSY_TIMEOUT.
- Let users to know serial bus error.
2003-01-31 03:09:13 +00:00
simokawa
af62f90cdb Restart cycle master after bus manager election.
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().
2003-01-30 05:18:35 +00:00
simokawa
90073e85da - Handle SCSI_STATUS_BUSY case. 2003-01-30 05:12:56 +00:00
simokawa
7a73a2b78e - Probe number of IT/IR DMA contexts as specified in OHCI spec. 2003-01-29 15:32:35 +00:00
simokawa
0a3c80b382 - Fix build on alpha.
- Add a missing newline in printf.
2003-01-29 02:13:31 +00:00
simokawa
e62202f284 - Allow multiple packets read/write for IR/IT to reduce system call.
- Remove unused variables.
2003-01-28 15:09:07 +00:00
simokawa
d3dc53e828 - Split db.desc.cmd into desc.control and desc.reqcount.
- remove unncessary descriptor updates.
2003-01-26 18:38:06 +00:00
simokawa
376bd949e0 - Improve IT/IR DMA queue management.
- Improve debug message for mbuf handling.
- Wait 1 sec for DMA stop in fwohci_i{t,r}x_disable() before freeing buffers.
2003-01-26 15:39:04 +00:00
simokawa
ea028a97ec Change API of FW_GDEVLST ioctl.
- include information about itself.
- define struct fw_devinfo and use it in struct fw_devlstreq.
- unify EUI64 representation using struct fw_eui64.
2003-01-25 14:47:33 +00:00
simokawa
0a0fee3fac Remove FW_SSTDV ioctl. It is not used anymore. 2003-01-24 13:03:19 +00:00
simokawa
14df48f995 Merge little and big endian case. 2003-01-24 12:45:19 +00:00
simokawa
b4946c8e83 - Add sysctl knob for bus manager. (hw.firewire.try_bmr)
- Check invalid SID length.
- Add some debug messages.
2003-01-23 13:34:40 +00:00
simokawa
8f2916a747 Define misc structs outside of struct firewire_comm. 2003-01-21 16:37:01 +00:00
simokawa
a43a378645 Ignore events of unused IR DMA. 2003-01-21 16:24:35 +00:00
alfred
bf8e8a6e8f Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
simokawa
5dc188b5c1 Replace M_DONTWAIT with M_NOWAIT for malloc().
Pointed out by: nate@root.org
2003-01-17 15:15:21 +00:00
simokawa
48e65aa188 Improve some debug massages. 2003-01-17 15:03:57 +00:00
simokawa
ccf87bc3ad Fix bus manager election process.
- Lock response 0x3f means that the host becomes the bus manager.
- Add missing htonl().
2003-01-17 15:03:25 +00:00
simokawa
a03e3d2538 Detect underrun of IT queue for debugging.
Add some comments.
2003-01-17 03:52:48 +00:00
simokawa
873e3b0a11 Improve memory allocation.
- Don't use contigmalloc() and allocate page by page to avoid
	allocation failure.
- allocate buffer by PAGE_SIZE.
2003-01-16 13:09:33 +00:00
simokawa
cd674b5595 Use cycleMatch for precise IT DMA start timing. 2003-01-16 07:01:54 +00:00
simokawa
f2b7de2a4e DV_PAL shouldn't be here. 2003-01-15 05:28:50 +00:00
simokawa
def6259292 Add DV_PAL for PAL users. 2003-01-15 05:26:23 +00:00
simokawa
424853c487 Fix IT DMA underun while bus reset.
- Reduce number of DELAY's
2003-01-15 04:21:16 +00:00
simokawa
d92ba29c91 Fix for FreeBSD-4.
- Protect whole fw_tbuf_update() with splfw().
2003-01-14 08:35:45 +00:00
simokawa
7ad0cf189a Minimal fix for DV part.
- Don't panic on contigmalloc failure.
- Calculate timestamp by feedforward rather than feedback which depends on
	unreliable interrupt timing.
- Overwrite timestamp in CIP header correctly.
- Add debug code for timestamp synchronization.
- Add comments.
2003-01-13 16:08:09 +00:00
simokawa
6aefd6f566 Merge big endian and little endian case.
Fill fdf bit fields and others.
2003-01-13 15:08:48 +00:00
simokawa
212d0ee2a6 - Add error messages for bulkxfer.
- Reduce register access.
2003-01-09 10:25:07 +00:00
simokawa
b41e588b14 - Fix print format for FreeBSD-4
- Reduce debug message.
2003-01-07 12:58:08 +00:00
simokawa
c771fcdd61 Don't call fw_bus_probe() twice when successive self-id packets received.
This change should stabilize SBP-II device probing.
2003-01-07 04:26:45 +00:00
simokawa
7d45be69e1 Use device_printf() and s/fc->dev/fc->bdev/. 2003-01-06 08:07:20 +00:00
simokawa
dc45c76582 Fix fc->dev to fc->bdev. 2003-01-06 05:57:48 +00:00
simokawa
36f295a49d Reduce diff to RELENG_4. 2003-01-05 14:58:45 +00:00
simokawa
c5a72d1412 Syntax fix in fwohci_pci_suspend(). 2003-01-05 09:12:47 +00:00
simokawa
0e54246592 - Change definition of fc->maxrec same as fwdev->maxrec.
- 'spec' and 'ver' are attributes of a unit rather than a node.
- Report Phy and Link info separatelly.
- Reorder intialization step in fwohci_reset().
2003-01-05 06:21:30 +00:00
simokawa
f1c859a3c5 - 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
simokawa
f588520584 - Handle zero sized directory right way.
- Staticize.
2003-01-04 10:32:31 +00:00
simokawa
add68c49b8 - Replace printf() with device_printf().
- Separate fc->dev (i.e. fwohci0) and fc->bdev (i.e. firewire0).
- Remove unused firewirebusreg.h.
- Reduce size of descriptor block for asynchronous transmit and
	check the number of descriptor when copying from mbuf.
- Skip mbuf whose length is zero. NFS seems passing such mbuf and
	some chips generates unrecoverable error.
2003-01-04 10:21:11 +00:00
simokawa
5914915190 - Propagate suspend/resume to child devices.
- Restore pci config registers after resume.
- Reinitialize and start rx buffers after resume.
- Don't reallocate memory in fwohci_db_init() if the dbch is
	already initialized.
- Fix typo.
- Some clean up.
2003-01-04 06:40:57 +00:00
simokawa
f938a61829 Experimental support for suspend/resume, not finished yet. 2003-01-01 08:25:32 +00:00
simokawa
7f7b3dea2b Reduce debug message. 2003-01-01 08:22:29 +00:00
simokawa
230497406e - Retry phy access when the wait-loop count is exhausted.
- Free allocated memory when detaching.
- Detect contigmalloc failure.
2003-01-01 04:23:54 +00:00
simokawa
5241028c0c Fix and add several device IDs. 2002-12-31 13:43:44 +00:00
simokawa
11e84e3552 - Implement primal Configuration ROM parser.
- Support multiple LUNs for SBP-II.
2002-12-31 10:28:49 +00:00
simokawa
8e3722443a Improve error checking of phy access and retry when error occurs. 2002-12-31 10:00:36 +00:00
simokawa
996afb0c07 - Add more CSR related definitions (IEEE-1212).
- Fix struct csrtext's spec fields.
- Add prototypes of upcoming configuration ROM related functions.
2002-12-30 09:41:32 +00:00
simokawa
2403926428 Cosmetic change. s/Firewire/FireWire/. 2002-12-26 06:50:09 +00:00
simokawa
e90de498fd Replace ntohl() with ntohs() because orb_hi is u_int16_t. 2002-12-26 06:41:37 +00:00
simokawa
7020b89b47 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
simokawa
9c9831e97c Reduce and improve debug messages.
Approved by: re
2002-12-06 02:17:30 +00:00
sam
14c32b5f40 network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re
2002-11-14 23:54:55 +00:00
simokawa
36297badba - Add fwmem_xfer_req() and use this in other functions. 2002-11-12 17:19:21 +00:00
simokawa
8595cb5b46 - Remove unused code.
- Fix style.
2002-11-12 17:16:20 +00:00
simokawa
86aed55239 fix wording. 2002-11-12 17:11:32 +00:00
simokawa
b445a4b51a Split userland services to fwdev.c. 2002-11-12 15:22:19 +00:00
simokawa
f4a7469d8f Use struct fw_device in fwmem.c
- specify fwmem target by EUI64.
- fw_noderesolve returns struct fw_device rather than dst.
- include struct firewire_comm in struct fw_device.
2002-11-12 13:49:17 +00:00
simokawa
6262082ff1 Add a prototype for suspend/resume. 2002-11-12 13:46:09 +00:00
simokawa
7c6dbbe64b Change interface of fwmem_read_*() functions to be usable from other part
of the module.
2002-11-12 11:15:01 +00:00
simokawa
664569e8ec Change interface of fwmem_read_*() functions to be usable from other part
of the module.
2002-11-12 11:08:50 +00:00
simokawa
3b7ac3a4f9 - clean up 2002-11-12 10:02:50 +00:00
simokawa
faf37223df - Remove unused code.
- Style fixes.
2002-11-12 05:52:01 +00:00
simokawa
af05a61150 Restrict process count in fwohci_arcv() and fwohci_ircv(). 2002-11-12 04:54:30 +00:00
simokawa
2d6271e925 - Fix printf warnings on 64bit plathome.
- Disable fw_vmaccess() because it's not used and unuseful 64bit plathome.
2002-11-07 02:13:40 +00:00
simokawa
e6dea8f633 Minor clean up on cdb handling. 2002-11-06 15:34:52 +00:00
simokawa
58b83e0c52 - Let the PCI code try to route interrupt in -current
- Print warning in -stable.
2002-11-06 04:07:05 +00:00
simokawa
0c6061a847 Sony CXD3222 OHCI i.LINK chips needs more DELAY before starting SCLK
when no devices are connected.
2002-11-05 02:42:28 +00:00
simokawa
97ccd4c7eb - Dequeue OCBs more safely in sbp_abort_all_ocbs(). 2002-10-23 13:04:02 +00:00
simokawa
ee934c85cb - Abort all OCBs for timeout.
- Improve warning message.
2002-10-21 15:36:59 +00:00
simokawa
7228ba2873 fix prototype of asyreqq(). 2002-10-21 10:21:49 +00:00
simokawa
b52cd7f4bd These (userland) files shouldn't be here. 2002-10-21 10:14:26 +00:00
jhb
af2f721bc3 This file doesn't need opt_bus.h. 2002-10-14 19:11:19 +00:00
simokawa
1b553b95de don't include bus_dma.h which doesn't need. 2002-09-21 15:05:22 +00:00
simokawa
f47d65ab2d remove unused code. 2002-09-21 14:48:07 +00:00
ikob
da2ba83f7b Firewire device support for Apple eMac with PPC kernel.
Contributed by Peter Grehan <grehan@freebsd.org>
2002-09-17 12:50:43 +00:00
ikob
5941256529 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