From owner-freebsd-firewire@FreeBSD.ORG Mon Oct 9 11:08:53 2006 Return-Path: X-Original-To: freebsd-firewire@FreeBSD.org Delivered-To: freebsd-firewire@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3226816A412 for ; Mon, 9 Oct 2006 11:08:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 746C843D69 for ; Mon, 9 Oct 2006 11:08:39 +0000 (GMT) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k99B8Na6071494 for ; Mon, 9 Oct 2006 11:08:23 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k99B8M0H071490 for freebsd-firewire@FreeBSD.org; Mon, 9 Oct 2006 11:08:22 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 9 Oct 2006 11:08:22 GMT Message-Id: <200610091108.k99B8M0H071490@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-firewire@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2006 11:08:53 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/74238 firewire [firewire] fw_rcv: unknown response; firewire ad-hoc w o kern/85434 firewire [fwip] fwip (IP over firewire) doesn't work with polli 2 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/95077 firewire [firewire] fatal trap 19 at fwohci_pci_init 1 problem total. From owner-freebsd-firewire@FreeBSD.ORG Mon Oct 9 18:31:27 2006 Return-Path: X-Original-To: firewire@freebsd.org Delivered-To: freebsd-firewire@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 545C016A407 for ; Mon, 9 Oct 2006 18:31:27 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9B3543D53 for ; Mon, 9 Oct 2006 18:31:14 +0000 (GMT) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan [127.0.0.1]) by aldan.algebra.com (8.13.8/8.13.7) with ESMTP id k99IVD1k045511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Oct 2006 14:31:14 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.13.8/8.13.7/Submit) id k99IVCCT045510; Mon, 9 Oct 2006 14:31:12 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: freebsd@gm.nunu.org, ikob@koganei.wide.ad.jp Date: Mon, 9 Oct 2006 14:31:12 -0400 User-Agent: KMail/1.9.1 X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: firewire@freebsd.org Subject: libraw1394 port for FreeBSD? X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2006 18:31:27 -0000 --Boundary-00=_wVpKF5iDZ2oZDyt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello! You are the authors of FreeBSD's firewire code, which appears to present an API different, from what Linux programs expect. Could we have a compatibility layer, which would provide such Linuxish API, so that it would be easier to port applications written and maintained on Linux? I'm attaching the skeleton of the devel/libraw1394 port. As you can see, libraw1394 comes with its own version of ieee1394-ioctl.h (which the port simply removes for now). The IOCTLs defined in it -- like RAW1394_IOC_ISO_XMIT_INIT and RAW1394_IOC_ISO_SHUTDOWN -- need to be provided by something in FreeBSD's /usr/include. Alternatively, the libraw1394's src/iso.c needs to be patched (or rewritten) using FreeBSD's firewire APIs. Would you be able to offer help/suggestions on either of the two approaches? The attached (incomplete) port makes the rest of the library compile cleanly, but I have no hope for being able to fix the iso.c myself... Thank you very much for your time. Respectfully, -mi --Boundary-00=_wVpKF5iDZ2oZDyt Content-Type: text/x-diff; charset="us-ascii"; name="libraw1394.shar" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libraw1394.shar" # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # libraw1394 # libraw1394/Makefile # libraw1394/distinfo # libraw1394/files # libraw1394/files/patch-types # libraw1394/files/patch-eventloop # libraw1394/files/patch-errors # libraw1394/files/patch-iso # echo c - libraw1394 mkdir -p libraw1394 > /dev/null 2>&1 echo x - libraw1394/Makefile sed 's/^X//' >libraw1394/Makefile << 'END-of-libraw1394/Makefile' XPORTNAME= libraw1394 XPORTVERSION= 1.2.1 XMASTER_SITES= http://www.linux1394.org/dl/ XCATEGORIES= devel multimedia X XCOMMENT= Linux' API for direct access to the IEEE 1394 bus X XGNU_CONFIGURE= yes X Xpost-patch: X ${MV} ${WRKSRC}/src/ieee1394-ioctl.h ${WRKSRC}/src/ieee1394-ioctl.h.org X ${ECHO_MSG} '/* Meow-meow */' > ${WRKSRC}/src/ieee1394-ioctl.h X X.include END-of-libraw1394/Makefile echo x - libraw1394/distinfo sed 's/^X//' >libraw1394/distinfo << 'END-of-libraw1394/distinfo' XMD5 (libraw1394-1.2.1.tar.gz) = e6210ff05b7f4ec0401ad3d11f493e1a XSHA256 (libraw1394-1.2.1.tar.gz) = 13381fb2ea63e6ee428d49c7f6679755a2c331f82afc19522794d11943bcab52 XSIZE (libraw1394-1.2.1.tar.gz) = 382992 END-of-libraw1394/distinfo echo c - libraw1394/files mkdir -p libraw1394/files > /dev/null 2>&1 echo x - libraw1394/files/patch-types sed 's/^X//' >libraw1394/files/patch-types << 'END-of-libraw1394/files/patch-types' X--- src/kernel-raw1394.h Fri Nov 5 19:26:44 2004 X+++ src/kernel-raw1394.h Mon Oct 9 13:40:37 2006 X@@ -73,43 +73,43 @@ X #define RAW1394_NOTIFY_ON 1 X X-#include X+#include X X struct raw1394_request { X- __u32 type; X- __s32 error; X- __u32 misc; X+ uint32_t type; X+ int32_t error; X+ uint32_t misc; X X- __u32 generation; X- __u32 length; X+ uint32_t generation; X+ uint32_t length; X X- __u64 address; X+ uint64_t address; X X- __u64 tag; X+ uint64_t tag; X X- __u64 sendb; X- __u64 recvb; X+ uint64_t sendb; X+ uint64_t recvb; X }; X X struct raw1394_khost_list { X- __u32 nodes; X- __u8 name[32]; X+ uint32_t nodes; X+ uint8_t name[32]; X }; X X typedef struct arm_request { X- __u16 destination_nodeid; X- __u16 source_nodeid; X- __u64 destination_offset; X- __u8 tlabel; X- __u8 tcode; X- __u8 extended_transaction_code; X- __u32 generation; X- __u16 buffer_length; X- __u8 *buffer; X+ uint16_t destination_nodeid; X+ uint16_t source_nodeid; X+ uint64_t destination_offset; X+ uint8_t tlabel; X+ uint8_t tcode; X+ uint8_t extended_transaction_code; X+ uint32_t generation; X+ uint16_t buffer_length; X+ uint8_t *buffer; X } *arm_request_t; X X typedef struct arm_response { X- __s32 response_code; X- __u16 buffer_length; X- __u8 *buffer; X+ int32_t response_code; X+ uint16_t buffer_length; X+ uint8_t *buffer; X } *arm_response_t; X X@@ -125,15 +125,15 @@ X /* must be identical to hpsb_iso_packet_info in iso.h! */ X struct raw1394_iso_packet_info { X- __u32 offset; X- __u16 len; X- __u16 cycle; /* recv only */ X- __u8 channel; /* recv only */ X- __u8 tag; X- __u8 sy; X+ uint32_t offset; X+ uint16_t len; X+ uint16_t cycle; /* recv only */ X+ uint8_t channel; /* recv only */ X+ uint8_t tag; X+ uint8_t sy; X }; X X /* argument for RAW1394_ISO_RECV/XMIT_PACKETS ioctls */ X struct raw1394_iso_packets { X- __u32 n_packets; X+ uint32_t n_packets; X struct raw1394_iso_packet_info *infos; X }; X@@ -141,20 +141,20 @@ X struct raw1394_iso_config { X /* size of packet data buffer, in bytes (will be rounded up to PAGE_SIZE) */ X- __u32 data_buf_size; X+ uint32_t data_buf_size; X X /* # of packets to buffer */ X- __u32 buf_packets; X+ uint32_t buf_packets; X X /* iso channel (set to -1 for multi-channel recv) */ X- __s32 channel; X+ int32_t channel; X X /* xmit only - iso transmission speed */ X- __u8 speed; X+ uint8_t speed; X X /* The mode of the dma when receiving iso data. Must be supported by chip */ X- __u8 dma_mode; X+ uint8_t dma_mode; X X /* max. latency of buffer, in packets (-1 if you don't care) */ X- __s32 irq_interval; X+ int32_t irq_interval; X }; X X@@ -166,14 +166,14 @@ X /* number of packets waiting to be filled with data (ISO transmission) X or containing data received (ISO reception) */ X- __u32 n_packets; X+ uint32_t n_packets; X X /* approximate number of packets dropped due to overflow or X underflow of the packet buffer (a value of zero guarantees X that no packets have been dropped) */ X- __u32 overflows; X+ uint32_t overflows; X X /* cycle number at which next packet will be transmitted; X -1 if not known */ X- __s16 xmit_cycle; X+ int16_t xmit_cycle; X }; X X--- src/raw1394_private.h Wed Feb 16 10:49:49 2005 X+++ src/raw1394_private.h Mon Oct 9 13:44:29 2006 X@@ -57,11 +57,6 @@ X #define CLEAR_REQ(reqp) memset((reqp), 0, sizeof(struct raw1394_request)) X X-#if SIZEOF_VOID_P == 4 X-#define int2ptr(x) ((void *)(__u32)x) X-#define ptr2int(x) ((__u64)(__u32)x) X-#else X-#define int2ptr(x) ((void *)x) X-#define ptr2int(x) ((__u64)x) X-#endif X+#define int2ptr(x) ((void *)(uintptr_t)x) X+#define ptr2int(x) ((uintptr_t)x) X X #endif /* _RAW1394_PRIVATE_H */ X--- src/readwrite.c Wed Nov 10 18:39:00 2004 X+++ src/readwrite.c Mon Oct 9 14:01:28 2006 X@@ -44,5 +44,5 @@ X req.tag = tag; X X- req.address = ((__u64)node << 48) | addr; X+ req.address = ((uint64_t)node << 48) | addr; X req.length = length; X req.recvb = ptr2int(buffer); X@@ -64,5 +64,5 @@ X req.tag = tag; X X- req.address = ((__u64)node << 48) | addr; X+ req.address = ((uint64_t)node << 48) | addr; X req.length = length; X req.sendb = ptr2int(data); X@@ -90,5 +90,5 @@ X req.tag = tag; X X- req.address = ((__u64)node << 48) | addr; X+ req.address = ((uint64_t)node << 48) | addr; X req.sendb = ptr2int(sendbuf); X req.recvb = ptr2int(result); X@@ -128,5 +128,5 @@ X req.tag = tag; X X- req.address = ((__u64)node << 48) | addr; X+ req.address = ((uint64_t)node << 48) | addr; X req.sendb = ptr2int(sendbuf); X req.recvb = ptr2int(result); X@@ -163,5 +163,5 @@ X req.tag = rawtag; X X- req.address = ((__u64)channel << 48) | speed; X+ req.address = ((uint64_t)channel << 48) | speed; X req.misc = (tag << 16) | sy; X req.length = length; X@@ -185,5 +185,5 @@ X req.tag = rawtag; X X- req.address = ((__u64)channel << 48) | speed; X+ req.address = ((uint64_t)channel << 48) | speed; X req.misc = (tag << 16) | sy; X req.length = length; END-of-libraw1394/files/patch-types echo x - libraw1394/files/patch-eventloop sed 's/^X//' >libraw1394/files/patch-eventloop << 'END-of-libraw1394/files/patch-eventloop' X--- src/eventloop.c Sat Apr 8 22:29:54 2006 X+++ src/eventloop.c Mon Oct 9 13:54:59 2006 X@@ -21,5 +21,4 @@ X #include X #include X-#include X X #include "raw1394.h" END-of-libraw1394/files/patch-eventloop echo x - libraw1394/files/patch-errors sed 's/^X//' >libraw1394/files/patch-errors << 'END-of-libraw1394/files/patch-errors' X--- src/errors.c Wed Nov 10 18:53:05 2004 X+++ src/errors.c Mon Oct 9 14:00:19 2006 X@@ -39,5 +39,9 @@ X 0xdead, X 0xdead, X+#ifdef EREMOTEIO X EREMOTEIO, /* ack_data_error */ X+#else X+ EIO, X+#endif X EPERM, /* ack_type_error */ X 0xdead /* invalid ack code */ X@@ -49,5 +53,9 @@ X 0xdead, X EAGAIN, /* rcode_conflict_error */ X+#ifdef EREMOTEIO X EREMOTEIO, /* rcode_data_error */ X+#else X+ EIO, X+#endif X EPERM, /* rcode_type_error */ X EINVAL, /* rcode_address_error */ END-of-libraw1394/files/patch-errors echo x - libraw1394/files/patch-iso sed 's/^X//' >libraw1394/files/patch-iso << 'END-of-libraw1394/files/patch-iso' X--- src/iso.c Sat Apr 8 22:02:31 2006 X+++ src/iso.c Mon Oct 9 14:17:43 2006 X@@ -17,5 +17,5 @@ X #include X #include X-#include X+#include X X #include "raw1394.h" END-of-libraw1394/files/patch-iso exit --Boundary-00=_wVpKF5iDZ2oZDyt-- From owner-freebsd-firewire@FreeBSD.ORG Wed Oct 11 17:03:45 2006 Return-Path: X-Original-To: firewire@freebsd.org Delivered-To: freebsd-firewire@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A31E216A4D2 for ; Wed, 11 Oct 2006 17:03:45 +0000 (UTC) (envelope-from buzz@gaia.arc.nasa.gov) Received: from gaia.arc.nasa.gov (gaia.arc.nasa.gov [143.232.155.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D54743D67 for ; Wed, 11 Oct 2006 16:58:15 +0000 (GMT) (envelope-from buzz@gaia.arc.nasa.gov) Received: from tioga.arc.nasa.gov (tioga.arc.nasa.gov [143.232.155.66]) by gaia.arc.nasa.gov (8.13.8/8.12.10) with ESMTP id k9BGvscq026520; Wed, 11 Oct 2006 09:57:54 -0700 (PDT) Date: Wed, 11 Oct 2006 09:57:53 -0700 (PDT) From: Buzz Slye X-X-Sender: buzz@tioga.arc.nasa.gov To: mi+kde@aldan.algebra.com Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: firewire@freebsd.org Subject: Libraw1394 on FreeBSD X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2006 17:03:45 -0000 Mikhail: We have been using the libraw1394 and libdc1394 successfully on FreeBSD for several years now. Libdc1394 is easily ported from Linux to FreeBSD. However, the Linux libraw1394 should be completely scrapped as the ioctl's and underlying support are completely different. Main.c, iso.c, and readwrite.c must be rewritten. Fortunately, this is much easier to do on BSD. For example, the incoming packets may handled with (suprise) a read. Following is an example of iso.c. Robert Slye Code: SGE / 242-4 NASA - Ames Research Center Moffett Field, CA 94035 (650) 604-3329 /* * libraw1394 - library for raw access to the 1394 bus with the Linux subsystem. * * Copyright (C) 1999,2000,2001,2002 Andreas Bombe * new ISO API by Dan Maas * * This library is licensed under the GNU Lesser General Public License (LGPL), * version 2.1 or later. See the file COPYING.LIB in the distribution for * details. * * Rewritten for FreeBSD - R E Slye - 6/23/04 * Most of the original code for Linux is not supported and is deleted. * This code may be used for receiving the iso stream download of a single * image from a digital camera. Stream xmit is not supported. */ #include #include #include #include #include #include #include #include #include #include #include "raw1394.h" #include "kernel-raw1394.h" #include "raw1394_private.h" extern int _dc1394_video_iso_handler(raw1394handle_t handle, int channel, size_t length, quadlet_t *data); /** * raw1394_start_iso_rcv - enable isochronous receiving * @channel: channel number to start receiving on * * Enables the reception of isochronous packets in @channel on @handle. * Isochronous packets are then passed to the callback specified with * _dc1394_video_iso_handler(). **/ int raw1394_start_iso_rcv(struct raw1394_handle *handle, unsigned int channel) { int size, rc; quadlet_t fwbuf[1026]; while (1) { if ((size = read(handle->fd, fwbuf, sizeof(fwbuf))) < 0) { printf(" rv = %d errno = %d\n", size, errno); return (-1); } rc = _dc1394_video_iso_handler(handle, channel, size, fwbuf); if (rc < 0) return (-1); else if (rc > 0) break; } return 0; } /** * raw1394_stop_iso_rcv - stop isochronous receiving * @channel: channel to stop receiving on * * Stops the reception of isochronous packets in @channel on @handle. **/ int raw1394_stop_iso_rcv(struct raw1394_handle *handle, unsigned int channel) { /* I don't know how to stop receiving on channel */ return 0; } From owner-freebsd-firewire@FreeBSD.ORG Wed Oct 11 17:17:05 2006 Return-Path: X-Original-To: firewire@freebsd.org Delivered-To: freebsd-firewire@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03D1D16A412 for ; Wed, 11 Oct 2006 17:17:05 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id D77C54411A for ; Wed, 11 Oct 2006 17:09:35 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from [172.21.130.86] (mx-broadway [38.98.68.18]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k9BH9QWc023546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Oct 2006 13:09:26 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: Buzz Slye Date: Wed, 11 Oct 2006 13:09:20 -0400 User-Agent: KMail/1.9.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200610111309.20881.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV 0.88.4/2024/Wed Oct 11 06:53:09 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: firewire@freebsd.org Subject: Re: Libraw1394 on FreeBSD X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2006 17:17:05 -0000 ÓÅÒÅÄÁ 11 ÖÏ×ÔÅÎØ 2006 12:57, Buzz Slye ÎÁÐÉÓÁ×: > š š We have been using the libraw1394 and libdc1394 successfully > on FreeBSD for several years now. šLibdc1394 is easily ported from > Linux to FreeBSD. You really should've made a port several years ago :-/ It would've been easier for your organization to maintain the software as you updated your FreeBSD systems, and it would've allowed the rest of us to begin using the fruits of your work that much earlier... > However, the Linux libraw1394 should be completely > scrapped as the ioctl's and underlying support are completely different. > Main.c, iso.c, and readwrite.c must be rewritten. Yeah, I expected so much -- I just want the API expected from libraw1394 by Linux-written applications to be available. No doubt, the internals will be different. > š š Fortunately, this is much easier to do on BSD. šFor example, the > incoming packets may handled with (suprise) a read. šFollowing is an > example of iso.c. Thank you very much! I'll try to finish up the port with this... Can you provide your versions of main.c and readwrite.c as well? Thanks! -mi