blob: d01250cd51ac96697b3eba700c5667488124cd09 [file] [log] [blame]
Thomas Wu68250352014-04-02 18:59:40 -07001/*
Sol Kavy2783c072014-04-05 12:53:13 -07002 **************************************************************************
3 * Copyright (c) 2014, Qualcomm Atheros, Inc.
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all copies.
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 **************************************************************************
15 */
16
17/*
Thomas Wu68250352014-04-02 18:59:40 -070018 * NSS Interface Messages
19 */
20
21#ifndef __NSS_IF_H
22#define __NSS_IF_H
23
24/*
25 * Message numbers
26 */
27enum nss_if_message_types {
28 NSS_IF_OPEN,
29 NSS_IF_CLOSE,
30 NSS_IF_LINK_STATE_NOTIFY,
31 NSS_IF_MTU_CHANGE,
32 NSS_IF_MAC_ADDR_SET,
Sol Kavy4013e282014-04-06 15:57:00 -070033 NSS_IF_STATS,
Thomas Wu68250352014-04-02 18:59:40 -070034 NSS_IF_ISHAPER_ASSIGN,
35 NSS_IF_BSHAPER_ASSIGN,
36 NSS_IF_ISHAPER_UNASSIGN,
37 NSS_IF_BSHAPER_UNASSIGN,
38 NSS_IF_ISHAPER_CONFIG,
39 NSS_IF_BSHAPER_CONFIG,
Sol Kavy2783c072014-04-05 12:53:13 -070040 NSS_IF_MAX_MSG_TYPES = 9999,
Thomas Wu68250352014-04-02 18:59:40 -070041};
42
43enum nss_if_error_types {
44 NSS_IF_ERROR_NO_ISHAPERS,
45 NSS_IF_ERROR_NO_BSHAPERS,
46 NSS_IF_ERROR_NO_ISHAPER,
47 NSS_IF_ERROR_NO_BSHAPER,
48 NSS_IF_ERROR_ISHAPER_OLD,
49 NSS_IF_ERROR_B_SHAPER_OLD,
50 NSS_IF_ERROR_I_SHAPER_CONFIG_FAILED,
51 NSS_IF_ERROR_B_SHAPER_CONFIG_FAILED,
52 NSS_IF_ERROR_TYPE_UNKNOWN,
53 NSS_IF_ERROR_TYPE_EOPEN,
54};
55
56/*
57 * Interface open command
58 */
59struct nss_if_open {
60 uint32_t tx_desc_ring; /* Tx descriptor ring address */
61 uint32_t rx_desc_ring; /* Rx descriptor ring address */
62};
63
64/*
65 * Interface close command
66 */
67struct nss_if_close {
68 uint32_t reserved; /* Place holder */
69};
70
71/*
72 * Link state notification to NSS
73 */
74struct nss_if_link_state_notify {
75 uint32_t state; /* Link State (UP/DOWN), speed/duplex settings */
76};
77
78/*
79 * Interface mtu change
80 */
81struct nss_if_mtu_change {
82 uint16_t min_buf_size; /* Changed min buf size value */
83};
84
85/*
Sol Kavy4013e282014-04-06 15:57:00 -070086 * Interface statistics.
87 */
88struct nss_if_stats {
89 uint32_t rx_packets; /* Number of packets received */
90 uint32_t rx_bytes; /* Number of bytes received */
91 uint32_t rx_dropped; /* Number of RX dropped packets */
92 uint32_t tx_packets; /* Number of packets transmitted */
93 uint32_t tx_bytes; /* Number of bytes transmitted */
94};
95
96/*
Thomas Wu68250352014-04-02 18:59:40 -070097 * The NSS MAC address structure.
98 */
99struct nss_if_mac_address_set {
100 uint8_t mac_addr[ETH_ALEN]; /* MAC address */
101};
102
Thomas Wu68250352014-04-02 18:59:40 -0700103
104/*
105 * Message structure to send/receive phys i/f commands
106 */
Sol Kavy2783c072014-04-05 12:53:13 -0700107union nss_if_msgs {
108 struct nss_if_link_state_notify link_state_notify; /* Message: notify link status */
109 struct nss_if_open open; /* Message: open interface */
110 struct nss_if_close close; /* Message: close interface */
111 struct nss_if_mtu_change mtu_change; /* Message: MTU change notification */
112 struct nss_if_mac_address_set mac_address_set; /* Message: set MAC address for i/f */
Sol Kavy4013e282014-04-06 15:57:00 -0700113 struct nss_if_stats stats; /* Message: statistics sync */
Thomas Wu68250352014-04-02 18:59:40 -0700114};
115
Thomas Wu68250352014-04-02 18:59:40 -0700116#endif /* __NSS_IF_H */