blob: e4a7d5e234d5d61cee281af9ac7e396df34d87f5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ursula Braun9bf9abe2017-01-09 16:55:21 +01002/*
3 * Shared Memory Communications over RDMA (SMC-R) and RoCE
4 *
5 * Definitions for LLC (link layer control) message handling
6 *
7 * Copyright IBM Corp. 2016
8 *
9 * Author(s): Klaus Wacker <Klaus.Wacker@de.ibm.com>
10 * Ursula Braun <ubraun@linux.vnet.ibm.com>
11 */
12
13#ifndef SMC_LLC_H
14#define SMC_LLC_H
15
16#include "smc_wr.h"
17
18#define SMC_LLC_FLAG_RESP 0x80
19
20#define SMC_LLC_WAIT_FIRST_TIME (5 * HZ)
Karsten Graul52bedf32018-03-01 13:51:32 +010021#define SMC_LLC_WAIT_TIME (2 * HZ)
Ursula Braun9bf9abe2017-01-09 16:55:21 +010022
23enum smc_llc_reqresp {
24 SMC_LLC_REQ,
25 SMC_LLC_RESP
26};
27
28enum smc_llc_msg_type {
29 SMC_LLC_CONFIRM_LINK = 0x01,
Karsten Graul52bedf32018-03-01 13:51:32 +010030 SMC_LLC_ADD_LINK = 0x02,
31 SMC_LLC_DELETE_LINK = 0x04,
Karsten Graul4ed75de2018-03-01 13:51:30 +010032 SMC_LLC_CONFIRM_RKEY = 0x06,
Karsten Graul313164d2018-03-01 13:51:29 +010033 SMC_LLC_TEST_LINK = 0x07,
Karsten Graul4ed75de2018-03-01 13:51:30 +010034 SMC_LLC_CONFIRM_RKEY_CONT = 0x08,
35 SMC_LLC_DELETE_RKEY = 0x09,
Ursula Braun9bf9abe2017-01-09 16:55:21 +010036};
37
Ursula Braun9bf9abe2017-01-09 16:55:21 +010038/* transmit */
39int smc_llc_send_confirm_link(struct smc_link *lnk, u8 mac[], union ib_gid *gid,
40 enum smc_llc_reqresp reqresp);
Karsten Graul52bedf32018-03-01 13:51:32 +010041int smc_llc_send_add_link(struct smc_link *link, u8 mac[], union ib_gid *gid,
42 enum smc_llc_reqresp reqresp);
43int smc_llc_send_delete_link(struct smc_link *link,
44 enum smc_llc_reqresp reqresp);
Karsten Graul313164d2018-03-01 13:51:29 +010045int smc_llc_send_test_link(struct smc_link *lnk, u8 user_data[16],
46 enum smc_llc_reqresp reqresp);
Ursula Braun9bf9abe2017-01-09 16:55:21 +010047int smc_llc_init(void) __init;
48
49#endif /* SMC_LLC_H */