summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r--drivers/s390/net/qeth_core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index c1292d3420a2..2fee41f773a1 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -560,6 +560,7 @@ enum qeth_prot_versions {
enum qeth_cmd_buffer_state {
BUF_STATE_FREE,
BUF_STATE_LOCKED,
+ BUF_STATE_MALLOC,
};
enum qeth_cq {
@@ -579,6 +580,7 @@ struct qeth_channel;
struct qeth_cmd_buffer {
enum qeth_cmd_buffer_state state;
+ unsigned int length;
struct qeth_channel *channel;
struct qeth_reply *reply;
long timeout;
@@ -608,6 +610,13 @@ struct qeth_channel {
int io_buf_no;
};
+static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob)
+{
+ if (iob->state != BUF_STATE_MALLOC)
+ return iob->channel->ccw;
+ return (struct ccw1 *)(iob->data + ALIGN(iob->length, 8));
+}
+
static inline bool qeth_trylock_channel(struct qeth_channel *channel)
{
return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0;