Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ciss/ciss.c
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | static struct cdevsw ciss_cdevsw = { | ||||
.d_version = D_VERSION, | .d_version = D_VERSION, | ||||
.d_flags = 0, | .d_flags = 0, | ||||
.d_open = ciss_open, | .d_open = ciss_open, | ||||
.d_close = ciss_close, | .d_close = ciss_close, | ||||
.d_ioctl = ciss_ioctl, | .d_ioctl = ciss_ioctl, | ||||
.d_name = "ciss", | .d_name = "ciss", | ||||
}; | }; | ||||
SYSCTL_NODE(_hw, OID_AUTO, ciss, CTLFLAG_RD, 0, "CISS sysctl tunables"); | |||||
kaktus: CTLFLAG_RD | CTLFLAG_MPSAFE | |||||
/* | /* | ||||
* This tunable can be set make the driver be more verbose | |||||
*/ | |||||
static int ciss_verbose = 0; | |||||
SYSCTL_INT(_hw_ciss, OID_AUTO, verbose, CTLFLAG_RWTUN, &ciss_verbose, 0, | |||||
"enable verbose messages"); | |||||
/* | |||||
* This tunable can be set at boot time and controls whether physical devices | * This tunable can be set at boot time and controls whether physical devices | ||||
* that are marked hidden by the firmware should be exposed anyways. | * that are marked hidden by the firmware should be exposed anyways. | ||||
*/ | */ | ||||
static unsigned int ciss_expose_hidden_physical = 0; | static unsigned int ciss_expose_hidden_physical = 0; | ||||
TUNABLE_INT("hw.ciss.expose_hidden_physical", &ciss_expose_hidden_physical); | TUNABLE_INT("hw.ciss.expose_hidden_physical", &ciss_expose_hidden_physical); | ||||
SYSCTL_INT(_hw_ciss, OID_AUTO, expose_hidden_physical, CTLFLAG_RWTUN, | |||||
&ciss_expose_hidden_physical, 0, | |||||
"expose hidden physical drives"); | |||||
static unsigned int ciss_nop_message_heartbeat = 0; | static unsigned int ciss_nop_message_heartbeat = 0; | ||||
TUNABLE_INT("hw.ciss.nop_message_heartbeat", &ciss_nop_message_heartbeat); | TUNABLE_INT("hw.ciss.nop_message_heartbeat", &ciss_nop_message_heartbeat); | ||||
SYSCTL_INT(_hw_ciss, OID_AUTO, nop_message_heartbeat, CTLFLAG_RWTUN, | |||||
&ciss_nop_message_heartbeat, 0, | |||||
"nop heartbeat messages"); | |||||
/* | /* | ||||
* This tunable can force a particular transport to be used: | * This tunable can force a particular transport to be used: | ||||
* <= 0 : use default | * <= 0 : use default | ||||
* 1 : force simple | * 1 : force simple | ||||
* 2 : force performant | * 2 : force performant | ||||
*/ | */ | ||||
static int ciss_force_transport = 0; | static int ciss_force_transport = 0; | ||||
TUNABLE_INT("hw.ciss.force_transport", &ciss_force_transport); | TUNABLE_INT("hw.ciss.force_transport", &ciss_force_transport); | ||||
SYSCTL_INT(_hw_ciss, OID_AUTO, force_transport, CTLFLAG_RDTUN, | |||||
&ciss_force_transport, 0, | |||||
"use default (0), force simple (1) or force performant (2) transport"); | |||||
/* | /* | ||||
* This tunable can force a particular interrupt delivery method to be used: | * This tunable can force a particular interrupt delivery method to be used: | ||||
* <= 0 : use default | * <= 0 : use default | ||||
* 1 : force INTx | * 1 : force INTx | ||||
* 2 : force MSIX | * 2 : force MSIX | ||||
*/ | */ | ||||
static int ciss_force_interrupt = 0; | static int ciss_force_interrupt = 0; | ||||
TUNABLE_INT("hw.ciss.force_interrupt", &ciss_force_interrupt); | TUNABLE_INT("hw.ciss.force_interrupt", &ciss_force_interrupt); | ||||
SYSCTL_INT(_hw_ciss, OID_AUTO, force_interrupt, CTLFLAG_RDTUN, | |||||
&ciss_force_interrupt, 0, | |||||
"use default (0), force INTx (1) or force MSIx(2) interrupts"); | |||||
impUnsubmitted Done Inline ActionsStray new newline imp: Stray new newline | |||||
/************************************************************************ | /************************************************************************ | ||||
* CISS adapters amazingly don't have a defined programming interface | * CISS adapters amazingly don't have a defined programming interface | ||||
* value. (One could say some very despairing things about PCI and | * value. (One could say some very despairing things about PCI and | ||||
* people just not getting the general idea.) So we are forced to | * people just not getting the general idea.) So we are forced to | ||||
* stick with matching against subvendor/subdevice, and thus have to | * stick with matching against subvendor/subdevice, and thus have to | ||||
* be updated for every new CISS adapter that appears. | * be updated for every new CISS adapter that appears. | ||||
*/ | */ | ||||
#define CISS_BOARD_UNKNWON 0 | #define CISS_BOARD_UNKNWON 0 | ||||
▲ Show 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | if (val < CISS_MSI_COUNT) | ||||
} | } | ||||
val = MIN(val, CISS_MSI_COUNT); | val = MIN(val, CISS_MSI_COUNT); | ||||
if (pci_alloc_msix(sc->ciss_dev, &val) != 0) { | if (pci_alloc_msix(sc->ciss_dev, &val) != 0) { | ||||
if (pci_alloc_msi(sc->ciss_dev, &val) != 0) | if (pci_alloc_msi(sc->ciss_dev, &val) != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
sc->ciss_msi = val; | sc->ciss_msi = val; | ||||
if (bootverbose) | if (bootverbose || ciss_verbose) | ||||
ciss_printf(sc, "Using %d MSIX interrupt%s\n", val, | ciss_printf(sc, "Using %d MSIX interrupt%s\n", val, | ||||
(val != 1) ? "s" : ""); | (val != 1) ? "s" : ""); | ||||
for (i = 0; i < val; i++) | for (i = 0; i < val; i++) | ||||
sc->ciss_irq_rid[i] = i + 1; | sc->ciss_irq_rid[i] = i + 1; | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
ciss_init_requests(struct ciss_softc *sc) | ciss_init_requests(struct ciss_softc *sc) | ||||
{ | { | ||||
struct ciss_request *cr; | struct ciss_request *cr; | ||||
int i; | int i; | ||||
debug_called(1); | debug_called(1); | ||||
if (bootverbose) | if (bootverbose || ciss_verbose) | ||||
ciss_printf(sc, "using %d of %d available commands\n", | ciss_printf(sc, "using %d of %d available commands\n", | ||||
sc->ciss_max_requests, sc->ciss_cfg->max_outstanding_commands); | sc->ciss_max_requests, sc->ciss_cfg->max_outstanding_commands); | ||||
/* | /* | ||||
* Create the DMA tag for commands. | * Create the DMA tag for commands. | ||||
*/ | */ | ||||
if (bus_dma_tag_create(sc->ciss_parent_dmat, /* parent */ | if (bus_dma_tag_create(sc->ciss_parent_dmat, /* parent */ | ||||
32, 0, /* alignment, boundary */ | 32, 0, /* alignment, boundary */ | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | #endif | ||||
* these values to the defaults that were established | * these values to the defaults that were established | ||||
* when this driver was developed for them | * when this driver was developed for them | ||||
*/ | */ | ||||
if (sc->ciss_cfg->max_logical_supported == 0) | if (sc->ciss_cfg->max_logical_supported == 0) | ||||
sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; | sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL; | ||||
if (sc->ciss_cfg->max_physical_supported == 0) | if (sc->ciss_cfg->max_physical_supported == 0) | ||||
sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; | sc->ciss_cfg->max_physical_supported = CISS_MAX_PHYSICAL; | ||||
/* print information */ | /* print information */ | ||||
if (bootverbose) { | if (bootverbose || ciss_verbose) { | ||||
ciss_printf(sc, " %d logical drive%s configured\n", | ciss_printf(sc, " %d logical drive%s configured\n", | ||||
sc->ciss_id->configured_logical_drives, | sc->ciss_id->configured_logical_drives, | ||||
(sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); | (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); | ||||
ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); | ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); | ||||
ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_chip_count); | ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_chip_count); | ||||
ciss_printf(sc, " signature '%.4s'\n", sc->ciss_cfg->signature); | ciss_printf(sc, " signature '%.4s'\n", sc->ciss_cfg->signature); | ||||
ciss_printf(sc, " valence %d\n", sc->ciss_cfg->valence); | ciss_printf(sc, " valence %d\n", sc->ciss_cfg->valence); | ||||
Show All 9 Lines | #endif | ||||
ciss_printf(sc, " interrupt coalesce count %d\n", | ciss_printf(sc, " interrupt coalesce count %d\n", | ||||
sc->ciss_cfg->interrupt_coalesce_count); | sc->ciss_cfg->interrupt_coalesce_count); | ||||
ciss_printf(sc, " max outstanding commands %d\n", | ciss_printf(sc, " max outstanding commands %d\n", | ||||
sc->ciss_cfg->max_outstanding_commands); | sc->ciss_cfg->max_outstanding_commands); | ||||
ciss_printf(sc, " bus types 0x%b\n", sc->ciss_cfg->bus_types, | ciss_printf(sc, " bus types 0x%b\n", sc->ciss_cfg->bus_types, | ||||
"\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); | "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); | ||||
ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); | ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); | ||||
ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); | ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); | ||||
ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); | ciss_printf(sc, " max logical volumes supported: %d\n", sc->ciss_cfg->max_logical_supported); | ||||
ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); | ciss_printf(sc, " max physical drives supported: %d\n", sc->ciss_cfg->max_physical_supported); | ||||
ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); | ciss_printf(sc, " max physical drives per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); | ||||
ciss_printf(sc, " JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ? | ciss_printf(sc, " JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ? | ||||
"Available" : "Unavailable"); | "Available" : "Unavailable"); | ||||
ciss_printf(sc, " JBOD Mode is %s\n", (sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED) ? | ciss_printf(sc, " JBOD Mode is %s\n", (sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED) ? | ||||
"Enabled" : "Disabled"); | "Enabled" : "Disabled"); | ||||
} | } | ||||
out: | out: | ||||
if (error) { | if (error) { | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", | ||||
ndrives, sc->ciss_cfg->max_logical_supported); | ndrives, sc->ciss_cfg->max_logical_supported); | ||||
error = ENXIO; | error = ENXIO; | ||||
goto out; | goto out; | ||||
} | } | ||||
/* | /* | ||||
* Save logical drive information. | * Save logical drive information. | ||||
*/ | */ | ||||
if (bootverbose) { | if (bootverbose || ciss_verbose) { | ||||
ciss_printf(sc, "%d logical drive%s\n", | ciss_printf(sc, "%d logical drive%s\n", | ||||
ndrives, (ndrives > 1 || ndrives == 0) ? "s" : ""); | ndrives, (ndrives > 1 || ndrives == 0) ? "s" : ""); | ||||
} | } | ||||
sc->ciss_logical = | sc->ciss_logical = | ||||
malloc(sc->ciss_max_logical_bus * sizeof(struct ciss_ldrive *), | malloc(sc->ciss_max_logical_bus * sizeof(struct ciss_ldrive *), | ||||
CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); | CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO); | ||||
if (sc->ciss_logical == NULL) { | if (sc->ciss_logical == NULL) { | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS, | ||||
sc->ciss_cfg->max_physical_supported); | sc->ciss_cfg->max_physical_supported); | ||||
if (cll == NULL) { | if (cll == NULL) { | ||||
error = ENXIO; | error = ENXIO; | ||||
goto out; | goto out; | ||||
} | } | ||||
nphys = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); | nphys = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); | ||||
if (bootverbose) { | if (bootverbose || ciss_verbose) { | ||||
ciss_printf(sc, "%d physical device%s\n", | ciss_printf(sc, "%d physical device%s\n", | ||||
nphys, (nphys > 1 || nphys == 0) ? "s" : ""); | nphys, (nphys > 1 || nphys == 0) ? "s" : ""); | ||||
} | } | ||||
/* Per-controller highest target number seen */ | |||||
sc->ciss_max_physical_target = 0; | |||||
/* | /* | ||||
* Figure out the bus mapping. | * Figure out the bus mapping. | ||||
* Logical buses include both the local logical bus for local arrays and | * Logical buses include both the local logical bus for local arrays and | ||||
* proxy buses for remote arrays. Physical buses are numbered by the | * proxy buses for remote arrays. Physical buses are numbered by the | ||||
* controller and represent physical buses that hold physical devices. | * controller and represent physical buses that hold physical devices. | ||||
* We shift these bus numbers so that everything fits into a single flat | * We shift these bus numbers so that everything fits into a single flat | ||||
* numbering space for CAM. Logical buses occupy the first 32 CAM bus | * numbering space for CAM. Logical buses occupy the first 32 CAM bus | ||||
* numbers, and the physical bus numbers are shifted to be above that. | * numbers, and the physical bus numbers are shifted to be above that. | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | ciss_init_physical(struct ciss_softc *sc) | ||||
if (sc->ciss_physical[i] == NULL) { | if (sc->ciss_physical[i] == NULL) { | ||||
ciss_printf(sc, "Could not allocate memory for target map\n"); | ciss_printf(sc, "Could not allocate memory for target map\n"); | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto out; | goto out; | ||||
} | } | ||||
} | } | ||||
ciss_filter_physical(sc, cll); | ciss_filter_physical(sc, cll); | ||||
if (bootverbose || ciss_verbose) | |||||
ciss_printf(sc, "max physical target id: %d\n", sc->ciss_max_physical_target); | |||||
Not Done Inline ActionsPrepending two spaces before " max" will make formatting consistent with other ciss_printf commands above. zarychtam_plan-b.pwste.edu.pl: Prepending two spaces before " max" will make formatting consistent with other ciss_printf… | |||||
Done Inline ActionsI was wrong, this part looks fine in the place where it's displayed. Please leave it as is. Please let me apologise for the wasteful comment I made above. zarychtam_plan-b.pwste.edu.pl: I was wrong, this part looks fine in the place where it's displayed. Please leave it as is. | |||||
out: | out: | ||||
if (cll != NULL) | if (cll != NULL) | ||||
free(cll, CISS_MALLOC_CLASS); | free(cll, CISS_MALLOC_CLASS); | ||||
return(error); | return(error); | ||||
} | } | ||||
Show All 33 Lines | ciss_filter_physical(struct ciss_softc *sc, struct ciss_lun_report *cll) | ||||
* Note: CISS firmware numbers physical busses starting at '1', not | * Note: CISS firmware numbers physical busses starting at '1', not | ||||
* '0'. This numbering is internal to the firmware and is only | * '0'. This numbering is internal to the firmware and is only | ||||
* used as a hint here. | * used as a hint here. | ||||
*/ | */ | ||||
bus = CISS_EXTRA_BUS2(ea) - 1; | bus = CISS_EXTRA_BUS2(ea) - 1; | ||||
target = CISS_EXTRA_TARGET2(ea); | target = CISS_EXTRA_TARGET2(ea); | ||||
sc->ciss_physical[bus][target].cp_address = cll->lun[i]; | sc->ciss_physical[bus][target].cp_address = cll->lun[i]; | ||||
sc->ciss_physical[bus][target].cp_online = 1; | sc->ciss_physical[bus][target].cp_online = 1; | ||||
if (target > sc->ciss_max_physical_target) | |||||
Done Inline ActionsReplacing this line with: if ((target > sc->ciss_max_physical_target) && (cll->lun[i].physical.mode != CISS_HDR_ADDRESS_MODE_MASK_PERIPHERAL)) fixes root mount while booting with ciss_expose_hidden_physical="1" and makes hidden pass(4) devices visible. zarychtam_plan-b.pwste.edu.pl: Replacing this line with:
if ((target > sc->ciss_max_physical_target) &&… | |||||
sc->ciss_max_physical_target = target; | |||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ciss_inquiry_logical(struct ciss_softc *sc, struct ciss_ldrive *ld) | ciss_inquiry_logical(struct ciss_softc *sc, struct ciss_ldrive *ld) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | goto out; | ||||
* Get the logical drive geometry. | * Get the logical drive geometry. | ||||
*/ | */ | ||||
if ((error = ciss_inquiry_logical(sc, ld)) != 0) | if ((error = ciss_inquiry_logical(sc, ld)) != 0) | ||||
goto out; | goto out; | ||||
/* | /* | ||||
* Print the drive's basic characteristics. | * Print the drive's basic characteristics. | ||||
*/ | */ | ||||
if (bootverbose) { | if (bootverbose || ciss_verbose) { | ||||
ciss_printf(sc, "logical drive (b%dt%d): %s, %dMB ", | ciss_printf(sc, "logical drive (b%dt%d): %s, %dMB ", | ||||
CISS_LUN_TO_BUS(ld->cl_address.logical.lun), | CISS_LUN_TO_BUS(ld->cl_address.logical.lun), | ||||
CISS_LUN_TO_TARGET(ld->cl_address.logical.lun), | CISS_LUN_TO_TARGET(ld->cl_address.logical.lun), | ||||
ciss_name_ldrive_org(ld->cl_ldrive->fault_tolerance), | ciss_name_ldrive_org(ld->cl_ldrive->fault_tolerance), | ||||
((ld->cl_ldrive->blocks_available / (1024 * 1024)) * | ((ld->cl_ldrive->blocks_available / (1024 * 1024)) * | ||||
ld->cl_ldrive->block_size)); | ld->cl_ldrive->block_size)); | ||||
ciss_print_ldrive(sc, ld); | ciss_print_ldrive(sc, ld); | ||||
▲ Show 20 Lines • Show All 549 Lines • ▼ Show 20 Lines | if (command_status != NULL) | ||||
*command_status = ce->command_status; | *command_status = ce->command_status; | ||||
if (scsi_status != NULL) { | if (scsi_status != NULL) { | ||||
if (ce->command_status == CISS_CMD_STATUS_TARGET_STATUS) { | if (ce->command_status == CISS_CMD_STATUS_TARGET_STATUS) { | ||||
*scsi_status = ce->scsi_status; | *scsi_status = ce->scsi_status; | ||||
} else { | } else { | ||||
*scsi_status = -1; | *scsi_status = -1; | ||||
} | } | ||||
} | } | ||||
if (bootverbose) | if (bootverbose || ciss_verbose > 1) | ||||
ciss_printf(cr->cr_sc, "command status 0x%x (%s) scsi status 0x%x\n", | ciss_printf(cr->cr_sc, "command status 0x%x (%s) scsi status 0x%x\n", | ||||
ce->command_status, ciss_name_command_status(ce->command_status), | ce->command_status, ciss_name_command_status(ce->command_status), | ||||
ce->scsi_status); | ce->scsi_status); | ||||
if (ce->command_status == CISS_CMD_STATUS_INVALID_COMMAND) { | if (ce->command_status == CISS_CMD_STATUS_INVALID_COMMAND) { | ||||
ciss_printf(cr->cr_sc, "invalid command, offense size %d at %d, value 0x%x, function %s\n", | ciss_printf(cr->cr_sc, "invalid command, offense size %d at %d, value 0x%x, function %s\n", | ||||
ce->additional_error_info.invalid_command.offense_size, | ce->additional_error_info.invalid_command.offense_size, | ||||
ce->additional_error_info.invalid_command.offense_offset, | ce->additional_error_info.invalid_command.offense_offset, | ||||
ce->additional_error_info.invalid_command.offense_value, | ce->additional_error_info.invalid_command.offense_value, | ||||
▲ Show 20 Lines • Show All 675 Lines • ▼ Show 20 Lines | ciss_cam_action(struct cam_sim *sim, union ccb *ccb) | ||||
int sg_length; | int sg_length; | ||||
debug(1, "XPT_PATH_INQ %d:%d:%d", cam_sim_bus(sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun); | debug(1, "XPT_PATH_INQ %d:%d:%d", cam_sim_bus(sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun); | ||||
cpi->version_num = 1; | cpi->version_num = 1; | ||||
cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ | cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ | ||||
cpi->target_sprt = 0; | cpi->target_sprt = 0; | ||||
cpi->hba_misc = 0; | cpi->hba_misc = 0; | ||||
cpi->max_target = sc->ciss_cfg->max_logical_supported; | cpi->max_target = MAX(sc->ciss_max_physical_target, sc->ciss_cfg->max_logical_supported); | ||||
cpi->max_lun = 0; /* 'logical drive' channel only */ | cpi->max_lun = 0; /* 'logical drive' channel only */ | ||||
Done Inline Actionssys/param.h provides a MAX() macro that you should use here. kevans: `sys/param.h` provides a MAX() macro that you should use here. | |||||
cpi->initiator_id = sc->ciss_cfg->max_logical_supported; | cpi->initiator_id = CAM_TARGET_WILDCARD; | ||||
strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); | strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); | ||||
Done Inline Actions0 is a wrong value here, since it may affect scanning for target 0. Something like CAM_TARGET_WILDCARD could be better, unless special value introduced.. mav: 0 is a wrong value here, since it may affect scanning for target 0. Something like… | |||||
strlcpy(cpi->hba_vid, "CISS", HBA_IDLEN); | strlcpy(cpi->hba_vid, "CISS", HBA_IDLEN); | ||||
strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); | ||||
cpi->unit_number = cam_sim_unit(sim); | cpi->unit_number = cam_sim_unit(sim); | ||||
cpi->bus_id = cam_sim_bus(sim); | cpi->bus_id = cam_sim_bus(sim); | ||||
cpi->base_transfer_speed = 132 * 1024; /* XXX what to set this to? */ | cpi->base_transfer_speed = 132 * 1024; /* XXX what to set this to? */ | ||||
cpi->transport = XPORT_SPI; | cpi->transport = XPORT_SPI; | ||||
cpi->transport_version = 2; | cpi->transport_version = 2; | ||||
cpi->protocol = PROTO_SCSI; | cpi->protocol = PROTO_SCSI; | ||||
▲ Show 20 Lines • Show All 1,134 Lines • ▼ Show 20 Lines | if (STAILQ_EMPTY(&sc->ciss_notify) != 0 && | ||||
msleep(&sc->ciss_notify, &sc->ciss_mtx, PUSER, "idle", 0); | msleep(&sc->ciss_notify, &sc->ciss_mtx, PUSER, "idle", 0); | ||||
} | } | ||||
if (sc->ciss_flags & CISS_FLAG_THREAD_SHUT) | if (sc->ciss_flags & CISS_FLAG_THREAD_SHUT) | ||||
break; | break; | ||||
cr = ciss_dequeue_notify(sc); | cr = ciss_dequeue_notify(sc); | ||||
if (cr == NULL) | if (cr == NULL) { | ||||
#if 1 | |||||
impUnsubmitted Done Inline ActionsI'd just remove the panic and the ifdef, keeping just the printf. imp: I'd just remove the panic and the ifdef, keeping just the printf. | |||||
/* | |||||
* We get a NULL message sometimes when unplugging/replugging stuff | |||||
*/ | |||||
if (ciss_verbose) | |||||
ciss_printf(sc, "NULL notify event received\n"); | |||||
continue; | |||||
#else | |||||
panic("cr null"); | panic("cr null"); | ||||
#endif | |||||
} | |||||
cn = (struct ciss_notify *)cr->cr_data; | cn = (struct ciss_notify *)cr->cr_data; | ||||
switch (cn->class) { | switch (cn->class) { | ||||
case CISS_NOTIFY_HOTPLUG: | case CISS_NOTIFY_HOTPLUG: | ||||
ciss_notify_hotplug(sc, cn); | ciss_notify_hotplug(sc, cn); | ||||
break; | break; | ||||
case CISS_NOTIFY_LOGICAL: | case CISS_NOTIFY_LOGICAL: | ||||
ciss_notify_logical(sc, cn); | ciss_notify_logical(sc, cn); | ||||
▲ Show 20 Lines • Show All 543 Lines • Show Last 20 Lines |
CTLFLAG_RD | CTLFLAG_MPSAFE