]>
Commit | Line | Data |
---|---|---|
91da11f8 LB |
1 | /* |
2 | * net/dsa/dsa_priv.h - Hardware switch handling | |
e84665c9 | 3 | * Copyright (c) 2008-2009 Marvell Semiconductor |
91da11f8 LB |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License, or | |
8 | * (at your option) any later version. | |
9 | */ | |
10 | ||
11 | #ifndef __DSA_PRIV_H | |
12 | #define __DSA_PRIV_H | |
13 | ||
91da11f8 | 14 | #include <linux/phy.h> |
5075314e | 15 | #include <linux/netdevice.h> |
04ff53f9 | 16 | #include <linux/netpoll.h> |
5075314e AD |
17 | |
18 | struct dsa_device_ops { | |
4ed70ce9 | 19 | struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev); |
5075314e AD |
20 | int (*rcv)(struct sk_buff *skb, struct net_device *dev, |
21 | struct packet_type *pt, struct net_device *orig_dev); | |
22 | }; | |
91da11f8 | 23 | |
91da11f8 | 24 | struct dsa_slave_priv { |
4ed70ce9 | 25 | struct sk_buff * (*xmit)(struct sk_buff *skb, |
5075314e | 26 | struct net_device *dev); |
e84665c9 | 27 | |
afdcf151 VD |
28 | /* DSA port data, such as switch, port index, etc. */ |
29 | struct dsa_port *dp; | |
e84665c9 LB |
30 | |
31 | /* | |
32 | * The phylib phy_device pointer for the PHY connected | |
33 | * to this port. | |
34 | */ | |
91da11f8 | 35 | struct phy_device *phy; |
0d8bcdd3 FF |
36 | phy_interface_t phy_interface; |
37 | int old_link; | |
38 | int old_pause; | |
39 | int old_duplex; | |
b73adef6 | 40 | |
04ff53f9 FF |
41 | #ifdef CONFIG_NET_POLL_CONTROLLER |
42 | struct netpoll *netpoll; | |
43 | #endif | |
f50f2127 FF |
44 | |
45 | /* TC context */ | |
46 | struct list_head mall_tc_list; | |
91da11f8 LB |
47 | }; |
48 | ||
91da11f8 | 49 | /* dsa.c */ |
9b8e895c | 50 | int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev, |
293784a8 FF |
51 | struct dsa_port *dport, int port); |
52 | void dsa_cpu_dsa_destroy(struct dsa_port *dport); | |
39a7f2a4 | 53 | const struct dsa_device_ops *dsa_resolve_tag_protocol(int tag_protocol); |
0c73c523 FF |
54 | int dsa_cpu_port_ethtool_setup(struct dsa_switch *ds); |
55 | void dsa_cpu_port_ethtool_restore(struct dsa_switch *ds); | |
91da11f8 LB |
56 | |
57 | /* slave.c */ | |
5075314e | 58 | extern const struct dsa_device_ops notag_netdev_ops; |
91da11f8 | 59 | void dsa_slave_mii_bus_init(struct dsa_switch *ds); |
af42192c | 60 | void dsa_cpu_port_ethtool_init(struct ethtool_ops *ops); |
d87d6f44 | 61 | int dsa_slave_create(struct dsa_switch *ds, struct device *parent, |
83c0afae | 62 | int port, const char *name); |
cda5c15b | 63 | void dsa_slave_destroy(struct net_device *slave_dev); |
24462549 FF |
64 | int dsa_slave_suspend(struct net_device *slave_dev); |
65 | int dsa_slave_resume(struct net_device *slave_dev); | |
88e4f0ca VD |
66 | int dsa_slave_register_notifier(void); |
67 | void dsa_slave_unregister_notifier(void); | |
91da11f8 | 68 | |
cf85d08f | 69 | /* tag_dsa.c */ |
3e8a72d1 | 70 | extern const struct dsa_device_ops dsa_netdev_ops; |
cf85d08f | 71 | |
91da11f8 | 72 | /* tag_edsa.c */ |
3e8a72d1 | 73 | extern const struct dsa_device_ops edsa_netdev_ops; |
91da11f8 | 74 | |
396138f0 | 75 | /* tag_trailer.c */ |
3e8a72d1 | 76 | extern const struct dsa_device_ops trailer_netdev_ops; |
396138f0 | 77 | |
5037d532 FF |
78 | /* tag_brcm.c */ |
79 | extern const struct dsa_device_ops brcm_netdev_ops; | |
80 | ||
cafdc45c JC |
81 | /* tag_qca.c */ |
82 | extern const struct dsa_device_ops qca_netdev_ops; | |
91da11f8 LB |
83 | |
84 | #endif |