Renamed fs_id to mount_id.

Some clean-ups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1174 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-09-25 14:05:44 +00:00
parent 4dc5ecd3cb
commit 62781e5bc4
@@ -2,7 +2,9 @@
** Copyright 2001, Travis Geiselbrecht. All rights reserved. ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License. ** Distributed under the terms of the NewOS License.
*/ */
#include <kernel.h> #include <kernel.h>
#include <vfs.h>
#include <debug.h> #include <debug.h>
#include <lock.h> #include <lock.h>
@@ -19,7 +21,6 @@
* *
* If you want to include the header for more information, you'll need to * If you want to include the header for more information, you'll need to
* 1) get a copy of pcihdr.h from http://www.yourvote.com/pci/ and modify it * 1) get a copy of pcihdr.h from http://www.yourvote.com/pci/ and modify it
* or get pcihdr.h.zip from http://beos.jetnet.co.uk/kernel/
* 2) copy it into the pci directory (ie here) * 2) copy it into the pci directory (ie here)
* 3) change the define of USE_PCIHDR from 0 to 1 * 3) change the define of USE_PCIHDR from 0 to 1
* 4) rebuild * 4) rebuild
@@ -32,14 +33,16 @@
int pci_scan_all(); int pci_scan_all();
struct pci_fs { struct pci_fs {
fs_id id; mount_id id;
mutex lock; mutex lock;
void *covered_vnode; void *covered_vnode;
void *redir_vnode; void *redir_vnode;
int root_vnode; /* just a placeholder to return a pointer to */ int root_vnode; /* just a placeholder to return a pointer to */
}; };
static unsigned int pci_read_data(uint8 bus, uint8 unit, uint8 function, int reg, int bytes)
static unsigned int
pci_read_data(uint8 bus, uint8 unit, uint8 function, int reg, int bytes)
{ {
struct pci_config_address addr; struct pci_config_address addr;
addr.enable = 1; addr.enable = 1;
@@ -62,7 +65,9 @@ static unsigned int pci_read_data(uint8 bus, uint8 unit, uint8 function, int reg
} }
} }
static void pci_write_data(uint8 bus, uint8 unit, uint8 function, int reg, uint32 data, int bytes)
static void
pci_write_data(uint8 bus, uint8 unit, uint8 function, int reg, uint32 data, int bytes)
{ {
struct pci_config_address addr; struct pci_config_address addr;
addr.enable = 1; addr.enable = 1;
@@ -87,7 +92,9 @@ static void pci_write_data(uint8 bus, uint8 unit, uint8 function, int reg, uint3
return; return;
} }
static int pci_read_config(uint8 bus, uint8 unit, uint8 func, struct pci_cfg *cfg)
static int
pci_read_config(uint8 bus, uint8 unit, uint8 func, struct pci_cfg *cfg)
{ {
union { union {
struct pci_cfg cfg; struct pci_cfg cfg;
@@ -142,7 +149,9 @@ static int pci_read_config(uint8 bus, uint8 unit, uint8 func, struct pci_cfg *cf
return 0; return 0;
} }
static const char *pci_class_to_string(uint8 base_class)
static const char *
pci_class_to_string(uint8 base_class)
{ {
switch (base_class) { switch (base_class) {
case 0x00: return "legacy"; case 0x00: return "legacy";
@@ -167,7 +176,9 @@ static const char *pci_class_to_string(uint8 base_class)
} }
} }
static const char *pci_subclass_to_string(uint8 base_class, uint8 sub_class)
static const char *
pci_subclass_to_string(uint8 base_class, uint8 sub_class)
{ {
switch(base_class) { switch(base_class) {
case 0: // legacy case 0: // legacy
@@ -215,7 +226,9 @@ static const char *pci_subclass_to_string(uint8 base_class, uint8 sub_class)
} }
} }
void dump_pci_config(struct pci_cfg *cfg)
void
dump_pci_config(struct pci_cfg *cfg)
{ {
int i; int i;
@@ -240,12 +253,14 @@ void dump_pci_config(struct pci_cfg *cfg)
dprintf("\tirq: %d\n", cfg->irq); dprintf("\tirq: %d\n", cfg->irq);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
dprintf("\tbase[%d] = 0x%x\n", i, cfg->base[i]); dprintf("\tbase[%d] = 0x%lx\n", i, cfg->base[i]);
dprintf("\tsize[%d] = 0x%x\n", i, cfg->size[i]); dprintf("\tsize[%d] = 0x%lx\n", i, cfg->size[i]);
} }
} }
static void dump_short_pci_config(struct pci_cfg *cfg)
static void
dump_short_pci_config(struct pci_cfg *cfg)
{ {
#if !USE_PCIHDR #if !USE_PCIHDR
dprintf("PCI: vendor id %d, device id %d ", cfg->vendor_id, cfg->device_id); dprintf("PCI: vendor id %d, device id %d ", cfg->vendor_id, cfg->device_id);
@@ -266,7 +281,9 @@ static void dump_short_pci_config(struct pci_cfg *cfg)
#endif #endif
} }
int pci_probe(uint8 bus, uint8 unit, uint8 function, struct pci_cfg *cfg)
int
pci_probe(uint8 bus, uint8 unit, uint8 function, struct pci_cfg *cfg)
{ {
if (function > 0) { if (function > 0) {
struct pci_cfg cfg1; struct pci_cfg cfg1;
@@ -294,7 +311,8 @@ int pci_probe(uint8 bus, uint8 unit, uint8 function, struct pci_cfg *cfg)
#if 0 #if 0
int pci_scan_all() int
pci_scan_all()
{ {
int bus; int bus;
int unit; int unit;