[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm
Subject:    RE: Callback Function
From:       Messerer Juergen <juergen.messerer () siemens ! com>
Date:       2002-09-24 6:13:15
[Download RAW message or body]

Why don't you use the poll() function??

Best regards

Juergen


-----Original Message-----
From: Richard Guinto [mailto:argie_guinto@yahoo.com]
Sent: Dienstag, 24. September 2002 05:15
To: linux-arm@lists.arm.linux.org.uk
Subject: Re: Callback Function


The hotplug invokes a user program when a device is
attached to USB or PCI bus.  This may not be what I
need.  Here's my real problem:

I have an application running which uses my usb
driver.  In my usb driver, I used the non-blocking URB
function.  I wan't my application to be informed when
a bulk out transfer is completed.  Here's some part of
my application code:

typedef void (*USBCallback)(void);

void USBDataConsumed(void)
{
 printf("Bulk Out completed!\n");
}

void main()
{
 ....

 SendBulkOut(..., &USBDataConsumed, ...);

...

}


Some part of my usb driver code (in kernel space):

SendBulkOut(...,  USBCallback pCallback)
{
 ....
 
 mypurb = usb_alloc_urb(0);
 ....
 mypurb->complete = &USBComplete;
 mypurb->context = pCallback;

 usb_submit_urb(mypurb);

 ...

}

void USBComplete(struct urb *purb)
{
 ....
 
 purb->pCallback(); //at this point, KERNEL PANIC!!!

 return;
}
 
Thanks,

Richard

> 
> Message: 3
> Date: Mon, 23 Sep 2002 10:05:07 +0100
> From: Russell King - ARM Linux
> <linux@arm.linux.org.uk>
> To: Richard Guinto <argie_guinto@yahoo.com>
> Cc: linux-arm@lists.arm.linux.org.uk
> Subject: Re: Callback function
> 
> On Sun, Sep 22, 2002 at 06:09:09PM -0700, Richard
> Guinto wrote:
> > How can a program running in kernel space call a
> > function in user space?
> 
> see the hotplug stuff for an example.  You call an
> external user space
> program.
> 
> > I passed a function pointer from an application to
> my
> > code running in kernel space, but I always got a
> > kernel panic when I call that function.  How can I
> > resolve this?
> 
> You *certainly* don't do it that way.
> 
> 
> --__--__--
> 
> Message: 4
> From: Michele Cimenti <mcimenti@solari.it>
> Organization: SOLARI UDINE
> To: linux-arm@lists.arm.linux.org.uk
> Subject: CS4 bus access on SA1110
> Date: Mon, 23 Sep 2002 11:59:26 +0200
> 
> When I access a device on CS4 memory space I got
> wrong data values.  The
> physical address is remapped using MMU. Using the
> oscilloscope I see that when
> 4 bytes aligned adresses are used SA1110 makes only
> one access to the device,
> but when 2 or 1 byte aligned adresses (0x40000201,
> 0x40000202 ecc.) are used
> SA1110 reads 4 consecutive bytes starting from
> selected address. Data read is
> correct only for 4 bytes aligned adresses
> (0x40000200, 0x40000204, ecc).
> 
> If MMU is disabled SA1110 makes only one memory
> access for any address and data
> is as expected.
> 
> May someone experienced (and possibily solved) this
> problem...
> Any suggestion will be apreciated.
> 
> Michele
> 
> 
> --__--__--
> 
> Message: 5
> Date: Mon, 23 Sep 2002 11:35:24 +0100
> From: Russell King - ARM Linux
> <linux@arm.linux.org.uk>
> To: Michele Cimenti <mcimenti@solari.it>
> Cc: linux-arm@lists.arm.linux.org.uk
> Subject: Re: CS4 bus access on SA1110
> 
> On Mon, Sep 23, 2002 at 11:59:26AM +0200, Michele
> Cimenti wrote:
> > When I access a device on CS4 memory space I got
> wrong data values.  The
> > physical address is remapped using MMU.
> 
> You don't give any details of the remapping.
> (address, type, control bits,
> page table bits, etc)
> 
> We can only guess without this information.
> 
> 
> --__--__--
> 
> Message: 6
> From: "Paul Chitescu" <Paul.Chitescu@IMC-Group.org>
> To: <linux-arm@lists.arm.linux.org.uk>
> Subject: Re: CS4 bus access on SA1110
> Date: Mon, 23 Sep 2002 13:47:32 +0300
> Organization: IMC Group
> 
> From: "Michele Cimenti" <mcimenti@solari.it>:
> > When I access a device on CS4 memory space I got
> wrong data values.  The
> > physical address is remapped using MMU. Using the
> oscilloscope I see that
> when
> > 4 bytes aligned adresses are used SA1110 makes
> only one access to the
> device,
> > but when 2 or 1 byte aligned adresses (0x40000201,
> 0x40000202 ecc.) are
> used
> > SA1110 reads 4 consecutive bytes starting from
> selected address. Data read
> is
> 
=== message truncated ===


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

-------------------------------------------------------------------
Subscription options:
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette:       http://www.arm.linux.org.uk/armlinux/mailinglists.php

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette:       http://www.arm.linux.org.uk/armlinux/mailinglists.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic