Lines Matching refs:pSMB
334 static int validate_t2(struct smb_t2_rsp *pSMB) in validate_t2() argument
339 if (pSMB->hdr.WordCount < 10) in validate_t2()
343 if (get_unaligned_le16(&pSMB->t2_rsp.ParameterOffset) > 1024 || in validate_t2()
344 get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024) in validate_t2()
347 total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount); in validate_t2()
354 total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount); in validate_t2()
355 if (total_size > get_bcc(&pSMB->hdr) || in validate_t2()
361 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB, in validate_t2()
547 NEGOTIATE_REQ *pSMB; in CIFSSMBNegotiate() local
561 (void **) &pSMB, (void **) &pSMBr); in CIFSSMBNegotiate()
565 pSMB->hdr.Mid = get_next_mid(server); in CIFSSMBNegotiate()
566 pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); in CIFSSMBNegotiate()
570 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; in CIFSSMBNegotiate()
575 strncpy(pSMB->DialectsArray+count, protocols[i].name, 16); in CIFSSMBNegotiate()
579 inc_rfc1001_len(pSMB, count); in CIFSSMBNegotiate()
580 pSMB->ByteCount = cpu_to_le16(count); in CIFSSMBNegotiate()
582 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, in CIFSSMBNegotiate()
643 cifs_buf_release(pSMB); in CIFSSMBNegotiate()
746 LOGOFF_ANDX_REQ *pSMB; in CIFSSMBLogoff() local
763 rc = small_smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL, (void **)&pSMB); in CIFSSMBLogoff()
769 pSMB->hdr.Mid = get_next_mid(ses->server); in CIFSSMBLogoff()
772 pSMB->hdr.Flags2 |= SMBFLG2_SECURITY_SIGNATURE; in CIFSSMBLogoff()
774 pSMB->hdr.Uid = ses->Suid; in CIFSSMBLogoff()
776 pSMB->AndXCommand = 0xFF; in CIFSSMBLogoff()
777 rc = SendReceiveNoRsp(xid, ses, (char *) pSMB, 0); in CIFSSMBLogoff()
794 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSPOSIXDelFile() local
804 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSPOSIXDelFile()
809 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSPOSIXDelFile()
811 cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, in CIFSPOSIXDelFile()
818 strncpy(pSMB->FileName, fileName, name_len); in CIFSPOSIXDelFile()
822 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSPOSIXDelFile()
823 pSMB->MaxDataCount = 0; /* BB double check this with jra */ in CIFSPOSIXDelFile()
824 pSMB->MaxSetupCount = 0; in CIFSPOSIXDelFile()
825 pSMB->Reserved = 0; in CIFSPOSIXDelFile()
826 pSMB->Flags = 0; in CIFSPOSIXDelFile()
827 pSMB->Timeout = 0; in CIFSPOSIXDelFile()
828 pSMB->Reserved2 = 0; in CIFSPOSIXDelFile()
834 pRqD = (struct unlink_psx_rq *)(((char *)&pSMB->hdr.Protocol) + offset); in CIFSPOSIXDelFile()
836 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSPOSIXDelFile()
837 pSMB->DataOffset = cpu_to_le16(offset); in CIFSPOSIXDelFile()
838 pSMB->SetupCount = 1; in CIFSPOSIXDelFile()
839 pSMB->Reserved3 = 0; in CIFSPOSIXDelFile()
840 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSPOSIXDelFile()
843 pSMB->DataCount = cpu_to_le16(sizeof(struct unlink_psx_rq)); in CIFSPOSIXDelFile()
844 pSMB->TotalDataCount = cpu_to_le16(sizeof(struct unlink_psx_rq)); in CIFSPOSIXDelFile()
845 pSMB->ParameterCount = cpu_to_le16(params); in CIFSPOSIXDelFile()
846 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSPOSIXDelFile()
847 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_UNLINK); in CIFSPOSIXDelFile()
848 pSMB->Reserved4 = 0; in CIFSPOSIXDelFile()
849 inc_rfc1001_len(pSMB, byte_count); in CIFSPOSIXDelFile()
850 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSPOSIXDelFile()
851 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSPOSIXDelFile()
855 cifs_buf_release(pSMB); in CIFSPOSIXDelFile()
869 DELETE_FILE_REQ *pSMB = NULL; in CIFSSMBDelFile() local
877 rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB, in CIFSSMBDelFile()
882 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBDelFile()
883 name_len = cifsConvertToUTF16((__le16 *) pSMB->fileName, name, in CIFSSMBDelFile()
891 strncpy(pSMB->fileName, name, name_len); in CIFSSMBDelFile()
893 pSMB->SearchAttributes = in CIFSSMBDelFile()
895 pSMB->BufferFormat = 0x04; in CIFSSMBDelFile()
896 inc_rfc1001_len(pSMB, name_len + 1); in CIFSSMBDelFile()
897 pSMB->ByteCount = cpu_to_le16(name_len + 1); in CIFSSMBDelFile()
898 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBDelFile()
904 cifs_buf_release(pSMB); in CIFSSMBDelFile()
915 DELETE_DIRECTORY_REQ *pSMB = NULL; in CIFSSMBRmDir() local
924 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB, in CIFSSMBRmDir()
929 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBRmDir()
930 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name, in CIFSSMBRmDir()
938 strncpy(pSMB->DirName, name, name_len); in CIFSSMBRmDir()
941 pSMB->BufferFormat = 0x04; in CIFSSMBRmDir()
942 inc_rfc1001_len(pSMB, name_len + 1); in CIFSSMBRmDir()
943 pSMB->ByteCount = cpu_to_le16(name_len + 1); in CIFSSMBRmDir()
944 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBRmDir()
950 cifs_buf_release(pSMB); in CIFSSMBRmDir()
961 CREATE_DIRECTORY_REQ *pSMB = NULL; in CIFSSMBMkDir() local
969 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB, in CIFSSMBMkDir()
974 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBMkDir()
975 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name, in CIFSSMBMkDir()
983 strncpy(pSMB->DirName, name, name_len); in CIFSSMBMkDir()
986 pSMB->BufferFormat = 0x04; in CIFSSMBMkDir()
987 inc_rfc1001_len(pSMB, name_len + 1); in CIFSSMBMkDir()
988 pSMB->ByteCount = cpu_to_le16(name_len + 1); in CIFSSMBMkDir()
989 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBMkDir()
995 cifs_buf_release(pSMB); in CIFSSMBMkDir()
1008 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSPOSIXCreate() local
1019 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSPOSIXCreate()
1024 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSPOSIXCreate()
1026 cifsConvertToUTF16((__le16 *) pSMB->FileName, name, in CIFSPOSIXCreate()
1033 strncpy(pSMB->FileName, name, name_len); in CIFSPOSIXCreate()
1038 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSPOSIXCreate()
1039 pSMB->MaxDataCount = cpu_to_le16(1000); /* large enough */ in CIFSPOSIXCreate()
1040 pSMB->MaxSetupCount = 0; in CIFSPOSIXCreate()
1041 pSMB->Reserved = 0; in CIFSPOSIXCreate()
1042 pSMB->Flags = 0; in CIFSPOSIXCreate()
1043 pSMB->Timeout = 0; in CIFSPOSIXCreate()
1044 pSMB->Reserved2 = 0; in CIFSPOSIXCreate()
1048 pdata = (OPEN_PSX_REQ *)(((char *)&pSMB->hdr.Protocol) + offset); in CIFSPOSIXCreate()
1053 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSPOSIXCreate()
1054 pSMB->DataOffset = cpu_to_le16(offset); in CIFSPOSIXCreate()
1055 pSMB->SetupCount = 1; in CIFSPOSIXCreate()
1056 pSMB->Reserved3 = 0; in CIFSPOSIXCreate()
1057 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSPOSIXCreate()
1060 pSMB->DataCount = cpu_to_le16(count); in CIFSPOSIXCreate()
1061 pSMB->ParameterCount = cpu_to_le16(params); in CIFSPOSIXCreate()
1062 pSMB->TotalDataCount = pSMB->DataCount; in CIFSPOSIXCreate()
1063 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSPOSIXCreate()
1064 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_OPEN); in CIFSPOSIXCreate()
1065 pSMB->Reserved4 = 0; in CIFSPOSIXCreate()
1066 inc_rfc1001_len(pSMB, byte_count); in CIFSPOSIXCreate()
1067 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSPOSIXCreate()
1068 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSPOSIXCreate()
1111 cifs_buf_release(pSMB); in CIFSPOSIXCreate()
1176 OPENX_REQ *pSMB = NULL; in SMBLegacyOpen() local
1183 rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB, in SMBLegacyOpen()
1188 pSMB->AndXCommand = 0xFF; /* none */ in SMBLegacyOpen()
1190 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in SMBLegacyOpen()
1193 cifsConvertToUTF16((__le16 *) (pSMB->fileName + 1), in SMBLegacyOpen()
1201 strncpy(pSMB->fileName, fileName, name_len); in SMBLegacyOpen()
1204 pSMB->OpenFlags = cpu_to_le16(REQ_OPLOCK); in SMBLegacyOpen()
1206 pSMB->OpenFlags = cpu_to_le16(REQ_BATCHOPLOCK); in SMBLegacyOpen()
1208 pSMB->OpenFlags |= cpu_to_le16(REQ_MORE_INFO); in SMBLegacyOpen()
1209 pSMB->Mode = cpu_to_le16(access_flags_to_smbopen_mode(access_flags)); in SMBLegacyOpen()
1210 pSMB->Mode |= cpu_to_le16(0x40); /* deny none */ in SMBLegacyOpen()
1216 pSMB->FileAttributes = cpu_to_le16(ATTR_SYSTEM); in SMBLegacyOpen()
1218 pSMB->FileAttributes = cpu_to_le16(0/*ATTR_NORMAL*/); in SMBLegacyOpen()
1221 pSMB->FileAttributes |= cpu_to_le16(ATTR_READONLY); in SMBLegacyOpen()
1228 pSMB->Sattr = cpu_to_le16(ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY); in SMBLegacyOpen()
1229 pSMB->OpenFunction = cpu_to_le16(convert_disposition(openDisposition)); in SMBLegacyOpen()
1231 inc_rfc1001_len(pSMB, count); in SMBLegacyOpen()
1233 pSMB->ByteCount = cpu_to_le16(count); in SMBLegacyOpen()
1234 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in SMBLegacyOpen()
1268 cifs_buf_release(pSMB); in SMBLegacyOpen()
1678 READ_REQ *pSMB = NULL; in CIFSSMBRead() local
1702 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **) &pSMB); in CIFSSMBRead()
1706 pSMB->hdr.Pid = cpu_to_le16((__u16)pid); in CIFSSMBRead()
1707 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid >> 16)); in CIFSSMBRead()
1713 pSMB->AndXCommand = 0xFF; /* none */ in CIFSSMBRead()
1714 pSMB->Fid = netfid; in CIFSSMBRead()
1715 pSMB->OffsetLow = cpu_to_le32(offset & 0xFFFFFFFF); in CIFSSMBRead()
1717 pSMB->OffsetHigh = cpu_to_le32(offset >> 32); in CIFSSMBRead()
1719 pSMB->Remaining = 0; in CIFSSMBRead()
1720 pSMB->MaxCount = cpu_to_le16(count & 0xFFFF); in CIFSSMBRead()
1721 pSMB->MaxCountHigh = cpu_to_le32(count >> 16); in CIFSSMBRead()
1723 pSMB->ByteCount = 0; /* no need to do le conversion since 0 */ in CIFSSMBRead()
1727 (struct smb_com_readx_req *)pSMB; in CIFSSMBRead()
1731 iov[0].iov_base = (char *)pSMB; in CIFSSMBRead()
1732 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4; in CIFSSMBRead()
1787 WRITE_REQ *pSMB = NULL; in CIFSSMBWrite() local
1814 rc = smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **) &pSMB, in CIFSSMBWrite()
1819 pSMB->hdr.Pid = cpu_to_le16((__u16)pid); in CIFSSMBWrite()
1820 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid >> 16)); in CIFSSMBWrite()
1826 pSMB->AndXCommand = 0xFF; /* none */ in CIFSSMBWrite()
1827 pSMB->Fid = netfid; in CIFSSMBWrite()
1828 pSMB->OffsetLow = cpu_to_le32(offset & 0xFFFFFFFF); in CIFSSMBWrite()
1830 pSMB->OffsetHigh = cpu_to_le32(offset >> 32); in CIFSSMBWrite()
1832 pSMB->Reserved = 0xFFFFFFFF; in CIFSSMBWrite()
1833 pSMB->WriteMode = 0; in CIFSSMBWrite()
1834 pSMB->Remaining = 0; in CIFSSMBWrite()
1849 pSMB->DataOffset = in CIFSSMBWrite()
1852 memcpy(pSMB->Data, buf, bytes_sent); in CIFSSMBWrite()
1855 cifs_buf_release(pSMB); in CIFSSMBWrite()
1863 pSMB->DataLengthLow = cpu_to_le16(bytes_sent & 0xFFFF); in CIFSSMBWrite()
1864 pSMB->DataLengthHigh = cpu_to_le16(bytes_sent >> 16); in CIFSSMBWrite()
1865 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBWrite()
1868 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBWrite()
1872 (struct smb_com_writex_req *)pSMB; in CIFSSMBWrite()
1876 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBWrite()
1895 cifs_buf_release(pSMB); in CIFSSMBWrite()
2190 WRITE_REQ *pSMB = NULL; in CIFSSMBWrite2() local
2213 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **) &pSMB); in CIFSSMBWrite2()
2217 pSMB->hdr.Pid = cpu_to_le16((__u16)pid); in CIFSSMBWrite2()
2218 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid >> 16)); in CIFSSMBWrite2()
2224 pSMB->AndXCommand = 0xFF; /* none */ in CIFSSMBWrite2()
2225 pSMB->Fid = netfid; in CIFSSMBWrite2()
2226 pSMB->OffsetLow = cpu_to_le32(offset & 0xFFFFFFFF); in CIFSSMBWrite2()
2228 pSMB->OffsetHigh = cpu_to_le32(offset >> 32); in CIFSSMBWrite2()
2229 pSMB->Reserved = 0xFFFFFFFF; in CIFSSMBWrite2()
2230 pSMB->WriteMode = 0; in CIFSSMBWrite2()
2231 pSMB->Remaining = 0; in CIFSSMBWrite2()
2233 pSMB->DataOffset = in CIFSSMBWrite2()
2236 pSMB->DataLengthLow = cpu_to_le16(count & 0xFFFF); in CIFSSMBWrite2()
2237 pSMB->DataLengthHigh = cpu_to_le16(count >> 16); in CIFSSMBWrite2()
2239 smb_hdr_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 1; in CIFSSMBWrite2()
2241 inc_rfc1001_len(pSMB, count + 1); in CIFSSMBWrite2()
2243 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */ in CIFSSMBWrite2()
2245 pSMB->ByteCount = cpu_to_le16(count + 1); in CIFSSMBWrite2()
2248 (struct smb_com_writex_req *)pSMB; in CIFSSMBWrite2()
2251 iov[0].iov_base = pSMB; in CIFSSMBWrite2()
2294 LOCK_REQ *pSMB = NULL; in cifs_lockv() local
2302 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); in cifs_lockv()
2306 pSMB->Timeout = 0; in cifs_lockv()
2307 pSMB->NumberOfLocks = cpu_to_le16(num_lock); in cifs_lockv()
2308 pSMB->NumberOfUnlocks = cpu_to_le16(num_unlock); in cifs_lockv()
2309 pSMB->LockType = lock_type; in cifs_lockv()
2310 pSMB->AndXCommand = 0xFF; /* none */ in cifs_lockv()
2311 pSMB->Fid = netfid; /* netfid stays le */ in cifs_lockv()
2314 inc_rfc1001_len(pSMB, count); in cifs_lockv()
2315 pSMB->ByteCount = cpu_to_le16(count); in cifs_lockv()
2317 iov[0].iov_base = (char *)pSMB; in cifs_lockv()
2318 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4 - in cifs_lockv()
2339 LOCK_REQ *pSMB = NULL; in CIFSSMBLock() local
2347 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); in CIFSSMBLock()
2355 pSMB->Timeout = 0; in CIFSSMBLock()
2358 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */ in CIFSSMBLock()
2360 pSMB->Timeout = 0; in CIFSSMBLock()
2363 pSMB->NumberOfLocks = cpu_to_le16(numLock); in CIFSSMBLock()
2364 pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock); in CIFSSMBLock()
2365 pSMB->LockType = lockType; in CIFSSMBLock()
2366 pSMB->OplockLevel = oplock_level; in CIFSSMBLock()
2367 pSMB->AndXCommand = 0xFF; /* none */ in CIFSSMBLock()
2368 pSMB->Fid = smb_file_id; /* netfid stays le */ in CIFSSMBLock()
2371 pSMB->Locks[0].Pid = cpu_to_le16(netpid); in CIFSSMBLock()
2373 pSMB->Locks[0].LengthLow = cpu_to_le32((u32)len); in CIFSSMBLock()
2374 pSMB->Locks[0].LengthHigh = cpu_to_le32((u32)(len>>32)); in CIFSSMBLock()
2375 pSMB->Locks[0].OffsetLow = cpu_to_le32((u32)offset); in CIFSSMBLock()
2376 pSMB->Locks[0].OffsetHigh = cpu_to_le32((u32)(offset>>32)); in CIFSSMBLock()
2382 inc_rfc1001_len(pSMB, count); in CIFSSMBLock()
2383 pSMB->ByteCount = cpu_to_le16(count); in CIFSSMBLock()
2386 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB, in CIFSSMBLock()
2387 (struct smb_hdr *) pSMB, &bytes_returned); in CIFSSMBLock()
2388 cifs_small_buf_release(pSMB); in CIFSSMBLock()
2390 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, flags); in CIFSSMBLock()
2409 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBPosixLock() local
2421 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); in CIFSSMBPosixLock()
2426 pSMBr = (struct smb_com_transaction2_sfi_rsp *)pSMB; in CIFSSMBPosixLock()
2429 pSMB->MaxSetupCount = 0; in CIFSSMBPosixLock()
2430 pSMB->Reserved = 0; in CIFSSMBPosixLock()
2431 pSMB->Flags = 0; in CIFSSMBPosixLock()
2432 pSMB->Reserved2 = 0; in CIFSSMBPosixLock()
2437 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBPosixLock()
2438 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBPosixLock()
2439 pSMB->SetupCount = 1; in CIFSSMBPosixLock()
2440 pSMB->Reserved3 = 0; in CIFSSMBPosixLock()
2442 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); in CIFSSMBPosixLock()
2444 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBPosixLock()
2446 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBPosixLock()
2447 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBPosixLock()
2448 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBPosixLock()
2449 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBPosixLock()
2450 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBPosixLock()
2452 (((char *) &pSMB->hdr.Protocol) + offset); in CIFSSMBPosixLock()
2458 pSMB->Timeout = cpu_to_le32(-1); in CIFSSMBPosixLock()
2460 pSMB->Timeout = 0; in CIFSSMBPosixLock()
2466 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBPosixLock()
2467 pSMB->Fid = smb_file_id; in CIFSSMBPosixLock()
2468 pSMB->InformationLevel = cpu_to_le16(SMB_SET_POSIX_LOCK); in CIFSSMBPosixLock()
2469 pSMB->Reserved4 = 0; in CIFSSMBPosixLock()
2470 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBPosixLock()
2471 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBPosixLock()
2473 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB, in CIFSSMBPosixLock()
2476 iov[0].iov_base = (char *)pSMB; in CIFSSMBPosixLock()
2477 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4; in CIFSSMBPosixLock()
2480 pSMB = NULL; /* request buf already freed by SendReceive2. Do in CIFSSMBPosixLock()
2523 if (pSMB) in CIFSSMBPosixLock()
2524 cifs_small_buf_release(pSMB); in CIFSSMBPosixLock()
2539 CLOSE_REQ *pSMB = NULL; in CIFSSMBClose() local
2543 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB); in CIFSSMBClose()
2549 pSMB->FileID = (__u16) smb_file_id; in CIFSSMBClose()
2550 pSMB->LastWriteTime = 0xFFFFFFFF; in CIFSSMBClose()
2551 pSMB->ByteCount = 0; in CIFSSMBClose()
2552 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBClose()
2572 FLUSH_REQ *pSMB = NULL; in CIFSSMBFlush() local
2575 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); in CIFSSMBFlush()
2579 pSMB->FileID = (__u16) smb_file_id; in CIFSSMBFlush()
2580 pSMB->ByteCount = 0; in CIFSSMBFlush()
2581 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBFlush()
2595 RENAME_REQ *pSMB = NULL; in CIFSSMBRename() local
2604 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB, in CIFSSMBRename()
2609 pSMB->BufferFormat = 0x04; in CIFSSMBRename()
2610 pSMB->SearchAttributes = in CIFSSMBRename()
2614 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBRename()
2615 name_len = cifsConvertToUTF16((__le16 *) pSMB->OldFileName, in CIFSSMBRename()
2620 pSMB->OldFileName[name_len] = 0x04; /* pad */ in CIFSSMBRename()
2622 pSMB->OldFileName[name_len + 1] = 0x00; in CIFSSMBRename()
2624 cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2], in CIFSSMBRename()
2632 strncpy(pSMB->OldFileName, from_name, name_len); in CIFSSMBRename()
2635 pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */ in CIFSSMBRename()
2636 strncpy(&pSMB->OldFileName[name_len + 1], to_name, name_len2); in CIFSSMBRename()
2642 inc_rfc1001_len(pSMB, count); in CIFSSMBRename()
2643 pSMB->ByteCount = cpu_to_le16(count); in CIFSSMBRename()
2645 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBRename()
2651 cifs_buf_release(pSMB); in CIFSSMBRename()
2663 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBRenameOpenFile() local
2674 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB, in CIFSSMBRenameOpenFile()
2680 pSMB->MaxSetupCount = 0; in CIFSSMBRenameOpenFile()
2681 pSMB->Reserved = 0; in CIFSSMBRenameOpenFile()
2682 pSMB->Flags = 0; in CIFSSMBRenameOpenFile()
2683 pSMB->Timeout = 0; in CIFSSMBRenameOpenFile()
2684 pSMB->Reserved2 = 0; in CIFSSMBRenameOpenFile()
2688 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; in CIFSSMBRenameOpenFile()
2690 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBRenameOpenFile()
2691 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBRenameOpenFile()
2692 pSMB->SetupCount = 1; in CIFSSMBRenameOpenFile()
2693 pSMB->Reserved3 = 0; in CIFSSMBRenameOpenFile()
2694 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBRenameOpenFile()
2696 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBRenameOpenFile()
2697 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBRenameOpenFile()
2698 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBRenameOpenFile()
2699 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBRenameOpenFile()
2705 sprintf(dummy_string, "cifs%x", pSMB->hdr.Mid); in CIFSSMBRenameOpenFile()
2718 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBRenameOpenFile()
2719 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBRenameOpenFile()
2720 pSMB->Fid = netfid; in CIFSSMBRenameOpenFile()
2721 pSMB->InformationLevel = in CIFSSMBRenameOpenFile()
2723 pSMB->Reserved4 = 0; in CIFSSMBRenameOpenFile()
2724 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBRenameOpenFile()
2725 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBRenameOpenFile()
2726 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBRenameOpenFile()
2733 cifs_buf_release(pSMB); in CIFSSMBRenameOpenFile()
2747 COPY_REQ *pSMB = NULL; in CIFSSMBCopy() local
2755 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB, in CIFSSMBCopy()
2760 pSMB->BufferFormat = 0x04; in CIFSSMBCopy()
2761 pSMB->Tid2 = target_tid; in CIFSSMBCopy()
2763 pSMB->Flags = cpu_to_le16(flags & COPY_TREE); in CIFSSMBCopy()
2765 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBCopy()
2766 name_len = cifsConvertToUTF16((__le16 *) pSMB->OldFileName, in CIFSSMBCopy()
2771 pSMB->OldFileName[name_len] = 0x04; /* pad */ in CIFSSMBCopy()
2773 pSMB->OldFileName[name_len + 1] = 0x00; in CIFSSMBCopy()
2775 cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2], in CIFSSMBCopy()
2782 strncpy(pSMB->OldFileName, fromName, name_len); in CIFSSMBCopy()
2785 pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */ in CIFSSMBCopy()
2786 strncpy(&pSMB->OldFileName[name_len + 1], toName, name_len2); in CIFSSMBCopy()
2792 inc_rfc1001_len(pSMB, count); in CIFSSMBCopy()
2793 pSMB->ByteCount = cpu_to_le16(count); in CIFSSMBCopy()
2795 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBCopy()
2801 cifs_buf_release(pSMB); in CIFSSMBCopy()
2814 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSUnixCreateSymLink() local
2825 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSUnixCreateSymLink()
2830 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSUnixCreateSymLink()
2832 cifsConvertToUTF16((__le16 *) pSMB->FileName, fromName, in CIFSUnixCreateSymLink()
2841 strncpy(pSMB->FileName, fromName, name_len); in CIFSUnixCreateSymLink()
2844 pSMB->MaxSetupCount = 0; in CIFSUnixCreateSymLink()
2845 pSMB->Reserved = 0; in CIFSUnixCreateSymLink()
2846 pSMB->Flags = 0; in CIFSUnixCreateSymLink()
2847 pSMB->Timeout = 0; in CIFSUnixCreateSymLink()
2848 pSMB->Reserved2 = 0; in CIFSUnixCreateSymLink()
2853 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; in CIFSUnixCreateSymLink()
2854 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSUnixCreateSymLink()
2867 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSUnixCreateSymLink()
2869 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSUnixCreateSymLink()
2870 pSMB->SetupCount = 1; in CIFSUnixCreateSymLink()
2871 pSMB->Reserved3 = 0; in CIFSUnixCreateSymLink()
2872 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSUnixCreateSymLink()
2874 pSMB->DataCount = cpu_to_le16(name_len_target); in CIFSUnixCreateSymLink()
2875 pSMB->ParameterCount = cpu_to_le16(params); in CIFSUnixCreateSymLink()
2876 pSMB->TotalDataCount = pSMB->DataCount; in CIFSUnixCreateSymLink()
2877 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSUnixCreateSymLink()
2878 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSUnixCreateSymLink()
2879 pSMB->DataOffset = cpu_to_le16(offset); in CIFSUnixCreateSymLink()
2880 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_LINK); in CIFSUnixCreateSymLink()
2881 pSMB->Reserved4 = 0; in CIFSUnixCreateSymLink()
2882 inc_rfc1001_len(pSMB, byte_count); in CIFSUnixCreateSymLink()
2883 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSUnixCreateSymLink()
2884 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSUnixCreateSymLink()
2891 cifs_buf_release(pSMB); in CIFSUnixCreateSymLink()
2904 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSUnixCreateHardLink() local
2915 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSUnixCreateHardLink()
2920 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSUnixCreateHardLink()
2921 name_len = cifsConvertToUTF16((__le16 *) pSMB->FileName, toName, in CIFSUnixCreateHardLink()
2929 strncpy(pSMB->FileName, toName, name_len); in CIFSUnixCreateHardLink()
2932 pSMB->MaxSetupCount = 0; in CIFSUnixCreateHardLink()
2933 pSMB->Reserved = 0; in CIFSUnixCreateHardLink()
2934 pSMB->Flags = 0; in CIFSUnixCreateHardLink()
2935 pSMB->Timeout = 0; in CIFSUnixCreateHardLink()
2936 pSMB->Reserved2 = 0; in CIFSUnixCreateHardLink()
2941 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; in CIFSUnixCreateHardLink()
2942 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSUnixCreateHardLink()
2954 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSUnixCreateHardLink()
2956 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSUnixCreateHardLink()
2957 pSMB->SetupCount = 1; in CIFSUnixCreateHardLink()
2958 pSMB->Reserved3 = 0; in CIFSUnixCreateHardLink()
2959 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSUnixCreateHardLink()
2961 pSMB->ParameterCount = cpu_to_le16(params); in CIFSUnixCreateHardLink()
2962 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSUnixCreateHardLink()
2963 pSMB->DataCount = cpu_to_le16(name_len_target); in CIFSUnixCreateHardLink()
2964 pSMB->TotalDataCount = pSMB->DataCount; in CIFSUnixCreateHardLink()
2965 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSUnixCreateHardLink()
2966 pSMB->DataOffset = cpu_to_le16(offset); in CIFSUnixCreateHardLink()
2967 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_HLINK); in CIFSUnixCreateHardLink()
2968 pSMB->Reserved4 = 0; in CIFSUnixCreateHardLink()
2969 inc_rfc1001_len(pSMB, byte_count); in CIFSUnixCreateHardLink()
2970 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSUnixCreateHardLink()
2971 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSUnixCreateHardLink()
2978 cifs_buf_release(pSMB); in CIFSUnixCreateHardLink()
2991 NT_RENAME_REQ *pSMB = NULL; in CIFSCreateHardLink() local
3001 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB, in CIFSCreateHardLink()
3006 pSMB->SearchAttributes = in CIFSCreateHardLink()
3009 pSMB->Flags = cpu_to_le16(CREATE_HARD_LINK); in CIFSCreateHardLink()
3010 pSMB->ClusterCount = 0; in CIFSCreateHardLink()
3012 pSMB->BufferFormat = 0x04; in CIFSCreateHardLink()
3014 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSCreateHardLink()
3016 cifsConvertToUTF16((__le16 *) pSMB->OldFileName, from_name, in CIFSCreateHardLink()
3022 pSMB->OldFileName[name_len] = 0x04; in CIFSCreateHardLink()
3023 pSMB->OldFileName[name_len + 1] = 0x00; /* pad */ in CIFSCreateHardLink()
3025 cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2], in CIFSCreateHardLink()
3033 strncpy(pSMB->OldFileName, from_name, name_len); in CIFSCreateHardLink()
3036 pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */ in CIFSCreateHardLink()
3037 strncpy(&pSMB->OldFileName[name_len + 1], to_name, name_len2); in CIFSCreateHardLink()
3043 inc_rfc1001_len(pSMB, count); in CIFSCreateHardLink()
3044 pSMB->ByteCount = cpu_to_le16(count); in CIFSCreateHardLink()
3046 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSCreateHardLink()
3052 cifs_buf_release(pSMB); in CIFSCreateHardLink()
3065 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSSMBUnixQuerySymLink() local
3076 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBUnixQuerySymLink()
3081 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBUnixQuerySymLink()
3083 cifsConvertToUTF16((__le16 *) pSMB->FileName, in CIFSSMBUnixQuerySymLink()
3091 strncpy(pSMB->FileName, searchName, name_len); in CIFSSMBUnixQuerySymLink()
3095 pSMB->TotalDataCount = 0; in CIFSSMBUnixQuerySymLink()
3096 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBUnixQuerySymLink()
3097 pSMB->MaxDataCount = cpu_to_le16(CIFSMaxBufSize); in CIFSSMBUnixQuerySymLink()
3098 pSMB->MaxSetupCount = 0; in CIFSSMBUnixQuerySymLink()
3099 pSMB->Reserved = 0; in CIFSSMBUnixQuerySymLink()
3100 pSMB->Flags = 0; in CIFSSMBUnixQuerySymLink()
3101 pSMB->Timeout = 0; in CIFSSMBUnixQuerySymLink()
3102 pSMB->Reserved2 = 0; in CIFSSMBUnixQuerySymLink()
3103 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBUnixQuerySymLink()
3105 pSMB->DataCount = 0; in CIFSSMBUnixQuerySymLink()
3106 pSMB->DataOffset = 0; in CIFSSMBUnixQuerySymLink()
3107 pSMB->SetupCount = 1; in CIFSSMBUnixQuerySymLink()
3108 pSMB->Reserved3 = 0; in CIFSSMBUnixQuerySymLink()
3109 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSSMBUnixQuerySymLink()
3111 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBUnixQuerySymLink()
3112 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBUnixQuerySymLink()
3113 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_LINK); in CIFSSMBUnixQuerySymLink()
3114 pSMB->Reserved4 = 0; in CIFSSMBUnixQuerySymLink()
3115 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBUnixQuerySymLink()
3116 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBUnixQuerySymLink()
3118 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBUnixQuerySymLink()
3148 cifs_buf_release(pSMB); in CIFSSMBUnixQuerySymLink()
3171 struct smb_com_transaction_ioctl_req *pSMB; in CIFSSMBQuerySymLink() local
3182 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, in CIFSSMBQuerySymLink()
3187 pSMB->TotalParameterCount = 0 ; in CIFSSMBQuerySymLink()
3188 pSMB->TotalDataCount = 0; in CIFSSMBQuerySymLink()
3189 pSMB->MaxParameterCount = cpu_to_le32(2); in CIFSSMBQuerySymLink()
3191 pSMB->MaxDataCount = cpu_to_le32(CIFSMaxBufSize & 0xFFFFFF00); in CIFSSMBQuerySymLink()
3192 pSMB->MaxSetupCount = 4; in CIFSSMBQuerySymLink()
3193 pSMB->Reserved = 0; in CIFSSMBQuerySymLink()
3194 pSMB->ParameterOffset = 0; in CIFSSMBQuerySymLink()
3195 pSMB->DataCount = 0; in CIFSSMBQuerySymLink()
3196 pSMB->DataOffset = 0; in CIFSSMBQuerySymLink()
3197 pSMB->SetupCount = 4; in CIFSSMBQuerySymLink()
3198 pSMB->SubCommand = cpu_to_le16(NT_TRANSACT_IOCTL); in CIFSSMBQuerySymLink()
3199 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQuerySymLink()
3200 pSMB->FunctionCode = cpu_to_le32(FSCTL_GET_REPARSE_POINT); in CIFSSMBQuerySymLink()
3201 pSMB->IsFsctl = 1; /* FSCTL */ in CIFSSMBQuerySymLink()
3202 pSMB->IsRootFlag = 0; in CIFSSMBQuerySymLink()
3203 pSMB->Fid = fid; /* file handle always le */ in CIFSSMBQuerySymLink()
3204 pSMB->ByteCount = 0; in CIFSSMBQuerySymLink()
3206 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQuerySymLink()
3278 cifs_buf_release(pSMB); in CIFSSMBQuerySymLink()
3293 struct smb_com_transaction_compr_ioctl_req *pSMB; in CIFSSMB_set_compression() local
3297 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, in CIFSSMB_set_compression()
3302 pSMB->compression_state = cpu_to_le16(COMPRESSION_FORMAT_DEFAULT); in CIFSSMB_set_compression()
3304 pSMB->TotalParameterCount = 0; in CIFSSMB_set_compression()
3305 pSMB->TotalDataCount = cpu_to_le32(2); in CIFSSMB_set_compression()
3306 pSMB->MaxParameterCount = 0; in CIFSSMB_set_compression()
3307 pSMB->MaxDataCount = 0; in CIFSSMB_set_compression()
3308 pSMB->MaxSetupCount = 4; in CIFSSMB_set_compression()
3309 pSMB->Reserved = 0; in CIFSSMB_set_compression()
3310 pSMB->ParameterOffset = 0; in CIFSSMB_set_compression()
3311 pSMB->DataCount = cpu_to_le32(2); in CIFSSMB_set_compression()
3312 pSMB->DataOffset = in CIFSSMB_set_compression()
3315 pSMB->SetupCount = 4; in CIFSSMB_set_compression()
3316 pSMB->SubCommand = cpu_to_le16(NT_TRANSACT_IOCTL); in CIFSSMB_set_compression()
3317 pSMB->ParameterCount = 0; in CIFSSMB_set_compression()
3318 pSMB->FunctionCode = cpu_to_le32(FSCTL_SET_COMPRESSION); in CIFSSMB_set_compression()
3319 pSMB->IsFsctl = 1; /* FSCTL */ in CIFSSMB_set_compression()
3320 pSMB->IsRootFlag = 0; in CIFSSMB_set_compression()
3321 pSMB->Fid = fid; /* file handle always le */ in CIFSSMB_set_compression()
3323 pSMB->ByteCount = cpu_to_le16(5); in CIFSSMB_set_compression()
3324 inc_rfc1001_len(pSMB, 5); in CIFSSMB_set_compression()
3326 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMB_set_compression()
3331 cifs_buf_release(pSMB); in CIFSSMB_set_compression()
3492 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSSMBGetPosixACL() local
3502 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBGetPosixACL()
3507 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBGetPosixACL()
3509 cifsConvertToUTF16((__le16 *) pSMB->FileName, in CIFSSMBGetPosixACL()
3514 pSMB->FileName[name_len] = 0; in CIFSSMBGetPosixACL()
3515 pSMB->FileName[name_len+1] = 0; in CIFSSMBGetPosixACL()
3519 strncpy(pSMB->FileName, searchName, name_len); in CIFSSMBGetPosixACL()
3523 pSMB->TotalDataCount = 0; in CIFSSMBGetPosixACL()
3524 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBGetPosixACL()
3526 pSMB->MaxDataCount = cpu_to_le16(4000); in CIFSSMBGetPosixACL()
3527 pSMB->MaxSetupCount = 0; in CIFSSMBGetPosixACL()
3528 pSMB->Reserved = 0; in CIFSSMBGetPosixACL()
3529 pSMB->Flags = 0; in CIFSSMBGetPosixACL()
3530 pSMB->Timeout = 0; in CIFSSMBGetPosixACL()
3531 pSMB->Reserved2 = 0; in CIFSSMBGetPosixACL()
3532 pSMB->ParameterOffset = cpu_to_le16( in CIFSSMBGetPosixACL()
3535 pSMB->DataCount = 0; in CIFSSMBGetPosixACL()
3536 pSMB->DataOffset = 0; in CIFSSMBGetPosixACL()
3537 pSMB->SetupCount = 1; in CIFSSMBGetPosixACL()
3538 pSMB->Reserved3 = 0; in CIFSSMBGetPosixACL()
3539 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSSMBGetPosixACL()
3541 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBGetPosixACL()
3542 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBGetPosixACL()
3543 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_ACL); in CIFSSMBGetPosixACL()
3544 pSMB->Reserved4 = 0; in CIFSSMBGetPosixACL()
3545 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBGetPosixACL()
3546 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBGetPosixACL()
3548 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBGetPosixACL()
3568 cifs_buf_release(pSMB); in CIFSSMBGetPosixACL()
3581 struct smb_com_transaction2_spi_req *pSMB = NULL; in CIFSSMBSetPosixACL() local
3591 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBSetPosixACL()
3595 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBSetPosixACL()
3597 cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, in CIFSSMBSetPosixACL()
3604 strncpy(pSMB->FileName, fileName, name_len); in CIFSSMBSetPosixACL()
3607 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetPosixACL()
3609 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetPosixACL()
3610 pSMB->MaxSetupCount = 0; in CIFSSMBSetPosixACL()
3611 pSMB->Reserved = 0; in CIFSSMBSetPosixACL()
3612 pSMB->Flags = 0; in CIFSSMBSetPosixACL()
3613 pSMB->Timeout = 0; in CIFSSMBSetPosixACL()
3614 pSMB->Reserved2 = 0; in CIFSSMBSetPosixACL()
3618 parm_data = ((char *) &pSMB->hdr.Protocol) + offset; in CIFSSMBSetPosixACL()
3619 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetPosixACL()
3628 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetPosixACL()
3629 pSMB->SetupCount = 1; in CIFSSMBSetPosixACL()
3630 pSMB->Reserved3 = 0; in CIFSSMBSetPosixACL()
3631 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSSMBSetPosixACL()
3632 pSMB->InformationLevel = cpu_to_le16(SMB_SET_POSIX_ACL); in CIFSSMBSetPosixACL()
3634 pSMB->DataCount = cpu_to_le16(data_count); in CIFSSMBSetPosixACL()
3635 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetPosixACL()
3636 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetPosixACL()
3637 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetPosixACL()
3638 pSMB->Reserved4 = 0; in CIFSSMBSetPosixACL()
3639 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetPosixACL()
3640 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetPosixACL()
3641 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetPosixACL()
3647 cifs_buf_release(pSMB); in CIFSSMBSetPosixACL()
3659 struct smb_t2_qfi_req *pSMB = NULL; in CIFSGetExtAttr() local
3669 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSGetExtAttr()
3675 pSMB->t2.TotalDataCount = 0; in CIFSGetExtAttr()
3676 pSMB->t2.MaxParameterCount = cpu_to_le16(4); in CIFSGetExtAttr()
3678 pSMB->t2.MaxDataCount = cpu_to_le16(4000); in CIFSGetExtAttr()
3679 pSMB->t2.MaxSetupCount = 0; in CIFSGetExtAttr()
3680 pSMB->t2.Reserved = 0; in CIFSGetExtAttr()
3681 pSMB->t2.Flags = 0; in CIFSGetExtAttr()
3682 pSMB->t2.Timeout = 0; in CIFSGetExtAttr()
3683 pSMB->t2.Reserved2 = 0; in CIFSGetExtAttr()
3684 pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(struct smb_t2_qfi_req, in CIFSGetExtAttr()
3686 pSMB->t2.DataCount = 0; in CIFSGetExtAttr()
3687 pSMB->t2.DataOffset = 0; in CIFSGetExtAttr()
3688 pSMB->t2.SetupCount = 1; in CIFSGetExtAttr()
3689 pSMB->t2.Reserved3 = 0; in CIFSGetExtAttr()
3690 pSMB->t2.SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); in CIFSGetExtAttr()
3692 pSMB->t2.TotalParameterCount = cpu_to_le16(params); in CIFSGetExtAttr()
3693 pSMB->t2.ParameterCount = pSMB->t2.TotalParameterCount; in CIFSGetExtAttr()
3694 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_ATTR_FLAGS); in CIFSGetExtAttr()
3695 pSMB->Pad = 0; in CIFSGetExtAttr()
3696 pSMB->Fid = netfid; in CIFSGetExtAttr()
3697 inc_rfc1001_len(pSMB, byte_count); in CIFSGetExtAttr()
3698 pSMB->t2.ByteCount = cpu_to_le16(byte_count); in CIFSGetExtAttr()
3700 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSGetExtAttr()
3729 cifs_buf_release(pSMB); in CIFSGetExtAttr()
3753 struct smb_com_ntransact_req *pSMB; in smb_init_nttransact() local
3756 (void **)&pSMB); in smb_init_nttransact()
3759 *ret_buf = (void *)pSMB; in smb_init_nttransact()
3760 pSMB->Reserved = 0; in smb_init_nttransact()
3761 pSMB->TotalParameterCount = cpu_to_le32(parm_len); in smb_init_nttransact()
3762 pSMB->TotalDataCount = 0; in smb_init_nttransact()
3763 pSMB->MaxDataCount = cpu_to_le32(CIFSMaxBufSize & 0xFFFFFF00); in smb_init_nttransact()
3764 pSMB->ParameterCount = pSMB->TotalParameterCount; in smb_init_nttransact()
3765 pSMB->DataCount = pSMB->TotalDataCount; in smb_init_nttransact()
3768 pSMB->ParameterOffset = cpu_to_le32(temp_offset); in smb_init_nttransact()
3769 pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len); in smb_init_nttransact()
3770 pSMB->SetupCount = setup_count; /* no need to le convert byte fields */ in smb_init_nttransact()
3771 pSMB->SubCommand = cpu_to_le16(sub_command); in smb_init_nttransact()
3835 QUERY_SEC_DESC_REQ *pSMB; in CIFSSMBGetCIFSACL() local
3844 8 /* parm len */, tcon, (void **) &pSMB); in CIFSSMBGetCIFSACL()
3848 pSMB->MaxParameterCount = cpu_to_le32(4); in CIFSSMBGetCIFSACL()
3850 pSMB->MaxSetupCount = 0; in CIFSSMBGetCIFSACL()
3851 pSMB->Fid = fid; /* file handle always le */ in CIFSSMBGetCIFSACL()
3852 pSMB->AclFlags = cpu_to_le32(CIFS_ACL_OWNER | CIFS_ACL_GROUP | in CIFSSMBGetCIFSACL()
3854 pSMB->ByteCount = cpu_to_le16(11); /* 3 bytes pad + 8 bytes parm */ in CIFSSMBGetCIFSACL()
3855 inc_rfc1001_len(pSMB, 11); in CIFSSMBGetCIFSACL()
3856 iov[0].iov_base = (char *)pSMB; in CIFSSMBGetCIFSACL()
3857 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4; in CIFSSMBGetCIFSACL()
3925 SET_SEC_DESC_REQ *pSMB = NULL; in CIFSSMBSetCIFSACL() local
3929 rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, &pSMBr); in CIFSSMBSetCIFSACL()
3933 pSMB->MaxSetupCount = 0; in CIFSSMBSetCIFSACL()
3934 pSMB->Reserved = 0; in CIFSSMBSetCIFSACL()
3942 pSMB->DataCount = cpu_to_le32(data_count); in CIFSSMBSetCIFSACL()
3943 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetCIFSACL()
3944 pSMB->MaxParameterCount = cpu_to_le32(4); in CIFSSMBSetCIFSACL()
3945 pSMB->MaxDataCount = cpu_to_le32(16384); in CIFSSMBSetCIFSACL()
3946 pSMB->ParameterCount = cpu_to_le32(param_count); in CIFSSMBSetCIFSACL()
3947 pSMB->ParameterOffset = cpu_to_le32(param_offset); in CIFSSMBSetCIFSACL()
3948 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetCIFSACL()
3949 pSMB->DataOffset = cpu_to_le32(data_offset); in CIFSSMBSetCIFSACL()
3950 pSMB->SetupCount = 0; in CIFSSMBSetCIFSACL()
3951 pSMB->SubCommand = cpu_to_le16(NT_TRANSACT_SET_SECURITY_DESC); in CIFSSMBSetCIFSACL()
3952 pSMB->ByteCount = cpu_to_le16(byte_count+data_count); in CIFSSMBSetCIFSACL()
3954 pSMB->Fid = fid; /* file handle always le */ in CIFSSMBSetCIFSACL()
3955 pSMB->Reserved2 = 0; in CIFSSMBSetCIFSACL()
3956 pSMB->AclFlags = cpu_to_le32(aclflag); in CIFSSMBSetCIFSACL()
3961 inc_rfc1001_len(pSMB, byte_count + data_count); in CIFSSMBSetCIFSACL()
3963 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetCIFSACL()
3965 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetCIFSACL()
3972 cifs_buf_release(pSMB); in CIFSSMBSetCIFSACL()
3989 QUERY_INFORMATION_REQ *pSMB; in SMBQueryInformation() local
3997 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, in SMBQueryInformation()
4002 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in SMBQueryInformation()
4004 cifsConvertToUTF16((__le16 *) pSMB->FileName, in SMBQueryInformation()
4012 strncpy(pSMB->FileName, search_name, name_len); in SMBQueryInformation()
4014 pSMB->BufferFormat = 0x04; in SMBQueryInformation()
4016 inc_rfc1001_len(pSMB, (__u16)name_len); in SMBQueryInformation()
4017 pSMB->ByteCount = cpu_to_le16(name_len); in SMBQueryInformation()
4019 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in SMBQueryInformation()
4044 cifs_buf_release(pSMB); in SMBQueryInformation()
4056 struct smb_t2_qfi_req *pSMB = NULL; in CIFSSMBQFileInfo() local
4063 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQFileInfo()
4069 pSMB->t2.TotalDataCount = 0; in CIFSSMBQFileInfo()
4070 pSMB->t2.MaxParameterCount = cpu_to_le16(4); in CIFSSMBQFileInfo()
4072 pSMB->t2.MaxDataCount = cpu_to_le16(CIFSMaxBufSize); in CIFSSMBQFileInfo()
4073 pSMB->t2.MaxSetupCount = 0; in CIFSSMBQFileInfo()
4074 pSMB->t2.Reserved = 0; in CIFSSMBQFileInfo()
4075 pSMB->t2.Flags = 0; in CIFSSMBQFileInfo()
4076 pSMB->t2.Timeout = 0; in CIFSSMBQFileInfo()
4077 pSMB->t2.Reserved2 = 0; in CIFSSMBQFileInfo()
4078 pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(struct smb_t2_qfi_req, in CIFSSMBQFileInfo()
4080 pSMB->t2.DataCount = 0; in CIFSSMBQFileInfo()
4081 pSMB->t2.DataOffset = 0; in CIFSSMBQFileInfo()
4082 pSMB->t2.SetupCount = 1; in CIFSSMBQFileInfo()
4083 pSMB->t2.Reserved3 = 0; in CIFSSMBQFileInfo()
4084 pSMB->t2.SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); in CIFSSMBQFileInfo()
4086 pSMB->t2.TotalParameterCount = cpu_to_le16(params); in CIFSSMBQFileInfo()
4087 pSMB->t2.ParameterCount = pSMB->t2.TotalParameterCount; in CIFSSMBQFileInfo()
4088 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO); in CIFSSMBQFileInfo()
4089 pSMB->Pad = 0; in CIFSSMBQFileInfo()
4090 pSMB->Fid = netfid; in CIFSSMBQFileInfo()
4091 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFileInfo()
4092 pSMB->t2.ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFileInfo()
4094 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFileInfo()
4113 cifs_buf_release(pSMB); in CIFSSMBQFileInfo()
4127 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSSMBQPathInfo() local
4136 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQPathInfo()
4141 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBQPathInfo()
4143 cifsConvertToUTF16((__le16 *) pSMB->FileName, search_name, in CIFSSMBQPathInfo()
4150 strncpy(pSMB->FileName, search_name, name_len); in CIFSSMBQPathInfo()
4154 pSMB->TotalDataCount = 0; in CIFSSMBQPathInfo()
4155 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQPathInfo()
4157 pSMB->MaxDataCount = cpu_to_le16(4000); in CIFSSMBQPathInfo()
4158 pSMB->MaxSetupCount = 0; in CIFSSMBQPathInfo()
4159 pSMB->Reserved = 0; in CIFSSMBQPathInfo()
4160 pSMB->Flags = 0; in CIFSSMBQPathInfo()
4161 pSMB->Timeout = 0; in CIFSSMBQPathInfo()
4162 pSMB->Reserved2 = 0; in CIFSSMBQPathInfo()
4163 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBQPathInfo()
4165 pSMB->DataCount = 0; in CIFSSMBQPathInfo()
4166 pSMB->DataOffset = 0; in CIFSSMBQPathInfo()
4167 pSMB->SetupCount = 1; in CIFSSMBQPathInfo()
4168 pSMB->Reserved3 = 0; in CIFSSMBQPathInfo()
4169 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSSMBQPathInfo()
4171 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBQPathInfo()
4172 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQPathInfo()
4174 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_STANDARD); in CIFSSMBQPathInfo()
4176 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO); in CIFSSMBQPathInfo()
4177 pSMB->Reserved4 = 0; in CIFSSMBQPathInfo()
4178 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQPathInfo()
4179 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQPathInfo()
4181 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQPathInfo()
4214 cifs_buf_release(pSMB); in CIFSSMBQPathInfo()
4225 struct smb_t2_qfi_req *pSMB = NULL; in CIFSSMBUnixQFileInfo() local
4232 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBUnixQFileInfo()
4238 pSMB->t2.TotalDataCount = 0; in CIFSSMBUnixQFileInfo()
4239 pSMB->t2.MaxParameterCount = cpu_to_le16(4); in CIFSSMBUnixQFileInfo()
4241 pSMB->t2.MaxDataCount = cpu_to_le16(CIFSMaxBufSize); in CIFSSMBUnixQFileInfo()
4242 pSMB->t2.MaxSetupCount = 0; in CIFSSMBUnixQFileInfo()
4243 pSMB->t2.Reserved = 0; in CIFSSMBUnixQFileInfo()
4244 pSMB->t2.Flags = 0; in CIFSSMBUnixQFileInfo()
4245 pSMB->t2.Timeout = 0; in CIFSSMBUnixQFileInfo()
4246 pSMB->t2.Reserved2 = 0; in CIFSSMBUnixQFileInfo()
4247 pSMB->t2.ParameterOffset = cpu_to_le16(offsetof(struct smb_t2_qfi_req, in CIFSSMBUnixQFileInfo()
4249 pSMB->t2.DataCount = 0; in CIFSSMBUnixQFileInfo()
4250 pSMB->t2.DataOffset = 0; in CIFSSMBUnixQFileInfo()
4251 pSMB->t2.SetupCount = 1; in CIFSSMBUnixQFileInfo()
4252 pSMB->t2.Reserved3 = 0; in CIFSSMBUnixQFileInfo()
4253 pSMB->t2.SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); in CIFSSMBUnixQFileInfo()
4255 pSMB->t2.TotalParameterCount = cpu_to_le16(params); in CIFSSMBUnixQFileInfo()
4256 pSMB->t2.ParameterCount = pSMB->t2.TotalParameterCount; in CIFSSMBUnixQFileInfo()
4257 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC); in CIFSSMBUnixQFileInfo()
4258 pSMB->Pad = 0; in CIFSSMBUnixQFileInfo()
4259 pSMB->Fid = netfid; in CIFSSMBUnixQFileInfo()
4260 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBUnixQFileInfo()
4261 pSMB->t2.ByteCount = cpu_to_le16(byte_count); in CIFSSMBUnixQFileInfo()
4263 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBUnixQFileInfo()
4282 cifs_buf_release(pSMB); in CIFSSMBUnixQFileInfo()
4296 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSSMBUnixQPathInfo() local
4305 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBUnixQPathInfo()
4310 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBUnixQPathInfo()
4312 cifsConvertToUTF16((__le16 *) pSMB->FileName, searchName, in CIFSSMBUnixQPathInfo()
4319 strncpy(pSMB->FileName, searchName, name_len); in CIFSSMBUnixQPathInfo()
4323 pSMB->TotalDataCount = 0; in CIFSSMBUnixQPathInfo()
4324 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBUnixQPathInfo()
4326 pSMB->MaxDataCount = cpu_to_le16(4000); in CIFSSMBUnixQPathInfo()
4327 pSMB->MaxSetupCount = 0; in CIFSSMBUnixQPathInfo()
4328 pSMB->Reserved = 0; in CIFSSMBUnixQPathInfo()
4329 pSMB->Flags = 0; in CIFSSMBUnixQPathInfo()
4330 pSMB->Timeout = 0; in CIFSSMBUnixQPathInfo()
4331 pSMB->Reserved2 = 0; in CIFSSMBUnixQPathInfo()
4332 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBUnixQPathInfo()
4334 pSMB->DataCount = 0; in CIFSSMBUnixQPathInfo()
4335 pSMB->DataOffset = 0; in CIFSSMBUnixQPathInfo()
4336 pSMB->SetupCount = 1; in CIFSSMBUnixQPathInfo()
4337 pSMB->Reserved3 = 0; in CIFSSMBUnixQPathInfo()
4338 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSSMBUnixQPathInfo()
4340 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBUnixQPathInfo()
4341 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBUnixQPathInfo()
4342 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC); in CIFSSMBUnixQPathInfo()
4343 pSMB->Reserved4 = 0; in CIFSSMBUnixQPathInfo()
4344 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBUnixQPathInfo()
4345 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBUnixQPathInfo()
4347 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBUnixQPathInfo()
4365 cifs_buf_release(pSMB); in CIFSSMBUnixQPathInfo()
4380 TRANSACTION2_FFIRST_REQ *pSMB = NULL; in CIFSFindFirst() local
4392 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSFindFirst()
4400 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSFindFirst()
4402 cifsConvertToUTF16((__le16 *) pSMB->FileName, searchName, in CIFSFindFirst()
4409 pSMB->FileName[name_len] = CIFS_DIR_SEP(cifs_sb); in CIFSFindFirst()
4410 pSMB->FileName[name_len+1] = 0; in CIFSFindFirst()
4411 pSMB->FileName[name_len+2] = '*'; in CIFSFindFirst()
4412 pSMB->FileName[name_len+3] = 0; in CIFSFindFirst()
4415 pSMB->FileName[name_len] = 0; in CIFSFindFirst()
4416 pSMB->FileName[name_len+1] = 0; in CIFSFindFirst()
4424 strncpy(pSMB->FileName, searchName, name_len); in CIFSFindFirst()
4426 pSMB->FileName[name_len] = CIFS_DIR_SEP(cifs_sb); in CIFSFindFirst()
4427 pSMB->FileName[name_len+1] = '*'; in CIFSFindFirst()
4428 pSMB->FileName[name_len+2] = 0; in CIFSFindFirst()
4434 pSMB->TotalDataCount = 0; /* no EAs */ in CIFSFindFirst()
4435 pSMB->MaxParameterCount = cpu_to_le16(10); in CIFSFindFirst()
4436 pSMB->MaxDataCount = cpu_to_le16(CIFSMaxBufSize & 0xFFFFFF00); in CIFSFindFirst()
4437 pSMB->MaxSetupCount = 0; in CIFSFindFirst()
4438 pSMB->Reserved = 0; in CIFSFindFirst()
4439 pSMB->Flags = 0; in CIFSFindFirst()
4440 pSMB->Timeout = 0; in CIFSFindFirst()
4441 pSMB->Reserved2 = 0; in CIFSFindFirst()
4443 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSFindFirst()
4444 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSFindFirst()
4445 pSMB->ParameterOffset = cpu_to_le16( in CIFSFindFirst()
4448 pSMB->DataCount = 0; in CIFSFindFirst()
4449 pSMB->DataOffset = 0; in CIFSFindFirst()
4450 pSMB->SetupCount = 1; /* one byte, no need to make endian neutral */ in CIFSFindFirst()
4451 pSMB->Reserved3 = 0; in CIFSFindFirst()
4452 pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_FIRST); in CIFSFindFirst()
4453 pSMB->SearchAttributes = in CIFSFindFirst()
4456 pSMB->SearchCount = cpu_to_le16(CIFSMaxBufSize/sizeof(FILE_UNIX_INFO)); in CIFSFindFirst()
4457 pSMB->SearchFlags = cpu_to_le16(search_flags); in CIFSFindFirst()
4458 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); in CIFSFindFirst()
4461 pSMB->SearchStorageType = 0; in CIFSFindFirst()
4462 inc_rfc1001_len(pSMB, byte_count); in CIFSFindFirst()
4463 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSFindFirst()
4465 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSFindFirst()
4474 cifs_buf_release(pSMB); in CIFSFindFirst()
4521 cifs_buf_release(pSMB); in CIFSFindFirst()
4532 TRANSACTION2_FNEXT_REQ *pSMB = NULL; in CIFSFindNext() local
4546 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSFindNext()
4553 pSMB->TotalDataCount = 0; /* no EAs */ in CIFSFindNext()
4554 pSMB->MaxParameterCount = cpu_to_le16(8); in CIFSFindNext()
4555 pSMB->MaxDataCount = cpu_to_le16(CIFSMaxBufSize & 0xFFFFFF00); in CIFSFindNext()
4556 pSMB->MaxSetupCount = 0; in CIFSFindNext()
4557 pSMB->Reserved = 0; in CIFSFindNext()
4558 pSMB->Flags = 0; in CIFSFindNext()
4559 pSMB->Timeout = 0; in CIFSFindNext()
4560 pSMB->Reserved2 = 0; in CIFSFindNext()
4561 pSMB->ParameterOffset = cpu_to_le16( in CIFSFindNext()
4563 pSMB->DataCount = 0; in CIFSFindNext()
4564 pSMB->DataOffset = 0; in CIFSFindNext()
4565 pSMB->SetupCount = 1; in CIFSFindNext()
4566 pSMB->Reserved3 = 0; in CIFSFindNext()
4567 pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_NEXT); in CIFSFindNext()
4568 pSMB->SearchHandle = searchHandle; /* always kept as le */ in CIFSFindNext()
4569 pSMB->SearchCount = in CIFSFindNext()
4571 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); in CIFSFindNext()
4572 pSMB->ResumeKey = psrch_inf->resume_key; in CIFSFindNext()
4573 pSMB->SearchFlags = cpu_to_le16(search_flags); in CIFSFindNext()
4578 memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); in CIFSFindNext()
4581 pSMB->ResumeFileName[name_len] = 0; in CIFSFindNext()
4582 pSMB->ResumeFileName[name_len+1] = 0; in CIFSFindNext()
4588 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSFindNext()
4589 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSFindNext()
4590 inc_rfc1001_len(pSMB, byte_count); in CIFSFindNext()
4591 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSFindNext()
4593 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSFindNext()
4599 cifs_buf_release(pSMB); in CIFSFindNext()
4625 psrch_inf->ntwrk_buf_start = (char *)pSMB; in CIFSFindNext()
4659 cifs_buf_release(pSMB); in CIFSFindNext()
4668 FINDCLOSE_REQ *pSMB = NULL; in CIFSFindClose() local
4671 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB); in CIFSFindClose()
4680 pSMB->FileID = searchHandle; in CIFSFindClose()
4681 pSMB->ByteCount = 0; in CIFSFindClose()
4682 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSFindClose()
4701 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSGetSrvInodeNumber() local
4711 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSGetSrvInodeNumber()
4716 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSGetSrvInodeNumber()
4718 cifsConvertToUTF16((__le16 *) pSMB->FileName, in CIFSGetSrvInodeNumber()
4726 strncpy(pSMB->FileName, search_name, name_len); in CIFSGetSrvInodeNumber()
4730 pSMB->TotalDataCount = 0; in CIFSGetSrvInodeNumber()
4731 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSGetSrvInodeNumber()
4733 pSMB->MaxDataCount = cpu_to_le16(4000); in CIFSGetSrvInodeNumber()
4734 pSMB->MaxSetupCount = 0; in CIFSGetSrvInodeNumber()
4735 pSMB->Reserved = 0; in CIFSGetSrvInodeNumber()
4736 pSMB->Flags = 0; in CIFSGetSrvInodeNumber()
4737 pSMB->Timeout = 0; in CIFSGetSrvInodeNumber()
4738 pSMB->Reserved2 = 0; in CIFSGetSrvInodeNumber()
4739 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSGetSrvInodeNumber()
4741 pSMB->DataCount = 0; in CIFSGetSrvInodeNumber()
4742 pSMB->DataOffset = 0; in CIFSGetSrvInodeNumber()
4743 pSMB->SetupCount = 1; in CIFSGetSrvInodeNumber()
4744 pSMB->Reserved3 = 0; in CIFSGetSrvInodeNumber()
4745 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSGetSrvInodeNumber()
4747 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSGetSrvInodeNumber()
4748 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSGetSrvInodeNumber()
4749 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_INTERNAL_INFO); in CIFSGetSrvInodeNumber()
4750 pSMB->Reserved4 = 0; in CIFSGetSrvInodeNumber()
4751 inc_rfc1001_len(pSMB, byte_count); in CIFSGetSrvInodeNumber()
4752 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSGetSrvInodeNumber()
4754 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSGetSrvInodeNumber()
4782 cifs_buf_release(pSMB); in CIFSGetSrvInodeNumber()
4906 TRANSACTION2_GET_DFS_REFER_REQ *pSMB = NULL; in CIFSGetDFSRefer() local
4919 rc = smb_init(SMB_COM_TRANSACTION2, 15, NULL, (void **) &pSMB, in CIFSGetDFSRefer()
4926 pSMB->hdr.Mid = get_next_mid(ses->server); in CIFSGetDFSRefer()
4927 pSMB->hdr.Tid = ses->ipc_tid; in CIFSGetDFSRefer()
4928 pSMB->hdr.Uid = ses->Suid; in CIFSGetDFSRefer()
4930 pSMB->hdr.Flags2 |= SMBFLG2_ERR_STATUS; in CIFSGetDFSRefer()
4932 pSMB->hdr.Flags2 |= SMBFLG2_DFS; in CIFSGetDFSRefer()
4935 pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; in CIFSGetDFSRefer()
4937 cifsConvertToUTF16((__le16 *) pSMB->RequestFileName, in CIFSGetDFSRefer()
4945 strncpy(pSMB->RequestFileName, search_name, name_len); in CIFSGetDFSRefer()
4949 pSMB->hdr.Flags2 |= SMBFLG2_SECURITY_SIGNATURE; in CIFSGetDFSRefer()
4951 pSMB->hdr.Uid = ses->Suid; in CIFSGetDFSRefer()
4954 pSMB->TotalDataCount = 0; in CIFSGetDFSRefer()
4955 pSMB->DataCount = 0; in CIFSGetDFSRefer()
4956 pSMB->DataOffset = 0; in CIFSGetDFSRefer()
4957 pSMB->MaxParameterCount = 0; in CIFSGetDFSRefer()
4959 pSMB->MaxDataCount = cpu_to_le16(4000); in CIFSGetDFSRefer()
4960 pSMB->MaxSetupCount = 0; in CIFSGetDFSRefer()
4961 pSMB->Reserved = 0; in CIFSGetDFSRefer()
4962 pSMB->Flags = 0; in CIFSGetDFSRefer()
4963 pSMB->Timeout = 0; in CIFSGetDFSRefer()
4964 pSMB->Reserved2 = 0; in CIFSGetDFSRefer()
4965 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSGetDFSRefer()
4967 pSMB->SetupCount = 1; in CIFSGetDFSRefer()
4968 pSMB->Reserved3 = 0; in CIFSGetDFSRefer()
4969 pSMB->SubCommand = cpu_to_le16(TRANS2_GET_DFS_REFERRAL); in CIFSGetDFSRefer()
4971 pSMB->ParameterCount = cpu_to_le16(params); in CIFSGetDFSRefer()
4972 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSGetDFSRefer()
4973 pSMB->MaxReferralLevel = cpu_to_le16(3); in CIFSGetDFSRefer()
4974 inc_rfc1001_len(pSMB, byte_count); in CIFSGetDFSRefer()
4975 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSGetDFSRefer()
4977 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, in CIFSGetDFSRefer()
5000 cifs_buf_release(pSMB); in CIFSGetDFSRefer()
5014 TRANSACTION2_QFSI_REQ *pSMB = NULL; in SMBOldQFSInfo() local
5023 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in SMBOldQFSInfo()
5029 pSMB->TotalDataCount = 0; in SMBOldQFSInfo()
5030 pSMB->MaxParameterCount = cpu_to_le16(2); in SMBOldQFSInfo()
5031 pSMB->MaxDataCount = cpu_to_le16(1000); in SMBOldQFSInfo()
5032 pSMB->MaxSetupCount = 0; in SMBOldQFSInfo()
5033 pSMB->Reserved = 0; in SMBOldQFSInfo()
5034 pSMB->Flags = 0; in SMBOldQFSInfo()
5035 pSMB->Timeout = 0; in SMBOldQFSInfo()
5036 pSMB->Reserved2 = 0; in SMBOldQFSInfo()
5038 pSMB->TotalParameterCount = cpu_to_le16(params); in SMBOldQFSInfo()
5039 pSMB->ParameterCount = pSMB->TotalParameterCount; in SMBOldQFSInfo()
5040 pSMB->ParameterOffset = cpu_to_le16(offsetof( in SMBOldQFSInfo()
5042 pSMB->DataCount = 0; in SMBOldQFSInfo()
5043 pSMB->DataOffset = 0; in SMBOldQFSInfo()
5044 pSMB->SetupCount = 1; in SMBOldQFSInfo()
5045 pSMB->Reserved3 = 0; in SMBOldQFSInfo()
5046 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in SMBOldQFSInfo()
5047 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_ALLOCATION); in SMBOldQFSInfo()
5048 inc_rfc1001_len(pSMB, byte_count); in SMBOldQFSInfo()
5049 pSMB->ByteCount = cpu_to_le16(byte_count); in SMBOldQFSInfo()
5051 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in SMBOldQFSInfo()
5081 cifs_buf_release(pSMB); in SMBOldQFSInfo()
5094 TRANSACTION2_QFSI_REQ *pSMB = NULL; in CIFSSMBQFSInfo() local
5103 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQFSInfo()
5109 pSMB->TotalDataCount = 0; in CIFSSMBQFSInfo()
5110 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQFSInfo()
5111 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBQFSInfo()
5112 pSMB->MaxSetupCount = 0; in CIFSSMBQFSInfo()
5113 pSMB->Reserved = 0; in CIFSSMBQFSInfo()
5114 pSMB->Flags = 0; in CIFSSMBQFSInfo()
5115 pSMB->Timeout = 0; in CIFSSMBQFSInfo()
5116 pSMB->Reserved2 = 0; in CIFSSMBQFSInfo()
5118 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBQFSInfo()
5119 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQFSInfo()
5120 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBQFSInfo()
5122 pSMB->DataCount = 0; in CIFSSMBQFSInfo()
5123 pSMB->DataOffset = 0; in CIFSSMBQFSInfo()
5124 pSMB->SetupCount = 1; in CIFSSMBQFSInfo()
5125 pSMB->Reserved3 = 0; in CIFSSMBQFSInfo()
5126 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in CIFSSMBQFSInfo()
5127 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_SIZE_INFO); in CIFSSMBQFSInfo()
5128 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFSInfo()
5129 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFSInfo()
5131 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFSInfo()
5161 cifs_buf_release(pSMB); in CIFSSMBQFSInfo()
5173 TRANSACTION2_QFSI_REQ *pSMB = NULL; in CIFSSMBQFSAttributeInfo() local
5182 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQFSAttributeInfo()
5188 pSMB->TotalDataCount = 0; in CIFSSMBQFSAttributeInfo()
5189 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQFSAttributeInfo()
5191 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBQFSAttributeInfo()
5192 pSMB->MaxSetupCount = 0; in CIFSSMBQFSAttributeInfo()
5193 pSMB->Reserved = 0; in CIFSSMBQFSAttributeInfo()
5194 pSMB->Flags = 0; in CIFSSMBQFSAttributeInfo()
5195 pSMB->Timeout = 0; in CIFSSMBQFSAttributeInfo()
5196 pSMB->Reserved2 = 0; in CIFSSMBQFSAttributeInfo()
5198 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBQFSAttributeInfo()
5199 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQFSAttributeInfo()
5200 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBQFSAttributeInfo()
5202 pSMB->DataCount = 0; in CIFSSMBQFSAttributeInfo()
5203 pSMB->DataOffset = 0; in CIFSSMBQFSAttributeInfo()
5204 pSMB->SetupCount = 1; in CIFSSMBQFSAttributeInfo()
5205 pSMB->Reserved3 = 0; in CIFSSMBQFSAttributeInfo()
5206 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in CIFSSMBQFSAttributeInfo()
5207 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_ATTRIBUTE_INFO); in CIFSSMBQFSAttributeInfo()
5208 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFSAttributeInfo()
5209 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFSAttributeInfo()
5211 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFSAttributeInfo()
5231 cifs_buf_release(pSMB); in CIFSSMBQFSAttributeInfo()
5243 TRANSACTION2_QFSI_REQ *pSMB = NULL; in CIFSSMBQFSDeviceInfo() local
5252 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQFSDeviceInfo()
5258 pSMB->TotalDataCount = 0; in CIFSSMBQFSDeviceInfo()
5259 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQFSDeviceInfo()
5261 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBQFSDeviceInfo()
5262 pSMB->MaxSetupCount = 0; in CIFSSMBQFSDeviceInfo()
5263 pSMB->Reserved = 0; in CIFSSMBQFSDeviceInfo()
5264 pSMB->Flags = 0; in CIFSSMBQFSDeviceInfo()
5265 pSMB->Timeout = 0; in CIFSSMBQFSDeviceInfo()
5266 pSMB->Reserved2 = 0; in CIFSSMBQFSDeviceInfo()
5268 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBQFSDeviceInfo()
5269 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQFSDeviceInfo()
5270 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBQFSDeviceInfo()
5273 pSMB->DataCount = 0; in CIFSSMBQFSDeviceInfo()
5274 pSMB->DataOffset = 0; in CIFSSMBQFSDeviceInfo()
5275 pSMB->SetupCount = 1; in CIFSSMBQFSDeviceInfo()
5276 pSMB->Reserved3 = 0; in CIFSSMBQFSDeviceInfo()
5277 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in CIFSSMBQFSDeviceInfo()
5278 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_DEVICE_INFO); in CIFSSMBQFSDeviceInfo()
5279 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFSDeviceInfo()
5280 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFSDeviceInfo()
5282 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFSDeviceInfo()
5302 cifs_buf_release(pSMB); in CIFSSMBQFSDeviceInfo()
5314 TRANSACTION2_QFSI_REQ *pSMB = NULL; in CIFSSMBQFSUnixInfo() local
5324 (void **) &pSMB, (void **) &pSMBr); in CIFSSMBQFSUnixInfo()
5329 pSMB->TotalDataCount = 0; in CIFSSMBQFSUnixInfo()
5330 pSMB->DataCount = 0; in CIFSSMBQFSUnixInfo()
5331 pSMB->DataOffset = 0; in CIFSSMBQFSUnixInfo()
5332 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQFSUnixInfo()
5334 pSMB->MaxDataCount = cpu_to_le16(100); in CIFSSMBQFSUnixInfo()
5335 pSMB->MaxSetupCount = 0; in CIFSSMBQFSUnixInfo()
5336 pSMB->Reserved = 0; in CIFSSMBQFSUnixInfo()
5337 pSMB->Flags = 0; in CIFSSMBQFSUnixInfo()
5338 pSMB->Timeout = 0; in CIFSSMBQFSUnixInfo()
5339 pSMB->Reserved2 = 0; in CIFSSMBQFSUnixInfo()
5341 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBQFSUnixInfo()
5342 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBQFSUnixInfo()
5343 pSMB->ParameterOffset = cpu_to_le16(offsetof(struct in CIFSSMBQFSUnixInfo()
5345 pSMB->SetupCount = 1; in CIFSSMBQFSUnixInfo()
5346 pSMB->Reserved3 = 0; in CIFSSMBQFSUnixInfo()
5347 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in CIFSSMBQFSUnixInfo()
5348 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_CIFS_UNIX_INFO); in CIFSSMBQFSUnixInfo()
5349 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFSUnixInfo()
5350 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFSUnixInfo()
5352 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFSUnixInfo()
5371 cifs_buf_release(pSMB); in CIFSSMBQFSUnixInfo()
5384 TRANSACTION2_SETFSI_REQ *pSMB = NULL; in CIFSSMBSetFSUnixInfo() local
5394 (void **) &pSMB, (void **) &pSMBr); in CIFSSMBSetFSUnixInfo()
5399 pSMB->MaxSetupCount = 0; in CIFSSMBSetFSUnixInfo()
5400 pSMB->Reserved = 0; in CIFSSMBSetFSUnixInfo()
5401 pSMB->Flags = 0; in CIFSSMBSetFSUnixInfo()
5402 pSMB->Timeout = 0; in CIFSSMBSetFSUnixInfo()
5403 pSMB->Reserved2 = 0; in CIFSSMBSetFSUnixInfo()
5408 pSMB->MaxParameterCount = cpu_to_le16(4); in CIFSSMBSetFSUnixInfo()
5410 pSMB->MaxDataCount = cpu_to_le16(100); in CIFSSMBSetFSUnixInfo()
5411 pSMB->SetupCount = 1; in CIFSSMBSetFSUnixInfo()
5412 pSMB->Reserved3 = 0; in CIFSSMBSetFSUnixInfo()
5413 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION); in CIFSSMBSetFSUnixInfo()
5416 pSMB->DataCount = cpu_to_le16(12); in CIFSSMBSetFSUnixInfo()
5417 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetFSUnixInfo()
5418 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetFSUnixInfo()
5419 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetFSUnixInfo()
5420 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetFSUnixInfo()
5421 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetFSUnixInfo()
5424 pSMB->FileNum = 0; in CIFSSMBSetFSUnixInfo()
5425 pSMB->InformationLevel = cpu_to_le16(SMB_SET_CIFS_UNIX_INFO); in CIFSSMBSetFSUnixInfo()
5428 pSMB->ClientUnixMajor = cpu_to_le16(CIFS_UNIX_MAJOR_VERSION); in CIFSSMBSetFSUnixInfo()
5429 pSMB->ClientUnixMinor = cpu_to_le16(CIFS_UNIX_MINOR_VERSION); in CIFSSMBSetFSUnixInfo()
5430 pSMB->ClientUnixCap = cpu_to_le64(cap); in CIFSSMBSetFSUnixInfo()
5432 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetFSUnixInfo()
5433 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetFSUnixInfo()
5435 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetFSUnixInfo()
5444 cifs_buf_release(pSMB); in CIFSSMBSetFSUnixInfo()
5459 TRANSACTION2_QFSI_REQ *pSMB = NULL; in CIFSSMBQFSPosixInfo() local
5468 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQFSPosixInfo()
5474 pSMB->TotalDataCount = 0; in CIFSSMBQFSPosixInfo()
5475 pSMB->DataCount = 0; in CIFSSMBQFSPosixInfo()
5476 pSMB->DataOffset = 0; in CIFSSMBQFSPosixInfo()
5477 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQFSPosixInfo()
5479 pSMB->MaxDataCount = cpu_to_le16(100); in CIFSSMBQFSPosixInfo()
5480 pSMB->MaxSetupCount = 0; in CIFSSMBQFSPosixInfo()
5481 pSMB->Reserved = 0; in CIFSSMBQFSPosixInfo()
5482 pSMB->Flags = 0; in CIFSSMBQFSPosixInfo()
5483 pSMB->Timeout = 0; in CIFSSMBQFSPosixInfo()
5484 pSMB->Reserved2 = 0; in CIFSSMBQFSPosixInfo()
5486 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBQFSPosixInfo()
5487 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBQFSPosixInfo()
5488 pSMB->ParameterOffset = cpu_to_le16(offsetof(struct in CIFSSMBQFSPosixInfo()
5490 pSMB->SetupCount = 1; in CIFSSMBQFSPosixInfo()
5491 pSMB->Reserved3 = 0; in CIFSSMBQFSPosixInfo()
5492 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); in CIFSSMBQFSPosixInfo()
5493 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_FS_INFO); in CIFSSMBQFSPosixInfo()
5494 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQFSPosixInfo()
5495 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQFSPosixInfo()
5497 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQFSPosixInfo()
5532 cifs_buf_release(pSMB); in CIFSSMBQFSPosixInfo()
5552 struct smb_com_transaction2_spi_req *pSMB = NULL; in CIFSSMBSetEOF() local
5564 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBSetEOF()
5569 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBSetEOF()
5571 cifsConvertToUTF16((__le16 *) pSMB->FileName, file_name, in CIFSSMBSetEOF()
5578 strncpy(pSMB->FileName, file_name, name_len); in CIFSSMBSetEOF()
5582 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetEOF()
5583 pSMB->MaxDataCount = cpu_to_le16(4100); in CIFSSMBSetEOF()
5584 pSMB->MaxSetupCount = 0; in CIFSSMBSetEOF()
5585 pSMB->Reserved = 0; in CIFSSMBSetEOF()
5586 pSMB->Flags = 0; in CIFSSMBSetEOF()
5587 pSMB->Timeout = 0; in CIFSSMBSetEOF()
5588 pSMB->Reserved2 = 0; in CIFSSMBSetEOF()
5594 pSMB->InformationLevel = in CIFSSMBSetEOF()
5597 pSMB->InformationLevel = in CIFSSMBSetEOF()
5601 pSMB->InformationLevel = in CIFSSMBSetEOF()
5604 pSMB->InformationLevel = in CIFSSMBSetEOF()
5609 (struct file_end_of_file_info *) (((char *) &pSMB->hdr.Protocol) + in CIFSSMBSetEOF()
5611 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetEOF()
5612 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetEOF()
5613 pSMB->SetupCount = 1; in CIFSSMBSetEOF()
5614 pSMB->Reserved3 = 0; in CIFSSMBSetEOF()
5615 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSSMBSetEOF()
5617 pSMB->DataCount = cpu_to_le16(data_count); in CIFSSMBSetEOF()
5618 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetEOF()
5619 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetEOF()
5620 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetEOF()
5621 pSMB->Reserved4 = 0; in CIFSSMBSetEOF()
5622 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetEOF()
5624 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetEOF()
5625 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetEOF()
5630 cifs_buf_release(pSMB); in CIFSSMBSetEOF()
5642 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBSetFileSize() local
5649 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); in CIFSSMBSetFileSize()
5654 pSMB->hdr.Pid = cpu_to_le16((__u16)cfile->pid); in CIFSSMBSetFileSize()
5655 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(cfile->pid >> 16)); in CIFSSMBSetFileSize()
5658 pSMB->MaxSetupCount = 0; in CIFSSMBSetFileSize()
5659 pSMB->Reserved = 0; in CIFSSMBSetFileSize()
5660 pSMB->Flags = 0; in CIFSSMBSetFileSize()
5661 pSMB->Timeout = 0; in CIFSSMBSetFileSize()
5662 pSMB->Reserved2 = 0; in CIFSSMBSetFileSize()
5667 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetFileSize()
5669 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetFileSize()
5670 pSMB->SetupCount = 1; in CIFSSMBSetFileSize()
5671 pSMB->Reserved3 = 0; in CIFSSMBSetFileSize()
5672 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBSetFileSize()
5674 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBSetFileSize()
5675 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetFileSize()
5676 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetFileSize()
5677 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetFileSize()
5678 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetFileSize()
5680 (struct file_end_of_file_info *) (((char *) &pSMB->hdr.Protocol) in CIFSSMBSetFileSize()
5682 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetFileSize()
5684 pSMB->Fid = cfile->fid.netfid; in CIFSSMBSetFileSize()
5687 pSMB->InformationLevel = in CIFSSMBSetFileSize()
5690 pSMB->InformationLevel = in CIFSSMBSetFileSize()
5694 pSMB->InformationLevel = in CIFSSMBSetFileSize()
5697 pSMB->InformationLevel = in CIFSSMBSetFileSize()
5700 pSMB->Reserved4 = 0; in CIFSSMBSetFileSize()
5701 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetFileSize()
5702 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetFileSize()
5703 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBSetFileSize()
5725 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBSetFileInfo() local
5731 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); in CIFSSMBSetFileInfo()
5736 pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener); in CIFSSMBSetFileInfo()
5737 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16)); in CIFSSMBSetFileInfo()
5740 pSMB->MaxSetupCount = 0; in CIFSSMBSetFileInfo()
5741 pSMB->Reserved = 0; in CIFSSMBSetFileInfo()
5742 pSMB->Flags = 0; in CIFSSMBSetFileInfo()
5743 pSMB->Timeout = 0; in CIFSSMBSetFileInfo()
5744 pSMB->Reserved2 = 0; in CIFSSMBSetFileInfo()
5748 data_offset = (char *)pSMB + in CIFSSMBSetFileInfo()
5752 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetFileInfo()
5754 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetFileInfo()
5755 pSMB->SetupCount = 1; in CIFSSMBSetFileInfo()
5756 pSMB->Reserved3 = 0; in CIFSSMBSetFileInfo()
5757 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBSetFileInfo()
5759 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBSetFileInfo()
5760 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetFileInfo()
5761 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetFileInfo()
5762 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetFileInfo()
5763 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetFileInfo()
5764 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetFileInfo()
5765 pSMB->Fid = fid; in CIFSSMBSetFileInfo()
5767 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO2); in CIFSSMBSetFileInfo()
5769 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO); in CIFSSMBSetFileInfo()
5770 pSMB->Reserved4 = 0; in CIFSSMBSetFileInfo()
5771 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetFileInfo()
5772 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetFileInfo()
5774 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBSetFileInfo()
5789 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBSetFileDisposition() local
5795 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); in CIFSSMBSetFileDisposition()
5800 pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener); in CIFSSMBSetFileDisposition()
5801 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16)); in CIFSSMBSetFileDisposition()
5804 pSMB->MaxSetupCount = 0; in CIFSSMBSetFileDisposition()
5805 pSMB->Reserved = 0; in CIFSSMBSetFileDisposition()
5806 pSMB->Flags = 0; in CIFSSMBSetFileDisposition()
5807 pSMB->Timeout = 0; in CIFSSMBSetFileDisposition()
5808 pSMB->Reserved2 = 0; in CIFSSMBSetFileDisposition()
5812 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; in CIFSSMBSetFileDisposition()
5815 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetFileDisposition()
5817 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetFileDisposition()
5818 pSMB->SetupCount = 1; in CIFSSMBSetFileDisposition()
5819 pSMB->Reserved3 = 0; in CIFSSMBSetFileDisposition()
5820 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBSetFileDisposition()
5822 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBSetFileDisposition()
5823 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetFileDisposition()
5824 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetFileDisposition()
5825 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetFileDisposition()
5826 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetFileDisposition()
5827 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetFileDisposition()
5828 pSMB->Fid = fid; in CIFSSMBSetFileDisposition()
5829 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_DISPOSITION_INFO); in CIFSSMBSetFileDisposition()
5830 pSMB->Reserved4 = 0; in CIFSSMBSetFileDisposition()
5831 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetFileDisposition()
5832 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetFileDisposition()
5834 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBSetFileDisposition()
5846 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSSMBSetPathInfo() local
5857 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBSetPathInfo()
5862 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBSetPathInfo()
5864 cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, in CIFSSMBSetPathInfo()
5871 strncpy(pSMB->FileName, fileName, name_len); in CIFSSMBSetPathInfo()
5876 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetPathInfo()
5878 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetPathInfo()
5879 pSMB->MaxSetupCount = 0; in CIFSSMBSetPathInfo()
5880 pSMB->Reserved = 0; in CIFSSMBSetPathInfo()
5881 pSMB->Flags = 0; in CIFSSMBSetPathInfo()
5882 pSMB->Timeout = 0; in CIFSSMBSetPathInfo()
5883 pSMB->Reserved2 = 0; in CIFSSMBSetPathInfo()
5887 data_offset = (char *) (&pSMB->hdr.Protocol) + offset; in CIFSSMBSetPathInfo()
5888 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetPathInfo()
5889 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetPathInfo()
5890 pSMB->SetupCount = 1; in CIFSSMBSetPathInfo()
5891 pSMB->Reserved3 = 0; in CIFSSMBSetPathInfo()
5892 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSSMBSetPathInfo()
5895 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBSetPathInfo()
5896 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetPathInfo()
5897 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetPathInfo()
5898 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetPathInfo()
5900 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO2); in CIFSSMBSetPathInfo()
5902 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO); in CIFSSMBSetPathInfo()
5903 pSMB->Reserved4 = 0; in CIFSSMBSetPathInfo()
5904 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetPathInfo()
5906 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetPathInfo()
5907 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetPathInfo()
5912 cifs_buf_release(pSMB); in CIFSSMBSetPathInfo()
5929 SETATTR_REQ *pSMB = NULL;
5938 rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB,
5943 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
5945 ConvertToUTF16((__le16 *) pSMB->fileName, fileName,
5952 strncpy(pSMB->fileName, fileName, name_len);
5954 pSMB->attr = cpu_to_le16(dos_attrs);
5955 pSMB->BufferFormat = 0x04;
5956 inc_rfc1001_len(pSMB, name_len + 1);
5957 pSMB->ByteCount = cpu_to_le16(name_len + 1);
5958 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5963 cifs_buf_release(pSMB);
6024 struct smb_com_transaction2_sfi_req *pSMB = NULL; in CIFSSMBUnixSetFileInfo() local
6030 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); in CIFSSMBUnixSetFileInfo()
6035 pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener); in CIFSSMBUnixSetFileInfo()
6036 pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16)); in CIFSSMBUnixSetFileInfo()
6039 pSMB->MaxSetupCount = 0; in CIFSSMBUnixSetFileInfo()
6040 pSMB->Reserved = 0; in CIFSSMBUnixSetFileInfo()
6041 pSMB->Flags = 0; in CIFSSMBUnixSetFileInfo()
6042 pSMB->Timeout = 0; in CIFSSMBUnixSetFileInfo()
6043 pSMB->Reserved2 = 0; in CIFSSMBUnixSetFileInfo()
6047 data_offset = (char *)pSMB + in CIFSSMBUnixSetFileInfo()
6052 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBUnixSetFileInfo()
6054 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBUnixSetFileInfo()
6055 pSMB->SetupCount = 1; in CIFSSMBUnixSetFileInfo()
6056 pSMB->Reserved3 = 0; in CIFSSMBUnixSetFileInfo()
6057 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); in CIFSSMBUnixSetFileInfo()
6059 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBUnixSetFileInfo()
6060 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBUnixSetFileInfo()
6061 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBUnixSetFileInfo()
6062 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBUnixSetFileInfo()
6063 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBUnixSetFileInfo()
6064 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBUnixSetFileInfo()
6065 pSMB->Fid = fid; in CIFSSMBUnixSetFileInfo()
6066 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); in CIFSSMBUnixSetFileInfo()
6067 pSMB->Reserved4 = 0; in CIFSSMBUnixSetFileInfo()
6068 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBUnixSetFileInfo()
6069 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBUnixSetFileInfo()
6073 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); in CIFSSMBUnixSetFileInfo()
6090 TRANSACTION2_SPI_REQ *pSMB = NULL; in CIFSSMBUnixSetPathInfo() local
6100 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBUnixSetPathInfo()
6105 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBUnixSetPathInfo()
6107 cifsConvertToUTF16((__le16 *) pSMB->FileName, file_name, in CIFSSMBUnixSetPathInfo()
6114 strncpy(pSMB->FileName, file_name, name_len); in CIFSSMBUnixSetPathInfo()
6119 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBUnixSetPathInfo()
6121 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBUnixSetPathInfo()
6122 pSMB->MaxSetupCount = 0; in CIFSSMBUnixSetPathInfo()
6123 pSMB->Reserved = 0; in CIFSSMBUnixSetPathInfo()
6124 pSMB->Flags = 0; in CIFSSMBUnixSetPathInfo()
6125 pSMB->Timeout = 0; in CIFSSMBUnixSetPathInfo()
6126 pSMB->Reserved2 = 0; in CIFSSMBUnixSetPathInfo()
6131 (FILE_UNIX_BASIC_INFO *) ((char *) &pSMB->hdr.Protocol + in CIFSSMBUnixSetPathInfo()
6134 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBUnixSetPathInfo()
6135 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBUnixSetPathInfo()
6136 pSMB->SetupCount = 1; in CIFSSMBUnixSetPathInfo()
6137 pSMB->Reserved3 = 0; in CIFSSMBUnixSetPathInfo()
6138 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSSMBUnixSetPathInfo()
6140 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBUnixSetPathInfo()
6141 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBUnixSetPathInfo()
6142 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBUnixSetPathInfo()
6143 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBUnixSetPathInfo()
6144 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); in CIFSSMBUnixSetPathInfo()
6145 pSMB->Reserved4 = 0; in CIFSSMBUnixSetPathInfo()
6146 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBUnixSetPathInfo()
6150 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBUnixSetPathInfo()
6151 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBUnixSetPathInfo()
6156 cifs_buf_release(pSMB); in CIFSSMBUnixSetPathInfo()
6179 TRANSACTION2_QPI_REQ *pSMB = NULL; in CIFSSMBQAllEAs() local
6193 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBQAllEAs()
6198 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBQAllEAs()
6200 cifsConvertToUTF16((__le16 *) pSMB->FileName, searchName, in CIFSSMBQAllEAs()
6207 strncpy(pSMB->FileName, searchName, list_len); in CIFSSMBQAllEAs()
6211 pSMB->TotalDataCount = 0; in CIFSSMBQAllEAs()
6212 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBQAllEAs()
6214 pSMB->MaxDataCount = cpu_to_le16(CIFSMaxBufSize); in CIFSSMBQAllEAs()
6215 pSMB->MaxSetupCount = 0; in CIFSSMBQAllEAs()
6216 pSMB->Reserved = 0; in CIFSSMBQAllEAs()
6217 pSMB->Flags = 0; in CIFSSMBQAllEAs()
6218 pSMB->Timeout = 0; in CIFSSMBQAllEAs()
6219 pSMB->Reserved2 = 0; in CIFSSMBQAllEAs()
6220 pSMB->ParameterOffset = cpu_to_le16(offsetof( in CIFSSMBQAllEAs()
6222 pSMB->DataCount = 0; in CIFSSMBQAllEAs()
6223 pSMB->DataOffset = 0; in CIFSSMBQAllEAs()
6224 pSMB->SetupCount = 1; in CIFSSMBQAllEAs()
6225 pSMB->Reserved3 = 0; in CIFSSMBQAllEAs()
6226 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION); in CIFSSMBQAllEAs()
6228 pSMB->TotalParameterCount = cpu_to_le16(params); in CIFSSMBQAllEAs()
6229 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBQAllEAs()
6230 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_QUERY_ALL_EAS); in CIFSSMBQAllEAs()
6231 pSMB->Reserved4 = 0; in CIFSSMBQAllEAs()
6232 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBQAllEAs()
6233 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBQAllEAs()
6235 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBQAllEAs()
6351 cifs_buf_release(pSMB); in CIFSSMBQAllEAs()
6364 struct smb_com_transaction2_spi_req *pSMB = NULL; in CIFSSMBSetEA() local
6374 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, in CIFSSMBSetEA()
6379 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { in CIFSSMBSetEA()
6381 cifsConvertToUTF16((__le16 *) pSMB->FileName, fileName, in CIFSSMBSetEA()
6388 strncpy(pSMB->FileName, fileName, name_len); in CIFSSMBSetEA()
6402 pSMB->MaxParameterCount = cpu_to_le16(2); in CIFSSMBSetEA()
6404 pSMB->MaxDataCount = cpu_to_le16(1000); in CIFSSMBSetEA()
6405 pSMB->MaxSetupCount = 0; in CIFSSMBSetEA()
6406 pSMB->Reserved = 0; in CIFSSMBSetEA()
6407 pSMB->Flags = 0; in CIFSSMBSetEA()
6408 pSMB->Timeout = 0; in CIFSSMBSetEA()
6409 pSMB->Reserved2 = 0; in CIFSSMBSetEA()
6413 pSMB->InformationLevel = in CIFSSMBSetEA()
6417 (struct fealist *) (((char *) &pSMB->hdr.Protocol) + in CIFSSMBSetEA()
6419 pSMB->ParameterOffset = cpu_to_le16(param_offset); in CIFSSMBSetEA()
6420 pSMB->DataOffset = cpu_to_le16(offset); in CIFSSMBSetEA()
6421 pSMB->SetupCount = 1; in CIFSSMBSetEA()
6422 pSMB->Reserved3 = 0; in CIFSSMBSetEA()
6423 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION); in CIFSSMBSetEA()
6425 pSMB->DataCount = cpu_to_le16(count); in CIFSSMBSetEA()
6445 pSMB->TotalDataCount = pSMB->DataCount; in CIFSSMBSetEA()
6446 pSMB->ParameterCount = cpu_to_le16(params); in CIFSSMBSetEA()
6447 pSMB->TotalParameterCount = pSMB->ParameterCount; in CIFSSMBSetEA()
6448 pSMB->Reserved4 = 0; in CIFSSMBSetEA()
6449 inc_rfc1001_len(pSMB, byte_count); in CIFSSMBSetEA()
6450 pSMB->ByteCount = cpu_to_le16(byte_count); in CIFSSMBSetEA()
6451 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBSetEA()
6456 cifs_buf_release(pSMB); in CIFSSMBSetEA()
6492 struct smb_com_transaction_change_notify_req *pSMB = NULL; in CIFSSMBNotify() local
6498 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, in CIFSSMBNotify()
6503 pSMB->TotalParameterCount = 0 ; in CIFSSMBNotify()
6504 pSMB->TotalDataCount = 0; in CIFSSMBNotify()
6505 pSMB->MaxParameterCount = cpu_to_le32(2); in CIFSSMBNotify()
6506 pSMB->MaxDataCount = cpu_to_le32(CIFSMaxBufSize & 0xFFFFFF00); in CIFSSMBNotify()
6507 pSMB->MaxSetupCount = 4; in CIFSSMBNotify()
6508 pSMB->Reserved = 0; in CIFSSMBNotify()
6509 pSMB->ParameterOffset = 0; in CIFSSMBNotify()
6510 pSMB->DataCount = 0; in CIFSSMBNotify()
6511 pSMB->DataOffset = 0; in CIFSSMBNotify()
6512 pSMB->SetupCount = 4; /* single byte does not need le conversion */ in CIFSSMBNotify()
6513 pSMB->SubCommand = cpu_to_le16(NT_TRANSACT_NOTIFY_CHANGE); in CIFSSMBNotify()
6514 pSMB->ParameterCount = pSMB->TotalParameterCount; in CIFSSMBNotify()
6516 pSMB->WatchTree = 1; /* one byte - no le conversion needed */ in CIFSSMBNotify()
6517 pSMB->Reserved2 = 0; in CIFSSMBNotify()
6518 pSMB->CompletionFilter = cpu_to_le32(filter); in CIFSSMBNotify()
6519 pSMB->Fid = netfid; /* file handle always le */ in CIFSSMBNotify()
6520 pSMB->ByteCount = 0; in CIFSSMBNotify()
6522 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, in CIFSSMBNotify()
6534 dnotify_req->Pid = pSMB->hdr.Pid; in CIFSSMBNotify()
6535 dnotify_req->PidHigh = pSMB->hdr.PidHigh; in CIFSSMBNotify()
6536 dnotify_req->Mid = pSMB->hdr.Mid; in CIFSSMBNotify()
6537 dnotify_req->Tid = pSMB->hdr.Tid; in CIFSSMBNotify()
6538 dnotify_req->Uid = pSMB->hdr.Uid; in CIFSSMBNotify()
6550 cifs_buf_release(pSMB); in CIFSSMBNotify()