master/sdo.c
changeset 962 ea83a7aab57a
parent 847 92266462d411
child 963 01702c78fe0a
equal deleted inserted replaced
961:8aa60dd6cbc7 962:ea83a7aab57a
    87 {
    87 {
    88     sdo->slave = slave;
    88     sdo->slave = slave;
    89     sdo->index = index;
    89     sdo->index = index;
    90     sdo->object_code = 0x00;
    90     sdo->object_code = 0x00;
    91     sdo->name = NULL;
    91     sdo->name = NULL;
    92     sdo->subindices = 0;
    92     sdo->max_subindex = 0;
    93     INIT_LIST_HEAD(&sdo->entries);
    93     INIT_LIST_HEAD(&sdo->entries);
    94 
    94 
    95     // Init kobject and add it to the hierarchy
    95     // Init kobject and add it to the hierarchy
    96     memset(&sdo->kobj, 0x00, sizeof(struct kobject));
    96     memset(&sdo->kobj, 0x00, sizeof(struct kobject));
    97     kobject_init(&sdo->kobj);
    97     kobject_init(&sdo->kobj);
   187 {
   187 {
   188     off_t off = 0;
   188     off_t off = 0;
   189 
   189 
   190     off += sprintf(buffer + off, "Index: 0x%04X\n", sdo->index);
   190     off += sprintf(buffer + off, "Index: 0x%04X\n", sdo->index);
   191     off += sprintf(buffer + off, "Name: %s\n", sdo->name ? sdo->name : "");
   191     off += sprintf(buffer + off, "Name: %s\n", sdo->name ? sdo->name : "");
   192     off += sprintf(buffer + off, "Subindices: %i\n", sdo->subindices);
   192     off += sprintf(buffer + off, "Max subindex: %u\n", sdo->max_subindex);
   193 
   193 
   194     return off;
   194     return off;
   195 }
   195 }
   196 
   196 
   197 /*****************************************************************************/
   197 /*****************************************************************************/