|
|
Subscribe / Log in / New account

Driver porting: The seq_file interface

Driver porting: The seq_file interface

Posted Dec 12, 2008 11:26 UTC (Fri) by iw2lsi (guest, #54769)
Parent article: Driver porting: The seq_file interface

Hi all

is it normal to have more than one stop while reading a seq file ?

actually I have a list with 37 items but I get a "spontaneous" stop while processing element nine, and than a new start with the element ten (*pos=10).

after some hours (ok, two day :D) of debugging, it's all working now.. but it was really difficult for me to understand seq_file interface :D

thanks

Giampaolo


to post comments

Driver porting: The seq_file interface

Posted Dec 14, 2013 15:15 UTC (Sat) by Lieta (guest, #94383) [Link] (1 responses)

I think it calls stop at the end of every page (4 KB), followed by the start.
At the end of file it calls stop, then start, followed by one more stop.
So it works like this:
.start
.stop
---PAGE---
.start
.stop
---PAGE---
...
.stop
.start
.stop
---EOF---
Special case is when the file is empty. Then there are just two calls (not 4): one .start one .stop.

Driver porting: The seq_file interface

Posted Dec 14, 2013 15:23 UTC (Sat) by Lieta (guest, #94383) [Link]

...
.stop(A)
.start
.stop(B)
---EOF---
There is a problem to differ the .stop(A) from .stop(B) when you have to return some resource (e.g. semaphore), that has been taken in .start, back at the end of sequence. The position counter is equal in both (A) and (B), because you are at EOF.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds