Vladimir Oltean | 8aa9ebc | 2019-05-02 23:23:30 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 |
| 2 | * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com> |
| 3 | */ |
| 4 | |
Vladimir Oltean | 227d07a | 2019-05-05 13:19:27 +0300 | [diff] [blame^] | 5 | /* Included by drivers/net/dsa/sja1105/sja1105.h and net/dsa/tag_sja1105.c */ |
Vladimir Oltean | 8aa9ebc | 2019-05-02 23:23:30 +0300 | [diff] [blame] | 6 | |
| 7 | #ifndef _NET_DSA_SJA1105_H |
| 8 | #define _NET_DSA_SJA1105_H |
| 9 | |
Vladimir Oltean | 227d07a | 2019-05-05 13:19:27 +0300 | [diff] [blame^] | 10 | #include <linux/skbuff.h> |
Vladimir Oltean | 6666ceb | 2019-05-02 23:23:34 +0300 | [diff] [blame] | 11 | #include <linux/etherdevice.h> |
Vladimir Oltean | 227d07a | 2019-05-05 13:19:27 +0300 | [diff] [blame^] | 12 | #include <net/dsa.h> |
Vladimir Oltean | 6666ceb | 2019-05-02 23:23:34 +0300 | [diff] [blame] | 13 | |
| 14 | #define ETH_P_SJA1105 ETH_P_DSA_8021Q |
| 15 | |
Vladimir Oltean | 227d07a | 2019-05-05 13:19:27 +0300 | [diff] [blame^] | 16 | /* IEEE 802.3 Annex 57A: Slow Protocols PDUs (01:80:C2:xx:xx:xx) */ |
| 17 | #define SJA1105_LINKLOCAL_FILTER_A 0x0180C2000000ull |
| 18 | #define SJA1105_LINKLOCAL_FILTER_A_MASK 0xFFFFFF000000ull |
| 19 | /* IEEE 1588 Annex F: Transport of PTP over Ethernet (01:1B:19:xx:xx:xx) */ |
| 20 | #define SJA1105_LINKLOCAL_FILTER_B 0x011B19000000ull |
| 21 | #define SJA1105_LINKLOCAL_FILTER_B_MASK 0xFFFFFF000000ull |
| 22 | |
| 23 | enum sja1105_frame_type { |
| 24 | SJA1105_FRAME_TYPE_NORMAL = 0, |
| 25 | SJA1105_FRAME_TYPE_LINK_LOCAL, |
| 26 | }; |
| 27 | |
| 28 | struct sja1105_skb_cb { |
| 29 | enum sja1105_frame_type type; |
| 30 | }; |
| 31 | |
| 32 | #define SJA1105_SKB_CB(skb) \ |
| 33 | ((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb)) |
| 34 | |
| 35 | struct sja1105_port { |
| 36 | struct dsa_port *dp; |
| 37 | int mgmt_slot; |
| 38 | }; |
Vladimir Oltean | 8aa9ebc | 2019-05-02 23:23:30 +0300 | [diff] [blame] | 39 | |
| 40 | #endif /* _NET_DSA_SJA1105_H */ |