open-isns: Fix warnings reported by gcc-4.5.2
[open-iscsi.git] / usr / be2iscsi.c
blobce8b7190a3ba04c7961e0018d7600ffb4402f662
1 /*
2 * be2iscsi helpers
4 * Copyright (C) 2006 Mike Christie
5 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 #include "initiator.h"
19 void be2iscsi_create_conn(struct iscsi_conn *conn)
21 struct iscsi_session *session = conn->session;
22 conn_rec_t *conn_rec = &session->nrec.conn[conn->id];
24 if (conn->max_recv_dlength > 65536)
25 conn->max_recv_dlength = 65536;
27 if (session->first_burst > 8192)
28 session->first_burst = 8192;
30 if (session->max_burst > 262144)
31 session->max_burst = 262144;
33 if (conn->max_xmit_dlength > 65536)
34 conn->max_xmit_dlength = 65536;
36 if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
37 conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
38 conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
40 session->erl = 0;
41 session->initial_r2t_en = 1;