summaryrefslogtreecommitdiffstats
path: root/drivers/nubus
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
commitf969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch)
treeb3530d803df59d726afaabebc6626987dee1ca05 /drivers/nubus
parenta10ce7ef2066b455d69187643ddf2073bfc4db24 (diff)
Merge with 2.3.27.
Diffstat (limited to 'drivers/nubus')
-rw-r--r--drivers/nubus/nubus.c46
-rw-r--r--drivers/nubus/proc.c10
2 files changed, 26 insertions, 30 deletions
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 63aadb610..47b3d88fe 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -963,37 +963,39 @@ static int sprint_nubus_board(struct nubus_board* board, char* ptr, int len)
return strlen(ptr);
}
-/* We're going to have to be a bit more sophisticated about this, I
- think, because it doesn't really seem to work right when you do a
- full listing of boards and devices */
-int get_nubus_list(char *buf)
+static int nubus_read_proc(char *buf, char **start, off_t off,
+ int count, int *eof, void *data)
{
- int nprinted, len, size;
- struct nubus_board* board;
-#define MSG "\nwarning: page-size limit reached!\n"
-
- /* reserve same for truncation warning message: */
- size = PAGE_SIZE - (strlen(MSG) + 1);
- len = sprintf(buf, "Nubus boards found:\n");
+ int nprinted, len, begin = 0;
+ int slot;
+ len = sprintf(buf, "Nubus devices found:\n");
/* Walk the list of NuBus boards */
for (board = nubus_boards; board != NULL; board = board->next)
{
nprinted = sprint_nubus_board(board, buf + len, size - len);
- if (nprinted < 0) {
- return len + sprintf(buf + len, MSG);
- }
+ if (nprinted < 0)
+ break;
len += nprinted;
+ if (len+begin < off) {
+ begin += len;
+ len = 0;
+ }
+ if (len+begin >= off+count)
+ break;
}
+ if (slot==16 || len+begin < off)
+ *eof = 1;
+ off -= begin;
+ *strat = buf + off;
+ len -= off;
+ if (len>count)
+ len = count;
+ if (len<0)
+ len = 0;
return len;
}
-
-static struct proc_dir_entry proc_old_nubus = {
- PROC_NUBUS, 5, "nubus",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_array_inode_operations
-};
-#endif /* CONFIG_PROC_FS */
+#endif
void __init nubus_scan_bus(void)
{
@@ -1034,7 +1036,7 @@ void __init nubus_init(void)
nubus_scan_bus();
#ifdef CONFIG_PROC_FS
- proc_register(&proc_root, &proc_old_nubus);
+ create_proc_read_entry("nubus", 0, NULL, nubus_read_proc, NULL);
nubus_proc_init();
#endif
}
diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c
index 1e5754b16..d21b6f995 100644
--- a/drivers/nubus/proc.c
+++ b/drivers/nubus/proc.c
@@ -60,13 +60,6 @@ get_nubus_dev_info(char *buf, char **start, off_t pos, int count, int wr)
return (count > cnt) ? cnt : count;
}
-static struct proc_dir_entry proc_nubus_devices = {
- PROC_BUS_NUBUS_DEVICES, 7, "devices",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_array_inode_operations,
- get_nubus_dev_info
-};
-
static struct proc_dir_entry *proc_bus_nubus_dir;
static void nubus_proc_subdir(struct nubus_dev* dev,
@@ -178,6 +171,7 @@ void __init nubus_proc_init(void)
if (!MACH_IS_MAC)
return;
proc_bus_nubus_dir = create_proc_entry("nubus", S_IFDIR, proc_bus);
- proc_register(proc_bus_nubus_dir, &proc_nubus_devices);
+ create_proc_info_entry("devices", 0, proc_bus_nubus_dir,
+ get_nubus_dev_info);
proc_bus_nubus_add_devices();
}