return 0;
}
+static int can_chip_procinfo(char *buf, char **start, off_t offset,
+ int count, int *eof, void *data)
+{
+ struct canchip_t *chip=data;
+ int len=0;
+
+ /* Generic chip info */
+ len += sprintf(buf+len,"type : %s\n",chip->chip_type);
+ len += sprintf(buf+len,"index : %d\n",chip->chip_idx);
+ len += sprintf(buf+len,"irq : %d\n",chip->chip_irq);
+ len += sprintf(buf+len,"addr : %lu\n",chip->chip_base_addr);
+ len += sprintf(buf+len,"config : %s\n",
+ (chip->flags & CHIP_CONFIGURED) ? "yes":"no");
+ len += sprintf(buf+len,"clock : %ld Hz\n",chip->clock);
+ len += sprintf(buf+len,"baud : %ld\n",chip->baudrate);
+ len += sprintf(buf+len,"num obj : %d\n",chip->max_objects);
+
+
+#if 0
+ /* Chip specific info if available */
+ if(chip->chipspecops->get_info)
+ len += (chip->chipspecops->get_info)(chip,buf+len);
+#endif
+
+ *eof = 1;
+ return len;
+}
+
+
int add_channel_to_procdir(struct candevice_t *candev)
{
int i=0;
add_object_to_procdir(cc);
+ create_proc_read_entry("chip_info", /* proc entry name */
+ 0, /* protection mask, 0->default */
+ base->channel[cc]->ch_entry, /* parent dir, NULL->/proc */
+ can_chip_procinfo,
+ candev->chip[i]);
+
cc++;
}
cc--;
if(!base->channel[cc]) continue;
+
+ remove_proc_entry("chip_info", base->channel[cc]->ch_entry);
if (remove_object_from_procdir(cc))
return -ENODEV;