From 337b7e372eb74f97b976f8240030bd1b8f19517d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 16 Feb 2016 19:35:02 +0000 Subject: [PATCH] ib_srpt: Port to Linux kernel v4.5 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6797 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 637878394..d4fdcbe7a 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -593,6 +593,9 @@ static void srpt_mad_send_handler(struct ib_mad_agent *mad_agent, * srpt_mad_recv_handler() - MAD reception callback function. */ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) + struct ib_mad_send_buf *send_buf, +#endif struct ib_mad_recv_wc *mad_wc) { struct srpt_port *sport = (struct srpt_port *)mad_agent->context; @@ -4206,11 +4209,15 @@ static void srpt_add_one(struct ib_device *device) sdev->device = device; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) ret = ib_query_device(device, &sdev->dev_attr); if (ret) { pr_err("ib_query_device() failed: %d\n", ret); goto free_dev; } +#else + sdev->dev_attr = device->attrs; +#endif sdev->pd = ib_alloc_pd(device); if (IS_ERR(sdev->pd)) {