Thanks for the reply Dave. I am doing the read inside the interrupt
service routine:
> > > // interrupt handler
> > > static int interrupt_handler(void)
> > > {
> > >
> > > interruptcount++;
> > > printk(">>> PC104 BUS INT: interruptcount=%d\n",
interruptcount);
> > >
> > > printk("PC104 Samples: 0x%04X\n", PEEK16(base)); <--
> > >
> > > /* Data ready. Wake up userspace process */
> > > data_not_ready = 0;
> > > wake_up_interruptible(&pc104_wait);
> > >
> > > return IRQ_HANDLED;
> > > }
I agree it must be a software problem but I'm not sure where? Should I
be using the inline macros or is there a different way to access in
kernel space?
Thanks,
Elliot
--- In David Hawkins <> wrote:
>
> Hi Elliot,
>
> > Thanks for the info Frank. My PC104 daughterboard is actually a home
> > brew FPGA board. If you wouldn't mind sharing the source to your hack
> > that would give me something to try as I'm running out of ideas...
>
> The fact that mmap works and kernel code doesn't would lead
> me to believe its a software issue, not the hardware.
>
> >>>> Here is my kernel module:
>
> >>>> static ssize_t pc104_read (struct file *file, char *buf,
> >>>> size_t count, loff_t *ppos) {
> >>>> int len, err;
> >>>>
> >>>> // check if we have data - if not, sleep
> >>>> // wake up in interrupt_handler
> >>>> while (data_not_ready) {
> >>>> interruptible_sleep_on(&pc104_wait);
> >>>> }
> >>>> data_not_ready = 1;
> >>>>
> >>>> /* Add read code here */
> >>>> return len;
> >>>> }
>
> Where are you 'reading'. There's no code here to access
> the PC104 base address?
>
> >>>> // write function called when to /dev/skeleton is written
> >>>> static ssize_t pc104_write (struct file *file, const char *buf,
> >>>> size_t count, loff_t *ppos) {
> >>>> int err;
> >>>> err = copy_from_user(string,buf,count);
> >>>> if (err != 0)
> >>>> return -EFAULT;
> >>>> counter += count;
> >>>> return count;
> >>>> }
>
> You wrote to a buffer, not to PC104.
>
> Perhaps this is not the correct code. Send the code that
> actually accesses the PC104 bus :)
>
> Cheers,
> Dave
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|