Ramaxel inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4P01N CVE: NA
Remove unused functions about ceq since the code just defined but never used in the driver.
Signed-off-by: Yanling Song songyl@ramaxel.com Reviewed-by: Yang Gan yanggan@ramaxel.com --- .../net/ethernet/ramaxel/spnic/hw/sphw_eqs.c | 97 ------------------- .../net/ethernet/ramaxel/spnic/hw/sphw_hwif.c | 27 +----- .../net/ethernet/ramaxel/spnic/hw/sphw_mbox.c | 18 ---- .../net/ethernet/ramaxel/spnic/hw/sphw_mbox.h | 2 - 4 files changed, 1 insertion(+), 143 deletions(-)
diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c index e0c84c5bcc58..8f71d9de76c1 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c @@ -595,43 +595,6 @@ static bool eq_irq_handler(void *data) return uncompleted; }
-static struct sphw_eq *find_eq(struct sphw_hwdev *hwdev, int msix_entry_idx) -{ - struct sphw_aeqs *aeqs = hwdev->aeqs; - struct sphw_ceqs *ceqs = hwdev->ceqs; - int i; - - for (i = 0; i < aeqs->num_aeqs; i++) { - struct sphw_eq *eq = &aeqs->aeq[i]; - - if (eq->eq_irq.msix_entry_idx == msix_entry_idx) - return eq; - } - - for (i = 0; i < ceqs->num_ceqs; i++) { - struct sphw_eq *eq = &ceqs->ceq[i]; - - if (eq->eq_irq.msix_entry_idx == msix_entry_idx) - return eq; - } - - return NULL; -} - -/* for windows */ -bool sphw_eq_intr_handler(void *hwdev, int msix_entry_idx) -{ - struct sphw_eq *eq; - - eq = find_eq(hwdev, msix_entry_idx); - if (!eq) { - pr_err("Can't find eq in eq interrupt handler\n"); - return false; - } - - return eq_irq_handler(eq); -} - /** * eq_irq_work - eq work for the event * @work: the work that is associated with the eq @@ -1312,63 +1275,3 @@ void sphw_dump_ceq_info(struct sphw_hwdev *hwdev) jiffies_to_msecs(jiffies - eq->soft_intr_jif)); } } - -int sphw_get_ceq_info(void *hwdev, u16 q_id, struct sphw_ceq_info *ceq_info) -{ - struct sphw_hwdev *dev = hwdev; - struct sphw_eq *eq = NULL; - - if (!hwdev || !ceq_info) - return -EINVAL; - - if (q_id >= dev->ceqs->num_ceqs) - return -EINVAL; - - eq = &dev->ceqs->ceq[q_id]; - ceq_info->q_len = eq->eq_len; - ceq_info->num_pages = eq->num_pages; - ceq_info->page_size = eq->page_size; - ceq_info->num_elem_in_pg = eq->num_elem_in_pg; - ceq_info->elem_size = eq->elem_size; - sdk_info(dev->dev_hdl, "get_ceq_info: qid=0x%x page_size=%ul\n", - q_id, eq->page_size); - - return 0; -} - -int sphw_get_ceq_page_phy_addr(void *hwdev, u16 q_id, u16 page_idx, u64 *page_phy_addr) -{ - struct sphw_hwdev *dev = hwdev; - struct sphw_eq *eq = NULL; - - if (!hwdev || !page_phy_addr) - return -EINVAL; - - if (q_id >= dev->ceqs->num_ceqs) - return -EINVAL; - - eq = &dev->ceqs->ceq[q_id]; - *page_phy_addr = eq->eq_pages[page_idx].align_paddr; - sdk_info(dev->dev_hdl, "ceq_page_phy_addr: 0x%llx page_idx=%u\n", - eq->eq_pages[page_idx].align_paddr, page_idx); - - return 0; -} - -int sphw_set_ceq_irq_disable(void *hwdev, u16 q_id) -{ - struct sphw_hwdev *dev = hwdev; - struct sphw_eq *ceq = NULL; - - if (!hwdev) - return -EINVAL; - - if (q_id >= dev->ceqs->num_ceqs) - return -EINVAL; - - ceq = &dev->ceqs->ceq[q_id]; - - sphw_set_msix_state(ceq->hwdev, ceq->eq_irq.msix_entry_idx, SPHW_MSIX_DISABLE); - - return 0; -} diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwif.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwif.c index 7230ce2f0778..fbb1128957f0 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwif.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwif.c @@ -338,32 +338,6 @@ void sphw_disable_doorbell(struct sphw_hwif *hwif) sphw_hwif_write_reg(hwif, addr, attr4); }
-void sphw_enable_outbound(struct sphw_hwif *hwif) -{ - u32 addr, attr5; - - addr = SPHW_CSR_FUNC_ATTR5_ADDR; - attr5 = sphw_hwif_read_reg(hwif, addr); - - attr5 = SPHW_AF5_CLEAR(attr5, OUTBOUND_CTRL); - attr5 |= SPHW_AF5_SET(ENABLE_OUTBOUND, OUTBOUND_CTRL); - - sphw_hwif_write_reg(hwif, addr, attr5); -} - -void sphw_disable_outbound(struct sphw_hwif *hwif) -{ - u32 addr, attr5; - - addr = SPHW_CSR_FUNC_ATTR5_ADDR; - attr5 = sphw_hwif_read_reg(hwif, addr); - - attr5 = SPHW_AF5_CLEAR(attr5, OUTBOUND_CTRL); - attr5 |= SPHW_AF5_SET(DISABLE_OUTBOUND, OUTBOUND_CTRL); - - sphw_hwif_write_reg(hwif, addr, attr5); -} - /** * set_ppf - try to set hwif as ppf and set the type of hwif in this case * @hwif: the hardware interface of a pci function device @@ -441,6 +415,7 @@ static int init_db_area_idx(struct sphw_free_db_area *free_db_area, u64 db_dwqe_ } free_db_area->db_max_areas = db_max_areas; spin_lock_init(&free_db_area->idx_lock); + return 0; }
diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c index edaef57a6b32..672882190907 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c @@ -1458,24 +1458,6 @@ int sphw_mbox_to_vf(void *hwdev, u16 vf_id, u8 mod, u16 cmd, void *buf_in, u16 i in_size, buf_out, out_size, timeout, channel); }
-int sphw_mbox_set_channel_status(struct sphw_hwdev *hwdev, u16 channel, bool enable) -{ - if (channel >= SPHW_CHANNEL_MAX) { - sdk_err(hwdev->dev_hdl, "Invalid channel id: 0x%x\n", channel); - return -EINVAL; - } - - if (enable) - clear_bit(channel, &hwdev->func_to_func->channel_stop); - else - set_bit(channel, &hwdev->func_to_func->channel_stop); - - sdk_info(hwdev->dev_hdl, "%s mbox channel 0x%x\n", - enable ? "Enable" : "Disable", channel); - - return 0; -} - void sphw_mbox_enable_channel_lock(struct sphw_hwdev *hwdev, bool enable) { hwdev->func_to_func->lock_channel_en = enable; diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.h b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.h index 1a7e0dff0965..9aebee1c088a 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.h +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.h @@ -266,8 +266,6 @@ int sphw_mbox_ppf_to_host(void *hwdev, u8 mod, u16 cmd, u8 host_id,
int sphw_mbox_init_host_msg_channel(struct sphw_hwdev *hwdev);
-int sphw_mbox_set_channel_status(struct sphw_hwdev *hwdev, u16 channel, bool enable); - void sphw_mbox_enable_channel_lock(struct sphw_hwdev *hwdev, bool enable);
#endif