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 { |
e84665c9 LB |
25 | /* |
26 | * The linux network interface corresponding to this | |
27 | * switch port. | |
28 | */ | |
91da11f8 | 29 | struct net_device *dev; |
4ed70ce9 | 30 | struct sk_buff * (*xmit)(struct sk_buff *skb, |
5075314e | 31 | struct net_device *dev); |
e84665c9 LB |
32 | |
33 | /* | |
34 | * Which switch this port is a part of, and the port index | |
35 | * for this port. | |
36 | */ | |
91da11f8 | 37 | struct dsa_switch *parent; |
e84665c9 LB |
38 | u8 port; |
39 | ||
40 | /* | |
41 | * The phylib phy_device pointer for the PHY connected | |
42 | * to this port. | |
43 | */ | |
91da11f8 | 44 | struct phy_device *phy; |
0d8bcdd3 FF |
45 | phy_interface_t phy_interface; |
46 | int old_link; | |
47 | int old_pause; | |
48 | int old_duplex; | |
b73adef6 FF |
49 | |
50 | struct net_device *bridge_dev; | |
04ff53f9 FF |
51 | #ifdef CONFIG_NET_POLL_CONTROLLER |
52 | struct netpoll *netpoll; | |
53 | #endif | |
91da11f8 LB |
54 | }; |
55 | ||
91da11f8 LB |
56 | /* dsa.c */ |
57 | extern char dsa_driver_version[]; | |
91da11f8 LB |
58 | |
59 | /* slave.c */ | |
5075314e | 60 | extern const struct dsa_device_ops notag_netdev_ops; |
91da11f8 | 61 | void dsa_slave_mii_bus_init(struct dsa_switch *ds); |
d87d6f44 GR |
62 | int dsa_slave_create(struct dsa_switch *ds, struct device *parent, |
63 | int port, char *name); | |
cda5c15b | 64 | void dsa_slave_destroy(struct net_device *slave_dev); |
24462549 FF |
65 | int dsa_slave_suspend(struct net_device *slave_dev); |
66 | int dsa_slave_resume(struct net_device *slave_dev); | |
b73adef6 FF |
67 | int dsa_slave_netdevice_event(struct notifier_block *unused, |
68 | unsigned long event, void *ptr); | |
91da11f8 | 69 | |
cf85d08f | 70 | /* tag_dsa.c */ |
3e8a72d1 | 71 | extern const struct dsa_device_ops dsa_netdev_ops; |
cf85d08f | 72 | |
91da11f8 | 73 | /* tag_edsa.c */ |
3e8a72d1 | 74 | extern const struct dsa_device_ops edsa_netdev_ops; |
91da11f8 | 75 | |
396138f0 | 76 | /* tag_trailer.c */ |
3e8a72d1 | 77 | extern const struct dsa_device_ops trailer_netdev_ops; |
396138f0 | 78 | |
5037d532 FF |
79 | /* tag_brcm.c */ |
80 | extern const struct dsa_device_ops brcm_netdev_ops; | |
81 | ||
91da11f8 LB |
82 | |
83 | #endif |