diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-08-18 17:30:09 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-09-02 16:33:49 -0400 |
commit | 84314fd4740ad73550c76dee4a9578979d84af48 (patch) | |
tree | f8902dbe4134f9bab4f6886bb6c0b2a30797ceaa /include/scsi/scsi_transport_fc.h | |
parent | deb81d80ba27da8dfabc29ccb5977db8f4942a0a (diff) |
[SCSI] SCSI and FC Transport: add netlink support for posting of transport events
This patch formally adds support for the posting of FC events via netlink.
It is a followup to the original RFC at:
http://marc.theaimsgroup.com/?l=linux-scsi&m=114530667923464&w=2
and the initial posting at:
http://marc.theaimsgroup.com/?l=linux-scsi&m=115507374832500&w=2
The patch has been updated to optimize the send path, per the discussions
in the initial posting.
Per discussions at the Storage Summit and at OLS, we are to use netlink for
async events from transports. Also per discussions, to avoid a netlink
protocol per transport, I've create a single NETLINK_SCSITRANSPORT protocol,
which can then be used by all transports.
This patch:
- Creates new files scsi_netlink.c and scsi_netlink.h, which contains the
single and shared definitions for the SCSI Transport. It is tied into the
base SCSI subsystem intialization.
Contains a single interface routine, scsi_send_transport_event(), for a
transport to send an event (via multicast to a protocol specific group).
- Creates a new scsi_netlink_fc.h file, which contains the FC netlink event
messages
- Adds 3 new routines to the fc transport:
fc_get_event_number() - to get a FC event #
fc_host_post_event() - to send a simple FC event (32 bits of data)
fc_host_post_vendor_event() - to send a Vendor unique event, with
arbitrary amounts of data.
Note: the separation of event number allows for a LLD to send a standard
event, followed by vendor-specific data for the event.
Note: This patch assumes 2 prior fc transport patches have been installed:
http://marc.theaimsgroup.com/?l=linux-scsi&m=115555807316329&w=2
http://marc.theaimsgroup.com/?l=linux-scsi&m=115581614930261&w=2
Sorry - next time I'll do something like making these individual
patches of the same posting when I know they'll be posted closely
together.
Signed-off-by: James Smart <James.Smart@emulex.com>
Tidy up configuration not to make SCSI always select NET
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi/scsi_transport_fc.h')
-rw-r--r-- | include/scsi/scsi_transport_fc.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index c74be5dabfeb..f91c5358af3a 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <scsi/scsi.h> | 31 | #include <scsi/scsi.h> |
32 | #include <scsi/scsi_netlink.h> | ||
32 | 33 | ||
33 | struct scsi_transport_template; | 34 | struct scsi_transport_template; |
34 | 35 | ||
@@ -284,6 +285,30 @@ struct fc_host_statistics { | |||
284 | 285 | ||
285 | 286 | ||
286 | /* | 287 | /* |
288 | * FC Event Codes - Polled and Async, following FC HBAAPI v2.0 guidelines | ||
289 | */ | ||
290 | |||
291 | /* | ||
292 | * fc_host_event_code: If you alter this, you also need to alter | ||
293 | * scsi_transport_fc.c (for the ascii descriptions). | ||
294 | */ | ||
295 | enum fc_host_event_code { | ||
296 | FCH_EVT_LIP = 0x1, | ||
297 | FCH_EVT_LINKUP = 0x2, | ||
298 | FCH_EVT_LINKDOWN = 0x3, | ||
299 | FCH_EVT_LIPRESET = 0x4, | ||
300 | FCH_EVT_RSCN = 0x5, | ||
301 | FCH_EVT_ADAPTER_CHANGE = 0x103, | ||
302 | FCH_EVT_PORT_UNKNOWN = 0x200, | ||
303 | FCH_EVT_PORT_OFFLINE = 0x201, | ||
304 | FCH_EVT_PORT_ONLINE = 0x202, | ||
305 | FCH_EVT_PORT_FABRIC = 0x204, | ||
306 | FCH_EVT_LINK_UNKNOWN = 0x500, | ||
307 | FCH_EVT_VENDOR_UNIQUE = 0xffff, | ||
308 | }; | ||
309 | |||
310 | |||
311 | /* | ||
287 | * FC Local Port (Host) Attributes | 312 | * FC Local Port (Host) Attributes |
288 | * | 313 | * |
289 | * Attributes are based on HBAAPI V2.0 definitions. | 314 | * Attributes are based on HBAAPI V2.0 definitions. |
@@ -526,5 +551,14 @@ struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost, | |||
526 | void fc_remote_port_delete(struct fc_rport *rport); | 551 | void fc_remote_port_delete(struct fc_rport *rport); |
527 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); | 552 | void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles); |
528 | int scsi_is_fc_rport(const struct device *); | 553 | int scsi_is_fc_rport(const struct device *); |
554 | u32 fc_get_event_number(void); | ||
555 | void fc_host_post_event(struct Scsi_Host *shost, u32 event_number, | ||
556 | enum fc_host_event_code event_code, u32 event_data); | ||
557 | void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, | ||
558 | u32 data_len, char * data_buf, u32 vendor_id); | ||
559 | /* Note: when specifying vendor_id to fc_host_post_vendor_event() | ||
560 | * be sure to read the Vendor Type and ID formatting requirements | ||
561 | * specified in scsi_netlink.h | ||
562 | */ | ||
529 | 563 | ||
530 | #endif /* SCSI_TRANSPORT_FC_H */ | 564 | #endif /* SCSI_TRANSPORT_FC_H */ |