/* Driver interface functions, more or less like in pci.c */
struct nubus_dev*
-nubus_find_device(unsigned short category, unsigned short type,
- unsigned short dr_hw, unsigned short dr_sw,
- const struct nubus_dev *from)
-{
- struct nubus_dev *itor = from ? from->next : nubus_devices;
-
- while (itor) {
- if (itor->category == category && itor->type == type &&
- itor->dr_hw == dr_hw && itor->dr_sw == dr_sw)
- return itor;
- itor = itor->next;
- }
- return NULL;
-}
-EXPORT_SYMBOL(nubus_find_device);
-
-struct nubus_dev*
nubus_find_type(unsigned short category, unsigned short type,
const struct nubus_dev *from)
{
}
case NUBUS_RESID_NAME:
{
- nubus_get_rsrc_str(dev->name, &ent, sizeof(dev->name));
- pr_debug(" name: %s\n", dev->name);
+ char name[64];
+
+ nubus_get_rsrc_str(name, &ent, sizeof(name));
+ pr_debug(" name: %s\n", name);
break;
}
case NUBUS_RESID_DRVRDIR:
use this :-) */
struct nubus_dir drvr_dir;
struct nubus_dirent drvr_ent;
+ unsigned char *driver;
nubus_get_subdir(&ent, &drvr_dir);
nubus_readdir(&drvr_dir, &drvr_ent);
- dev->driver = nubus_dirptr(&drvr_ent);
- pr_debug(" driver at: 0x%p\n", dev->driver);
+ driver = nubus_dirptr(&drvr_ent);
+ pr_debug(" driver at: 0x%p\n", driver);
break;
}
case NUBUS_RESID_MINOR_BASEOS:
+ {
/* We will need this in order to support
multiple framebuffers. It might be handy
for Ethernet as well */
- nubus_get_rsrc_mem(&dev->iobase, &ent, 4);
- pr_debug(" memory offset: 0x%08lx\n", dev->iobase);
+ u32 base_offset;
+
+ nubus_get_rsrc_mem(&base_offset, &ent, 4);
+ pr_debug(" memory offset: 0x%08x\n", base_offset);
break;
+ }
case NUBUS_RESID_MINOR_LENGTH:
+ {
/* Ditto */
- nubus_get_rsrc_mem(&dev->iosize, &ent, 4);
- pr_debug(" memory length: 0x%08lx\n", dev->iosize);
+ u32 length;
+
+ nubus_get_rsrc_mem(&length, &ent, 4);
+ pr_debug(" memory length: 0x%08x\n", length);
break;
+ }
case NUBUS_RESID_FLAGS:
- dev->flags = ent.data;
- pr_debug(" flags: 0x%06x\n", dev->flags);
+ pr_debug(" flags: 0x%06x\n", ent.data);
break;
case NUBUS_RESID_HWDEVID:
- dev->hwdevid = ent.data;
- pr_debug(" hwdevid: 0x%06x\n", dev->hwdevid);
+ pr_debug(" hwdevid: 0x%06x\n", ent.data);
break;
default:
/* Local/Private resources have their own
rp = nubus_rom_addr(slot);
for (i = 4; i; i--) {
- int card_present;
-
rp--;
- card_present = hwreg_present(rp);
- if (!card_present)
+ if (!hwreg_present(rp))
continue;
dp = *rp;
if (!MACH_IS_MAC)
return 0;
- nubus_devices = NULL;
- nubus_boards = NULL;
nubus_scan_bus();
nubus_proc_init();
return 0;
unsigned short type;
unsigned short dr_sw;
unsigned short dr_hw;
- /* This is the device's name rather than the board's.
- Sometimes they are different. Usually the board name is
- more correct. */
- char name[64];
- /* MacOS driver (I kid you not) */
- unsigned char* driver;
- /* Actually this is an offset */
- unsigned long iobase;
- unsigned long iosize;
- unsigned char flags, hwdevid;
/* Functional directory */
unsigned char* directory;
#else
static inline void nubus_proc_init(void) {}
#endif
-int get_nubus_list(char *buf);
+
int nubus_proc_attach_device(struct nubus_dev *dev);
/* If we need more precision we can add some more of these */
-struct nubus_dev* nubus_find_device(unsigned short category,
- unsigned short type,
- unsigned short dr_hw,
- unsigned short dr_sw,
- const struct nubus_dev* from);
struct nubus_dev* nubus_find_type(unsigned short category,
unsigned short type,
const struct nubus_dev* from);