Style cleanups, some removed debug output.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8163 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-06-25 12:55:56 +00:00
parent 8f46c3cb5c
commit 7383f6963f
+18 -33
View File
@@ -1,6 +1,6 @@
/* /*
** Copyright 2002/03, Thomas Kurschel. All rights reserved. ** Copyright 2002/03, Thomas Kurschel. All rights reserved.
** Distributed under the terms of the OpenBeOS License. ** Distributed under the terms of the Haiku License.
*/ */
/* /*
@@ -218,18 +218,17 @@ sim_path_inquiry(ide_bus_info *bus, scsi_path_inquiry *info)
// number of queued requests, which is 32 per device * 2 devices // number of queued requests, which is 32 per device * 2 devices
info->hba_queue_size = 65; info->hba_queue_size = 65;
strncpy( info->sim_vid, "OpenBeOS", SCSI_SIM_ID ); strncpy(info->sim_vid, "Haiku", SCSI_SIM_ID);
if( pnp->get_attr_string( bus->node, if (pnp->get_attr_string(bus->node, SCSI_DESCRIPTION_CONTROLLER_NAME,
SCSI_DESCRIPTION_CONTROLLER_NAME, &controller_name, true ) == B_OK ) &controller_name, true) == B_OK) {
{ strlcpy(info->hba_vid, controller_name, SCSI_HBA_ID);
strncpy( info->hba_vid, controller_name, SCSI_HBA_ID );
free(controller_name); free(controller_name);
} else } else
strncpy( info->hba_vid, "", SCSI_HBA_ID ); strlcpy(info->hba_vid, "", SCSI_HBA_ID);
strncpy( info->controller_family, "IDE", SCSI_FAM_ID ); strlcpy(info->controller_family, "IDE", SCSI_FAM_ID);
strncpy( info->controller_type, "IDE", SCSI_TYPE_ID ); strlcpy(info->controller_type, "IDE", SCSI_TYPE_ID);
SHOW_FLOW0(4, "done"); SHOW_FLOW0(4, "done");
@@ -246,14 +245,9 @@ scan_device(ide_bus_info *bus, int device)
// bus when a bus or device scan is issued, so we // bus when a bus or device scan is issued, so we
// have to use a SPC for that to be sure no one else // have to use a SPC for that to be sure no one else
// is accessing the device or bus concurrently // is accessing the device or bus concurrently
dprintf("1\n");
schedule_synced_pc(bus, &bus->scan_bus_syncinfo, (void *)device); schedule_synced_pc(bus, &bus->scan_bus_syncinfo, (void *)device);
dprintf("2\n");
acquire_sem(bus->scan_device_sem); acquire_sem(bus->scan_device_sem);
dprintf("3\n");
return;
} }
@@ -268,12 +262,6 @@ sim_scan_bus(ide_bus_info *bus)
return SCSI_NO_HBA; return SCSI_NO_HBA;
for (i = 0; i < bus->max_devices; ++i) { for (i = 0; i < bus->max_devices; ++i) {
// ToDo: remove me! (this speeds up detection in bochs - because
// timing seems to be broken there)
if (i == 1) {
dprintf("ignore 1!\n");
continue;
}
scan_device(bus, i); scan_device(bus, i);
} }
@@ -588,12 +576,10 @@ ide_sim_init_bus(pnp_node_handle node, void *user_cookie, void **cookie)
init_synced_pc(&bus->disconnect_syncinfo, disconnect_worker); init_synced_pc(&bus->disconnect_syncinfo, disconnect_worker);
bus->scsi_cookie = user_cookie; bus->scsi_cookie = user_cookie;
bus->state = ide_state_idle; bus->state = ide_state_idle;
bus->timer.bus = bus; bus->timer.bus = bus;
bus->synced_pc_list = NULL; bus->synced_pc_list = NULL;
if ((res = scsi->alloc_dpc(&bus->irq_dpc)) < 0) if ((res = scsi->alloc_dpc(&bus->irq_dpc)) < 0)
goto err1; goto err1;
@@ -620,8 +606,8 @@ ide_sim_init_bus(pnp_node_handle node, void *user_cookie, void **cookie)
// read restrictions of controller // read restrictions of controller
if( pnp->get_attr_uint8( node, if (pnp->get_attr_uint8(node, IDE_CONTROLLER_MAX_DEVICES_ITEM,
IDE_CONTROLLER_MAX_DEVICES_ITEM, &bus->max_devices, true ) != B_OK ) &bus->max_devices, true) != B_OK)
// per default, 2 devices are supported per node // per default, 2 devices are supported per node
bus->max_devices = 2; bus->max_devices = 2;
@@ -710,7 +696,8 @@ disconnect_worker(ide_bus_info *bus, void *arg)
} }
static void ide_sim_bus_removed( pnp_node_handle node, ide_bus_info *bus ) static void
ide_sim_bus_removed(pnp_node_handle node, ide_bus_info *bus)
{ {
if (bus == NULL) if (bus == NULL)
// driver not loaded - no manual intervention needed // driver not loaded - no manual intervention needed
@@ -723,8 +710,6 @@ static void ide_sim_bus_removed( pnp_node_handle node, ide_bus_info *bus )
// abort all running commands with SCSI_NO_HBA // abort all running commands with SCSI_NO_HBA
// (the scheduled function also unblocks the bus when finished) // (the scheduled function also unblocks the bus when finished)
schedule_synced_pc(bus, &bus->disconnect_syncinfo, NULL); schedule_synced_pc(bus, &bus->disconnect_syncinfo, NULL);
return;
} }
@@ -750,10 +735,9 @@ ide_sim_get_restrictions(ide_bus_info *bus, uchar target_id,
if (device->is_atapi) { if (device->is_atapi) {
if (strncmp(device->infoblock.model_number, "IOMEGA ZIP 100 ATAPI", if (strncmp(device->infoblock.model_number, "IOMEGA ZIP 100 ATAPI",
strlen( "IOMEGA ZIP 100 ATAPI" )) == 0 || strlen("IOMEGA ZIP 100 ATAPI")) == 0
strncmp( device->infoblock.model_number, "IOMEGA Clik!", || strncmp( device->infoblock.model_number, "IOMEGA Clik!",
strlen( "IOMEGA Clik!" )) == 0 ) strlen( "IOMEGA Clik!")) == 0) {
{
SHOW_ERROR0(2, "Found buggy ZIP/Clik! drive - restricting transmission size"); SHOW_ERROR0(2, "Found buggy ZIP/Clik! drive - restricting transmission size");
*max_blocks = 64; *max_blocks = 64;
} }
@@ -761,7 +745,8 @@ ide_sim_get_restrictions(ide_bus_info *bus, uchar target_id,
} }
static status_t std_ops( int32 op, ... ) static status_t
std_ops(int32 op, ...)
{ {
switch (op) { switch (op) {
case B_MODULE_INIT: case B_MODULE_INIT: