• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Blackfin On-Chip MAC Driver
3  *
4  * Copyright 2004-2007 Analog Devices Inc.
5  *
6  * Enter bugs at http://blackfin.uclinux.org/
7  *
8  * Licensed under the GPL-2 or later.
9  */
10 
11 #define BFIN_MAC_CSUM_OFFLOAD
12 
13 struct dma_descriptor {
14 	struct dma_descriptor *next_dma_desc;
15 	unsigned long start_addr;
16 	unsigned short config;
17 	unsigned short x_count;
18 };
19 
20 struct status_area_rx {
21 #if defined(BFIN_MAC_CSUM_OFFLOAD)
22 	unsigned short ip_hdr_csum;	/* ip header checksum */
23 	/* ip payload(udp or tcp or others) checksum */
24 	unsigned short ip_payload_csum;
25 #endif
26 	unsigned long status_word;	/* the frame status word */
27 };
28 
29 struct status_area_tx {
30 	unsigned long status_word;	/* the frame status word */
31 };
32 
33 /* use two descriptors for a packet */
34 struct net_dma_desc_rx {
35 	struct net_dma_desc_rx *next;
36 	struct sk_buff *skb;
37 	struct dma_descriptor desc_a;
38 	struct dma_descriptor desc_b;
39 	struct status_area_rx status;
40 };
41 
42 /* use two descriptors for a packet */
43 struct net_dma_desc_tx {
44 	struct net_dma_desc_tx *next;
45 	struct sk_buff *skb;
46 	struct dma_descriptor desc_a;
47 	struct dma_descriptor desc_b;
48 	unsigned char packet[1560];
49 	struct status_area_tx status;
50 };
51 
52 struct bfin_mac_local {
53 	/*
54 	 * these are things that the kernel wants me to keep, so users
55 	 * can find out semi-useless statistics of how well the card is
56 	 * performing
57 	 */
58 	struct net_device_stats stats;
59 
60 	unsigned char Mac[6];	/* MAC address of the board */
61 	spinlock_t lock;
62 
63 	/* MII and PHY stuffs */
64 	int old_link;          /* used by bf537_adjust_link */
65 	int old_speed;
66 	int old_duplex;
67 
68 	struct phy_device *phydev;
69 	struct mii_bus *mii_bus;
70 };
71 
72 extern void bfin_get_ether_addr(char *addr);
73