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;
|
uint32 signature;
|
||||||
uint16 port;
|
uint16 port;
|
||||||
uint8 size; // == index for POKE_PORT_INDEXED_*
|
uint8 size; // == index for POKE_PORT_INDEXED_*
|
||||||
uint16 value;
|
uint32 value;
|
||||||
} port_io_args;
|
} port_io_args;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,11 @@ init_driver(void)
|
|||||||
|
|
||||||
if (get_module(B_ISA_MODULE_NAME, (module_info**)&isa) < B_OK)
|
if (get_module(B_ISA_MODULE_NAME, (module_info**)&isa) < B_OK)
|
||||||
return ENOSYS;
|
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 ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -72,8 +75,8 @@ init_driver(void)
|
|||||||
void
|
void
|
||||||
uninit_driver(void)
|
uninit_driver(void)
|
||||||
{
|
{
|
||||||
if (isa) put_module(B_ISA_MODULE_NAME);
|
put_module(B_ISA_MODULE_NAME);
|
||||||
if (pci) put_module(B_PCI_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);
|
isa->write_io_16(ioctl->port, ioctl->value);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
isa->write_io_16(ioctl->port, ioctl->value);
|
isa->write_io_32(ioctl->port, ioctl->value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
result = B_BAD_VALUE;
|
result = B_BAD_VALUE;
|
||||||
@@ -207,8 +210,7 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
|||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
ioctl->value = pci->read_pci_config(ioctl->bus, ioctl->device,
|
ioctl->value = pci->read_pci_config(ioctl->bus, ioctl->device,
|
||||||
ioctl->function, ioctl->offset,
|
ioctl->function, ioctl->offset, ioctl->size);
|
||||||
ioctl->size);
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,11 +257,8 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
|||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
ioctl->area = map_physical_memory(ioctl->name,
|
ioctl->area = map_physical_memory(ioctl->name,
|
||||||
ioctl->physical_address,
|
ioctl->physical_address, ioctl->size, ioctl->flags,
|
||||||
ioctl->size,
|
ioctl->protection, (void**)&ioctl->address);
|
||||||
ioctl->flags,
|
|
||||||
ioctl->protection,
|
|
||||||
(void**) &ioctl->address);
|
|
||||||
return ioctl->area;
|
return ioctl->area;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,16 +277,16 @@ poke_control(void* cookie, uint32 op, void* arg, size_t length)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
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;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user