linux/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h
<<
>>
Prefs
   1/*
   2 *---------------------------------------------------------------------------
   3 * FT1000 driver for Flarion Flash OFDM NIC Device
   4 *
   5 * Copyright (C) 2002 Flarion Technologies, All rights reserved.
   6 *
   7 * This program is free software; you can redistribute it and/or modify it
   8 * under the terms of the GNU General Public License as published by the Free
   9 * Software Foundation; either version 2 of the License, or (at your option) any
  10 * later version. This program is distributed in the hope that it will be useful,
  11 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  13 * more details. You should have received a copy of the GNU General Public
  14 * License along with this program; if not, write to the
  15 * Free Software Foundation, Inc., 59 Temple Place -
  16 * Suite 330, Boston, MA 02111-1307, USA.
  17 *---------------------------------------------------------------------------
  18 *
  19 * File:         ft1000_ioctl.h
  20 *
  21 * Description:    Common structures and defines relating to IOCTL
  22 *
  23 * History:
  24 * 11/5/02    Whc                Created.
  25 *
  26 *---------------------------------------------------------------------------
  27 */
  28#ifndef _FT1000IOCTLH_
  29#define _FT1000IOCTLH_
  30
  31struct IOCTL_GET_VER {
  32        unsigned long drv_ver;
  33} __packed;
  34
  35/* Data structure for Dsp statistics */
  36struct IOCTL_GET_DSP_STAT {
  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
  64                                               * from host to dsp
  65                                               */
  66        unsigned long nRxPkts;                /* Number of packets received from
  67                                               * dsp to host
  68                                               */
  69        unsigned long nTxBytes;               /* Number of bytes transmitted
  70                                               * from host to dsp
  71                                               */
  72        unsigned long nRxBytes;               /* Number of bytes received from
  73                                               * dsp to host
  74                                               */
  75        unsigned long ConTm;                  /* Current session connection time
  76                                               * in seconds
  77                                               */
  78        unsigned char CalVer[CALVERSZ];       /* Proprietary Calibration
  79                                               * Version
  80                                               */
  81        unsigned char CalDate[CALDATESZ];     /* Proprietary Calibration Date */
  82} __packed;
  83
  84/* Data structure for Dual Ported RAM messaging between Host and Dsp */
  85struct IOCTL_DPRAM_BLK {
  86        unsigned short total_len;
  87        struct pseudo_hdr pseudohdr;
  88        unsigned char buffer[1780];
  89} __packed;
  90
  91struct IOCTL_DPRAM_COMMAND {
  92        unsigned short extra;
  93        struct IOCTL_DPRAM_BLK dpram_blk;
  94} __packed;
  95
  96/*
  97 * Custom IOCTL command codes
  98 */
  99#define FT1000_MAGIC_CODE      'F'
 100
 101#define IOCTL_REGISTER_CMD      0
 102#define IOCTL_SET_DPRAM_CMD     3
 103#define IOCTL_GET_DPRAM_CMD     4
 104#define IOCTL_GET_DSP_STAT_CMD  6
 105#define IOCTL_GET_VER_CMD       7
 106#define IOCTL_CONNECT           10
 107#define IOCTL_DISCONNECT        11
 108
 109#define IOCTL_FT1000_GET_DSP_STAT _IOR(FT1000_MAGIC_CODE,               \
 110                                       IOCTL_GET_DSP_STAT_CMD,          \
 111                                       struct IOCTL_GET_DSP_STAT)
 112#define IOCTL_FT1000_GET_VER _IOR(FT1000_MAGIC_CODE, IOCTL_GET_VER_CMD, \
 113                                  struct IOCTL_GET_VER)
 114#define IOCTL_FT1000_CONNECT _IO(FT1000_MAGIC_CODE, IOCTL_CONNECT)
 115#define IOCTL_FT1000_DISCONNECT _IO(FT1000_MAGIC_CODE, IOCTL_DISCONNECT)
 116#define IOCTL_FT1000_SET_DPRAM _IOW(FT1000_MAGIC_CODE, IOCTL_SET_DPRAM_CMD, \
 117                                    struct IOCTL_DPRAM_BLK)
 118#define IOCTL_FT1000_GET_DPRAM _IOR(FT1000_MAGIC_CODE, IOCTL_GET_DPRAM_CMD, \
 119                                    struct IOCTL_DPRAM_BLK)
 120#define IOCTL_FT1000_REGISTER  _IOW(FT1000_MAGIC_CODE, IOCTL_REGISTER_CMD, \
 121                                    unsigned short *)
 122
 123#endif /* _FT1000IOCTLH_ */
 124