2 * File: drivers/net/bfin_mac.c
5 * Bryan Wu <bryan.wu@analog.com>
8 * Luke Yang <luke.yang@analog.com>
14 * Copyright 2004-2006 Analog Devices Inc.
16 * Bugs: Enter bugs at http://blackfin.uclinux.org/
18 * This program is free software ; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation ; either version 2, or (at your option)
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY ; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program ; see the file COPYING.
30 * If not, write to the Free Software Foundation,
31 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #define BFIN_MAC_CSUM_OFFLOAD
36 struct dma_descriptor {
37 struct dma_descriptor *next_dma_desc;
38 unsigned long start_addr;
39 unsigned short config;
40 unsigned short x_count;
43 struct status_area_rx {
44 #if defined(BFIN_MAC_CSUM_OFFLOAD)
45 unsigned short ip_hdr_csum; /* ip header checksum */
46 /* ip payload(udp or tcp or others) checksum */
47 unsigned short ip_payload_csum;
49 unsigned long status_word; /* the frame status word */
52 struct status_area_tx {
53 unsigned long status_word; /* the frame status word */
56 /* use two descriptors for a packet */
57 struct net_dma_desc_rx {
58 struct net_dma_desc_rx *next;
60 struct dma_descriptor desc_a;
61 struct dma_descriptor desc_b;
62 struct status_area_rx status;
65 /* use two descriptors for a packet */
66 struct net_dma_desc_tx {
67 struct net_dma_desc_tx *next;
69 struct dma_descriptor desc_a;
70 struct dma_descriptor desc_b;
71 unsigned char packet[1560];
72 struct status_area_tx status;
75 struct bf537mac_local {
77 * these are things that the kernel wants me to keep, so users
78 * can find out semi-useless statistics of how well the card is
81 struct net_device_stats stats;
83 unsigned char Mac[6]; /* MAC address of the board */
86 /* MII and PHY stuffs */
87 int old_link; /* used by bf537_adjust_link */
91 struct phy_device *phydev;
92 struct mii_bus mii_bus;
95 extern void get_bf537_ether_addr(char *addr);