Deleted Added
full compact
msgring.h (212790) msgring.h (213377)
1/*-
2 * Copyright (c) 2003-2009 RMI Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * RMI_BSD
1/*-
2 * Copyright (c) 2003-2009 RMI Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * RMI_BSD
30 * $FreeBSD: head/sys/mips/rmi/msgring.h 212790 2010-09-17 10:28:10Z jchandra $
30 * $FreeBSD: head/sys/mips/rmi/msgring.h 213377 2010-10-03 04:33:58Z jchandra $
31 */
32#ifndef _RMI_MSGRING_H_
33#define _RMI_MSGRING_H_
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/types.h>
38

--- 127 unchanged lines hidden (view full) ---

166#define MSGRNG_STNID_PCIE_3 119
167#define MSGRNG_STNID_XLS_PK0 121
168
169#define MSGRNG_CODE_MAC 0
170#define MSGRNG_CODE_XGMAC 2
171#define MSGRNG_CODE_SEC 0
172#define MSGRNG_CODE_BOOT_WAKEUP 200
173#define MSGRNG_CODE_SPI4 3
31 */
32#ifndef _RMI_MSGRING_H_
33#define _RMI_MSGRING_H_
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/types.h>
38

--- 127 unchanged lines hidden (view full) ---

166#define MSGRNG_STNID_PCIE_3 119
167#define MSGRNG_STNID_XLS_PK0 121
168
169#define MSGRNG_CODE_MAC 0
170#define MSGRNG_CODE_XGMAC 2
171#define MSGRNG_CODE_SEC 0
172#define MSGRNG_CODE_BOOT_WAKEUP 200
173#define MSGRNG_CODE_SPI4 3
174#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0)
175
174
175#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0)
176#define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0)
177#define msgrng_write_config(v) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, v)
176#define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0)
177#define msgrng_write_config(v) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, v)
178
179#define msgrng_read_bucksize(b) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b)
180#define msgrng_write_bucksize(b, v) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b, v)
178#define msgrng_read_bucksize(b) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b)
179#define msgrng_write_bucksize(b, v) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b, v)
181
182#define msgrng_read_cc(r, s) read_c2_register32(r, s)
183#define msgrng_write_cc(r, v, s) write_c2_register32(r, s, v)
184
185#define msgrng_load_rx_msg0() read_c2_register64(MSGRNG_RX_BUF_REG, 0)
186#define msgrng_load_rx_msg1() read_c2_register64(MSGRNG_RX_BUF_REG, 1)
187#define msgrng_load_rx_msg2() read_c2_register64(MSGRNG_RX_BUF_REG, 2)
188#define msgrng_load_rx_msg3() read_c2_register64(MSGRNG_RX_BUF_REG, 3)
189

--- 126 unchanged lines hidden (view full) ---

316 *stid = (status & 0x7f0000) >> 16;
317 msg->msg0 = msgrng_load_rx_msg0();
318 msg->msg1 = msgrng_load_rx_msg1();
319 msg->msg2 = msgrng_load_rx_msg2();
320 msg->msg3 = msgrng_load_rx_msg3();
321 return (0);
322}
323
180#define msgrng_read_cc(r, s) read_c2_register32(r, s)
181#define msgrng_write_cc(r, v, s) write_c2_register32(r, s, v)
182
183#define msgrng_load_rx_msg0() read_c2_register64(MSGRNG_RX_BUF_REG, 0)
184#define msgrng_load_rx_msg1() read_c2_register64(MSGRNG_RX_BUF_REG, 1)
185#define msgrng_load_rx_msg2() read_c2_register64(MSGRNG_RX_BUF_REG, 2)
186#define msgrng_load_rx_msg3() read_c2_register64(MSGRNG_RX_BUF_REG, 3)
187

--- 126 unchanged lines hidden (view full) ---

314 *stid = (status & 0x7f0000) >> 16;
315 msg->msg0 = msgrng_load_rx_msg0();
316 msg->msg1 = msgrng_load_rx_msg1();
317 msg->msg2 = msgrng_load_rx_msg2();
318 msg->msg3 = msgrng_load_rx_msg3();
319 return (0);
320}
321
324#define MSGRNG_STN_RX_QSIZE 256
322#define MSGRNG_STN_RX_QSIZE 256
323#define MSGRNG_NSTATIONS 128
324#define MSGRNG_CORE_NBUCKETS 8
325
326struct stn_cc {
327 unsigned short counters[16][8];
328};
329
330struct bucket_size {
325
326struct stn_cc {
327 unsigned short counters[16][8];
328};
329
330struct bucket_size {
331 unsigned short bucket[128];
331 unsigned short bucket[MSGRNG_NSTATIONS];
332};
333
334extern struct bucket_size bucket_sizes;
335
336extern struct stn_cc cc_table_cpu_0;
337extern struct stn_cc cc_table_cpu_1;
338extern struct stn_cc cc_table_cpu_2;
339extern struct stn_cc cc_table_cpu_3;

--- 15 unchanged lines hidden (view full) ---

355extern struct stn_cc xls_cc_table_cpu_3;
356extern struct stn_cc xls_cc_table_gmac0;
357extern struct stn_cc xls_cc_table_gmac1;
358extern struct stn_cc xls_cc_table_cmp;
359extern struct stn_cc xls_cc_table_pcie;
360extern struct stn_cc xls_cc_table_dma;
361extern struct stn_cc xls_cc_table_sec;
362
332};
333
334extern struct bucket_size bucket_sizes;
335
336extern struct stn_cc cc_table_cpu_0;
337extern struct stn_cc cc_table_cpu_1;
338extern struct stn_cc cc_table_cpu_2;
339extern struct stn_cc cc_table_cpu_3;

--- 15 unchanged lines hidden (view full) ---

355extern struct stn_cc xls_cc_table_cpu_3;
356extern struct stn_cc xls_cc_table_gmac0;
357extern struct stn_cc xls_cc_table_gmac1;
358extern struct stn_cc xls_cc_table_cmp;
359extern struct stn_cc xls_cc_table_pcie;
360extern struct stn_cc xls_cc_table_dma;
361extern struct stn_cc xls_cc_table_sec;
362
363/*
364 * NOTE: this is not stationid/8, ie the station numbers below are just
365 * for internal use
366 */
367enum {
368 TX_STN_CPU_0,
369 TX_STN_CPU_1,
370 TX_STN_CPU_2,
371 TX_STN_CPU_3,
372 TX_STN_CPU_4,
373 TX_STN_CPU_5,
374 TX_STN_CPU_6,
375 TX_STN_CPU_7,
376 TX_STN_GMAC,
377 TX_STN_DMA,
378 TX_STN_XGS_0,
379 TX_STN_XGS_1,
380 TX_STN_SAE,
381 TX_STN_GMAC0,
382 TX_STN_GMAC1,
383 TX_STN_CDE,
384 TX_STN_PCIE,
385 TX_STN_INVALID,
386 MAX_TX_STNS
387};
388
389int register_msgring_handler(int major,
390 void (*action) (int, int, int, int, struct msgrng_msg *, void *),
391 void *dev_id);
363typedef void (*msgring_handler)(int, int, int, int, struct msgrng_msg *, void *);
364int register_msgring_handler(int startb, int endb, msgring_handler action,
365 void *arg);
392uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages);
393void xlr_msgring_cpu_init(void);
394void xlr_msgring_config(void);
395
396#endif
366uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages);
367void xlr_msgring_cpu_init(void);
368void xlr_msgring_config(void);
369
370#endif