[SCSI] scsi_netlink: Add transport and LLD recieve and event support
authorJames Smart <James.Smart@Emulex.Com>
Fri, 8 Aug 2008 06:14:18 +0000 (02:14 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Oct 2008 16:46:13 +0000 (11:46 -0500)
commit22447be7d15aefcfab84e9bec4859a28198b0c62
tree7bb58323dfdbfbc85759c668a876b85d2084a3da
parent557cc476c04146ee610f4bc77bfe20ce1c823d7c
[SCSI] scsi_netlink: Add transport and LLD recieve and event support

This patch adds scsi netlink recieve and event support for transport
and scsi LLDD's.  It is a reimplementation of the patch posted last
week by David Somayajulu.
http://marc.info/?l=linux-scsi&m=121745486221819&w=2

There are a few things done differently:

- Transport support is included

- Event delivery is included

- The vendor message is now its own unique message type, considered
  part of the generic "SCSI Transport".

- LLDD entry points are now registered rather than included in the
  scsi_host_template.

  Background: When I started to implement the event handler via template,
  I had to either: muck up scsi_add_host and scsi_remove_host;  or have
  the event handler search all possible shosts. Neither was acceptable.
  Moving to a registration solves this, and also limits the scope of
  the changes to something that could be backported to a distro without
  breaking an already-released-distro kabi. However, I admit it isn't
  as elegant, as the passing of the LLDD host template in the
  registration and the complexity around dynamic add/remove shows.

- The receive path was augmented to require a unique identifier for
  the LLDD before the message was allowed to be handed off to the
  driver. Given how quickly very fatal errors occur if there's msg
  mismatches (which I saw in testing my own tools :), I believe this
  to be a very good thing. The id plays off the vendor id scheme already
  introduced for the vendor unique event messages used by FC.
  Additionally, the id use as the basis of the registration/deregistration.

- Send assist functions, for both the transport and LLDDs are included.

[fujita.tomonori@lab.ntt.co.jp: fix missing cast]
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_netlink.c
include/scsi/scsi_netlink.h