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/timer.h>
15 #include <linux/etherdevice.h>
16 #include <linux/bfin_mac.h>
19 * Disable hardware checksum for bug #5600 if writeback cache is
20 * enabled. Otherwize, corrupted RX packet will be sent up stack
23 #ifndef CONFIG_BFIN_EXTMEM_WRITEBACK
24 #define BFIN_MAC_CSUM_OFFLOAD
27 #define TX_RECLAIM_JIFFIES (HZ / 5)
29 struct dma_descriptor {
30 struct dma_descriptor *next_dma_desc;
31 unsigned long start_addr;
32 unsigned short config;
33 unsigned short x_count;
36 struct status_area_rx {
37 #if defined(BFIN_MAC_CSUM_OFFLOAD)
38 unsigned short ip_hdr_csum; /* ip header checksum */
39 /* ip payload(udp or tcp or others) checksum */
40 unsigned short ip_payload_csum;
42 unsigned long status_word; /* the frame status word */
45 struct status_area_tx {
46 unsigned long status_word; /* the frame status word */
49 /* use two descriptors for a packet */
50 struct net_dma_desc_rx {
51 struct net_dma_desc_rx *next;
53 struct dma_descriptor desc_a;
54 struct dma_descriptor desc_b;
55 struct status_area_rx status;
58 /* use two descriptors for a packet */
59 struct net_dma_desc_tx {
60 struct net_dma_desc_tx *next;
62 struct dma_descriptor desc_a;
63 struct dma_descriptor desc_b;
64 unsigned char packet[1560];
65 struct status_area_tx status;
68 struct bfin_mac_local {
70 * these are things that the kernel wants me to keep, so users
71 * can find out semi-useless statistics of how well the card is
74 struct net_device_stats stats;
78 int wol; /* Wake On Lan */
79 int irq_wake_requested;
80 struct timer_list tx_reclaim_timer;
81 struct net_device *ndev;
83 /* Data for EMAC_VLAN1 regs */
84 u16 vlan1_mask, vlan2_mask;
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;
94 #if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
97 struct hwtstamp_config stamp_cfg;
101 extern int bfin_get_ether_addr(char *addr);