blob: 09530f41612306a7a69753e6b3e589b56f1fe79a [file] [log] [blame]
Steve French1080ef72011-02-24 18:07:19 +00001/*
2 * SMB2 version specific operations
3 *
4 * Copyright (c) 2012, Jeff Layton <jlayton@redhat.com>
5 *
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License v2 as published
8 * by the Free Software Foundation.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include "cifsglob.h"
Pavel Shilovsky2dc7e1c2011-12-26 22:53:34 +040021#include "smb2pdu.h"
22#include "smb2proto.h"
23
24static __u64
25smb2_get_next_mid(struct TCP_Server_Info *server)
26{
27 __u64 mid;
28 /* for SMB2 we need the current value */
29 spin_lock(&GlobalMid_Lock);
30 mid = server->CurrentMid++;
31 spin_unlock(&GlobalMid_Lock);
32 return mid;
33}
Steve French1080ef72011-02-24 18:07:19 +000034
35struct smb_version_operations smb21_operations = {
Pavel Shilovsky2dc7e1c2011-12-26 22:53:34 +040036 .setup_request = smb2_setup_request,
37 .check_receive = smb2_check_receive,
38 .get_next_mid = smb2_get_next_mid,
Steve French1080ef72011-02-24 18:07:19 +000039};
40
41struct smb_version_values smb21_values = {
42 .version_string = SMB21_VERSION_STRING,
Pavel Shilovsky2dc7e1c2011-12-26 22:53:34 +040043 .lock_cmd = SMB2_LOCK,
Steve French1080ef72011-02-24 18:07:19 +000044};