Initial attempt at updating to utilize (un)reserve_device.
Compiles but otherwise untested. Relates to #6798. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,9 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <drivers/Drivers.h>
|
#include <Drivers.h>
|
||||||
#include <drivers/KernelExport.h>
|
#include <KernelExport.h>
|
||||||
#include <drivers/PCI.h>
|
#include <PCI.h>
|
||||||
#include <hmulti_audio.h>
|
#include <hmulti_audio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -365,6 +365,7 @@ init_driver(void)
|
|||||||
{
|
{
|
||||||
pci_info info;
|
pci_info info;
|
||||||
int32 i;
|
int32 i;
|
||||||
|
status_t err;
|
||||||
|
|
||||||
if (get_module(B_PCI_MODULE_NAME, (module_info**) &gPCI) != B_OK)
|
if (get_module(B_PCI_MODULE_NAME, (module_info**) &gPCI) != B_OK)
|
||||||
return ENODEV;
|
return ENODEV;
|
||||||
@@ -382,8 +383,22 @@ init_driver(void)
|
|||||||
|
|
||||||
memset(&gCards[gCardsCount], 0, sizeof(ali_dev));
|
memset(&gCards[gCardsCount], 0, sizeof(ali_dev));
|
||||||
gCards[gCardsCount].info = info;
|
gCards[gCardsCount].info = info;
|
||||||
if (ali_setup(&gCards[gCardsCount]))
|
#ifdef __HAIKU__
|
||||||
|
if ((err = (*gPCI->reserve_device)(info.bus, info.device, info.function,
|
||||||
|
DRIVER_NAME, &gCards[gCardsCount])) < B_OK) {
|
||||||
|
dprintf("%s: failed to reserve_device(%d, %d, %d,): %s\n",
|
||||||
|
DRIVER_NAME, info.bus, info.device, info.function,
|
||||||
|
strerror(err));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (ali_setup(&gCards[gCardsCount])) {
|
||||||
TRACE("init_driver: setup of ali %ld failed\n", gCardsCount + 1);
|
TRACE("init_driver: setup of ali %ld failed\n", gCardsCount + 1);
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
(*gPCI->unreserve_device)(info.bus, info.device, info.function,
|
||||||
|
DRIVER_NAME, &gCards[gCardsCount]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
gCardsCount++;
|
gCardsCount++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#define ALI_VOICES 32
|
#define ALI_VOICES 32
|
||||||
#define ALI_RECORD_VOICE 31
|
#define ALI_RECORD_VOICE 31
|
||||||
|
|
||||||
|
#define DRIVER_NAME "ali5451"
|
||||||
|
|
||||||
typedef struct _ali_mem
|
typedef struct _ali_mem
|
||||||
{
|
{
|
||||||
LIST_ENTRY(_ali_mem) next;
|
LIST_ENTRY(_ali_mem) next;
|
||||||
|
|||||||
Reference in New Issue
Block a user