LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2012, 04:27 PM   #1
cdaum
LQ Newbie
 
Registered: Sep 2012
Distribution: RHEL6
Posts: 1

Rep: Reputation: Disabled
Thumbs up can not read from 1394 device with new firewire stack - 2.6.36.4-RedHawk-6.0.4


I have installed libraw1394 and wrote a program to read and write via firewire. I tested it between a Ubuntu 12.04 box and my redhawk machine. with success. I tried using the same read program to read raw1394 data from a custom piece of hardware with no success. I know the device is spitting out data.

I was told that my redhawk machine needed to use raw1394. So i built the kernel modules for ieee1394 and raw1394 and did an insmod for both of them. Still no success.

Here is the code and output...

#include <stdio.h>
#include <string.h>
#include <libraw1394/raw1394.h>
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#define MAXPORTS 6


unsigned char gBuffer[4096];
int gDataLength;
bool gFlag;


enum raw1394_iso_disposition isoHandler(raw1394handle_t handle,
unsigned char *data,
unsigned int len,
unsigned char channel,
unsigned char tag,
unsigned char sy,
unsigned int cycle,
unsigned int dropped)
{
printf("Iso packet received! Length %08X, tag %08X, sy %08X, cycle %08X dropped: ", len, tag, sy, cycle,dropped);

memcpy(&gBuffer[0],data,len);
gDataLength = len;

for(int i = 0; i<len; i++)
{
printf("%02X ",gBuffer[i]);

if(!(i % 10))
printf("\n");
}

return RAW1394_ISO_OK;
}

int main(int argc, char* argv[]){

raw1394handle_t raw1394_h;
struct raw1394_portinfo pinf[6];
int nports,status;
char resp;

if(!(raw1394_h = raw1394_new_handle())) {
perror("Device1394:pen_input: raw1394_get_handle");
return 1;
}


int tFwFD = raw1394_get_fd(raw1394_h);
status = fcntl(tFwFD,F_SETFL,O_NONBLOCK);

nports=raw1394_get_port_info(raw1394_h, pinf, MAXPORTS);

printf("%d ports found :\n",nports);
for (int i=0; i< nports; i++)
printf(" port %d: nodecount %d name %s \n",i,pinf[i].nodes,pinf[i].name);

if(raw1394_set_port(raw1394_h, 0) < 0) {
perror("Device1394:pen_input: raw1394_set_port");
raw1394_destroy_handle(raw1394_h);
return 1;
}



/*
int raw1394_iso_recv_init (raw1394handle_t handle,
raw1394_iso_recv_handler_t handler,
unsigned int buf_packets,
unsigned int max_packet_size,
unsigned char channel,
enum raw1394_iso_dma_recv_mode mode,
int irq_interval);
*/


status = raw1394_iso_recv_init (raw1394_h,isoHandler ,2000, 1000, 62,RAW1394_DMA_DEFAULT, -1);
int temp = raw1394_errcode_to_errno(status);
printf("Receive init. Status = %d\n, errno = %d translated %d\n", status, errno,temp);
perror("rec init - ");


/*
int raw1394_iso_recv_start (raw1394handle_t handle,
int start_on_cycle,
int tag_mask,
int sync);
*/
status = raw1394_iso_recv_start(raw1394_h,-1, -1, 0);
printf("Started isoch receive. Status = %d\n, errno = %d\n", status, errno);

while(1)
{

raw1394_loop_iterate(raw1394_h);
printf("next...\n");
}

return 0;
}

1 ports found :
port 0: nodecount 1 name /dev/fw0

Receive init. Status = 0
, errno = 2 translated 57005
rec init - : No such file or directory
Started isoch receive. Status = 0
, errno = 2

^C


Any help would be appreciated! Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IEEE 1394 (Firewire ) problem on Ubuntu 10.10 ? Girts Ubuntu 4 10-31-2010 08:43 AM
firewire (1394) networking mastahnke Linux - Networking 6 05-26-2009 11:06 AM
Firewire 1394 help please studysession Red Hat 1 04-27-2004 03:00 PM
PCMCIA Firewire 1394 Toshiba Laptop mvallamp Linux - Laptop and Netbook 3 09-26-2003 05:01 AM
1394 Firewire flex411 Linux - General 0 05-10-2001 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration