Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hptiop/hptiop.c
Show First 20 Lines • Show All 2,040 Lines • ▼ Show 20 Lines | static int hptiop_attach(device_t dev) | ||||
set_config.vbus_id = cam_sim_path(hba->sim); | set_config.vbus_id = cam_sim_path(hba->sim); | ||||
set_config.max_host_request_size = HPT_SRB_MAX_REQ_SIZE; | set_config.max_host_request_size = HPT_SRB_MAX_REQ_SIZE; | ||||
if (hba->ops->set_config(hba, &set_config)) { | if (hba->ops->set_config(hba, &set_config)) { | ||||
device_printf(dev, "set iop config failed.\n"); | device_printf(dev, "set iop config failed.\n"); | ||||
goto free_hba_path; | goto free_hba_path; | ||||
} | } | ||||
xpt_setup_ccb(&ccb.ccb_h, hba->path, /*priority*/5); | xpt_setup_stack_ccb(&ccb.ccb_h, sizeof(ccb), hba->path, 5); | ||||
ccb.ccb_h.func_code = XPT_SASYNC_CB; | ccb.ccb_h.func_code = XPT_SASYNC_CB; | ||||
ccb.event_enable = (AC_FOUND_DEVICE | AC_LOST_DEVICE); | ccb.event_enable = (AC_FOUND_DEVICE | AC_LOST_DEVICE); | ||||
ccb.callback = hptiop_async; | ccb.callback = hptiop_async; | ||||
ccb.callback_arg = hba->sim; | ccb.callback_arg = hba->sim; | ||||
xpt_action((union ccb *)&ccb); | xpt_action((union ccb *)&ccb); | ||||
rid = 0; | rid = 0; | ||||
if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, SYS_RES_IRQ, | if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, SYS_RES_IRQ, | ||||
▲ Show 20 Lines • Show All 734 Lines • ▼ Show 20 Lines | static void hptiop_release_resource(struct hpt_iop_hba *hba) | ||||
int i; | int i; | ||||
if (hba->ioctl_dev) | if (hba->ioctl_dev) | ||||
destroy_dev(hba->ioctl_dev); | destroy_dev(hba->ioctl_dev); | ||||
if (hba->path) { | if (hba->path) { | ||||
struct ccb_setasync ccb; | struct ccb_setasync ccb; | ||||
xpt_setup_ccb(&ccb.ccb_h, hba->path, /*priority*/5); | xpt_setup_stack_ccb(&ccb.ccb_h, sizeof(ccb), hba->path, 5); | ||||
ccb.ccb_h.func_code = XPT_SASYNC_CB; | ccb.ccb_h.func_code = XPT_SASYNC_CB; | ||||
ccb.event_enable = 0; | ccb.event_enable = 0; | ||||
ccb.callback = hptiop_async; | ccb.callback = hptiop_async; | ||||
ccb.callback_arg = hba->sim; | ccb.callback_arg = hba->sim; | ||||
xpt_action((union ccb *)&ccb); | xpt_action((union ccb *)&ccb); | ||||
xpt_free_path(hba->path); | xpt_free_path(hba->path); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |