Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ft1000_ioctl.h
Go to the documentation of this file.
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 //
18 // File: ft1000_ioctl.h
19 //
20 // Description: Common structures and defines relating to IOCTL
21 //
22 // History:
23 // 11/5/02 Whc Created.
24 //
25 //---------------------------------------------------------------------------//---------------------------------------------------------------------------
26 #ifndef _FT1000IOCTLH_
27 #define _FT1000IOCTLH_
28 
29 typedef struct _IOCTL_GET_VER
30 {
31  unsigned long drv_ver;
32 } __attribute__ ((packed)) IOCTL_GET_VER, *PIOCTL_GET_VER;
33 
34 //Data structure for Dsp statistics
36 {
37  unsigned char DspVer[DSPVERSZ]; // DSP version number
38  unsigned char HwSerNum[HWSERNUMSZ]; // Hardware Serial Number
39  unsigned char Sku[SKUSZ]; // SKU
40  unsigned char eui64[EUISZ]; // EUI64
41  unsigned short ConStat; // Connection Status
42  // Bits 0-3 = Connection Status Field
43  // 0000=Idle (Disconnect)
44  // 0001=Searching
45  // 0010=Active (Connected)
46  // 0011=Waiting for L2 down
47  // 0100=Sleep
48  unsigned short LedStat; // Led Status
49  // Bits 0-3 = Signal Strength Field
50  // 0000 = -105dBm to -92dBm
51  // 0001 = -92dBm to -85dBm
52  // 0011 = -85dBm to -75dBm
53  // 0111 = -75dBm to -50dBm
54  // 1111 = -50dBm to 0dBm
55  // Bits 4-7 = Reserved
56  // Bits 8-11 = SNR Field
57  // 0000 = <2dB
58  // 0001 = 2dB to 8dB
59  // 0011 = 8dB to 15dB
60  // 0111 = 15dB to 22dB
61  // 1111 = >22dB
62  // Bits 12-15 = Reserved
63  unsigned long nTxPkts; // Number of packets transmitted from host to dsp
64  unsigned long nRxPkts; // Number of packets received from dsp to host
65  unsigned long nTxBytes; // Number of bytes transmitted from host to dsp
66  unsigned long nRxBytes; // Number of bytes received from dsp to host
67  unsigned long ConTm; // Current session connection time in seconds
68  unsigned char CalVer[CALVERSZ]; // Proprietary Calibration Version
69  unsigned char CalDate[CALDATESZ]; // Proprietary Calibration Date
70 } __attribute__ ((packed)) IOCTL_GET_DSP_STAT, *PIOCTL_GET_DSP_STAT;
71 
72 //Data structure for Dual Ported RAM messaging between Host and Dsp
74 {
75  unsigned short total_len;
77  unsigned char buffer[1780];
78 } __attribute__ ((packed)) IOCTL_DPRAM_BLK, *PIOCTL_DPRAM_BLK;
79 
81 {
82  unsigned short extra;
83  IOCTL_DPRAM_BLK dpram_blk;
84 } __attribute__ ((packed)) IOCTL_DPRAM_COMMAND, *PIOCTL_DPRAM_COMMAND;
85 
86 //
87 // Custom IOCTL command codes
88 //
89 #define FT1000_MAGIC_CODE 'F'
90 
91 #define IOCTL_REGISTER_CMD 0
92 #define IOCTL_SET_DPRAM_CMD 3
93 #define IOCTL_GET_DPRAM_CMD 4
94 #define IOCTL_GET_DSP_STAT_CMD 6
95 #define IOCTL_GET_VER_CMD 7
96 #define IOCTL_CONNECT 10
97 #define IOCTL_DISCONNECT 11
98 
99 #define IOCTL_FT1000_GET_DSP_STAT _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DSP_STAT_CMD, sizeof(IOCTL_GET_DSP_STAT) )
100 #define IOCTL_FT1000_GET_VER _IOR (FT1000_MAGIC_CODE, IOCTL_GET_VER_CMD, sizeof(IOCTL_GET_VER) )
101 #define IOCTL_FT1000_CONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_CONNECT, 0 )
102 #define IOCTL_FT1000_DISCONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_DISCONNECT, 0 )
103 #define IOCTL_FT1000_SET_DPRAM _IOW (FT1000_MAGIC_CODE, IOCTL_SET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
104 #define IOCTL_FT1000_GET_DPRAM _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
105 #define IOCTL_FT1000_REGISTER _IOW (FT1000_MAGIC_CODE, IOCTL_REGISTER_CMD, sizeof(unsigned short *) )
106 #endif // _FT1000IOCTLH_
107