<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&#39;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 &quot;Sample kobject implementation&quot; as base of my code. But as 4h of work there some points that I didn&#39;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">&lt;<a href="mailto:greg@kroah.com" target="_blank">greg@kroah.com</a>&gt;</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>
&gt; (Forget the last e-mail, please, stupid Gmail)<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m looking for some information about :<br>
&gt;<br>
&gt; struct kobj_attribute {<br>
&gt;         struct attribute attr;<br>
&gt;         ssize_t (*show)(struct kobject *kobj, struct kobj_attribute<br>
&gt; *attr, char *buf);<br>
&gt;         ssize_t (*store)(struct kobject *kobj, struct kobj_attribute<br>
&gt; *attr, const char *buf, size_t count);<br>
&gt; };<br>
&gt;<br>
&gt;<br>
&gt; My function to handle the operation:<br>
&gt;<br>
&gt; static ssize_t my_store(struct kobject *kobj, struct kobj_attribute *attr,<br>
&gt; const char *buf, size_t count) {<br>
&gt;  char *buffer;<br>
&gt;<br>
&gt;         buffer = (char*) kcalloc(count, sizeof(char), GFP_KERNEL);<br>
&gt;<br>
&gt;         copy_from_user(buffer, buf, count);<br>
&gt;         .....<br>
&gt;         .....<br>
&gt;         etc....<br>
&gt; }<br>
&gt;<br>
</div>&gt; So, this *const char *buf, *where ti come from ? Kernel space?<br>
<br>
I&#39;m guessing you didn&#39;t read the kobject documentation that is in the<br>
kernel tree?<br>
</blockquote></div><br></div>