]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/net/dsa.h
8139cp: fix checksum broken
[net-next-2.6.git] / include / net / dsa.h
CommitLineData
91da11f8
LB
1/*
2 * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
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 __LINUX_NET_DSA_H
12#define __LINUX_NET_DSA_H
13
e84665c9
LB
14#define DSA_MAX_SWITCHES 4
15#define DSA_MAX_PORTS 12
16
17struct dsa_chip_data {
18 /*
19 * How to access the switch configuration registers.
20 */
21 struct device *mii_bus;
22 int sw_addr;
23
24 /*
25 * The names of the switch's ports. Use "cpu" to
26 * designate the switch port that the cpu is connected to,
27 * "dsa" to indicate that this port is a DSA link to
28 * another switch, NULL to indicate the port is unused,
29 * or any other string to indicate this is a physical port.
30 */
31 char *port_names[DSA_MAX_PORTS];
32
33 /*
34 * An array (with nr_chips elements) of which element [a]
35 * indicates which port on this switch should be used to
36 * send packets to that are destined for switch a. Can be
37 * NULL if there is only one switch chip.
38 */
39 s8 *rtable;
40};
91da11f8
LB
41
42struct dsa_platform_data {
43 /*
44 * Reference to a Linux network interface that connects
e84665c9 45 * to the root switch chip of the tree.
91da11f8
LB
46 */
47 struct device *netdev;
48
49 /*
e84665c9
LB
50 * Info structs describing each of the switch chips
51 * connected via this network interface.
91da11f8 52 */
e84665c9
LB
53 int nr_chips;
54 struct dsa_chip_data *chip;
91da11f8
LB
55};
56
cf85d08f 57extern bool dsa_uses_dsa_tags(void *dsa_ptr);
396138f0 58extern bool dsa_uses_trailer_tags(void *dsa_ptr);
cf85d08f 59
91da11f8
LB
60
61#endif