• Home
  • Raw
  • Download

Lines Matching refs:karg

124 static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);
1169 struct mpt_ioctl_iocinfo *karg; in mptctl_getiocinfo() local
1194 karg = kmalloc(data_size, GFP_KERNEL); in mptctl_getiocinfo()
1195 if (karg == NULL) { in mptctl_getiocinfo()
1201 if (copy_from_user(karg, uarg, data_size)) { in mptctl_getiocinfo()
1205 kfree(karg); in mptctl_getiocinfo()
1209 if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || in mptctl_getiocinfo()
1213 kfree(karg); in mptctl_getiocinfo()
1218 if (karg->hdr.maxDataSize != data_size) { in mptctl_getiocinfo()
1222 kfree(karg); in mptctl_getiocinfo()
1233 karg->adapterType = MPT_IOCTL_INTERFACE_SAS; in mptctl_getiocinfo()
1235 karg->adapterType = MPT_IOCTL_INTERFACE_FC; in mptctl_getiocinfo()
1237 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; in mptctl_getiocinfo()
1239 if (karg->hdr.port > 1) in mptctl_getiocinfo()
1241 port = karg->hdr.port; in mptctl_getiocinfo()
1243 karg->port = port; in mptctl_getiocinfo()
1246 karg->pciId = pdev->device; in mptctl_getiocinfo()
1248 karg->hwRev = revision; in mptctl_getiocinfo()
1249 karg->subSystemDevice = pdev->subsystem_device; in mptctl_getiocinfo()
1250 karg->subSystemVendor = pdev->subsystem_vendor; in mptctl_getiocinfo()
1255 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1256 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1257 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1261 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1262 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1263 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1264 karg->pciInfo.segmentID = pci_domain_nr(pdev->bus); in mptctl_getiocinfo()
1269 karg->numDevices = 0; in mptctl_getiocinfo()
1276 karg->numDevices++; in mptctl_getiocinfo()
1282 karg->FWVersion = ioc->facts.FWVersion.Word; in mptctl_getiocinfo()
1283 karg->BIOSVersion = ioc->biosVersion; in mptctl_getiocinfo()
1287 strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH); in mptctl_getiocinfo()
1288 karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0'; in mptctl_getiocinfo()
1290 karg->busChangeEvent = 0; in mptctl_getiocinfo()
1291 karg->hostId = ioc->pfacts[port].PortSCSIID; in mptctl_getiocinfo()
1292 karg->rsvd[0] = karg->rsvd[1] = 0; in mptctl_getiocinfo()
1296 if (copy_to_user((char __user *)arg, karg, data_size)) { in mptctl_getiocinfo()
1300 kfree(karg); in mptctl_getiocinfo()
1304 kfree(karg); in mptctl_getiocinfo()
1322 struct mpt_ioctl_targetinfo karg; in mptctl_gettargetinfo() local
1335 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { in mptctl_gettargetinfo()
1342 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_gettargetinfo()
1355 numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); in mptctl_gettargetinfo()
1357 port = karg.hdr.port; in mptctl_gettargetinfo()
1405 karg.numDevices = numDevices; in mptctl_gettargetinfo()
1409 if (copy_to_user((char __user *)arg, &karg, in mptctl_gettargetinfo()
1445 struct mpt_ioctl_test karg; in mptctl_readtest() local
1449 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1456 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_readtest()
1470 karg.chip_type = ioc->mfcnt; in mptctl_readtest()
1472 karg.chip_type = ioc->pcidev->device; in mptctl_readtest()
1474 strncpy (karg.name, ioc->name, MPT_MAX_NAME); in mptctl_readtest()
1475 karg.name[MPT_MAX_NAME-1]='\0'; in mptctl_readtest()
1476 strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH); in mptctl_readtest()
1477 karg.product[MPT_PRODUCT_LENGTH-1]='\0'; in mptctl_readtest()
1481 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1506 struct mpt_ioctl_eventquery karg; in mptctl_eventquery() local
1510 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1517 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_eventquery()
1526 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; in mptctl_eventquery()
1527 karg.eventTypes = ioc->eventTypes; in mptctl_eventquery()
1531 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1545 struct mpt_ioctl_eventenable karg; in mptctl_eventenable() local
1549 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { in mptctl_eventenable()
1556 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_eventenable()
1583 ioc->eventTypes = karg.eventTypes; in mptctl_eventenable()
1593 struct mpt_ioctl_eventreport karg; in mptctl_eventreport() local
1598 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { in mptctl_eventreport()
1605 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_eventreport()
1614 numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); in mptctl_eventreport()
1647 struct mpt_ioctl_replace_fw karg; in mptctl_replace_fw() local
1652 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { in mptctl_replace_fw()
1659 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_replace_fw()
1677 newFwSize = karg.newImageSize; in mptctl_replace_fw()
1720 struct mpt_ioctl_command karg; in mptctl_mpt_command() local
1726 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { in mptctl_mpt_command()
1733 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_mpt_command()
1740 rc = mptctl_do_mpt_command (karg, &uarg->MF); in mptctl_mpt_command()
1758 mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) in mptctl_do_mpt_command() argument
1781 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_do_mpt_command()
1800 sz = karg.dataSgeOffset * 4; in mptctl_do_mpt_command()
1801 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
1803 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
1826 if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) { in mptctl_do_mpt_command()
1844 karg.dataOutSize = karg.dataInSize = 0; in mptctl_do_mpt_command()
1905 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1908 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
1927 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
1929 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
1932 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
1991 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1994 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
2006 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
2008 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
2011 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
2110 psge = (char *) (((int *) mf) + karg.dataSgeOffset); in mptctl_do_mpt_command()
2113 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
2116 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
2122 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
2123 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2132 flagsLength |= karg.dataOutSize; in mptctl_do_mpt_command()
2133 bufOut.len = karg.dataOutSize; in mptctl_do_mpt_command()
2150 karg.dataOutBufPtr, in mptctl_do_mpt_command()
2156 ioc->name, __FILE__, __LINE__,karg.dataOutBufPtr); in mptctl_do_mpt_command()
2163 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2165 flagsLength |= karg.dataInSize; in mptctl_do_mpt_command()
2167 bufIn.len = karg.dataInSize; in mptctl_do_mpt_command()
2212 timeout = (karg.timeout > 0) ? karg.timeout : MPT_IOCTL_DEFAULT_TIMEOUT; in mptctl_do_mpt_command()
2234 if (karg.maxReplyBytes < ioc->reply_sz) { in mptctl_do_mpt_command()
2235 sz = min(karg.maxReplyBytes, 4*ioc->ioctl->ReplyFrame[2]); in mptctl_do_mpt_command()
2241 if (copy_to_user(karg.replyFrameBufPtr, in mptctl_do_mpt_command()
2246 ioc->name, __FILE__, __LINE__, karg.replyFrameBufPtr); in mptctl_do_mpt_command()
2256 sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE); in mptctl_do_mpt_command()
2258 if (copy_to_user(karg.senseDataPtr, ioc->ioctl->sense, sz)) { in mptctl_do_mpt_command()
2262 karg.senseDataPtr); in mptctl_do_mpt_command()
2273 (karg.dataInSize > 0) && (bufIn.kptr)) { in mptctl_do_mpt_command()
2275 if (copy_to_user(karg.dataInBufPtr, in mptctl_do_mpt_command()
2276 bufIn.kptr, karg.dataInSize)) { in mptctl_do_mpt_command()
2280 karg.dataInBufPtr); in mptctl_do_mpt_command()
2331 hp_host_info_t karg; in mptctl_hp_hostinfo() local
2349 if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) { in mptctl_hp_hostinfo()
2356 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_hp_hostinfo()
2370 karg.vendor = pdev->vendor; in mptctl_hp_hostinfo()
2371 karg.device = pdev->device; in mptctl_hp_hostinfo()
2372 karg.subsystem_id = pdev->subsystem_device; in mptctl_hp_hostinfo()
2373 karg.subsystem_vendor = pdev->subsystem_vendor; in mptctl_hp_hostinfo()
2374 karg.devfn = pdev->devfn; in mptctl_hp_hostinfo()
2375 karg.bus = pdev->bus->number; in mptctl_hp_hostinfo()
2381 karg.host_no = ioc->sh->host_no; in mptctl_hp_hostinfo()
2383 karg.host_no = -1; in mptctl_hp_hostinfo()
2387 karg.fw_version[0] = ioc->facts.FWVersion.Struct.Major >= 10 ? in mptctl_hp_hostinfo()
2389 karg.fw_version[1] = (ioc->facts.FWVersion.Struct.Major % 10 ) + '0'; in mptctl_hp_hostinfo()
2390 karg.fw_version[2] = '.'; in mptctl_hp_hostinfo()
2391 karg.fw_version[3] = ioc->facts.FWVersion.Struct.Minor >= 10 ? in mptctl_hp_hostinfo()
2393 karg.fw_version[4] = (ioc->facts.FWVersion.Struct.Minor % 10 ) + '0'; in mptctl_hp_hostinfo()
2394 karg.fw_version[5] = '.'; in mptctl_hp_hostinfo()
2395 karg.fw_version[6] = ioc->facts.FWVersion.Struct.Unit >= 10 ? in mptctl_hp_hostinfo()
2397 karg.fw_version[7] = (ioc->facts.FWVersion.Struct.Unit % 10 ) + '0'; in mptctl_hp_hostinfo()
2398 karg.fw_version[8] = '.'; in mptctl_hp_hostinfo()
2399 karg.fw_version[9] = ioc->facts.FWVersion.Struct.Dev >= 10 ? in mptctl_hp_hostinfo()
2401 karg.fw_version[10] = (ioc->facts.FWVersion.Struct.Dev % 10 ) + '0'; in mptctl_hp_hostinfo()
2402 karg.fw_version[11] = '\0'; in mptctl_hp_hostinfo()
2417 strncpy(karg.serial_number, " ", 24); in mptctl_hp_hostinfo()
2429 strncpy(karg.serial_number, pdata->BoardTracerNumber, 24); in mptctl_hp_hostinfo()
2430 karg.serial_number[24-1]='\0'; in mptctl_hp_hostinfo()
2441 karg.ioc_status = HP_STATUS_OK; in mptctl_hp_hostinfo()
2445 karg.ioc_status = HP_STATUS_FAILED; in mptctl_hp_hostinfo()
2451 karg.ioc_status = HP_STATUS_OTHER; in mptctl_hp_hostinfo()
2455 karg.base_io_addr = pci_resource_start(pdev, 0); in mptctl_hp_hostinfo()
2458 karg.bus_phys_width = HP_BUS_WIDTH_UNK; in mptctl_hp_hostinfo()
2460 karg.bus_phys_width = HP_BUS_WIDTH_16; in mptctl_hp_hostinfo()
2462 karg.hard_resets = 0; in mptctl_hp_hostinfo()
2463 karg.soft_resets = 0; in mptctl_hp_hostinfo()
2464 karg.timeouts = 0; in mptctl_hp_hostinfo()
2469 karg.hard_resets = hd->hard_resets; in mptctl_hp_hostinfo()
2470 karg.soft_resets = hd->soft_resets; in mptctl_hp_hostinfo()
2471 karg.timeouts = hd->timeouts; in mptctl_hp_hostinfo()
2530 karg.rsvd = *(u32 *)pbuf; in mptctl_hp_hostinfo()
2538 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) { in mptctl_hp_hostinfo()
2568 hp_target_info_t karg; in mptctl_hp_targetinfo() local
2576 if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2583 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || in mptctl_hp_targetinfo()
2600 if (ioc->sh->host_no != karg.hdr.host) in mptctl_hp_targetinfo()
2619 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2623 karg.negotiated_width = np & MPI_SCSIDEVPAGE0_NP_WIDE ? in mptctl_hp_targetinfo()
2629 karg.negotiated_speed = HP_DEV_SPEED_ULTRA320; in mptctl_hp_targetinfo()
2631 karg.negotiated_speed = HP_DEV_SPEED_ULTRA160; in mptctl_hp_targetinfo()
2633 karg.negotiated_speed = HP_DEV_SPEED_ULTRA2; in mptctl_hp_targetinfo()
2635 karg.negotiated_speed = HP_DEV_SPEED_ULTRA; in mptctl_hp_targetinfo()
2637 karg.negotiated_speed = HP_DEV_SPEED_FAST; in mptctl_hp_targetinfo()
2639 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2641 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2649 karg.message_rejects = -1; in mptctl_hp_targetinfo()
2650 karg.phase_errors = -1; in mptctl_hp_targetinfo()
2651 karg.parity_errors = -1; in mptctl_hp_targetinfo()
2652 karg.select_timeouts = -1; in mptctl_hp_targetinfo()
2674 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2676 karg.message_rejects = (u32) le16_to_cpu(pg3_alloc->MsgRejectCount); in mptctl_hp_targetinfo()
2677 karg.phase_errors = (u32) le16_to_cpu(pg3_alloc->PhaseErrorCount); in mptctl_hp_targetinfo()
2678 karg.parity_errors = (u32) le16_to_cpu(pg3_alloc->ParityErrorCount); in mptctl_hp_targetinfo()
2685 karg.select_timeouts = hd->sel_timeout[karg.hdr.id]; in mptctl_hp_targetinfo()
2689 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2767 struct mpt_ioctl_command karg; in compat_mpt_command() local
2791 karg.hdr.iocnum = karg32.hdr.iocnum; in compat_mpt_command()
2792 karg.hdr.port = karg32.hdr.port; in compat_mpt_command()
2793 karg.timeout = karg32.timeout; in compat_mpt_command()
2794 karg.maxReplyBytes = karg32.maxReplyBytes; in compat_mpt_command()
2796 karg.dataInSize = karg32.dataInSize; in compat_mpt_command()
2797 karg.dataOutSize = karg32.dataOutSize; in compat_mpt_command()
2798 karg.maxSenseBytes = karg32.maxSenseBytes; in compat_mpt_command()
2799 karg.dataSgeOffset = karg32.dataSgeOffset; in compat_mpt_command()
2801 karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr; in compat_mpt_command()
2802 karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr; in compat_mpt_command()
2803 karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr; in compat_mpt_command()
2804 karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr; in compat_mpt_command()
2808 ret = mptctl_do_mpt_command (karg, &uarg->MF); in compat_mpt_command()