1 //---------------------------------------------------------------------------
2 // FT1000 driver for Flarion Flash OFDM NIC Device
4 // Copyright (C) 2002 Flarion Technologies, All rights reserved.
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 //---------------------------------------------------------------------------
18 // File: ft1000_ioctl.h
20 // Description: Common structures and defines relating to IOCTL
23 // 11/5/02 Whc Created.
25 //---------------------------------------------------------------------------//---------------------------------------------------------------------------
26 #ifndef _FT1000IOCTLH_
27 #define _FT1000IOCTLH_
36 #define MAX_DNLD_BLKSZ 1024
38 // Standard Flarion Pseudo header
39 typedef struct _PSEUDO_HDR
41 unsigned short length
; //length of msg body
42 unsigned char source
; //source address (0x10=Host 0x20=DSP)
43 unsigned char destination
; //destination address (refer to source address)
44 unsigned char portdest
; //destination port id
46 // 0x10=Application Broadcast
52 unsigned char portsrc
; //source port id (refer to portdest)
53 unsigned short sh_str_id
; //stream id (Not applicable on Mobile)
54 unsigned char control
; //stream id (Not applicable on Mobile)
55 unsigned char rsvd1
; //reserved
56 unsigned char seq_num
; //sequence number
57 unsigned char rsvd2
; //reserved
58 unsigned short qos_class
; //Quality of Service class (Not applicable on Mobile)
59 unsigned short checksum
; //Psuedo header checksum
60 } __attribute__ ((packed
)) PSEUDO_HDR
, *PPSEUDO_HDR
;
62 typedef struct _IOCTL_GET_VER
64 unsigned long drv_ver
;
65 } __attribute__ ((packed
)) IOCTL_GET_VER
, *PIOCTL_GET_VER
;
67 //Data structure for Dsp statistics
68 typedef struct _IOCTL_GET_DSP_STAT
70 unsigned char DspVer
[DSPVERSZ
]; // DSP version number
71 unsigned char HwSerNum
[HWSERNUMSZ
]; // Hardware Serial Number
72 unsigned char Sku
[SKUSZ
]; // SKU
73 unsigned char eui64
[EUISZ
]; // EUI64
74 unsigned short ConStat
; // Connection Status
75 // Bits 0-3 = Connection Status Field
76 // 0000=Idle (Disconnect)
78 // 0010=Active (Connected)
79 // 0011=Waiting for L2 down
81 unsigned short LedStat
; // Led Status
82 // Bits 0-3 = Signal Strength Field
83 // 0000 = -105dBm to -92dBm
84 // 0001 = -92dBm to -85dBm
85 // 0011 = -85dBm to -75dBm
86 // 0111 = -75dBm to -50dBm
87 // 1111 = -50dBm to 0dBm
88 // Bits 4-7 = Reserved
89 // Bits 8-11 = SNR Field
93 // 0111 = 15dB to 22dB
95 // Bits 12-15 = Reserved
96 unsigned long nTxPkts
; // Number of packets transmitted from host to dsp
97 unsigned long nRxPkts
; // Number of packets received from dsp to host
98 unsigned long nTxBytes
; // Number of bytes transmitted from host to dsp
99 unsigned long nRxBytes
; // Number of bytes received from dsp to host
100 unsigned long ConTm
; // Current session connection time in seconds
101 unsigned char CalVer
[CALVERSZ
]; // Proprietary Calibration Version
102 unsigned char CalDate
[CALDATESZ
]; // Proprietary Calibration Date
103 } __attribute__ ((packed
)) IOCTL_GET_DSP_STAT
, *PIOCTL_GET_DSP_STAT
;
105 //Data structure for Dual Ported RAM messaging between Host and Dsp
106 typedef struct _IOCTL_DPRAM_BLK
108 unsigned short total_len
;
109 PSEUDO_HDR pseudohdr
;
110 unsigned char buffer
[1780];
111 } __attribute__ ((packed
)) IOCTL_DPRAM_BLK
, *PIOCTL_DPRAM_BLK
;
113 typedef struct _IOCTL_DPRAM_COMMAND
115 unsigned short extra
;
116 IOCTL_DPRAM_BLK dpram_blk
;
117 } __attribute__ ((packed
)) IOCTL_DPRAM_COMMAND
, *PIOCTL_DPRAM_COMMAND
;
120 // Custom IOCTL command codes
122 #define FT1000_MAGIC_CODE 'F'
124 #define IOCTL_REGISTER_CMD 0
125 #define IOCTL_SET_DPRAM_CMD 3
126 #define IOCTL_GET_DPRAM_CMD 4
127 #define IOCTL_GET_DSP_STAT_CMD 6
128 #define IOCTL_GET_VER_CMD 7
129 #define IOCTL_CONNECT 10
130 #define IOCTL_DISCONNECT 11
132 #define IOCTL_FT1000_GET_DSP_STAT _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DSP_STAT_CMD, sizeof(IOCTL_GET_DSP_STAT) )
133 #define IOCTL_FT1000_GET_VER _IOR (FT1000_MAGIC_CODE, IOCTL_GET_VER_CMD, sizeof(IOCTL_GET_VER) )
134 #define IOCTL_FT1000_CONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_CONNECT, 0 )
135 #define IOCTL_FT1000_DISCONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_DISCONNECT, 0 )
136 #define IOCTL_FT1000_SET_DPRAM _IOW (FT1000_MAGIC_CODE, IOCTL_SET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
137 #define IOCTL_FT1000_GET_DPRAM _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
138 #define IOCTL_FT1000_REGISTER _IOW (FT1000_MAGIC_CODE, IOCTL_REGISTER_CMD, sizeof(unsigned short *) )
139 #endif // _FT1000IOCTLH_