f41a83bf42
o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb
153 lines
4.4 KiB
Plaintext
153 lines
4.4 KiB
Plaintext
$FreeBSD$
|
|
|
|
IEEE 1394 support for FreeBSD-5.X and 4.X.
|
|
|
|
1. Introduction
|
|
|
|
This tarball contains IEEE1394(FireWire) driver which is first
|
|
written by Katsushi Kobayashi[1] <ikob@koganei.wide.ad.jp> and
|
|
modified by Hidetoshi Shimokawa <simokawa@freebsd.org>.
|
|
Please note this driver is still under development.
|
|
You can find latest snapshots under:
|
|
http://people.freebsd.org/~simokawa/
|
|
named firewire-2002XXXX.tar.gz
|
|
|
|
The driver consists of 6 parts:
|
|
|
|
- fwohci.c/fwohci_pci.c
|
|
OHCI[2] driver
|
|
- IEEE1394 link/phy chip control
|
|
- firewire.c
|
|
Chip independent driver
|
|
- CSR
|
|
- Transaction
|
|
- Character devices for userland
|
|
- fwmem.c
|
|
/dev/fwmem0: physical memory of a remote node.
|
|
- sbp.c
|
|
SBP-II[3] (a.k.a. SCSI over FireWire) driver
|
|
|
|
- if_fwe.c
|
|
NON-Standard implementation of Ethernet over FireWire.
|
|
|
|
- bus_mgm.c (userland)
|
|
Bus management function for user.
|
|
show topology map, change gap count, bus reset, etc.
|
|
|
|
2. Installation
|
|
|
|
Suppose you have kernel source at /sys.
|
|
|
|
- Extract tarball at root directory.
|
|
- cd /sys/dev/firewire
|
|
- make
|
|
- make install
|
|
- make load
|
|
|
|
For FreeBSD-4 user:
|
|
|
|
- ./MAKEDEV
|
|
|
|
3. SBP-II support (sbp)
|
|
|
|
- You need CAM(SCSI) support in your kernel.
|
|
If you are using FreeBSD-5 before 2002/03/23 or FreeBSD-4 before
|
|
2002/4/8, you need to apply CAM-patch in this archive
|
|
to handle HDD's(T_RBC or T_DIRECT which doesn't support READ_6).
|
|
|
|
- If you connect a few firewire devices only, try the following to
|
|
reduce gap overhead.
|
|
|
|
- ./bus_mgm -g 8
|
|
|
|
4. Ethernet over FireWire (if_fwe)
|
|
|
|
This is a sample driver for ethernet emulation. Please note this
|
|
does NOT conform to any standards like IP over FireWire(RFC2734[4]).
|
|
It just sends ethernet frames encapsulated in asynchronous stream
|
|
packets. It doesn't scale because it does something like unicast over multicast, but it's easy to be implemented and you can use any
|
|
facilities what ethernet can do. (ipv6, bridging, vlan etc.)
|
|
|
|
It also has DEVICE_POLLING[5] support. To enable it, edit your
|
|
kernel config file and Makefile.fwe then rebuild kernel and if_fwe.ko.
|
|
|
|
5. FireWire for Kernel Hackers
|
|
|
|
As you know, IEEE1394 is a bus and OHCI supports physical access
|
|
to the host memory. This means that you can access the remote
|
|
host over firewire without software support at the remote host.
|
|
In other words, you can investigate remote host's physical memory
|
|
whether its OS is alive or crashed or hangs up.
|
|
|
|
You need to apply KVMLIB-patch and rebuild libkvm then rebuild ps,
|
|
dmesg and gdb those are statically linked.
|
|
You may want to apply GDB-patch in this archive to get same behavior
|
|
as gdb with /dev/mem or want to insert savectx(&dumppcb) into panic(),
|
|
breakpoint() and so on to emulation crash dump.
|
|
|
|
You have to determine target node_id manually at this point.
|
|
(guess using bus_mgm -t or dmesg)
|
|
(Targets should be specified by EUI64 in the future)
|
|
|
|
# sysctl kern.firewire.fwmem_node=[node_id]
|
|
|
|
# ps -agx -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
|
|
# dmesg -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
|
|
# gdb -k -c /dev/fwmem0 /sys/i386/compile/GENERIC/kernel.debug
|
|
# dd if=/dev/fwmem0 of=vmcore bs=1m count=[phys. memory in MB]
|
|
|
|
remote gdb at 400,000,000 bps :-)
|
|
|
|
|
|
6. DV
|
|
I have not tested yet.
|
|
|
|
7. Tested HW
|
|
|
|
OS
|
|
- FreeBSD-4/i386
|
|
- FreeBSD-4/alpha
|
|
- FreeBSD-5/i386
|
|
|
|
* Not tested on SMP.
|
|
* Not tested on big-endian machine...
|
|
|
|
OHCI
|
|
- Texas Instruments TSB12LV26 (PCI)
|
|
- Texas Instruments TSB43AA22 (PCI/Cardbus)
|
|
|
|
* There might be phy probing problem but most of the OHCI
|
|
chips should work.
|
|
* Tested with multiple firewire buses.
|
|
|
|
SBP-II
|
|
- HDD: Logitec USB/FireWire LHD-P30FU
|
|
- HDD: Yano A-dish 120GB
|
|
- HDD: Yano B-Max 320GB
|
|
The repository of cvsup2.jp.freebsd.org is on this device.
|
|
- HDD: Personal Storage 3000XT 160GB
|
|
The last sector of this drive cannot be accessed..
|
|
- DVD-RAM: Panasonic LF-D340JD
|
|
- SCSI-FireWire converter: Yano FWSCSI-01
|
|
We can recognize only 1 device/lun at this point
|
|
- HDD: iPod, PowerBook G4 (target mode)
|
|
Reported by ikob
|
|
- Scanner: Epson GT-9700F
|
|
Now works!!
|
|
Sane-backend needs a patch(SANE-patch in this archive).
|
|
|
|
if_fwe
|
|
- IPv4, IPv6, bridging, vlan.
|
|
- You need at least two FreeBSD machines with this driver to use.
|
|
|
|
References:
|
|
[1] ftp://ftp.uec.ac.jp/pub/firewire/beta/
|
|
[2] http://developer.intel.com/technology/1394/download/ohci_11.htm
|
|
[3] http://www.t10.org/scsi-3.htm
|
|
[4] http://www.faqs.org/rfcs/rfc2734.html
|
|
[5] http://info.iet.unipi.it/~luigi/polling/
|
|
|
|
|
|
Hidetoshi Shimokawa
|
|
simokawa@freebsd.org
|