Commit Graph

389 Commits

Author SHA1 Message Date
Warner Losh
4143dbe3ea The Sony i.LINK CXD1947 device is a firewire bridge, but it doesn't
implement the OHCI programming interface.  Thus it probes, but fails
to attach because of an invalid OHCI version.  Rather than count on
the downstream tests properly failing, print a message that this
chipset isn't supported and fail the probe.
2005-07-17 19:59:07 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +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
Poul-Henning Kamp
f4f6abcb4e Explicitly hold a reference to the cdev we have just cloned. This
closes the race where the cdev was reclaimed before it ever made it
back to devfs lookup.
2005-03-31 12:19:44 +00:00
Sam Leffler
b083b7c98d fix potential null ptr deref
Submitted by:	Coverity Prevent analysis tool
2005-03-29 01:44:59 +00:00
Warner Losh
538565c4a5 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
Hidetoshi Shimokawa
e726a7e116 Clear PCIM_CMD_SERRESPEN and PCIM_CMD_PERRESPEN for broken hardware.
Some amd64 laptops fail to boot with these flags.

PR: kern/75482
2005-01-06 07:40:34 +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
John-Mark Gurney
d17d400489 return after freeing data element, instead of falling through, and using
the free'd element, and ultimate NULL deref of the failed allocation.

MFC after:	1 week
2005-01-04 18:15:27 +00:00
Hidetoshi Shimokawa
0fd466727c Fix malloc type in free(). 2004-11-10 06:21:47 +00:00
Hidetoshi Shimokawa
fcbe55a58d Respect _BOOT flag. 2004-10-22 15:39:39 +00:00
Hidetoshi Shimokawa
e794746d65 Add a missing splx(). 2004-09-06 20:42:34 +00:00
Hidetoshi Shimokawa
ce7bda463c Remove an unused variable. 2004-08-29 13:45:55 +00:00
Robert Watson
83bcc8bda0 Assert Giant in fwe_start(), as it is not yet MPSAFE. 2004-08-18 04:54:54 +00:00
Robert Watson
a1755216cf Since if_fwip doesn't contain locking or run with INTR_MPSAFE, mark
the interface as IFF_NEEDSGIANT so if_start is run holding Giant.

Approved by:	dfr
2004-08-13 23:09:41 +00:00
Robert Watson
52bc12b3da Set IFF_NEEDSGIANT for fwe network interface since the firewire
framework isn't yet MPSAFE.

Approved by:	simokawa
2004-08-12 03:02:16 +00:00
Hidetoshi Shimokawa
433dd56b71 Fix and add deivce ID's.
Obtained from: DragonFly BSD
2004-08-04 12:18:39 +00:00
Alexander Kabaev
eec256de79 Avoid casts as lvalues. 2004-07-28 06:21:53 +00:00
Doug Rabson
2f8e2ebbe2 Temporary fix for interoperability with Windows and OS X. A more complete
fix will follow when its ready.

Submitted by: simokawa
2004-07-20 08:58:27 +00:00
Hidetoshi Shimokawa
f9d9941f2d Don't output too many debug messages for bootverbose.
This driver seems to be fairly stable now.
2004-07-20 04:49:44 +00:00
Hidetoshi Shimokawa
f77993e5e0 Initialize ifp->if_output for FreeBSD-4. 2004-07-20 04:29:33 +00:00
Hidetoshi Shimokawa
af21fc1195 Adjust packet length correctly for FreeBSD-4.
Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
2004-07-20 03:56:23 +00:00
Hidetoshi Shimokawa
6e2b0d0b25 Add some PCI IDs for OHCI chips.
Obtained from: DragonFly BSD
2004-07-17 09:41:20 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
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".
2004-07-15 08:26:07 +00:00
John Baldwin
39981fed82 Trim a few things from the dmesg output and stick them under bootverbose to
cut down on the clutter including PCI interrupt routing, MTRR, pcibios,
etc.

Discussed with:	USENIX Cabal
2004-07-01 07:46:29 +00:00
Warner Losh
794950069f Remove the setting of the pci config variables on power state changes.
The bus does this now.
2004-06-28 20:26:21 +00:00
Hidetoshi Shimokawa
e1ebf69098 Fix the description of hw.firewire.sbp.exclusive_login.
Submitted by: KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
2004-06-18 08:02:49 +00:00
Poul-Henning Kamp
f3732fd15b Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Doug Rabson
c2216c0ac6 Fix spelling. 2004-06-15 16:03:49 +00:00
Doug Rabson
ee2f2ccc2f If we run out of transmission labels, just re-queue the packet for later
instead of printing endless error messages on the console and discarding
the packet.
2004-06-14 09:34:20 +00:00
Doug Rabson
04fa3b29f5 Add configuration rom entries for IP over firewire. 2004-06-13 13:58:00 +00:00
Doug Rabson
b8b3323469 Add a new driver to support IP over firewire. This driver is intended to
conform to the rfc2734 and rfc3146 standard for IP over firewire and
should eventually supercede the fwe driver. Right now the broadcast
channel number is hardwired and we don't support MCAP for multicast
channel allocation - more infrastructure is required in the firewire
code itself to fix these problems.
2004-06-13 10:54:36 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Doug Rabson
7b1f628606 Don't try to copy out the result payload if there isn't one. This ioctl
interface really needs changing to split out the various async request
types.
2004-05-23 18:43:44 +00:00
Maxime Henrion
866a788cc2 We don't need to initialize if_output, ether_ifattach() does it
for us.
2004-05-23 16:11:53 +00:00
Doug Rabson
c0e9efacfe Initialise OHCI_CROMHDR and OHCI_BUS_OPT in fwohci_ibr to make sure that
they have the right values at the first bus reset.
2004-05-23 14:22:11 +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
Yaroslav Tykhiy
7560265c18 Mark the capability of this driver to receive VLAN frames >1500 bytes
as initially active in if_capenable since it is always on.

Reviewed by:	simokawa
2004-05-21 17:11:34 +00:00
Doug Rabson
95a2495411 Fix spelling. 2004-05-21 09:12:07 +00:00
Doug Rabson
c59285296e Don't use the node id as an index into the topology map. This breaks
if a node on the bus has more than three ports (like my cheapo six
port hub).
2004-05-16 11:26:39 +00:00
Hidetoshi Shimokawa
10d3ed6459 MFp4: FireWire
* 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.
2004-03-26 23:17:10 +00:00
Hidetoshi Shimokawa
a832f947f3 Fix a bug introduced in rev 1.33(mega API change).
Because xfer->send.payload is a pointer to the buffer, '&' shouldn't be there.

Submitted by: John Weisgerber <weisgerberj@gsilumonics.com>
PR: misc/64623
2004-03-24 01:29:08 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Colin Percival
a333b323e1 Check that xfer != NULL before dereferencing it, not after.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 01:10:11 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +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
b180671ce4 Use device_identify and bus_add_child methods to add a firewire
bus on fwohci. This should fix attach failure caused by a race
between firewire and fwochi initialization for the kernel module.
2004-01-30 14:28:11 +00:00
Hidetoshi Shimokawa
1398a889e6 * fwohci_pci.c
Improve error message for attach failure.

* sbp_targ.c
	- Add speed in struct sbp_targ_login.
	- Remove unnecessary htonl().
2004-01-23 17:37:09 +00:00
Hidetoshi Shimokawa
4c790222f6 Add missing free() in exception handlers.
Reported by:    Stanford Metacompilation research group
2004-01-22 14:41:17 +00:00
Hidetoshi Shimokawa
480878299e Sync type of linkspeed with firewire.c. 2004-01-11 15:40:42 +00:00
Hidetoshi Shimokawa
11fe249262 * firewire
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.
2004-01-08 14:58:09 +00:00
Hidetoshi Shimokawa
d09a5d6fce Remove __P(). 2004-01-06 14:30:47 +00:00
Hidetoshi Shimokawa
c3e840a89b Fix register mis-alignment introduced in rev1.12. 2004-01-06 14:24:01 +00:00
Hidetoshi Shimokawa
5b50d9ade7 MFp4:
* 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.
2004-01-05 14:21:18 +00:00
Peter Wemm
a89ec05e3e Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
2003-12-23 02:36:43 +00:00
Hidetoshi Shimokawa
c54d1fe2bd Fix panic.
- Don't call sbp_targ_status_FIFO() twice for LOGIN error.
- Don't access login if it's NULL.
2003-12-13 15:33:45 +00:00
Hidetoshi Shimokawa
a73ff5105c MFp4:
- Introduce sbp_targ_login instead of sbp_targ_istate.
- Implement reconnection and logout.
- Freeze simq while bus reset.
2003-12-11 03:42:40 +00:00
Warner Losh
347934fa63 Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in.  While they should be
unnecessary, they appear to be sometimes necessary.

Reviewed in concept: dfr
Approved by: re (scottl@)
2003-11-28 05:28:29 +00:00
Hidetoshi Shimokawa
86224a5746 Add tunables. 2003-11-13 06:29:40 +00:00
Hidetoshi Shimokawa
39b2899f54 Improve debug message. 2003-11-12 04:06:21 +00:00
Hidetoshi Shimokawa
4a4bfb088e - Reserve a ocb for management ORB.
- Requeue XPT_SCSI_IO if ocb is short.
2003-11-12 03:45:10 +00:00
Hidetoshi Shimokawa
5414e3cfad Oops, fix typo in my name. 2003-11-12 03:29:57 +00:00
Hidetoshi Shimokawa
9b86b36df8 Reduce debug message. 2003-11-10 14:04:37 +00:00
Hidetoshi Shimokawa
4a431baa58 * Improve sbp device probe in boot process.
- Notify BUS RESET to CAM in sbp_attach().
	- Use last bus reset time to determine login delay.

Tested by: imura

* Add some sysctl MIB and tunables.
2003-11-10 03:51:23 +00:00
Seigo Tanimura
512824f8f7 - Implement selwakeuppri() which allows raising the priority of a
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
2003-11-09 09:17:26 +00:00
Hidetoshi Shimokawa
132e28bd75 Allow shared open of /dev/fwmem* for read-only. 2003-11-07 12:39:39 +00:00
Hidetoshi Shimokawa
3a927c871a Respect a return code of fwmem_open(). 2003-11-07 12:30:57 +00:00
Hidetoshi Shimokawa
30177c8168 Increase FWMAXQUEUE up to 128. 2003-11-07 09:01:41 +00:00
Hidetoshi Shimokawa
34ea46a73b Add compatibility for 4-stable.
Submitted by: imura
2003-11-07 08:59:35 +00:00
Hidetoshi Shimokawa
ed32ba839e Use if_printf() for FWEDEBUG. 2003-11-06 04:19:15 +00:00
Hidetoshi Shimokawa
5e7c89e488 - Change driver name to fix if_xname breakage in the previous revision.
- Don't call device_get_unit() twice.

Tested by: nork
2003-11-03 13:01:23 +00:00
Doug Rabson
0be389f3ca Remove explicit cardbus attachments from drivers where this is identical
to the pci attachment. Cardbus is a derived class of pci so all pci
drivers are automatically available for matching against cardbus devices.

Reviewed by: imp
2003-11-03 09:22:18 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Hidetoshi Shimokawa
97b70925d0 Add a new sysctl MIB to control exclusive login. 2003-10-31 12:05:55 +00:00
Hidetoshi Shimokawa
ff04511e01 Reject too large OHCI version number.
Invalid OHCI version indicates OHCI registers are not mapped
correctly in PCI or CardBus layer.
2003-10-31 05:05:12 +00:00
Hidetoshi Shimokawa
b2d0deb2ce Add a compatibility macro for FreeBSD-4. 2003-10-31 04:58:03 +00:00
Hidetoshi Shimokawa
65290832bd Fix fwmem_strategy() race in 4-stable. 2003-10-25 15:05:59 +00:00
Hidetoshi Shimokawa
a4468d6352 Move validity check of 'xfer->fc != NULL' to right place. 2003-10-25 15:04:49 +00:00
Hidetoshi Shimokawa
102ebc1f95 Fix for FW_ASYREQ.
- set send.pay_len correctly.
- copy response only if needed.
- remove unnecessary 'err = 0'.
2003-10-24 13:55:51 +00:00
Hidetoshi Shimokawa
ad5c39fe2a Don't check timeout just after booted.
Some transactions could be considered wrongly to be timeout
bacause interrupts are disabled during boot process.
2003-10-24 07:42:21 +00:00
Hidetoshi Shimokawa
61ba65809d Reduce debug messages. 2003-10-23 01:55:03 +00:00
Hidetoshi Shimokawa
e9e688e243 Add SBP-II target mode driver.
Though this is still incomplete and has some missing features such as
exclusive login and event notification, it may be enough for someone
who wants to play with it.

This driver is supposed to work with firewire(4), targ(4) of CAM(4)
and scsi_target(8) which can be found in /usr/share/example/scsi_target.
This driver doesn't require sbp(4) which implements initiator mode.

Sample configuration:

Kernel: (you can use modules as well)
device	firewire
device	scbus
device	targ
device	sbp_targ

After reboot:
# mdconfig -a -t malloc -s 10m
md0
# scsi_target 0:0:0 /dev/md0
(Assuming sbp_targ0 on scbus0)

You should find the 10MB HDD on FreeBSD/MacOS X/WinXP or whatever connected
to the target using FireWire.

