mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Bounine <alexandre.bounine@idt.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexandre Bounine <alexandre.bounine@idt.com>,
	Matt Porter <mporter@kernel.crashing.org>,
	Aurelien Jacquiot <a-jacquiot@ti.com>,
	Andre van Herk <andre.van.herk@prodrive-technologies.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 08/30] rapidio/tsi721: add query_mport callback
Date: Fri,  5 Feb 2016 18:19:24 -0500	[thread overview]
Message-ID: <1454714386-15259-9-git-send-email-alexandre.bounine@idt.com> (raw)
In-Reply-To: <1454714386-15259-1-git-send-email-alexandre.bounine@idt.com>

Add device-specific implementation of query_mport callback function.

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
Cc: linux-kernel@vger.kernel.org
---
 drivers/rapidio/devices/tsi721.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index d463d2c..cd40f0f 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2288,6 +2288,39 @@ static int tsi721_messages_init(struct tsi721_device *priv)
 }
 
 /**
+ * tsi721_query_mport - Fetch inbound message from the Tsi721 MSG Queue
+ * @mport: Master port implementing the Inbound Messaging Engine
+ * @mbox: Inbound mailbox number
+ *
+ * Returns pointer to the message on success or NULL on failure.
+ */
+static int tsi721_query_mport(struct rio_mport *mport,
+			      struct rio_mport_attr *attr)
+{
+	struct tsi721_device *priv = mport->priv;
+	u32 rval;
+
+	rval = ioread32(priv->regs + (0x100 + RIO_PORT_N_ERR_STS_CSR(0)));
+	if (rval & RIO_PORT_N_ERR_STS_PORT_OK) {
+		rval = ioread32(priv->regs + (0x100 + RIO_PORT_N_CTL2_CSR(0)));
+		attr->link_speed = (rval & RIO_PORT_N_CTL2_SEL_BAUD) >> 28;
+		rval = ioread32(priv->regs + (0x100 + RIO_PORT_N_CTL_CSR(0)));
+		attr->link_width = (rval & RIO_PORT_N_CTL_IPW) >> 27;
+	} else
+		attr->link_speed = RIO_LINK_DOWN;
+
+#ifdef CONFIG_RAPIDIO_DMA_ENGINE
+	attr->flags = RIO_MPORT_DMA | RIO_MPORT_DMA_SG;
+	attr->dma_max_sge = 0;
+	attr->dma_max_size = TSI721_BDMA_MAX_BCOUNT;
+	attr->dma_align = 0;
+#else
+	attr->flags = 0;
+#endif
+	return 0;
+}
+
+/**
  * tsi721_disable_ints - disables all device interrupts
  * @priv: pointer to tsi721 private data
  */
@@ -2372,6 +2405,7 @@ static int tsi721_setup_mport(struct tsi721_device *priv)
 	ops->get_inb_message = tsi721_get_inb_message;
 	ops->map_inb = tsi721_rio_map_inb_mem;
 	ops->unmap_inb = tsi721_rio_unmap_inb_mem;
+	ops->query_mport = tsi721_query_mport;
 
 	mport = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
 	if (!mport) {
-- 
1.7.8.4

  parent reply	other threads:[~2016-02-05 23:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 23:19 [PATCH 00/30] rapidio: mport character driver and subsystem updates Alexandre Bounine
2016-02-05 23:19 ` [PATCH 01/30] rapidio/rionet: fix deadlock on SMP Alexandre Bounine
2016-02-05 23:19 ` [PATCH 02/30] rapidio/rionet: add capability to change MTU Alexandre Bounine
2016-02-05 23:19 ` [PATCH 03/30] rapidio/tsi721: fix hardcoded MRRS setting Alexandre Bounine
2016-02-05 23:19 ` [PATCH 04/30] rapidio/tsi721: add check for overlapped IB window mappings Alexandre Bounine
2016-02-05 23:19 ` [PATCH 05/30] rapidio/tsi721: add option to configure direct mapping of IB window Alexandre Bounine
2016-02-05 23:19 ` [PATCH 06/30] rapidio/tsi721_dma: fix pending transaction queue handling Alexandre Bounine
2016-02-05 23:19 ` [PATCH 07/30] rapidio: add query_mport operation Alexandre Bounine
2016-02-05 23:19 ` Alexandre Bounine [this message]
2016-02-05 23:19 ` [PATCH 09/30] rapidio: add shutdown notification for RapidIO devices Alexandre Bounine
2016-02-05 23:19 ` [PATCH 10/30] rapidio/tsi721: add shutdown notification callback Alexandre Bounine
2016-02-05 23:19 ` [PATCH 11/30] rapidio/rionet: add shutdown event handling Alexandre Bounine
2016-02-05 23:19 ` [PATCH 12/30] rapidio: rework common RIO device add/delete routines Alexandre Bounine
2016-02-05 23:19 ` [PATCH 13/30] rapidio: move net allocation into core code Alexandre Bounine
2016-02-05 23:19 ` [PATCH 14/30] rapidio: add core mport removal support Alexandre Bounine
2016-02-05 23:19 ` [PATCH 15/30] rapidio/tsi721: add HW specific mport removal Alexandre Bounine
2016-02-05 23:19 ` [PATCH 16/30] powerpc/fsl_rio: changes to mport registration Alexandre Bounine
2016-02-05 23:19 ` [PATCH 17/30] rapidio/rionet: add locking into add/remove device Alexandre Bounine
2016-02-05 23:19 ` [PATCH 18/30] rapidio/rionet: add mport removal handling Alexandre Bounine
2016-02-05 23:19 ` [PATCH 19/30] rapidio: add lock protection for doorbell list Alexandre Bounine
2016-02-05 23:19 ` [PATCH 20/30] rapidio: move rio_local_set_device_id function to the common core Alexandre Bounine
2016-02-05 23:19 ` [PATCH 21/30] rapidio: move rio_pw_enable into core code Alexandre Bounine
2016-02-05 23:19 ` [PATCH 22/30] rapidio: add global inbound port write interfaces Alexandre Bounine
2016-02-08 21:18   ` Andrew Morton
2016-02-09 13:56     ` Bounine, Alexandre
2016-02-05 23:19 ` [PATCH 23/30] rapidio/tsi721: fix locking in OB_MSG processing Alexandre Bounine
2016-02-05 23:19 ` [PATCH 24/30] rapidio: add outbound window support Alexandre Bounine
2016-02-05 23:19 ` [PATCH 25/30] rapidio/tsi721: add outbound windows mapping support Alexandre Bounine
2016-02-05 23:19 ` [PATCH 26/30] rapidio/tsi721: add filtered debug output Alexandre Bounine
2016-02-05 23:19 ` [PATCH 27/30] rapidio/tsi721_dma: update error reporting from prep_sg callback Alexandre Bounine
2016-02-05 23:19 ` [PATCH 28/30] rapidio/tsi721_dma: fix synchronization issues Alexandre Bounine
2016-02-05 23:19 ` [PATCH 29/30] rapidio/tsi721_dma: fix hardware error handling Alexandre Bounine
2016-02-05 23:19 ` [PATCH 30/30] rapidio: add mport char device driver Alexandre Bounine
2016-04-05 10:36   ` Gabriel Laskar
2016-04-05 11:45     ` Bounine, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454714386-15259-9-git-send-email-alexandre.bounine@idt.com \
    --to=alexandre.bounine@idt.com \
    --cc=a-jacquiot@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=andre.van.herk@prodrive-technologies.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®