1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */
3 * Copyright 2008 - 2015 Freescale Semiconductor Inc.
9 #include <linux/device.h>
10 #include <linux/if_ether.h>
11 #include <linux/phy.h>
12 #include <linux/phylink.h>
13 #include <linux/list.h>
15 #include "fman_port.h"
28 struct fman_port *port[PORT_NUM];
29 struct phylink *phylink;
30 struct phylink_config phylink_config;
31 phy_interface_t phy_if;
36 const struct phylink_mac_ops *phylink_ops;
37 int (*enable)(struct fman_mac *mac_dev);
38 void (*disable)(struct fman_mac *mac_dev);
39 int (*set_promisc)(struct fman_mac *mac_dev, bool enable);
40 int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr);
41 int (*set_allmulti)(struct fman_mac *mac_dev, bool enable);
42 int (*set_tstamp)(struct fman_mac *mac_dev, bool enable);
43 int (*set_exception)(struct fman_mac *mac_dev,
44 enum fman_mac_exceptions exception, bool enable);
45 int (*add_hash_mac_addr)(struct fman_mac *mac_dev,
46 enet_addr_t *eth_addr);
47 int (*remove_hash_mac_addr)(struct fman_mac *mac_dev,
48 enet_addr_t *eth_addr);
50 void (*update_speed)(struct mac_device *mac_dev, int speed);
52 struct fman_mac *fman_mac;
53 struct mac_priv_s *priv;
55 struct device *fman_dev;
56 struct device *fman_port_devs[PORT_NUM];
59 static inline struct mac_device
60 *fman_config_to_mac(struct phylink_config *config)
62 return container_of(config, struct mac_device, phylink_config);
65 struct dpaa_eth_data {
66 struct mac_device *mac_dev;
71 extern const char *mac_driver_description;
73 int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev);