.. | .. |
---|
11 | 11 | #include <linux/types.h> |
---|
12 | 12 | #include <linux/skbuff.h> |
---|
13 | 13 | #include <linux/workqueue.h> |
---|
| 14 | +#include <linux/net_namespace.h> |
---|
14 | 15 | #include <net/devlink.h> |
---|
15 | 16 | |
---|
16 | 17 | #include "trap.h" |
---|
.. | .. |
---|
23 | 24 | struct mlxsw_driver; |
---|
24 | 25 | struct mlxsw_bus; |
---|
25 | 26 | struct mlxsw_bus_info; |
---|
| 27 | +struct mlxsw_fw_rev; |
---|
26 | 28 | |
---|
27 | 29 | unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); |
---|
28 | 30 | |
---|
29 | 31 | void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); |
---|
| 32 | + |
---|
| 33 | +bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core); |
---|
| 34 | + |
---|
| 35 | +bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core); |
---|
| 36 | + |
---|
| 37 | +bool |
---|
| 38 | +mlxsw_core_fw_rev_minor_subminor_validate(const struct mlxsw_fw_rev *rev, |
---|
| 39 | + const struct mlxsw_fw_rev *req_rev); |
---|
30 | 40 | |
---|
31 | 41 | int mlxsw_core_driver_register(struct mlxsw_driver *mlxsw_driver); |
---|
32 | 42 | void mlxsw_core_driver_unregister(struct mlxsw_driver *mlxsw_driver); |
---|
.. | .. |
---|
34 | 44 | int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, |
---|
35 | 45 | const struct mlxsw_bus *mlxsw_bus, |
---|
36 | 46 | void *bus_priv, bool reload, |
---|
37 | | - struct devlink *devlink); |
---|
| 47 | + struct devlink *devlink, |
---|
| 48 | + struct netlink_ext_ack *extack); |
---|
38 | 49 | void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload); |
---|
39 | 50 | |
---|
40 | 51 | struct mlxsw_tx_info { |
---|
.. | .. |
---|
46 | 57 | const struct mlxsw_tx_info *tx_info); |
---|
47 | 58 | int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, |
---|
48 | 59 | const struct mlxsw_tx_info *tx_info); |
---|
| 60 | +void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core, |
---|
| 61 | + struct sk_buff *skb, u8 local_port); |
---|
49 | 62 | |
---|
50 | 63 | struct mlxsw_rx_listener { |
---|
51 | 64 | void (*func)(struct sk_buff *skb, u8 local_port, void *priv); |
---|
52 | 65 | u8 local_port; |
---|
| 66 | + u8 mirror_reason; |
---|
53 | 67 | u16 trap_id; |
---|
54 | | - enum mlxsw_reg_hpkt_action action; |
---|
55 | 68 | }; |
---|
56 | 69 | |
---|
57 | 70 | struct mlxsw_event_listener { |
---|
.. | .. |
---|
65 | 78 | union { |
---|
66 | 79 | struct mlxsw_rx_listener rx_listener; |
---|
67 | 80 | struct mlxsw_event_listener event_listener; |
---|
68 | | - } u; |
---|
69 | | - enum mlxsw_reg_hpkt_action action; |
---|
70 | | - enum mlxsw_reg_hpkt_action unreg_action; |
---|
71 | | - u8 trap_group; |
---|
72 | | - bool is_ctrl; /* should go via control buffer or not */ |
---|
73 | | - bool is_event; |
---|
| 81 | + }; |
---|
| 82 | + enum mlxsw_reg_hpkt_action en_action; /* Action when enabled */ |
---|
| 83 | + enum mlxsw_reg_hpkt_action dis_action; /* Action when disabled */ |
---|
| 84 | + u8 en_trap_group; /* Trap group when enabled */ |
---|
| 85 | + u8 dis_trap_group; /* Trap group when disabled */ |
---|
| 86 | + u8 is_ctrl:1, /* should go via control buffer or not */ |
---|
| 87 | + is_event:1, |
---|
| 88 | + enabled_on_register:1; /* Trap should be enabled when listener |
---|
| 89 | + * is registered. |
---|
| 90 | + */ |
---|
74 | 91 | }; |
---|
75 | 92 | |
---|
76 | | -#define MLXSW_RXL(_func, _trap_id, _action, _is_ctrl, _trap_group, \ |
---|
77 | | - _unreg_action) \ |
---|
78 | | - { \ |
---|
79 | | - .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
80 | | - .u.rx_listener = \ |
---|
81 | | - { \ |
---|
82 | | - .func = _func, \ |
---|
83 | | - .local_port = MLXSW_PORT_DONT_CARE, \ |
---|
84 | | - .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
85 | | - }, \ |
---|
86 | | - .action = MLXSW_REG_HPKT_ACTION_##_action, \ |
---|
87 | | - .unreg_action = MLXSW_REG_HPKT_ACTION_##_unreg_action, \ |
---|
88 | | - .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_trap_group, \ |
---|
89 | | - .is_ctrl = _is_ctrl, \ |
---|
90 | | - .is_event = false, \ |
---|
| 93 | +#define __MLXSW_RXL(_func, _trap_id, _en_action, _is_ctrl, _en_trap_group, \ |
---|
| 94 | + _dis_action, _enabled_on_register, _dis_trap_group, \ |
---|
| 95 | + _mirror_reason) \ |
---|
| 96 | + { \ |
---|
| 97 | + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
| 98 | + .rx_listener = \ |
---|
| 99 | + { \ |
---|
| 100 | + .func = _func, \ |
---|
| 101 | + .local_port = MLXSW_PORT_DONT_CARE, \ |
---|
| 102 | + .mirror_reason = _mirror_reason, \ |
---|
| 103 | + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
| 104 | + }, \ |
---|
| 105 | + .en_action = MLXSW_REG_HPKT_ACTION_##_en_action, \ |
---|
| 106 | + .dis_action = MLXSW_REG_HPKT_ACTION_##_dis_action, \ |
---|
| 107 | + .en_trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_en_trap_group, \ |
---|
| 108 | + .dis_trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_dis_trap_group, \ |
---|
| 109 | + .is_ctrl = _is_ctrl, \ |
---|
| 110 | + .enabled_on_register = _enabled_on_register, \ |
---|
91 | 111 | } |
---|
92 | 112 | |
---|
93 | | -#define MLXSW_EVENTL(_func, _trap_id, _trap_group) \ |
---|
94 | | - { \ |
---|
95 | | - .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
96 | | - .u.event_listener = \ |
---|
97 | | - { \ |
---|
98 | | - .func = _func, \ |
---|
99 | | - .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
100 | | - }, \ |
---|
101 | | - .action = MLXSW_REG_HPKT_ACTION_TRAP_TO_CPU, \ |
---|
102 | | - .trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_trap_group, \ |
---|
103 | | - .is_ctrl = false, \ |
---|
104 | | - .is_event = true, \ |
---|
| 113 | +#define MLXSW_RXL(_func, _trap_id, _en_action, _is_ctrl, _trap_group, \ |
---|
| 114 | + _dis_action) \ |
---|
| 115 | + __MLXSW_RXL(_func, _trap_id, _en_action, _is_ctrl, _trap_group, \ |
---|
| 116 | + _dis_action, true, _trap_group, 0) |
---|
| 117 | + |
---|
| 118 | +#define MLXSW_RXL_DIS(_func, _trap_id, _en_action, _is_ctrl, _en_trap_group, \ |
---|
| 119 | + _dis_action, _dis_trap_group) \ |
---|
| 120 | + __MLXSW_RXL(_func, _trap_id, _en_action, _is_ctrl, _en_trap_group, \ |
---|
| 121 | + _dis_action, false, _dis_trap_group, 0) |
---|
| 122 | + |
---|
| 123 | +#define MLXSW_RXL_MIRROR(_func, _session_id, _trap_group, _mirror_reason) \ |
---|
| 124 | + __MLXSW_RXL(_func, MIRROR_SESSION##_session_id, TRAP_TO_CPU, false, \ |
---|
| 125 | + _trap_group, TRAP_TO_CPU, true, _trap_group, \ |
---|
| 126 | + _mirror_reason) |
---|
| 127 | + |
---|
| 128 | +#define MLXSW_EVENTL(_func, _trap_id, _trap_group) \ |
---|
| 129 | + { \ |
---|
| 130 | + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
| 131 | + .event_listener = \ |
---|
| 132 | + { \ |
---|
| 133 | + .func = _func, \ |
---|
| 134 | + .trap_id = MLXSW_TRAP_ID_##_trap_id, \ |
---|
| 135 | + }, \ |
---|
| 136 | + .en_action = MLXSW_REG_HPKT_ACTION_TRAP_TO_CPU, \ |
---|
| 137 | + .en_trap_group = MLXSW_REG_HTGT_TRAP_GROUP_##_trap_group, \ |
---|
| 138 | + .is_event = true, \ |
---|
| 139 | + .enabled_on_register = true, \ |
---|
105 | 140 | } |
---|
106 | 141 | |
---|
107 | 142 | int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core, |
---|
108 | 143 | const struct mlxsw_rx_listener *rxl, |
---|
109 | | - void *priv); |
---|
| 144 | + void *priv, bool enabled); |
---|
110 | 145 | void mlxsw_core_rx_listener_unregister(struct mlxsw_core *mlxsw_core, |
---|
111 | | - const struct mlxsw_rx_listener *rxl, |
---|
112 | | - void *priv); |
---|
| 146 | + const struct mlxsw_rx_listener *rxl); |
---|
113 | 147 | |
---|
114 | 148 | int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core, |
---|
115 | 149 | const struct mlxsw_event_listener *el, |
---|
116 | 150 | void *priv); |
---|
117 | 151 | void mlxsw_core_event_listener_unregister(struct mlxsw_core *mlxsw_core, |
---|
118 | | - const struct mlxsw_event_listener *el, |
---|
119 | | - void *priv); |
---|
| 152 | + const struct mlxsw_event_listener *el); |
---|
120 | 153 | |
---|
121 | 154 | int mlxsw_core_trap_register(struct mlxsw_core *mlxsw_core, |
---|
122 | 155 | const struct mlxsw_listener *listener, |
---|
.. | .. |
---|
124 | 157 | void mlxsw_core_trap_unregister(struct mlxsw_core *mlxsw_core, |
---|
125 | 158 | const struct mlxsw_listener *listener, |
---|
126 | 159 | void *priv); |
---|
| 160 | +int mlxsw_core_trap_state_set(struct mlxsw_core *mlxsw_core, |
---|
| 161 | + const struct mlxsw_listener *listener, |
---|
| 162 | + bool enabled); |
---|
127 | 163 | |
---|
128 | 164 | typedef void mlxsw_reg_trans_cb_t(struct mlxsw_core *mlxsw_core, char *payload, |
---|
129 | 165 | size_t payload_len, unsigned long cb_priv); |
---|
.. | .. |
---|
150 | 186 | u16 lag_id; |
---|
151 | 187 | } u; |
---|
152 | 188 | u8 lag_port_index; |
---|
| 189 | + u8 mirror_reason; |
---|
153 | 190 | int trap_id; |
---|
154 | 191 | }; |
---|
155 | 192 | |
---|
.. | .. |
---|
164 | 201 | u16 lag_id, u8 local_port); |
---|
165 | 202 | |
---|
166 | 203 | void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port); |
---|
167 | | -int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port); |
---|
| 204 | +int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, |
---|
| 205 | + u32 port_number, bool split, u32 split_port_subnumber, |
---|
| 206 | + bool splittable, u32 lanes, |
---|
| 207 | + const unsigned char *switch_id, |
---|
| 208 | + unsigned char switch_id_len); |
---|
168 | 209 | void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port); |
---|
| 210 | +int mlxsw_core_cpu_port_init(struct mlxsw_core *mlxsw_core, |
---|
| 211 | + void *port_driver_priv, |
---|
| 212 | + const unsigned char *switch_id, |
---|
| 213 | + unsigned char switch_id_len); |
---|
| 214 | +void mlxsw_core_cpu_port_fini(struct mlxsw_core *mlxsw_core); |
---|
169 | 215 | void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, |
---|
170 | | - void *port_driver_priv, struct net_device *dev, |
---|
171 | | - u32 port_number, bool split, |
---|
172 | | - u32 split_port_subnumber); |
---|
| 216 | + void *port_driver_priv, struct net_device *dev); |
---|
173 | 217 | void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, |
---|
174 | 218 | void *port_driver_priv); |
---|
175 | 219 | void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, |
---|
176 | 220 | void *port_driver_priv); |
---|
177 | 221 | enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, |
---|
178 | 222 | u8 local_port); |
---|
179 | | -int mlxsw_core_port_get_phys_port_name(struct mlxsw_core *mlxsw_core, |
---|
180 | | - u8 local_port, char *name, size_t len); |
---|
| 223 | +struct devlink_port * |
---|
| 224 | +mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, |
---|
| 225 | + u8 local_port); |
---|
| 226 | +struct mlxsw_env *mlxsw_core_env(const struct mlxsw_core *mlxsw_core); |
---|
| 227 | +bool mlxsw_core_is_initialized(const struct mlxsw_core *mlxsw_core); |
---|
| 228 | +int mlxsw_core_module_max_width(struct mlxsw_core *mlxsw_core, u8 module); |
---|
181 | 229 | |
---|
182 | 230 | int mlxsw_core_schedule_dw(struct delayed_work *dwork, unsigned long delay); |
---|
183 | 231 | bool mlxsw_core_schedule_work(struct work_struct *work); |
---|
184 | 232 | void mlxsw_core_flush_owq(void); |
---|
| 233 | +int mlxsw_core_resources_query(struct mlxsw_core *mlxsw_core, char *mbox, |
---|
| 234 | + struct mlxsw_res *res); |
---|
185 | 235 | |
---|
186 | 236 | #define MLXSW_CONFIG_PROFILE_SWID_COUNT 8 |
---|
187 | 237 | |
---|
.. | .. |
---|
234 | 284 | struct list_head list; |
---|
235 | 285 | const char *kind; |
---|
236 | 286 | size_t priv_size; |
---|
| 287 | + const struct mlxsw_fw_rev *fw_req_rev; |
---|
| 288 | + const char *fw_filename; |
---|
237 | 289 | int (*init)(struct mlxsw_core *mlxsw_core, |
---|
238 | | - const struct mlxsw_bus_info *mlxsw_bus_info); |
---|
| 290 | + const struct mlxsw_bus_info *mlxsw_bus_info, |
---|
| 291 | + struct netlink_ext_ack *extack); |
---|
239 | 292 | void (*fini)(struct mlxsw_core *mlxsw_core); |
---|
240 | 293 | int (*basic_trap_groups_set)(struct mlxsw_core *mlxsw_core); |
---|
241 | 294 | int (*port_type_set)(struct mlxsw_core *mlxsw_core, u8 local_port, |
---|
.. | .. |
---|
249 | 302 | struct devlink_sb_pool_info *pool_info); |
---|
250 | 303 | int (*sb_pool_set)(struct mlxsw_core *mlxsw_core, |
---|
251 | 304 | unsigned int sb_index, u16 pool_index, u32 size, |
---|
252 | | - enum devlink_sb_threshold_type threshold_type); |
---|
| 305 | + enum devlink_sb_threshold_type threshold_type, |
---|
| 306 | + struct netlink_ext_ack *extack); |
---|
253 | 307 | int (*sb_port_pool_get)(struct mlxsw_core_port *mlxsw_core_port, |
---|
254 | 308 | unsigned int sb_index, u16 pool_index, |
---|
255 | 309 | u32 *p_threshold); |
---|
256 | 310 | int (*sb_port_pool_set)(struct mlxsw_core_port *mlxsw_core_port, |
---|
257 | 311 | unsigned int sb_index, u16 pool_index, |
---|
258 | | - u32 threshold); |
---|
| 312 | + u32 threshold, struct netlink_ext_ack *extack); |
---|
259 | 313 | int (*sb_tc_pool_bind_get)(struct mlxsw_core_port *mlxsw_core_port, |
---|
260 | 314 | unsigned int sb_index, u16 tc_index, |
---|
261 | 315 | enum devlink_sb_pool_type pool_type, |
---|
.. | .. |
---|
263 | 317 | int (*sb_tc_pool_bind_set)(struct mlxsw_core_port *mlxsw_core_port, |
---|
264 | 318 | unsigned int sb_index, u16 tc_index, |
---|
265 | 319 | enum devlink_sb_pool_type pool_type, |
---|
266 | | - u16 pool_index, u32 threshold); |
---|
| 320 | + u16 pool_index, u32 threshold, |
---|
| 321 | + struct netlink_ext_ack *extack); |
---|
267 | 322 | int (*sb_occ_snapshot)(struct mlxsw_core *mlxsw_core, |
---|
268 | 323 | unsigned int sb_index); |
---|
269 | 324 | int (*sb_occ_max_clear)(struct mlxsw_core *mlxsw_core, |
---|
.. | .. |
---|
275 | 330 | unsigned int sb_index, u16 tc_index, |
---|
276 | 331 | enum devlink_sb_pool_type pool_type, |
---|
277 | 332 | u32 *p_cur, u32 *p_max); |
---|
| 333 | + int (*trap_init)(struct mlxsw_core *mlxsw_core, |
---|
| 334 | + const struct devlink_trap *trap, void *trap_ctx); |
---|
| 335 | + void (*trap_fini)(struct mlxsw_core *mlxsw_core, |
---|
| 336 | + const struct devlink_trap *trap, void *trap_ctx); |
---|
| 337 | + int (*trap_action_set)(struct mlxsw_core *mlxsw_core, |
---|
| 338 | + const struct devlink_trap *trap, |
---|
| 339 | + enum devlink_trap_action action, |
---|
| 340 | + struct netlink_ext_ack *extack); |
---|
| 341 | + int (*trap_group_init)(struct mlxsw_core *mlxsw_core, |
---|
| 342 | + const struct devlink_trap_group *group); |
---|
| 343 | + int (*trap_group_set)(struct mlxsw_core *mlxsw_core, |
---|
| 344 | + const struct devlink_trap_group *group, |
---|
| 345 | + const struct devlink_trap_policer *policer, |
---|
| 346 | + struct netlink_ext_ack *extack); |
---|
| 347 | + int (*trap_policer_init)(struct mlxsw_core *mlxsw_core, |
---|
| 348 | + const struct devlink_trap_policer *policer); |
---|
| 349 | + void (*trap_policer_fini)(struct mlxsw_core *mlxsw_core, |
---|
| 350 | + const struct devlink_trap_policer *policer); |
---|
| 351 | + int (*trap_policer_set)(struct mlxsw_core *mlxsw_core, |
---|
| 352 | + const struct devlink_trap_policer *policer, |
---|
| 353 | + u64 rate, u64 burst, |
---|
| 354 | + struct netlink_ext_ack *extack); |
---|
| 355 | + int (*trap_policer_counter_get)(struct mlxsw_core *mlxsw_core, |
---|
| 356 | + const struct devlink_trap_policer *policer, |
---|
| 357 | + u64 *p_drops); |
---|
278 | 358 | void (*txhdr_construct)(struct sk_buff *skb, |
---|
279 | 359 | const struct mlxsw_tx_info *tx_info); |
---|
280 | 360 | int (*resources_register)(struct mlxsw_core *mlxsw_core); |
---|
.. | .. |
---|
282 | 362 | const struct mlxsw_config_profile *profile, |
---|
283 | 363 | u64 *p_single_size, u64 *p_double_size, |
---|
284 | 364 | u64 *p_linear_size); |
---|
| 365 | + int (*params_register)(struct mlxsw_core *mlxsw_core); |
---|
| 366 | + void (*params_unregister)(struct mlxsw_core *mlxsw_core); |
---|
| 367 | + |
---|
| 368 | + /* Notify a driver that a timestamped packet was transmitted. Driver |
---|
| 369 | + * is responsible for freeing the passed-in SKB. |
---|
| 370 | + */ |
---|
| 371 | + void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core, |
---|
| 372 | + struct sk_buff *skb, u8 local_port); |
---|
| 373 | + |
---|
285 | 374 | u8 txhdr_len; |
---|
286 | 375 | const struct mlxsw_config_profile *profile; |
---|
287 | 376 | bool res_query_enabled; |
---|
| 377 | + bool fw_fatal_enabled; |
---|
| 378 | + bool temp_warn_enabled; |
---|
288 | 379 | }; |
---|
289 | 380 | |
---|
290 | 381 | int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, |
---|
.. | .. |
---|
292 | 383 | u64 *p_single_size, u64 *p_double_size, |
---|
293 | 384 | u64 *p_linear_size); |
---|
294 | 385 | |
---|
295 | | -void mlxsw_core_fw_flash_start(struct mlxsw_core *mlxsw_core); |
---|
296 | | -void mlxsw_core_fw_flash_end(struct mlxsw_core *mlxsw_core); |
---|
| 386 | +u32 mlxsw_core_read_frc_h(struct mlxsw_core *mlxsw_core); |
---|
| 387 | +u32 mlxsw_core_read_frc_l(struct mlxsw_core *mlxsw_core); |
---|
| 388 | + |
---|
| 389 | +void mlxsw_core_emad_string_tlv_enable(struct mlxsw_core *mlxsw_core); |
---|
297 | 390 | |
---|
298 | 391 | bool mlxsw_core_res_valid(struct mlxsw_core *mlxsw_core, |
---|
299 | 392 | enum mlxsw_res_id res_id); |
---|
.. | .. |
---|
306 | 399 | |
---|
307 | 400 | #define MLXSW_CORE_RES_GET(mlxsw_core, short_res_id) \ |
---|
308 | 401 | mlxsw_core_res_get(mlxsw_core, MLXSW_RES_ID_##short_res_id) |
---|
| 402 | + |
---|
| 403 | +static inline struct net *mlxsw_core_net(struct mlxsw_core *mlxsw_core) |
---|
| 404 | +{ |
---|
| 405 | + return devlink_net(priv_to_devlink(mlxsw_core)); |
---|
| 406 | +} |
---|
309 | 407 | |
---|
310 | 408 | #define MLXSW_BUS_F_TXRX BIT(0) |
---|
311 | 409 | #define MLXSW_BUS_F_RESET BIT(1) |
---|
.. | .. |
---|
325 | 423 | char *in_mbox, size_t in_mbox_size, |
---|
326 | 424 | char *out_mbox, size_t out_mbox_size, |
---|
327 | 425 | u8 *p_status); |
---|
| 426 | + u32 (*read_frc_h)(void *bus_priv); |
---|
| 427 | + u32 (*read_frc_l)(void *bus_priv); |
---|
328 | 428 | u8 features; |
---|
329 | 429 | }; |
---|
330 | 430 | |
---|
.. | .. |
---|
342 | 442 | struct mlxsw_fw_rev fw_rev; |
---|
343 | 443 | u8 vsd[MLXSW_CMD_BOARDINFO_VSD_LEN]; |
---|
344 | 444 | u8 psid[MLXSW_CMD_BOARDINFO_PSID_LEN]; |
---|
| 445 | + u8 low_frequency:1, |
---|
| 446 | + read_frc_capable:1; |
---|
345 | 447 | }; |
---|
346 | 448 | |
---|
347 | 449 | struct mlxsw_hwmon; |
---|
.. | .. |
---|
392 | 494 | |
---|
393 | 495 | #endif |
---|
394 | 496 | |
---|
| 497 | +enum mlxsw_devlink_param_id { |
---|
| 498 | + MLXSW_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX, |
---|
| 499 | + MLXSW_DEVLINK_PARAM_ID_ACL_REGION_REHASH_INTERVAL, |
---|
| 500 | +}; |
---|
| 501 | + |
---|
| 502 | +struct mlxsw_skb_cb { |
---|
| 503 | + union { |
---|
| 504 | + struct mlxsw_tx_info tx_info; |
---|
| 505 | + u32 cookie_index; /* Only used during receive */ |
---|
| 506 | + }; |
---|
| 507 | +}; |
---|
| 508 | + |
---|
| 509 | +static inline struct mlxsw_skb_cb *mlxsw_skb_cb(struct sk_buff *skb) |
---|
| 510 | +{ |
---|
| 511 | + BUILD_BUG_ON(sizeof(mlxsw_skb_cb) > sizeof(skb->cb)); |
---|
| 512 | + return (struct mlxsw_skb_cb *) skb->cb; |
---|
| 513 | +} |
---|
| 514 | + |
---|
395 | 515 | #endif |
---|