Lines Matching refs:mlxsw_m_port
27 struct mlxsw_m_port;
35 struct mlxsw_m_port **ports;
45 struct mlxsw_m_port { struct
68 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); in mlxsw_m_port_open() argument
69 struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; in mlxsw_m_port_open()
72 mlxsw_m_port->module); in mlxsw_m_port_open()
77 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); in mlxsw_m_port_stop() local
78 struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; in mlxsw_m_port_stop()
80 mlxsw_env_module_port_down(mlxsw_m->core, 0, mlxsw_m_port->module); in mlxsw_m_port_stop()
87 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); in mlxsw_m_port_get_devlink_port() local
88 struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; in mlxsw_m_port_get_devlink_port()
91 mlxsw_m_port->local_port); in mlxsw_m_port_get_devlink_port()
103 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); in mlxsw_m_module_get_drvinfo() local
104 struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; in mlxsw_m_module_get_drvinfo()
120 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_get_module_info() local
121 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_info()
124 mlxsw_m_port->slot_index, in mlxsw_m_get_module_info()
125 mlxsw_m_port->module, modinfo); in mlxsw_m_get_module_info()
132 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_get_module_eeprom() local
133 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_eeprom()
136 mlxsw_m_port->slot_index, in mlxsw_m_get_module_eeprom()
137 mlxsw_m_port->module, ee, data); in mlxsw_m_get_module_eeprom()
145 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_get_module_eeprom_by_page() local
146 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_eeprom_by_page()
149 mlxsw_m_port->slot_index, in mlxsw_m_get_module_eeprom_by_page()
150 mlxsw_m_port->module, in mlxsw_m_get_module_eeprom_by_page()
156 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_reset() local
157 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_reset()
159 return mlxsw_env_reset_module(netdev, core, mlxsw_m_port->slot_index, in mlxsw_m_reset()
160 mlxsw_m_port->module, in mlxsw_m_reset()
169 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_get_module_power_mode() local
170 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_power_mode()
172 return mlxsw_env_get_module_power_mode(core, mlxsw_m_port->slot_index, in mlxsw_m_get_module_power_mode()
173 mlxsw_m_port->module, in mlxsw_m_get_module_power_mode()
182 struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); in mlxsw_m_set_module_power_mode() local
183 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_set_module_power_mode()
185 return mlxsw_env_set_module_power_mode(core, mlxsw_m_port->slot_index, in mlxsw_m_set_module_power_mode()
186 mlxsw_m_port->module, in mlxsw_m_set_module_power_mode()
219 mlxsw_m_port_dev_addr_get(struct mlxsw_m_port *mlxsw_m_port) in mlxsw_m_port_dev_addr_get() argument
221 struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; in mlxsw_m_port_dev_addr_get()
231 eth_hw_addr_gen(mlxsw_m_port->dev, addr, mlxsw_m_port->module + 1 + in mlxsw_m_port_dev_addr_get()
232 mlxsw_m_port->module_offset); in mlxsw_m_port_dev_addr_get()
245 struct mlxsw_m_port *mlxsw_m_port; in mlxsw_m_port_create() local
259 dev = alloc_etherdev(sizeof(struct mlxsw_m_port)); in mlxsw_m_port_create()
267 mlxsw_m_port = netdev_priv(dev); in mlxsw_m_port_create()
268 mlxsw_m_port->dev = dev; in mlxsw_m_port_create()
269 mlxsw_m_port->mlxsw_m = mlxsw_m; in mlxsw_m_port_create()
270 mlxsw_m_port->local_port = local_port; in mlxsw_m_port_create()
271 mlxsw_m_port->module = module; in mlxsw_m_port_create()
272 mlxsw_m_port->slot_index = slot_index; in mlxsw_m_port_create()
278 mlxsw_m_port->module_offset = mlxsw_m_port->slot_index ? in mlxsw_m_port_create()
279 (mlxsw_m_port->slot_index - 1) * in mlxsw_m_port_create()
285 err = mlxsw_m_port_dev_addr_get(mlxsw_m_port); in mlxsw_m_port_create()
288 mlxsw_m_port->local_port); in mlxsw_m_port_create()
293 mlxsw_m->ports[local_port] = mlxsw_m_port; in mlxsw_m_port_create()
297 mlxsw_m_port->local_port); in mlxsw_m_port_create()
301 mlxsw_core_port_eth_set(mlxsw_m->core, mlxsw_m_port->local_port, in mlxsw_m_port_create()
302 mlxsw_m_port, dev); in mlxsw_m_port_create()
317 struct mlxsw_m_port *mlxsw_m_port = mlxsw_m->ports[local_port]; in mlxsw_m_port_remove() local
320 unregister_netdev(mlxsw_m_port->dev); /* This calls ndo_stop */ in mlxsw_m_port_remove()
322 free_netdev(mlxsw_m_port->dev); in mlxsw_m_port_remove()