Lines Matching refs:karg
126 static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfP…
1227 struct mpt_ioctl_iocinfo *karg; in mptctl_getiocinfo() local
1249 karg = memdup_user(uarg, data_size); in mptctl_getiocinfo()
1250 if (IS_ERR(karg)) { in mptctl_getiocinfo()
1252 __FILE__, __LINE__, PTR_ERR(karg)); in mptctl_getiocinfo()
1253 return PTR_ERR(karg); in mptctl_getiocinfo()
1257 if (karg->hdr.maxDataSize != data_size) { in mptctl_getiocinfo()
1261 kfree(karg); in mptctl_getiocinfo()
1272 karg->adapterType = MPT_IOCTL_INTERFACE_SAS; in mptctl_getiocinfo()
1274 karg->adapterType = MPT_IOCTL_INTERFACE_FC; in mptctl_getiocinfo()
1276 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; in mptctl_getiocinfo()
1278 if (karg->hdr.port > 1) { in mptctl_getiocinfo()
1279 kfree(karg); in mptctl_getiocinfo()
1282 port = karg->hdr.port; in mptctl_getiocinfo()
1284 karg->port = port; in mptctl_getiocinfo()
1287 karg->pciId = pdev->device; in mptctl_getiocinfo()
1288 karg->hwRev = pdev->revision; in mptctl_getiocinfo()
1289 karg->subSystemDevice = pdev->subsystem_device; in mptctl_getiocinfo()
1290 karg->subSystemVendor = pdev->subsystem_vendor; in mptctl_getiocinfo()
1295 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1296 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1297 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1301 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1302 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1303 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1304 karg->pciInfo.segmentID = pci_domain_nr(pdev->bus); in mptctl_getiocinfo()
1309 karg->numDevices = 0; in mptctl_getiocinfo()
1318 karg->numDevices++; in mptctl_getiocinfo()
1324 karg->FWVersion = ioc->facts.FWVersion.Word; in mptctl_getiocinfo()
1325 karg->BIOSVersion = ioc->biosVersion; in mptctl_getiocinfo()
1329 strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH); in mptctl_getiocinfo()
1330 karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0'; in mptctl_getiocinfo()
1332 karg->busChangeEvent = 0; in mptctl_getiocinfo()
1333 karg->hostId = ioc->pfacts[port].PortSCSIID; in mptctl_getiocinfo()
1334 karg->rsvd[0] = karg->rsvd[1] = 0; in mptctl_getiocinfo()
1338 if (copy_to_user((char __user *)arg, karg, data_size)) { in mptctl_getiocinfo()
1342 kfree(karg); in mptctl_getiocinfo()
1346 kfree(karg); in mptctl_getiocinfo()
1364 struct mpt_ioctl_targetinfo karg; in mptctl_gettargetinfo() local
1375 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { in mptctl_gettargetinfo()
1388 numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); in mptctl_gettargetinfo()
1390 port = karg.hdr.port; in mptctl_gettargetinfo()
1440 karg.numDevices = numDevices; in mptctl_gettargetinfo()
1444 if (copy_to_user((char __user *)arg, &karg, in mptctl_gettargetinfo()
1480 struct mpt_ioctl_test karg; in mptctl_readtest() local
1482 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1496 karg.chip_type = ioc->mfcnt; in mptctl_readtest()
1498 karg.chip_type = ioc->pcidev->device; in mptctl_readtest()
1500 strncpy (karg.name, ioc->name, MPT_MAX_NAME); in mptctl_readtest()
1501 karg.name[MPT_MAX_NAME-1]='\0'; in mptctl_readtest()
1502 strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH); in mptctl_readtest()
1503 karg.product[MPT_PRODUCT_LENGTH-1]='\0'; in mptctl_readtest()
1507 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1532 struct mpt_ioctl_eventquery karg; in mptctl_eventquery() local
1534 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1543 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; in mptctl_eventquery()
1544 karg.eventTypes = ioc->eventTypes; in mptctl_eventquery()
1548 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1562 struct mpt_ioctl_eventenable karg; in mptctl_eventenable() local
1564 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { in mptctl_eventenable()
1591 ioc->eventTypes = karg.eventTypes; in mptctl_eventenable()
1601 struct mpt_ioctl_eventreport karg; in mptctl_eventreport() local
1604 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { 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
1650 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { in mptctl_replace_fw()
1668 newFwSize = ALIGN(karg.newImageSize, 4); in mptctl_replace_fw()
1706 struct mpt_ioctl_command karg; in mptctl_mpt_command() local
1710 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { in mptctl_mpt_command()
1717 rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); in mptctl_mpt_command()
1735 mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) in mptctl_do_mpt_command() argument
1770 if (karg.maxReplyBytes < 0 || in mptctl_do_mpt_command()
1771 karg.dataInSize < 0 || in mptctl_do_mpt_command()
1772 karg.dataOutSize < 0 || in mptctl_do_mpt_command()
1773 karg.dataSgeOffset < 0 || in mptctl_do_mpt_command()
1774 karg.maxSenseBytes < 0 || in mptctl_do_mpt_command()
1775 karg.dataSgeOffset > ioc->req_sz / 4) in mptctl_do_mpt_command()
1780 sz = karg.dataSgeOffset * 4; in mptctl_do_mpt_command()
1781 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
1783 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
1806 if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) { in mptctl_do_mpt_command()
1826 karg.dataOutSize = karg.dataInSize = 0; in mptctl_do_mpt_command()
1887 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1890 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
1912 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
1914 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
1917 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
1974 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1977 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
1989 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
1991 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
1994 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
2088 psge = (char *) (((int *) mf) + karg.dataSgeOffset); in mptctl_do_mpt_command()
2091 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
2094 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
2100 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
2101 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2109 flagsLength |= karg.dataOutSize; in mptctl_do_mpt_command()
2110 bufOut.len = karg.dataOutSize; in mptctl_do_mpt_command()
2127 karg.dataOutBufPtr, in mptctl_do_mpt_command()
2133 ioc->name, __FILE__, __LINE__,karg.dataOutBufPtr); in mptctl_do_mpt_command()
2140 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2142 flagsLength |= karg.dataInSize; in mptctl_do_mpt_command()
2144 bufIn.len = karg.dataInSize; in mptctl_do_mpt_command()
2197 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, 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, in mptctl_do_mpt_command()
2263 karg.senseDataPtr); in mptctl_do_mpt_command()
2274 (karg.dataInSize > 0) && (bufIn.kptr)) { in mptctl_do_mpt_command()
2276 if (copy_to_user(karg.dataInBufPtr, in mptctl_do_mpt_command()
2277 bufIn.kptr, karg.dataInSize)) { in mptctl_do_mpt_command()
2281 karg.dataInBufPtr); in mptctl_do_mpt_command()
2330 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()
2364 karg.vendor = pdev->vendor; in mptctl_hp_hostinfo()
2365 karg.device = pdev->device; in mptctl_hp_hostinfo()
2366 karg.subsystem_id = pdev->subsystem_device; in mptctl_hp_hostinfo()
2367 karg.subsystem_vendor = pdev->subsystem_vendor; in mptctl_hp_hostinfo()
2368 karg.devfn = pdev->devfn; in mptctl_hp_hostinfo()
2369 karg.bus = pdev->bus->number; in mptctl_hp_hostinfo()
2375 karg.host_no = ioc->sh->host_no; in mptctl_hp_hostinfo()
2377 karg.host_no = -1; in mptctl_hp_hostinfo()
2380 snprintf(karg.fw_version, sizeof(karg.fw_version), in mptctl_hp_hostinfo()
2400 strncpy(karg.serial_number, " ", 24); in mptctl_hp_hostinfo()
2412 strlcpy(karg.serial_number, in mptctl_hp_hostinfo()
2424 karg.ioc_status = HP_STATUS_OK; in mptctl_hp_hostinfo()
2428 karg.ioc_status = HP_STATUS_FAILED; in mptctl_hp_hostinfo()
2434 karg.ioc_status = HP_STATUS_OTHER; in mptctl_hp_hostinfo()
2438 karg.base_io_addr = pci_resource_start(pdev, 0); in mptctl_hp_hostinfo()
2441 karg.bus_phys_width = HP_BUS_WIDTH_UNK; in mptctl_hp_hostinfo()
2443 karg.bus_phys_width = HP_BUS_WIDTH_16; in mptctl_hp_hostinfo()
2445 karg.hard_resets = 0; in mptctl_hp_hostinfo()
2446 karg.soft_resets = 0; in mptctl_hp_hostinfo()
2447 karg.timeouts = 0; in mptctl_hp_hostinfo()
2452 karg.hard_resets = ioc->hard_resets; in mptctl_hp_hostinfo()
2453 karg.soft_resets = ioc->soft_resets; in mptctl_hp_hostinfo()
2454 karg.timeouts = ioc->timeouts; in mptctl_hp_hostinfo()
2523 karg.rsvd = *(u32 *)pbuf; in mptctl_hp_hostinfo()
2534 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) { in mptctl_hp_hostinfo()
2563 hp_target_info_t karg; in mptctl_hp_targetinfo() local
2570 if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2577 if (karg.hdr.id >= MPT_MAX_FC_DEVICES) in mptctl_hp_targetinfo()
2590 if (ioc->sh->host_no != karg.hdr.host) in mptctl_hp_targetinfo()
2609 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2613 karg.negotiated_width = np & MPI_SCSIDEVPAGE0_NP_WIDE ? in mptctl_hp_targetinfo()
2619 karg.negotiated_speed = HP_DEV_SPEED_ULTRA320; in mptctl_hp_targetinfo()
2621 karg.negotiated_speed = HP_DEV_SPEED_ULTRA160; in mptctl_hp_targetinfo()
2623 karg.negotiated_speed = HP_DEV_SPEED_ULTRA2; in mptctl_hp_targetinfo()
2625 karg.negotiated_speed = HP_DEV_SPEED_ULTRA; in mptctl_hp_targetinfo()
2627 karg.negotiated_speed = HP_DEV_SPEED_FAST; in mptctl_hp_targetinfo()
2629 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2631 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2639 karg.message_rejects = -1; in mptctl_hp_targetinfo()
2640 karg.phase_errors = -1; in mptctl_hp_targetinfo()
2641 karg.parity_errors = -1; in mptctl_hp_targetinfo()
2642 karg.select_timeouts = -1; in mptctl_hp_targetinfo()
2663 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2665 karg.message_rejects = (u32) le16_to_cpu(pg3_alloc->MsgRejectCount); in mptctl_hp_targetinfo()
2666 karg.phase_errors = (u32) le16_to_cpu(pg3_alloc->PhaseErrorCount); in mptctl_hp_targetinfo()
2667 karg.parity_errors = (u32) le16_to_cpu(pg3_alloc->ParityErrorCount); in mptctl_hp_targetinfo()
2674 karg.select_timeouts = hd->sel_timeout[karg.hdr.id]; in mptctl_hp_targetinfo()
2678 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2756 struct mpt_ioctl_command karg; in compat_mpt_command() local
2780 karg.hdr.iocnum = karg32.hdr.iocnum; in compat_mpt_command()
2781 karg.hdr.port = karg32.hdr.port; in compat_mpt_command()
2782 karg.timeout = karg32.timeout; in compat_mpt_command()
2783 karg.maxReplyBytes = karg32.maxReplyBytes; in compat_mpt_command()
2785 karg.dataInSize = karg32.dataInSize; in compat_mpt_command()
2786 karg.dataOutSize = karg32.dataOutSize; in compat_mpt_command()
2787 karg.maxSenseBytes = karg32.maxSenseBytes; in compat_mpt_command()
2788 karg.dataSgeOffset = karg32.dataSgeOffset; in compat_mpt_command()
2790 karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr; in compat_mpt_command()
2791 karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr; in compat_mpt_command()
2792 karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr; in compat_mpt_command()
2793 karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr; in compat_mpt_command()
2797 ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); in compat_mpt_command()