Lines Matching refs:ioctl
47 * Buffered ioctl handlers. A buffered ioctl is one which requires that we
51 * it for subsequent ioctl calls that require it.
69 void *ioctl;
108 /* Handle EXPRESS_IOCTL_RW_FIRMWARE ioctl with img_type = FW_IMG_FM_API. */
241 "for a buffered ioctl!",
244 esas2r_debug("buffered ioctl alloc failure");
249 memcpy(esas2r_buffered_ioctl, bi->ioctl, bi->length);
257 esas2r_debug("buffered ioctl - no requests");
286 memcpy(bi->ioctl, esas2r_buffered_ioctl, bi->length);
292 /* SMP ioctl support */
300 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge);
319 bi.ioctl = si;
329 /* CSMI ioctl support */
348 struct atto_vda_ioctl_req *ioctl = &rq->vrq->ioctl;
353 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge);
355 ioctl->csmi.ctrl_code = cpu_to_le32(ctrl_code);
356 ioctl->csmi.target_id = cpu_to_le16(target_id);
357 ioctl->csmi.lun = (u8)le32_to_cpu(rq->vrq->scsi.flags);
653 bi.ioctl = &ci->data;
664 /* ATTO HBA ioctl support */
672 esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge);
1237 bi.ioctl = ioctl_hba;
1275 struct atto_express_ioctl *ioctl = NULL;
1281 esas2r_log(ESAS2R_LOG_DEBG, "ioctl (%p, %x, %p)", hostdata, cmd, arg);
1288 ioctl = memdup_user(arg, sizeof(struct atto_express_ioctl));
1289 if (IS_ERR(ioctl)) {
1293 return PTR_ERR(ioctl);
1298 if (memcmp(ioctl->header.signature,
1302 kfree(ioctl);
1309 ioctl->header.return_code = IOCTL_SUCCESS;
1320 ioctl->data.chanlist.num_channels = 0;
1324 ioctl->data.chanlist.num_channels++;
1325 ioctl->data.chanlist.channel[k] = i;
1336 if (ioctl->header.channel == 0xFF) {
1339 if (ioctl->header.channel >= MAX_ADAPTERS ||
1340 esas2r_adapters[ioctl->header.channel] == NULL) {
1341 ioctl->header.return_code = IOCTL_BAD_CHANNEL;
1343 kfree(ioctl);
1347 a = esas2r_adapters[ioctl->header.channel];
1353 if (ioctl->data.fwrw.img_type == FW_IMG_FM_API) {
1355 (char *)ioctl->data.fwrw.image,
1362 (char *)ioctl->data.fwrw.
1368 } else if (ioctl->data.fwrw.img_type == FW_IMG_FS_API) {
1370 (char *)ioctl->data.fwrw.image,
1377 (char *)ioctl->data.fwrw.
1384 ioctl->header.return_code = IOCTL_BAD_FLASH_IMGTYPE;
1391 memcpy(ioctl->data.prw.data_buffer, a->nvram,
1393 ioctl->data.prw.code = 1;
1400 kfree(ioctl);
1407 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer);
1408 ioctl->data.prw.code = code;
1417 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer);
1418 ioctl->data.prw.code = 1;
1423 ioctl->data.chaninfo.major_rev = ESAS2R_MAJOR_REV;
1424 ioctl->data.chaninfo.minor_rev = ESAS2R_MINOR_REV;
1425 ioctl->data.chaninfo.IRQ = a->pcid->irq;
1426 ioctl->data.chaninfo.device_id = a->pcid->device;
1427 ioctl->data.chaninfo.vendor_id = a->pcid->vendor;
1428 ioctl->data.chaninfo.ven_dev_id = a->pcid->subsystem_device;
1429 ioctl->data.chaninfo.revision_id = a->pcid->revision;
1430 ioctl->data.chaninfo.pci_bus = a->pcid->bus->number;
1431 ioctl->data.chaninfo.pci_dev_func = a->pcid->devfn;
1432 ioctl->data.chaninfo.core_rev = 0;
1433 ioctl->data.chaninfo.host_no = a->host->host_no;
1434 ioctl->data.chaninfo.hbaapi_rev = 0;
1438 ioctl->header.return_code = handle_smp_ioctl(a,
1439 &ioctl->data.
1444 ioctl->header.return_code =
1445 handle_csmi_ioctl(a, &ioctl->data.csmi);
1449 ioctl->header.return_code = handle_hba_ioctl(a,
1450 &ioctl->data.
1456 (char *)&ioctl->data.ioctl_vda,
1459 ioctl->data.ioctl_vda.data_length);
1463 (char *)&ioctl->data.ioctl_vda,
1466 ioctl->data.ioctl_vda.data_length);
1476 ioctl->data.modinfo.adapter = a;
1477 ioctl->data.modinfo.pci_dev = a->pcid;
1478 ioctl->data.modinfo.scsi_host = a->host;
1479 ioctl->data.modinfo.host_no = a->host->host_no;
1485 ioctl->header.return_code = IOCTL_ERR_INVCMD;
1491 esas2r_log(ESAS2R_LOG_WARN, "err %d on ioctl cmd %u", err,
1497 ioctl->header.return_code = IOCTL_OUT_OF_RESOURCES;
1502 ioctl->header.return_code = IOCTL_INVALID_PARAM;
1506 ioctl->header.return_code = IOCTL_GENERAL_ERROR;
1513 err = copy_to_user(arg, ioctl, sizeof(struct atto_express_ioctl));
1518 kfree(ioctl);
1523 kfree(ioctl);