<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Greg, </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><span style="font-family:arial,sans-serif;font-size:13px">I'm still trying to understand the sysfs. </span><div style="font-family:arial,sans-serif;font-size:13px">
I indeed read the documentation, I was using your "Sample kobject implementation" as base of my code. But as 4h of work there some points that I didn't understand yet.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>--</div>Lucas Tanure <br>+55 (19) 988176559<br></div></div>
<br><br><div class="gmail_quote">On Wed, Sep 3, 2014 at 9:23 PM, Greg KH <span dir="ltr"><<a href="mailto:greg@kroah.com" target="_blank">greg@kroah.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Wed, Sep 03, 2014 at 09:10:41PM -0300, Lucas Tanure wrote:<br>
> (Forget the last e-mail, please, stupid Gmail)<br>
><br>
> Hi,<br>
><br>
> I'm looking for some information about :<br>
><br>
> struct kobj_attribute {<br>
> struct attribute attr;<br>
> ssize_t (*show)(struct kobject *kobj, struct kobj_attribute<br>
> *attr, char *buf);<br>
> ssize_t (*store)(struct kobject *kobj, struct kobj_attribute<br>
> *attr, const char *buf, size_t count);<br>
> };<br>
><br>
><br>
> My function to handle the operation:<br>
><br>
> static ssize_t my_store(struct kobject *kobj, struct kobj_attribute *attr,<br>
> const char *buf, size_t count) {<br>
> char *buffer;<br>
><br>
> buffer = (char*) kcalloc(count, sizeof(char), GFP_KERNEL);<br>
><br>
> copy_from_user(buffer, buf, count);<br>
> .....<br>
> .....<br>
> etc....<br>
> }<br>
><br>
</div>> So, this *const char *buf, *where ti come from ? Kernel space?<br>
<br>
I'm guessing you didn't read the kobject documentation that is in the<br>
kernel tree?<br>
</blockquote></div><br></div>