Commit 189e19e8 authored by Finn Thain's avatar Finn Thain Committed by Geert Uytterhoeven

nubus: Rename struct nubus_dev

It is misleading to call a functional resource a "device". In adopting
the Linux Driver Model, the struct device will be embedded in struct
nubus_board. That will compound the terminlogy problem because drivers
will bind with boards, not with functional resources. Avoid this by
renaming struct nubus_dev as struct nubus_rsrc. "Functional resource"
is the vendor's terminology so this helps avoid confusion.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 2f7dd07e
...@@ -123,7 +123,8 @@ enum mac8390_access { ...@@ -123,7 +123,8 @@ enum mac8390_access {
}; };
extern int mac8390_memtest(struct net_device *dev); extern int mac8390_memtest(struct net_device *dev);
static int mac8390_initdev(struct net_device *dev, struct nubus_dev *ndev, static int mac8390_initdev(struct net_device *dev,
struct nubus_rsrc *ndev,
enum mac8390_type type); enum mac8390_type type);
static int mac8390_open(struct net_device *dev); static int mac8390_open(struct net_device *dev);
...@@ -169,11 +170,11 @@ static void word_memcpy_tocard(unsigned long tp, const void *fp, int count); ...@@ -169,11 +170,11 @@ static void word_memcpy_tocard(unsigned long tp, const void *fp, int count);
static void word_memcpy_fromcard(void *tp, unsigned long fp, int count); static void word_memcpy_fromcard(void *tp, unsigned long fp, int count);
static u32 mac8390_msg_enable; static u32 mac8390_msg_enable;
static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) static enum mac8390_type __init mac8390_ident(struct nubus_rsrc *fres)
{ {
switch (dev->dr_sw) { switch (fres->dr_sw) {
case NUBUS_DRSW_3COM: case NUBUS_DRSW_3COM:
switch (dev->dr_hw) { switch (fres->dr_hw) {
case NUBUS_DRHW_APPLE_SONIC_NB: case NUBUS_DRHW_APPLE_SONIC_NB:
case NUBUS_DRHW_APPLE_SONIC_LC: case NUBUS_DRHW_APPLE_SONIC_LC:
case NUBUS_DRHW_SONNET: case NUBUS_DRHW_SONNET:
...@@ -184,7 +185,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) ...@@ -184,7 +185,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
break; break;
case NUBUS_DRSW_APPLE: case NUBUS_DRSW_APPLE:
switch (dev->dr_hw) { switch (fres->dr_hw) {
case NUBUS_DRHW_ASANTE_LC: case NUBUS_DRHW_ASANTE_LC:
return MAC8390_NONE; return MAC8390_NONE;
case NUBUS_DRHW_CABLETRON: case NUBUS_DRHW_CABLETRON:
...@@ -201,7 +202,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) ...@@ -201,7 +202,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
case NUBUS_DRSW_TECHWORKS: case NUBUS_DRSW_TECHWORKS:
case NUBUS_DRSW_DAYNA2: case NUBUS_DRSW_DAYNA2:
case NUBUS_DRSW_DAYNA_LC: case NUBUS_DRSW_DAYNA_LC:
if (dev->dr_hw == NUBUS_DRHW_CABLETRON) if (fres->dr_hw == NUBUS_DRHW_CABLETRON)
return MAC8390_CABLETRON; return MAC8390_CABLETRON;
else else
return MAC8390_APPLE; return MAC8390_APPLE;
...@@ -212,7 +213,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) ...@@ -212,7 +213,7 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
break; break;
case NUBUS_DRSW_KINETICS: case NUBUS_DRSW_KINETICS:
switch (dev->dr_hw) { switch (fres->dr_hw) {
case NUBUS_DRHW_INTERLAN: case NUBUS_DRHW_INTERLAN:
return MAC8390_INTERLAN; return MAC8390_INTERLAN;
default: default:
...@@ -225,8 +226,8 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev) ...@@ -225,8 +226,8 @@ static enum mac8390_type __init mac8390_ident(struct nubus_dev *dev)
* These correspond to Dayna Sonic cards * These correspond to Dayna Sonic cards
* which use the macsonic driver * which use the macsonic driver
*/ */
if (dev->dr_hw == NUBUS_DRHW_SMC9194 || if (fres->dr_hw == NUBUS_DRHW_SMC9194 ||
dev->dr_hw == NUBUS_DRHW_INTERLAN) fres->dr_hw == NUBUS_DRHW_INTERLAN)
return MAC8390_NONE; return MAC8390_NONE;
else else
return MAC8390_DAYNA; return MAC8390_DAYNA;
...@@ -289,7 +290,8 @@ static int __init mac8390_memsize(unsigned long membase) ...@@ -289,7 +290,8 @@ static int __init mac8390_memsize(unsigned long membase)
return i * 0x1000; return i * 0x1000;
} }
static bool __init mac8390_init(struct net_device *dev, struct nubus_dev *ndev, static bool __init mac8390_init(struct net_device *dev,
struct nubus_rsrc *ndev,
enum mac8390_type cardtype) enum mac8390_type cardtype)
{ {
struct nubus_dir dir; struct nubus_dir dir;
...@@ -394,7 +396,7 @@ static bool __init mac8390_init(struct net_device *dev, struct nubus_dev *ndev, ...@@ -394,7 +396,7 @@ static bool __init mac8390_init(struct net_device *dev, struct nubus_dev *ndev,
struct net_device * __init mac8390_probe(int unit) struct net_device * __init mac8390_probe(int unit)
{ {
struct net_device *dev; struct net_device *dev;
struct nubus_dev *ndev = NULL; struct nubus_rsrc *ndev = NULL;
int err = -ENODEV; int err = -ENODEV;
struct ei_device *ei_local; struct ei_device *ei_local;
...@@ -489,7 +491,7 @@ static const struct net_device_ops mac8390_netdev_ops = { ...@@ -489,7 +491,7 @@ static const struct net_device_ops mac8390_netdev_ops = {
}; };
static int __init mac8390_initdev(struct net_device *dev, static int __init mac8390_initdev(struct net_device *dev,
struct nubus_dev *ndev, struct nubus_rsrc *ndev,
enum mac8390_type type) enum mac8390_type type)
{ {
static u32 fwrd4_offsets[16] = { static u32 fwrd4_offsets[16] = {
......
...@@ -428,26 +428,26 @@ static int mac_nubus_sonic_ethernet_addr(struct net_device *dev, ...@@ -428,26 +428,26 @@ static int mac_nubus_sonic_ethernet_addr(struct net_device *dev,
return 0; return 0;
} }
static int macsonic_ident(struct nubus_dev *ndev) static int macsonic_ident(struct nubus_rsrc *fres)
{ {
if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC && if (fres->dr_hw == NUBUS_DRHW_ASANTE_LC &&
ndev->dr_sw == NUBUS_DRSW_SONIC_LC) fres->dr_sw == NUBUS_DRSW_SONIC_LC)
return MACSONIC_DAYNALINK; return MACSONIC_DAYNALINK;
if (ndev->dr_hw == NUBUS_DRHW_SONIC && if (fres->dr_hw == NUBUS_DRHW_SONIC &&
ndev->dr_sw == NUBUS_DRSW_APPLE) { fres->dr_sw == NUBUS_DRSW_APPLE) {
/* There has to be a better way to do this... */ /* There has to be a better way to do this... */
if (strstr(ndev->board->name, "DuoDock")) if (strstr(fres->board->name, "DuoDock"))
return MACSONIC_DUODOCK; return MACSONIC_DUODOCK;
else else
return MACSONIC_APPLE; return MACSONIC_APPLE;
} }
if (ndev->dr_hw == NUBUS_DRHW_SMC9194 && if (fres->dr_hw == NUBUS_DRHW_SMC9194 &&
ndev->dr_sw == NUBUS_DRSW_DAYNA) fres->dr_sw == NUBUS_DRSW_DAYNA)
return MACSONIC_DAYNA; return MACSONIC_DAYNA;
if (ndev->dr_hw == NUBUS_DRHW_APPLE_SONIC_LC && if (fres->dr_hw == NUBUS_DRHW_APPLE_SONIC_LC &&
ndev->dr_sw == 0) { /* huh? */ fres->dr_sw == 0) { /* huh? */
return MACSONIC_APPLE16; return MACSONIC_APPLE16;
} }
return -1; return -1;
...@@ -456,7 +456,7 @@ static int macsonic_ident(struct nubus_dev *ndev) ...@@ -456,7 +456,7 @@ static int macsonic_ident(struct nubus_dev *ndev)
static int mac_nubus_sonic_probe(struct net_device *dev) static int mac_nubus_sonic_probe(struct net_device *dev)
{ {
static int slots; static int slots;
struct nubus_dev* ndev = NULL; struct nubus_rsrc *ndev = NULL;
struct sonic_local* lp = netdev_priv(dev); struct sonic_local* lp = netdev_priv(dev);
unsigned long base_addr, prom_addr; unsigned long base_addr, prom_addr;
u16 sonic_dcr; u16 sonic_dcr;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
/* Globals */ /* Globals */
struct nubus_dev *nubus_devices; struct nubus_rsrc *nubus_func_rsrcs;
struct nubus_board *nubus_boards; struct nubus_board *nubus_boards;
/* Meaning of "bytelanes": /* Meaning of "bytelanes":
...@@ -228,12 +228,11 @@ int nubus_get_root_dir(const struct nubus_board *board, ...@@ -228,12 +228,11 @@ int nubus_get_root_dir(const struct nubus_board *board,
EXPORT_SYMBOL(nubus_get_root_dir); EXPORT_SYMBOL(nubus_get_root_dir);
/* This is a slyly renamed version of the above */ /* This is a slyly renamed version of the above */
int nubus_get_func_dir(const struct nubus_dev *dev, int nubus_get_func_dir(const struct nubus_rsrc *fres, struct nubus_dir *dir)
struct nubus_dir *dir)
{ {
dir->ptr = dir->base = dev->directory; dir->ptr = dir->base = fres->directory;
dir->done = 0; dir->done = 0;
dir->mask = dev->board->lanes; dir->mask = fres->board->lanes;
return 0; return 0;
} }
EXPORT_SYMBOL(nubus_get_func_dir); EXPORT_SYMBOL(nubus_get_func_dir);
...@@ -306,11 +305,10 @@ EXPORT_SYMBOL(nubus_rewinddir); ...@@ -306,11 +305,10 @@ EXPORT_SYMBOL(nubus_rewinddir);
/* Driver interface functions, more or less like in pci.c */ /* Driver interface functions, more or less like in pci.c */
struct nubus_dev* struct nubus_rsrc *nubus_find_type(unsigned short category, unsigned short type,
nubus_find_type(unsigned short category, unsigned short type, const struct nubus_rsrc *from)
const struct nubus_dev *from)
{ {
struct nubus_dev *itor = from ? from->next : nubus_devices; struct nubus_rsrc *itor = from ? from->next : nubus_func_rsrcs;
while (itor) { while (itor) {
if (itor->category == category && itor->type == type) if (itor->category == category && itor->type == type)
...@@ -321,10 +319,10 @@ nubus_find_type(unsigned short category, unsigned short type, ...@@ -321,10 +319,10 @@ nubus_find_type(unsigned short category, unsigned short type,
} }
EXPORT_SYMBOL(nubus_find_type); EXPORT_SYMBOL(nubus_find_type);
struct nubus_dev* struct nubus_rsrc *nubus_find_slot(unsigned int slot,
nubus_find_slot(unsigned int slot, const struct nubus_dev *from) const struct nubus_rsrc *from)
{ {
struct nubus_dev *itor = from ? from->next : nubus_devices; struct nubus_rsrc *itor = from ? from->next : nubus_func_rsrcs;
while (itor) { while (itor) {
if (itor->board->slot == slot) if (itor->board->slot == slot)
...@@ -403,19 +401,19 @@ static int __init nubus_get_display_vidmode(struct nubus_board *board, ...@@ -403,19 +401,19 @@ static int __init nubus_get_display_vidmode(struct nubus_board *board,
return 0; return 0;
} }
static int __init nubus_get_display_resource(struct nubus_dev *dev, static int __init nubus_get_display_resource(struct nubus_rsrc *fres,
struct proc_dir_entry *procdir, struct proc_dir_entry *procdir,
const struct nubus_dirent *ent) const struct nubus_dirent *ent)
{ {
switch (ent->type) { switch (ent->type) {
case NUBUS_RESID_GAMMADIR: case NUBUS_RESID_GAMMADIR:
pr_debug(" gamma directory offset: 0x%06x\n", ent->data); pr_debug(" gamma directory offset: 0x%06x\n", ent->data);
nubus_get_block_rsrc_dir(dev->board, procdir, ent); nubus_get_block_rsrc_dir(fres->board, procdir, ent);
break; break;
case 0x0080 ... 0x0085: case 0x0080 ... 0x0085:
pr_debug(" mode 0x%02x info offset: 0x%06x\n", pr_debug(" mode 0x%02x info offset: 0x%06x\n",
ent->type, ent->data); ent->type, ent->data);
nubus_get_display_vidmode(dev->board, procdir, ent); nubus_get_display_vidmode(fres->board, procdir, ent);
break; break;
default: default:
pr_debug(" unknown resource 0x%02x, data 0x%06x\n", pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
...@@ -425,7 +423,7 @@ static int __init nubus_get_display_resource(struct nubus_dev *dev, ...@@ -425,7 +423,7 @@ static int __init nubus_get_display_resource(struct nubus_dev *dev,
return 0; return 0;
} }
static int __init nubus_get_network_resource(struct nubus_dev *dev, static int __init nubus_get_network_resource(struct nubus_rsrc *fres,
struct proc_dir_entry *procdir, struct proc_dir_entry *procdir,
const struct nubus_dirent *ent) const struct nubus_dirent *ent)
{ {
...@@ -447,7 +445,7 @@ static int __init nubus_get_network_resource(struct nubus_dev *dev, ...@@ -447,7 +445,7 @@ static int __init nubus_get_network_resource(struct nubus_dev *dev,
return 0; return 0;
} }
static int __init nubus_get_cpu_resource(struct nubus_dev *dev, static int __init nubus_get_cpu_resource(struct nubus_rsrc *fres,
struct proc_dir_entry *procdir, struct proc_dir_entry *procdir,
const struct nubus_dirent *ent) const struct nubus_dirent *ent)
{ {
...@@ -480,19 +478,19 @@ static int __init nubus_get_cpu_resource(struct nubus_dev *dev, ...@@ -480,19 +478,19 @@ static int __init nubus_get_cpu_resource(struct nubus_dev *dev,
return 0; return 0;
} }
static int __init nubus_get_private_resource(struct nubus_dev *dev, static int __init nubus_get_private_resource(struct nubus_rsrc *fres,
struct proc_dir_entry *procdir, struct proc_dir_entry *procdir,
const struct nubus_dirent *ent) const struct nubus_dirent *ent)
{ {
switch (dev->category) { switch (fres->category) {
case NUBUS_CAT_DISPLAY: case NUBUS_CAT_DISPLAY:
nubus_get_display_resource(dev, procdir, ent); nubus_get_display_resource(fres, procdir, ent);
break; break;
case NUBUS_CAT_NETWORK: case NUBUS_CAT_NETWORK:
nubus_get_network_resource(dev, procdir, ent); nubus_get_network_resource(fres, procdir, ent);
break; break;
case NUBUS_CAT_CPU: case NUBUS_CAT_CPU:
nubus_get_cpu_resource(dev, procdir, ent); nubus_get_cpu_resource(fres, procdir, ent);
break; break;
default: default:
pr_debug(" unknown resource 0x%02x, data 0x%06x\n", pr_debug(" unknown resource 0x%02x, data 0x%06x\n",
...@@ -502,24 +500,25 @@ static int __init nubus_get_private_resource(struct nubus_dev *dev, ...@@ -502,24 +500,25 @@ static int __init nubus_get_private_resource(struct nubus_dev *dev,
return 0; return 0;
} }
static struct nubus_dev * __init static struct nubus_rsrc * __init
nubus_get_functional_resource(struct nubus_board *board, int slot, nubus_get_functional_resource(struct nubus_board *board, int slot,
const struct nubus_dirent *parent) const struct nubus_dirent *parent)
{ {
struct nubus_dir dir; struct nubus_dir dir;
struct nubus_dirent ent; struct nubus_dirent ent;
struct nubus_dev *dev; struct nubus_rsrc *fres;
pr_debug(" Functional resource 0x%02x:\n", parent->type); pr_debug(" Functional resource 0x%02x:\n", parent->type);
nubus_get_subdir(parent, &dir); nubus_get_subdir(parent, &dir);
dir.procdir = nubus_proc_add_rsrc_dir(board->procdir, parent, board); dir.procdir = nubus_proc_add_rsrc_dir(board->procdir, parent, board);
/* Actually we should probably panic if this fails */ /* Actually we should probably panic if this fails */
if ((dev = kzalloc(sizeof(*dev), GFP_ATOMIC)) == NULL) fres = kzalloc(sizeof(*fres), GFP_ATOMIC);
if (!fres)
return NULL; return NULL;
dev->resid = parent->type; fres->resid = parent->type;
dev->directory = dir.base; fres->directory = dir.base;
dev->board = board; fres->board = board;
while (nubus_readdir(&dir, &ent) != -1) { while (nubus_readdir(&dir, &ent) != -1) {
switch (ent.type) { switch (ent.type) {
...@@ -528,10 +527,10 @@ nubus_get_functional_resource(struct nubus_board *board, int slot, ...@@ -528,10 +527,10 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
unsigned short nbtdata[4]; unsigned short nbtdata[4];
nubus_get_rsrc_mem(nbtdata, &ent, 8); nubus_get_rsrc_mem(nbtdata, &ent, 8);
dev->category = nbtdata[0]; fres->category = nbtdata[0];
dev->type = nbtdata[1]; fres->type = nbtdata[1];
dev->dr_sw = nbtdata[2]; fres->dr_sw = nbtdata[2];
dev->dr_hw = nbtdata[3]; fres->dr_hw = nbtdata[3];
pr_debug(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n", pr_debug(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n",
nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]); nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]);
nubus_proc_add_rsrc_mem(dir.procdir, &ent, 8); nubus_proc_add_rsrc_mem(dir.procdir, &ent, 8);
...@@ -589,11 +588,11 @@ nubus_get_functional_resource(struct nubus_board *board, int slot, ...@@ -589,11 +588,11 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
default: default:
/* Local/Private resources have their own /* Local/Private resources have their own
function */ function */
nubus_get_private_resource(dev, dir.procdir, &ent); nubus_get_private_resource(fres, dir.procdir, &ent);
} }
} }
return dev; return fres;
} }
/* This is *really* cool. */ /* This is *really* cool. */
...@@ -729,7 +728,6 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot, ...@@ -729,7 +728,6 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
return 0; return 0;
} }
/* Add a board (might be many devices) to the list */
static struct nubus_board * __init nubus_add_board(int slot, int bytelanes) static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
{ {
struct nubus_board *board; struct nubus_board *board;
...@@ -801,10 +799,11 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes) ...@@ -801,10 +799,11 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
pr_debug("Slot %X resources:\n", slot); pr_debug("Slot %X resources:\n", slot);
/* Each slot should have one board resource and any number of /* Each slot should have one board resource and any number of
functional resources. So we'll fill in some fields in the * functional resources. So we'll fill in some fields in the
struct nubus_board from the board resource, then walk down * struct nubus_board from the board resource, then walk down
the list of functional resources, spinning out a nubus_dev * the list of functional resources, spinning out a nubus_rsrc
for each of them. */ * for each of them.
*/
if (nubus_readdir(&dir, &ent) == -1) { if (nubus_readdir(&dir, &ent) == -1) {
/* We can't have this! */ /* We can't have this! */
pr_err("Slot %X: Board resource not found!\n", slot); pr_err("Slot %X: Board resource not found!\n", slot);
...@@ -819,32 +818,32 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes) ...@@ -819,32 +818,32 @@ static struct nubus_board * __init nubus_add_board(int slot, int bytelanes)
nubus_get_board_resource(board, slot, &ent); nubus_get_board_resource(board, slot, &ent);
while (nubus_readdir(&dir, &ent) != -1) { while (nubus_readdir(&dir, &ent) != -1) {
struct nubus_dev *dev; struct nubus_rsrc *fres;
struct nubus_dev **devp; struct nubus_rsrc **fresp;
dev = nubus_get_functional_resource(board, slot, &ent); fres = nubus_get_functional_resource(board, slot, &ent);
if (dev == NULL) if (fres == NULL)
continue; continue;
/* Resources should appear in ascending ID order. This sanity /* Resources should appear in ascending ID order. This sanity
* check prevents duplicate resource IDs. * check prevents duplicate resource IDs.
*/ */
if (dev->resid <= prev_resid) { if (fres->resid <= prev_resid) {
kfree(dev); kfree(fres);
continue; continue;
} }
prev_resid = dev->resid; prev_resid = fres->resid;
/* We zeroed this out above */ /* We zeroed this out above */
if (board->first_dev == NULL) if (board->first_func_rsrc == NULL)
board->first_dev = dev; board->first_func_rsrc = fres;
/* Put it on the global NuBus device chain. Keep entries in order. */ /* Put it on the func. resource list. Keep entries in order. */
for (devp = &nubus_devices; *devp != NULL; for (fresp = &nubus_func_rsrcs; *fresp != NULL;
devp = &((*devp)->next)) fresp = &((*fresp)->next))
/* spin */; /* spin */;
*devp = dev; *fresp = fres;
dev->next = NULL; fres->next = NULL;
} }
/* Put it on the global NuBus board chain. Keep entries in order. */ /* Put it on the global NuBus board chain. Keep entries in order. */
......
...@@ -36,17 +36,14 @@ ...@@ -36,17 +36,14 @@
static int static int
nubus_devices_proc_show(struct seq_file *m, void *v) nubus_devices_proc_show(struct seq_file *m, void *v)
{ {
struct nubus_dev *dev = nubus_devices; struct nubus_rsrc *fres = nubus_func_rsrcs;
while (dev) { while (fres) {
seq_printf(m, "%x\t%04x %04x %04x %04x", seq_printf(m, "%x\t%04x %04x %04x %04x",
dev->board->slot, fres->board->slot, fres->category, fres->type,
dev->category, fres->dr_sw, fres->dr_hw);
dev->type, seq_printf(m, "\t%08lx\n", fres->board->slot_addr);
dev->dr_sw, fres = fres->next;
dev->dr_hw);
seq_printf(m, "\t%08lx\n", dev->board->slot_addr);
dev = dev->next;
} }
return 0; return 0;
} }
......
...@@ -556,7 +556,7 @@ static void __init iounmap_macfb(void) ...@@ -556,7 +556,7 @@ static void __init iounmap_macfb(void)
static int __init macfb_init(void) static int __init macfb_init(void)
{ {
int video_cmap_len, video_is_nubus = 0; int video_cmap_len, video_is_nubus = 0;
struct nubus_dev* ndev = NULL; struct nubus_rsrc *ndev = NULL;
char *option = NULL; char *option = NULL;
int err; int err;
......
...@@ -33,7 +33,7 @@ struct nubus_dirent { ...@@ -33,7 +33,7 @@ struct nubus_dirent {
struct nubus_board { struct nubus_board {
struct nubus_board *next; struct nubus_board *next;
struct nubus_dev *first_dev; struct nubus_rsrc *first_func_rsrc;
/* Only 9-E actually exist, though 0-8 are also theoretically /* Only 9-E actually exist, though 0-8 are also theoretically
possible, and 0 is a special case which represents the possible, and 0 is a special case which represents the
...@@ -62,11 +62,11 @@ struct nubus_board { ...@@ -62,11 +62,11 @@ struct nubus_board {
struct proc_dir_entry *procdir; struct proc_dir_entry *procdir;
}; };
struct nubus_dev { struct nubus_rsrc {
/* Next link in device list */ /* Next link in list */
struct nubus_dev *next; struct nubus_rsrc *next;
/* The functional resource ID of this device */ /* The functional resource ID */
unsigned char resid; unsigned char resid;
/* These are mostly here for convenience; we could always read /* These are mostly here for convenience; we could always read
them from the ROMs if we wanted to */ them from the ROMs if we wanted to */
...@@ -81,8 +81,8 @@ struct nubus_dev { ...@@ -81,8 +81,8 @@ struct nubus_dev {
struct nubus_board *board; struct nubus_board *board;
}; };
/* This is all NuBus devices (used to find devices later on) */ /* This is all NuBus functional resources (used to find devices later on) */
extern struct nubus_dev *nubus_devices; extern struct nubus_rsrc *nubus_func_rsrcs;
/* This is all NuBus cards */ /* This is all NuBus cards */
extern struct nubus_board *nubus_boards; extern struct nubus_board *nubus_boards;
...@@ -115,13 +115,12 @@ static inline void nubus_proc_add_rsrc(struct proc_dir_entry *procdir, ...@@ -115,13 +115,12 @@ static inline void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
const struct nubus_dirent *ent) {} const struct nubus_dirent *ent) {}
#endif #endif
/* If we need more precision we can add some more of these */ struct nubus_rsrc *nubus_find_type(unsigned short category,
struct nubus_dev *nubus_find_type(unsigned short category, unsigned short type,
unsigned short type, const struct nubus_rsrc *from);
const struct nubus_dev *from);
/* Might have more than one device in a slot, you know... */ struct nubus_rsrc *nubus_find_slot(unsigned int slot,
struct nubus_dev *nubus_find_slot(unsigned int slot, const struct nubus_rsrc *from);
const struct nubus_dev *from);
/* These are somewhat more NuBus-specific. They all return 0 for /* These are somewhat more NuBus-specific. They all return 0 for
success and -1 for failure, as you'd expect. */ success and -1 for failure, as you'd expect. */
...@@ -134,8 +133,7 @@ int nubus_get_root_dir(const struct nubus_board *board, ...@@ -134,8 +133,7 @@ int nubus_get_root_dir(const struct nubus_board *board,
int nubus_get_board_dir(const struct nubus_board *board, int nubus_get_board_dir(const struct nubus_board *board,
struct nubus_dir *dir); struct nubus_dir *dir);
/* The functional directory */ /* The functional directory */
int nubus_get_func_dir(const struct nubus_dev *dev, int nubus_get_func_dir(const struct nubus_rsrc *fres, struct nubus_dir *dir);
struct nubus_dir *dir);
/* These work on any directory gotten via the above */ /* These work on any directory gotten via the above */
int nubus_readdir(struct nubus_dir *dir, int nubus_readdir(struct nubus_dir *dir,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment