reorganize and update documentation; fix compiler warning
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@144 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
parent
dbfde4f174
commit
940fabaf39
6
AUTHORS
6
AUTHORS
|
@ -1,10 +1,10 @@
|
|||
Maintainer: Ben Collins <bcollins@debian.org>
|
||||
Maintainer: Dan Dennedy <dan@dennedy.org>
|
||||
|
||||
Original author: Andreas Bombe <andreas.bombe@munich.netsurf.de>
|
||||
or: <bombe@informatik.tu-muenchen.de>
|
||||
or <bombe@informatik.tu-muenchen.de>
|
||||
|
||||
Contributors:
|
||||
Manfred Weihs <weihs@ict.tuwien.ac.at>
|
||||
Christian Toegel <christian.toegel@gmx.at>
|
||||
Dan Maas <dmaas@maasdigital.com>
|
||||
Dan Dennedy <dan@dennedy.org>
|
||||
Ben Collins <bcollins@debian.org>
|
||||
|
|
161
INSTALL
161
INSTALL
|
@ -1,27 +1,43 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
|
@ -54,20 +70,22 @@ The simplest way to compile this package is:
|
|||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
|
@ -75,28 +93,28 @@ directory where you want the object files and executables to go and run
|
|||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
give `configure' the option `--exec-prefix=PREFIX', the package will
|
||||
use PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
|
@ -107,7 +125,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
|||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
|
@ -122,48 +140,81 @@ you can use the `configure' options `--x-includes=DIR' and
|
|||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
will cause the specified gcc to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
|
@ -175,8 +226,6 @@ operates.
|
|||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
|
7
NEWS
7
NEWS
|
@ -5,12 +5,15 @@ Version 1.1.0:
|
|||
numbers changed to reflect a new interface that is not backwards compatible!
|
||||
- added raw1394_arm_set_buf() and raw1394_arm_get_buf() functions.
|
||||
- added raw1394_new_handle_on_port() to make initialization simpler.
|
||||
- new, consistent versioning scheme. 1.0.0 was reported by pkg-config in 0.10
|
||||
series; hence, 1.1.0 in this release.
|
||||
- make versioning consistent and updated. 1.0.0 was reported by pkg-config in
|
||||
0.10 series; hence, 1.1.0 in this release.
|
||||
- removed outdated, bogus "linking required only" version symbols in
|
||||
version.c - use pkg-config now.
|
||||
- dropped libraw1394.m4 - use pkg-config now.
|
||||
- added RPM spec file.
|
||||
- deprecate old isochronous API.
|
||||
- move API comment documentation to header and reformat header comments as
|
||||
kernel-doc (use linux/scripts/kernel-doc to extract and format them).
|
||||
|
||||
Version 0.10:
|
||||
|
||||
|
|
2
README
2
README
|
@ -56,7 +56,7 @@ correctly links with libraw1394.
|
|||
|
||||
6. Maintainer
|
||||
|
||||
Maintainers of libraw1394 are currently Ben Collins and Dan Dennedy. Send
|
||||
Maintainer of libraw1394 is currently Dan Dennedy. Send
|
||||
suggestions, bug reports and fixes to linux1394-devel@lists.sourceforge.net.
|
||||
See the file AUTHORS for a complete list of contributors to libraw1394.
|
||||
|
||||
|
|
4406
doc/libraw1394.sgml
4406
doc/libraw1394.sgml
File diff suppressed because it is too large
Load Diff
|
@ -52,8 +52,8 @@ int raw1394_arm_register(struct raw1394_handle *handle, nodeaddr_t start,
|
|||
int retval=0;
|
||||
struct raw1394_request req;
|
||||
|
||||
if (((start & ~(0xFFFFFFFFFFFF)) != 0) ||
|
||||
(((start + length) & ~(0xFFFFFFFFFFFF)) != 0)) {
|
||||
if (((start & ~(0xFFFFFFFF)) != 0) ||
|
||||
(((start + length) & ~(0xFFFFFFFF)) != 0)) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
@ -152,4 +152,3 @@ int raw1394_arm_get_buf (struct raw1394_handle *handle, nodeaddr_t start,
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
31
src/errors.c
31
src/errors.c
|
@ -17,42 +17,11 @@
|
|||
#include "ieee1394.h"
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_get_errcode - return error code of async transaction
|
||||
*
|
||||
* Returns the error code of the last raw1394_read(), raw1394_write(),
|
||||
* raw1394_lock() or raw1394_iso_write(). The error code is either an internal
|
||||
* error (i.e. not a bus error) or a combination of acknowledge code and
|
||||
* response code, as appropriate.
|
||||
*
|
||||
* Some macros are available to extract information from the error code,
|
||||
* raw1394_errcode_to_errno() can be used to convert it to an errno number of
|
||||
* roughly the same meaning.
|
||||
**/
|
||||
raw1394_errcode_t raw1394_get_errcode(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->err;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_errcode_to_errno - convert libraw1394 errcode to errno
|
||||
* @errcode: the error code to convert
|
||||
*
|
||||
* The error code as retrieved by raw1394_get_errcode() is converted into a
|
||||
* roughly equivalent errno number and returned. %0xdead is returned for an
|
||||
* illegal errcode.
|
||||
*
|
||||
* It is intended to be used to decide what to do (retry, give up, report error)
|
||||
* for those programs that aren't interested in details, since these get lost in
|
||||
* the conversion. However the returned errnos are equivalent in source code
|
||||
* meaning only, the associated text of e.g. perror() is not necessarily
|
||||
* meaningful.
|
||||
*
|
||||
* Returned values are %EAGAIN (retrying might succeed, also generation number
|
||||
* mismatch), %EREMOTEIO (other node had internal problems), %EPERM (operation
|
||||
* not allowed on this address, e.g. write on read-only location), %EINVAL
|
||||
* (invalid argument) and %EFAULT (invalid pointer).
|
||||
**/
|
||||
int raw1394_errcode_to_errno(raw1394_errcode_t errcode)
|
||||
{
|
||||
static const int ack2errno[16] = {
|
||||
|
|
|
@ -27,17 +27,6 @@
|
|||
#include "raw1394_private.h"
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_loop_iterate - get and process one event message
|
||||
*
|
||||
* Get one new message through handle and process it with the registered message
|
||||
* handler. This function will return %-1 for an error or the return value of
|
||||
* the handler which got executed. The default handlers always return zero.
|
||||
*
|
||||
* Note that some other library functions may call this function multiple times
|
||||
* to wait for their completion, some handler return values may get lost if you
|
||||
* use these.
|
||||
**/
|
||||
int raw1394_loop_iterate(struct raw1394_handle *handle)
|
||||
{
|
||||
struct raw1394_request req;
|
||||
|
@ -115,13 +104,6 @@ int raw1394_loop_iterate(struct raw1394_handle *handle)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_set_bus_reset_handler - set bus reset handler
|
||||
* @new_h: pointer to new handler
|
||||
*
|
||||
* Sets the handler to be called on every bus reset to @new_h and returns the
|
||||
* old handler. The default handler just calls raw1394_update_generation().
|
||||
**/
|
||||
bus_reset_handler_t raw1394_set_bus_reset_handler(struct raw1394_handle *handle,
|
||||
bus_reset_handler_t new)
|
||||
{
|
||||
|
@ -133,19 +115,6 @@ bus_reset_handler_t raw1394_set_bus_reset_handler(struct raw1394_handle *handle,
|
|||
return old;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_set_tag_handler - set request completion handler
|
||||
* @new_h: pointer to new handler
|
||||
*
|
||||
* Sets the handler to be called whenever a request completes to @new_h and
|
||||
* returns the old handler. The default handler interprets the tag as a pointer
|
||||
* to a &struct raw1394_reqhandle and calls the callback in there.
|
||||
*
|
||||
* Care must be taken when replacing the tag handler and calling the synchronous
|
||||
* versions of the transaction functions (i.e. raw1394_read(), raw1394_write(),
|
||||
* raw1394_lock(), raw1394_iso_write()) since these do pass pointers to &struct
|
||||
* raw1394_reqhandle as the tag and expect the callback to be invoked.
|
||||
**/
|
||||
tag_handler_t raw1394_set_tag_handler(struct raw1394_handle *handle,
|
||||
tag_handler_t new)
|
||||
{
|
||||
|
@ -169,17 +138,6 @@ arm_tag_handler_t raw1394_set_arm_tag_handler(struct raw1394_handle *handle,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_set_iso_handler - set isochronous packet handler
|
||||
* @new_h: pointer to new handler
|
||||
*
|
||||
* Sets the handler to be called when an isochronous packet is received to
|
||||
* @new_h and returns the old handler. The default handler does nothing.
|
||||
*
|
||||
* In order to actually get iso packet events, receiving on a specific channel
|
||||
* first has to be enabled with raw1394_start_iso_rcv() and can be stopped again
|
||||
* with raw1394_stop_iso_rcv().
|
||||
**/
|
||||
iso_handler_t raw1394_set_iso_handler(struct raw1394_handle *handle,
|
||||
unsigned int channel, iso_handler_t new)
|
||||
{
|
||||
|
@ -201,17 +159,6 @@ iso_handler_t raw1394_set_iso_handler(struct raw1394_handle *handle,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_set_fcp_handler - set FCP handler
|
||||
* @new_h: pointer to new handler
|
||||
*
|
||||
* Sets the handler to be called when either FCP command or FCP response
|
||||
* registers get written to @new_h and returns the old handler. The default
|
||||
* handler does nothing.
|
||||
*
|
||||
* In order to actually get FCP events, you have to enable it with
|
||||
* raw1394_start_fcp_listen() and can stop it with raw1394_stop_fcp_listen().
|
||||
**/
|
||||
fcp_handler_t raw1394_set_fcp_handler(struct raw1394_handle *handle,
|
||||
fcp_handler_t new)
|
||||
{
|
||||
|
|
13
src/fcp.c
13
src/fcp.c
|
@ -54,24 +54,11 @@ static int do_fcp_listen(struct raw1394_handle *handle, int startstop)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_start_fcp_listen - enable reception of FCP events
|
||||
*
|
||||
* Enables the reception of FCP events (writes to the FCP_COMMAND or
|
||||
* FCP_RESPONSE address ranges) on @handle. FCP requests are then passed to the
|
||||
* callback specified with raw1394_set_fcp_handler().
|
||||
**/
|
||||
int raw1394_start_fcp_listen(struct raw1394_handle *handle)
|
||||
{
|
||||
return do_fcp_listen(handle, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_stop_fcp_listen - disable reception of FCP events
|
||||
*
|
||||
* Stops the reception of FCP events (writes to the FCP_COMMAND or
|
||||
* FCP_RESPONSE address ranges) on @handle.
|
||||
**/
|
||||
int raw1394_stop_fcp_listen(struct raw1394_handle *handle)
|
||||
{
|
||||
return do_fcp_listen(handle, 0);
|
||||
|
|
97
src/iso.c
97
src/iso.c
|
@ -60,14 +60,6 @@ static int do_iso_listen(struct raw1394_handle *handle, int channel)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* raw1394_set_iso_handler().
|
||||
**/
|
||||
int raw1394_start_iso_rcv(struct raw1394_handle *handle, unsigned int channel)
|
||||
{
|
||||
if (channel > 63) {
|
||||
|
@ -78,12 +70,6 @@ int raw1394_start_iso_rcv(struct raw1394_handle *handle, unsigned int channel)
|
|||
return do_iso_listen(handle, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
if (channel > 63) {
|
||||
|
@ -169,17 +155,6 @@ static int do_iso_init(raw1394handle_t handle,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_xmit_init - initialize isochronous transmission
|
||||
* @handler: handler function for queueing packets
|
||||
* @buf_packets: number of isochronous packets to buffer
|
||||
* @max_packet_size: largest packet you need to handle, in bytes (not including the isochronous header)
|
||||
* @channel: isochronous channel on which to transmit
|
||||
* @speed: speed at which to transmit
|
||||
* @irq_interval: maximum latency of wake-ups, in packets (-1 if you don't care)
|
||||
*
|
||||
* Allocates all user and kernel resources necessary for isochronous transmission.
|
||||
**/
|
||||
int raw1394_iso_xmit_init(raw1394handle_t handle,
|
||||
raw1394_iso_xmit_handler_t handler,
|
||||
unsigned int buf_packets,
|
||||
|
@ -199,17 +174,6 @@ int raw1394_iso_xmit_init(raw1394handle_t handle,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_init - initialize isochronous reception
|
||||
* @handler: handler function for receiving packets
|
||||
* @buf_packets: number of isochronous packets to buffer
|
||||
* @max_packet_size: largest packet you need to handle, in bytes (not including the isochronous header)
|
||||
* @channel: isochronous channel to receive
|
||||
* @speed: speed at which to receive
|
||||
* @irq_interval: maximum latency of wake-ups, in packets (-1 if you don't care)
|
||||
*
|
||||
* Allocates all user and kernel resources necessary for isochronous reception.
|
||||
**/
|
||||
int raw1394_iso_recv_init(raw1394handle_t handle,
|
||||
raw1394_iso_recv_handler_t handler,
|
||||
unsigned int buf_packets,
|
||||
|
@ -228,16 +192,6 @@ int raw1394_iso_recv_init(raw1394handle_t handle,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_multichannel_recv_init - initialize multi-channel isochronous reception
|
||||
* @handler: handler function for receiving packets
|
||||
* @buf_packets: number of isochronous packets to buffer
|
||||
* @max_packet_size: largest packet you need to handle, in bytes (not including the isochronous header)
|
||||
* @speed: speed at which to receive
|
||||
* @irq_interval: maximum latency of wake-ups, in packets (-1 if you don't care)
|
||||
*
|
||||
* Allocates all user and kernel resources necessary for isochronous reception.
|
||||
**/
|
||||
int raw1394_iso_multichannel_recv_init(raw1394handle_t handle,
|
||||
raw1394_iso_recv_handler_t handler,
|
||||
unsigned int buf_packets,
|
||||
|
@ -255,9 +209,6 @@ int raw1394_iso_multichannel_recv_init(raw1394handle_t handle,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_listen_channel - listen to a specific channel in multi-channel mode
|
||||
**/
|
||||
int raw1394_iso_recv_listen_channel(raw1394handle_t handle, unsigned char channel)
|
||||
{
|
||||
if (handle->iso_mode != ISO_RECV) {
|
||||
|
@ -268,9 +219,6 @@ int raw1394_iso_recv_listen_channel(raw1394handle_t handle, unsigned char channe
|
|||
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_LISTEN_CHANNEL, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_unlisten_channel - stop listening to a specific channel in multi-channel mode
|
||||
**/
|
||||
int raw1394_iso_recv_unlisten_channel(raw1394handle_t handle, unsigned char channel)
|
||||
{
|
||||
if (handle->iso_mode != ISO_RECV) {
|
||||
|
@ -281,16 +229,6 @@ int raw1394_iso_recv_unlisten_channel(raw1394handle_t handle, unsigned char chan
|
|||
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_UNLISTEN_CHANNEL, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_flush - if you specified an irq_interval > 1 in
|
||||
* iso_recv_init, you won't be notified for every single iso packet, but
|
||||
* for groups of them. Now e.g. if irq_interval is 100, and you were just
|
||||
* notified about iso packets and after them only 20 more packets arrived,
|
||||
* no notification will be generated (20 < 100). In the case that you know
|
||||
* that there should be more packets at this moment, you can call this
|
||||
* function and all iso packets which are already received by the kernel
|
||||
* will be flushed out to user space.
|
||||
*/
|
||||
int raw1394_iso_recv_flush(raw1394handle_t handle)
|
||||
{
|
||||
if (handle->iso_mode != ISO_RECV) {
|
||||
|
@ -301,13 +239,6 @@ int raw1394_iso_recv_flush(raw1394handle_t handle)
|
|||
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_FLUSH, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_set_channel_mask - listen or unlisten to a whole bunch of channels at once
|
||||
* @mask: 64-bit mask of channels, 1 means listen, 0 means unlisten,
|
||||
* channel 0 is LSB, channel 63 is MSB
|
||||
*
|
||||
* for multi-channel reception mode only
|
||||
**/
|
||||
int raw1394_iso_recv_set_channel_mask(raw1394handle_t handle, u_int64_t mask)
|
||||
{
|
||||
if (handle->iso_mode != ISO_RECV) {
|
||||
|
@ -318,12 +249,6 @@ int raw1394_iso_recv_set_channel_mask(raw1394handle_t handle, u_int64_t mask)
|
|||
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_SET_CHANNEL_MASK, (void*) &mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_recv_start - begin isochronous reception
|
||||
* @start_on_cycle: isochronous cycle number on which to start (-1 if you don't care)
|
||||
* @tag_mask: mask of tag fields to match (-1 to receive all packets)
|
||||
* @sync: not used, reserved for future implementation
|
||||
**/
|
||||
int raw1394_iso_recv_start(raw1394handle_t handle, int start_on_cycle, int tag_mask, int sync)
|
||||
{
|
||||
int args[3];
|
||||
|
@ -422,13 +347,6 @@ out:
|
|||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_xmit_write - alternative blocking-write API for ISO transmission
|
||||
* @data: pointer to packet data buffer
|
||||
* @len: length of packet, in bytes
|
||||
* @tag: tag field
|
||||
* @sy: sync field
|
||||
**/
|
||||
int raw1394_iso_xmit_write(raw1394handle_t handle, unsigned char *data, unsigned int len,
|
||||
unsigned char tag, unsigned char sy)
|
||||
{
|
||||
|
@ -477,11 +395,6 @@ int raw1394_iso_xmit_write(raw1394handle_t handle, unsigned char *data, unsigned
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_xmit_start - begin isochronous transmission
|
||||
* @start_on_cycle: isochronous cycle number on which to start (-1 if you don't care)
|
||||
* @prebuffer_packets: number of packets to queue up before starting transmission (-1 if you don't care)
|
||||
**/
|
||||
int raw1394_iso_xmit_start(raw1394handle_t handle, int start_on_cycle, int prebuffer_packets)
|
||||
{
|
||||
int args[2];
|
||||
|
@ -501,9 +414,6 @@ int raw1394_iso_xmit_start(raw1394handle_t handle, int start_on_cycle, int prebu
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_xmit_sync - wait until all queued packets have been sent
|
||||
**/
|
||||
int raw1394_iso_xmit_sync(raw1394handle_t handle)
|
||||
{
|
||||
if(handle->iso_mode != ISO_XMIT) {
|
||||
|
@ -513,9 +423,6 @@ int raw1394_iso_xmit_sync(raw1394handle_t handle)
|
|||
return ioctl(handle->fd, RAW1394_IOC_ISO_XMIT_SYNC, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_stop - halt isochronous transmission or reception
|
||||
**/
|
||||
void raw1394_iso_stop(raw1394handle_t handle)
|
||||
{
|
||||
if(handle->iso_mode == ISO_INACTIVE) {
|
||||
|
@ -526,9 +433,6 @@ void raw1394_iso_stop(raw1394handle_t handle)
|
|||
handle->iso_state = ISO_STOP;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_iso_shutdown - clean up and deallocate all resources for isochronous transmission or reception
|
||||
**/
|
||||
void raw1394_iso_shutdown(raw1394handle_t handle)
|
||||
{
|
||||
if(handle->iso_buffer) {
|
||||
|
@ -640,4 +544,3 @@ int _raw1394_iso_iterate(raw1394handle_t handle)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
145
src/main.c
145
src/main.c
|
@ -109,18 +109,6 @@ static unsigned int init_rawdevice(struct raw1394_handle *h)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_new_handle - create new handle
|
||||
*
|
||||
* Creates and returns a new handle which can (after being set up) control one
|
||||
* port. It is not allowed to use the same handle in multiple threads or forked
|
||||
* processes. It is allowed to create and use multiple handles, however. Use
|
||||
* one handle per thread which needs it in the multithreaded case.
|
||||
*
|
||||
* Returns the created handle or %NULL when initialization fails. In the latter
|
||||
* case errno either contains some OS specific error code or %0 if the error is
|
||||
* that libraw1394 and raw1394 don't support each other's protocol versions.
|
||||
**/
|
||||
struct raw1394_handle *raw1394_new_handle(void)
|
||||
{
|
||||
struct raw1394_handle *handle;
|
||||
|
@ -154,14 +142,6 @@ struct raw1394_handle *raw1394_new_handle(void)
|
|||
return handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_destroy_handle - deallocate handle
|
||||
* @handle: handle to deallocate
|
||||
*
|
||||
* Closes connection with raw1394 on this handle and deallocates everything
|
||||
* associated with it. It is safe to pass %NULL as handle, nothing is done in
|
||||
* this case.
|
||||
**/
|
||||
void raw1394_destroy_handle(struct raw1394_handle *handle)
|
||||
{
|
||||
if (handle) {
|
||||
|
@ -173,137 +153,46 @@ void raw1394_destroy_handle(struct raw1394_handle *handle)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_fd - get the communication file descriptor
|
||||
* @handle: raw1394 handle
|
||||
*
|
||||
* Returns the fd used for communication with the raw1394 kernel module. This
|
||||
* can be used for select()/poll() calls if you wait on other fds or can be
|
||||
* integrated into another event loop (e.g. from a GUI application framework).
|
||||
* It can also be used to set/remove the O_NONBLOCK flag using fcntl() to modify
|
||||
* the blocking behaviour in raw1394_loop_iterate(). It must not be used for
|
||||
* anything else.
|
||||
**/
|
||||
int raw1394_get_fd(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->fd;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_generation - get generation number of handle
|
||||
*
|
||||
* This function returns the generation number associated with the handle. The
|
||||
* generation number is incremented on every bus reset, and every transaction
|
||||
* started by raw1394 is tagged with the stored generation number. If these
|
||||
* don't match, the transaction will abort with an error.
|
||||
*
|
||||
* The generation number of the handle is not automatically updated,
|
||||
* raw1394_update_generation() has to be used for this.
|
||||
**/
|
||||
unsigned int raw1394_get_generation(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->generation;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_update_generation - set generation number of handle
|
||||
* @gen: new generation number
|
||||
*
|
||||
* This function sets the generation number of the handle to @gen. All requests
|
||||
* that apply to a single node ID are tagged with this number and abort with an
|
||||
* error if that is different from the generation number kept in the kernel.
|
||||
* This avoids acting on the wrong node which may have changed its ID in a bus
|
||||
* reset.
|
||||
*
|
||||
* TODO HERE
|
||||
**/
|
||||
void raw1394_update_generation(struct raw1394_handle *handle, unsigned int gen)
|
||||
{
|
||||
handle->generation = gen;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_nodecount - get number of nodes on the bus
|
||||
* @handle: libraw1394 handle
|
||||
*
|
||||
* Returns the number of nodes on the bus to which the handle is connected.
|
||||
* This value can change with every bus reset. Since the root node always has
|
||||
* the highest node ID, this number can be used to determine that ID (it's
|
||||
* LOCAL_BUS|(count-1)).
|
||||
**/
|
||||
int raw1394_get_nodecount(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->num_of_nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_local_id - get local node ID
|
||||
* @handle: libraw1394 handle
|
||||
*
|
||||
* Returns the node ID of the local node connected to which the handle is
|
||||
* connected. This value can change with every bus reset.
|
||||
**/
|
||||
nodeid_t raw1394_get_local_id(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->local_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_irm_id - get node ID of isochronous resource manager
|
||||
* @handle: libraw1394 handle
|
||||
*
|
||||
* Returns the node ID of the isochronous resource manager of the bus the handle
|
||||
* is connected to. This value may change with every bus reset.
|
||||
**/
|
||||
nodeid_t raw1394_get_irm_id(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->irm_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_set_userdata - associate user data with a handle
|
||||
* @handle: raw1394 handle
|
||||
* @data: user data (pointer)
|
||||
*
|
||||
* Allows to associate one void pointer with a handle. libraw1394 does not care
|
||||
* about the data, it just stores it in the handle allowing it to be retrieved
|
||||
* at any time with raw1394_get_userdata(). This can be useful when multiple
|
||||
* handles are used, so that callbacks can identify the handle.
|
||||
**/
|
||||
void raw1394_set_userdata(struct raw1394_handle *handle, void *data)
|
||||
{
|
||||
handle->userdata = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_userdata - retrieve user data from handle
|
||||
* @handle: libraw1394 handle
|
||||
*
|
||||
* Returns the user data pointer associated with the handle using
|
||||
* raw1394_set_userdata().
|
||||
**/
|
||||
void *raw1394_get_userdata(struct raw1394_handle *handle)
|
||||
{
|
||||
return handle->userdata;
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_get_port_info - get information about available ports
|
||||
* @pinf: pointer to an array of struct raw1394_portinfo
|
||||
* @maxports: number of elements in @pinf
|
||||
*
|
||||
* Before you can set which port to use, you have to use this function to find
|
||||
* out which ports exist.
|
||||
*
|
||||
* If your program is interactive, you should present the user with this list to
|
||||
* let them decide which port to use if there is more than one. A
|
||||
* non-interactive program (and probably interactive ones, too) should provide a
|
||||
* command line option to choose the port.
|
||||
*
|
||||
* Returns the number of ports and writes information about them into @pinf, but
|
||||
* not into more than @maxports elements. If @maxports is %0, @pinf can be
|
||||
* %NULL, too.
|
||||
**/
|
||||
int raw1394_get_port_info(struct raw1394_handle *handle,
|
||||
struct raw1394_portinfo *pinf, int maxports)
|
||||
{
|
||||
|
@ -341,21 +230,6 @@ int raw1394_get_port_info(struct raw1394_handle *handle,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_set_port - choose port for handle
|
||||
* @port: port to connect to (corresponds to index of struct raw1394_portinfo)
|
||||
*
|
||||
* This function connects the handle to the port given (as queried with
|
||||
* raw1394_get_port_info()). If successful, raw1394_get_port_info() and
|
||||
* raw1394_set_port() are not allowed to be called afterwards on this handle.
|
||||
* To make up for this, all the other functions (those handling asynchronous and
|
||||
* isochronous transmissions) can now be called.
|
||||
*
|
||||
* Returns %0 for success and -1 for failure with errno set appropriately. A
|
||||
* possible failure mode is with errno = %ESTALE, in this case the configuration
|
||||
* has changed since the call to raw1394_get_port_info() and it has to be called
|
||||
* again to update your view of the available ports.
|
||||
**/
|
||||
int raw1394_set_port(struct raw1394_handle *handle, int port)
|
||||
{
|
||||
struct raw1394_request req;
|
||||
|
@ -394,16 +268,6 @@ int raw1394_set_port(struct raw1394_handle *handle, int port)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* raw1394_new_handle_on_port - create a new handle and bind it to a port
|
||||
* @port: port to connect to (same as argument to raw1394_set_port())
|
||||
*
|
||||
* Same as raw1394_new_handle(), but also binds the handle to the
|
||||
* specified 1394 port. Equivalent to raw1394_new_handle() followed by
|
||||
* raw1394_get_port_info() and raw1394_set_port(). Useful for
|
||||
* command-line programs that already know what port they want. If
|
||||
* raw1394_set_port() returns ESTALE, retries automatically.
|
||||
**/
|
||||
raw1394handle_t raw1394_new_handle_on_port(int port)
|
||||
{
|
||||
raw1394handle_t handle = raw1394_new_handle();
|
||||
|
@ -444,15 +308,6 @@ int raw1394_reset_bus_new(struct raw1394_handle *handle, int type)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_reset_bus - initiate bus reset
|
||||
*
|
||||
* This function initiates a bus reset on the connected port. Usually this is
|
||||
* not necessary and should be avoided, this function is here for low level bus
|
||||
* control and debugging.
|
||||
*
|
||||
* Returns %0 for success and -1 for failure with errno set appropriately.
|
||||
**/
|
||||
int raw1394_reset_bus(struct raw1394_handle *handle)
|
||||
{
|
||||
return raw1394_reset_bus_new (handle, RAW1394_LONG_RESET);
|
||||
|
|
1042
src/raw1394.h
1042
src/raw1394.h
File diff suppressed because it is too large
Load Diff
|
@ -31,25 +31,6 @@
|
|||
#include "raw1394_private.h"
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_start_read - initiate a read transaction
|
||||
* @node: target node
|
||||
* @addr: address to read from
|
||||
* @length: amount of data to read
|
||||
* @buffer: pointer to buffer where data will be saved
|
||||
* @tag: data to identify the request to completion handler
|
||||
*
|
||||
* This function starts the specified read request and returns %0 for success
|
||||
* and a negative number for an error, in which case errno will be set. If
|
||||
* @length is %4 a quadlet read is initiated and a block read otherwise.
|
||||
*
|
||||
* The transaction is only started, no success of the transaction is implied
|
||||
* with a successful return of this function. When the transaction completes, a
|
||||
* raw1394_loop_iterate() will call the tag handler and pass it the tag and
|
||||
* error code of the transaction. @tag should therefore be set to something
|
||||
* that uniquely identifies this transaction (e.g. a struct pointer casted to
|
||||
* unsigned long).
|
||||
**/
|
||||
int raw1394_start_read(struct raw1394_handle *handle, nodeid_t node,
|
||||
nodeaddr_t addr, size_t length, quadlet_t *buffer,
|
||||
unsigned long tag)
|
||||
|
@ -70,25 +51,6 @@ int raw1394_start_read(struct raw1394_handle *handle, nodeid_t node,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_start_write - initiate a write transaction
|
||||
* @node: target node
|
||||
* @addr: address to write to
|
||||
* @length: amount of data to write
|
||||
* @data: pointer to data to be sent
|
||||
* @tag: data to identify the request to completion handler
|
||||
*
|
||||
* This function starts the specified write request and returns %0 for success
|
||||
* and a negative number for an error, in which case errno will be set. If
|
||||
* @length is %4 a quadlet write is initiated and a block write otherwise.
|
||||
*
|
||||
* The transaction is only started, no success of the transaction is implied
|
||||
* with a successful return of this function. When the transaction completes, a
|
||||
* raw1394_loop_iterate() will call the tag handler and pass it the tag and
|
||||
* error code of the transaction. @tag should therefore be set to something
|
||||
* that uniquely identifies this transaction (e.g. a struct pointer casted to
|
||||
* unsigned long).
|
||||
**/
|
||||
int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node,
|
||||
nodeaddr_t addr, size_t length, quadlet_t *data,
|
||||
unsigned long tag)
|
||||
|
@ -109,26 +71,6 @@ int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_start_lock - initiate a lock transaction
|
||||
* @node: target node
|
||||
* @addr: address to read from
|
||||
* @extcode: extended transaction code determining the lock operation
|
||||
* @data: data part of lock parameters
|
||||
* @arg: arg part of lock parameters
|
||||
* @result: address where return value will be written
|
||||
* @tag: data to identify the request to completion handler
|
||||
*
|
||||
* This function starts the specified lock request and returns %0 for success
|
||||
* and a negative number for an error, in which case errno will be set.
|
||||
*
|
||||
* The transaction is only started, no success of the transaction is implied
|
||||
* with a successful return of this function. When the transaction completes, a
|
||||
* raw1394_loop_iterate() will call the tag handler and pass it the tag and
|
||||
* error code of the transaction. @tag should therefore be set to something
|
||||
* that uniquely identifies this transaction (e.g. a struct pointer casted to
|
||||
* unsigned long).
|
||||
**/
|
||||
int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node,
|
||||
nodeaddr_t addr, unsigned int extcode, quadlet_t data,
|
||||
quadlet_t arg, quadlet_t *result, unsigned long tag)
|
||||
|
@ -207,27 +149,6 @@ int raw1394_start_lock64(struct raw1394_handle *handle, nodeid_t node,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* raw1394_start_iso_write - initiate an isochronous packet write
|
||||
* @channel: channel number on which to send on
|
||||
* @tag: data to be put into packet's tag field
|
||||
* @sy: data to be put into packet's sy field
|
||||
* @speed: speed at which to send
|
||||
* @length: amount of data to send
|
||||
* @data: pointer to data to send
|
||||
* @rawtag: data to identify the request to completion handler
|
||||
*
|
||||
* This function starts the specified isochronous packet transmission and
|
||||
* returns %0 for success and a negative number for an error, in which case
|
||||
* errno will be set.
|
||||
*
|
||||
* When the send completes, a raw1394_loop_iterate() will call the tag handler
|
||||
* and pass it the tag and error code of the transaction. @tag should therefore
|
||||
* be set to something that uniquely identifies this transaction (e.g. a struct
|
||||
* pointer casted to unsigned long).
|
||||
*
|
||||
* Isochronous packets are automatically
|
||||
**/
|
||||
int raw1394_start_iso_write(struct raw1394_handle *handle, unsigned int channel,
|
||||
unsigned int tag, unsigned int sy,
|
||||
unsigned int speed, size_t length, quadlet_t *data,
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
/* This function is to be used by the autoconf macro to find the lib version */
|
||||
const char *raw1394_get_libversion()
|
||||
{
|
||||
return VERSION;
|
||||
|
|
Reference in New Issue