Manpage is not finished yet.
2003-10-18 05:41:31 +00:00
Hidetoshi Shimokawa
5217c8c293 - Call sbp_reset_start() for mgm timeout.
- Change type of target->luns to allocate an array of LUNs dynamically.
	This allows targets to change their number of LUNs after each bus reset.
- Serialize ORB POINTER command for each LUN.
- Improve debug messages.
2003-10-18 04:59:47 +00:00
Hidetoshi Shimokawa
bdc0dba68b - Introduce hw.firewire.hold_count sysctl MIB by popular demand.
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.
2003-10-06 07:17:43 +00:00
Hidetoshi Shimokawa
cb987496a3 - Implement sbp_poll() to enable kernel dump on SBP-2 device. 2003-10-06 05:40:47 +00:00
Hidetoshi Shimokawa
baaf74b248 - Fix timeout for unodered excution.
In unodered excution case, we cannot detect link-chain end only
	by prev == NULL if lastest ORB is executed earlyer than the former
	ORBs. Use ORB_LINK_DEAD flag for this case.

- Don't reset agent for management ORB.
- Improve debug messages.

Spotted by: sbp target mode
2003-10-06 03:44:37 +00:00
Hidetoshi Shimokawa
c44a734c56 Remove wrong usage of BUF_REFCNT().
Spotted by: phk
2003-10-02 14:33:30 +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
c727011a76 Fix a bug in fwdev_clone().
Spotted by: grog
2003-10-01 06:04:30 +00:00
Hidetoshi Shimokawa
aed9eb791a Phy register map. 2003-09-25 09:27:05 +00:00
Hidetoshi Shimokawa
16acf1a3f1 Fix byte order of multi-byte scsi_status information. 2003-08-29 13:36:17 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Hidetoshi Shimokawa
2109dbc4e5 Make this compiled on RELENG_4. 2003-08-22 07:33:20 +00:00
Hidetoshi Shimokawa
1a75370022 Comment out verbose debug messages. 2003-08-22 07:30:41 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Hidetoshi Shimokawa
7e711d0d8d Include order bit in sdev->type. 2003-08-21 08:40:31 +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
Hidetoshi Shimokawa
98b8dc587d Remove unused code. 2003-08-19 08:59:07 +00:00
Hidetoshi Shimokawa
29b187dc39 Drop too short packets. 2003-08-19 08:50:35 +00:00
Hidetoshi Shimokawa
f9c8c31d33 Allow to access phy registers via ioctl(). 2003-08-19 08:47:49 +00:00
Hidetoshi Shimokawa
f40a29157e Validate number of iso. DMA channels. 2003-08-12 13:01:27 +00:00
Hidetoshi Shimokawa
a160e00e41 Change device name notation.
- /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.
2003-08-05 03:11:39 +00:00
Hidetoshi Shimokawa
183498934b - Don't mess with TX queue in fwohci_stop() if we failed to attach the device.
Tested by: wilko

- Detect memory mapping failure of registers by checking OHCI version.

Tested by: KONDOU, Kazuhiro <kazuhiro@alib.jp>
2003-08-04 05:43:02 +00:00
Hidetoshi Shimokawa
9925de2808 Workaround for gcc on alpha/ia64.
(warning: `xferq' might be used uninitialized in this function)
2003-08-01 17:19:12 +00:00
Hidetoshi Shimokawa
6cada79a78 Clean up fwdev.
Allocate iso DMA channel dynamically.  This allows us to have more
/dev/fw* than number of DMA channels for asyn. transactions and etc.
2003-08-01 04:51:21 +00:00
Hidetoshi Shimokawa
3722fcec4b - Disable faking T_DIRECT as T_RBC because we have PIM_NO_6_BYTE now. 2003-08-01 02:24:39 +00:00
Hidetoshi Shimokawa
6a3f229e17 - Detect full of DMA channel correctly. 2003-08-01 02:13:25 +00:00
Nate Lawson
1deac58179 Add a PATH_INQ flag, PIM_NO_6_BYTE, which indicates the SIM never wishes to
receive 6 byte commands.  Add a check for this flag to da(4) and cd(4) so
that they honor it.  This is a quick workaround for many devices (especially
USB) that require da(4) quirks to operate.  The more complete approach is
to finish the new transport code which will be aware of the SCSI version a
transport implements.

MFC after:	1 day
2003-07-28 06:15:59 +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
9547314f7c Clean up include files. 2003-07-18 14:31:16 +00:00
Hidetoshi Shimokawa
086a638ef6 Add some debug messages. 2003-07-18 05:28:30 +00:00
Hidetoshi Shimokawa
d7e486b41d Allow retrieval of local Configuration ROM. 2003-07-12 09:34:44 +00:00
Hidetoshi Shimokawa
4d4e204a98 Configuraiton ROM fix:
- 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.
2003-07-09 13:07:35 +00:00
Hidetoshi Shimokawa
4f93346871 Add compatibility for FreeBSD-4. 2003-07-04 14:04:41 +00:00
Warner Losh
fa4b32fa80 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
Scott Long
f6b1c44d1f 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
Hidetoshi Shimokawa
2c56e6e419 Fix tsleep/wakup race on FreeBSD-4. 2003-07-01 12:03:54 +00:00
Hidetoshi Shimokawa
170e7a20d0 Include file clean up. 2003-06-30 06:33:18 +00:00
Hidetoshi Shimokawa
630529ad1e 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
Hidetoshi Shimokawa
740b10aaa9 - 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
Hidetoshi Shimokawa
88e7cb59f4 Bound check for broken Configuration ROM. 2003-06-16 08:43:22 +00:00
Hidetoshi Shimokawa
e47e35e61b Fix for big endian. 2003-06-16 08:29:24 +00:00
Hidetoshi Shimokawa
0d3432eca7 Revert previos change for prior release/branch. 2003-06-16 03:44:36 +00:00
Hidetoshi Shimokawa
0bc666e09b - Enable support for building Configuration ROM.
- Improve probe message for S800 chips.
2003-06-15 04:09:26 +00:00
Hidetoshi Shimokawa
b83977f0a4 Fix crom_add_simple_text().
Bytewap Configuration ROM image.
2003-06-15 03:22:30 +00:00
Hidetoshi Shimokawa
19fc8e7c05 Add CSRVAL_VENDOR_PRIVATE. 2003-06-15 03:19:55 +00:00
Hidetoshi Shimokawa
ec3fab0e0c White space fix. 2003-06-15 00:17:38 +00:00
Nate Lawson
2813692cc2 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
Hidetoshi Shimokawa
0b1739465d Fix typo in the previous revision. 2003-06-10 12:08:58 +00:00
Hidetoshi Shimokawa
97aad8deb4 Fix struct bus_info on big-endian machines. 2003-06-10 02:29:10 +00:00
Hidetoshi Shimokawa
efd4a0c1ec Add tx_speed sysctl variable. 2003-06-10 02:27:39 +00:00
Hidetoshi Shimokawa
3be95df6a0 Add id for TI's 1394b link chip. 2003-06-04 04:26:14 +00:00
Hidetoshi Shimokawa
de7f8045e0 Don't call sbp_do_attach() recursively after agent reset
while device probing.
2003-06-03 23:01:43 +00:00
Hidetoshi Shimokawa
df7898b895 Allocate zeroed space for fwdev. 2003-06-03 22:58:22 +00:00
Hidetoshi Shimokawa
1bba1572a0 Open fwmem device exclusively. 2003-06-03 22:52:55 +00:00
Scott Long
bf423d4637 Remove the redundant declaration of bus_dmasync_op_t. 2003-05-27 16:34:52 +00:00
Hidetoshi Shimokawa
96c7c6dd58 Make it compiled on 4-stable.
Approved by: re (scottl)
2003-05-12 00:42:28 +00:00
Hidetoshi Shimokawa
6902ee83c7 - 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
Hidetoshi Shimokawa
d7398f2363 Write to RESET_START register if TARGET_RESET ORB doesn't work for timeout. 2003-05-05 14:50:24 +00:00
Hidetoshi Shimokawa
2b68d77fdd Don't panic for FWXF_START state in fw_xfer_unload(). 2003-05-05 10:14:52 +00:00
Jake Burkholder
eadb8f358b Fix printf format errors. 2003-05-02 17:21:07 +00:00
Hidetoshi Shimokawa
e47276e59c Fix printf warning caused by recent CAM change. 2003-05-01 03:38:04 +00:00
Hidetoshi Shimokawa
98465499f8 Release devq before detach. 2003-04-30 10:32:32 +00:00
Hidetoshi Shimokawa
16dbbeec74 Set status to FWDEVINVAL if probe failed. 2003-04-30 10:20:24 +00:00
Hidetoshi Shimokawa
45800373db Add missing crom_next() in the previous revision. 2003-04-29 23:40:04 +00:00
Hidetoshi Shimokawa
13bd86018b Set recv.len to zero if we get no response. 2003-04-29 15:02:34 +00:00
Hidetoshi Shimokawa
fd59632766 Get correct firmware/model information for multiple unit directories. 2003-04-29 15:01:01 +00:00