Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / ft1000 / ft1000-pcmcia / ft1000.h
1 /*---------------------------------------------------------------------------
2   FT1000 driver for Flarion Flash OFDM NIC Device
3
4   Copyright (C) 2002 Flarion Technologies, All rights reserved.
5
6   This program is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published by the Free
8   Software Foundation; either version 2 of the License, or (at your option) any
9   later version. This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12   more details. You should have received a copy of the GNU General Public
13   License along with this program; if not, write to the
14   Free Software Foundation, Inc., 59 Temple Place -
15   Suite 330, Boston, MA 02111-1307, USA.
16   ---------------------------------------------------------------------------
17   Description:    Common structures and defines
18   ---------------------------------------------------------------------------*/
19 #ifndef _FT1000H_
20 #define _FT1000H_
21
22 #include "../ft1000.h"
23
24 #define FT1000_DRV_VER 0x01010300
25
26 #define FT1000_DPRAM_BASE       0x0000  /* Dual Port RAM starting offset */
27
28 /*
29  * Maximum number of occurrence of pseudo header errors before resetting PC
30  * Card.
31  */
32 #define MAX_PH_ERR      300
33
34 #define SUCCESS 0x00
35 #define FAILURE 0x01
36
37 struct ft1000_pcmcia {
38         int PktIntfErr;
39         u16 packetseqnum;
40         void *link;
41 };
42
43 struct pcmcia_device;
44 struct net_device;
45 extern struct net_device *init_ft1000_card(struct pcmcia_device *link,
46                                            void *ft1000_reset);
47 extern void stop_ft1000_card(struct net_device *dev);
48 extern int card_download(struct net_device *dev, const u8 *pFileStart,
49                          size_t FileLength);
50
51 extern u16 ft1000_read_dpram(struct net_device *dev, int offset);
52 extern void card_bootload(struct net_device *dev);
53 extern u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset,
54                                     int Index);
55 extern u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset);
56 void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value);
57
58 /* Read the value of a given ASIC register. */
59 static inline u16 ft1000_read_reg(struct net_device *dev, u16 offset)
60 {
61         return inw(dev->base_addr + offset);
62 }
63
64 /* Set the value of a given ASIC register. */
65 static inline void ft1000_write_reg(struct net_device *dev, u16 offset,
66                                     u16 value)
67 {
68         outw(value, dev->base_addr + offset);
69 }
70
71 #endif