Fixed some bugs, partially by Oscar Lesta.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13767 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -41,7 +41,7 @@ typedef struct {
|
||||
uint32 signature;
|
||||
uint16 port;
|
||||
uint8 size; // == index for POKE_PORT_INDEXED_*
|
||||
uint16 value;
|
||||
uint32 value;
|
||||
} port_io_args;
|
||||
|
||||
|
||||
|
||||
@@ -62,8 +62,11 @@ init_driver(void)
|
||||
|
||||
if (get_module(B_ISA_MODULE_NAME, (module_info**)&isa) < B_OK)
|
||||
return ENOSYS;
|
||||
if (get_module(B_PCI_MODULE_NAME, (module_info**) &pci) < B_OK)
|
||||
|
||||
if (get_module(B_PCI_MODULE_NAME, (module_info**)&pci) < B_OK) {
|
||||
put_module(B_ISA_MODULE_NAME);
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
@@ -72,8 +75,8 @@ init_driver(void)
|
||||
void
|
||||
uninit_driver(void)
|
||||
{
|
||||
if (isa) put_module(B_ISA_MODULE_NAME);
|
||||
if (pci) put_module(B_PCI_MODULE_NAME);
|
||||
put_module(B_ISA_MODULE_NAME);
|
||||
put_module(B_PCI_MODULE_NAME);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +172,7 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
||||
isa->write_io_16(ioctl->port, ioctl->value);
|
||||
break;
|
||||
case 4:
|
||||
isa->write_io_16(ioctl->port, ioctl->value);
|
||||
isa->write_io_32(ioctl->port, ioctl->value);
|
||||
break;
|
||||
default:
|
||||
result = B_BAD_VALUE;
|
||||
@@ -207,8 +210,7 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
ioctl->value = pci->read_pci_config(ioctl->bus, ioctl->device,
|
||||
ioctl->function, ioctl->offset,
|
||||
ioctl->size);
|
||||
ioctl->function, ioctl->offset, ioctl->size);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -255,11 +257,8 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
ioctl->area = map_physical_memory(ioctl->name,
|
||||
ioctl->physical_address,
|
||||
ioctl->size,
|
||||
ioctl->flags,
|
||||
ioctl->protection,
|
||||
(void**) &ioctl->address);
|
||||
ioctl->physical_address, ioctl->size, ioctl->flags,
|
||||
ioctl->protection, (void**)&ioctl->address);
|
||||
return ioctl->area;
|
||||
}
|
||||
|
||||
@@ -278,16 +277,16 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
||||
|
||||
|
||||
status_t
|
||||
poke_read(void* cookie, off_t position, void* buffer, size_t* num_bytes)
|
||||
poke_read(void* cookie, off_t position, void* buffer, size_t* numBytes)
|
||||
{
|
||||
*num_bytes = 0;
|
||||
*numBytes = 0;
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
poke_write(void* cookie, off_t position, const void* buffer, size_t* num_bytes)
|
||||
poke_write(void* cookie, off_t position, const void* buffer, size_t* numBytes)
|
||||
{
|
||||
*num_bytes = 0;
|
||||
*numBytes = 0;
|
||||
return B_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user