Lines Matching full:ioctl

49  * Buffered ioctl handlers.  A buffered ioctl is one which requires that we
53 * it for subsequent ioctl calls that require it.
71 void *ioctl; member
110 /* Handle EXPRESS_IOCTL_RW_FIRMWARE ioctl with img_type = FW_IMG_FM_API. */
243 "for a buffered ioctl!", in handle_buffered_ioctl()
246 esas2r_debug("buffered ioctl alloc failure"); in handle_buffered_ioctl()
251 memcpy(esas2r_buffered_ioctl, bi->ioctl, bi->length); in handle_buffered_ioctl()
259 esas2r_debug("buffered ioctl - no requests"); in handle_buffered_ioctl()
288 memcpy(bi->ioctl, esas2r_buffered_ioctl, bi->length); in handle_buffered_ioctl()
294 /* SMP ioctl support */
302 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge); in smp_ioctl_callback()
321 bi.ioctl = si; in handle_smp_ioctl()
331 /* CSMI ioctl support */
342 /* Tunnel a CSMI IOCTL to the back end driver for processing. */
350 struct atto_vda_ioctl_req *ioctl = &rq->vrq->ioctl; in csmi_ioctl_tunnel() local
355 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge); in csmi_ioctl_tunnel()
357 ioctl->csmi.ctrl_code = cpu_to_le32(ctrl_code); in csmi_ioctl_tunnel()
358 ioctl->csmi.target_id = cpu_to_le16(target_id); in csmi_ioctl_tunnel()
359 ioctl->csmi.lun = (u8)le32_to_cpu(rq->vrq->scsi.flags); in csmi_ioctl_tunnel()
655 bi.ioctl = &ci->data; in handle_csmi_ioctl()
666 /* ATTO HBA ioctl support */
668 /* Tunnel an ATTO HBA IOCTL to the back end driver for processing. */
674 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge); in hba_ioctl_tunnel()
1232 bi.ioctl = ioctl_hba; in handle_hba_ioctl()
1270 struct atto_express_ioctl *ioctl = NULL; in esas2r_ioctl_handler() local
1276 esas2r_log(ESAS2R_LOG_DEBG, "ioctl (%p, %x, %p)", hostdata, cmd, arg); in esas2r_ioctl_handler()
1283 ioctl = memdup_user(arg, sizeof(struct atto_express_ioctl)); in esas2r_ioctl_handler()
1284 if (IS_ERR(ioctl)) { in esas2r_ioctl_handler()
1288 return PTR_ERR(ioctl); in esas2r_ioctl_handler()
1293 if (memcmp(ioctl->header.signature, in esas2r_ioctl_handler()
1297 kfree(ioctl); in esas2r_ioctl_handler()
1304 ioctl->header.return_code = IOCTL_SUCCESS; in esas2r_ioctl_handler()
1315 ioctl->data.chanlist.num_channels = 0; in esas2r_ioctl_handler()
1319 ioctl->data.chanlist.num_channels++; in esas2r_ioctl_handler()
1320 ioctl->data.chanlist.channel[k] = i; in esas2r_ioctl_handler()
1331 if (ioctl->header.channel == 0xFF) { in esas2r_ioctl_handler()
1334 if (ioctl->header.channel >= MAX_ADAPTERS || in esas2r_ioctl_handler()
1335 esas2r_adapters[ioctl->header.channel] == NULL) { in esas2r_ioctl_handler()
1336 ioctl->header.return_code = IOCTL_BAD_CHANNEL; in esas2r_ioctl_handler()
1338 kfree(ioctl); in esas2r_ioctl_handler()
1342 a = esas2r_adapters[ioctl->header.channel]; in esas2r_ioctl_handler()
1348 if (ioctl->data.fwrw.img_type == FW_IMG_FM_API) { in esas2r_ioctl_handler()
1350 (char *)ioctl->data.fwrw.image, in esas2r_ioctl_handler()
1357 (char *)ioctl->data.fwrw. in esas2r_ioctl_handler()
1363 } else if (ioctl->data.fwrw.img_type == FW_IMG_FS_API) { in esas2r_ioctl_handler()
1365 (char *)ioctl->data.fwrw.image, in esas2r_ioctl_handler()
1372 (char *)ioctl->data.fwrw. in esas2r_ioctl_handler()
1379 ioctl->header.return_code = IOCTL_BAD_FLASH_IMGTYPE; in esas2r_ioctl_handler()
1386 memcpy(ioctl->data.prw.data_buffer, a->nvram, in esas2r_ioctl_handler()
1388 ioctl->data.prw.code = 1; in esas2r_ioctl_handler()
1395 kfree(ioctl); in esas2r_ioctl_handler()
1402 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer); in esas2r_ioctl_handler()
1403 ioctl->data.prw.code = code; in esas2r_ioctl_handler()
1412 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer); in esas2r_ioctl_handler()
1413 ioctl->data.prw.code = 1; in esas2r_ioctl_handler()
1418 ioctl->data.chaninfo.major_rev = ESAS2R_MAJOR_REV; in esas2r_ioctl_handler()
1419 ioctl->data.chaninfo.minor_rev = ESAS2R_MINOR_REV; in esas2r_ioctl_handler()
1420 ioctl->data.chaninfo.IRQ = a->pcid->irq; in esas2r_ioctl_handler()
1421 ioctl->data.chaninfo.device_id = a->pcid->device; in esas2r_ioctl_handler()
1422 ioctl->data.chaninfo.vendor_id = a->pcid->vendor; in esas2r_ioctl_handler()
1423 ioctl->data.chaninfo.ven_dev_id = a->pcid->subsystem_device; in esas2r_ioctl_handler()
1424 ioctl->data.chaninfo.revision_id = a->pcid->revision; in esas2r_ioctl_handler()
1425 ioctl->data.chaninfo.pci_bus = a->pcid->bus->number; in esas2r_ioctl_handler()
1426 ioctl->data.chaninfo.pci_dev_func = a->pcid->devfn; in esas2r_ioctl_handler()
1427 ioctl->data.chaninfo.core_rev = 0; in esas2r_ioctl_handler()
1428 ioctl->data.chaninfo.host_no = a->host->host_no; in esas2r_ioctl_handler()
1429 ioctl->data.chaninfo.hbaapi_rev = 0; in esas2r_ioctl_handler()
1433 ioctl->header.return_code = handle_smp_ioctl(a, in esas2r_ioctl_handler()
1434 &ioctl->data. in esas2r_ioctl_handler()
1439 ioctl->header.return_code = in esas2r_ioctl_handler()
1440 handle_csmi_ioctl(a, &ioctl->data.csmi); in esas2r_ioctl_handler()
1444 ioctl->header.return_code = handle_hba_ioctl(a, in esas2r_ioctl_handler()
1445 &ioctl->data. in esas2r_ioctl_handler()
1451 (char *)&ioctl->data.ioctl_vda, in esas2r_ioctl_handler()
1454 ioctl->data.ioctl_vda.data_length); in esas2r_ioctl_handler()
1458 (char *)&ioctl->data.ioctl_vda, in esas2r_ioctl_handler()
1461 ioctl->data.ioctl_vda.data_length); in esas2r_ioctl_handler()
1471 ioctl->data.modinfo.adapter = a; in esas2r_ioctl_handler()
1472 ioctl->data.modinfo.pci_dev = a->pcid; in esas2r_ioctl_handler()
1473 ioctl->data.modinfo.scsi_host = a->host; in esas2r_ioctl_handler()
1474 ioctl->data.modinfo.host_no = a->host->host_no; in esas2r_ioctl_handler()
1480 ioctl->header.return_code = IOCTL_ERR_INVCMD; in esas2r_ioctl_handler()
1486 esas2r_log(ESAS2R_LOG_WARN, "err %d on ioctl cmd %u", err, in esas2r_ioctl_handler()
1492 ioctl->header.return_code = IOCTL_OUT_OF_RESOURCES; in esas2r_ioctl_handler()
1497 ioctl->header.return_code = IOCTL_INVALID_PARAM; in esas2r_ioctl_handler()
1501 ioctl->header.return_code = IOCTL_GENERAL_ERROR; in esas2r_ioctl_handler()
1508 err = copy_to_user(arg, ioctl, sizeof(struct atto_express_ioctl)); in esas2r_ioctl_handler()
1513 kfree(ioctl); in esas2r_ioctl_handler()
1518 kfree(ioctl); in esas2r_ioctl_handler()