From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 071ACC94E for ; Fri, 26 Jun 2015 16:27:07 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 26 Jun 2015 07:27:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,685,1427785200"; d="scan'208";a="514684527" Received: from lwang14-mobl6.amr.corp.intel.com ([10.127.184.59]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jun 2015 07:27:08 -0700 From: Liang-Min Larry Wang To: dev@dpdk.org Date: Fri, 26 Jun 2015 10:26:47 -0400 Message-Id: <1435328807-15788-6-git-send-email-liang-min.wang@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435328807-15788-1-git-send-email-liang-min.wang@intel.com> References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com> <1435328807-15788-1-git-send-email-liang-min.wang@intel.com> Subject: [dpdk-dev] [PATCH v8 5/5] Changed register tables to const. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 14:27:09 -0000 From: "Andrew G. Harvey" Signed-off-by: Andrew G. Harvey --- drivers/net/e1000/igb_ethdev.c | 8 ++++---- drivers/net/e1000/igb_regs.h | 28 ++++++++++++------------- drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++------ drivers/net/ixgbe/ixgbe_regs.h | 44 ++++++++++++++++++++-------------------- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index cde6840..1b1a596 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -3709,7 +3709,7 @@ eth_igb_get_reg_length(struct rte_eth_dev *dev __rte_unused) { int count = 0; int g_ind = 0; - reg_info *reg_group; + const reg_info *reg_group; reg_group = igb_regs[g_ind++]; while(reg_group) { @@ -3725,7 +3725,7 @@ igbvf_get_reg_length(struct rte_eth_dev *dev __rte_unused) { int count = 0; int g_ind = 0; - reg_info *reg_group; + const reg_info *reg_group; reg_group = igbvf_regs[g_ind++]; while(reg_group) { @@ -3744,7 +3744,7 @@ eth_igb_get_regs(struct rte_eth_dev *dev, uint32_t *regs_buff = regs->buf; int g_ind = 0; int count = 0; - reg_info *reg_group; + const reg_info *reg_group; /* * Support only full register dump @@ -3772,7 +3772,7 @@ igbvf_get_regs(struct rte_eth_dev *dev, uint32_t *regs_buff = regs->buf; int g_ind = 0; int count = 0; - reg_info *reg_group; + const reg_info *reg_group; /* * Support only full register dump diff --git a/drivers/net/e1000/igb_regs.h b/drivers/net/e1000/igb_regs.h index 14602e8..c8adc49 100644 --- a/drivers/net/e1000/igb_regs.h +++ b/drivers/net/e1000/igb_regs.h @@ -42,7 +42,7 @@ typedef struct _reg_info { const char *name; } reg_info; -static reg_info igb_regs_general[] = { +static const reg_info igb_regs_general[] = { {E1000_CTRL, 1, 1, "E1000_CTRL"}, {E1000_STATUS, 1, 1, "E1000_STATUS"}, {E1000_CTRL_EXT, 1, 1, "E1000_CTRL_EXT"}, @@ -58,12 +58,12 @@ static reg_info igb_regs_general[] = { {0, 0, 0, ""} }; -static reg_info igb_regs_nvm [] = { +static const reg_info igb_regs_nvm [] = { {E1000_EECD, 1, 1, "E1000_EECD"}, {0, 0, 0, ""} }; -static reg_info igb_regs_interrupt [] = { +static const reg_info igb_regs_interrupt [] = { {E1000_EICS, 1, 1, "E1000_EICS"}, {E1000_EIMS, 1, 1, "E1000_EIMS"}, {E1000_EIMC, 1, 1, "E1000_EIMC"}, @@ -81,7 +81,7 @@ static reg_info igb_regs_interrupt [] = { {0, 0, 0, ""} }; -static reg_info igb_regs_fctl[] = { +static const reg_info igb_regs_fctl[] = { {E1000_FCAL, 1, 1, "E1000_FCAL"}, {E1000_FCAH, 1, 1, "E1000_FCAH"}, {E1000_FCTTV, 1, 1, "E1000_FCTTV"}, @@ -91,7 +91,7 @@ static reg_info igb_regs_fctl[] = { {0, 0, 0, ""} }; -static reg_info igb_regs_rxdma[] = { +static const reg_info igb_regs_rxdma[] = { {E1000_RDBAL(0), 4, 0x100, "E1000_RDBAL"}, {E1000_RDBAH(0), 4, 0x100, "E1000_RDBAH"}, {E1000_RDLEN(0), 4, 0x100, "E1000_RDLEN"}, @@ -103,7 +103,7 @@ static reg_info igb_regs_rxdma[] = { {0, 0, 0, ""} }; -static reg_info igb_regs_rx [] = { +static const reg_info igb_regs_rx [] = { {E1000_RCTL, 1, 1, "E1000_RCTL"}, {E1000_RXCSUM, 1, 1, "E1000_RXCSUM"}, {E1000_RLPML, 1, 1, "E1000_RLPML"}, @@ -115,7 +115,7 @@ static reg_info igb_regs_rx [] = { {0, 0, 0, ""} }; -static reg_info igb_regs_tx [] = { +static const reg_info igb_regs_tx [] = { {E1000_TCTL, 1, 1, "E1000_TCTL"}, {E1000_TCTL_EXT, 1, 1, "E1000_TCTL_EXT"}, {E1000_TIPG, 1, 1, "E1000_TIPG"}, @@ -136,7 +136,7 @@ static reg_info igb_regs_tx [] = { {0, 0, 0, ""} }; -static reg_info igb_regs_wakeup [] = { +static const reg_info igb_regs_wakeup [] = { {E1000_WUC, 1, 1, "E1000_WUC"}, {E1000_WUFC, 1, 1, "E1000_WUFC"}, {E1000_WUS, 1, 1, "E1000_WUS"}, @@ -151,7 +151,7 @@ static reg_info igb_regs_wakeup [] = { {0, 0, 0, ""} }; -static reg_info igb_regs_mac [] = { +static const reg_info igb_regs_mac [] = { {E1000_PCS_CFG0, 1, 1, "E1000_PCS_CFG0"}, {E1000_PCS_LCTL, 1, 1, "E1000_PCS_LCTL"}, {E1000_PCS_LSTAT, 1, 1, "E1000_PCS_LSTAT"}, @@ -162,13 +162,13 @@ static reg_info igb_regs_mac [] = { {0, 0, 0, ""} }; -static reg_info* igb_regs[] = { igb_regs_general, igb_regs_nvm, +static const reg_info* igb_regs[] = { igb_regs_general, igb_regs_nvm, igb_regs_interrupt, igb_regs_fctl, igb_regs_rxdma, igb_regs_rx, igb_regs_tx, igb_regs_wakeup, igb_regs_mac, NULL}; -static reg_info* igbvf_regs[] = { igb_regs_general, +static const reg_info* igbvf_regs[] = { igb_regs_general, /* * FIXME: reading igb_regs_interrupt results side-effect which doesn't work with VFIO * @@ -177,7 +177,7 @@ static reg_info* igbvf_regs[] = { igb_regs_general, igb_regs_rxdma, igb_regs_tx, NULL}; static inline int -igb_read_regs(struct e1000_hw *hw, reg_info *reg, uint32_t *reg_buf) +igb_read_regs(struct e1000_hw *hw, const reg_info *reg, uint32_t *reg_buf) { unsigned int i; @@ -188,7 +188,7 @@ igb_read_regs(struct e1000_hw *hw, reg_info *reg, uint32_t *reg_buf) }; static inline int -igb_reg_group_count(reg_info *regs) +igb_reg_group_count(const reg_info *regs) { int count = 0; int i = 0; @@ -201,7 +201,7 @@ igb_reg_group_count(reg_info *regs) }; static inline int -igb_read_regs_group(struct rte_eth_dev *dev, uint32_t *reg_buf, reg_info *regs) +igb_read_regs_group(struct rte_eth_dev *dev, uint32_t *reg_buf, const reg_info *regs) { int count = 0; int i = 0; diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index b1917ff..b4962a2 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4518,8 +4518,8 @@ ixgbe_get_reg_length(struct rte_eth_dev *dev __rte_unused) struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); int count = 0; int g_ind = 0; - reg_info *reg_group; - reg_info **reg_set = + const reg_info *reg_group; + const reg_info **reg_set = (hw->mac.type == ixgbe_mac_82598EB)?ixgbe_regs_mac_82598EB:ixgbe_regs_others; reg_group = reg_set[g_ind++]; @@ -4536,7 +4536,7 @@ ixgbevf_get_reg_length(struct rte_eth_dev *dev __rte_unused) { int count = 0; int g_ind = 0; - reg_info *reg_group; + const reg_info *reg_group; reg_group = ixgbevf_regs[g_ind++]; while(reg_group) { @@ -4555,8 +4555,8 @@ ixgbe_get_regs(struct rte_eth_dev *dev, uint32_t *regs_buff = regs->buf; int g_ind = 0; int count = 0; - reg_info *reg_group; - reg_info **reg_set = (hw->mac.type == ixgbe_mac_82598EB)? + const reg_info *reg_group; + const reg_info **reg_set = (hw->mac.type == ixgbe_mac_82598EB)? ixgbe_regs_mac_82598EB:ixgbe_regs_others; /* @@ -4585,7 +4585,7 @@ ixgbevf_get_regs(struct rte_eth_dev *dev, uint32_t *regs_buff = regs->buf; int g_ind = 0; int count = 0; - reg_info *reg_group; + const reg_info *reg_group; /* * Support only full register dump diff --git a/drivers/net/ixgbe/ixgbe_regs.h b/drivers/net/ixgbe/ixgbe_regs.h index 7025ed8..5f54b98 100644 --- a/drivers/net/ixgbe/ixgbe_regs.h +++ b/drivers/net/ixgbe/ixgbe_regs.h @@ -43,7 +43,7 @@ typedef struct _reg_info { const char *name; } reg_info; -static reg_info ixgbe_regs_general[] = { +static const reg_info ixgbe_regs_general[] = { {IXGBE_CTRL, 1, 1, "IXGBE_CTRL"}, {IXGBE_STATUS, 1, 1, "IXGBE_STATUS"}, {IXGBE_CTRL_EXT, 1, 1, "IXGBE_CTRL_EXT"}, @@ -55,7 +55,7 @@ static reg_info ixgbe_regs_general[] = { {0, 0, 0, ""} }; -static reg_info ixgbevf_regs_general[] = { +static const reg_info ixgbevf_regs_general[] = { {IXGBE_CTRL, 1, 1, "IXGBE_CTRL"}, {IXGBE_STATUS, 1, 1, "IXGBE_STATUS"}, {IXGBE_VFLINKS, 1, 1, "IXGBE_VFLINKS"}, @@ -66,7 +66,7 @@ static reg_info ixgbevf_regs_general[] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_nvm [] = { +static const reg_info ixgbe_regs_nvm [] = { {IXGBE_EEC, 1, 1, "IXGBE_EEC"}, {IXGBE_EERD, 1, 1, "IXGBE_EERD"}, {IXGBE_FLA, 1, 1, "IXGBE_FLA"}, @@ -80,7 +80,7 @@ static reg_info ixgbe_regs_nvm [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_interrupt [] = { +static const reg_info ixgbe_regs_interrupt [] = { {IXGBE_EICS, 1, 1, "IXGBE_EICS"}, {IXGBE_EIMS, 1, 1, "IXGBE_EIMS"}, {IXGBE_EIMC, 1, 1, "IXGBE_EIMC"}, @@ -95,7 +95,7 @@ static reg_info ixgbe_regs_interrupt [] = { {0, 0, 0, ""} }; -static reg_info ixgbevf_regs_interrupt [] = { +static const reg_info ixgbevf_regs_interrupt [] = { {IXGBE_VTEICR, 1, 1, "IXGBE_VTEICR"}, {IXGBE_VTEICS, 1, 1, "IXGBE_VTEICS"}, {IXGBE_VTEIMS, 1, 1, "IXGBE_VTEIMS"}, @@ -108,7 +108,7 @@ static reg_info ixgbevf_regs_interrupt [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_fctl_mac_82598EB[] = { +static const reg_info ixgbe_regs_fctl_mac_82598EB[] = { {IXGBE_PFCTOP, 1, 1, ""}, {IXGBE_FCTTV(0), 4, 4, ""}, {IXGBE_FCRTV, 1, 1, ""}, @@ -118,7 +118,7 @@ static reg_info ixgbe_regs_fctl_mac_82598EB[] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_fctl_others[] = { +static const reg_info ixgbe_regs_fctl_others[] = { {IXGBE_PFCTOP, 1, 1, ""}, {IXGBE_FCTTV(0), 4, 4, ""}, {IXGBE_FCRTV, 1, 1, ""}, @@ -128,7 +128,7 @@ static reg_info ixgbe_regs_fctl_others[] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_rxdma[] = { +static const reg_info ixgbe_regs_rxdma[] = { {IXGBE_RDBAL(0), 64, 0x40, "IXGBE_RDBAL"}, {IXGBE_RDBAH(0), 64, 0x40, "IXGBE_RDBAH"}, {IXGBE_RDLEN(0), 64, 0x40, "IXGBE_RDLEN"}, @@ -144,7 +144,7 @@ static reg_info ixgbe_regs_rxdma[] = { {0, 0, 0, ""} }; -static reg_info ixgbevf_regs_rxdma[] = { +static const reg_info ixgbevf_regs_rxdma[] = { {IXGBE_RDBAL(0), 8, 0x40, "IXGBE_RDBAL"}, {IXGBE_RDBAH(0), 8, 0x40, "IXGBE_RDBAH"}, {IXGBE_RDLEN(0), 8, 0x40, "IXGBE_RDLEN"}, @@ -159,7 +159,7 @@ static reg_info ixgbevf_regs_rxdma[] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_rx [] = { +static const reg_info ixgbe_regs_rx [] = { {IXGBE_RXCSUM, 1, 1, "IXGBE_RXCSUM"}, {IXGBE_RFCTL, 1, 1, "IXGBE_RFCTL"}, {IXGBE_RAL(0), 16, 8, "IXGBE_RAL"}, @@ -176,7 +176,7 @@ static reg_info ixgbe_regs_rx [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_tx [] = { +static const reg_info ixgbe_regs_tx [] = { {IXGBE_TDBAL(0), 32, 0x40, "IXGBE_TDBAL"}, {IXGBE_TDBAH(0), 32, 0x40, "IXGBE_TDBAH"}, {IXGBE_TDLEN(0), 32, 0x40, "IXGBE_TDLEN"}, @@ -192,7 +192,7 @@ static reg_info ixgbe_regs_tx [] = { {0, 0, 0, ""} }; -static reg_info ixgbevf_regs_tx [] = { +static const reg_info ixgbevf_regs_tx [] = { {IXGBE_TDBAL(0), 4, 0x40, "IXGBE_TDBAL"}, {IXGBE_TDBAH(0), 4, 0x40, "IXGBE_TDBAH"}, {IXGBE_TDLEN(0), 4, 0x40, "IXGBE_TDLEN"}, @@ -204,7 +204,7 @@ static reg_info ixgbevf_regs_tx [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_wakeup [] = { +static const reg_info ixgbe_regs_wakeup [] = { {IXGBE_WUC, 1, 1, "IXGBE_WUC"}, {IXGBE_WUFC, 1, 1, "IXGBE_WUFC"}, {IXGBE_WUS, 1, 1, "IXGBE_WUS"}, @@ -217,7 +217,7 @@ static reg_info ixgbe_regs_wakeup [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_dcb [] = { +static const reg_info ixgbe_regs_dcb [] = { {IXGBE_RMCS, 1, 1, "IXGBE_RMCS"}, {IXGBE_DPMCS, 1, 1, "IXGBE_DPMCS"}, {IXGBE_PDPMCS, 1, 1, "IXGBE_PDPMCS"}, @@ -231,7 +231,7 @@ static reg_info ixgbe_regs_dcb [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_mac [] = { +static const reg_info ixgbe_regs_mac [] = { {IXGBE_PCS1GCFIG, 1, 1, "IXGBE_PCS1GCFIG"}, {IXGBE_PCS1GLCTL, 1, 1, "IXGBE_PCS1GLCTL"}, {IXGBE_PCS1GLSTA, 1, 1, "IXGBE_PCS1GLSTA"}, @@ -268,7 +268,7 @@ static reg_info ixgbe_regs_mac [] = { {0, 0, 0, ""} }; -static reg_info ixgbe_regs_diagnostic [] = { +static const reg_info ixgbe_regs_diagnostic [] = { {IXGBE_RDSTATCTL, 1, 1, "IXGBE_RDSTATCTL"}, {IXGBE_RDSTAT(0), 8, 4, "IXGBE_RDSTAT"}, {IXGBE_RDHMPN, 1, 1, "IXGBE_RDHMPN"}, @@ -302,22 +302,22 @@ static reg_info ixgbe_regs_diagnostic [] = { }; /* PF registers */ -static reg_info* ixgbe_regs_others[] = { ixgbe_regs_general, ixgbe_regs_nvm, ixgbe_regs_interrupt, +static const reg_info* ixgbe_regs_others[] = { ixgbe_regs_general, ixgbe_regs_nvm, ixgbe_regs_interrupt, ixgbe_regs_fctl_others, ixgbe_regs_rxdma, ixgbe_regs_rx, ixgbe_regs_tx, ixgbe_regs_wakeup, ixgbe_regs_dcb, ixgbe_regs_mac, ixgbe_regs_diagnostic, NULL}; -static reg_info* ixgbe_regs_mac_82598EB[] = { ixgbe_regs_general, ixgbe_regs_nvm, ixgbe_regs_interrupt, +static const reg_info* ixgbe_regs_mac_82598EB[] = { ixgbe_regs_general, ixgbe_regs_nvm, ixgbe_regs_interrupt, ixgbe_regs_fctl_mac_82598EB, ixgbe_regs_rxdma, ixgbe_regs_rx, ixgbe_regs_tx, ixgbe_regs_wakeup, ixgbe_regs_dcb, ixgbe_regs_mac, ixgbe_regs_diagnostic, NULL}; /* VF registers */ -static reg_info* ixgbevf_regs[] = { ixgbevf_regs_general, ixgbevf_regs_interrupt, +static const reg_info* ixgbevf_regs[] = { ixgbevf_regs_general, ixgbevf_regs_interrupt, ixgbevf_regs_rxdma, ixgbevf_regs_tx, NULL}; static inline int -ixgbe_read_regs(struct ixgbe_hw *hw, reg_info *reg, uint32_t *reg_buf) +ixgbe_read_regs(struct ixgbe_hw *hw, const reg_info *reg, uint32_t *reg_buf) { unsigned int i; @@ -328,7 +328,7 @@ ixgbe_read_regs(struct ixgbe_hw *hw, reg_info *reg, uint32_t *reg_buf) }; static inline int -ixgbe_regs_group_count(reg_info *regs) +ixgbe_regs_group_count(const reg_info *regs) { int count = 0; int i = 0; @@ -341,7 +341,7 @@ ixgbe_regs_group_count(reg_info *regs) }; static inline int -ixgbe_read_regs_group(struct rte_eth_dev *dev, uint32_t *reg_buf, reg_info *regs) +ixgbe_read_regs_group(struct rte_eth_dev *dev, uint32_t *reg_buf, const reg_info *regs) { int count = 0; int i = 0; -- 2.1.4