Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/include/rdma/iw_cm.h
/* | /* | ||||
* Copyright (c) 2005 Network Appliance, Inc. All rights reserved. | * Copyright (c) 2005 Network Appliance, Inc. All rights reserved. | ||||
* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | ||||
* Copyright (c) 2016 Chelsio Communications. All rights reserved. | |||||
* | * | ||||
* This software is available to you under a choice of one of two | * This software is available to you under a choice of one of two | ||||
* licenses. You may choose to be licensed under the terms of the GNU | * licenses. You may choose to be licensed under the terms of the GNU | ||||
* General Public License (GPL) Version 2, available from the file | * General Public License (GPL) Version 2, available from the file | ||||
* COPYING in the main directory of this source tree, or the | * COPYING in the main directory of this source tree, or the | ||||
* OpenIB.org BSD license below: | * OpenIB.org BSD license below: | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or | * Redistribution and use in source and binary forms, with or | ||||
Show All 32 Lines | enum iw_cm_event_type { | ||||
IW_CM_EVENT_ESTABLISHED, /* passive side accept successful */ | IW_CM_EVENT_ESTABLISHED, /* passive side accept successful */ | ||||
IW_CM_EVENT_DISCONNECT, /* orderly shutdown */ | IW_CM_EVENT_DISCONNECT, /* orderly shutdown */ | ||||
IW_CM_EVENT_CLOSE /* close complete */ | IW_CM_EVENT_CLOSE /* close complete */ | ||||
}; | }; | ||||
struct iw_cm_event { | struct iw_cm_event { | ||||
enum iw_cm_event_type event; | enum iw_cm_event_type event; | ||||
int status; | int status; | ||||
struct sockaddr_in local_addr; | struct sockaddr_storage local_addr; | ||||
struct sockaddr_in remote_addr; | struct sockaddr_storage remote_addr; | ||||
void *private_data; | void *private_data; | ||||
void *provider_data; | void *provider_data; | ||||
u8 private_data_len; | u8 private_data_len; | ||||
struct socket *so; | |||||
u8 ord; | u8 ord; | ||||
u8 ird; | u8 ird; | ||||
}; | }; | ||||
/** | /** | ||||
* iw_cm_handler - Function to be called by the IW CM when delivering events | * iw_cm_handler - Function to be called by the IW CM when delivering events | ||||
* to the client. | * to the client. | ||||
* | * | ||||
Show All 13 Lines | |||||
*/ | */ | ||||
typedef int (*iw_event_handler)(struct iw_cm_id *cm_id, | typedef int (*iw_event_handler)(struct iw_cm_id *cm_id, | ||||
struct iw_cm_event *event); | struct iw_cm_event *event); | ||||
struct iw_cm_id { | struct iw_cm_id { | ||||
iw_cm_handler cm_handler; /* client callback function */ | iw_cm_handler cm_handler; /* client callback function */ | ||||
void *context; /* client cb context */ | void *context; /* client cb context */ | ||||
struct ib_device *device; | struct ib_device *device; | ||||
struct sockaddr_in local_addr; | struct sockaddr_storage local_addr; /* local addr */ | ||||
struct sockaddr_in remote_addr; | struct sockaddr_storage remote_addr; | ||||
struct sockaddr_storage m_local_addr; /* nmapped local addr */ | |||||
struct sockaddr_storage m_remote_addr; /* nmapped rem addr */ | |||||
void *provider_data; /* provider private data */ | void *provider_data; /* provider private data */ | ||||
iw_event_handler event_handler; /* cb for provider | iw_event_handler event_handler; /* cb for provider | ||||
events */ | events */ | ||||
/* Used by provider to add and remove refs on IW cm_id */ | /* Used by provider to add and remove refs on IW cm_id */ | ||||
void (*add_ref)(struct iw_cm_id *); | void (*add_ref)(struct iw_cm_id *); | ||||
void (*rem_ref)(struct iw_cm_id *); | void (*rem_ref)(struct iw_cm_id *); | ||||
struct socket *so; | u8 tos; | ||||
}; | }; | ||||
struct iw_cm_conn_param { | struct iw_cm_conn_param { | ||||
const void *private_data; | const void *private_data; | ||||
u16 private_data_len; | u16 private_data_len; | ||||
u32 ord; | u32 ord; | ||||
u32 ird; | u32 ird; | ||||
u32 qpn; | u32 qpn; | ||||
Show All 11 Lines | int (*connect)(struct iw_cm_id *cm_id, | ||||
struct iw_cm_conn_param *conn_param); | struct iw_cm_conn_param *conn_param); | ||||
int (*accept)(struct iw_cm_id *cm_id, | int (*accept)(struct iw_cm_id *cm_id, | ||||
struct iw_cm_conn_param *conn_param); | struct iw_cm_conn_param *conn_param); | ||||
int (*reject)(struct iw_cm_id *cm_id, | int (*reject)(struct iw_cm_id *cm_id, | ||||
const void *pdata, u8 pdata_len); | const void *pdata, u8 pdata_len); | ||||
int (*create_listen_ep)(struct iw_cm_id *cm_id, | int (*create_listen)(struct iw_cm_id *cm_id, | ||||
int backlog); | int backlog); | ||||
void (*destroy_listen_ep)(struct iw_cm_id *cm_id); | int (*destroy_listen)(struct iw_cm_id *cm_id); | ||||
char ifname[IFNAMSIZ]; | |||||
void (*newconn)(struct iw_cm_id *parent_cm_id, | |||||
struct socket *so); | |||||
}; | }; | ||||
/** | /** | ||||
* iw_create_cm_id - Create an IW CM identifier. | * iw_create_cm_id - Create an IW CM identifier. | ||||
* | * | ||||
* @device: The IB device on which to create the IW CM identier. | * @device: The IB device on which to create the IW CM identier. | ||||
* @event_handler: User callback invoked to report events associated with the | * @event_handler: User callback invoked to report events associated with the | ||||
* returned IW CM identifier. | * returned IW CM identifier. | ||||
* @context: User specified context associated with the id. | * @context: User specified context associated with the id. | ||||
*/ | */ | ||||
struct iw_cm_id *iw_create_cm_id(struct ib_device *device, struct socket *so, | struct iw_cm_id *iw_create_cm_id(struct ib_device *device, | ||||
iw_cm_handler cm_handler, void *context); | iw_cm_handler cm_handler, void *context); | ||||
/** | /** | ||||
* iw_destroy_cm_id - Destroy an IW CM identifier. | * iw_destroy_cm_id - Destroy an IW CM identifier. | ||||
* | * | ||||
* @cm_id: The previously created IW CM identifier to destroy. | * @cm_id: The previously created IW CM identifier to destroy. | ||||
* | * | ||||
* The client can assume that no events will be delivered for the CM ID after | * The client can assume that no events will be delivered for the CM ID after | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |