• Home
  • Raw
  • Download

Lines Matching refs:karg

126 static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfP…
1225 struct mpt_ioctl_iocinfo *karg; in mptctl_getiocinfo() local
1247 karg = memdup_user(uarg, data_size); in mptctl_getiocinfo()
1248 if (IS_ERR(karg)) { in mptctl_getiocinfo()
1250 __FILE__, __LINE__, PTR_ERR(karg)); in mptctl_getiocinfo()
1251 return PTR_ERR(karg); in mptctl_getiocinfo()
1255 if (karg->hdr.maxDataSize != data_size) { in mptctl_getiocinfo()
1259 kfree(karg); in mptctl_getiocinfo()
1270 karg->adapterType = MPT_IOCTL_INTERFACE_SAS; in mptctl_getiocinfo()
1272 karg->adapterType = MPT_IOCTL_INTERFACE_FC; in mptctl_getiocinfo()
1274 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; in mptctl_getiocinfo()
1276 if (karg->hdr.port > 1) { in mptctl_getiocinfo()
1277 kfree(karg); in mptctl_getiocinfo()
1280 port = karg->hdr.port; in mptctl_getiocinfo()
1282 karg->port = port; in mptctl_getiocinfo()
1285 karg->pciId = pdev->device; in mptctl_getiocinfo()
1286 karg->hwRev = pdev->revision; in mptctl_getiocinfo()
1287 karg->subSystemDevice = pdev->subsystem_device; in mptctl_getiocinfo()
1288 karg->subSystemVendor = pdev->subsystem_vendor; in mptctl_getiocinfo()
1293 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1294 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1295 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1299 karg->pciInfo.u.bits.busNumber = pdev->bus->number; in mptctl_getiocinfo()
1300 karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); in mptctl_getiocinfo()
1301 karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); in mptctl_getiocinfo()
1302 karg->pciInfo.segmentID = pci_domain_nr(pdev->bus); in mptctl_getiocinfo()
1307 karg->numDevices = 0; in mptctl_getiocinfo()
1316 karg->numDevices++; in mptctl_getiocinfo()
1322 karg->FWVersion = ioc->facts.FWVersion.Word; in mptctl_getiocinfo()
1323 karg->BIOSVersion = ioc->biosVersion; in mptctl_getiocinfo()
1327 strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH); in mptctl_getiocinfo()
1328 karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0'; in mptctl_getiocinfo()
1330 karg->busChangeEvent = 0; in mptctl_getiocinfo()
1331 karg->hostId = ioc->pfacts[port].PortSCSIID; in mptctl_getiocinfo()
1332 karg->rsvd[0] = karg->rsvd[1] = 0; in mptctl_getiocinfo()
1336 if (copy_to_user((char __user *)arg, karg, data_size)) { in mptctl_getiocinfo()
1340 kfree(karg); in mptctl_getiocinfo()
1344 kfree(karg); in mptctl_getiocinfo()
1362 struct mpt_ioctl_targetinfo karg; in mptctl_gettargetinfo() local
1372 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { in mptctl_gettargetinfo()
1381 numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); in mptctl_gettargetinfo()
1432 karg.numDevices = numDevices; in mptctl_gettargetinfo()
1436 if (copy_to_user((char __user *)arg, &karg, in mptctl_gettargetinfo()
1472 struct mpt_ioctl_test karg; in mptctl_readtest() local
1474 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1488 karg.chip_type = ioc->mfcnt; in mptctl_readtest()
1490 karg.chip_type = ioc->pcidev->device; in mptctl_readtest()
1492 strncpy (karg.name, ioc->name, MPT_MAX_NAME); in mptctl_readtest()
1493 karg.name[MPT_MAX_NAME-1]='\0'; in mptctl_readtest()
1494 strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH); in mptctl_readtest()
1495 karg.product[MPT_PRODUCT_LENGTH-1]='\0'; in mptctl_readtest()
1499 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) { in mptctl_readtest()
1524 struct mpt_ioctl_eventquery karg; in mptctl_eventquery() local
1526 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1535 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; in mptctl_eventquery()
1536 karg.eventTypes = ioc->eventTypes; in mptctl_eventquery()
1540 if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { in mptctl_eventquery()
1554 struct mpt_ioctl_eventenable karg; in mptctl_eventenable() local
1556 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { in mptctl_eventenable()
1583 ioc->eventTypes = karg.eventTypes; in mptctl_eventenable()
1593 struct mpt_ioctl_eventreport karg; in mptctl_eventreport() local
1596 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { in mptctl_eventreport()
1606 numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); in mptctl_eventreport()
1639 struct mpt_ioctl_replace_fw karg; in mptctl_replace_fw() local
1642 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { in mptctl_replace_fw()
1660 newFwSize = ALIGN(karg.newImageSize, 4); in mptctl_replace_fw()
1698 struct mpt_ioctl_command karg; in mptctl_mpt_command() local
1702 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { in mptctl_mpt_command()
1709 rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); in mptctl_mpt_command()
1727 mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) in mptctl_do_mpt_command() argument
1762 if (karg.maxReplyBytes < 0 || in mptctl_do_mpt_command()
1763 karg.dataInSize < 0 || in mptctl_do_mpt_command()
1764 karg.dataOutSize < 0 || in mptctl_do_mpt_command()
1765 karg.dataSgeOffset < 0 || in mptctl_do_mpt_command()
1766 karg.maxSenseBytes < 0 || in mptctl_do_mpt_command()
1767 karg.dataSgeOffset > ioc->req_sz / 4) in mptctl_do_mpt_command()
1772 sz = karg.dataSgeOffset * 4; in mptctl_do_mpt_command()
1773 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
1775 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
1798 if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) { in mptctl_do_mpt_command()
1818 karg.dataOutSize = karg.dataInSize = 0; in mptctl_do_mpt_command()
1879 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1882 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
1904 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
1906 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
1909 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
1966 if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) in mptctl_do_mpt_command()
1969 pScsiReq->SenseBufferLength = karg.maxSenseBytes; in mptctl_do_mpt_command()
1981 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
1983 dataSize = karg.dataOutSize; in mptctl_do_mpt_command()
1986 dataSize = karg.dataInSize; in mptctl_do_mpt_command()
2080 psge = (char *) (((int *) mf) + karg.dataSgeOffset); in mptctl_do_mpt_command()
2083 if (karg.dataOutSize > 0) in mptctl_do_mpt_command()
2086 if (karg.dataInSize > 0) in mptctl_do_mpt_command()
2092 if (karg.dataOutSize > 0) { in mptctl_do_mpt_command()
2093 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2101 flagsLength |= karg.dataOutSize; in mptctl_do_mpt_command()
2102 bufOut.len = karg.dataOutSize; in mptctl_do_mpt_command()
2119 karg.dataOutBufPtr, in mptctl_do_mpt_command()
2125 ioc->name, __FILE__, __LINE__,karg.dataOutBufPtr); in mptctl_do_mpt_command()
2132 if (karg.dataInSize > 0) { in mptctl_do_mpt_command()
2134 flagsLength |= karg.dataInSize; in mptctl_do_mpt_command()
2136 bufIn.len = karg.dataInSize; in mptctl_do_mpt_command()
2189 timeout = (karg.timeout > 0) ? karg.timeout : MPT_IOCTL_DEFAULT_TIMEOUT; in mptctl_do_mpt_command()
2226 if (karg.maxReplyBytes < ioc->reply_sz) { in mptctl_do_mpt_command()
2227 sz = min(karg.maxReplyBytes, in mptctl_do_mpt_command()
2233 if (copy_to_user(karg.replyFrameBufPtr, in mptctl_do_mpt_command()
2238 ioc->name, __FILE__, __LINE__, karg.replyFrameBufPtr); in mptctl_do_mpt_command()
2248 sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE); in mptctl_do_mpt_command()
2250 if (copy_to_user(karg.senseDataPtr, in mptctl_do_mpt_command()
2255 karg.senseDataPtr); in mptctl_do_mpt_command()
2266 (karg.dataInSize > 0) && (bufIn.kptr)) { in mptctl_do_mpt_command()
2268 if (copy_to_user(karg.dataInBufPtr, in mptctl_do_mpt_command()
2269 bufIn.kptr, karg.dataInSize)) { in mptctl_do_mpt_command()
2273 karg.dataInBufPtr); in mptctl_do_mpt_command()
2322 hp_host_info_t karg; in mptctl_hp_hostinfo() local
2341 if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) { in mptctl_hp_hostinfo()
2356 karg.vendor = pdev->vendor; in mptctl_hp_hostinfo()
2357 karg.device = pdev->device; in mptctl_hp_hostinfo()
2358 karg.subsystem_id = pdev->subsystem_device; in mptctl_hp_hostinfo()
2359 karg.subsystem_vendor = pdev->subsystem_vendor; in mptctl_hp_hostinfo()
2360 karg.devfn = pdev->devfn; in mptctl_hp_hostinfo()
2361 karg.bus = pdev->bus->number; in mptctl_hp_hostinfo()
2367 karg.host_no = ioc->sh->host_no; in mptctl_hp_hostinfo()
2369 karg.host_no = -1; in mptctl_hp_hostinfo()
2372 snprintf(karg.fw_version, sizeof(karg.fw_version), in mptctl_hp_hostinfo()
2392 strncpy(karg.serial_number, " ", 24); in mptctl_hp_hostinfo()
2404 strlcpy(karg.serial_number, in mptctl_hp_hostinfo()
2416 karg.ioc_status = HP_STATUS_OK; in mptctl_hp_hostinfo()
2420 karg.ioc_status = HP_STATUS_FAILED; in mptctl_hp_hostinfo()
2426 karg.ioc_status = HP_STATUS_OTHER; in mptctl_hp_hostinfo()
2430 karg.base_io_addr = pci_resource_start(pdev, 0); in mptctl_hp_hostinfo()
2433 karg.bus_phys_width = HP_BUS_WIDTH_UNK; in mptctl_hp_hostinfo()
2435 karg.bus_phys_width = HP_BUS_WIDTH_16; in mptctl_hp_hostinfo()
2437 karg.hard_resets = 0; in mptctl_hp_hostinfo()
2438 karg.soft_resets = 0; in mptctl_hp_hostinfo()
2439 karg.timeouts = 0; in mptctl_hp_hostinfo()
2444 karg.hard_resets = ioc->hard_resets; in mptctl_hp_hostinfo()
2445 karg.soft_resets = ioc->soft_resets; in mptctl_hp_hostinfo()
2446 karg.timeouts = ioc->timeouts; in mptctl_hp_hostinfo()
2515 karg.rsvd = *(u32 *)pbuf; in mptctl_hp_hostinfo()
2526 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) { in mptctl_hp_hostinfo()
2555 hp_target_info_t karg; in mptctl_hp_targetinfo() local
2562 if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2569 if (karg.hdr.id >= MPT_MAX_FC_DEVICES) in mptctl_hp_targetinfo()
2582 if (ioc->sh->host_no != karg.hdr.host) in mptctl_hp_targetinfo()
2601 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2605 karg.negotiated_width = np & MPI_SCSIDEVPAGE0_NP_WIDE ? in mptctl_hp_targetinfo()
2611 karg.negotiated_speed = HP_DEV_SPEED_ULTRA320; in mptctl_hp_targetinfo()
2613 karg.negotiated_speed = HP_DEV_SPEED_ULTRA160; in mptctl_hp_targetinfo()
2615 karg.negotiated_speed = HP_DEV_SPEED_ULTRA2; in mptctl_hp_targetinfo()
2617 karg.negotiated_speed = HP_DEV_SPEED_ULTRA; in mptctl_hp_targetinfo()
2619 karg.negotiated_speed = HP_DEV_SPEED_FAST; in mptctl_hp_targetinfo()
2621 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2623 karg.negotiated_speed = HP_DEV_SPEED_ASYNC; in mptctl_hp_targetinfo()
2631 karg.message_rejects = -1; in mptctl_hp_targetinfo()
2632 karg.phase_errors = -1; in mptctl_hp_targetinfo()
2633 karg.parity_errors = -1; in mptctl_hp_targetinfo()
2634 karg.select_timeouts = -1; in mptctl_hp_targetinfo()
2655 cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; in mptctl_hp_targetinfo()
2657 karg.message_rejects = (u32) le16_to_cpu(pg3_alloc->MsgRejectCount); in mptctl_hp_targetinfo()
2658 karg.phase_errors = (u32) le16_to_cpu(pg3_alloc->PhaseErrorCount); in mptctl_hp_targetinfo()
2659 karg.parity_errors = (u32) le16_to_cpu(pg3_alloc->ParityErrorCount); in mptctl_hp_targetinfo()
2666 karg.select_timeouts = hd->sel_timeout[karg.hdr.id]; in mptctl_hp_targetinfo()
2670 if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) { in mptctl_hp_targetinfo()
2748 struct mpt_ioctl_command karg; in compat_mpt_command() local
2772 karg.hdr.iocnum = karg32.hdr.iocnum; in compat_mpt_command()
2773 karg.hdr.port = karg32.hdr.port; in compat_mpt_command()
2774 karg.timeout = karg32.timeout; in compat_mpt_command()
2775 karg.maxReplyBytes = karg32.maxReplyBytes; in compat_mpt_command()
2777 karg.dataInSize = karg32.dataInSize; in compat_mpt_command()
2778 karg.dataOutSize = karg32.dataOutSize; in compat_mpt_command()
2779 karg.maxSenseBytes = karg32.maxSenseBytes; in compat_mpt_command()
2780 karg.dataSgeOffset = karg32.dataSgeOffset; in compat_mpt_command()
2782 karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr; in compat_mpt_command()
2783 karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr; in compat_mpt_command()
2784 karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr; in compat_mpt_command()
2785 karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr; in compat_mpt_command()
2789 ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); in compat_mpt_command()