Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: reg: Add Port Physical Loopback Register

The PPLR register allows configuration of the port's loopback mode.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
a0c25387 b362487a

+37
+37
drivers/net/ethernet/mellanox/mlxsw/reg.h
··· 5210 5210 mlxsw_reg_pspa_sub_port_set(payload, 0); 5211 5211 } 5212 5212 5213 + /* PPLR - Port Physical Loopback Register 5214 + * -------------------------------------- 5215 + * This register allows configuration of the port's loopback mode. 5216 + */ 5217 + #define MLXSW_REG_PPLR_ID 0x5018 5218 + #define MLXSW_REG_PPLR_LEN 0x8 5219 + 5220 + MLXSW_REG_DEFINE(pplr, MLXSW_REG_PPLR_ID, MLXSW_REG_PPLR_LEN); 5221 + 5222 + /* reg_pplr_local_port 5223 + * Local port number. 5224 + * Access: Index 5225 + */ 5226 + MLXSW_ITEM32(reg, pplr, local_port, 0x00, 16, 8); 5227 + 5228 + /* Phy local loopback. When set the port's egress traffic is looped back 5229 + * to the receiver and the port transmitter is disabled. 5230 + */ 5231 + #define MLXSW_REG_PPLR_LB_TYPE_BIT_PHY_LOCAL BIT(1) 5232 + 5233 + /* reg_pplr_lb_en 5234 + * Loopback enable. 5235 + * Access: RW 5236 + */ 5237 + MLXSW_ITEM32(reg, pplr, lb_en, 0x04, 0, 8); 5238 + 5239 + static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port, 5240 + bool phy_local) 5241 + { 5242 + MLXSW_REG_ZERO(pplr, payload); 5243 + mlxsw_reg_pplr_local_port_set(payload, local_port); 5244 + mlxsw_reg_pplr_lb_en_set(payload, 5245 + phy_local ? 5246 + MLXSW_REG_PPLR_LB_TYPE_BIT_PHY_LOCAL : 0); 5247 + } 5248 + 5213 5249 /* HTGT - Host Trap Group Table 5214 5250 * ---------------------------- 5215 5251 * Configures the properties for forwarding to CPU. ··· 10017 9981 MLXSW_REG(pptb), 10018 9982 MLXSW_REG(pbmc), 10019 9983 MLXSW_REG(pspa), 9984 + MLXSW_REG(pplr), 10020 9985 MLXSW_REG(htgt), 10021 9986 MLXSW_REG(hpkt), 10022 9987 MLXSW_REG(rgcr),