Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 1 | /* |
Sol Kavy | 2783c07 | 2014-04-05 12:53:13 -0700 | [diff] [blame] | 2 | ************************************************************************** |
| 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 Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 18 | * NSS Interface Messages |
| 19 | */ |
| 20 | |
| 21 | #ifndef __NSS_IF_H |
| 22 | #define __NSS_IF_H |
| 23 | |
| 24 | /* |
| 25 | * Message numbers |
| 26 | */ |
| 27 | enum 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 Kavy | 4013e28 | 2014-04-06 15:57:00 -0700 | [diff] [blame] | 33 | NSS_IF_STATS, |
Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 34 | 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 Kavy | 2783c07 | 2014-04-05 12:53:13 -0700 | [diff] [blame] | 40 | NSS_IF_MAX_MSG_TYPES = 9999, |
Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | enum 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 | */ |
| 59 | struct 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 | */ |
| 67 | struct nss_if_close { |
| 68 | uint32_t reserved; /* Place holder */ |
| 69 | }; |
| 70 | |
| 71 | /* |
| 72 | * Link state notification to NSS |
| 73 | */ |
| 74 | struct nss_if_link_state_notify { |
| 75 | uint32_t state; /* Link State (UP/DOWN), speed/duplex settings */ |
| 76 | }; |
| 77 | |
| 78 | /* |
| 79 | * Interface mtu change |
| 80 | */ |
| 81 | struct nss_if_mtu_change { |
| 82 | uint16_t min_buf_size; /* Changed min buf size value */ |
| 83 | }; |
| 84 | |
| 85 | /* |
Sol Kavy | 4013e28 | 2014-04-06 15:57:00 -0700 | [diff] [blame] | 86 | * Interface statistics. |
| 87 | */ |
| 88 | struct 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 Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 97 | * The NSS MAC address structure. |
| 98 | */ |
| 99 | struct nss_if_mac_address_set { |
| 100 | uint8_t mac_addr[ETH_ALEN]; /* MAC address */ |
| 101 | }; |
| 102 | |
Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 103 | |
| 104 | /* |
| 105 | * Message structure to send/receive phys i/f commands |
| 106 | */ |
Sol Kavy | 2783c07 | 2014-04-05 12:53:13 -0700 | [diff] [blame] | 107 | union 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 Kavy | 4013e28 | 2014-04-06 15:57:00 -0700 | [diff] [blame] | 113 | struct nss_if_stats stats; /* Message: statistics sync */ |
Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 114 | }; |
| 115 | |
Thomas Wu | 6825035 | 2014-04-02 18:59:40 -0700 | [diff] [blame] | 116 | #endif /* __NSS_IF_H */ |