patch-2.3.43 linux/drivers/sbus/char/jsflash.c
Next file: linux/drivers/sbus/char/openprom.c
Previous file: linux/drivers/sbus/char/flash.c
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
Wed Feb 9 11:42:35 2000
- Orig file:
v2.3.42/linux/drivers/sbus/char/jsflash.c
- Orig date:
Fri Jan 28 15:09:08 2000
diff -u --recursive --new-file v2.3.42/linux/drivers/sbus/char/jsflash.c linux/drivers/sbus/char/jsflash.c
@@ -30,6 +30,7 @@
#include <linux/fcntl.h>
#include <linux/poll.h>
#include <linux/init.h>
+#include <linux/string.h>
#if 0 /* P3 from mem.c */
#include <linux/mm.h>
#include <linux/vmalloc.h>
@@ -47,6 +48,8 @@
#include <asm/sbus.h>
#include <asm/ebus.h>
#endif
+#include <asm/pcic.h>
+#include <asm/oplib.h>
#include <asm/jsflash.h> /* ioctl arguments. <linux/> ?? */
#define JSFIDSZ (sizeof(struct jsflash_ident_arg))
@@ -357,17 +360,13 @@
}
static struct file_operations jsf_fops = {
- jsf_lseek,
- jsf_read,
- jsf_write,
- NULL, /* readdir */
- NULL, /* poll */
- jsf_ioctl,
- jsf_mmap,
- jsf_open,
- NULL, /* flush */
- jsf_release,
- NULL /* fsync */
+ llseek: jsf_lseek,
+ read: jsf_read,
+ write: jsf_write,
+ ioctl: jsf_ioctl,
+ mmap: jsf_mmap,
+ open: jsf_open,
+ release: jsf_release,
};
static struct miscdevice jsf_dev = { JSF_MINOR, "jsflash", &jsf_fops };
@@ -377,10 +376,16 @@
#ifdef MODULE
int init_module(void)
#else
-int /* __init */ jsflash_init(void)
+int __init jsflash_init(void)
#endif
{
int rc;
+ char banner[128];
+
+ /* FIXME: Really autodetect things */
+ prom_getproperty(prom_root_node, "banner-name", banner, 128);
+ if (strcmp (banner, "JavaStation-NC") && strcmp (banner, "JavaStation-E"))
+ return -ENXIO;
/* extern enum sparc_cpu sparc_cpu_model; */ /* in <asm/system.h> */
if (sparc_cpu_model == sun4m && jsf0.base == 0) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)