summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/rw_reg.c
blob: a0e590857df534cd16cdd72718f98ece6585759d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
// Copyright (c) 2010-2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/

#include <rte_ethdev.h>
#include "rw_reg.h"

int read_reg(uint8_t port_id, uint32_t addr, uint32_t *reg)
{
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	struct _dev_hw *hw = (struct _dev_hw *)dev->data->dev_private;

	*reg = PROX_READ_REG(hw, addr);
	return 0;
}

int write_reg(uint8_t port_id, uint32_t reg, uint32_t val)
{
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	struct _dev_hw *hw = (struct _dev_hw *)dev->data->dev_private;

	PROX_WRITE_REG(hw, reg, val);
	return 0;
}
>int offset; int width; }; struct display_page { struct display_table tables[8]; int n_tables; int width; }; struct screen_state { unsigned chosen_screen; unsigned chosen_page; int toggle; int pps_unit; }; struct display_screen { void (*draw_frame)(struct screen_state *screen_state); void (*draw_stats)(struct screen_state *screen_state); int (*get_height)(void); const char *title; }; void display_set_pps_unit(int val); struct lcore_cfg; struct task_args; void display_page_draw_frame(const struct display_page *display_page, int height); int display_column_get_width(const struct display_column *display_column); void display_column_init(struct display_column *display_column, const char *title, unsigned width); struct display_column *display_table_add_col(struct display_table *table); void display_table_init(struct display_table *table, const char *title); struct display_table *display_page_add_table(struct display_page *display_page); void display_page_init(struct display_page *display_page); __attribute__((format(printf, 3, 4))) void display_column_print(const struct display_column *display_column, int row, const char *fmt, ...); void display_column_print_core_task(const struct display_column *display_column, int row, struct lcore_cfg *lconf, struct task_args *targ); void display_column_print_number(const struct display_column *display_column, int row, uint64_t number); char *print_time_unit_err_usec(char *dst, struct time_unit_err *t); char *print_time_unit_usec(char *dst, struct time_unit *t); struct port_queue; struct rte_ring; void display_column_port_ring(const struct display_column *display_column, int row, struct port_queue *ports, int port_count, struct rte_ring **rings, int ring_count); void display_init(void); void display_end(void); void display_stats(void); void display_refresh(void); void display_print(const char *str); void display_cmd(const char *cmd, int cmd_len, int cursor_pos); void display_screen(unsigned screen_id); void toggle_display_screen(void); void display_page_up(void); void display_page_down(void); void display_print_page(void); void display_lock(void); void display_unlock(void); int display_getch(void); static struct stats_cons display = { .init = display_init, .notify = display_stats, .refresh = display_refresh, .finish = display_end, .flags = STATS_CONS_F_ALL, }; #endif /* _DISPLAY_H_ */