Modified support for 32/64 bit environments, control struct fields have fixed size now.
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@27 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
parent
8942a29ac1
commit
3b8b4c0ae9
2
NEWS
2
NEWS
|
@ -1,6 +1,8 @@
|
|||
|
||||
Version 0.7:
|
||||
|
||||
- added support for environments where the kernel runs in 64 bit mode whereas
|
||||
user space runs in 32 bit mode
|
||||
- fixed lock transaction to actually return the required response; these
|
||||
functions are actually useful now, prototypes for raw1394_start_lock and
|
||||
raw1394_lock changed
|
||||
|
|
13
configure.in
13
configure.in
|
@ -4,20 +4,7 @@ AC_INIT(Makefile.am)
|
|||
AM_INIT_AUTOMAKE(libraw1394, 0.6)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
# AC_CANONICAL_HOST
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
|
||||
AC_ARG_ENABLE(32-64,
|
||||
[ --enable-32-64 support systems with 64 bit kernel and 32 bit userland],
|
||||
[
|
||||
case $enableval in
|
||||
yes) AC_DEFINE(KERNEL64_USER32) ;;
|
||||
no) ;;
|
||||
*) AC_MSG_ERROR([ Invalid arg for --enable-32-64 ])
|
||||
esac
|
||||
])
|
||||
|
||||
AC_OUTPUT([ Makefile src/Makefile debian/Makefile ])
|
||||
|
|
|
@ -18,8 +18,8 @@ static int do_fcp_listen(struct raw1394_handle *handle, int startstop)
|
|||
req->type = RAW1394_REQ_FCP_LISTEN;
|
||||
req->generation = handle->generation;
|
||||
req->misc = startstop;
|
||||
req->tag = (unsigned long)&rh;
|
||||
req->recvb = (kptr_t)handle->buffer;
|
||||
req->tag = (__u64)&rh;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->length = 512;
|
||||
|
||||
err = write(handle->fd, req, sizeof(*req));
|
||||
|
|
|
@ -19,8 +19,8 @@ static int do_iso_listen(struct raw1394_handle *handle, int channel)
|
|||
req->type = RAW1394_REQ_ISO_LISTEN;
|
||||
req->generation = handle->generation;
|
||||
req->misc = channel;
|
||||
req->tag = (unsigned long)&rh;
|
||||
req->recvb = (kptr_t)handle->buffer;
|
||||
req->tag = (__u64)&rh;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->length = HBUF_SIZE;
|
||||
|
||||
err = write(handle->fd, req, sizeof(*req));
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
#ifndef IEEE1394_RAW1394_H
|
||||
#define IEEE1394_RAW1394_H
|
||||
|
||||
#define RAW1394_DEVICE_MAJOR 171
|
||||
#define RAW1394_DEVICE_NAME "raw1394"
|
||||
|
||||
#define RAW1394_KERNELAPI_VERSION 2
|
||||
#define RAW1394_KERNELAPI_VERSION 3
|
||||
|
||||
/* state: opened */
|
||||
#define RAW1394_REQ_INITIALIZE 1
|
||||
|
@ -45,30 +44,27 @@
|
|||
#define RAW1394_ERROR_TIMEOUT (-1102)
|
||||
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
struct raw1394_request {
|
||||
int type;
|
||||
int error;
|
||||
int misc;
|
||||
__s16 type;
|
||||
__s16 error;
|
||||
__u32 misc;
|
||||
|
||||
unsigned int generation;
|
||||
octlet_t address;
|
||||
__u32 generation;
|
||||
__u32 length;
|
||||
|
||||
unsigned long tag;
|
||||
__u64 address;
|
||||
|
||||
size_t length;
|
||||
__u64 tag;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
quadlet_t *sendb;
|
||||
quadlet_t *recvb;
|
||||
#else
|
||||
kptr_t sendb;
|
||||
kptr_t recvb;
|
||||
#endif
|
||||
__u64 sendb;
|
||||
__u64 recvb;
|
||||
};
|
||||
|
||||
struct raw1394_khost_list {
|
||||
int nodes;
|
||||
char name[32];
|
||||
__u32 nodes;
|
||||
__u8 name[32];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
|
|
@ -135,7 +135,7 @@ int raw1394_get_port_info(struct raw1394_handle *handle,
|
|||
CLEAR_REQ(req);
|
||||
req->type = RAW1394_REQ_LIST_CARDS;
|
||||
req->generation = handle->generation;
|
||||
req->recvb = (kptr_t)handle->buffer;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->length = HBUF_SIZE;
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -20,9 +20,9 @@ int raw1394_start_read(struct raw1394_handle *handle, nodeid_t node,
|
|||
req->generation = handle->generation;
|
||||
req->tag = tag;
|
||||
|
||||
req->address = ((u_int64_t)node << 48) | addr;
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->length = length;
|
||||
req->recvb = (kptr_t)buffer;
|
||||
req->recvb = (__u64)buffer;
|
||||
|
||||
return (int)write(handle->fd, req, sizeof(*req));
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node,
|
|||
req->generation = handle->generation;
|
||||
req->tag = tag;
|
||||
|
||||
req->address = ((u_int64_t)node << 48) | addr;
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->length = length;
|
||||
req->sendb = (kptr_t)data;
|
||||
req->sendb = (__u64)data;
|
||||
|
||||
return (int)write(handle->fd, req, sizeof(*req));
|
||||
}
|
||||
|
@ -64,9 +64,9 @@ int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node,
|
|||
req->generation = handle->generation;
|
||||
req->tag = tag;
|
||||
|
||||
req->address = ((u_int64_t)node << 48) | addr;
|
||||
req->sendb = (kptr_t)sendbuf;
|
||||
req->recvb = (kptr_t)result;
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->sendb = (__u64)sendbuf;
|
||||
req->recvb = (__u64)result;
|
||||
req->misc = extcode;
|
||||
|
||||
switch (extcode) {
|
||||
|
|
Reference in New Issue