summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Burnicki <martin.burnicki@meinberg.de>2023-07-27 17:02:53 +0200
committerMartin Burnicki <martin.burnicki@meinberg.de>2023-07-27 17:02:53 +0200
commit48c5e6d0e96d28f3d2ba0262882ed58ab36c7b8f (patch)
tree3959b186159eae33e198dd6d48c14aae37cb1fee
parent084992756fe9093d531825c4c12e67c1e010995e (diff)
downloadmbgtools-lx-48c5e6d0e96d28f3d2ba0262882ed58ab36c7b8f.tar.gz
mbgtools-lx-48c5e6d0e96d28f3d2ba0262882ed58ab36c7b8f.zip
Use an explicit list of PCI devices supported by the kernel driver
There will be PCI devices with Meinberg vendor ID which aren't supported by this driver, so using the wildcard device ID isn't appropriate anymore. Also update some comments accordingly.
-rw-r--r--mbgclock/mbgclock_main.c47
-rw-r--r--mbglib/common/pcpsdrvr.h11
2 files changed, 52 insertions, 6 deletions
diff --git a/mbgclock/mbgclock_main.c b/mbgclock/mbgclock_main.c
index f810840..dafd33c 100644
--- a/mbgclock/mbgclock_main.c
+++ b/mbgclock/mbgclock_main.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgclock_main.c 1.44 2023/07/07 11:44:36 martin REL_M $
+ * $Id: mbgclock_main.c 1.45 2023/07/27 14:59:35 martin.burnicki REL_M $
*
* Description:
* Main file for the mbgclock driver for Linux which allows access to
@@ -12,6 +12,11 @@
*
* -----------------------------------------------------------------------
* $Log: mbgclock_main.c $
+ * Revision 1.45 2023/07/27 14:59:35 martin.burnicki
+ * Use an explicit list of PCI devices supported by this driver.
+ * There will be PCI devices with Meinberg vendor ID which aren't
+ * supported by this driver, so using the wildcard device ID isn't
+ * appropriate anymore.
* Revision 1.44 2023/07/07 11:44:36 martin
* Fixed build for kernel 6.4 and newer.
* Revision 1.43 2023/05/04 14:27:54 martin
@@ -2349,9 +2354,39 @@ void __devexit mbgclock_remove_pci_device( struct pci_dev *pci_dev )
+/**
+ * @brief Table of PCI devices supported by this driver.
+ *
+ * The table should be updated whenever a new PCI device
+ * is added to ::pcps_dev_type_ex list.
+ *
+ * @see ::pcps_dev_type_ex
+ */
static struct pci_device_id mbgclock_pci_tbl[] __devinitdata =
{
- { PCI_VENDOR_MEINBERG, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PCI32, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS167PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PCI509, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS168PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PCI510, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS169PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR510PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR167PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS170PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PCI511, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR511PCI, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PEX511, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR511PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS170PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PTP270PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_FRC511PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR170PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS180PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_TCR180PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_PZF180PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GLN180PEX, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GPS180AMC, PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_MEINBERG, PCI_DEV_GNS181PEX, PCI_ANY_ID, PCI_ANY_ID },
{ 0 }
};
@@ -2517,6 +2552,14 @@ void __devexit mbgclock_remove_usb_device( struct usb_interface *intf )
+/**
+ * @brief Table of USB devices supported by this driver.
+ *
+ * The table should be updated whenever a new USB device
+ * is added to ::pcps_dev_type_ex list.
+ *
+ * @see ::pcps_dev_type_ex
+ */
static struct usb_device_id mbgclock_usb_tbl[] __devinitdata =
{
// A wildcard product ID for USB devices does not seem to be supported
diff --git a/mbglib/common/pcpsdrvr.h b/mbglib/common/pcpsdrvr.h
index 06b4095..8457c0e 100644
--- a/mbglib/common/pcpsdrvr.h
+++ b/mbglib/common/pcpsdrvr.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: pcpsdrvr.h 1.65 2022/02/10 14:00:16 martin.burnicki REL_M $
+ * $Id: pcpsdrvr.h 1.66 2023/07/27 14:57:09 martin.burnicki REL_M $
*
* Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
*
@@ -10,6 +10,8 @@
*
* -----------------------------------------------------------------------
* $Log: pcpsdrvr.h $
+ * Revision 1.66 2023/07/27 14:57:09 martin.burnicki
+ * Updated some comments.
* Revision 1.65 2022/02/10 14:00:16 martin.burnicki
* Use a 32 bit status port value internally.
* Revision 1.64 2022/02/08 15:10:39 martin.burnicki
@@ -1118,7 +1120,6 @@ enum PCPS_ACCESS_MODES
_ext PCPS_DEV_TYPE_EX pcps_dev_type_ex[N_PCPS_DEV_TYPE]
#ifdef _DO_INIT
= {
- // Attention, the name is limited to PCPS_CLOCK_NAME_SZ, including terminating 0.
// CPU type 0 is the same as MBG_DEV_CPU_NAME_UNSPEC, but 0 is used here to make it more obvious.
// Devices with CPU type 0 don't support updating the firmware using the common flash utiliy, mbgflash.
{ { PCPS_TYPE_PC31, "PC31", 0, PCPS_REF_DCF, PCPS_BUS_ISA }, { 0 /* 80C31 */ } },
@@ -1161,8 +1162,10 @@ _ext PCPS_DEV_TYPE_EX pcps_dev_type_ex[N_PCPS_DEV_TYPE]
// NOTE If a new device is added here, don't forget to also add it
// to the Windows .inf file of supported PCI and USB devices,
- // and in case of USB to the table mbgclock_usb_tbl of the Linux
- // driver file mbgclock_main.c.
+ // and to the mbgclock_pci_tbl or mbgclock_usb_tbl table of the
+ // Linux driver file mbgclock_main.c.
+ // Note also that the name is limited to PCPS_CLOCK_NAME_SZ,
+ // including the terminating 0.
}
#endif
;