diff -ru linux-2.1.103-virgin/arch/ppc/config.in linux-2.1.103-adb-proc/arch/ppc/config.in --- linux-2.1.103-virgin/arch/ppc/config.in Sun May 31 20:04:16 1998 +++ linux-2.1.103-adb-proc/arch/ppc/config.in Wed Sep 9 11:59:06 1998 @@ -62,6 +62,7 @@ bool 'Sysctl support' CONFIG_SYSCTL bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT +bool 'Apple Desktop Bus Accounting' CONFIG_ADB_ACCT # only elf supported, a.out is not -- Cort define_bool CONFIG_BINFMT_ELF y diff -ru linux-2.1.103-virgin/drivers/macintosh/adb.c linux-2.1.103-adb-proc/drivers/macintosh/adb.c --- linux-2.1.103-virgin/drivers/macintosh/adb.c Mon May 4 22:55:55 1998 +++ linux-2.1.103-adb-proc/drivers/macintosh/adb.c Wed Sep 9 12:27:04 1998 @@ -19,6 +19,10 @@ #include #include +#ifdef CONFIG_ADB_ACCT +#include +#endif + enum adb_hw adb_hardware = ADB_NONE; int (*adb_send_request)(struct adb_request *req, int sync); int (*adb_autopoll)(int on); @@ -28,6 +32,10 @@ void (*handler)(unsigned char *, int, struct pt_regs *, int); int original_address; int handler_id; +#ifdef CONFIG_ADB_ACCT + unsigned int inp; + unsigned int outp; +#endif } adb_handler[16]; __openfirmware @@ -37,6 +45,7 @@ return -1; } + #if 0 static void printADBreply(struct adb_request *req) { @@ -138,6 +147,33 @@ printk("\n"); } +#ifdef CONFIG_ADB_ACCT +int adb_proc_read_devices(char *buf, char **start, off_t offset, + int len, int unused){ + + int i; + len = 0; + len += sprintf(buf+len, + "Dev ID\tOrig ID\tHandler ID\tIN\tOUT\tHandler func\n"); + for ( i = 0 ; i < 16 ; i++) + len += sprintf(buf+len, + " %d \t%d \t%d \t%u\tNA\t0x%x\n", + i, adb_handler[i].original_address, adb_handler[i].handler_id, + adb_handler[i].inp,/*adb_handler[i].outp,*/adb_handler[i].handler); + return len; +} + +struct proc_dir_entry adb_proc_entry = { + 0, + 11, "adb-devices", + S_IFREG | S_IRUGO, + 1,0,0, + 0, + NULL, + &adb_proc_read_devices, +}; +#endif /*CONFIG_ADB_ACCT*/ + void adb_init(void) { adb_send_request = (void *) adb_nodev; @@ -153,6 +189,9 @@ adb_scan_bus(); adb_autopoll(1); } +#ifdef CONFIG_ADB_ACCT + proc_register(&proc_root,&adb_proc_entry); +#endif /*CONFIG_ADB_ACCT*/ } int @@ -215,6 +254,9 @@ printk(" %x", buf[i]); printk(", id = %d\n", id); } +#ifdef CONFIG_ADB_ACCT + adb_handler[id].inp++; +#endif if (adb_handler[id].handler != 0) { (*adb_handler[id].handler)(buf, nb, regs, autopoll); }