File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -451,16 +451,6 @@ int devPCIDisableInterrupt(const epicsPCIDevice *dev);
451451epicsShareFunc
452452const char * devPCIDeviceClassToString (int classId );
453453
454- /**
455- * @brief Optional callback invoked on PCI device hot-swap.
456- *
457- * This function pointer may be set to a custom handler that will be called
458- * when a PCI device is successfully reopened (e.g. after hot-swap).
459- *
460- * @param name Identifier or name of the reopened PCI device.
461- */
462- epicsShareExtern void (* devPCIonHotSwapHook )(const char * );
463-
464454#ifdef __cplusplus
465455} /* extern "C" */
466456#endif
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ struct osdPCIDevice {
104104
105105 epicsMutexId devLock ; /* guard access to isrs list */
106106
107+ //Optional callback invoked on PCI device hot-swap.
108+ void (* onHotSwapHook )(struct osdPCIDevice * dev );
109+
107110 ELLNODE node ;
108111
109112 ELLLIST isrs ; /* contains struct osdISR */
@@ -944,8 +947,6 @@ static int reopen_uio(struct osdPCIDevice *osd)
944947 return 0 ;
945948}
946949
947- epicsShareDef void (* devPCIonHotSwapHook )(const char * name ) = NULL ;
948-
949950static
950951void isrThread (void * arg )
951952{
@@ -997,7 +998,7 @@ void isrThread(void* arg)
997998 epicsMutexMustLock (osd -> devLock );
998999 if (reopen_uio (osd ) == 0 ) {
9991000 errlogPrintf ("isrThread '%s': Successfully reopened UIO device\n" , name );
1000- if (devPCIonHotSwapHook ) devPCIonHotSwapHook ( name );
1001+ if (osd -> onHotSwapHook ) osd -> onHotSwapHook ( osd );
10011002 } else {
10021003 errlogPrintf ("isrThread '%s': UIO reopen failed. Will retry.\n" , name );
10031004 }
You can’t perform that action at this time.
0 commit comments