realtek: Replace C++ style comments
[openwrt/staging/jow.git] / target / linux / realtek / files-5.15 / drivers / net / dsa / rtl83xx / rtl838x.h
index 68a4675e111d4a5539fa380dc96042ab67992346..a4bfc285a60ce2dfe3403491cfbee4d71ce139ea 100644 (file)
@@ -518,13 +518,13 @@ typedef enum {
 #define RTL930X_PIE_BLK_PHASE_CTRL             (0xA5A4)
 #define RTL931X_PIE_BLK_PHASE_CTRL             (0x4184)
 
-// PIE actions
+/* PIE actions */
 #define PIE_ACT_COPY_TO_PORT   2
 #define PIE_ACT_REDIRECT_TO_PORT 4
 #define PIE_ACT_ROUTE_UC       6
 #define PIE_ACT_VID_ASSIGN     0
 
-// L3 actions
+/* L3 actions */
 #define L3_FORWARD             0
 #define L3_DROP                        1
 #define L3_TRAP2CPU            2
@@ -533,7 +533,7 @@ typedef enum {
 #define L3_COPY2MASTERCPU      5
 #define L3_HARDDROP            6
 
-// Route actions
+/* Route actions */
 #define ROUTE_ACT_FORWARD      0
 #define ROUTE_ACT_TRAP2CPU     1
 #define ROUTE_ACT_COPY2CPU     2
@@ -631,10 +631,10 @@ struct rtl838x_vlan_info {
        u8 profile_id;
        bool hash_mc_fid;
        bool hash_uc_fid;
-       u8 fid; // AKA MSTI
+       u8 fid; /* AKA MSTI */
 
-       // The following fields are used only by the RTL931X
-       int if_id;              // Interface (index in L3_EGR_INTF_IDX)
+       /* The following fields are used only by the RTL931X */
+       int if_id;              /* Interface (index in L3_EGR_INTF_IDX) */
        u16 multicast_grp_mask;
        int l2_tunnel_list_id;
 };
@@ -670,9 +670,9 @@ struct rtl838x_l2_entry {
        u32 mc_sip;
        u16 mc_mac_index;
        u16 nh_route_id;
-       bool nh_vlan_target;  // Only RTL83xx: VLAN used for next hop
+       bool nh_vlan_target;  /* Only RTL83xx: VLAN used for next hop */
 
-       // The following is only valid on RTL931x
+       /* The following is only valid on RTL931x */
        bool is_open_flow;
        bool is_pe_forward;
        bool is_local_forward;
@@ -709,35 +709,35 @@ enum egr_filter {
  * to SoC family (e.g. because of different port ranges) */
 struct pie_rule {
        int id;
-       enum pie_phase phase;   // Phase in which this template is applied
-       int packet_cntr;        // ID of a packet counter assigned to this rule
-       int octet_cntr;         // ID of a byte counter assigned to this rule
+       enum pie_phase phase;   /* Phase in which this template is applied */
+       int packet_cntr;        /* ID of a packet counter assigned to this rule */
+       int octet_cntr;         /* ID of a byte counter assigned to this rule */
        u32 last_packet_cnt;
        u64 last_octet_cnt;
 
-       // The following are requirements for the pie template
+       /* The following are requirements for the pie template */
        bool is_egress;
-       bool is_ipv6;           // This is a rule with IPv6 fields
+       bool is_ipv6;           /* This is a rule with IPv6 fields */
 
-       // Fixed fields that are always matched against on RTL8380
+       /* Fixed fields that are always matched against on RTL8380 */
        u8 spmmask_fix;
-       u8 spn;                 // Source port number
-       bool stacking_port;     // Source port is stacking port
-       bool mgnt_vlan;         // Packet arrived on management VLAN
-       bool dmac_hit_sw;       // The packet's destination MAC matches one of the device's
-       bool content_too_deep;  // The content of the packet cannot be parsed: too many layers
-       bool not_first_frag;    // Not the first IP fragment
-       u8 frame_type_l4;       // 0: UDP, 1: TCP, 2: ICMP/ICMPv6, 3: IGMP
-       u8 frame_type;          // 0: ARP, 1: L2 only, 2: IPv4, 3: IPv6
-       bool otag_fmt;          // 0: outer tag packet, 1: outer priority tag or untagged
-       bool itag_fmt;          // 0: inner tag packet, 1: inner priority tag or untagged
-       bool otag_exist;        // packet with outer tag
-       bool itag_exist;        // packet with inner tag
-       bool frame_type_l2;     // 0: Ethernet, 1: LLC_SNAP, 2: LLC_Other, 3: Reserved
-       bool igr_normal_port;   // Ingress port is not cpu or stacking port
-       u8 tid;                 // The template ID defining the what the templated fields mean
-
-       // Masks for the fields that are always matched against on RTL8380
+       u8 spn;                 /* Source port number */
+       bool stacking_port;     /* Source port is stacking port */
+       bool mgnt_vlan;         /* Packet arrived on management VLAN */
+       bool dmac_hit_sw;       /* The packet's destination MAC matches one of the device's */
+       bool content_too_deep;  /* The content of the packet cannot be parsed: too many layers */
+       bool not_first_frag;    /* Not the first IP fragment */
+       u8 frame_type_l4;       /* 0: UDP, 1: TCP, 2: ICMP/ICMPv6, 3: IGMP */
+       u8 frame_type;          /* 0: ARP, 1: L2 only, 2: IPv4, 3: IPv6 */
+       bool otag_fmt;          /* 0: outer tag packet, 1: outer priority tag or untagged */
+       bool itag_fmt;          /* 0: inner tag packet, 1: inner priority tag or untagged */
+       bool otag_exist;        /* packet with outer tag */
+       bool itag_exist;        /* packet with inner tag */
+       bool frame_type_l2;     /* 0: Ethernet, 1: LLC_SNAP, 2: LLC_Other, 3: Reserved */
+       bool igr_normal_port;   /* Ingress port is not cpu or stacking port */
+       u8 tid;                 /* The template ID defining the what the templated fields mean */
+
+       /* Masks for the fields that are always matched against on RTL8380 */
        u8 spmmask_fix_m;
        u8 spn_m;
        bool stacking_port_m;
@@ -755,52 +755,52 @@ struct pie_rule {
        bool igr_normal_port_m;
        u8 tid_m;
 
-       // Logical operations between rules, special rules for rule numbers apply
+       /* Logical operations between rules, special rules for rule numbers apply */
        bool valid;
-       bool cond_not;          // Matches when conditions not match
-       bool cond_and1;         // And this rule 2n with the next rule 2n+1 in same block
-       bool cond_and2;         // And this rule m in block 2n with rule m in block 2n+1
+       bool cond_not;          /* Matches when conditions not match */
+       bool cond_and1;         /* And this rule 2n with the next rule 2n+1 in same block */
+       bool cond_and2;         /* And this rule m in block 2n with rule m in block 2n+1 */
        bool ivalid;
 
-       // Actions to be performed
-       bool drop;              // Drop the packet
-       bool fwd_sel;           // Forward packet: to port, portmask, dest route, next rule, drop
-       bool ovid_sel;          // So something to outer vlan-id: shift, re-assign
-       bool ivid_sel;          // Do something to inner vlan-id: shift, re-assign
-       bool flt_sel;           // Filter the packet when sending to certain ports
-       bool log_sel;           // Log the packet in one of the LOG-table counters
-       bool rmk_sel;           // Re-mark the packet, i.e. change the priority-tag
-       bool meter_sel;         // Meter the packet, i.e. limit rate of this type of packet
-       bool tagst_sel;         // Change the ergress tag
-       bool mir_sel;           // Mirror the packet to a Link Aggregation Group
-       bool nopri_sel;         // Change the normal priority
-       bool cpupri_sel;        // Change the CPU priority
-       bool otpid_sel;         // Change Outer Tag Protocol Identifier (802.1q)
-       bool itpid_sel;         // Change Inner Tag Protocol Identifier (802.1q)
-       bool shaper_sel;        // Apply traffic shaper
-       bool mpls_sel;          // MPLS actions
-       bool bypass_sel;        // Bypass actions
-       bool fwd_sa_lrn;        // Learn the source address when forwarding
-       bool fwd_mod_to_cpu;    // Forward the modified VLAN tag format to CPU-port
-
-       // Fields used in predefined templates 0-2 on RTL8380 / 90 / 9300
-       u64 spm;                // Source Port Matrix
-       u16 otag;               // Outer VLAN-ID
-       u8 smac[ETH_ALEN];      // Source MAC address
-       u8 dmac[ETH_ALEN];      // Destination MAC address
-       u16 ethertype;          // Ethernet frame type field in ethernet header
-       u16 itag;               // Inner VLAN-ID
+       /* Actions to be performed */
+       bool drop;              /* Drop the packet */
+       bool fwd_sel;           /* Forward packet: to port, portmask, dest route, next rule, drop */
+       bool ovid_sel;          /* So something to outer vlan-id: shift, re-assign */
+       bool ivid_sel;          /* Do something to inner vlan-id: shift, re-assign */
+       bool flt_sel;           /* Filter the packet when sending to certain ports */
+       bool log_sel;           /* Log the packet in one of the LOG-table counters */
+       bool rmk_sel;           /* Re-mark the packet, i.e. change the priority-tag */
+       bool meter_sel;         /* Meter the packet, i.e. limit rate of this type of packet */
+       bool tagst_sel;         /* Change the ergress tag */
+       bool mir_sel;           /* Mirror the packet to a Link Aggregation Group */
+       bool nopri_sel;         /* Change the normal priority */
+       bool cpupri_sel;        /* Change the CPU priority */
+       bool otpid_sel;         /* Change Outer Tag Protocol Identifier (802.1q) */
+       bool itpid_sel;         /* Change Inner Tag Protocol Identifier (802.1q) */
+       bool shaper_sel;        /* Apply traffic shaper */
+       bool mpls_sel;          /* MPLS actions */
+       bool bypass_sel;        /* Bypass actions */
+       bool fwd_sa_lrn;        /* Learn the source address when forwarding */
+       bool fwd_mod_to_cpu;    /* Forward the modified VLAN tag format to CPU-port */
+
+       /* Fields used in predefined templates 0-2 on RTL8380 / 90 / 9300 */
+       u64 spm;                /* Source Port Matrix */
+       u16 otag;               /* Outer VLAN-ID */
+       u8 smac[ETH_ALEN];      /* Source MAC address */
+       u8 dmac[ETH_ALEN];      /* Destination MAC address */
+       u16 ethertype;          /* Ethernet frame type field in ethernet header */
+       u16 itag;               /* Inner VLAN-ID */
        u16 field_range_check;
-       u32 sip;                // Source IP
-       struct in6_addr sip6;   // IPv6 Source IP
-       u32 dip;                // Destination IP
-       struct in6_addr dip6;   // IPv6 Destination IP
-       u16 tos_proto;          // IPv4: TOS + Protocol fields, IPv6: Traffic class + next header
-       u16 sport;              // TCP/UDP source port
-       u16 dport;              // TCP/UDP destination port
+       u32 sip;                /* Source IP */
+       struct in6_addr sip6;   /* IPv6 Source IP */
+       u32 dip;                /* Destination IP */
+       struct in6_addr dip6;   /* IPv6 Destination IP */
+       u16 tos_proto;          /* IPv4: TOS + Protocol fields, IPv6: Traffic class + next header */
+       u16 sport;              /* TCP/UDP source port */
+       u16 dport;              /* TCP/UDP destination port */
        u16 icmp_igmp;
        u16 tcp_info;
-       u16 dsap_ssap;          // Destination / Source Service Access Point bytes (802.3)
+       u16 dsap_ssap;          /* Destination / Source Service Access Point bytes (802.3) */
 
        u64 spm_m;
        u16 otag_m;
@@ -810,9 +810,9 @@ struct pie_rule {
        u16 itag_m;
        u16 field_range_check_m;
        u32 sip_m;
-       struct in6_addr sip6_m; // IPv6 Source IP mask
+       struct in6_addr sip6_m; /* IPv6 Source IP mask */
        u32 dip_m;
-       struct in6_addr dip6_m; // IPv6 Destination IP mask
+       struct in6_addr dip6_m; /* IPv6 Destination IP mask */
        u16 tos_proto_m;
        u16 sport_m;
        u16 dport_m;
@@ -820,25 +820,25 @@ struct pie_rule {
        u16 tcp_info_m;
        u16 dsap_ssap_m;
 
-       // Data associated with actions
-       u8 fwd_act;             // Type of forwarding action
-                               // 0: permit, 1: drop, 2: copy to port id, 4: copy to portmask
-                               // 4: redirect to portid, 5: redirect to portmask
-                               // 6: route, 7: vlan leaky (only 8380)
-       u16 fwd_data;           // Additional data for forwarding action, e.g. destination port
+       /* Data associated with actions */
+       u8 fwd_act;             /* Type of forwarding action */
+                               /* 0: permit, 1: drop, 2: copy to port id, 4: copy to portmask */
+                               /* 4: redirect to portid, 5: redirect to portmask */
+                               /* 6: route, 7: vlan leaky (only 8380) */
+       u16 fwd_data;           /* Additional data for forwarding action, e.g. destination port */
        u8 ovid_act;
-       u16 ovid_data;          // Outer VLAN ID
+       u16 ovid_data;          /* Outer VLAN ID */
        u8 ivid_act;
-       u16 ivid_data;          // Inner VLAN ID
-       u16 flt_data;           // Filtering data
-       u16 log_data;           // ID of packet or octet counter in LOG table, on RTL93xx
-                               // unnecessary since PIE-Rule-ID == LOG-counter-ID
+       u16 ivid_data;          /* Inner VLAN ID */
+       u16 flt_data;           /* Filtering data */
+       u16 log_data;           /* ID of packet or octet counter in LOG table, on RTL93xx */
+                               /* unnecessary since PIE-Rule-ID == LOG-counter-ID */
        bool log_octets;
-       u8 mpls_act;            // MPLS action type
-       u16 mpls_lib_idx;       // MPLS action data
+       u8 mpls_act;            /* MPLS action type */
+       u16 mpls_lib_idx;       /* MPLS action data */
 
-       u16 rmk_data;           // Data for remarking
-       u16 meter_data;         // ID of meter for bandwidth control
+       u16 rmk_data;           /* Data for remarking */
+       u16 meter_data;         /* ID of meter for bandwidth control */
        u16 tagst_data;
        u16 mir_data;
        u16 nopri_data;
@@ -847,10 +847,10 @@ struct pie_rule {
        u16 itpid_data;
        u16 shaper_data;
 
-       // Bypass actions, ignored on RTL8380
-       bool bypass_all;        // Not clear
-       bool bypass_igr_stp;    // Bypass Ingress STP state
-       bool bypass_ibc_sc;     // Bypass Ingress Bandwidth Control and Storm Control
+       /* Bypass actions, ignored on RTL8380 */
+       bool bypass_all;        /* Not clear */
+       bool bypass_igr_stp;    /* Bypass Ingress STP state */
+       bool bypass_ibc_sc;     /* Bypass Ingress Bandwidth Control and Storm Control */
 };
 
 struct rtl838x_l3_intf {
@@ -874,30 +874,30 @@ struct rtl838x_l3_intf {
  * Mask fields state whether the corresponding data fields matter for matching
  */
 struct rtl93xx_rt_mac {
-       bool valid;     // Valid or not
-       bool p_type;    // Individual (0) or trunk (1) port
-       bool p_mask;    // Whether the port type is used
+       bool valid;     /* Valid or not */
+       bool p_type;    /* Individual (0) or trunk (1) port */
+       bool p_mask;    /* Whether the port type is used */
        u8 p_id;
-       u8 p_id_mask;   // Mask for the port
-       u8 action;      // Routing action performed: 0: FORWARD, 1: DROP, 2: TRAP2CPU
-                       //   3: COPY2CPU, 4: TRAP2MASTERCPU, 5: COPY2MASTERCPU, 6: HARDDROP
+       u8 p_id_mask;   /* Mask for the port */
+       u8 action;      /* Routing action performed: 0: FORWARD, 1: DROP, 2: TRAP2CPU */
+                       /*   3: COPY2CPU, 4: TRAP2MASTERCPU, 5: COPY2MASTERCPU, 6: HARDDROP */
        u16 vid;
        u16 vid_mask;
-       u64 mac;        // MAC address used as source MAC in the routed packet
+       u64 mac;        /* MAC address used as source MAC in the routed packet */
        u64 mac_mask;
 };
 
 struct rtl83xx_nexthop {
-       u16 id;         // ID: L3_NEXT_HOP table-index or route-index set in L2_NEXT_HOP
+       u16 id;         /* ID: L3_NEXT_HOP table-index or route-index set in L2_NEXT_HOP */
        u32 dev_id;
        u16 port;
-       u16 vid;        // VLAN-ID for L2 table entry (saved from L2-UC entry)
-       u16 rvid;       // Relay VID/FID for the L2 table entry
-       u64 mac;        // The MAC address of the entry in the L2_NEXT_HOP table
+       u16 vid;        /* VLAN-ID for L2 table entry (saved from L2-UC entry) */
+       u16 rvid;       /* Relay VID/FID for the L2 table entry */
+       u64 mac;        /* The MAC address of the entry in the L2_NEXT_HOP table */
        u16 mac_id;
-       u16 l2_id;      // Index of this next hop forwarding entry in L2 FIB table
-       u64 gw;         // The gateway MAC address packets are forwarded to
-       int if_id;      // Interface (into L3_EGR_INTF_IDX)
+       u16 l2_id;      /* Index of this next hop forwarding entry in L2 FIB table */
+       u64 gw;         /* The gateway MAC address packets are forwarded to */
+       int if_id;      /* Interface (into L3_EGR_INTF_IDX) */
 };
 
 struct rtl838x_switch_priv;
@@ -924,14 +924,14 @@ struct rtl93xx_route_attr {
 };
 
 struct rtl83xx_route {
-       u32 gw_ip;                      // IP of the route's gateway
-       u32 dst_ip;                     // IP of the destination net
+       u32 gw_ip;                      /* IP of the route's gateway */
+       u32 dst_ip;                     /* IP of the destination net */
        struct in6_addr dst_ip6;
-       int prefix_len;                 // Network prefix len of the destination net
+       int prefix_len;                 /* Network prefix len of the destination net */
        bool is_host_route;
-       int id;                         // ID number of this route
+       int id;                         /* ID number of this route */
        struct rhlist_head linkage;
-       u16 switch_mac_id;              // Index into switch's own MACs, RTL839X only
+       u16 switch_mac_id;              /* Index into switch's own MACs, RTL839X only */
        struct rtl83xx_nexthop nh;
        struct pie_rule pr;
        struct rtl93xx_route_attr attr;
@@ -1043,8 +1043,8 @@ struct rtl838x_switch_priv {
        u16 family_id;
        char version;
        struct rtl838x_port ports[57];
-       struct mutex reg_mutex;         // Mutex for individual register manipulations
-       struct mutex pie_mutex;         // Mutex for Packet Inspection Engine
+       struct mutex reg_mutex;         /* Mutex for individual register manipulations */
+       struct mutex pie_mutex;         /* Mutex for Packet Inspection Engine */
        int link_state_irq;
        int mirror_group_ports[4];
        struct mii_bus *mii_bus;
@@ -1063,7 +1063,7 @@ struct rtl838x_switch_priv {
        u32 lag_primary[MAX_LAGS];
        u32 is_lagmember[57];
        u64 lagmembers;
-       struct notifier_block nb;  // TODO: change to different name
+       struct notifier_block nb;  /* TODO: change to different name */
        struct notifier_block ne_nb;
        struct notifier_block fib_nb;
        bool eee_enabled;