1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * IBM ASM Service Processor Device Driver
5 * Copyright (C) IBM Corporation, 2004
7 * Author: Max Asböck <amax@us.ibm.com>
16 u8 initiator_and_target
;
19 u32 initiator_context
;
23 #define I2O_HEADER_TEMPLATE \
25 .message_flags = 0x00, \
28 .initiator_and_target = 0x40, \
30 .initiator_context = 0x0 }
32 #define I2O_MESSAGE_SIZE 0x1000
33 #define I2O_COMMAND_SIZE (I2O_MESSAGE_SIZE - sizeof(struct i2o_header))
37 struct i2o_header header
;
42 static inline unsigned short outgoing_message_size(unsigned int data_size
)
45 unsigned short i2o_size
;
47 if (data_size
> I2O_COMMAND_SIZE
)
48 data_size
= I2O_COMMAND_SIZE
;
50 size
= sizeof(struct i2o_header
) + data_size
;
52 i2o_size
= size
/ sizeof(u32
);
54 if (size
% sizeof(u32
))
60 static inline u32
incoming_data_size(struct i2o_message
*i2o_message
)
62 return (sizeof(u32
) * i2o_message
->header
.message_size
);