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);
1236 bi.ioctl = ioctl_hba;
1274 struct atto_express_ioctl *ioctl = NULL;
1280 esas2r_log(ESAS2R_LOG_DEBG, "ioctl (%p, %x, %p)", hostdata, cmd, arg);
1287 ioctl = memdup_user(arg, sizeof(struct atto_express_ioctl));
1288 if (IS_ERR(ioctl)) {
1292 return PTR_ERR(ioctl);
1297 if (memcmp(ioctl->header.signature,
1301 kfree(ioctl);
1308 ioctl->header.return_code = IOCTL_SUCCESS;
1319 ioctl->data.chanlist.num_channels = 0;
1323 ioctl->data.chanlist.num_channels++;
1324 ioctl->data.chanlist.channel[k] = i;
1335 if (ioctl->header.channel == 0xFF) {
1338 if (ioctl->header.channel >= MAX_ADAPTERS ||
1339 esas2r_adapters[ioctl->header.channel] == NULL) {
1340 ioctl->header.return_code = IOCTL_BAD_CHANNEL;
1342 kfree(ioctl);
1346 a = esas2r_adapters[ioctl->header.channel];
1352 if (ioctl->data.fwrw.img_type == FW_IMG_FM_API) {
1354 (char *)ioctl->data.fwrw.image,
1361 (char *)ioctl->data.fwrw.
1367 } else if (ioctl->data.fwrw.img_type == FW_IMG_FS_API) {
1369 (char *)ioctl->data.fwrw.image,
1376 (char *)ioctl->data.fwrw.
1383 ioctl->header.return_code = IOCTL_BAD_FLASH_IMGTYPE;
1390 memcpy(ioctl->data.prw.data_buffer, a->nvram,
1392 ioctl->data.prw.code = 1;
1399 kfree(ioctl);
1406 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer);
1407 ioctl->data.prw.code = code;
1416 (struct esas2r_sas_nvram *)ioctl->data.prw.data_buffer);
1417 ioctl->data.prw.code = 1;
1422 ioctl->data.chaninfo.major_rev = ESAS2R_MAJOR_REV;
1423 ioctl->data.chaninfo.minor_rev = ESAS2R_MINOR_REV;
1424 ioctl->data.chaninfo.IRQ = a->pcid->irq;
1425 ioctl->data.chaninfo.device_id = a->pcid->device;
1426 ioctl->data.chaninfo.vendor_id = a->pcid->vendor;
1427 ioctl->data.chaninfo.ven_dev_id = a->pcid->subsystem_device;
1428 ioctl->data.chaninfo.revision_id = a->pcid->revision;
1429 ioctl->data.chaninfo.pci_bus = a->pcid->bus->number;
1430 ioctl->data.chaninfo.pci_dev_func = a->pcid->devfn;
1431 ioctl->data.chaninfo.core_rev = 0;
1432 ioctl->data.chaninfo.host_no = a->host->host_no;
1433 ioctl->data.chaninfo.hbaapi_rev = 0;
1437 ioctl->header.return_code = handle_smp_ioctl(a,
1438 &ioctl->data.
1443 ioctl->header.return_code =
1444 handle_csmi_ioctl(a, &ioctl->data.csmi);
1448 ioctl->header.return_code = handle_hba_ioctl(a,
1449 &ioctl->data.
1455 (char *)&ioctl->data.ioctl_vda,
1458 ioctl->data.ioctl_vda.data_length);
1462 (char *)&ioctl->data.ioctl_vda,
1465 ioctl->data.ioctl_vda.data_length);
1475 ioctl->data.modinfo.adapter = a;
1476 ioctl->data.modinfo.pci_dev = a->pcid;
1477 ioctl->data.modinfo.scsi_host = a->host;
1478 ioctl->data.modinfo.host_no = a->host->host_no;
1484 ioctl->header.return_code = IOCTL_ERR_INVCMD;
1490 esas2r_log(ESAS2R_LOG_WARN, "err %d on ioctl cmd %u", err,
1496 ioctl->header.return_code = IOCTL_OUT_OF_RESOURCES;
1501 ioctl->header.return_code = IOCTL_INVALID_PARAM;
1505 ioctl->header.return_code = IOCTL_GENERAL_ERROR;
1512 err = copy_to_user(arg, ioctl, sizeof(struct atto_express_ioctl));
1517 kfree(ioctl);
1522 kfree(ioctl);