Re: fcp handling
Brought to you by:
aeb,
bencollins
From: Andreas B. <and...@mu...> - 2000-03-27 00:54:08
|
On Sun, Mar 26, 2000 at 07:30:51PM +0200, Manfred Weihs wrote: > If I understood the code correctly, then by issuing > raw1394_start_fcp_listen we tell the kernel to store the packets > arriving in a buffer array which is located in raw1394_handle. BTW: That > ist the same buffer which is used for iso packets, so it would probably > be advisable for people, who are listening for iso_packets _and_ > fcp_frames, to allocate two seperate handles for those two purposes (I > think, that should be mentioned in a comment in raw1394.h). The buffer is only overwritten on a raw1394_loop_iterate() call which then calls the handlers. After a handler ends, the corresponding data is invalid (the handler must process the data immediately or save it somewhere else if it really has to store plain data). Therefore there won't be problems with correct usage. In the future the address given to an iso or FCP handler might not even exist anymore since I intend to implement kernel-to-user memory mapping at some point in the future and the page containing the data could be unmapped immediately after use. > I am also not quit sure, if it was a good idea to mix up the reception > of fcp commands and responses into one handler, since an application > might be interested in only listening to either commands or responses > (of cource, if somebody wants to implement a fully AV/C-compliant unit, > he will have to handle both). Future optimization. For now this just amounts in unneccessary handler calls (and data copies) but doesn't create any realy problems. Just ignore handler calls with the wrong direction argument. > In that context I have another qestion: > If two application (or one application using two raw-handles) register > for listening at the FCP addresses, which buffer will be used? Or will > the kernel create two copies of that packet in both raw-handle-buffers? > I think that the kernel will do this, but I just wanted to ask, because > I was not sure, and studying the source-code is not easy... The FCP data (like iso data) is stored once in the kernel and then copied to each listening app. The data in kernel is deleted after the reference count reaches zero (all apps got a copy). -- Andreas E. Bombe <and...@mu...> http://home.pages.de/~andreas.bombe/ DSA key 0x04880A44 |