iPXE
Functions
vxge_config.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/iobuf.h>
#include <ipxe/ethernet.h>
#include <byteswap.h>
#include "vxge_traffic.h"
#include "vxge_config.h"
#include "vxge_main.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_ONLY)
 
void vxge_hw_vpath_set_zero_rx_frm_len (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status vxge_hw_set_fw_api (struct __vxge_hw_device *hldev, u64 vp_id, u32 action, u32 offset, u64 data0, u64 data1)
 
enum vxge_hw_status vxge_hw_get_func_mode (struct __vxge_hw_device *hldev, u32 *func_mode)
 
void __vxge_hw_device_pci_e_init (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status __vxge_hw_device_register_poll (void __iomem *reg, u64 mask, u32 max_millis)
 
enum vxge_hw_status __vxge_hw_device_vpath_reset_in_prog_check (u64 __iomem *vpath_rst_in_prog)
 
static struct vxge_hw_legacy_reg __iomem__vxge_hw_device_get_legacy_reg (struct pci_device *pdev, void __iomem *bar0)
 
struct vxge_hw_toc_reg __iomem__vxge_hw_device_toc_get (void __iomem *bar0, struct vxge_hw_legacy_reg __iomem *legacy_reg)
 
enum vxge_hw_status __vxge_hw_device_reg_addr_get (struct __vxge_hw_device *hldev)
 
static u32 __vxge_hw_device_access_rights_get (u32 host_type, u32 func_id)
 
void __vxge_hw_device_host_info_get (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status vxge_hw_device_hw_info_get (struct pci_device *pdev, void __iomem *bar0, struct vxge_hw_device_hw_info *hw_info)
 vxge_hw_device_hw_info_get - Get the hw information Returns the vpath mask that has the bits set for each vpath allocated for the driver, FW version information and the first mac addresse for each vpath More...
 
enum vxge_hw_status vxge_hw_device_initialize (struct __vxge_hw_device **devh, void *bar0, struct pci_device *pdev, u8 titan1)
 
void vxge_hw_device_terminate (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status vxge_hw_ring_replenish (struct __vxge_hw_ring *ring)
 
enum vxge_hw_status __vxge_hw_ring_create (struct __vxge_hw_virtualpath *vpath, struct __vxge_hw_ring *ring)
 
enum vxge_hw_status __vxge_hw_ring_delete (struct __vxge_hw_ring *ring)
 
enum vxge_hw_status __vxge_hw_legacy_swapper_set (struct vxge_hw_legacy_reg __iomem *legacy_reg)
 
enum vxge_hw_status __vxge_hw_vpath_swapper_set (struct vxge_hw_vpath_reg __iomem *vpath_reg)
 
enum vxge_hw_status __vxge_hw_kdfc_swapper_set (struct vxge_hw_legacy_reg __iomem *legacy_reg, struct vxge_hw_vpath_reg __iomem *vpath_reg)
 
enum vxge_hw_status vxge_hw_vpath_strip_fcs_check (struct __vxge_hw_device *hldev, u64 vpath_mask)
 
enum vxge_hw_status __vxge_hw_fifo_create (struct __vxge_hw_virtualpath *vpath, struct __vxge_hw_fifo *fifo)
 
enum vxge_hw_status __vxge_hw_fifo_delete (struct __vxge_hw_fifo *fifo)
 
enum vxge_hw_status __vxge_hw_vpath_pci_read (struct __vxge_hw_virtualpath *vpath, u32 phy_func_0, u32 offset, u32 *val)
 
u32 __vxge_hw_vpath_func_id_get (struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
 
static void __vxge_hw_read_rts_ds (struct vxge_hw_vpath_reg __iomem *vpath_reg, u64 dta_struct_sel)
 
enum vxge_hw_status __vxge_hw_vpath_card_info_get (struct vxge_hw_vpath_reg __iomem *vpath_reg, struct vxge_hw_device_hw_info *hw_info)
 
enum vxge_hw_status __vxge_hw_vpath_fw_ver_get (struct vxge_hw_vpath_reg __iomem *vpath_reg, struct vxge_hw_device_hw_info *hw_info)
 
enum vxge_hw_status __vxge_hw_vpath_addr_get (struct vxge_hw_vpath_reg *vpath_reg, u8(macaddr)[ETH_ALEN], u8(macaddr_mask)[ETH_ALEN])
 
static enum vxge_hw_status __vxge_hw_vpath_mgmt_read (struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status __vxge_hw_vpath_reset_check (struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status __vxge_hw_vpath_reset (struct __vxge_hw_device *hldev, u32 vp_id)
 
void __vxge_hw_vpath_prc_configure (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status __vxge_hw_vpath_kdfc_configure (struct __vxge_hw_device *hldev, u32 vp_id)
 
enum vxge_hw_status __vxge_hw_vpath_mac_configure (struct __vxge_hw_device *hldev)
 
enum vxge_hw_status __vxge_hw_vpath_tim_configure (struct __vxge_hw_device *hldev, u32 vp_id)
 
enum vxge_hw_status __vxge_hw_vpath_initialize (struct __vxge_hw_device *hldev, u32 vp_id)
 
enum vxge_hw_status __vxge_hw_vp_initialize (struct __vxge_hw_device *hldev, u32 vp_id, struct __vxge_hw_virtualpath *vpath)
 
void __vxge_hw_vp_terminate (struct __vxge_hw_device *hldev, struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status vxge_hw_vpath_mtu_set (struct __vxge_hw_virtualpath *vpath, u32 new_mtu)
 
enum vxge_hw_status vxge_hw_vpath_open (struct __vxge_hw_device *hldev, struct vxge_vpath *vpath)
 
void vxge_hw_vpath_rx_doorbell_init (struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status vxge_hw_vpath_close (struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status vxge_hw_vpath_reset (struct __vxge_hw_virtualpath *vpath)
 
enum vxge_hw_status vxge_hw_vpath_recover_from_reset (struct __vxge_hw_virtualpath *vpath)
 
void vxge_hw_vpath_enable (struct __vxge_hw_virtualpath *vpath)
 

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY  )

◆ vxge_hw_vpath_set_zero_rx_frm_len()

void vxge_hw_vpath_set_zero_rx_frm_len ( struct __vxge_hw_device hldev)

Definition at line 30 of file vxge_config.c.

31 {
32  u64 val64;
33  struct __vxge_hw_virtualpath *vpath;
34  struct vxge_hw_vpath_reg __iomem *vp_reg;
35 
36  vpath = &hldev->virtual_path;
37  vp_reg = vpath->vp_reg;
38 
39  val64 = readq(&vp_reg->rxmac_vcfg0);
40  val64 &= ~VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN(0x3fff);
41  writeq(val64, &vp_reg->rxmac_vcfg0);
42  val64 = readq(&vp_reg->rxmac_vcfg0);
43  return;
44 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
uint64_t u64
Definition: stdint.h:25
#define __iomem
Definition: igbvf_osdep.h:45
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN(val)
Definition: vxge_reg.h:171
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __iomem, readq(), vxge_hw_vpath_reg::rxmac_vcfg0, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN, and writeq().

Referenced by vxge_close().

◆ vxge_hw_set_fw_api()

enum vxge_hw_status vxge_hw_set_fw_api ( struct __vxge_hw_device hldev,
u64  vp_id,
u32  action,
u32  offset,
u64  data0,
u64  data1 
)

Definition at line 47 of file vxge_config.c.

53 {
55  u64 val64;
57 
58  struct vxge_hw_vpath_reg __iomem *vp_reg;
59 
60  vp_reg = (struct vxge_hw_vpath_reg __iomem *)hldev->vpath_reg[vp_id];
61 
64 
65  wmb();
66 
67  val64 = VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(action) |
71 
72  writeq(val64, &vp_reg->rts_access_steer_ctrl);
73 
74  wmb();
75 
77  &vp_reg->rts_access_steer_ctrl,
79  WAIT_FACTOR *
81 
82  if (status != VXGE_HW_OK)
83  return VXGE_HW_FAIL;
84 
85  val64 = readq(&vp_reg->rts_access_steer_ctrl);
86 
89  else
91 
92  return status;
93 }
wmb()
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET(val)
Definition: vxge_reg.h:189
u32 data1
Definition: ar9003_mac.h:71
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS
Definition: vxge_reg.h:188
#define WAIT_FACTOR
Definition: vxge_config.h:28
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE
Definition: vxge_reg.h:185
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
uint64_t u64
Definition: stdint.h:25
u64 rts_access_steer_data0
Definition: vxge_reg.h:4215
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
u64 rts_access_steer_ctrl
Definition: vxge_reg.h:4204
#define __iomem
Definition: igbvf_osdep.h:45
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
u64 rts_access_steer_data1
Definition: vxge_reg.h:4217
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO
Definition: vxge_reg.h:204
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(val)
Definition: vxge_reg.h:183
u32 data0
Definition: ar9003_mac.h:69
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL(val)
Definition: vxge_reg.h:184
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
uint32_t u32
Definition: stdint.h:23
enum vxge_hw_status __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
Definition: vxge_config.c:147

References __iomem, __vxge_hw_device_register_poll(), data0, data1, offset, readq(), vxge_hw_vpath_reg::rts_access_steer_ctrl, vxge_hw_vpath_reg::rts_access_steer_data0, vxge_hw_vpath_reg::rts_access_steer_data1, status, __vxge_hw_device::vpath_reg, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_FAIL, VXGE_HW_OK, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO, VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET, VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS, VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE, WAIT_FACTOR, wmb(), and writeq().

Referenced by vxge_hw_get_func_mode().

◆ vxge_hw_get_func_mode()

enum vxge_hw_status vxge_hw_get_func_mode ( struct __vxge_hw_device hldev,
u32 func_mode 
)

Definition at line 97 of file vxge_config.c.

98 {
100  struct vxge_hw_vpath_reg __iomem *vp_reg;
101  u64 val64;
102  int vp_id;
103 
104  /* get the first vpath number assigned to this function */
105  vp_id = hldev->first_vp_id;
106 
107  vp_reg = (struct vxge_hw_vpath_reg __iomem *)hldev->vpath_reg[vp_id];
108 
109  status = vxge_hw_set_fw_api(hldev, vp_id,
111 
112  if (status == VXGE_HW_OK) {
113  val64 = readq(&vp_reg->rts_access_steer_data0);
114  *func_mode = VXGE_HW_GET_FUNC_MODE_VAL(val64);
115  }
116 
117  return status;
118 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
enum vxge_hw_status vxge_hw_set_fw_api(struct __vxge_hw_device *hldev, u64 vp_id, u32 action, u32 offset, u64 data0, u64 data1)
Definition: vxge_config.c:47
uint8_t status
Status.
Definition: ena.h:16
uint64_t u64
Definition: stdint.h:25
u64 rts_access_steer_data0
Definition: vxge_reg.h:4215
#define __iomem
Definition: igbvf_osdep.h:45
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_GET_FUNC_MODE_VAL(val)
Definition: vxge_reg.h:67
#define VXGE_HW_FW_API_GET_FUNC_MODE
Definition: vxge_reg.h:65

References __iomem, __vxge_hw_device::first_vp_id, readq(), vxge_hw_vpath_reg::rts_access_steer_data0, status, __vxge_hw_device::vpath_reg, VXGE_HW_FW_API_GET_FUNC_MODE, VXGE_HW_GET_FUNC_MODE_VAL, VXGE_HW_OK, and vxge_hw_set_fw_api().

Referenced by vxge_probe().

◆ __vxge_hw_device_pci_e_init()

void __vxge_hw_device_pci_e_init ( struct __vxge_hw_device hldev)

Definition at line 126 of file vxge_config.c.

127 {
128  u16 cmd = 0;
129  struct pci_device *pdev = hldev->pdev;
130 
131  vxge_trace();
132 
133  /* Set the PErr Repconse bit and SERR in PCI command register. */
135  cmd |= 0x140;
137 
138  return;
139 }
uint16_t u16
Definition: stdint.h:21
int pci_write_config_word(struct pci_device *pci, unsigned int where, uint16_t value)
Write 16-bit word to PCI configuration space.
int pci_read_config_word(struct pci_device *pci, unsigned int where, uint16_t *value)
Read 16-bit word from PCI configuration space.
#define PCI_COMMAND
PCI command.
Definition: pci.h:24
A PCI device.
Definition: pci.h:187
#define vxge_trace()
Definition: vxge_config.h:767
struct pci_device * pdev
Definition: vxge_config.h:482
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29

References cmd, PCI_COMMAND, pci_read_config_word(), pci_write_config_word(), __vxge_hw_device::pdev, and vxge_trace.

Referenced by vxge_hw_device_initialize().

◆ __vxge_hw_device_register_poll()

enum vxge_hw_status __vxge_hw_device_register_poll ( void __iomem reg,
u64  mask,
u32  max_millis 
)

Definition at line 147 of file vxge_config.c.

148 {
149  u64 val64;
150  u32 i = 0;
151  enum vxge_hw_status ret = VXGE_HW_FAIL;
152 
153  udelay(10);
154 
155  do {
156  val64 = readq(reg);
157  if (!(val64 & mask))
158  return VXGE_HW_OK;
159  udelay(100);
160  } while (++i <= 9);
161 
162  i = 0;
163  do {
164  val64 = readq(reg);
165  if (!(val64 & mask))
166  return VXGE_HW_OK;
167  udelay(1000);
168  } while (++i <= max_millis);
169 
170  return ret;
171 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
uint64_t u64
Definition: stdint.h:25
static unsigned int unsigned int reg
Definition: intel.h:245
vxge_hw_status
Definition: vxge_config.h:70
uint32_t u32
Definition: stdint.h:23

References readq(), reg, udelay(), VXGE_HW_FAIL, and VXGE_HW_OK.

Referenced by __vxge_hw_device_vpath_reset_in_prog_check(), __vxge_hw_pio_mem_write64(), __vxge_hw_vpath_pci_read(), __vxge_hw_vpath_reset_check(), and vxge_hw_set_fw_api().

◆ __vxge_hw_device_vpath_reset_in_prog_check()

enum vxge_hw_status __vxge_hw_device_vpath_reset_in_prog_check ( u64 __iomem vpath_rst_in_prog)

Definition at line 178 of file vxge_config.c.

179 {
180  enum vxge_hw_status status;
181 
182  vxge_trace();
183 
187  return status;
188 }
uint8_t status
Status.
Definition: ena.h:16
u64 vpath_rst_in_prog
Definition: vxge_reg.h:167
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_VPATH_RST_IN_PROG_VPATH_RST_IN_PROG(val)
Definition: vxge_reg.h:168
enum vxge_hw_status __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
Definition: vxge_config.c:147

References __vxge_hw_device_register_poll(), status, vpath_rst_in_prog, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_VPATH_RST_IN_PROG_VPATH_RST_IN_PROG, and vxge_trace.

Referenced by __vxge_hw_device_reg_addr_get(), and vxge_hw_device_hw_info_get().

◆ __vxge_hw_device_get_legacy_reg()

static struct vxge_hw_legacy_reg __iomem* __vxge_hw_device_get_legacy_reg ( struct pci_device pdev,
void __iomem bar0 
)
static

Definition at line 196 of file vxge_config.c.

197 {
198  enum vxge_hw_status status;
199  struct vxge_hw_legacy_reg __iomem *legacy_reg;
200  /*
201  * If the length of Bar0 is 16MB, then assume that we are configured
202  * in MF8P_VP2 mode and then add 8MB to the legacy_reg offsets
203  */
204  if (pci_bar_size(pdev, PCI_BASE_ADDRESS_0) == 0x1000000)
205  legacy_reg = (struct vxge_hw_legacy_reg __iomem *)
206  (bar0 + 0x800000);
207  else
208  legacy_reg = (struct vxge_hw_legacy_reg __iomem *)bar0;
209 
210  status = __vxge_hw_legacy_swapper_set(legacy_reg);
211  if (status != VXGE_HW_OK)
212  return NULL;
213 
214  return legacy_reg;
215 }
#define PCI_BASE_ADDRESS_0
Definition: pci.h:61
uint8_t status
Status.
Definition: ena.h:16
unsigned long pci_bar_size(struct pci_device *pci, unsigned int reg)
Find the size of a PCI BAR.
Definition: pciextra.c:90
#define __iomem
Definition: igbvf_osdep.h:45
vxge_hw_status
Definition: vxge_config.h:70
enum vxge_hw_status __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg)
Definition: vxge_config.c:683
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References __iomem, __vxge_hw_legacy_swapper_set(), NULL, pci_bar_size(), PCI_BASE_ADDRESS_0, status, and VXGE_HW_OK.

Referenced by __vxge_hw_device_reg_addr_get(), and vxge_hw_device_hw_info_get().

◆ __vxge_hw_device_toc_get()

struct vxge_hw_toc_reg __iomem* __vxge_hw_device_toc_get ( void __iomem bar0,
struct vxge_hw_legacy_reg __iomem legacy_reg 
)

Definition at line 222 of file vxge_config.c.

224 {
225  u64 val64;
226  struct vxge_hw_toc_reg __iomem *toc = NULL;
227 
228  val64 = readq(&legacy_reg->toc_first_pointer);
229  toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64);
230 
231  return toc;
232 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint64_t u64
Definition: stdint.h:25
#define __iomem
Definition: igbvf_osdep.h:45
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References __iomem, NULL, and readq().

Referenced by __vxge_hw_device_reg_addr_get(), and vxge_hw_device_hw_info_get().

◆ __vxge_hw_device_reg_addr_get()

enum vxge_hw_status __vxge_hw_device_reg_addr_get ( struct __vxge_hw_device hldev)

Definition at line 241 of file vxge_config.c.

242 {
243  u64 val64;
244  u32 i;
246 
248  hldev->bar0);
249  if (hldev->legacy_reg == NULL) {
251  goto exit;
252  }
253 
254  hldev->toc_reg = __vxge_hw_device_toc_get(hldev->bar0,
255  hldev->legacy_reg);
256  if (hldev->toc_reg == NULL) {
258  goto exit;
259  }
260 
261  val64 = readq(&hldev->toc_reg->toc_common_pointer);
262  hldev->common_reg =
263  (struct vxge_hw_common_reg __iomem *)(hldev->bar0 + val64);
264 
265  val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer);
266  hldev->mrpcim_reg =
267  (struct vxge_hw_mrpcim_reg __iomem *)(hldev->bar0 + val64);
268 
269  for (i = 0; i < VXGE_HW_TITAN_SRPCIM_REG_SPACES; i++) {
270  val64 = readq(&hldev->toc_reg->toc_srpcim_pointer[i]);
271  hldev->srpcim_reg[i] =
272  (struct vxge_hw_srpcim_reg __iomem *)
273  (hldev->bar0 + val64);
274  }
275 
276  for (i = 0; i < VXGE_HW_TITAN_VPMGMT_REG_SPACES; i++) {
277  val64 = readq(&hldev->toc_reg->toc_vpmgmt_pointer[i]);
278  hldev->vpmgmt_reg[i] =
279  (struct vxge_hw_vpmgmt_reg __iomem *)(hldev->bar0 + val64);
280  }
281 
282  for (i = 0; i < VXGE_HW_TITAN_VPATH_REG_SPACES; i++) {
283  val64 = readq(&hldev->toc_reg->toc_vpath_pointer[i]);
284  hldev->vpath_reg[i] =
285  (struct vxge_hw_vpath_reg __iomem *)
286  (hldev->bar0 + val64);
287  }
288 
289  val64 = readq(&hldev->toc_reg->toc_kdfc);
290 
291  switch (VXGE_HW_TOC_GET_KDFC_INITIAL_BIR(val64)) {
292  case 0:
293  hldev->kdfc = (u8 __iomem *)(hldev->bar0 +
295  break;
296  default:
297  break;
298  }
299 
302 exit:
303  return status;
304 }
u64 toc_vpmgmt_pointer[17]
Definition: vxge_reg.h:683
struct vxge_hw_legacy_reg * legacy_reg
Definition: vxge_config.h:495
static struct vxge_hw_legacy_reg __iomem * __vxge_hw_device_get_legacy_reg(struct pci_device *pdev, void __iomem *bar0)
Definition: vxge_config.c:196
u64 toc_vpath_pointer[17]
Definition: vxge_reg.h:687
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct vxge_hw_toc_reg __iomem * __vxge_hw_device_toc_get(void __iomem *bar0, struct vxge_hw_legacy_reg __iomem *legacy_reg)
Definition: vxge_config.c:222
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
u64 toc_mrpcim_pointer
Definition: vxge_reg.h:677
enum vxge_hw_status __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
Definition: vxge_config.c:178
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_TITAN_SRPCIM_REG_SPACES
Definition: vxge_reg.h:52
#define VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val)
Definition: vxge_reg.h:115
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_TITAN_VPATH_REG_SPACES
Definition: vxge_reg.h:54
#define VXGE_HW_TITAN_VPMGMT_REG_SPACES
Definition: vxge_reg.h:53
#define __iomem
Definition: igbvf_osdep.h:45
u64 toc_common_pointer
Definition: vxge_reg.h:669
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
struct vxge_hw_vpmgmt_reg * vpmgmt_reg[VXGE_HW_TITAN_VPMGMT_REG_SPACES]
Definition: vxge_config.h:501
void __iomem * bar0
Definition: vxge_config.h:481
struct vxge_hw_toc_reg * toc_reg
Definition: vxge_config.h:496
vxge_hw_status
Definition: vxge_config.h:70
struct pci_device * pdev
Definition: vxge_config.h:482
struct vxge_hw_mrpcim_reg * mrpcim_reg
Definition: vxge_config.h:498
u64 toc_srpcim_pointer[17]
Definition: vxge_reg.h:679
#define VXGE_HW_TOC_GET_KDFC_INITIAL_BIR(val)
Definition: vxge_reg.h:117
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
struct vxge_hw_srpcim_reg * srpcim_reg[VXGE_HW_TITAN_SRPCIM_REG_SPACES]
Definition: vxge_config.h:499

References __iomem, __vxge_hw_device_get_legacy_reg(), __vxge_hw_device_toc_get(), __vxge_hw_device_vpath_reset_in_prog_check(), __vxge_hw_device::bar0, __vxge_hw_device::common_reg, __vxge_hw_device::kdfc, __vxge_hw_device::legacy_reg, __vxge_hw_device::mrpcim_reg, NULL, __vxge_hw_device::pdev, readq(), __vxge_hw_device::srpcim_reg, status, vxge_hw_toc_reg::toc_common_pointer, vxge_hw_toc_reg::toc_kdfc, vxge_hw_toc_reg::toc_mrpcim_pointer, __vxge_hw_device::toc_reg, vxge_hw_toc_reg::toc_srpcim_pointer, vxge_hw_toc_reg::toc_vpath_pointer, vxge_hw_toc_reg::toc_vpmgmt_pointer, __vxge_hw_device::vpath_reg, vxge_hw_common_reg::vpath_rst_in_prog, __vxge_hw_device::vpmgmt_reg, VXGE_HW_FAIL, VXGE_HW_OK, VXGE_HW_TITAN_SRPCIM_REG_SPACES, VXGE_HW_TITAN_VPATH_REG_SPACES, VXGE_HW_TITAN_VPMGMT_REG_SPACES, VXGE_HW_TOC_GET_KDFC_INITIAL_BIR, and VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET.

Referenced by vxge_hw_device_initialize().

◆ __vxge_hw_device_access_rights_get()

static u32 __vxge_hw_device_access_rights_get ( u32  host_type,
u32  func_id 
)
static

Definition at line 311 of file vxge_config.c.

312 {
313  u32 access_rights = VXGE_HW_DEVICE_ACCESS_RIGHT_VPATH;
314 
315  switch (host_type) {
317  if (func_id == 0) {
318  access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
320  }
321  break;
323  access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
325  break;
327  access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM |
329  break;
333  break;
336  access_rights |= VXGE_HW_DEVICE_ACCESS_RIGHT_SRPCIM;
337  break;
338  }
339 
340  return access_rights;
341 }
__be16 func_id
Definition: CIB_PRM.h:30
#define VXGE_HW_NO_MR_SR_VH0_FUNCTION0
Definition: vxge_config.h:431
#define VXGE_HW_DEVICE_ACCESS_RIGHT_SRPCIM
Definition: vxge_config.h:493
#define VXGE_HW_MR_NO_SR_VH0_BASE_FUNCTION
Definition: vxge_config.h:430
#define VXGE_HW_SR_VH_VIRTUAL_FUNCTION
Definition: vxge_config.h:435
#define VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION
Definition: vxge_config.h:429
#define VXGE_HW_SR_VH_FUNCTION0
Definition: vxge_config.h:434
#define VXGE_HW_MR_SR_VH0_INVALID_CONFIG
Definition: vxge_config.h:433
#define VXGE_HW_VH_NORMAL_FUNCTION
Definition: vxge_config.h:436
#define VXGE_HW_NO_MR_SR_VH0_VIRTUAL_FUNCTION
Definition: vxge_config.h:432
#define VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM
Definition: vxge_config.h:494
#define VXGE_HW_DEVICE_ACCESS_RIGHT_VPATH
Definition: vxge_config.h:492
uint32_t u32
Definition: stdint.h:23

References func_id, VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM, VXGE_HW_DEVICE_ACCESS_RIGHT_SRPCIM, VXGE_HW_DEVICE_ACCESS_RIGHT_VPATH, VXGE_HW_MR_NO_SR_VH0_BASE_FUNCTION, VXGE_HW_MR_SR_VH0_INVALID_CONFIG, VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION, VXGE_HW_NO_MR_SR_VH0_FUNCTION0, VXGE_HW_NO_MR_SR_VH0_VIRTUAL_FUNCTION, VXGE_HW_SR_VH_FUNCTION0, VXGE_HW_SR_VH_VIRTUAL_FUNCTION, and VXGE_HW_VH_NORMAL_FUNCTION.

Referenced by __vxge_hw_device_host_info_get(), and vxge_hw_device_hw_info_get().

◆ __vxge_hw_device_host_info_get()

void __vxge_hw_device_host_info_get ( struct __vxge_hw_device hldev)

Definition at line 347 of file vxge_config.c.

348 {
349  u64 val64;
350  u32 i;
351 
352  val64 = readq(&hldev->common_reg->host_type_assignments);
353 
354  hldev->host_type =
356 
358 
359  for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
360 
361  if (!(hldev->vpath_assignments & vxge_mBIT(i)))
362  continue;
363 
364  hldev->func_id =
366 
368  hldev->host_type, hldev->func_id);
369 
370  hldev->first_vp_id = i;
371  break;
372  }
373 
374  return;
375 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
u64 host_type_assignments
Definition: vxge_reg.h:883
#define u32
Definition: vga.h:21
#define VXGE_HW_MAX_VIRTUAL_PATHS
Definition: vxge_traffic.h:30
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_HOST_TYPE_ASSIGNMENTS_GET_HOST_TYPE_ASSIGNMENTS(bits)
Definition: vxge_reg.h:47
struct vxge_hw_vpmgmt_reg * vpmgmt_reg[VXGE_HW_TITAN_VPMGMT_REG_SPACES]
Definition: vxge_config.h:501
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
u32 __vxge_hw_vpath_func_id_get(struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
Definition: vxge_config.c:905
static u32 __vxge_hw_device_access_rights_get(u32 host_type, u32 func_id)
Definition: vxge_config.c:311
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_device_access_rights_get(), __vxge_hw_vpath_func_id_get(), __vxge_hw_device::access_rights, __vxge_hw_device::common_reg, __vxge_hw_device::first_vp_id, __vxge_hw_device::func_id, __vxge_hw_device::host_type, vxge_hw_common_reg::host_type_assignments, readq(), u32, __vxge_hw_device::vpath_assignments, vxge_hw_common_reg::vpath_assignments, __vxge_hw_device::vpmgmt_reg, VXGE_HW_HOST_TYPE_ASSIGNMENTS_GET_HOST_TYPE_ASSIGNMENTS, VXGE_HW_MAX_VIRTUAL_PATHS, and vxge_mBIT.

Referenced by vxge_hw_device_initialize().

◆ vxge_hw_device_hw_info_get()

enum vxge_hw_status vxge_hw_device_hw_info_get ( struct pci_device pdev,
void __iomem bar0,
struct vxge_hw_device_hw_info hw_info 
)

vxge_hw_device_hw_info_get - Get the hw information Returns the vpath mask that has the bits set for each vpath allocated for the driver, FW version information and the first mac addresse for each vpath

Definition at line 384 of file vxge_config.c.

386 {
387  u32 i;
388  u64 val64;
389  struct vxge_hw_toc_reg __iomem *toc;
390  struct vxge_hw_mrpcim_reg __iomem *mrpcim_reg;
391  struct vxge_hw_common_reg __iomem *common_reg;
392  struct vxge_hw_vpath_reg __iomem *vpath_reg;
393  struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
394  struct vxge_hw_legacy_reg __iomem *legacy_reg;
395  enum vxge_hw_status status;
396 
397  vxge_trace();
398 
399  memset(hw_info, 0, sizeof(struct vxge_hw_device_hw_info));
400 
401  legacy_reg = __vxge_hw_device_get_legacy_reg(pdev, bar0);
402  if (legacy_reg == NULL) {
404  goto exit;
405  }
406 
407  toc = __vxge_hw_device_toc_get(bar0, legacy_reg);
408  if (toc == NULL) {
410  goto exit;
411  }
412 
413  val64 = readq(&toc->toc_common_pointer);
414  common_reg = (struct vxge_hw_common_reg __iomem *)(bar0 + val64);
415 
417  (u64 __iomem *)&common_reg->vpath_rst_in_prog);
418  if (status != VXGE_HW_OK)
419  goto exit;
420 
421  hw_info->vpath_mask = readq(&common_reg->vpath_assignments);
422 
423  val64 = readq(&common_reg->host_type_assignments);
424 
425  hw_info->host_type =
427 
428  for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
429 
430  if (!((hw_info->vpath_mask) & vxge_mBIT(i)))
431  continue;
432 
433  val64 = readq(&toc->toc_vpmgmt_pointer[i]);
434 
435  vpmgmt_reg = (struct vxge_hw_vpmgmt_reg __iomem *)
436  (bar0 + val64);
437 
438  hw_info->func_id = __vxge_hw_vpath_func_id_get(vpmgmt_reg);
440  hw_info->func_id) &
442 
443  val64 = readq(&toc->toc_mrpcim_pointer);
444 
445  mrpcim_reg = (struct vxge_hw_mrpcim_reg __iomem *)
446  (bar0 + val64);
447 
448  writeq(0, &mrpcim_reg->xgmac_gen_fw_memo_mask);
449  wmb();
450  }
451 
452  val64 = readq(&toc->toc_vpath_pointer[i]);
453 
454  vpath_reg = (struct vxge_hw_vpath_reg __iomem *)(bar0 + val64);
455 
456  status = __vxge_hw_vpath_fw_ver_get(vpath_reg, hw_info);
457  if (status != VXGE_HW_OK)
458  goto exit;
459 
460  status = __vxge_hw_vpath_card_info_get(vpath_reg, hw_info);
461  if (status != VXGE_HW_OK)
462  goto exit;
463 
464  break;
465  }
466 
467  for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
468 
469  if (!((hw_info->vpath_mask) & vxge_mBIT(i)))
470  continue;
471 
472  val64 = readq(&toc->toc_vpath_pointer[i]);
473  vpath_reg = (struct vxge_hw_vpath_reg __iomem *)(bar0 + val64);
474 
475  status = __vxge_hw_vpath_addr_get(vpath_reg,
476  hw_info->mac_addrs[i],
477  hw_info->mac_addr_masks[i]);
478  if (status != VXGE_HW_OK)
479  goto exit;
480  }
481 exit:
482  return status;
483 }
wmb()
u64 toc_vpmgmt_pointer[17]
Definition: vxge_reg.h:683
static struct vxge_hw_legacy_reg __iomem * __vxge_hw_device_get_legacy_reg(struct pci_device *pdev, void __iomem *bar0)
Definition: vxge_config.c:196
u64 toc_vpath_pointer[17]
Definition: vxge_reg.h:687
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct vxge_hw_toc_reg __iomem * __vxge_hw_device_toc_get(void __iomem *bar0, struct vxge_hw_legacy_reg __iomem *legacy_reg)
Definition: vxge_config.c:222
u64 host_type_assignments
Definition: vxge_reg.h:883
u64 toc_mrpcim_pointer
Definition: vxge_reg.h:677
enum vxge_hw_status __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
Definition: vxge_config.c:178
enum vxge_hw_status __vxge_hw_vpath_card_info_get(struct vxge_hw_vpath_reg __iomem *vpath_reg, struct vxge_hw_device_hw_info *hw_info)
Definition: vxge_config.c:935
struct vxge_hw_device_hw_info - Device information @host_type: Host Type @func_id: Function Id @vpath...
Definition: vxge_config.h:427
uint8_t status
Status.
Definition: ena.h:16
#define u32
Definition: vga.h:21
#define VXGE_HW_MAX_VIRTUAL_PATHS
Definition: vxge_traffic.h:30
uint64_t u64
Definition: stdint.h:25
#define __iomem
Definition: igbvf_osdep.h:45
#define VXGE_HW_HOST_TYPE_ASSIGNMENTS_GET_HOST_TYPE_ASSIGNMENTS(bits)
Definition: vxge_reg.h:47
u64 toc_common_pointer
Definition: vxge_reg.h:669
u64 xgmac_gen_fw_memo_mask
Definition: vxge_reg.h:1906
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
u32 __vxge_hw_vpath_func_id_get(struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
Definition: vxge_config.c:905
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
static u32 __vxge_hw_device_access_rights_get(u32 host_type, u32 func_id)
Definition: vxge_config.c:311
#define VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM
Definition: vxge_config.h:494
enum vxge_hw_status __vxge_hw_vpath_addr_get(struct vxge_hw_vpath_reg *vpath_reg, u8(macaddr)[ETH_ALEN], u8(macaddr_mask)[ETH_ALEN])
Definition: vxge_config.c:1148
enum vxge_hw_status __vxge_hw_vpath_fw_ver_get(struct vxge_hw_vpath_reg __iomem *vpath_reg, struct vxge_hw_device_hw_info *hw_info)
Definition: vxge_config.c:1056
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
uint32_t u32
Definition: stdint.h:23
void * memset(void *dest, int character, size_t len) __nonnull

References __iomem, __vxge_hw_device_access_rights_get(), __vxge_hw_device_get_legacy_reg(), __vxge_hw_device_toc_get(), __vxge_hw_device_vpath_reset_in_prog_check(), __vxge_hw_vpath_addr_get(), __vxge_hw_vpath_card_info_get(), __vxge_hw_vpath_func_id_get(), __vxge_hw_vpath_fw_ver_get(), vxge_hw_device_hw_info::func_id, vxge_hw_device_hw_info::host_type, vxge_hw_common_reg::host_type_assignments, memset(), NULL, readq(), status, vxge_hw_toc_reg::toc_common_pointer, vxge_hw_toc_reg::toc_mrpcim_pointer, vxge_hw_toc_reg::toc_vpath_pointer, vxge_hw_toc_reg::toc_vpmgmt_pointer, u32, vxge_hw_common_reg::vpath_assignments, vxge_hw_device_hw_info::vpath_mask, vxge_hw_common_reg::vpath_rst_in_prog, VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM, VXGE_HW_ERR_CRITICAL, VXGE_HW_HOST_TYPE_ASSIGNMENTS_GET_HOST_TYPE_ASSIGNMENTS, VXGE_HW_MAX_VIRTUAL_PATHS, VXGE_HW_OK, vxge_mBIT, vxge_trace, wmb(), writeq(), and vxge_hw_mrpcim_reg::xgmac_gen_fw_memo_mask.

Referenced by vxge_probe().

◆ vxge_hw_device_initialize()

enum vxge_hw_status vxge_hw_device_initialize ( struct __vxge_hw_device **  devh,
void *  bar0,
struct pci_device pdev,
u8  titan1 
)

Definition at line 495 of file vxge_config.c.

500 {
501  struct __vxge_hw_device *hldev = NULL;
503 
504  vxge_trace();
505 
506  hldev = (struct __vxge_hw_device *)
507  zalloc(sizeof(struct __vxge_hw_device));
508  if (hldev == NULL) {
509  vxge_debug(VXGE_ERR, "hldev allocation failed\n");
511  goto exit;
512  }
513 
514  hldev->magic = VXGE_HW_DEVICE_MAGIC;
515 
516  hldev->bar0 = bar0;
517  hldev->pdev = pdev;
518  hldev->titan1 = titan1;
519 
521 
523  if (status != VXGE_HW_OK) {
524  vxge_debug(VXGE_ERR, "%s:%d __vxge_hw_device_reg_addr_get "
525  "failed\n", __func__, __LINE__);
527  goto exit;
528  }
529 
531 
532  *devh = hldev;
533 exit:
534  return status;
535 }
void __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:347
#define vxge_debug(mask, fmt...)
Definition: vxge_config.h:762
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:241
void __vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:126
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
void __iomem * bar0
Definition: vxge_config.h:481
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct pci_device * pdev
Definition: vxge_config.h:482
void vxge_hw_device_terminate(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:542
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define VXGE_HW_DEVICE_MAGIC
Definition: vxge_config.h:479
#define VXGE_ERR
Definition: vxge_config.h:54

References __vxge_hw_device_host_info_get(), __vxge_hw_device_pci_e_init(), __vxge_hw_device_reg_addr_get(), __vxge_hw_device::bar0, __vxge_hw_device::magic, NULL, __vxge_hw_device::pdev, status, __vxge_hw_device::titan1, vxge_debug, VXGE_ERR, VXGE_HW_DEVICE_MAGIC, vxge_hw_device_terminate(), VXGE_HW_ERR_OUT_OF_MEMORY, VXGE_HW_OK, vxge_trace, and zalloc().

Referenced by vxge_probe().

◆ vxge_hw_device_terminate()

void vxge_hw_device_terminate ( struct __vxge_hw_device hldev)

Definition at line 542 of file vxge_config.c.

543 {
544  vxge_trace();
545 
546  assert(hldev->magic == VXGE_HW_DEVICE_MAGIC);
547 
548  hldev->magic = VXGE_HW_DEVICE_DEAD;
549  free(hldev);
550 }
#define VXGE_HW_DEVICE_DEAD
Definition: vxge_config.h:480
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
#define vxge_trace()
Definition: vxge_config.h:767
#define VXGE_HW_DEVICE_MAGIC
Definition: vxge_config.h:479

References assert(), free, __vxge_hw_device::magic, VXGE_HW_DEVICE_DEAD, VXGE_HW_DEVICE_MAGIC, and vxge_trace.

Referenced by vxge_hw_device_initialize(), vxge_probe(), and vxge_remove().

◆ vxge_hw_ring_replenish()

enum vxge_hw_status vxge_hw_ring_replenish ( struct __vxge_hw_ring ring)

Definition at line 557 of file vxge_config.c.

558 {
559  struct __vxge_hw_device *hldev;
560  struct vxge_hw_ring_rxd_1 *rxd;
562  u8 offset = 0;
563  struct __vxge_hw_ring_block *block;
564  u8 i, iob_off;
565 
566  vxge_trace();
567 
568  hldev = ring->vpathh->hldev;
569  /*
570  * We allocate all the dma buffers first and then share the
571  * these buffers among the all rx descriptors in the block.
572  */
573  for (i = 0; i < ARRAY_SIZE(ring->iobuf); i++) {
574  ring->iobuf[i] = alloc_iob(VXGE_LL_MAX_FRAME_SIZE(hldev->vdev));
575  if (!ring->iobuf[i]) {
576  while (i) {
577  free_iob(ring->iobuf[--i]);
578  ring->iobuf[i] = NULL;
579  }
581  goto iobuf_err;
582  }
583  }
584 
586 
587  rxd = &ring->rxdl->rxd[offset];
589  iob_off = VXGE_HW_RING_BUF_PER_BLOCK;
590  else
591  iob_off = offset % ring->buf_per_block;
592 
593  rxd->control_0 = rxd->control_1 = 0;
594  vxge_hw_ring_rxd_1b_set(rxd, ring->iobuf[iob_off],
595  VXGE_LL_MAX_FRAME_SIZE(hldev->vdev));
596 
597  vxge_hw_ring_rxd_post(ring, rxd);
598  }
599  /* linking the block to itself as we use only one rx block*/
600  block = ring->rxdl;
601  block->reserved_2_pNext_RxD_block = (unsigned long) block;
602  block->pNext_RxD_Blk_physical = (u64)virt_to_bus(block);
603 
604  ring->rxd_offset = 0;
605 iobuf_err:
606  return status;
607 }
struct __vxge_hw_virtualpath * vpathh
Definition: vxge_config.h:379
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition: iobuf.c:145
uint16_t block
Definition: tftp.h:12
void vxge_hw_ring_rxd_post(struct __vxge_hw_ring *ring __unused, struct vxge_hw_ring_rxd_1 *rxdp)
vxge_hw_ring_rxd_post - Post descriptor on the ring.
Definition: vxge_traffic.c:318
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Definition: iobuf.c:128
struct vxgedev * vdev
Definition: vxge_config.h:484
uint8_t status
Status.
Definition: ena.h:16
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
struct io_buffer * iobuf[VXGE_HW_RING_BUF_PER_BLOCK+1]
Definition: vxge_config.h:378
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
uint64_t u64
Definition: stdint.h:25
struct __vxge_hw_ring_block * rxdl
Definition: vxge_config.h:370
#define VXGE_LL_MAX_FRAME_SIZE(dev)
Definition: vxge_main.h:147
#define ARRAY_SIZE(x)
Definition: efx_common.h:43
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
static void vxge_hw_ring_rxd_1b_set(struct vxge_hw_ring_rxd_1 *rxdp, struct io_buffer *iob, u32 size)
vxge_hw_ring_rxd_1b_set - Prepare 1-buffer-mode descriptor.
Definition: vxge_config.h:597
#define VXGE_HW_RING_BUF_PER_BLOCK
Definition: vxge_config.h:371
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
struct vxge_hw_ring_rxd_1 rxd[VXGE_HW_MAX_RXDS_PER_BLOCK_1]
Definition: vxge_config.h:342
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
struct vxge_hw_ring_rxd_1 - One buffer mode RxD for ring
Definition: vxge_config.h:154
uint8_t u8
Definition: stdint.h:19
#define VXGE_HW_MAX_RXDS_PER_BLOCK_1
Definition: vxge_config.h:341
#define rxd
Definition: davicom.c:145

References alloc_iob(), ARRAY_SIZE, block, __vxge_hw_ring::buf_per_block, free_iob(), __vxge_hw_virtualpath::hldev, __vxge_hw_ring::iobuf, NULL, offset, rxd, __vxge_hw_ring_block::rxd, __vxge_hw_ring::rxd_offset, __vxge_hw_ring::rxdl, status, __vxge_hw_device::vdev, virt_to_bus(), __vxge_hw_ring::vpathh, VXGE_HW_ERR_OUT_OF_MEMORY, VXGE_HW_MAX_RXDS_PER_BLOCK_1, VXGE_HW_OK, VXGE_HW_RING_BUF_PER_BLOCK, vxge_hw_ring_rxd_1b_set(), vxge_hw_ring_rxd_post(), VXGE_LL_MAX_FRAME_SIZE, and vxge_trace.

Referenced by __vxge_hw_ring_create().

◆ __vxge_hw_ring_create()

enum vxge_hw_status __vxge_hw_ring_create ( struct __vxge_hw_virtualpath vpath,
struct __vxge_hw_ring ring 
)

Definition at line 615 of file vxge_config.c.

617 {
619  struct __vxge_hw_device *hldev;
620  u32 vp_id;
621 
622  vxge_trace();
623 
624  hldev = vpath->hldev;
625  vp_id = vpath->vp_id;
626 
627  ring->rxdl = malloc_dma(sizeof(struct __vxge_hw_ring_block),
628  sizeof(struct __vxge_hw_ring_block));
629  if (!ring->rxdl) {
630  vxge_debug(VXGE_ERR, "%s:%d malloc_dma error\n",
631  __func__, __LINE__);
633  goto exit;
634  }
635  ring->rxd_offset = 0;
636  ring->vpathh = vpath;
639  ring->vp_id = vp_id;
640  ring->vp_reg = vpath->vp_reg;
641  ring->common_reg = hldev->common_reg;
642 
644 
646  if (status != VXGE_HW_OK) {
647  __vxge_hw_ring_delete(ring);
648  goto exit;
649  }
650 exit:
651  return status;
652 }
struct __vxge_hw_virtualpath * vpathh
Definition: vxge_config.h:379
enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_ring *ring)
Definition: vxge_config.c:658
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
#define vxge_debug(mask, fmt...)
Definition: vxge_config.h:762
uint8_t status
Status.
Definition: ena.h:16
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:361
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:362
struct __vxge_hw_ring_block * rxdl
Definition: vxge_config.h:370
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
static void *__malloc malloc_dma(size_t size, size_t phys_align)
Allocate memory for DMA.
Definition: malloc.h:66
#define VXGE_HW_RING_BUF_PER_BLOCK
Definition: vxge_config.h:371
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
#define VXGE_HW_RING_RXD_QWORD_LIMIT
Definition: vxge_config.h:367
enum vxge_hw_status vxge_hw_ring_replenish(struct __vxge_hw_ring *ring)
Definition: vxge_config.c:557
#define VXGE_HW_RING_RX_POLL_WEIGHT
Definition: vxge_config.h:375
uint32_t u32
Definition: stdint.h:23
#define VXGE_ERR
Definition: vxge_config.h:54

References __vxge_hw_ring_delete(), __vxge_hw_ring::buf_per_block, __vxge_hw_ring::common_reg, __vxge_hw_device::common_reg, __vxge_hw_virtualpath::hldev, malloc_dma(), __vxge_hw_ring::rx_poll_weight, __vxge_hw_ring::rxd_offset, __vxge_hw_ring::rxd_qword_limit, __vxge_hw_ring::rxdl, status, __vxge_hw_ring::vp_id, __vxge_hw_virtualpath::vp_id, __vxge_hw_ring::vp_reg, __vxge_hw_virtualpath::vp_reg, __vxge_hw_ring::vpathh, vxge_debug, VXGE_ERR, VXGE_HW_ERR_OUT_OF_MEMORY, VXGE_HW_OK, VXGE_HW_RING_BUF_PER_BLOCK, vxge_hw_ring_replenish(), VXGE_HW_RING_RX_POLL_WEIGHT, VXGE_HW_RING_RXD_QWORD_LIMIT, and vxge_trace.

Referenced by vxge_hw_vpath_open().

◆ __vxge_hw_ring_delete()

enum vxge_hw_status __vxge_hw_ring_delete ( struct __vxge_hw_ring ring)

Definition at line 658 of file vxge_config.c.

659 {
660  u8 i;
661 
662  vxge_trace();
663 
664  for (i = 0; (i < ARRAY_SIZE(ring->iobuf)) && ring->iobuf[i]; i++) {
665  free_iob(ring->iobuf[i]);
666  ring->iobuf[i] = NULL;
667  }
668 
669  if (ring->rxdl) {
670  free_dma(ring->rxdl, sizeof(struct __vxge_hw_ring_block));
671  ring->rxdl = NULL;
672  }
673  ring->rxd_offset = 0;
674 
675  return VXGE_HW_OK;
676 }
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition: iobuf.c:145
struct io_buffer * iobuf[VXGE_HW_RING_BUF_PER_BLOCK+1]
Definition: vxge_config.h:378
struct __vxge_hw_ring_block * rxdl
Definition: vxge_config.h:370
#define ARRAY_SIZE(x)
Definition: efx_common.h:43
#define vxge_trace()
Definition: vxge_config.h:767
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint8_t u8
Definition: stdint.h:19

References ARRAY_SIZE, free_dma(), free_iob(), __vxge_hw_ring::iobuf, NULL, __vxge_hw_ring::rxd_offset, __vxge_hw_ring::rxdl, VXGE_HW_OK, and vxge_trace.

Referenced by __vxge_hw_ring_create(), and vxge_hw_vpath_close().

◆ __vxge_hw_legacy_swapper_set()

enum vxge_hw_status __vxge_hw_legacy_swapper_set ( struct vxge_hw_legacy_reg __iomem legacy_reg)

Definition at line 683 of file vxge_config.c.

684 {
685  u64 val64;
687 
688  vxge_trace();
689 
690  val64 = readq(&legacy_reg->toc_swapper_fb);
691 
692  wmb();
693 
694  switch (val64) {
695 
697  return status;
698 
708  break;
709 
715  break;
716 
722  break;
723  }
724 
725  wmb();
726 
727  val64 = readq(&legacy_reg->toc_swapper_fb);
728  if (val64 != VXGE_HW_SWAPPER_INITIAL_VALUE)
730 
731  return status;
732 }
wmb()
struct vxge_hw_legacy_reg * legacy_reg
Definition: vxge_config.h:495
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_SWAPPER_BYTE_SWAPPED
Definition: vxge_reg.h:623
#define VXGE_HW_SWAPPER_BIT_FLIPPED
Definition: vxge_reg.h:624
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_SWAPPER_WRITE_BIT_FLAP_ENABLE
Definition: vxge_reg.h:636
#define VXGE_HW_SWAPPER_READ_BYTE_SWAP_ENABLE
Definition: vxge_reg.h:627
#define VXGE_HW_SWAPPER_READ_BIT_FLAP_ENABLE
Definition: vxge_reg.h:630
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_SWAPPER_INITIAL_VALUE
Definition: vxge_reg.h:622
#define VXGE_HW_SWAPPER_WRITE_BYTE_SWAP_ENABLE
Definition: vxge_reg.h:633
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_SWAPPER_BYTE_SWAPPED_BIT_FLIPPED
Definition: vxge_reg.h:625
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __vxge_hw_device::legacy_reg, vxge_hw_legacy_reg::pifm_rd_flip_en, vxge_hw_legacy_reg::pifm_rd_swap_en, vxge_hw_legacy_reg::pifm_wr_flip_en, vxge_hw_legacy_reg::pifm_wr_swap_en, readq(), status, vxge_hw_legacy_reg::toc_swapper_fb, VXGE_HW_ERR_SWAPPER_CTRL, VXGE_HW_OK, VXGE_HW_SWAPPER_BIT_FLIPPED, VXGE_HW_SWAPPER_BYTE_SWAPPED, VXGE_HW_SWAPPER_BYTE_SWAPPED_BIT_FLIPPED, VXGE_HW_SWAPPER_INITIAL_VALUE, VXGE_HW_SWAPPER_READ_BIT_FLAP_ENABLE, VXGE_HW_SWAPPER_READ_BYTE_SWAP_ENABLE, VXGE_HW_SWAPPER_WRITE_BIT_FLAP_ENABLE, VXGE_HW_SWAPPER_WRITE_BYTE_SWAP_ENABLE, vxge_trace, wmb(), and writeq().

Referenced by __vxge_hw_device_get_legacy_reg(), and __vxge_hw_vpath_initialize().

◆ __vxge_hw_vpath_swapper_set()

enum vxge_hw_status __vxge_hw_vpath_swapper_set ( struct vxge_hw_vpath_reg __iomem vpath_reg)

Definition at line 739 of file vxge_config.c.

740 {
741  vxge_trace();
742 
743 #if (__BYTE_ORDER != __BIG_ENDIAN)
744  u64 val64;
745 
747  wmb();
750  wmb();
751 #endif
752  return VXGE_HW_OK;
753 }
wmb()
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_VPATH_GENERAL_CFG1_CTL_BYTE_SWAPEN
Definition: vxge_reg.h:558
uint64_t u64
Definition: stdint.h:25
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
#define vxge_trace()
Definition: vxge_config.h:767
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References readq(), vxge_hw_vpath_reg::vpath_general_cfg1, __vxge_hw_device::vpath_reg, VXGE_HW_OK, VXGE_HW_VPATH_GENERAL_CFG1_CTL_BYTE_SWAPEN, vxge_trace, wmb(), and writeq().

Referenced by __vxge_hw_vpath_initialize().

◆ __vxge_hw_kdfc_swapper_set()

enum vxge_hw_status __vxge_hw_kdfc_swapper_set ( struct vxge_hw_legacy_reg __iomem legacy_reg,
struct vxge_hw_vpath_reg __iomem vpath_reg 
)

Definition at line 760 of file vxge_config.c.

763 {
764  u64 val64;
765 
766  vxge_trace();
767 
768  val64 = readq(&legacy_reg->pifm_wr_swap_en);
769 
771  val64 = readq(&vpath_reg->kdfcctl_cfg0);
772  wmb();
773 
777 
778  writeq(val64, &vpath_reg->kdfcctl_cfg0);
779  wmb();
780  }
781 
782  return VXGE_HW_OK;
783 }
wmb()
#define VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO2
Definition: vxge_reg.h:573
struct vxge_hw_legacy_reg * legacy_reg
Definition: vxge_config.h:495
#define VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO1
Definition: vxge_reg.h:572
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint64_t u64
Definition: stdint.h:25
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
#define VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO0
Definition: vxge_reg.h:571
#define VXGE_HW_SWAPPER_WRITE_BYTE_SWAP_ENABLE
Definition: vxge_reg.h:633
#define vxge_trace()
Definition: vxge_config.h:767
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References vxge_hw_vpath_reg::kdfcctl_cfg0, __vxge_hw_device::legacy_reg, vxge_hw_legacy_reg::pifm_wr_swap_en, readq(), __vxge_hw_device::vpath_reg, VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO0, VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO1, VXGE_HW_KDFCCTL_CFG0_BYTE_SWAPEN_FIFO2, VXGE_HW_OK, VXGE_HW_SWAPPER_WRITE_BYTE_SWAP_ENABLE, vxge_trace, wmb(), and writeq().

Referenced by __vxge_hw_vpath_kdfc_configure().

◆ vxge_hw_vpath_strip_fcs_check()

enum vxge_hw_status vxge_hw_vpath_strip_fcs_check ( struct __vxge_hw_device hldev,
u64  vpath_mask 
)

Definition at line 789 of file vxge_config.c.

790 {
791  struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
793  int i = 0, j = 0;
794 
795  for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
796  if (!((vpath_mask) & vxge_mBIT(i)))
797  continue;
798  vpmgmt_reg = hldev->vpmgmt_reg[i];
799  for (j = 0; j < VXGE_HW_MAC_MAX_MAC_PORT_ID; j++) {
800  if (readq(&vpmgmt_reg->rxmac_cfg0_port_vpmgmt_clone[j])
802  return VXGE_HW_FAIL;
803  }
804  }
805  return status;
806 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_MAC_MAX_MAC_PORT_ID
Definition: vxge_traffic.h:34
u64 rxmac_cfg0_port_vpmgmt_clone[3]
Definition: vxge_reg.h:3916
#define VXGE_HW_MAX_VIRTUAL_PATHS
Definition: vxge_traffic.h:30
#define __iomem
Definition: igbvf_osdep.h:45
struct vxge_hw_vpmgmt_reg * vpmgmt_reg[VXGE_HW_TITAN_VPMGMT_REG_SPACES]
Definition: vxge_config.h:501
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
#define VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS
Definition: vxge_reg.h:96
vxge_hw_status
Definition: vxge_config.h:70

References __iomem, readq(), vxge_hw_vpmgmt_reg::rxmac_cfg0_port_vpmgmt_clone, status, __vxge_hw_device::vpmgmt_reg, VXGE_HW_FAIL, VXGE_HW_MAC_MAX_MAC_PORT_ID, VXGE_HW_MAX_VIRTUAL_PATHS, VXGE_HW_OK, VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS, and vxge_mBIT.

Referenced by vxge_probe().

◆ __vxge_hw_fifo_create()

enum vxge_hw_status __vxge_hw_fifo_create ( struct __vxge_hw_virtualpath vpath,
struct __vxge_hw_fifo fifo 
)

Definition at line 813 of file vxge_config.c.

815 {
817 
818  vxge_trace();
819 
820  fifo->vpathh = vpath;
822  fifo->hw_offset = fifo->sw_offset = 0;
823  fifo->nofl_db = vpath->nofl_db;
824  fifo->vp_id = vpath->vp_id;
825  fifo->vp_reg = vpath->vp_reg;
826  fifo->tx_intr_num = (vpath->vp_id * VXGE_HW_MAX_INTR_PER_VP)
828 
829  fifo->txdl = malloc_dma(sizeof(struct vxge_hw_fifo_txd)
830  * fifo->depth, fifo->depth);
831  if (!fifo->txdl) {
832  vxge_debug(VXGE_ERR, "%s:%d malloc_dma error\n",
833  __func__, __LINE__);
835  }
836  memset(fifo->txdl, 0, sizeof(struct vxge_hw_fifo_txd) * fifo->depth);
837  return status;
838 }
#define VXGE_HW_FIFO_TXD_DEPTH
Definition: vxge_config.h:329
struct __vxge_hw_virtualpath * vpathh
Definition: vxge_config.h:334
struct vxge_hw_fifo_txd - Transmit Descriptor
Definition: vxge_config.h:212
struct __vxge_hw_non_offload_db_wrapper * nofl_db
Definition: vxge_config.h:324
#define vxge_debug(mask, fmt...)
Definition: vxge_config.h:762
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_MAX_INTR_PER_VP
Definition: vxge_traffic.h:129
#define VXGE_HW_VPATH_INTR_TX
Definition: vxge_traffic.h:130
struct __vxge_hw_non_offload_db_wrapper * nofl_db
Definition: vxge_config.h:399
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
static void *__malloc malloc_dma(size_t size, size_t phys_align)
Allocate memory for DMA.
Definition: malloc.h:66
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:323
struct vxge_hw_fifo_txd * txdl
Definition: vxge_config.h:328
#define VXGE_ERR
Definition: vxge_config.h:54
void * memset(void *dest, int character, size_t len) __nonnull

References __vxge_hw_fifo::depth, __vxge_hw_fifo::hw_offset, malloc_dma(), memset(), __vxge_hw_fifo::nofl_db, __vxge_hw_virtualpath::nofl_db, status, __vxge_hw_fifo::sw_offset, __vxge_hw_fifo::tx_intr_num, __vxge_hw_fifo::txdl, __vxge_hw_fifo::vp_id, __vxge_hw_virtualpath::vp_id, __vxge_hw_fifo::vp_reg, __vxge_hw_virtualpath::vp_reg, __vxge_hw_fifo::vpathh, vxge_debug, VXGE_ERR, VXGE_HW_ERR_OUT_OF_MEMORY, VXGE_HW_FIFO_TXD_DEPTH, VXGE_HW_MAX_INTR_PER_VP, VXGE_HW_OK, VXGE_HW_VPATH_INTR_TX, and vxge_trace.

Referenced by vxge_hw_vpath_open().

◆ __vxge_hw_fifo_delete()

enum vxge_hw_status __vxge_hw_fifo_delete ( struct __vxge_hw_fifo fifo)

Definition at line 844 of file vxge_config.c.

845 {
846  vxge_trace();
847 
848  if (fifo->txdl)
849  free_dma(fifo->txdl,
850  sizeof(struct vxge_hw_fifo_txd) * fifo->depth);
851 
852  fifo->txdl = NULL;
853  fifo->hw_offset = fifo->sw_offset = 0;
854 
855  return VXGE_HW_OK;
856 }
struct vxge_hw_fifo_txd - Transmit Descriptor
Definition: vxge_config.h:212
#define vxge_trace()
Definition: vxge_config.h:767
struct vxge_hw_fifo_txd * txdl
Definition: vxge_config.h:328
static void free_dma(void *ptr, size_t size)
Free memory allocated with malloc_dma()
Definition: malloc.h:81
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References __vxge_hw_fifo::depth, free_dma(), __vxge_hw_fifo::hw_offset, NULL, __vxge_hw_fifo::sw_offset, __vxge_hw_fifo::txdl, VXGE_HW_OK, and vxge_trace.

Referenced by vxge_hw_vpath_close(), and vxge_hw_vpath_open().

◆ __vxge_hw_vpath_pci_read()

enum vxge_hw_status __vxge_hw_vpath_pci_read ( struct __vxge_hw_virtualpath vpath,
u32  phy_func_0,
u32  offset,
u32 val 
)

Definition at line 864 of file vxge_config.c.

866 {
867  u64 val64;
869  struct vxge_hw_vpath_reg __iomem *vp_reg = vpath->vp_reg;
870 
872 
873  if (phy_func_0)
875 
876  writeq(val64, &vp_reg->pci_config_access_cfg1);
877  wmb();
879  &vp_reg->pci_config_access_cfg2);
880  wmb();
881 
883  &vp_reg->pci_config_access_cfg2,
885 
886  if (status != VXGE_HW_OK)
887  goto exit;
888 
889  val64 = readq(&vp_reg->pci_config_access_status);
890 
893  *val = 0;
894  } else
895  *val = (u32)vxge_bVALn(val64, 32, 32);
896 exit:
897  return status;
898 }
wmb()
u64 pci_config_access_status
Definition: vxge_reg.h:4653
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_INTR_MASK_ALL
Definition: vxge_traffic.h:29
uint8_t status
Status.
Definition: ena.h:16
#define u32
Definition: vga.h:21
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
#define vxge_bVALn(bits, loc, n)
Definition: vxge_reg.h:35
#define VXGE_HW_PCI_CONFIG_ACCESS_CFG2_REQ
Definition: vxge_reg.h:630
#define __iomem
Definition: igbvf_osdep.h:45
u64 pci_config_access_cfg1
Definition: vxge_reg.h:4648
void __asmcall int val
Definition: setjmp.h:28
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define VXGE_HW_PCI_CONFIG_ACCESS_CFG1_SEL_FUNC0
Definition: vxge_reg.h:628
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_PCI_CONFIG_ACCESS_CFG1_ADDRESS(val)
Definition: vxge_reg.h:627
#define VXGE_HW_PCI_CONFIG_ACCESS_STATUS_ACCESS_ERR
Definition: vxge_reg.h:632
u64 pci_config_access_cfg2
Definition: vxge_reg.h:4651
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
enum vxge_hw_status __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
Definition: vxge_config.c:147

References __iomem, __vxge_hw_device_register_poll(), offset, vxge_hw_vpath_reg::pci_config_access_cfg1, vxge_hw_vpath_reg::pci_config_access_cfg2, vxge_hw_vpath_reg::pci_config_access_status, readq(), status, u32, val, __vxge_hw_virtualpath::vp_reg, vxge_bVALn, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_FAIL, VXGE_HW_INTR_MASK_ALL, VXGE_HW_OK, VXGE_HW_PCI_CONFIG_ACCESS_CFG1_ADDRESS, VXGE_HW_PCI_CONFIG_ACCESS_CFG1_SEL_FUNC0, VXGE_HW_PCI_CONFIG_ACCESS_CFG2_REQ, VXGE_HW_PCI_CONFIG_ACCESS_STATUS_ACCESS_ERR, wmb(), and writeq().

Referenced by __vxge_hw_vpath_initialize().

◆ __vxge_hw_vpath_func_id_get()

u32 __vxge_hw_vpath_func_id_get ( struct vxge_hw_vpmgmt_reg __iomem vpmgmt_reg)

Definition at line 905 of file vxge_config.c.

906 {
907  u64 val64;
908 
909  val64 = readq(&vpmgmt_reg->vpath_to_func_map_cfg1);
910 
911  return
913 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_VPATH_TO_FUNC_MAP_CFG1_GET_VPATH_TO_FUNC_MAP_CFG1(bits)
Definition: vxge_reg.h:45
uint32_t u32
Definition: stdint.h:23

References readq(), and VXGE_HW_VPATH_TO_FUNC_MAP_CFG1_GET_VPATH_TO_FUNC_MAP_CFG1.

Referenced by __vxge_hw_device_host_info_get(), and vxge_hw_device_hw_info_get().

◆ __vxge_hw_read_rts_ds()

static void __vxge_hw_read_rts_ds ( struct vxge_hw_vpath_reg __iomem vpath_reg,
u64  dta_struct_sel 
)
inlinestatic

Definition at line 919 of file vxge_config.c.

921 {
922  writeq(0, &vpath_reg->rts_access_steer_ctrl);
923  wmb();
924  writeq(dta_struct_sel, &vpath_reg->rts_access_steer_data0);
925  writeq(0, &vpath_reg->rts_access_steer_data1);
926  wmb();
927  return;
928 }
wmb()
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References wmb(), and writeq().

Referenced by __vxge_hw_vpath_card_info_get().

◆ __vxge_hw_vpath_card_info_get()

enum vxge_hw_status __vxge_hw_vpath_card_info_get ( struct vxge_hw_vpath_reg __iomem vpath_reg,
struct vxge_hw_device_hw_info hw_info 
)

Definition at line 935 of file vxge_config.c.

938 {
939  u32 i, j;
940  u64 val64;
941  u64 data1 = 0ULL;
942  u64 data2 = 0ULL;
944  u8 *serial_number = hw_info->serial_number;
945  u8 *part_number = hw_info->part_number;
946  u8 *product_desc = hw_info->product_desc;
947 
948  __vxge_hw_read_rts_ds(vpath_reg,
950 
957 
959  &vpath_reg->rts_access_steer_ctrl,
962 
963  if (status != VXGE_HW_OK)
964  return status;
965 
966  val64 = readq(&vpath_reg->rts_access_steer_ctrl);
967 
969  data1 = readq(&vpath_reg->rts_access_steer_data0);
970  ((u64 *)serial_number)[0] = be64_to_cpu(data1);
971 
972  data2 = readq(&vpath_reg->rts_access_steer_data1);
973  ((u64 *)serial_number)[1] = be64_to_cpu(data2);
974  status = VXGE_HW_OK;
975  } else
976  *serial_number = 0;
977 
978  __vxge_hw_read_rts_ds(vpath_reg,
980 
987 
989  &vpath_reg->rts_access_steer_ctrl,
992 
993  if (status != VXGE_HW_OK)
994  return status;
995 
996  val64 = readq(&vpath_reg->rts_access_steer_ctrl);
997 
999 
1000  data1 = readq(&vpath_reg->rts_access_steer_data0);
1001  ((u64 *)part_number)[0] = be64_to_cpu(data1);
1002 
1003  data2 = readq(&vpath_reg->rts_access_steer_data1);
1004  ((u64 *)part_number)[1] = be64_to_cpu(data2);
1005 
1006  status = VXGE_HW_OK;
1007 
1008  } else
1009  *part_number = 0;
1010 
1011  j = 0;
1012 
1015 
1016  __vxge_hw_read_rts_ds(vpath_reg, i);
1017 
1024 
1026  &vpath_reg->rts_access_steer_ctrl,
1029 
1030  if (status != VXGE_HW_OK)
1031  return status;
1032 
1033  val64 = readq(&vpath_reg->rts_access_steer_ctrl);
1034 
1036 
1037  data1 = readq(&vpath_reg->rts_access_steer_data0);
1038  ((u64 *)product_desc)[j++] = be64_to_cpu(data1);
1039 
1040  data2 = readq(&vpath_reg->rts_access_steer_data1);
1041  ((u64 *)product_desc)[j++] = be64_to_cpu(data2);
1042 
1043  status = VXGE_HW_OK;
1044  } else
1045  *product_desc = 0;
1046  }
1047 
1048  return status;
1049 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET(val)
Definition: vxge_reg.h:189
u32 data1
Definition: ar9003_mac.h:71
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS
Definition: vxge_reg.h:188
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE
Definition: vxge_reg.h:185
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_0
Definition: vxge_reg.h:421
u8 serial_number[VXGE_HW_INFO_LEN]
Definition: vxge_config.h:460
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_MEMO_ENTRY
Definition: vxge_reg.h:188
#define be64_to_cpu(value)
Definition: byteswap.h:117
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_SERIAL_NUMBER
Definition: vxge_reg.h:418
u8 product_desc[VXGE_HW_INFO_LEN]
Definition: vxge_config.h:462
static enum vxge_hw_status __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, u64 mask, u32 max_millis)
Definition: vxge_config.h:714
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_3
Definition: vxge_reg.h:424
u32 data2
Definition: ar9003_mac.h:73
u8 part_number[VXGE_HW_INFO_LEN]
Definition: vxge_config.h:461
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO
Definition: vxge_reg.h:204
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(val)
Definition: vxge_reg.h:183
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_PART_NUMBER
Definition: vxge_reg.h:417
static void __vxge_hw_read_rts_ds(struct vxge_hw_vpath_reg __iomem *vpath_reg, u64 dta_struct_sel)
Definition: vxge_config.c:919
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL(val)
Definition: vxge_reg.h:184
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_pio_mem_write64(), __vxge_hw_read_rts_ds(), be64_to_cpu, data1, data2, vxge_hw_device_hw_info::part_number, vxge_hw_device_hw_info::product_desc, readq(), vxge_hw_device_hw_info::serial_number, status, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_OK, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_MEMO_ENTRY, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO, VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET, VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS, VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE, VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_0, VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_3, VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_PART_NUMBER, and VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_SERIAL_NUMBER.

Referenced by vxge_hw_device_hw_info_get().

◆ __vxge_hw_vpath_fw_ver_get()

enum vxge_hw_status __vxge_hw_vpath_fw_ver_get ( struct vxge_hw_vpath_reg __iomem vpath_reg,
struct vxge_hw_device_hw_info hw_info 
)

Definition at line 1056 of file vxge_config.c.

1059 {
1060  u64 val64;
1061  u64 data1 = 0ULL;
1062  u64 data2 = 0ULL;
1063  struct vxge_hw_device_version *fw_version = &hw_info->fw_version;
1064  struct vxge_hw_device_date *fw_date = &hw_info->fw_date;
1065  struct vxge_hw_device_version *flash_version = &hw_info->flash_version;
1066  struct vxge_hw_device_date *flash_date = &hw_info->flash_date;
1068 
1075 
1077  &vpath_reg->rts_access_steer_ctrl,
1080 
1081  if (status != VXGE_HW_OK)
1082  goto exit;
1083 
1084  val64 = readq(&vpath_reg->rts_access_steer_ctrl);
1085 
1087 
1088  data1 = readq(&vpath_reg->rts_access_steer_data0);
1089  data2 = readq(&vpath_reg->rts_access_steer_data1);
1090 
1091  fw_date->day =
1093  data1);
1094  fw_date->month =
1096  data1);
1097  fw_date->year =
1099  data1);
1100 
1101  snprintf(fw_date->date, VXGE_HW_FW_STRLEN, "%d/%d/%d",
1102  fw_date->month, fw_date->day, fw_date->year);
1103 
1104  fw_version->major =
1106  fw_version->minor =
1108  fw_version->build =
1110 
1111  snprintf(fw_version->version, VXGE_HW_FW_STRLEN, "%d.%d.%d",
1112  fw_version->major, fw_version->minor, fw_version->build);
1113 
1114  flash_date->day =
1116  flash_date->month =
1118  flash_date->year =
1120 
1121  snprintf(flash_date->date, VXGE_HW_FW_STRLEN, "%d/%d/%d",
1122  flash_date->month, flash_date->day, flash_date->year);
1123 
1124  flash_version->major =
1126  flash_version->minor =
1128  flash_version->build =
1130 
1131  snprintf(flash_version->version, VXGE_HW_FW_STRLEN, "%d.%d.%d",
1132  flash_version->major, flash_version->minor,
1133  flash_version->build);
1134 
1135  status = VXGE_HW_OK;
1136 
1137  } else
1138  status = VXGE_HW_FAIL;
1139 exit:
1140  return status;
1141 }
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_BUILD(bits)
Definition: vxge_reg.h:479
struct vxge_hw_device_date fw_date
Definition: vxge_config.h:457
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_DAY(bits)
Definition: vxge_reg.h:462
struct vxge_hw_device_date flash_date
Definition: vxge_config.h:459
struct vxge_hw_device_version fw_version
Definition: vxge_config.h:456
char date[VXGE_HW_FW_STRLEN]
Definition: vxge_config.h:262
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MAJOR(bits)
Definition: vxge_reg.h:451
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_FW_STRLEN
struct vxge_hw_device_date - Date Format @day: Day @month: Month @year: Year
Definition: vxge_config.h:257
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET(val)
Definition: vxge_reg.h:189
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MINOR(bits)
Definition: vxge_reg.h:454
u32 data1
Definition: ar9003_mac.h:71
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS
Definition: vxge_reg.h:188
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MONTH(bits)
Definition: vxge_reg.h:465
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MAJOR(bits)
Definition: vxge_reg.h:473
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_YEAR(bits)
Definition: vxge_reg.h:468
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_BUILD(bits)
Definition: vxge_reg.h:457
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE
Definition: vxge_reg.h:185
#define u32
Definition: vga.h:21
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MINOR(bits)
Definition: vxge_reg.h:476
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
struct vxge_hw_device_version flash_version
Definition: vxge_config.h:458
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_YEAR(bits)
Definition: vxge_reg.h:446
static enum vxge_hw_status __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, u64 mask, u32 max_millis)
Definition: vxge_config.h:714
u32 data2
Definition: ar9003_mac.h:73
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_ENTRY
Definition: vxge_reg.h:186
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MONTH(bits)
Definition: vxge_reg.h:443
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO
Definition: vxge_reg.h:204
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(val)
Definition: vxge_reg.h:183
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_DAY(bits)
Definition: vxge_reg.h:440
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL(val)
Definition: vxge_reg.h:184
char version[VXGE_HW_FW_STRLEN]
Definition: vxge_config.h:269

