iflib drivers: Constify PCI ID LUTs

Since d49e83eac3, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.
This commit is contained in:
Marius Strobl 2023-08-16 18:49:34 +02:00
parent ece58eaf50
commit 51e235148a
14 changed files with 20 additions and 20 deletions

View File

@ -137,7 +137,7 @@ static struct resource_spec axgbe_pci_mac_spec[] = {
{ -1, 0 }
};
static pci_vendor_info_t axgbe_vendor_info_array[] =
static const pci_vendor_info_t axgbe_vendor_info_array[] =
{
PVID(0x1022, 0x1458, "AMD 10 Gigabit Ethernet Driver"),
PVID(0x1022, 0x1459, "AMD 10 Gigabit Ethernet Driver"),

View File

@ -206,7 +206,7 @@
#define BNXT_MIN_FRAME_SIZE 52 /* Frames must be padded to this size for some A0 chips */
extern char bnxt_driver_version[];
extern const char bnxt_driver_version[];
typedef void (*bnxt_doorbell_tx)(void *, uint16_t idx);
typedef void (*bnxt_doorbell_rx)(void *, uint16_t idx);
typedef void (*bnxt_doorbell_rx_cq)(void *, bool);

View File

@ -67,7 +67,7 @@
* PCI Device ID Table
*/
static pci_vendor_info_t bnxt_vendor_info_array[] =
static const pci_vendor_info_t bnxt_vendor_info_array[] =
{
PVID(BROADCOM_VENDOR_ID, BCM57301,
"Broadcom BCM57301 NetXtreme-C 10Gb Ethernet Controller"),
@ -300,7 +300,7 @@ static driver_t bnxt_iflib_driver = {
*/
#define BNXT_DRIVER_VERSION "2.20.0.1"
char bnxt_driver_version[] = BNXT_DRIVER_VERSION;
const char bnxt_driver_version[] = BNXT_DRIVER_VERSION;
extern struct if_txrx bnxt_txrx;
static struct if_shared_ctx bnxt_sctx_init = {
.isc_magic = IFLIB_MAGIC,

View File

@ -36,8 +36,8 @@
/*********************************************************************
* Driver version:
*********************************************************************/
char em_driver_version[] = "7.7.8-fbsd";
char igb_driver_version[] = "2.5.19-fbsd";
static const char em_driver_version[] = "7.7.8-fbsd";
static const char igb_driver_version[] = "2.5.19-fbsd";
/*********************************************************************
* PCI Device ID Table
@ -49,7 +49,7 @@ char igb_driver_version[] = "2.5.19-fbsd";
* { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
*********************************************************************/
static pci_vendor_info_t em_vendor_info_array[] =
static const pci_vendor_info_t em_vendor_info_array[] =
{
/* Intel(R) - lem-class legacy devices */
PVID(0x8086, E1000_DEV_ID_82540EM, "Intel(R) Legacy PRO/1000 MT 82540EM"),
@ -214,7 +214,7 @@ static pci_vendor_info_t em_vendor_info_array[] =
PVID_END
};
static pci_vendor_info_t igb_vendor_info_array[] =
static const pci_vendor_info_t igb_vendor_info_array[] =
{
/* Intel(R) - igb-class devices */
PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 82575EB (Copper)"),

View File

@ -125,7 +125,7 @@ static int enetc_ctrl_send(struct enetc_softc*,
static const char enetc_driver_version[] = "1.0.0";
static pci_vendor_info_t enetc_vendor_info_array[] = {
static const pci_vendor_info_t enetc_vendor_info_array[] = {
PVID(PCI_VENDOR_FREESCALE, ENETC_DEV_ID_PF,
"Freescale ENETC PCIe Gigabit Ethernet Controller"),
PVID_END

View File

@ -57,7 +57,7 @@
static SYSCTL_NODE(_hw, OID_AUTO, enic, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"ENIC");
static pci_vendor_info_t enic_vendor_info_array[] =
static const pci_vendor_info_t enic_vendor_info_array[] =
{
PVID(CISCO_VENDOR_ID, PCI_DEVICE_ID_CISCO_VIC_ENET,
DRV_DESCRIPTION),

View File

@ -66,7 +66,7 @@ const char iavf_driver_version[] = "3.0.26-k";
* to most-generic entry; e.g. PVIDV_OEM()s for a device ID must come before
* the PVIDV() for it.
*/
static pci_vendor_info_t iavf_vendor_info_array[] = {
static const pci_vendor_info_t iavf_vendor_info_array[] = {
PVIDV(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF,
"Intel(R) Ethernet Virtual Function 700 Series"),
PVIDV(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_VF,

View File

@ -85,7 +85,7 @@ const uint8_t ice_rc_version = 0;
* to most-generic entry; e.g. PVIDV_OEM()s for a device ID must come before
* the PVIDV() for it.
*/
static pci_vendor_info_t ice_vendor_info_array[] = {
static const pci_vendor_info_t ice_vendor_info_array[] = {
PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_BACKPLANE,
"Intel(R) Ethernet Controller E810-C for backplane"),
PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP,

View File

@ -46,7 +46,7 @@
* { Vendor ID, Device ID, String }
*********************************************************************/
static pci_vendor_info_t igc_vendor_info_array[] =
static const pci_vendor_info_t igc_vendor_info_array[] =
{
/* Intel(R) PRO/1000 Network Connection - igc */
PVID(0x8086, IGC_DEV_ID_I225_LM, "Intel(R) Ethernet Controller I225-LM"),

View File

@ -45,7 +45,7 @@
/************************************************************************
* Driver version
************************************************************************/
char ixgbe_driver_version[] = "4.0.1-k";
static const char ixgbe_driver_version[] = "4.0.1-k";
/************************************************************************
* PCI Device ID Table
@ -56,7 +56,7 @@ char ixgbe_driver_version[] = "4.0.1-k";
*
* { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
************************************************************************/
static pci_vendor_info_t ixgbe_vendor_info_array[] =
static const pci_vendor_info_t ixgbe_vendor_info_array[] =
{
PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, "Intel(R) 82598EB AF (Dual Fiber)"),
PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, "Intel(R) 82598EB AF (Fiber)"),

View File

@ -45,7 +45,7 @@
/************************************************************************
* Driver version
************************************************************************/
char ixv_driver_version[] = "2.0.1-k";
static const char ixv_driver_version[] = "2.0.1-k";
/************************************************************************
* PCI Device ID Table
@ -56,7 +56,7 @@ char ixv_driver_version[] = "2.0.1-k";
*
* { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
************************************************************************/
static pci_vendor_info_t ixv_vendor_info_array[] =
static const pci_vendor_info_t ixv_vendor_info_array[] =
{
PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, "Intel(R) X520 82599 Virtual Function"),
PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, "Intel(R) X540 Virtual Function"),

View File

@ -63,7 +63,7 @@
* ( Vendor ID, Device ID, Branding String )
*********************************************************************/
static pci_vendor_info_t ixl_vendor_info_array[] =
static const pci_vendor_info_t ixl_vendor_info_array[] =
{
PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) Ethernet Controller X710 for 10GbE SFP+"),
PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet Controller XL710 for 40GbE backplane"),

View File

@ -86,7 +86,7 @@
#include "ifdi_if.h"
#include "miibus_if.h"
static pci_vendor_info_t mgb_vendor_info_array[] = {
static const pci_vendor_info_t mgb_vendor_info_array[] = {
PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7430_DEVICE_ID,
"Microchip LAN7430 PCIe Gigabit Ethernet Controller"),
PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7431_DEVICE_ID,

View File

@ -77,7 +77,7 @@
#define VMXNET3_VMWARE_VENDOR_ID 0x15AD
#define VMXNET3_VMWARE_DEVICE_ID 0x07B0
static pci_vendor_info_t vmxnet3_vendor_info_array[] =
static const pci_vendor_info_t vmxnet3_vendor_info_array[] =
{
PVID(VMXNET3_VMWARE_VENDOR_ID, VMXNET3_VMWARE_DEVICE_ID, "VMware VMXNET3 Ethernet Adapter"),
/* required last entry */