aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2011-01-28 19:04:18 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 12:02:20 -0500
commit70d53b046a6221e3ceb3bd8eaa807ef6a1c53762 (patch)
treef1ab4e0de20a8db091ea04df564a03a689698b40 /include
parentbaf9fdf076a8976431b5de565aef2b98816caecf (diff)
[SCSI] libfc: add hook to notify providers of local port changes
When an SCST provider is registered, it needs to know what local ports are available for configuration as targets. Add a notifier chain that is invoked when any local port that is added or deleted. Maintain a global list of local ports and add an interator function that calls a given function for every existing local port. This is used when first loading a provider. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/libfc.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a9aff25a399b..79d1c76b4269 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -763,6 +763,15 @@ struct fc_disc {
763 enum fc_disc_event); 763 enum fc_disc_event);
764}; 764};
765 765
766/*
767 * Local port notifier and events.
768 */
769extern struct blocking_notifier_head fc_lport_notifier_head;
770enum fc_lport_event {
771 FC_LPORT_EV_ADD,
772 FC_LPORT_EV_DEL,
773};
774
766/** 775/**
767 * struct fc_lport - Local port 776 * struct fc_lport - Local port
768 * @host: The SCSI host associated with a local port 777 * @host: The SCSI host associated with a local port
@@ -803,9 +812,10 @@ struct fc_disc {
803 * @lso_max: The maximum large offload send size 812 * @lso_max: The maximum large offload send size
804 * @fcts: FC-4 type mask 813 * @fcts: FC-4 type mask
805 * @lp_mutex: Mutex to protect the local port 814 * @lp_mutex: Mutex to protect the local port
806 * @list: Handle for list of local ports 815 * @list: Linkage on list of vport peers
807 * @retry_work: Handle to local port for delayed retry context 816 * @retry_work: Handle to local port for delayed retry context
808 * @prov: Pointers available for use by passive FC-4 providers 817 * @prov: Pointers available for use by passive FC-4 providers
818 * @lport_list: Linkage on module-wide list of local ports
809 */ 819 */
810struct fc_lport { 820struct fc_lport {
811 /* Associations */ 821 /* Associations */
@@ -862,6 +872,7 @@ struct fc_lport {
862 struct list_head list; 872 struct list_head list;
863 struct delayed_work retry_work; 873 struct delayed_work retry_work;
864 void *prov[FC_FC4_PROV_SIZE]; 874 void *prov[FC_FC4_PROV_SIZE];
875 struct list_head lport_list;
865}; 876};
866 877
867/** 878/**
@@ -1016,6 +1027,7 @@ struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize);
1016struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); 1027struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id);
1017int fc_lport_bsg_request(struct fc_bsg_job *); 1028int fc_lport_bsg_request(struct fc_bsg_job *);
1018void fc_lport_set_local_id(struct fc_lport *, u32 port_id); 1029void fc_lport_set_local_id(struct fc_lport *, u32 port_id);
1030void fc_lport_iterate(void (*func)(struct fc_lport *, void *), void *);
1019 1031
1020/* 1032/*
1021 * REMOTE PORT LAYER 1033 * REMOTE PORT LAYER