Blame view

net/dsa/dsa_priv.h 1.84 KB
91da11f87   Lennert Buytenhek   net: Distributed ...
1
2
  /*
   * net/dsa/dsa_priv.h - Hardware switch handling
e84665c9c   Lennert Buytenhek   dsa: add switch c...
3
   * Copyright (c) 2008-2009 Marvell Semiconductor
91da11f87   Lennert Buytenhek   net: Distributed ...
4
5
6
7
8
9
10
11
12
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation; either version 2 of the License, or
   * (at your option) any later version.
   */
  
  #ifndef __DSA_PRIV_H
  #define __DSA_PRIV_H
91da11f87   Lennert Buytenhek   net: Distributed ...
13
  #include <linux/phy.h>
5075314e4   Alexander Duyck   dsa: Split ops up...
14
15
16
17
18
19
20
  #include <linux/netdevice.h>
  
  struct dsa_device_ops {
  	netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
  	int (*rcv)(struct sk_buff *skb, struct net_device *dev,
  		   struct packet_type *pt, struct net_device *orig_dev);
  };
91da11f87   Lennert Buytenhek   net: Distributed ...
21

91da11f87   Lennert Buytenhek   net: Distributed ...
22
  struct dsa_slave_priv {
e84665c9c   Lennert Buytenhek   dsa: add switch c...
23
24
25
26
  	/*
  	 * The linux network interface corresponding to this
  	 * switch port.
  	 */
91da11f87   Lennert Buytenhek   net: Distributed ...
27
  	struct net_device	*dev;
5075314e4   Alexander Duyck   dsa: Split ops up...
28
29
  	netdev_tx_t		(*xmit)(struct sk_buff *skb,
  					struct net_device *dev);
e84665c9c   Lennert Buytenhek   dsa: add switch c...
30
31
32
33
34
  
  	/*
  	 * Which switch this port is a part of, and the port index
  	 * for this port.
  	 */
91da11f87   Lennert Buytenhek   net: Distributed ...
35
  	struct dsa_switch	*parent;
e84665c9c   Lennert Buytenhek   dsa: add switch c...
36
37
38
39
40
41
  	u8			port;
  
  	/*
  	 * The phylib phy_device pointer for the PHY connected
  	 * to this port.
  	 */
91da11f87   Lennert Buytenhek   net: Distributed ...
42
  	struct phy_device	*phy;
0d8bcdd38   Florian Fainelli   net: dsa: allow f...
43
44
45
46
  	phy_interface_t		phy_interface;
  	int			old_link;
  	int			old_pause;
  	int			old_duplex;
91da11f87   Lennert Buytenhek   net: Distributed ...
47
  };
91da11f87   Lennert Buytenhek   net: Distributed ...
48
49
  /* dsa.c */
  extern char dsa_driver_version[];
91da11f87   Lennert Buytenhek   net: Distributed ...
50
51
  
  /* slave.c */
5075314e4   Alexander Duyck   dsa: Split ops up...
52
  extern const struct dsa_device_ops notag_netdev_ops;
91da11f87   Lennert Buytenhek   net: Distributed ...
53
54
55
56
  void dsa_slave_mii_bus_init(struct dsa_switch *ds);
  struct net_device *dsa_slave_create(struct dsa_switch *ds,
  				    struct device *parent,
  				    int port, char *name);
244625491   Florian Fainelli   net: dsa: allow s...
57
58
  int dsa_slave_suspend(struct net_device *slave_dev);
  int dsa_slave_resume(struct net_device *slave_dev);
91da11f87   Lennert Buytenhek   net: Distributed ...
59

cf85d08fd   Lennert Buytenhek   dsa: add support ...
60
  /* tag_dsa.c */
3e8a72d1d   Florian Fainelli   net: dsa: reduce ...
61
  extern const struct dsa_device_ops dsa_netdev_ops;
cf85d08fd   Lennert Buytenhek   dsa: add support ...
62

91da11f87   Lennert Buytenhek   net: Distributed ...
63
  /* tag_edsa.c */
3e8a72d1d   Florian Fainelli   net: dsa: reduce ...
64
  extern const struct dsa_device_ops edsa_netdev_ops;
91da11f87   Lennert Buytenhek   net: Distributed ...
65

396138f03   Lennert Buytenhek   dsa: add support ...
66
  /* tag_trailer.c */
3e8a72d1d   Florian Fainelli   net: dsa: reduce ...
67
  extern const struct dsa_device_ops trailer_netdev_ops;
396138f03   Lennert Buytenhek   dsa: add support ...
68

5037d532b   Florian Fainelli   net: dsa: add Bro...
69
70
  /* tag_brcm.c */
  extern const struct dsa_device_ops brcm_netdev_ops;
91da11f87   Lennert Buytenhek   net: Distributed ...
71
72
  
  #endif