fbnic.h (20d2e88cc7461b03b97293d62d780a2d4b08ed8b) | fbnic.h (69684376eed517817251ea6a768cfc315350d5c1) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (c) Meta Platforms, Inc. and affiliates. */ 3 4#ifndef _FBNIC_H_ 5#define _FBNIC_H_ 6 7#include <linux/interrupt.h> 8#include <linux/io.h> --- 7 unchanged lines hidden (view full) --- 16struct fbnic_dev { 17 struct device *dev; 18 struct net_device *netdev; 19 20 u32 __iomem *uc_addr0; 21 u32 __iomem *uc_addr4; 22 const struct fbnic_mac *mac; 23 unsigned int fw_msix_vector; | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (c) Meta Platforms, Inc. and affiliates. */ 3 4#ifndef _FBNIC_H_ 5#define _FBNIC_H_ 6 7#include <linux/interrupt.h> 8#include <linux/io.h> --- 7 unchanged lines hidden (view full) --- 16struct fbnic_dev { 17 struct device *dev; 18 struct net_device *netdev; 19 20 u32 __iomem *uc_addr0; 21 u32 __iomem *uc_addr4; 22 const struct fbnic_mac *mac; 23 unsigned int fw_msix_vector; |
24 unsigned int pcs_msix_vector; |
|
24 unsigned short num_irqs; 25 26 struct delayed_work service_task; 27 28 struct fbnic_fw_mbx mbx[FBNIC_IPC_MBX_INDICES]; 29 struct fbnic_fw_cap fw_cap; 30 /* Lock protecting Tx Mailbox queue to prevent possible races */ 31 spinlock_t fw_tx_lock; --- 12 unchanged lines hidden (view full) --- 44 45/* Reserve entry 0 in the MSI-X "others" array until we have filled all 46 * 32 of the possible interrupt slots. By doing this we can avoid any 47 * potential conflicts should we need to enable one of the debug interrupt 48 * causes later. 49 */ 50enum { 51 FBNIC_FW_MSIX_ENTRY, | 25 unsigned short num_irqs; 26 27 struct delayed_work service_task; 28 29 struct fbnic_fw_mbx mbx[FBNIC_IPC_MBX_INDICES]; 30 struct fbnic_fw_cap fw_cap; 31 /* Lock protecting Tx Mailbox queue to prevent possible races */ 32 spinlock_t fw_tx_lock; --- 12 unchanged lines hidden (view full) --- 45 46/* Reserve entry 0 in the MSI-X "others" array until we have filled all 47 * 32 of the possible interrupt slots. By doing this we can avoid any 48 * potential conflicts should we need to enable one of the debug interrupt 49 * causes later. 50 */ 51enum { 52 FBNIC_FW_MSIX_ENTRY, |
53 FBNIC_PCS_MSIX_ENTRY, |
|
52 FBNIC_NON_NAPI_VECTORS 53}; 54 55static inline bool fbnic_present(struct fbnic_dev *fbd) 56{ 57 return !!READ_ONCE(fbd->uc_addr0); 58} 59 --- 30 unchanged lines hidden (view full) --- 90bool fbnic_fw_present(struct fbnic_dev *fbd); 91u32 fbnic_fw_rd32(struct fbnic_dev *fbd, u32 reg); 92void fbnic_fw_wr32(struct fbnic_dev *fbd, u32 reg, u32 val); 93 94#define fw_rd32(_f, _r) fbnic_fw_rd32(_f, _r) 95#define fw_wr32(_f, _r, _v) fbnic_fw_wr32(_f, _r, _v) 96#define fw_wrfl(_f) fbnic_fw_rd32(_f, FBNIC_FW_ZERO_REG) 97 | 54 FBNIC_NON_NAPI_VECTORS 55}; 56 57static inline bool fbnic_present(struct fbnic_dev *fbd) 58{ 59 return !!READ_ONCE(fbd->uc_addr0); 60} 61 --- 30 unchanged lines hidden (view full) --- 92bool fbnic_fw_present(struct fbnic_dev *fbd); 93u32 fbnic_fw_rd32(struct fbnic_dev *fbd, u32 reg); 94void fbnic_fw_wr32(struct fbnic_dev *fbd, u32 reg, u32 val); 95 96#define fw_rd32(_f, _r) fbnic_fw_rd32(_f, _r) 97#define fw_wr32(_f, _r, _v) fbnic_fw_wr32(_f, _r, _v) 98#define fw_wrfl(_f) fbnic_fw_rd32(_f, FBNIC_FW_ZERO_REG) 99 |
100static inline bool fbnic_bmc_present(struct fbnic_dev *fbd) 101{ 102 return fbd->fw_cap.bmc_present; 103} 104 |
|
98static inline bool fbnic_init_failure(struct fbnic_dev *fbd) 99{ 100 return !fbd->netdev; 101} 102 103extern char fbnic_driver_name[]; 104 105void fbnic_devlink_free(struct fbnic_dev *fbd); 106struct fbnic_dev *fbnic_devlink_alloc(struct pci_dev *pdev); 107void fbnic_devlink_register(struct fbnic_dev *fbd); 108void fbnic_devlink_unregister(struct fbnic_dev *fbd); 109 110int fbnic_fw_enable_mbx(struct fbnic_dev *fbd); 111void fbnic_fw_disable_mbx(struct fbnic_dev *fbd); 112 | 105static inline bool fbnic_init_failure(struct fbnic_dev *fbd) 106{ 107 return !fbd->netdev; 108} 109 110extern char fbnic_driver_name[]; 111 112void fbnic_devlink_free(struct fbnic_dev *fbd); 113struct fbnic_dev *fbnic_devlink_alloc(struct pci_dev *pdev); 114void fbnic_devlink_register(struct fbnic_dev *fbd); 115void fbnic_devlink_unregister(struct fbnic_dev *fbd); 116 117int fbnic_fw_enable_mbx(struct fbnic_dev *fbd); 118void fbnic_fw_disable_mbx(struct fbnic_dev *fbd); 119 |
120int fbnic_pcs_irq_enable(struct fbnic_dev *fbd); 121void fbnic_pcs_irq_disable(struct fbnic_dev *fbd); 122 |
|
113int fbnic_request_irq(struct fbnic_dev *dev, int nr, irq_handler_t handler, 114 unsigned long flags, const char *name, void *data); 115void fbnic_free_irq(struct fbnic_dev *dev, int nr, void *data); 116void fbnic_free_irqs(struct fbnic_dev *fbd); 117int fbnic_alloc_irqs(struct fbnic_dev *fbd); 118 119enum fbnic_boards { 120 fbnic_board_asic 121}; 122 123struct fbnic_info { 124 unsigned int max_num_queues; 125 unsigned int bar_mask; 126}; 127 128#endif /* _FBNIC_H_ */ | 123int fbnic_request_irq(struct fbnic_dev *dev, int nr, irq_handler_t handler, 124 unsigned long flags, const char *name, void *data); 125void fbnic_free_irq(struct fbnic_dev *dev, int nr, void *data); 126void fbnic_free_irqs(struct fbnic_dev *fbd); 127int fbnic_alloc_irqs(struct fbnic_dev *fbd); 128 129enum fbnic_boards { 130 fbnic_board_asic 131}; 132 133struct fbnic_info { 134 unsigned int max_num_queues; 135 unsigned int bar_mask; 136}; 137 138#endif /* _FBNIC_H_ */ |