From: Mike Christie <michaelc@cs.wisc.edu>
To: David Somayajulu <david.somayajulu@qlogic.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
David Wagner <david.wagner@qlogic.com>
Subject: Re: [PATCH 1/2] scsi:netlink support in scsi and fc transports for hba specific messages
Date: Thu, 31 Jul 2008 14:56:36 -0500 [thread overview]
Message-ID: <489218F4.8020203@cs.wisc.edu> (raw)
In-Reply-To: <1217454832.25166.22.camel@localhost.localdomain>
David Somayajulu wrote:
> This patch adds support to the scsi transport layer for passing hba specific netlink messages to a low level driver. Also support is added to the fc transport, to enable an FC hba driver to post netlink message to a specific user process.
>
> Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com>
> ---
> drivers/scsi/scsi_netlink.c | 13 +++++++
> drivers/scsi/scsi_transport_fc.c | 72 ++++++++++++++++++++++++++++++++++++++
> include/scsi/scsi_host.h | 6 +++
> include/scsi/scsi_netlink.h | 3 +-
> include/scsi/scsi_transport_fc.h | 2 +
> 5 files changed, 95 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c
> index ae7ed9a..3bc85c9 100644
> --- a/drivers/scsi/scsi_netlink.c
> +++ b/drivers/scsi/scsi_netlink.c
> @@ -24,6 +24,7 @@
> #include <net/sock.h>
> #include <net/netlink.h>
>
> +#include <scsi/scsi_host.h>
> #include <scsi/scsi_netlink.h>
> #include "scsi_priv.h"
>
> @@ -47,6 +48,7 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> struct scsi_nl_hdr *hdr;
> uint32_t rlen;
> int err;
> + struct Scsi_Host *shost;
>
> while (skb->len >= NLMSG_SPACE(0)) {
> err = 0;
> @@ -89,6 +91,17 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> /*
> * We currently don't support anyone sending us a message
> */
> + if (hdr->msgtype == SCSI_NL_HOST_PRIVATE) {
> + shost = scsi_host_lookup(hdr->host_no);
> + if (!shost) {
> + printk(KERN_ERR "%s: scsi_host_lookup failed "
> + "host no %u\n", __FUNCTION__, hdr->host_no);
> + } else if (shost->hostt->netlink_rcv_msg) {
> + err = shost->hostt->netlink_rcv_msg(shost,
> + (void *)((char *)hdr+sizeof(*hdr)),
> + hdr->msglen, NETLINK_CREDS(skb)->pid);
> + }
> + }
Finally getting this done :) Thanks!
If shost is not null you need to do a scsi_host_put hen you are done
with the host.
next prev parent reply other threads:[~2008-07-31 19:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 21:53 [PATCH 1/2] scsi:netlink support in scsi and fc transports for hba specific messages David Somayajulu
2008-07-31 2:09 ` [PATCH 1/2] scsi:netlink support in scsi and fc transports for hbaspecific messages James.Smart
2008-07-31 18:58 ` David Somayajulu
2008-08-01 0:35 ` James.Smart
2008-08-01 18:03 ` David Somayajulu
2008-07-31 19:56 ` Mike Christie [this message]
2008-07-31 3:35 ` [PATCH 1/2] scsi:netlink support in scsi and fc transports for hba specific messages David Somayajulu
2008-08-02 18:09 ` [PATCH 1/2] scsi:netlink support in scsi and fc transports forhba " James.Smart
2008-08-03 6:16 ` David Somayajulu
2008-08-04 7:18 ` Mike Christie
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=489218F4.8020203@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=david.somayajulu@qlogic.com \
--cc=david.wagner@qlogic.com \
--cc=linux-scsi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.