Lines Matching +full:dev +full:- +full:active +full:- +full:grp

1 /*-
76 mtx_lock(&ocs->dbg_lock); in __ocs_ioctl_mbox_cb()
78 mtx_unlock(&ocs->dbg_lock); in __ocs_ioctl_mbox_cb()
88 sli4_cmd_sli_config_t *sli_config = (sli4_cmd_sli_config_t *)mcmd->payload; in ocs_process_sli_config()
91 if (sli_config->emb) { in ocs_process_sli_config()
92 sli4_req_hdr_t *req = (sli4_req_hdr_t *)sli_config->payload.embed; in ocs_process_sli_config()
94 switch (req->opcode) { in ocs_process_sli_config()
96 if (mcmd->out_bytes) { in ocs_process_sli_config()
98 (sli4_req_common_read_object_t *)sli_config->payload.embed; in ocs_process_sli_config()
100 if (ocs_dma_alloc(ocs, dma, mcmd->out_bytes, 4096)) { in ocs_process_sli_config()
101 device_printf(ocs->dev, "%s: COMMON_READ_OBJECT - %lld allocation failed\n", in ocs_process_sli_config()
102 __func__, (unsigned long long)mcmd->out_bytes); in ocs_process_sli_config()
106 memset(dma->virt, 0, mcmd->out_bytes); in ocs_process_sli_config()
108 rdobj->host_buffer_descriptor[0].bde_type = SLI4_BDE_TYPE_BDE_64; in ocs_process_sli_config()
109 rdobj->host_buffer_descriptor[0].buffer_length = mcmd->out_bytes; in ocs_process_sli_config()
110 rdobj->host_buffer_descriptor[0].u.data.buffer_address_low = ocs_addr32_lo(dma->phys); in ocs_process_sli_config()
111 rdobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys); in ocs_process_sli_config()
117 (sli4_req_common_write_object_t *)sli_config->payload.embed; in ocs_process_sli_config()
119 if (ocs_dma_alloc(ocs, dma, wrobj->desired_write_length, 4096)) { in ocs_process_sli_config()
120 device_printf(ocs->dev, "%s: COMMON_WRITE_OBJECT - %d allocation failed\n", in ocs_process_sli_config()
121 __func__, wrobj->desired_write_length); in ocs_process_sli_config()
125 wrobj->host_buffer_descriptor[0].bde_type = SLI4_BDE_TYPE_BDE_64; in ocs_process_sli_config()
126 wrobj->host_buffer_descriptor[0].buffer_length = wrobj->desired_write_length; in ocs_process_sli_config()
127 wrobj->host_buffer_descriptor[0].u.data.buffer_address_low = ocs_addr32_lo(dma->phys); in ocs_process_sli_config()
128 wrobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys); in ocs_process_sli_config()
131 error = copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); in ocs_process_sli_config()
133 device_printf(ocs->dev, "%s: COMMON_WRITE_OBJECT - copyin failed: %d\n", in ocs_process_sli_config()
143 if (mcmd->out_bytes) { in ocs_process_sli_config()
145 (sli4_req_common_read_object_list_t *)sli_config->payload.embed; in ocs_process_sli_config()
147 if (ocs_dma_alloc(ocs, dma, mcmd->out_bytes, 4096)) { in ocs_process_sli_config()
148 device_printf(ocs->dev, "%s: COMMON_READ_OBJECT_LIST - %lld allocation failed\n", in ocs_process_sli_config()
149 __func__,(unsigned long long) mcmd->out_bytes); in ocs_process_sli_config()
153 memset(dma->virt, 0, mcmd->out_bytes); in ocs_process_sli_config()
155 rdobj->host_buffer_descriptor[0].bde_type = SLI4_BDE_TYPE_BDE_64; in ocs_process_sli_config()
156 rdobj->host_buffer_descriptor[0].buffer_length = mcmd->out_bytes; in ocs_process_sli_config()
157 rdobj->host_buffer_descriptor[0].u.data.buffer_address_low = ocs_addr32_lo(dma->phys); in ocs_process_sli_config()
158 rdobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys); in ocs_process_sli_config()
164 device_printf(ocs->dev, "%s: in=%p (%lld) out=%p (%lld)\n", __func__, in ocs_process_sli_config()
165 (void *)(uintptr_t)mcmd->in_addr, (unsigned long long)mcmd->in_bytes, in ocs_process_sli_config()
166 (void *)(uintptr_t)mcmd->out_addr, (unsigned long long)mcmd->out_bytes); in ocs_process_sli_config()
167 device_printf(ocs->dev, "%s: unknown (opc=%#x)\n", __func__, in ocs_process_sli_config()
168 req->opcode); in ocs_process_sli_config()
169 hexdump(mcmd, mcmd->size, NULL, 0); in ocs_process_sli_config()
173 uint32_t max_bytes = max(mcmd->in_bytes, mcmd->out_bytes); in ocs_process_sli_config()
175 device_printf(ocs->dev, "%s: non-embedded - %u allocation failed\n", in ocs_process_sli_config()
180 error = copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); in ocs_process_sli_config()
182 device_printf(ocs->dev, "%s: non-embedded - copyin failed: %d\n", in ocs_process_sli_config()
188 sli_config->payload.mem.address_low = ocs_addr32_lo(dma->phys); in ocs_process_sli_config()
189 sli_config->payload.mem.address_high = ocs_addr32_hi(dma->phys); in ocs_process_sli_config()
190 sli_config->payload.mem.length = max_bytes; in ocs_process_sli_config()
204 if ((ELXU_BSD_MAGIC != mcmd->magic) || in ocs_process_mbx_ioctl()
205 (sizeof(ocs_ioctl_elxu_mbox_t) != mcmd->size)) { in ocs_process_mbx_ioctl()
206 device_printf(ocs->dev, "%s: malformed command m=%08x s=%08x\n", in ocs_process_mbx_ioctl()
207 __func__, mcmd->magic, mcmd->size); in ocs_process_mbx_ioctl()
211 switch(((sli4_mbox_command_header_t *)mcmd->payload)->command) { in ocs_process_mbx_ioctl()
223 device_printf(ocs->dev, "command %d\n",((sli4_mbox_command_header_t *)mcmd->payload)->command); in ocs_process_mbx_ioctl()
224 device_printf(ocs->dev, "%s, command not support\n", __func__); in ocs_process_mbx_ioctl()
243 * 5. msleep returns, re-acquiring the lock in ocs_process_mbx_ioctl()
246 mtx_lock(&ocs->dbg_lock); in ocs_process_mbx_ioctl()
247 if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, in ocs_process_mbx_ioctl()
249 device_printf(ocs->dev, "%s: command- %x failed\n", __func__, in ocs_process_mbx_ioctl()
250 ((sli4_mbox_command_header_t *)mcmd->payload)->command); in ocs_process_mbx_ioctl()
252 msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); in ocs_process_mbx_ioctl()
253 mtx_unlock(&ocs->dbg_lock); in ocs_process_mbx_ioctl()
255 if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command in ocs_process_mbx_ioctl()
256 && mcmd->out_bytes && dma.virt) { in ocs_process_mbx_ioctl()
257 error = copyout(dma.virt, (void *)(uintptr_t)mcmd->out_addr, mcmd->out_bytes); in ocs_process_mbx_ioctl()
287 switch(req->cmd) { in ocs_process_ecd_helper()
294 if (req->bar >= PCI_MAX_BAR) { in ocs_process_ecd_helper()
295 device_printf(ocs->dev, "Error: bar %d out of range\n", req->bar); in ocs_process_ecd_helper()
296 return -EFAULT; in ocs_process_ecd_helper()
298 if (ocs->reg[req->bar].res == NULL) { in ocs_process_ecd_helper()
299 device_printf(ocs->dev, "Error: bar %d not defined\n", req->bar); in ocs_process_ecd_helper()
300 return -EFAULT; in ocs_process_ecd_helper()
307 switch(req->cmd) { in ocs_process_ecd_helper()
309 v8 = ocs_config_read8(ocs, req->offset); in ocs_process_ecd_helper()
310 req->data = v8; in ocs_process_ecd_helper()
313 v16 = ocs_config_read16(ocs, req->offset); in ocs_process_ecd_helper()
314 req->data = v16; in ocs_process_ecd_helper()
317 v32 = ocs_config_read32(ocs, req->offset); in ocs_process_ecd_helper()
318 req->data = v32; in ocs_process_ecd_helper()
321 ocs_config_write8(ocs, req->offset, req->data); in ocs_process_ecd_helper()
324 ocs_config_write16(ocs, req->offset, req->data); in ocs_process_ecd_helper()
327 ocs_config_write32(ocs, req->offset, req->data); in ocs_process_ecd_helper()
330 req->data = ocs_reg_read8(ocs, req->bar, req->offset); in ocs_process_ecd_helper()
333 req->data = ocs_reg_read16(ocs, req->bar, req->offset); in ocs_process_ecd_helper()
336 req->data = ocs_reg_read32(ocs, req->bar, req->offset); in ocs_process_ecd_helper()
339 ocs_reg_write8(ocs, req->bar, req->offset, req->data); in ocs_process_ecd_helper()
342 ocs_reg_write16(ocs, req->bar, req->offset, req->data); in ocs_process_ecd_helper()
345 ocs_reg_write32(ocs, req->bar, req->offset, req->data); in ocs_process_ecd_helper()
348 device_printf(ocs->dev, "Invalid helper command=%d\n", req->cmd); in ocs_process_ecd_helper()
359 struct ocs_softc *ocs = cdev->si_drv1; in ocs_ioctl()
360 device_t dev = ocs->dev; in ocs_ioctl() local
381 domain = ocs_domain_get_instance(ocs, req->domain_index); in ocs_ioctl()
383 device_printf(ocs->dev, "domain [%d] nod found\n", in ocs_ioctl()
384 req->domain_index); in ocs_ioctl()
385 return -EFAULT; in ocs_ioctl()
388 if (req->req_create) { in ocs_ioctl()
389 rc = ocs_sport_vport_new(domain, req->wwpn, req->wwnn, in ocs_ioctl()
390 UINT32_MAX, req->enable_ini, in ocs_ioctl()
391 req->enable_tgt, NULL, NULL, TRUE); in ocs_ioctl()
393 rc = ocs_sport_vport_del(ocs, domain, req->wwpn, req->wwnn); in ocs_ioctl()
405 if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) { in ocs_ioctl()
406 device_printf(ocs->dev, "Error: ocs_textbuf_alloc failed\n"); in ocs_ioctl()
407 return -EFAULT; in ocs_ioctl()
410 switch (req->args.action) { in ocs_ioctl()
420 if (req->args.action == OCS_IOCTL_DDUMP_GET_SAVED) { in ocs_ioctl()
421 if (ocs_textbuf_initialized(&ocs->ddump_saved)) { in ocs_ioctl()
422 ptbuf = &ocs->ddump_saved; in ocs_ioctl()
425 if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) { in ocs_ioctl()
427 return -EFAULT; in ocs_ioctl()
431 if (req->args.flags & OCS_IOCTL_DDUMP_FLAGS_WQES) { in ocs_ioctl()
434 if (req->args.flags & OCS_IOCTL_DDUMP_FLAGS_CQES) { in ocs_ioctl()
437 if (req->args.flags & OCS_IOCTL_DDUMP_FLAGS_MQES) { in ocs_ioctl()
440 if (req->args.flags & OCS_IOCTL_DDUMP_FLAGS_RQES) { in ocs_ioctl()
443 if (req->args.flags & OCS_IOCTL_DDUMP_FLAGS_EQES) { in ocs_ioctl()
449 if (ocs_ddump(ocs, &textbuf, flags, req->args.q_entries) != 0) { in ocs_ioctl()
467 remaining = req->user_buffer_len; in ocs_ioctl()
476 if (ocs_copy_to_user(req->user_buffer + written, in ocs_ioctl()
481 remaining -= (uint32_t)n; in ocs_ioctl()
484 req->bytes_written = written; in ocs_ioctl()
505 req->pci_vendor = ocs->pci_vendor; in ocs_ioctl()
506 req->pci_device = ocs->pci_device; in ocs_ioctl()
507 ocs_strncpy(req->businfo, ocs->businfo, sizeof(req->businfo)); in ocs_ioctl()
509 req->sli_intf = ocs_config_read32(ocs, SLI4_INTF_REG); in ocs_ioctl()
510 ocs_strncpy(req->desc, device_get_desc(dev), sizeof(req->desc)); in ocs_ioctl()
511 ocs_strncpy(req->fw_rev, ocs->fwrev, sizeof(req->fw_rev)); in ocs_ioctl()
512 if (ocs->domain && ocs->domain->sport) { in ocs_ioctl()
513 *((uint64_t*)req->hw_addr.fc.wwnn) = ocs_htobe64(ocs->domain->sport->wwnn); in ocs_ioctl()
514 *((uint64_t*)req->hw_addr.fc.wwpn) = ocs_htobe64(ocs->domain->sport->wwpn); in ocs_ioctl()
516 ocs_strncpy(req->serialnum, ocs->serialnum, sizeof(req->serialnum)); in ocs_ioctl()
525 if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) { in ocs_ioctl()
527 return -EFAULT; in ocs_ioctl()
533 if (ocs_copy_to_user(req->user_buffer, in ocs_ioctl()
539 req->bytes_written = ocs_textbuf_get_written(&textbuf); in ocs_ioctl()
554 if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) { in ocs_ioctl()
556 return -EFAULT; in ocs_ioctl()
562 if(ocs_copy_to_user(req->user_buffer + copied, in ocs_ioctl()
569 req->bytes_written = copied; in ocs_ioctl()
582 if (ocs_copy_from_user(name, req->name, OCS_MGMT_MAX_NAME)) { in ocs_ioctl()
585 return -EFAULT; in ocs_ioctl()
589 if (ocs_textbuf_alloc(ocs, &textbuf, req->value_length)) { in ocs_ioctl()
591 return -EFAULT; in ocs_ioctl()
597 if (ocs_copy_to_user(req->value, in ocs_ioctl()
603 req->value_length = ocs_textbuf_get_written(&textbuf); in ocs_ioctl()
616 if (ocs_copy_from_user(name, req->name, OCS_MGMT_MAX_NAME)) { in ocs_ioctl()
619 return -EFAULT; in ocs_ioctl()
623 if (ocs_copy_from_user(value, req->value, OCS_MGMT_MAX_VALUE)) { in ocs_ioctl()
626 return -EFAULT; in ocs_ioctl()
629 req->result = ocs_mgmt_set(ocs, name, value); in ocs_ioctl()
638 if (ocs_copy_from_user(action_name, req->name, sizeof(action_name))) { in ocs_ioctl()
641 return -EFAULT; in ocs_ioctl()
644 req->result = ocs_mgmt_exec(ocs, action_name, req->arg_in, req->arg_in_length, in ocs_ioctl()
645 req->arg_out, req->arg_out_length); in ocs_ioctl()
652 status = -ENOTTY; in ocs_ioctl()
664 result->status = status; in ocs_fw_write_cb()
665 result->actual_xfer = actual_write_length; in ocs_fw_write_cb()
666 result->change_status = change_status; in ocs_fw_write_cb()
668 ocs_sem_v(&(result->semaphore)); in ocs_fw_write_cb()
690 return -ENOMEM; in ocs_firmware_write()
706 ocs_hw_firmware_write(&ocs->hw, &dma, xfer_size, offset, in ocs_firmware_write()
710 rc = -ENXIO; in ocs_firmware_write()
715 rc = -EFAULT; in ocs_firmware_write()
723 bytes_left -= result.actual_xfer; in ocs_firmware_write()
742 if (rc || !req->newptr) in ocs_sys_fwupgrade()
747 device_printf(ocs->dev, "Unable to get Firmware. " in ocs_sys_fwupgrade()
752 fw_image = (const struct ocs_hw_grp_hdr *)fw->data; in ocs_sys_fwupgrade()
756 if ((ocs_be32toh(fw_image->magic_number) != OCS_HW_OBJECT_G5) && in ocs_sys_fwupgrade()
757 (ocs_be32toh(fw_image->magic_number) != OCS_HW_OBJECT_G6)) { in ocs_sys_fwupgrade()
758 device_printf(ocs->dev, in ocs_sys_fwupgrade()
760 ocs_be32toh(fw_image->magic_number), fw->datasize); in ocs_sys_fwupgrade()
761 rc = -1; in ocs_sys_fwupgrade()
765 if (!strncmp(ocs->fw_version, fw_image->revision, in ocs_sys_fwupgrade()
766 strnlen(fw_image->revision, 16))) { in ocs_sys_fwupgrade()
767 device_printf(ocs->dev, "No update req. " in ocs_sys_fwupgrade()
773 device_printf(ocs->dev, "Upgrading Firmware from %s to %s \n", in ocs_sys_fwupgrade()
774 ocs->fw_version, fw_image->revision); in ocs_sys_fwupgrade()
776 rc = ocs_firmware_write(ocs, fw->data, fw->datasize, &fw_change_status); in ocs_sys_fwupgrade()
783 device_printf(ocs->dev, in ocs_sys_fwupgrade()
784 "No reset needed, new firmware is active.\n"); in ocs_sys_fwupgrade()
787 device_printf(ocs->dev, in ocs_sys_fwupgrade()
793 device_printf(ocs->dev, in ocs_sys_fwupgrade()
817 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_wwnn()
821 ocs_xport_t *xport = ocs->xport; in ocs_sysctl_wwnn()
823 if (xport->req_wwnn) { in ocs_sysctl_wwnn()
824 wwnn = &xport->req_wwnn; in ocs_sysctl_wwnn()
829 wwnn = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_NODE); in ocs_sysctl_wwnn()
836 if (!req->newptr) { in ocs_sysctl_wwnn()
856 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_wwpn()
860 ocs_xport_t *xport = ocs->xport; in ocs_sysctl_wwpn()
862 if (xport->req_wwpn) { in ocs_sysctl_wwpn()
863 wwpn = &xport->req_wwpn; in ocs_sysctl_wwpn()
867 wwpn = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_PORT); in ocs_sysctl_wwpn()
873 if (!req->newptr) { in ocs_sysctl_wwpn()
892 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_current_topology()
895 ocs_hw_get(&ocs->hw, OCS_HW_TOPOLOGY, &value); in ocs_sysctl_current_topology()
903 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_current_speed()
906 ocs_hw_get(&ocs->hw, OCS_HW_LINK_SPEED, &value); in ocs_sysctl_current_speed()
915 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_config_topology()
920 ocs_hw_get(&ocs->hw, OCS_HW_CONFIG_TOPOLOGY, &old_value); in ocs_sysctl_config_topology()
923 if (!req->newptr) { in ocs_sysctl_config_topology()
945 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_config_speed()
950 ocs_hw_get(&ocs->hw, OCS_HW_LINK_CONFIG_SPEED, &old_value); in ocs_sysctl_config_speed()
953 if (!req->newptr) { in ocs_sysctl_config_speed()
974 ocs_t *ocs = oidp->oid_arg1; in ocs_sysctl_fcid()
978 if (ocs->domain && ocs->domain->attached) { in ocs_sysctl_fcid()
980 ocs->domain->sport->fc_id); in ocs_sysctl_fcid()
995 ocs_xport_status(ocs->xport, OCS_XPORT_CONFIG_PORT_STATUS, &old); in ocs_sysctl_port_state()
998 if (!req->newptr) { in ocs_sysctl_port_state()
1015 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in ocs_sysctl_port_state()
1024 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in ocs_sysctl_port_state()
1040 ocs_fcport *fcp = oidp->oid_arg1; in ocs_sysctl_vport_wwpn()
1044 snprintf(str_wwpn, sizeof(str_wwpn), "0x%llx", (unsigned long long)fcp->vport->wwpn); in ocs_sysctl_vport_wwpn()
1052 ocs_fcport *fcp = oidp->oid_arg1; in ocs_sysctl_vport_wwnn()
1056 snprintf(str_wwnn, sizeof(str_wwnn), "0x%llx", (unsigned long long)fcp->vport->wwnn); in ocs_sysctl_vport_wwnn()
1072 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(ocs->dev); in ocs_sysctl_init()
1073 struct sysctl_oid *tree = device_get_sysctl_tree(ocs->dev); in ocs_sysctl_init()
1082 pci_get_devid(ocs->dev), "Device ID"); in ocs_sysctl_init()
1084 memset(ocs->modeldesc, 0, sizeof(ocs->modeldesc)); in ocs_sysctl_init()
1085 if (0 == pci_get_vpd_ident(ocs->dev, &str)) { in ocs_sysctl_init()
1086 snprintf(ocs->modeldesc, sizeof(ocs->modeldesc), "%s", str); in ocs_sysctl_init()
1090 ocs->modeldesc, in ocs_sysctl_init()
1093 memset(ocs->serialnum, 0, sizeof(ocs->serialnum)); in ocs_sysctl_init()
1094 if (0 == pci_get_vpd_readonly(ocs->dev, "SN", &str)) { in ocs_sysctl_init()
1095 snprintf(ocs->serialnum, sizeof(ocs->serialnum), "%s", str); in ocs_sysctl_init()
1099 ocs->serialnum, in ocs_sysctl_init()
1102 ocs_hw_get(&ocs->hw, OCS_HW_SLI_REV, &rev); in ocs_sysctl_init()
1103 ocs_hw_get(&ocs->hw, OCS_HW_IF_TYPE, &if_type); in ocs_sysctl_init()
1104 ocs_hw_get(&ocs->hw, OCS_HW_SLI_FAMILY, &family); in ocs_sysctl_init()
1106 memset(ocs->fwrev, 0, sizeof(ocs->fwrev)); in ocs_sysctl_init()
1107 snprintf(ocs->fwrev, sizeof(ocs->fwrev), "%s, sli-%d:%d:%x", in ocs_sysctl_init()
1108 (char *)ocs_hw_get_ptr(&ocs->hw, OCS_HW_FW_REV), in ocs_sysctl_init()
1112 ocs->fwrev, in ocs_sysctl_init()
1115 memset(ocs->sli_intf, 0, sizeof(ocs->sli_intf)); in ocs_sysctl_init()
1116 snprintf(ocs->sli_intf, sizeof(ocs->sli_intf), "%08x", in ocs_sysctl_init()
1120 ocs->sli_intf, in ocs_sysctl_init()
1125 ocs_sys_fwupgrade, "A", "Firmware grp file"); in ocs_sysctl_init()
1140 "Current Topology, 1-NPort; 2-Loop; 3-None"); in ocs_sysctl_init()
1150 "Configured Topology, 0-Auto; 1-NPort; 2-Loop"); in ocs_sysctl_init()
1155 "Configured Speed, 0-Auto, 2000, 4000, 8000, 16000, 32000"); in ocs_sysctl_init()
1158 "businfo", CTLFLAG_RD, ocs->businfo, 0, "Bus Info"); in ocs_sysctl_init()
1168 for (i = 0; i < ocs->num_vports; i++) { in ocs_sysctl_init()
1208 if (0 == (error = resource_int_value(device_get_name(ocs->dev), device_get_unit(ocs->dev), in ocs_debug_attach()
1210 device_printf(ocs->dev, "setting %s to %010x\n", resname, ocs_debug_mask); in ocs_debug_attach()
1214 unit = device_get_unit(ocs->dev); in ocs_debug_attach()
1215 ocs->cdev = make_dev(&ocs_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640, in ocs_debug_attach()
1217 if (ocs->cdev) { in ocs_debug_attach()
1218 ocs->cdev->si_drv1 = ocs; in ocs_debug_attach()
1223 mtx_init(&ocs->dbg_lock, "ocs_dbg_lock", NULL, MTX_DEF); in ocs_debug_attach()
1234 mtx_destroy(&ocs->dbg_lock); in ocs_debug_detach()
1236 if (ocs->cdev) { in ocs_debug_detach()
1237 ocs->cdev->si_drv1 = NULL; in ocs_debug_detach()
1238 destroy_dev(ocs->cdev); in ocs_debug_detach()