@@ -3323,8 +3323,8 @@ int ib_send_cm_apr(struct ib_cm_id *cm_id,
unsigned long flags;
int ret;
- if ((private_data && private_data_len > IB_CM_APR_PRIVATE_DATA_SIZE) ||
- (info && info_length > IB_CM_APR_INFO_LENGTH))
+ if ((private_data && private_data_len > CM_APR_PRIVATE_DATA_SIZE) ||
+ (info && info_length > CM_APR_ADDITIONAL_INFORMATION_SIZE))
return -EINVAL;
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
@@ -3378,7 +3378,7 @@ static int cm_apr_handler(struct cm_work *work)
work->cm_event.param.apr_rcvd.apr_info = &apr_msg->info;
work->cm_event.param.apr_rcvd.info_len = apr_msg->info_length;
work->cm_event.private_data = &apr_msg->private_data;
- work->cm_event.private_data_len = IB_CM_APR_PRIVATE_DATA_SIZE;
+ work->cm_event.private_data_len = CM_APR_PRIVATE_DATA_SIZE;
spin_lock_irq(&cm_id_priv->lock);
if (cm_id_priv->id.state != IB_CM_ESTABLISHED ||
@@ -751,9 +751,9 @@ struct cm_apr_msg {
u8 info_length;
u8 ap_status;
__be16 rsvd;
- u8 info[IB_CM_APR_INFO_LENGTH];
+ u8 info[CM_APR_ADDITIONAL_INFORMATION_SIZE];
- u8 private_data[IB_CM_APR_PRIVATE_DATA_SIZE];
+ u8 private_data[CM_APR_PRIVATE_DATA_SIZE];
} __packed;
struct cm_sidr_req_msg {
@@ -65,7 +65,6 @@ enum ib_cm_event_type {
};
enum ib_cm_data_size {
- IB_CM_APR_PRIVATE_DATA_SIZE = 148,
IB_CM_APR_INFO_LENGTH = 72,
IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE = 216,
IB_CM_SIDR_REP_PRIVATE_DATA_SIZE = 136,
@@ -171,4 +171,15 @@
#define CM_LAP_PRIVATE_DATA CM_FIELD_MLOC(struct cm_lap_msg, 64, 1344)
#define CM_LAP_PRIVATE_DATA_SIZE 168
+/* Table 116 APR Message Contents */
+#define CM_APR_LOCAL_COMM_ID CM_FIELD32_LOC(struct cm_apr_msg, 0, 32)
+#define CM_APR_REMOTE_COMM_ID CM_FIELD32_LOC(struct cm_apr_msg, 4, 32)
+#define CM_APR_ADDITIONAL_INFORMATION_LENGTH \
+ CM_FIELD8_LOC(struct cm_apr_msg, 8, 8)
+#define CM_APR_AR_STATUS CM_FIELD8_LOC(struct cm_apr_msg, 9, 8)
+#define CM_APR_ADDITIONAL_INFORMATION CM_FIELD_MLOC(struct cm_apr_msg, 12, 576)
+#define CM_APR_ADDITIONAL_INFORMATION_SIZE 72
+#define CM_APR_PRIVATE_DATA CM_FIELD_MLOC(struct cm_apr_msg, 84, 1184)
+#define CM_APR_PRIVATE_DATA_SIZE 148
+
#endif /* _IBTA_VOL1_C12_H_ */