References __vxge_hw_pio_mem_write64(), vxge_hw_device_version::build, data1, data2, vxge_hw_device_date::date, vxge_hw_device_date::day, vxge_hw_device_hw_info::flash_date, vxge_hw_device_hw_info::flash_version, vxge_hw_device_hw_info::fw_date, vxge_hw_device_hw_info::fw_version, vxge_hw_device_version::major, vxge_hw_device_version::minor, vxge_hw_device_date::month, readq(), snprintf(), status, u32, vxge_hw_device_version::version, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_FAIL, VXGE_HW_FW_STRLEN, VXGE_HW_OK, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_ENTRY, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO, VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET, VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS, VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_BUILD, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_DAY, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MAJOR, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MINOR, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_MONTH, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_FW_VER_YEAR, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_BUILD, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_DAY, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MAJOR, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MINOR, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_MONTH, VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_FLASH_VER_YEAR, and vxge_hw_device_date::year.

Referenced by vxge_hw_device_hw_info_get().

◆ __vxge_hw_vpath_addr_get()

enum vxge_hw_status __vxge_hw_vpath_addr_get ( struct vxge_hw_vpath_reg vpath_reg,
u8(macaddr)  [ETH_ALEN],
u8(macaddr_mask)  [ETH_ALEN] 
)

Definition at line 1148 of file vxge_config.c.

1151 {
1152  u32 i;
1153  u64 val64;
1154  u64 data1 = 0ULL;
1155  u64 data2 = 0ULL;
1158 
1159  while (1) {
1160  val64 = VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(action) |
1165 
1167  &vpath_reg->rts_access_steer_ctrl,
1170 
1171  if (status != VXGE_HW_OK)
1172  break;
1173 
1174  val64 = readq(&vpath_reg->rts_access_steer_ctrl);
1175 
1177 
1178  data1 = readq(&vpath_reg->rts_access_steer_data0);
1179  data2 = readq(&vpath_reg->rts_access_steer_data1);
1180 
1181  data1 =
1183  data2 =
1185  data2);
1186 
1187  for (i = ETH_ALEN; i > 0; i--) {
1188  macaddr[i-1] = (u8)(data1 & 0xFF);
1189  data1 >>= 8;
1190 
1191  macaddr_mask[i-1] = (u8)(data2 & 0xFF);
1192  data2 >>= 8;
1193  }
1194  if (is_valid_ether_addr(macaddr)) {
1195  status = VXGE_HW_OK;
1196  break;
1197  }
1198  action =
1200  } else
1201  status = VXGE_HW_FAIL;
1202  }
1203 
1204  return status;
1205 }
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY
Definition: vxge_reg.h:185
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET(val)
Definition: vxge_reg.h:189
u32 data1
Definition: ar9003_mac.h:71
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA
Definition: vxge_reg.h:192
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS
Definition: vxge_reg.h:188
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_FIRST_ENTRY
Definition: vxge_reg.h:184
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE
Definition: vxge_reg.h:185
uint64_t u64
Definition: stdint.h:25
u64 rts_access_steer_data0
Definition: vxge_reg.h:4215
#define u8
Definition: igbvf_osdep.h:38
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
u64 rts_access_steer_ctrl
Definition: vxge_reg.h:4204
static enum vxge_hw_status __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr, u64 mask, u32 max_millis)
Definition: vxge_config.h:714
#define ETH_ALEN
Definition: if_ether.h:8
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
Definition: ethernet.h:77
u64 rts_access_steer_data1
Definition: vxge_reg.h:4217
#define VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_DA_MAC_ADDR_MASK(bits)
Definition: vxge_reg.h:365
u32 data2
Definition: ar9003_mac.h:73
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION(val)
Definition: vxge_reg.h:183
#define VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL(val)
Definition: vxge_reg.h:184
#define VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_DA_MAC_ADDR(bits)
Definition: vxge_reg.h:206
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_pio_mem_write64(), data1, data2, ETH_ALEN, is_valid_ether_addr(), readq(), vxge_hw_vpath_reg::rts_access_steer_ctrl, vxge_hw_vpath_reg::rts_access_steer_data0, vxge_hw_vpath_reg::rts_access_steer_data1, status, u8, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_FAIL, VXGE_HW_OK, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_FIRST_ENTRY, VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL, VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA, VXGE_HW_RTS_ACCESS_STEER_CTRL_OFFSET, VXGE_HW_RTS_ACCESS_STEER_CTRL_RMACJ_STATUS, VXGE_HW_RTS_ACCESS_STEER_CTRL_STROBE, VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_DA_MAC_ADDR, and VXGE_HW_RTS_ACCESS_STEER_DATA1_GET_DA_MAC_ADDR_MASK.

Referenced by vxge_hw_device_hw_info_get().

◆ __vxge_hw_vpath_mgmt_read()

static enum vxge_hw_status __vxge_hw_vpath_mgmt_read ( struct __vxge_hw_virtualpath vpath)
static

Definition at line 1212 of file vxge_config.c.

1214 {
1215  u32 i, mtu = 0, max_pyld = 0;
1216  u64 val64;
1218 
1219  for (i = 0; i < VXGE_HW_MAC_MAX_MAC_PORT_ID; i++) {
1220 
1221  val64 = readq(&vpath->vpmgmt_reg->
1223  max_pyld =
1224  (u32)
1226  (val64);
1227  if (mtu < max_pyld)
1228  mtu = max_pyld;
1229  }
1230 
1232 
1234 
1237  else
1239 
1240  return status;
1241 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_MAC_MAX_MAC_PORT_ID
Definition: vxge_traffic.h:34
#define VXGE_HW_XGMAC_GEN_STATUS_VPMGMT_CLONE_XMACJ_NTWK_OK
Definition: vxge_reg.h:129
#define u32
Definition: vga.h:21
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_MAC_HEADER_MAX_SIZE
Definition: vxge_traffic.h:41
u64 xgmac_gen_status_vpmgmt_clone
Definition: vxge_reg.h:3950
#define VXGE_HW_DEVICE_LINK_STATE_SET(hldev, ls)
Definition: vxge_config.h:517
#define VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_GET_MAX_PYLD_LEN(bits)
Definition: vxge_reg.h:96
u64 rxmac_cfg0_port_vpmgmt_clone[3]
Definition: vxge_reg.h:94
struct vxge_hw_vpmgmt_reg * vpmgmt_reg
Definition: vxge_config.h:398
uint32_t mtu
Maximum MTU.
Definition: ena.h:28
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_virtualpath::hldev, __vxge_hw_virtualpath::max_mtu, mtu, readq(), rxmac_cfg0_port_vpmgmt_clone, status, u32, __vxge_hw_virtualpath::vpmgmt_reg, VXGE_HW_DEVICE_LINK_STATE_SET, VXGE_HW_LINK_DOWN, VXGE_HW_LINK_UP, VXGE_HW_MAC_HEADER_MAX_SIZE, VXGE_HW_MAC_MAX_MAC_PORT_ID, VXGE_HW_OK, VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_GET_MAX_PYLD_LEN, VXGE_HW_XGMAC_GEN_STATUS_VPMGMT_CLONE_XMACJ_NTWK_OK, and vxge_hw_vpmgmt_reg::xgmac_gen_status_vpmgmt_clone.

Referenced by __vxge_hw_vp_initialize().

◆ __vxge_hw_vpath_reset_check()

enum vxge_hw_status __vxge_hw_vpath_reset_check ( struct __vxge_hw_virtualpath vpath)

Definition at line 1249 of file vxge_config.c.

1250 {
1251  enum vxge_hw_status status;
1252 
1253  vxge_trace();
1254 
1258  1 << (16 - vpath->vp_id)),
1260 
1261  return status;
1262 }
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_DEF_DEVICE_POLL_MILLIS
Definition: vxge_config.h:67
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
#define VXGE_HW_VPATH_RST_IN_PROG_VPATH_RST_IN_PROG(val)
Definition: vxge_reg.h:168
enum vxge_hw_status __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
Definition: vxge_config.c:147

References __vxge_hw_device_register_poll(), __vxge_hw_device::common_reg, __vxge_hw_virtualpath::hldev, status, __vxge_hw_virtualpath::vp_id, vxge_hw_common_reg::vpath_rst_in_prog, VXGE_HW_DEF_DEVICE_POLL_MILLIS, VXGE_HW_VPATH_RST_IN_PROG_VPATH_RST_IN_PROG, and vxge_trace.

Referenced by __vxge_hw_vp_initialize(), vxge_hw_vpath_recover_from_reset(), and vxge_reset_all_vpaths().

◆ __vxge_hw_vpath_reset()

enum vxge_hw_status __vxge_hw_vpath_reset ( struct __vxge_hw_device hldev,
u32  vp_id 
)

Definition at line 1269 of file vxge_config.c.

1270 {
1271  u64 val64;
1273 
1274  vxge_trace();
1275 
1276  val64 = VXGE_HW_CMN_RSTHDLR_CFG0_SW_RESET_VPATH(1 << (16 - vp_id));
1277 
1279  &hldev->common_reg->cmn_rsthdlr_cfg0);
1280 
1281  return status;
1282 }
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
static void __vxge_hw_pio_mem_write32_upper(u32 val, void __iomem *addr)
Definition: vxge_config.h:703
#define VXGE_HW_CMN_RSTHDLR_CFG0_SW_RESET_VPATH(val)
Definition: vxge_reg.h:72
uint8_t status
Status.
Definition: ena.h:16
uint64_t u64
Definition: stdint.h:25
#define vxge_bVALn(bits, loc, n)
Definition: vxge_reg.h:35
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_pio_mem_write32_upper(), vxge_hw_common_reg::cmn_rsthdlr_cfg0, __vxge_hw_device::common_reg, status, vxge_bVALn, VXGE_HW_CMN_RSTHDLR_CFG0_SW_RESET_VPATH, VXGE_HW_OK, and vxge_trace.

Referenced by __vxge_hw_vp_initialize(), and vxge_hw_vpath_reset().

◆ __vxge_hw_vpath_prc_configure()

void __vxge_hw_vpath_prc_configure ( struct __vxge_hw_device hldev)

Definition at line 1290 of file vxge_config.c.

1291 {
1292  u64 val64;
1293  struct __vxge_hw_virtualpath *vpath;
1294  struct vxge_hw_vpath_reg __iomem *vp_reg;
1295 
1296  vxge_trace();
1297 
1298  vpath = &hldev->virtual_path;
1299  vp_reg = vpath->vp_reg;
1300 
1301  val64 = readq(&vp_reg->prc_cfg1);
1303  writeq(val64, &vp_reg->prc_cfg1);
1304 
1305  val64 = readq(&vpath->vp_reg->prc_cfg6);
1306  val64 &= ~VXGE_HW_PRC_CFG6_RXD_CRXDT(0x1ff);
1307  val64 &= ~VXGE_HW_PRC_CFG6_RXD_SPAT(0x1ff);
1309  val64 |= VXGE_HW_PRC_CFG6_RXD_CRXDT(0x3);
1310  val64 |= VXGE_HW_PRC_CFG6_RXD_SPAT(0xf);
1311  writeq(val64, &vpath->vp_reg->prc_cfg6);
1312 
1314  (u64)virt_to_bus(vpath->ringh.rxdl) >> 3),
1315  &vp_reg->prc_cfg5);
1316 
1317  val64 = readq(&vp_reg->prc_cfg4);
1318  val64 |= VXGE_HW_PRC_CFG4_IN_SVC;
1319  val64 &= ~VXGE_HW_PRC_CFG4_RING_MODE(0x3);
1320  val64 |= VXGE_HW_PRC_CFG4_RING_MODE(
1323 
1324  writeq(val64, &vp_reg->prc_cfg4);
1325  return;
1326 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_PRC_CFG6_RXD_CRXDT(val)
Definition: vxge_reg.h:63
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
#define VXGE_HW_PRC_CFG4_RING_MODE(val)
Definition: vxge_reg.h:47
#define VXGE_HW_PRC_CFG1_RTI_TINT_DISABLE
Definition: vxge_reg.h:38
#define VXGE_HW_PRC_CFG5_RXD0_ADD(val)
Definition: vxge_reg.h:56
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
#define VXGE_HW_PRC_CFG6_DOORBELL_MODE_EN
Definition: vxge_reg.h:60
#define VXGE_HW_PRC_CFG4_RTH_DISABLE
Definition: vxge_reg.h:50
uint64_t u64
Definition: stdint.h:25
struct __vxge_hw_ring_block * rxdl
Definition: vxge_config.h:370
#define __iomem
Definition: igbvf_osdep.h:45
struct __vxge_hw_ring ringh
Definition: vxge_config.h:406
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define vxge_trace()
Definition: vxge_config.h:767
#define VXGE_HW_PRC_CFG4_IN_SVC
Definition: vxge_reg.h:46
#define VXGE_HW_PRC_CFG6_RXD_SPAT(val)
Definition: vxge_reg.h:65
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
#define VXGE_HW_PRC_CFG4_RING_MODE_ONE_BUFFER
Definition: vxge_reg.h:139

References __iomem, vxge_hw_vpath_reg::prc_cfg1, vxge_hw_vpath_reg::prc_cfg4, vxge_hw_vpath_reg::prc_cfg5, vxge_hw_vpath_reg::prc_cfg6, readq(), __vxge_hw_virtualpath::ringh, __vxge_hw_ring::rxdl, virt_to_bus(), __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, VXGE_HW_PRC_CFG1_RTI_TINT_DISABLE, VXGE_HW_PRC_CFG4_IN_SVC, VXGE_HW_PRC_CFG4_RING_MODE, VXGE_HW_PRC_CFG4_RING_MODE_ONE_BUFFER, VXGE_HW_PRC_CFG4_RTH_DISABLE, VXGE_HW_PRC_CFG5_RXD0_ADD, VXGE_HW_PRC_CFG6_DOORBELL_MODE_EN, VXGE_HW_PRC_CFG6_RXD_CRXDT, VXGE_HW_PRC_CFG6_RXD_SPAT, vxge_trace, and writeq().

Referenced by vxge_hw_vpath_open(), and vxge_hw_vpath_recover_from_reset().

◆ __vxge_hw_vpath_kdfc_configure()

enum vxge_hw_status __vxge_hw_vpath_kdfc_configure ( struct __vxge_hw_device hldev,
u32  vp_id 
)

Definition at line 1334 of file vxge_config.c.

1335 {
1336  u64 val64;
1337  u64 vpath_stride;
1339  struct __vxge_hw_virtualpath *vpath;
1340  struct vxge_hw_vpath_reg __iomem *vp_reg;
1341 
1342  vxge_trace();
1343 
1344  vpath = &hldev->virtual_path;
1345  vp_reg = vpath->vp_reg;
1346  status = __vxge_hw_kdfc_swapper_set(hldev->legacy_reg, vp_reg);
1347 
1348  if (status != VXGE_HW_OK)
1349  goto exit;
1350 
1351  val64 = readq(&vp_reg->kdfc_drbl_triplet_total);
1352 
1353  vpath->max_kdfc_db =
1355  val64+1)/2;
1356 
1357  vpath->max_nofl_db = vpath->max_kdfc_db;
1358 
1360  (vpath->max_nofl_db*2)-1);
1361 
1362  writeq(val64, &vp_reg->kdfc_fifo_trpl_partition);
1363 
1365  &vp_reg->kdfc_fifo_trpl_ctrl);
1366 
1367  val64 = readq(&vp_reg->kdfc_trpl_fifo_0_ctrl);
1368 
1369  val64 &= ~(VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_MODE(0x3) |
1371 
1374 #if (__BYTE_ORDER != __BIG_ENDIAN)
1376 #endif
1378 
1379  writeq(val64, &vp_reg->kdfc_trpl_fifo_0_ctrl);
1380  writeq((u64)0, &vp_reg->kdfc_trpl_fifo_0_wb_address);
1381  wmb();
1382  vpath_stride = readq(&hldev->toc_reg->toc_kdfc_vpath_stride);
1383 
1384  vpath->nofl_db =
1386  (hldev->kdfc + (vp_id *
1388  vpath_stride)));
1389 exit:
1390  return status;
1391 }
wmb()
u64 kdfc_trpl_fifo_0_wb_address
Definition: vxge_reg.h:4157
struct vxge_hw_legacy_reg * legacy_reg
Definition: vxge_config.h:495
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
#define VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_MODE(val)
Definition: vxge_reg.h:101
u64 kdfc_fifo_trpl_partition
Definition: vxge_reg.h:4116
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_kdfc_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg, struct vxge_hw_vpath_reg __iomem *vpath_reg)
Definition: vxge_config.c:760
#define VXGE_HW_TOC_KDFC_VPATH_STRIDE_GET_TOC_KDFC_VPATH_STRIDE(bits)
Definition: vxge_reg.h:124
#define VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_SELECT(val)
Definition: vxge_reg.h:109
#define VXGE_HW_KDFC_DRBL_TRIPLET_TOTAL_GET_KDFC_MAX_SIZE(bits)
Definition: vxge_reg.h:105
#define u32
Definition: vga.h:21
uint64_t u64
Definition: stdint.h:25
u64 kdfc_trpl_fifo_0_ctrl
Definition: vxge_reg.h:4122
#define VXGE_HW_KDFC_FIFO_TRPL_CTRL_TRIPLET_ENABLE
Definition: vxge_reg.h:99
#define __iomem
Definition: igbvf_osdep.h:45
#define VXGE_HW_KDFC_FIFO_TRPL_PARTITION_LENGTH_0(val)
Definition: vxge_reg.h:95
u64 kdfc_drbl_triplet_total
Definition: vxge_reg.h:4167
struct __vxge_hw_non_offload_db_wrapper * nofl_db
Definition: vxge_config.h:399
#define VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_SWAP_EN
Definition: vxge_reg.h:103
u64 toc_kdfc_vpath_stride
Definition: vxge_reg.h:697
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
struct vxge_hw_toc_reg * toc_reg
Definition: vxge_config.h:496
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_MODE_NON_OFFLOAD_ONLY
Definition: vxge_reg.h:109
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __iomem, __vxge_hw_kdfc_swapper_set(), __vxge_hw_device::kdfc, vxge_hw_vpath_reg::kdfc_drbl_triplet_total, vxge_hw_vpath_reg::kdfc_fifo_trpl_ctrl, vxge_hw_vpath_reg::kdfc_fifo_trpl_partition, vxge_hw_vpath_reg::kdfc_trpl_fifo_0_ctrl, vxge_hw_vpath_reg::kdfc_trpl_fifo_0_wb_address, __vxge_hw_device::legacy_reg, __vxge_hw_virtualpath::max_kdfc_db, __vxge_hw_virtualpath::max_nofl_db, __vxge_hw_virtualpath::nofl_db, readq(), status, vxge_hw_toc_reg::toc_kdfc_vpath_stride, __vxge_hw_device::toc_reg, u32, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, VXGE_HW_KDFC_DRBL_TRIPLET_TOTAL_GET_KDFC_MAX_SIZE, VXGE_HW_KDFC_FIFO_TRPL_CTRL_TRIPLET_ENABLE, VXGE_HW_KDFC_FIFO_TRPL_PARTITION_LENGTH_0, VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_MODE, VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_MODE_NON_OFFLOAD_ONLY, VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_SELECT, VXGE_HW_KDFC_TRPL_FIFO_0_CTRL_SWAP_EN, VXGE_HW_OK, VXGE_HW_TOC_KDFC_VPATH_STRIDE_GET_TOC_KDFC_VPATH_STRIDE, vxge_trace, wmb(), and writeq().

Referenced by __vxge_hw_vpath_initialize().

◆ __vxge_hw_vpath_mac_configure()

enum vxge_hw_status __vxge_hw_vpath_mac_configure ( struct __vxge_hw_device hldev)

Definition at line 1398 of file vxge_config.c.

1399 {
1400  u64 val64;
1402  struct __vxge_hw_virtualpath *vpath;
1403  struct vxge_hw_vpath_reg __iomem *vp_reg;
1404 
1405  vxge_trace();
1406 
1407  vpath = &hldev->virtual_path;
1408  vp_reg = vpath->vp_reg;
1409 
1411  vpath->vsport_number), &vp_reg->xmac_vsport_choice);
1412 
1413  val64 = readq(&vp_reg->rxmac_vcfg1);
1414 
1417 
1418  writeq(val64, &vp_reg->rxmac_vcfg1);
1419  return status;
1420 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_RXMAC_VCFG1_RTS_RTH_MULTI_IT_BD_MODE(val)
Definition: vxge_reg.h:179
uint64_t u64
Definition: stdint.h:25
#define __iomem
Definition: igbvf_osdep.h:45
#define VXGE_HW_XMAC_VSPORT_CHOICE_VSPORT_NUMBER(val)
Definition: vxge_reg.h:202
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RXMAC_VCFG1_RTS_RTH_MULTI_IT_EN_MODE
Definition: vxge_reg.h:180
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __iomem, readq(), vxge_hw_vpath_reg::rxmac_vcfg1, status, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, __vxge_hw_virtualpath::vsport_number, VXGE_HW_OK, VXGE_HW_RXMAC_VCFG1_RTS_RTH_MULTI_IT_BD_MODE, VXGE_HW_RXMAC_VCFG1_RTS_RTH_MULTI_IT_EN_MODE, VXGE_HW_XMAC_VSPORT_CHOICE_VSPORT_NUMBER, vxge_trace, writeq(), and vxge_hw_vpath_reg::xmac_vsport_choice.

Referenced by __vxge_hw_vpath_initialize().

◆ __vxge_hw_vpath_tim_configure()

enum vxge_hw_status __vxge_hw_vpath_tim_configure ( struct __vxge_hw_device hldev,
u32  vp_id 
)

Definition at line 1428 of file vxge_config.c.

1429 {
1430  u64 val64;
1432  struct __vxge_hw_virtualpath *vpath;
1433  struct vxge_hw_vpath_reg __iomem *vp_reg;
1434 
1435  vxge_trace();
1436 
1437  vpath = &hldev->virtual_path;
1438  vp_reg = vpath->vp_reg;
1439 
1440  writeq((u64)0, &vp_reg->tim_dest_addr);
1441  writeq((u64)0, &vp_reg->tim_vpath_map);
1442  writeq((u64)0, &vp_reg->tim_bitmap);
1443  writeq((u64)0, &vp_reg->tim_remap);
1444 
1446  (vp_id * VXGE_HW_MAX_INTR_PER_VP) +
1448 
1449  val64 = readq(&vp_reg->tim_pci_cfg);
1450  val64 |= VXGE_HW_TIM_PCI_CFG_ADD_PAD;
1451  writeq(val64, &vp_reg->tim_pci_cfg);
1452 
1453  /* TX configuration */
1455  (VXGE_TTI_BTIMER_VAL * 1000) / 272);
1462  writeq(val64, &vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
1463 
1468  writeq(val64, &vp_reg->tim_cfg2_int_num[VXGE_HW_VPATH_INTR_TX]);
1469 
1473  (VXGE_TTI_LTIMER_VAL * 1000) / 272);
1474  writeq(val64, &vp_reg->tim_cfg3_int_num[VXGE_HW_VPATH_INTR_TX]);
1475 
1476  /* RX configuration */
1478  (VXGE_RTI_BTIMER_VAL * 1000) / 272);
1483  writeq(val64, &vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_RX]);
1484 
1489  writeq(val64, &vp_reg->tim_cfg2_int_num[VXGE_HW_VPATH_INTR_RX]);
1490 
1494  (VXGE_RTI_LTIMER_VAL * 1000) / 272);
1495  writeq(val64, &vp_reg->tim_cfg3_int_num[VXGE_HW_VPATH_INTR_RX]);
1496 
1497  val64 = 0;
1504 
1505  return status;
1506 }
#define RTI_RX_UFC_A
Definition: vxge_main.h:118
#define VXGE_HW_TIM_CFG1_INT_NUM_URNG_A(val)
Definition: vxge_reg.h:271
#define VXGE_HW_TIM_CFG3_INT_NUM_LTIMER_VAL(val)
Definition: vxge_reg.h:284
#define TTI_TX_URANGE_C
Definition: vxge_main.h:95
u64 tim_cfg2_int_num[4]
Definition: vxge_reg.h:4296
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
#define VXGE_HW_VPATH_INTR_EINTA
Definition: vxge_traffic.h:132
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
#define TTI_TX_UFC_A
Definition: vxge_main.h:96
#define VXGE_HW_TIM_CFG2_INT_NUM_UEC_C(val)
Definition: vxge_reg.h:277
u64 tim_cfg3_int_num[4]
Definition: vxge_reg.h:4301
#define VXGE_HW_TIM_CFG2_INT_NUM_UEC_B(val)
Definition: vxge_reg.h:276
u64 tim_cfg1_int_num[4]
Definition: vxge_reg.h:4286
#define VXGE_HW_TIM_CFG2_INT_NUM_UEC_D(val)
Definition: vxge_reg.h:278
#define VXGE_HW_VPATH_INTR_RX
Definition: vxge_traffic.h:131
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_TTI_BTIMER_VAL
Definition: vxge_main.h:73
#define RTI_RX_URANGE_A
Definition: vxge_main.h:112
#define VXGE_HW_MAX_INTR_PER_VP
Definition: vxge_traffic.h:129
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_TIM_CFG1_INT_NUM_URNG_C(val)
Definition: vxge_reg.h:273
#define TTI_TX_UFC_B
Definition: vxge_main.h:97
#define VXGE_HW_VPATH_INTR_BMAP
Definition: vxge_traffic.h:133
#define TTI_TX_URANGE_B
Definition: vxge_main.h:94
#define VXGE_HW_TIM_PCI_CFG_ADD_PAD
Definition: vxge_reg.h:306
#define __iomem
Definition: igbvf_osdep.h:45
#define RTI_RX_URANGE_C
Definition: vxge_main.h:114
#define VXGE_HW_TIM_UTIL_SEL_LEGACY_RX_NET_UTIL
Definition: vxge_traffic.h:138
#define VXGE_HW_TIM_CFG1_INT_NUM_BTIMER_VAL(val)
Definition: vxge_reg.h:265
#define VXGE_HW_TIM_CFG1_INT_NUM_TIMER_AC
Definition: vxge_reg.h:269
#define VXGE_HW_VPATH_INTR_TX
Definition: vxge_traffic.h:130
#define RTI_RX_UFC_B
Definition: vxge_main.h:119
#define RTI_RX_UFC_D
Definition: vxge_main.h:121
#define TTI_TX_UFC_D
Definition: vxge_main.h:99
#define RTI_RX_UFC_C
Definition: vxge_main.h:120
#define VXGE_HW_TIM_CFG1_INT_NUM_TXFRM_CNT_EN
Definition: vxge_reg.h:267
#define VXGE_HW_TIM_CFG1_INT_NUM_URNG_B(val)
Definition: vxge_reg.h:272
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define TTI_TX_URANGE_A
Definition: vxge_main.h:93
#define VXGE_RTI_BTIMER_VAL
Definition: vxge_main.h:79
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_TIM_CFG3_INT_NUM_UTIL_SEL(val)
Definition: vxge_reg.h:283
#define TTI_TX_UFC_C
Definition: vxge_main.h:98
#define VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI
Definition: vxge_reg.h:270
#define VXGE_HW_TIM_CFG2_INT_NUM_UEC_A(val)
Definition: vxge_reg.h:275
#define VXGE_RTI_LTIMER_VAL
Definition: vxge_main.h:80
#define VXGE_TTI_LTIMER_VAL
Definition: vxge_main.h:77
#define VXGE_HW_TIM_UTIL_SEL_LEGACY_TX_NET_UTIL
Definition: vxge_traffic.h:137
#define VXGE_HW_TIM_RING_ASSN_INT_NUM(val)
Definition: vxge_reg.h:297
#define RTI_RX_URANGE_B
Definition: vxge_main.h:113
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __iomem, readq(), RTI_RX_UFC_A, RTI_RX_UFC_B, RTI_RX_UFC_C, RTI_RX_UFC_D, RTI_RX_URANGE_A, RTI_RX_URANGE_B, RTI_RX_URANGE_C, status, vxge_hw_vpath_reg::tim_bitmap, vxge_hw_vpath_reg::tim_cfg1_int_num, vxge_hw_vpath_reg::tim_cfg2_int_num, vxge_hw_vpath_reg::tim_cfg3_int_num, vxge_hw_vpath_reg::tim_dest_addr, vxge_hw_vpath_reg::tim_pci_cfg, vxge_hw_vpath_reg::tim_remap, vxge_hw_vpath_reg::tim_ring_assn, vxge_hw_vpath_reg::tim_vpath_map, TTI_TX_UFC_A, TTI_TX_UFC_B, TTI_TX_UFC_C, TTI_TX_UFC_D, TTI_TX_URANGE_A, TTI_TX_URANGE_B, TTI_TX_URANGE_C, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, VXGE_HW_MAX_INTR_PER_VP, VXGE_HW_OK, VXGE_HW_TIM_CFG1_INT_NUM_BTIMER_VAL, VXGE_HW_TIM_CFG1_INT_NUM_TIMER_AC, VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI, VXGE_HW_TIM_CFG1_INT_NUM_TXFRM_CNT_EN, VXGE_HW_TIM_CFG1_INT_NUM_URNG_A, VXGE_HW_TIM_CFG1_INT_NUM_URNG_B, VXGE_HW_TIM_CFG1_INT_NUM_URNG_C, VXGE_HW_TIM_CFG2_INT_NUM_UEC_A, VXGE_HW_TIM_CFG2_INT_NUM_UEC_B, VXGE_HW_TIM_CFG2_INT_NUM_UEC_C, VXGE_HW_TIM_CFG2_INT_NUM_UEC_D, VXGE_HW_TIM_CFG3_INT_NUM_LTIMER_VAL, VXGE_HW_TIM_CFG3_INT_NUM_UTIL_SEL, VXGE_HW_TIM_PCI_CFG_ADD_PAD, VXGE_HW_TIM_RING_ASSN_INT_NUM, VXGE_HW_TIM_UTIL_SEL_LEGACY_RX_NET_UTIL, VXGE_HW_TIM_UTIL_SEL_LEGACY_TX_NET_UTIL, VXGE_HW_VPATH_INTR_BMAP, VXGE_HW_VPATH_INTR_EINTA, VXGE_HW_VPATH_INTR_RX, VXGE_HW_VPATH_INTR_TX, VXGE_RTI_BTIMER_VAL, VXGE_RTI_LTIMER_VAL, vxge_trace, VXGE_TTI_BTIMER_VAL, VXGE_TTI_LTIMER_VAL, and writeq().

Referenced by __vxge_hw_vpath_initialize().

◆ __vxge_hw_vpath_initialize()

enum vxge_hw_status __vxge_hw_vpath_initialize ( struct __vxge_hw_device hldev,
u32  vp_id 
)

Definition at line 1514 of file vxge_config.c.

1515 {
1516  u64 val64;
1517  u32 val32;
1518  int i;
1520  struct __vxge_hw_virtualpath *vpath;
1521  struct vxge_hw_vpath_reg *vp_reg;
1522 
1523  vxge_trace();
1524 
1525  vpath = &hldev->virtual_path;
1526 
1527  if (!(hldev->vpath_assignments & vxge_mBIT(vp_id))) {
1529  goto exit;
1530  }
1531  vp_reg = vpath->vp_reg;
1533  if (status != VXGE_HW_OK)
1534  goto exit;
1535 
1537 
1538  if (status != VXGE_HW_OK)
1539  goto exit;
1540  val64 = readq(&vpath->vpmgmt_reg->xmac_vsport_choices_vp);
1541 
1542  for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
1543  if (val64 & vxge_mBIT(i))
1544  vpath->vsport_number = i;
1545  }
1546 
1548 
1549  if (status != VXGE_HW_OK)
1550  goto exit;
1551 
1552  status = __vxge_hw_vpath_kdfc_configure(hldev, vp_id);
1553 
1554  if (status != VXGE_HW_OK)
1555  goto exit;
1556 
1557  status = __vxge_hw_vpath_tim_configure(hldev, vp_id);
1558 
1559  if (status != VXGE_HW_OK)
1560  goto exit;
1561 
1562  val64 = readq(&vp_reg->rtdma_rd_optimization_ctrl);
1563 
1564  /* Get MRRS value from device control */
1565  status = __vxge_hw_vpath_pci_read(vpath, 1, 0x78, &val32);
1566 
1567  if (status == VXGE_HW_OK) {
1568  val32 = (val32 & VXGE_HW_PCI_EXP_DEVCTL_READRQ) >> 12;
1569  val64 &=
1571  val64 |=
1573 
1575  }
1576 
1578  val64 |=
1581 
1583  writeq(val64, &vp_reg->rtdma_rd_optimization_ctrl);
1584 
1585 exit:
1586  return status;
1587 }
#define VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_ADDR_BDRY(val)
Definition: vxge_reg.h:249
struct vxge_hw_legacy_reg * legacy_reg
Definition: vxge_config.h:495
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
enum vxge_hw_status __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:1398
enum vxge_hw_status __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1334
uint8_t status
Status.
Definition: ena.h:16
#define VXGE_HW_MAX_PAYLOAD_SIZE_512
Definition: vxge_config.h:68
#define VXGE_HW_MAX_VIRTUAL_PATHS
Definition: vxge_traffic.h:30
uint64_t u64
Definition: stdint.h:25
u64 xmac_vsport_choices_vp
Definition: vxge_reg.h:3946
#define VXGE_HW_PCI_EXP_DEVCTL_READRQ
Definition: vxge_reg.h:242
#define VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_ADDR_BDRY_EN
Definition: vxge_reg.h:248
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
struct vxge_hw_vpmgmt_reg * vpmgmt_reg
Definition: vxge_config.h:398
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
enum vxge_hw_status __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg)
Definition: vxge_config.c:739
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
enum vxge_hw_status __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg)
Definition: vxge_config.c:683
#define VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_FILL_THRESH(val)
Definition: vxge_reg.h:243
#define VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_WAIT_FOR_SPACE
Definition: vxge_reg.h:241
enum vxge_hw_status __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath, u32 phy_func_0, u32 offset, u32 *val)
Definition: vxge_config.c:864
enum vxge_hw_status __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1428
u64 rtdma_rd_optimization_ctrl
Definition: vxge_reg.h:4259
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_legacy_swapper_set(), __vxge_hw_vpath_kdfc_configure(), __vxge_hw_vpath_mac_configure(), __vxge_hw_vpath_pci_read(), __vxge_hw_vpath_swapper_set(), __vxge_hw_vpath_tim_configure(), __vxge_hw_device::legacy_reg, readq(), vxge_hw_vpath_reg::rtdma_rd_optimization_ctrl, status, __vxge_hw_device::virtual_path, __vxge_hw_virtualpath::vp_reg, __vxge_hw_device::vpath_assignments, __vxge_hw_virtualpath::vpmgmt_reg, __vxge_hw_virtualpath::vsport_number, VXGE_HW_ERR_VPATH_NOT_AVAILABLE, VXGE_HW_MAX_PAYLOAD_SIZE_512, VXGE_HW_MAX_VIRTUAL_PATHS, VXGE_HW_OK, VXGE_HW_PCI_EXP_DEVCTL_READRQ, VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_ADDR_BDRY, VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_ADDR_BDRY_EN, VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_FILL_THRESH, VXGE_HW_RTDMA_RD_OPTIMIZATION_CTRL_FB_WAIT_FOR_SPACE, vxge_mBIT, vxge_trace, writeq(), and vxge_hw_vpmgmt_reg::xmac_vsport_choices_vp.

Referenced by __vxge_hw_vp_initialize(), and vxge_hw_vpath_recover_from_reset().

◆ __vxge_hw_vp_initialize()

enum vxge_hw_status __vxge_hw_vp_initialize ( struct __vxge_hw_device hldev,
u32  vp_id,
struct __vxge_hw_virtualpath vpath 
)

Definition at line 1595 of file vxge_config.c.

1597 {
1599 
1600  vxge_trace();
1601 
1602  if (!(hldev->vpath_assignments & vxge_mBIT(vp_id))) {
1604  goto exit;
1605  }
1606 
1607  vpath->vp_id = vp_id;
1608  vpath->vp_open = VXGE_HW_VP_OPEN;
1609  vpath->hldev = hldev;
1610  vpath->vp_reg = hldev->vpath_reg[vp_id];
1611  vpath->vpmgmt_reg = hldev->vpmgmt_reg[vp_id];
1612 
1613  __vxge_hw_vpath_reset(hldev, vp_id);
1614 
1616  if (status != VXGE_HW_OK) {
1617  memset(vpath, 0, sizeof(struct __vxge_hw_virtualpath));
1618  goto exit;
1619  }
1620 
1622  hldev->tim_int_mask1, vp_id);
1623 
1624  status = __vxge_hw_vpath_initialize(hldev, vp_id);
1625 
1626  if (status != VXGE_HW_OK) {
1627  __vxge_hw_vp_terminate(hldev, vpath);
1628  goto exit;
1629  }
1630 
1632 exit:
1633  return status;
1634 }
u64 tim_int_mask0[4]
Definition: vxge_config.h:511
enum vxge_hw_status __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1514
#define VXGE_HW_DEVICE_TIM_INT_MASK_SET(m0, m1, i)
Definition: vxge_config.h:519
static enum vxge_hw_status __vxge_hw_vpath_mgmt_read(struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1212
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1269
u32 tim_int_mask1[4]
Definition: vxge_config.h:512
struct vxge_hw_vpath_reg * vpath_reg[VXGE_HW_TITAN_VPATH_REG_SPACES]
Definition: vxge_config.h:503
enum vxge_hw_status __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1249
void __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1641
struct vxge_hw_vpmgmt_reg * vpmgmt_reg[VXGE_HW_TITAN_VPMGMT_REG_SPACES]
Definition: vxge_config.h:501
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
struct vxge_hw_vpmgmt_reg * vpmgmt_reg
Definition: vxge_config.h:398
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
#define VXGE_HW_VP_OPEN
Definition: vxge_config.h:394
void * memset(void *dest, int character, size_t len) __nonnull

References __vxge_hw_vp_terminate(), __vxge_hw_vpath_initialize(), __vxge_hw_vpath_mgmt_read(), __vxge_hw_vpath_reset(), __vxge_hw_vpath_reset_check(), __vxge_hw_virtualpath::hldev, memset(), status, __vxge_hw_device::tim_int_mask0, __vxge_hw_device::tim_int_mask1, __vxge_hw_virtualpath::vp_id, __vxge_hw_virtualpath::vp_open, __vxge_hw_virtualpath::vp_reg, __vxge_hw_device::vpath_assignments, __vxge_hw_device::vpath_reg, __vxge_hw_virtualpath::vpmgmt_reg, __vxge_hw_device::vpmgmt_reg, VXGE_HW_DEVICE_TIM_INT_MASK_SET, VXGE_HW_ERR_VPATH_NOT_AVAILABLE, VXGE_HW_OK, VXGE_HW_VP_OPEN, vxge_mBIT, and vxge_trace.

Referenced by vxge_hw_vpath_open().

◆ __vxge_hw_vp_terminate()

void __vxge_hw_vp_terminate ( struct __vxge_hw_device hldev,
struct __vxge_hw_virtualpath vpath 
)

Definition at line 1641 of file vxge_config.c.

1643 {
1644  vxge_trace();
1645 
1646  if (vpath->vp_open == VXGE_HW_VP_NOT_OPEN)
1647  return;
1648 
1650  hldev->tim_int_mask1, vpath->vp_id);
1651 
1652  memset(vpath, 0, sizeof(struct __vxge_hw_virtualpath));
1653 }
u64 tim_int_mask0[4]
Definition: vxge_config.h:511
u32 tim_int_mask1[4]
Definition: vxge_config.h:512
#define VXGE_HW_DEVICE_TIM_INT_MASK_RESET(m0, m1, i)
Definition: vxge_config.h:530
#define vxge_trace()
Definition: vxge_config.h:767
#define VXGE_HW_VP_NOT_OPEN
Definition: vxge_config.h:393
void * memset(void *dest, int character, size_t len) __nonnull

References memset(), __vxge_hw_device::tim_int_mask0, __vxge_hw_device::tim_int_mask1, __vxge_hw_virtualpath::vp_id, __vxge_hw_virtualpath::vp_open, VXGE_HW_DEVICE_TIM_INT_MASK_RESET, VXGE_HW_VP_NOT_OPEN, and vxge_trace.

Referenced by __vxge_hw_vp_initialize(), vxge_hw_vpath_close(), and vxge_hw_vpath_open().

◆ vxge_hw_vpath_mtu_set()

enum vxge_hw_status vxge_hw_vpath_mtu_set ( struct __vxge_hw_virtualpath vpath,
u32  new_mtu 
)

Definition at line 1661 of file vxge_config.c.

1662 {
1663  u64 val64;
1665 
1666  vxge_trace();
1667 
1668  new_mtu += VXGE_HW_MAC_HEADER_MAX_SIZE;
1669 
1670  if ((new_mtu < VXGE_HW_MIN_MTU) || (new_mtu > vpath->max_mtu))
1672 
1673  val64 = readq(&vpath->vp_reg->rxmac_vcfg0);
1674 
1675  val64 &= ~VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN(0x3fff);
1676  val64 |= VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN(new_mtu);
1677 
1678  writeq(val64, &vpath->vp_reg->rxmac_vcfg0);
1679 
1680  return status;
1681 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint8_t status
Status.
Definition: ena.h:16
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_MAC_HEADER_MAX_SIZE
Definition: vxge_traffic.h:41
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define VXGE_HW_MIN_MTU
Definition: vxge_config.h:34
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
#define VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN(val)
Definition: vxge_reg.h:171
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __vxge_hw_virtualpath::max_mtu, readq(), vxge_hw_vpath_reg::rxmac_vcfg0, status, __vxge_hw_virtualpath::vp_reg, VXGE_HW_ERR_INVALID_MTU_SIZE, VXGE_HW_MAC_HEADER_MAX_SIZE, VXGE_HW_MIN_MTU, VXGE_HW_OK, VXGE_HW_RXMAC_VCFG0_RTS_MAX_FRM_LEN, vxge_trace, and writeq().

Referenced by vxge_open().

◆ vxge_hw_vpath_open()

enum vxge_hw_status vxge_hw_vpath_open ( struct __vxge_hw_device hldev,
struct vxge_vpath vpath 
)

Definition at line 1690 of file vxge_config.c.

1691 {
1692  struct __vxge_hw_virtualpath *vpathh;
1693  enum vxge_hw_status status;
1694 
1695  vxge_trace();
1696 
1697  vpathh = &hldev->virtual_path;
1698 
1699  if (vpath->vp_open == VXGE_HW_VP_OPEN) {
1701  goto vpath_open_exit1;
1702  }
1703 
1705  if (status != VXGE_HW_OK)
1706  goto vpath_open_exit1;
1707 
1708  status = __vxge_hw_fifo_create(vpathh, &vpathh->fifoh);
1709  if (status != VXGE_HW_OK)
1710  goto vpath_open_exit2;
1711 
1712  status = __vxge_hw_ring_create(vpathh, &vpathh->ringh);
1713  if (status != VXGE_HW_OK)
1714  goto vpath_open_exit3;
1715 
1717 
1718  return VXGE_HW_OK;
1719 
1720 vpath_open_exit3:
1721  __vxge_hw_fifo_delete(&vpathh->fifoh);
1722 vpath_open_exit2:
1723  __vxge_hw_vp_terminate(hldev, vpathh);
1724 vpath_open_exit1:
1725  return status;
1726 }
int vp_open
Definition: vxge_main.h:191
struct __vxge_hw_virtualpath virtual_path
Definition: vxge_config.h:507
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_fifo_delete(struct __vxge_hw_fifo *fifo)
Definition: vxge_config.c:844
void __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1641
enum vxge_hw_status __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id, struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1595
enum vxge_hw_status __vxge_hw_fifo_create(struct __vxge_hw_virtualpath *vpath, struct __vxge_hw_fifo *fifo)
Definition: vxge_config.c:813
struct __vxge_hw_ring ringh
Definition: vxge_config.h:406
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
struct __vxge_hw_fifo fifoh
Definition: vxge_config.h:407
void __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:1290
#define VXGE_HW_VP_OPEN
Definition: vxge_config.h:394
enum vxge_hw_status __vxge_hw_ring_create(struct __vxge_hw_virtualpath *vpath, struct __vxge_hw_ring *ring)
Definition: vxge_config.c:615

References __vxge_hw_fifo_create(), __vxge_hw_fifo_delete(), __vxge_hw_ring_create(), __vxge_hw_vp_initialize(), __vxge_hw_vp_terminate(), __vxge_hw_vpath_prc_configure(), __vxge_hw_virtualpath::fifoh, __vxge_hw_device::first_vp_id, __vxge_hw_virtualpath::hldev, __vxge_hw_virtualpath::ringh, status, __vxge_hw_device::virtual_path, vxge_vpath::vp_open, VXGE_HW_ERR_INVALID_STATE, VXGE_HW_OK, VXGE_HW_VP_OPEN, and vxge_trace.

Referenced by vxge_open_vpaths().

◆ vxge_hw_vpath_rx_doorbell_init()

void vxge_hw_vpath_rx_doorbell_init ( struct __vxge_hw_virtualpath vpath)

Definition at line 1737 of file vxge_config.c.

1738 {
1739  u64 new_count, val64;
1740 
1741  vxge_trace();
1742 
1743  if (vpath->hldev->titan1) {
1744  new_count = readq(&vpath->vp_reg->rxdmem_size);
1745  new_count &= 0x1fff;
1746  } else
1747  new_count = VXGE_HW_RING_RXD_QWORDS_MODE_1 * 4;
1748 
1749  val64 = (VXGE_HW_RXDMEM_SIZE_PRC_RXDMEM_SIZE(new_count));
1750 
1752  &vpath->vp_reg->prc_rxd_doorbell);
1753 }
uint64_t readq(volatile uint64_t *io_addr)
Read 64-bit qword from memory-mapped device.
uint64_t u64
Definition: stdint.h:25
#define VXGE_HW_RING_RXD_QWORDS_MODE_1
Definition: vxge_config.h:364
#define VXGE_HW_RXDMEM_SIZE_PRC_RXDMEM_SIZE(val)
Definition: vxge_reg.h:81
#define VXGE_HW_PRC_RXD_DOORBELL_NEW_QW_CNT(val)
Definition: vxge_reg.h:77
struct vxge_hw_vpath_reg * vp_reg
Definition: vxge_config.h:397
#define vxge_trace()
Definition: vxge_config.h:767
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
void writeq(uint64_t data, volatile uint64_t *io_addr)
Write 64-bit qword to memory-mapped device.

References __vxge_hw_virtualpath::hldev, vxge_hw_vpath_reg::prc_rxd_doorbell, readq(), vxge_hw_vpath_reg::rxdmem_size, __vxge_hw_device::titan1, __vxge_hw_virtualpath::vp_reg, VXGE_HW_PRC_RXD_DOORBELL_NEW_QW_CNT, VXGE_HW_RING_RXD_QWORDS_MODE_1, VXGE_HW_RXDMEM_SIZE_PRC_RXDMEM_SIZE, vxge_trace, and writeq().

Referenced by vxge_open().

◆ vxge_hw_vpath_close()

enum vxge_hw_status vxge_hw_vpath_close ( struct __vxge_hw_virtualpath vpath)

Definition at line 1760 of file vxge_config.c.

1761 {
1762  struct __vxge_hw_device *devh = NULL;
1763  u32 vp_id = vpath->vp_id;
1765 
1766  vxge_trace();
1767 
1768  devh = vpath->hldev;
1769 
1770  if (vpath->vp_open == VXGE_HW_VP_NOT_OPEN) {
1772  goto vpath_close_exit;
1773  }
1774 
1775  devh->vpaths_deployed &= ~vxge_mBIT(vp_id);
1776 
1777  __vxge_hw_ring_delete(&vpath->ringh);
1778 
1779  __vxge_hw_fifo_delete(&vpath->fifoh);
1780 
1781  __vxge_hw_vp_terminate(devh, vpath);
1782 
1783  vpath->vp_open = VXGE_HW_VP_NOT_OPEN;
1784 
1785 vpath_close_exit:
1786  return status;
1787 }
enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_ring *ring)
Definition: vxge_config.c:658
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_fifo_delete(struct __vxge_hw_fifo *fifo)
Definition: vxge_config.c:844
void __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1641
#define vxge_mBIT(loc)
Definition: vxge_reg.h:24
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
struct __vxge_hw_ring ringh
Definition: vxge_config.h:406
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
struct __vxge_hw_fifo fifoh
Definition: vxge_config.h:407
#define VXGE_HW_VP_NOT_OPEN
Definition: vxge_config.h:393
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_fifo_delete(), __vxge_hw_ring_delete(), __vxge_hw_vp_terminate(), __vxge_hw_virtualpath::fifoh, __vxge_hw_virtualpath::hldev, NULL, __vxge_hw_virtualpath::ringh, status, __vxge_hw_virtualpath::vp_id, __vxge_hw_virtualpath::vp_open, __vxge_hw_device::vpaths_deployed, VXGE_HW_ERR_VPATH_NOT_OPEN, VXGE_HW_OK, VXGE_HW_VP_NOT_OPEN, vxge_mBIT, and vxge_trace.

Referenced by vxge_close_vpaths().

◆ vxge_hw_vpath_reset()

enum vxge_hw_status vxge_hw_vpath_reset ( struct __vxge_hw_virtualpath vpath)

Definition at line 1793 of file vxge_config.c.

1794 {
1795  enum vxge_hw_status status;
1796  u32 vp_id;
1797 
1798  vxge_trace();
1799 
1800  vp_id = vpath->vp_id;
1801 
1802  if (vpath->vp_open == VXGE_HW_VP_NOT_OPEN) {
1804  goto exit;
1805  }
1806 
1807  status = __vxge_hw_vpath_reset(vpath->hldev, vp_id);
1808 exit:
1809  return status;
1810 }
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1269
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
#define VXGE_HW_VP_NOT_OPEN
Definition: vxge_config.h:393
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_vpath_reset(), __vxge_hw_virtualpath::hldev, status, __vxge_hw_virtualpath::vp_id, __vxge_hw_virtualpath::vp_open, VXGE_HW_ERR_VPATH_NOT_OPEN, VXGE_HW_VP_NOT_OPEN, and vxge_trace.

Referenced by vxge_reset_all_vpaths().

◆ vxge_hw_vpath_recover_from_reset()

enum vxge_hw_status vxge_hw_vpath_recover_from_reset ( struct __vxge_hw_virtualpath vpath)

Definition at line 1818 of file vxge_config.c.

1819 {
1820  enum vxge_hw_status status;
1821  struct __vxge_hw_device *hldev;
1822  u32 vp_id;
1823 
1824  vxge_trace();
1825 
1826  vp_id = vpath->vp_id;
1827  hldev = vpath->hldev;
1828 
1829  if (vpath->vp_open == VXGE_HW_VP_NOT_OPEN) {
1831  goto exit;
1832  }
1833 
1835  if (status != VXGE_HW_OK)
1836  goto exit;
1837 
1838  status = __vxge_hw_vpath_initialize(hldev, vp_id);
1839  if (status != VXGE_HW_OK)
1840  goto exit;
1841 
1843 
1844 exit:
1845  return status;
1846 }
enum vxge_hw_status __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id)
Definition: vxge_config.c:1514
uint8_t status
Status.
Definition: ena.h:16
enum vxge_hw_status __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath)
Definition: vxge_config.c:1249
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
#define vxge_trace()
Definition: vxge_config.h:767
vxge_hw_status
Definition: vxge_config.h:70
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
#define VXGE_HW_VP_NOT_OPEN
Definition: vxge_config.h:393
void __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev)
Definition: vxge_config.c:1290
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_vpath_initialize(), __vxge_hw_vpath_prc_configure(), __vxge_hw_vpath_reset_check(), __vxge_hw_virtualpath::hldev, status, __vxge_hw_virtualpath::vp_id, __vxge_hw_virtualpath::vp_open, VXGE_HW_ERR_VPATH_NOT_OPEN, VXGE_HW_OK, VXGE_HW_VP_NOT_OPEN, and vxge_trace.

Referenced by vxge_reset_all_vpaths().

◆ vxge_hw_vpath_enable()

void vxge_hw_vpath_enable ( struct __vxge_hw_virtualpath vpath)

Definition at line 1854 of file vxge_config.c.

1855 {
1856  struct __vxge_hw_device *hldev;
1857  u64 val64;
1858 
1859  vxge_trace();
1860 
1861  hldev = vpath->hldev;
1862 
1864  1 << (16 - vpath->vp_id));
1865 
1867  &hldev->common_reg->cmn_rsthdlr_cfg1);
1868 }
struct vxge_hw_common_reg * common_reg
Definition: vxge_config.h:497
static void __vxge_hw_pio_mem_write32_upper(u32 val, void __iomem *addr)
Definition: vxge_config.h:703
#define VXGE_HW_CMN_RSTHDLR_CFG1_CLR_VPATH_RESET(val)
Definition: vxge_reg.h:74
uint64_t u64
Definition: stdint.h:25
#define vxge_bVALn(bits, loc, n)
Definition: vxge_reg.h:35
struct __vxge_hw_device - Hal device object @magic: Magic Number @bar0: BAR0 virtual address.
Definition: vxge_config.h:477
#define vxge_trace()
Definition: vxge_config.h:767
struct __vxge_hw_device * hldev
Definition: vxge_config.h:396
uint32_t u32
Definition: stdint.h:23

References __vxge_hw_pio_mem_write32_upper(), vxge_hw_common_reg::cmn_rsthdlr_cfg1, __vxge_hw_device::common_reg, __vxge_hw_virtualpath::hldev, __vxge_hw_virtualpath::vp_id, vxge_bVALn, VXGE_HW_CMN_RSTHDLR_CFG1_CLR_VPATH_RESET, and vxge_trace.

Referenced by vxge_open().