Merge tag 'metag-fixes-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / drivers / net / ethernet / adi / bfin_mac.h
CommitLineData
e190d6b1 1/*
2fb9d6f5 2 * Blackfin On-Chip MAC Driver
e190d6b1 3 *
2fb9d6f5 4 * Copyright 2004-2007 Analog Devices Inc.
e190d6b1 5 *
2fb9d6f5 6 * Enter bugs at http://blackfin.uclinux.org/
e190d6b1 7 *
2fb9d6f5 8 * Licensed under the GPL-2 or later.
e190d6b1 9 */
fe92afed
BS
10#ifndef _BFIN_MAC_H_
11#define _BFIN_MAC_H_
12
13#include <linux/net_tstamp.h>
dd87b22f 14#include <linux/ptp_clock_kernel.h>
4fcc3d34 15#include <linux/timer.h>
02460d08
SZ
16#include <linux/etherdevice.h>
17#include <linux/bfin_mac.h>
e190d6b1 18
2d70a3d4
SZ
19/*
20 * Disable hardware checksum for bug #5600 if writeback cache is
21 * enabled. Otherwize, corrupted RX packet will be sent up stack
22 * without error mark.
23 */
24#ifndef CONFIG_BFIN_EXTMEM_WRITEBACK
e190d6b1 25#define BFIN_MAC_CSUM_OFFLOAD
2d70a3d4 26#endif
e190d6b1 27
4fcc3d34
SZ
28#define TX_RECLAIM_JIFFIES (HZ / 5)
29
e190d6b1
BW
30struct dma_descriptor {
31 struct dma_descriptor *next_dma_desc;
32 unsigned long start_addr;
33 unsigned short config;
34 unsigned short x_count;
35};
36
37struct status_area_rx {
38#if defined(BFIN_MAC_CSUM_OFFLOAD)
39 unsigned short ip_hdr_csum; /* ip header checksum */
40 /* ip payload(udp or tcp or others) checksum */
41 unsigned short ip_payload_csum;
42#endif
43 unsigned long status_word; /* the frame status word */
44};
45
46struct status_area_tx {
47 unsigned long status_word; /* the frame status word */
48};
49
50/* use two descriptors for a packet */
51struct net_dma_desc_rx {
52 struct net_dma_desc_rx *next;
53 struct sk_buff *skb;
54 struct dma_descriptor desc_a;
55 struct dma_descriptor desc_b;
56 struct status_area_rx status;
57};
58
59/* use two descriptors for a packet */
60struct net_dma_desc_tx {
61 struct net_dma_desc_tx *next;
62 struct sk_buff *skb;
63 struct dma_descriptor desc_a;
64 struct dma_descriptor desc_b;
65 unsigned char packet[1560];
66 struct status_area_tx status;
67};
68
7ef0a7ee 69struct bfin_mac_local {
e190d6b1
BW
70 /*
71 * these are things that the kernel wants me to keep, so users
72 * can find out semi-useless statistics of how well the card is
73 * performing
74 */
4ae5a3ad 75 struct net_device_stats stats;
e190d6b1 76
e190d6b1 77 spinlock_t lock;
4ae5a3ad 78
53fd3f28
MH
79 int wol; /* Wake On Lan */
80 int irq_wake_requested;
4fcc3d34
SZ
81 struct timer_list tx_reclaim_timer;
82 struct net_device *ndev;
53fd3f28 83
c599bd6b
MF
84 /* Data for EMAC_VLAN1 regs */
85 u16 vlan1_mask, vlan2_mask;
86
4ae5a3ad
BW
87 /* MII and PHY stuffs */
88 int old_link; /* used by bf537_adjust_link */
89 int old_speed;
90 int old_duplex;
91
92 struct phy_device *phydev;
298cf9be 93 struct mii_bus *mii_bus;
fe92afed
BS
94
95#if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
bc3c5f63
RC
96 u32 addend;
97 unsigned int shift;
dd87b22f 98 s32 max_ppb;
fe92afed 99 struct hwtstamp_config stamp_cfg;
dd87b22f
RC
100 struct ptp_clock_info caps;
101 struct ptp_clock *clock;
102 int phc_index;
103 spinlock_t phc_lock; /* protects time lo/hi registers */
fe92afed 104#endif
e190d6b1
BW
105};
106
5055d2f2 107extern int bfin_get_ether_addr(char *addr);
fe92afed
BS
108
109#endif
This page took 1.002854 seconds and 5 git commands to generate.