2 * Blackfin On-Chip MAC Driver
4 * Copyright 2004-2007 Analog Devices Inc.
6 * Enter bugs at http://blackfin.uclinux.org/
8 * Licensed under the GPL-2 or later.
13 #include <linux/net_tstamp.h>
14 #include <linux/clocksource.h>
15 #include <linux/timecompare.h>
17 #define BFIN_MAC_CSUM_OFFLOAD
19 struct dma_descriptor {
20 struct dma_descriptor *next_dma_desc;
21 unsigned long start_addr;
22 unsigned short config;
23 unsigned short x_count;
26 struct status_area_rx {
27 #if defined(BFIN_MAC_CSUM_OFFLOAD)
28 unsigned short ip_hdr_csum; /* ip header checksum */
29 /* ip payload(udp or tcp or others) checksum */
30 unsigned short ip_payload_csum;
32 unsigned long status_word; /* the frame status word */
35 struct status_area_tx {
36 unsigned long status_word; /* the frame status word */
39 /* use two descriptors for a packet */
40 struct net_dma_desc_rx {
41 struct net_dma_desc_rx *next;
43 struct dma_descriptor desc_a;
44 struct dma_descriptor desc_b;
45 struct status_area_rx status;
48 /* use two descriptors for a packet */
49 struct net_dma_desc_tx {
50 struct net_dma_desc_tx *next;
52 struct dma_descriptor desc_a;
53 struct dma_descriptor desc_b;
54 unsigned char packet[1560];
55 struct status_area_tx status;
58 struct bfin_mac_local {
60 * these are things that the kernel wants me to keep, so users
61 * can find out semi-useless statistics of how well the card is
64 struct net_device_stats stats;
66 unsigned char Mac[6]; /* MAC address of the board */
69 /* MII and PHY stuffs */
70 int old_link; /* used by bf537_adjust_link */
74 struct phy_device *phydev;
75 struct mii_bus *mii_bus;
77 #if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
78 struct cyclecounter cycles;
79 struct timecounter clock;
80 struct timecompare compare;
81 struct hwtstamp_config stamp_cfg;
85 extern void bfin_get_ether_addr(char *addr);