File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -706,6 +706,32 @@ void pci_epc_linkup(struct pci_epc *epc)
706
706
}
707
707
EXPORT_SYMBOL_GPL (pci_epc_linkup );
708
708
709
+ /**
710
+ * pci_epc_linkdown() - Notify the EPF device that EPC device has dropped the
711
+ * connection with the Root Complex.
712
+ * @epc: the EPC device which has dropped the link with the host
713
+ *
714
+ * Invoke to Notify the EPF device that the EPC device has dropped the
715
+ * connection with the Root Complex.
716
+ */
717
+ void pci_epc_linkdown (struct pci_epc * epc )
718
+ {
719
+ struct pci_epf * epf ;
720
+
721
+ if (!epc || IS_ERR (epc ))
722
+ return ;
723
+
724
+ mutex_lock (& epc -> list_lock );
725
+ list_for_each_entry (epf , & epc -> pci_epf , list ) {
726
+ mutex_lock (& epf -> lock );
727
+ if (epf -> event_ops && epf -> event_ops -> link_down )
728
+ epf -> event_ops -> link_down (epf );
729
+ mutex_unlock (& epf -> lock );
730
+ }
731
+ mutex_unlock (& epc -> list_lock );
732
+ }
733
+ EXPORT_SYMBOL_GPL (pci_epc_linkdown );
734
+
709
735
/**
710
736
* pci_epc_init_notify() - Notify the EPF device that EPC device's core
711
737
* initialization is completed.
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ void pci_epc_destroy(struct pci_epc *epc);
203
203
int pci_epc_add_epf (struct pci_epc * epc , struct pci_epf * epf ,
204
204
enum pci_epc_interface_type type );
205
205
void pci_epc_linkup (struct pci_epc * epc );
206
+ void pci_epc_linkdown (struct pci_epc * epc );
206
207
void pci_epc_init_notify (struct pci_epc * epc );
207
208
void pci_epc_remove_epf (struct pci_epc * epc , struct pci_epf * epf ,
208
209
enum pci_epc_interface_type type );
Original file line number Diff line number Diff line change @@ -71,10 +71,12 @@ struct pci_epf_ops {
71
71
* struct pci_epf_event_ops - Callbacks for capturing the EPC events
72
72
* @core_init: Callback for the EPC initialization complete event
73
73
* @link_up: Callback for the EPC link up event
74
+ * @link_down: Callback for the EPC link down event
74
75
*/
75
76
struct pci_epc_event_ops {
76
77
int (* core_init )(struct pci_epf * epf );
77
78
int (* link_up )(struct pci_epf * epf );
79
+ int (* link_down )(struct pci_epf * epf );
78
80
};
79
81
80
82
/**
You can’t perform that action at this time.
0 commit comments