busmanager is working now
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8380 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -83,7 +83,7 @@ status_t init(void)
|
|||||||
INIT_BEN(pd->kernel);
|
INIT_BEN(pd->kernel);
|
||||||
|
|
||||||
/* find all of our supported devices, if any */
|
/* find all of our supported devices, if any */
|
||||||
if (!probe_devices())
|
if (probe_devices() != B_OK)
|
||||||
{
|
{
|
||||||
/* free the driver data */
|
/* free the driver data */
|
||||||
DELETE_BEN(pd->kernel);
|
DELETE_BEN(pd->kernel);
|
||||||
@@ -150,6 +150,7 @@ next_device:
|
|||||||
|
|
||||||
/* note actual number of AGP devices found */
|
/* note actual number of AGP devices found */
|
||||||
pd->count = count;
|
pd->count = count;
|
||||||
|
TRACE("agp_man: found %d AGP capable device(s)\n", (uint16)count);
|
||||||
|
|
||||||
/* if we didn't find any devices no AGP bus exists */
|
/* if we didn't find any devices no AGP bus exists */
|
||||||
if (!count) return B_ERROR;
|
if (!count) return B_ERROR;
|
||||||
@@ -162,7 +163,7 @@ next_device:
|
|||||||
if ((pd->di[count - 1].agpi.interface.agp_stat & AGP_rate_rev) !=
|
if ((pd->di[count - 1].agpi.interface.agp_stat & AGP_rate_rev) !=
|
||||||
(pd->di[count].agpi.interface.agp_stat & AGP_rate_rev))
|
(pd->di[count].agpi.interface.agp_stat & AGP_rate_rev))
|
||||||
{
|
{
|
||||||
TRACE(("agp_man: compatibility problem detected, aborting\n"));
|
TRACE("agp_man: compatibility problem detected, aborting\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,13 +217,16 @@ static bool has_AGP_interface(pci_info *pcii, uint8 *adress)
|
|||||||
|
|
||||||
long get_nth_agp_info (long index, agp_info *info)
|
long get_nth_agp_info (long index, agp_info *info)
|
||||||
{
|
{
|
||||||
pci_info *pcii = &(pd->di[index].pcii);
|
pci_info *pcii;
|
||||||
|
|
||||||
|
TRACE("agp_man: get_nth_agp_info called with index %d\n", (uint16)index);
|
||||||
|
|
||||||
/* check if we have a device here */
|
/* check if we have a device here */
|
||||||
if (index > pd->count) return B_ERROR;
|
if (index >= pd->count) return B_ERROR;
|
||||||
|
|
||||||
/* refresh from the contents of the AGP registers from this device */
|
/* refresh from the contents of the AGP registers from this device */
|
||||||
/* (note: also get agp_stat as some graphicsdriver may have been tweaking, like nvidia) */
|
/* (note: also get agp_stat as some graphicsdriver may have been tweaking, like nvidia) */
|
||||||
|
pcii = &(pd->di[index].pcii);
|
||||||
pd->di[index].agpi.interface.agp_stat = get_pci(pd->di[index].agp_adress + 4, 4);
|
pd->di[index].agpi.interface.agp_stat = get_pci(pd->di[index].agp_adress + 4, 4);
|
||||||
pd->di[index].agpi.interface.agp_cmd = get_pci(pd->di[index].agp_adress + 8, 4);
|
pd->di[index].agpi.interface.agp_cmd = get_pci(pd->di[index].agp_adress + 8, 4);
|
||||||
|
|
||||||
@@ -237,6 +241,8 @@ void enable_agp (uint32 *command)
|
|||||||
long count;
|
long count;
|
||||||
pci_info *pcii;
|
pci_info *pcii;
|
||||||
|
|
||||||
|
TRACE("agp_man: enable_agp called\n");
|
||||||
|
|
||||||
/* validate the given command: */
|
/* validate the given command: */
|
||||||
/* if we should set PCI mode, reset all options */
|
/* if we should set PCI mode, reset all options */
|
||||||
if (!(*command & AGP_enable)) *command = 0x00000000;
|
if (!(*command & AGP_enable)) *command = 0x00000000;
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
#define AGP_PROTO_H
|
#define AGP_PROTO_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <KernelExport.h>
|
||||||
#include <PCI.h>
|
#include <PCI.h>
|
||||||
#include "AGP.h"
|
#include "AGP.h"
|
||||||
|
|
||||||
//#define AGP_DEBUG
|
#define AGP_DEBUG
|
||||||
#ifdef AGP_DEBUG
|
#ifdef AGP_DEBUG
|
||||||
#define TRACE dprintf
|
#define TRACE dprintf
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -36,14 +36,14 @@ bus_std_ops(int32 op, ...)
|
|||||||
{
|
{
|
||||||
switch(op) {
|
switch(op) {
|
||||||
case B_MODULE_INIT:
|
case B_MODULE_INIT:
|
||||||
TRACE(("agp_man: bus module: init\n"));
|
TRACE("agp_man: bus module: init\n");
|
||||||
if (init() != B_OK)
|
if (init() != B_OK)
|
||||||
{
|
{
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case B_MODULE_UNINIT:
|
case B_MODULE_UNINIT:
|
||||||
TRACE(("agp_man: bus module: uninit\n"));
|
TRACE("agp_man: bus module: uninit\n");
|
||||||
uninit();
|
uninit();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -70,11 +70,11 @@ struct agp_module_info m_module_info =
|
|||||||
NULL // the rescan function
|
NULL // the rescan function
|
||||||
} ,
|
} ,
|
||||||
//my functions
|
//my functions
|
||||||
&get_nth_agp_info,
|
get_nth_agp_info,
|
||||||
&enable_agp,
|
enable_agp
|
||||||
};
|
};
|
||||||
|
|
||||||
module_info *modules[] = {
|
_EXPORT module_info *modules[] = {
|
||||||
(module_info *)&m_module_info ,
|
(module_info *)&m_module_info ,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user