Commit f7c1be0c authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

Staging: Add support for Flarion OFDM usb and pcmcia devices.

This drivers add support for following devices:

(usb)-> Qleadtek FLASH-OFDM USB Modem [LR7F04]
     -> Qleadtek Express Card
     -> Leadtek Multi-band modem HSDPA

Sources for usb:
https://sourceforge.net/projects/ft1000/files/ft1000_usb/ft1000_usb_v01.04.tar.gz/download

(pcmcia) -> Multimedia Net Card

Sources for pcmcia :
https://sourceforge.net/projects/ft1000/files/ft1000_pcmcia_2.6.30-2.6.31.tgz/download

More informations (in Slovak language):
	http://ft1000.qintec.sk/home.htmlSigned-off-by: default avatarMarek Belisko <marek.belisko@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 027360c5
......@@ -165,5 +165,7 @@ source "drivers/staging/keucr/Kconfig"
source "drivers/staging/bcm/Kconfig"
source "drivers/staging/ft1000/Kconfig"
endif # !STAGING_EXCLUDE_BUILD
endif # STAGING
......@@ -63,3 +63,4 @@ obj-$(CONFIG_SBE_2T3E3) += sbe-2t3e3/
obj-$(CONFIG_ATH6K_LEGACY) += ath6kl/
obj-$(CONFIG_USB_ENESTORAGE) += keucr/
obj-$(CONFIG_BCM_WIMAX) += bcm/
obj-$(CONFIG_FT1000) += ft1000/
config FT1000
tristate "Drivers for Flarion ft1000 devices"
if FT1000
config FT1000_USB
tristate "Driver for ft1000 usb devices."
depends on USB
depends on NET
help
Say Y if you want to have support for Qleadtek FLASH-OFDM USB Modem [LR7F04],
Qleadtek Express Card or Leadtek Multi-band modem HSDPA.
config FT1000_PCMCIA
tristate "Driver for ft1000 pcmcia device."
depends on PCMCIA
depends on NET
help
Say Y if you want to have support for Flarion card also called
Multimedia Net Card.
endif
obj-$(CONFIG_FT1000_USB) += ft1000-usb/
obj-$(CONFIG_FT1000_PCMCIA) += ft1000-pcmcia/
TODO:
- checkpatch.pl cleanups
- coding style
- sparse fixes
- adapt to latest usb and pcmcia api changes
- change firmware loading for usb driver to proper kernel method (request_firmware)
Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
Cc: Marek Belisko <marek.belisko@gmail.com>
obj-$(CONFIG_FT1000_PCMCIA) = ft1000_pcmcia.o
ft1000_pcmcia-objs := ft1000_hw.o ft1000_dnld.o ft1000_proc.o ft1000_cs.o
//---------------------------------------------------------------------------
// FT1000 driver for Flarion Flash OFDM NIC Device
//
// Copyright (C) 2002 Flarion Technologies, All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option) any
// later version. This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details. You should have received a copy of the GNU General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place -
// Suite 330, Boston, MA 02111-1307, USA.
//---------------------------------------------------------------------------
//
// File: boot.h
//
// Description: boatloader
//
// History:
// 1/11/05 Whc Ported to Linux.
//
//---------------------------------------------------------------------------
#ifndef _BOOTH_
#define _BOOTH_
// Official bootloader
unsigned char bootimage [] = {
0x00,0x00,0x01,0x5E,0x00,0x00
,0x00,0x00,0x00,0x00,0x02,0xD7
,0x00,0x00,0x01,0x5E,0x46,0xB3
,0xE6,0x02,0x00,0x98,0xE6,0x8C
,0x00,0x98,0xFB,0x92,0xFF,0xFF
,0x98,0xFB,0x94,0xFF,0xFF,0x98
,0xFB,0x06,0x08,0x00,0x98,0xFB
,0x96,0x84,0x00,0x98,0xFB,0x08
,0x1C,0x00,0x98,0xFB,0x51,0x25
,0x10,0x1C,0x00,0xE6,0x51,0x01
,0x07,0xFD,0x4C,0xFF,0x20,0xF5
,0x51,0x02,0x20,0x08,0x00,0x4C
,0xFF,0x20,0x3C,0x00,0xC0,0x64
,0x98,0xC0,0x66,0x98,0xC0,0x68
,0x98,0xC0,0x6A,0x98,0xC0,0x6C
,0x98,0x90,0x08,0x90,0x09,0x90
,0x0A,0x90,0x0B,0x90,0x0C,0x90
,0x0D,0x90,0x0E,0x90,0x0F,0x90
,0x04,0x90,0x06,0xFB,0x51,0x22
,0x16,0x08,0x03,0xFB,0x51,0x52
,0x16,0x08,0x04,0xFB,0x51,0x24
,0x2B,0x08,0x06,0xFB,0x51,0x54
,0x2B,0x08,0x07,0xFB,0x51,0x24
,0x2B,0x08,0x09,0xFB,0x51,0x54
,0x2B,0x08,0x0A,0xFB,0x51,0x12
,0x16,0x08,0x0C,0xFB,0x51,0x52
,0x16,0x08,0x0D,0x78,0x00,0x00
,0x00,0x16,0x00,0x00,0xEC,0x31
,0xAE,0x00,0x00,0x81,0x4C,0x0F
,0xE6,0x43,0xFF,0xEC,0x31,0x4E
,0x00,0x00,0x91,0xEC,0x31,0xAE
,0x00,0x00,0x91,0x4C,0x0F,0xE6
,0x43,0xFF,0xEC,0x31,0x5E,0x00
,0x00,0xA1,0xEB,0x31,0x08,0x00
,0x00,0xA6,0xEB,0x31,0x08,0x00
,0x00,0xAC,0x3C,0x00,0xEB,0x31
,0x08,0x00,0x00,0xA8,0x76,0xFE
,0xFE,0x08,0xEB,0x31,0x08,0x20
,0x00,0x00,0x76,0xFF,0xFF,0x18
,0xED,0x31,0x08,0x20,0x00,0x00
,0x26,0x10,0x04,0x10,0xF5,0x3C
,0x01,0x3C,0x00,0x08,0x01,0x12
,0x3C,0x11,0x3C,0x00,0x08,0x01
,0x0B,0x08,0x00,0x6D,0xEC,0x31
,0xAE,0x20,0x00,0x06,0xED,0x4D
,0x08,0x00,0x00,0x67,0x80,0x6F
,0x00,0x01,0x0B,0x6F,0x00,0x02
,0x2E,0x76,0xEE,0x01,0x48,0x06
,0x01,0x39,0xED,0x4D,0x18,0x00
,0x02,0xED,0x4D,0x08,0x00,0x04
,0x14,0x06,0xA4,0xED,0x31,0x22
,0x00,0x00,0xAC,0x76,0xEE,0x07
,0x48,0x6D,0x22,0x01,0x1E,0x08
,0x01,0x58,0xEB,0x31,0x08,0x00
,0x00,0xAC,0x06,0xFF,0xBA,0x3C
,0x00,0xEB,0x31,0x08,0x20,0x00
,0x04,0x3C,0x30,0xEB,0x31,0x08
,0x20,0x00,0x02,0x3C,0x10,0xEB
,0x31,0x08,0x20,0x00,0x00,0xED
,0x31,0x08,0x20,0x00,0x00,0x04
,0x10,0xF7,0xED,0x31,0x08,0x00
,0x00,0xA2,0x91,0x00,0x9C,0x3C
,0x80,0xEB,0x31,0x08,0x20,0x00
,0x04,0x3C,0x20,0xEB,0x31,0x08
,0x20,0x00,0x02,0x3C,0x10,0xEB
,0x31,0x08,0x20,0x00,0x00,0xED
,0x31,0x08,0x20,0x00,0x00,0x04
,0x10,0xF7,0xED,0x31,0x08,0x20
,0x00,0x04,0x42,0x10,0x90,0x08
,0xEC,0x31,0xAE,0x20,0x00,0x06
,0xA4,0x41,0x08,0x00,0xB6,0xED
,0x41,0x28,0x7D,0xFF,0xFF,0x22
,0xB3,0x40,0x98,0x2A,0x32,0xEB
,0x41,0x28,0xB4,0x43,0xFC,0x05
,0xFF,0xE6,0xA0,0x31,0x20,0x00
,0x06,0xEB,0x31,0x08,0x20,0x00
,0x04,0x3C,0x20,0xEB,0x31,0x08
,0x20,0x00,0x02,0x3C,0x10,0xEB
,0x31,0x08,0x20,0x00,0x00,0xED
,0x31,0x08,0x20,0x00,0x00,0x04
,0x10,0xF7,0xED,0x31,0x08,0x20
,0x00,0x04,0x42,0x10,0x90,0x08
,0xEC,0x31,0xAE,0x20,0x00,0x06
,0xA4,0x41,0x08,0x00,0x68,0xED
,0x41,0x28,0x7D,0xFF,0xFF,0x22
,0xB3,0x40,0x98,0x2A,0x32,0xEB
,0x41,0x28,0xB4,0x43,0xFC,0x05
,0xFF,0xE6,0x48,0x04,0xEB,0x31
,0x08,0x20,0x00,0x04,0xEB,0x31
,0x18,0x20,0x00,0x02,0x3C,0x11
,0xEB,0x31,0x18,0x20,0x00,0x00
,0xED,0x31,0x08,0x20,0x00,0x00
,0x04,0x10,0xF7,0xED,0x31,0x08
,0x20,0x00,0x02,0x66,0x00,0x6F
,0x00,0x01,0x16,0x76,0xEE,0x06
,0x48,0x4A,0x1E,0x48,0x04,0xED
,0x31,0x08,0x20,0x00,0x04,0xEB
,0x31,0x08,0x00,0x00,0xA4,0x48
,0x04,0xED,0x31,0x08,0x20,0x00
,0x04,0xEB,0x31,0x08,0x00,0x00
,0xA2,0x48,0x04,0x20,0x20,0x4A
,0x7C,0x46,0x82,0x50,0x05,0x50
,0x15,0xB5,0x1E,0x98,0xED,0x31
,0x08,0x00,0x00,0xA8,0x10,0x47
,0x3B,0x2C,0x01,0xDB,0x40,0x11
,0x98,0xC1,0x1E,0x98,0x10,0x07
,0x30,0xF9,0x40,0x07,0x18,0x98
,0x2A,0x10,0xEB,0x31,0x08,0x00
,0x00,0xA8,0xA4,0x1E,0x98,0xBB
,0x1E,0x98,0x50,0x14,0x50,0x04
,0x46,0x83,0x48,0x04,0x02,0x01
,0x00,0x50,0x05,0x50,0x15,0x10
,0x87,0x3F,0x90,0x2B,0x18,0x01
,0x00,0xC0,0x31,0x00,0x00,0xAE
,0xDF,0x41,0x00,0x08,0x00,0x1A
,0x42,0x11,0x67,0x01,0xDF,0x41
,0x02,0x08,0x00,0x10,0x42,0x11
,0x62,0x01,0xB4,0x43,0x4A,0x68
,0x50,0x14,0x50,0x04,0x24,0x10
,0x48,0x04,0xF2,0x31,0x00,0x01
,0x00,0x00,0xAE,0xF6,0x31,0x00
,0x01,0x00,0x00,0xAE,0x62,0xE4
,0xE5,0x61,0x04,0x48,0x04,0xE5
,0x63,0x05,0x48,0x04,0x20,0x20
,0x00,0x00,0x00,0x00
};
#endif
device "ft1000_cs"
class "network" module "ft1000","ft1000_cs"
card "flarion FT1000"
manfid 0x02cc, 0x0100
bind "ft1000_cs"
card "flarion FT1000"
manfid 0x02cc, 0x1000
bind "ft1000_cs"
card "flarion FT1000"
manfid 0x02cc, 0x1300
bind "ft1000_cs"
This diff is collapsed.
This diff is collapsed.
//---------------------------------------------------------------------------
// FT1000 driver for Flarion Flash OFDM NIC Device
//
// Copyright (C) 2002 Flarion Technologies, All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option) any
// later version. This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details. You should have received a copy of the GNU General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place -
// Suite 330, Boston, MA 02111-1307, USA.
//---------------------------------------------------------------------------
//
// File: ft1000_dev.h
//
// Description: Register definitions and bit masks for the FT1000 NIC
//
// History:
// 2/5/02 Ivan Bohannon Written.
// 8/29/02 Whc Ported to Linux.
//
//---------------------------------------------------------------------------
#ifndef _FT1000_DEVH_
#define _FT1000_DEVH_
//---------------------------------------------------------------------------
//
// Function: ft1000_read_reg
// Descripton: This function will read the value of a given ASIC register.
// Input:
// dev - device structure
// offset - ASIC register offset
// Output:
// data - ASIC register value
//
//---------------------------------------------------------------------------
static inline u16 ft1000_read_reg (struct net_device *dev, u16 offset) {
u16 data = 0;
data = inw(dev->base_addr + offset);
return (data);
}
//---------------------------------------------------------------------------
//
// Function: ft1000_write_reg
// Descripton: This function will set the value for a given ASIC register.
// Input:
// dev - device structure
// offset - ASIC register offset
// value - value to write
// Output:
// None.
//
//---------------------------------------------------------------------------
static inline void ft1000_write_reg (struct net_device *dev, u16 offset, u16 value) {
outw (value, dev->base_addr + offset);
}
#endif // _FT1000_DEVH_
This diff is collapsed.
This diff is collapsed.
/*---------------------------------------------------------------------------
FT1000 driver for Flarion Flash OFDM NIC Device
Copyright (C) 2006 Patrik Ostrihon, All rights reserved.
Copyright (C) 2006 ProWeb Consulting, a.s, All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------------*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/netdevice.h>
#include <asm/uaccess.h>
#include "ft1000.h"
#define FT1000_PROC "ft1000"
#define MAX_FILE_LEN 255
#define PUTM_TO_PAGE(len,page,args...) \
len += snprintf(page+len, PAGE_SIZE - len, args)
#define PUTX_TO_PAGE(len,page,message,size,var) \
len += snprintf(page+len, PAGE_SIZE - len, message); \
for(i = 0; i < (size - 1); i++) \
{ \
len += snprintf(page+len, PAGE_SIZE - len, "%02x:", var[i]); \
} \
len += snprintf(page+len, PAGE_SIZE - len, "%02x\n", var[i])
#define PUTD_TO_PAGE(len,page,message,size,var) \
len += snprintf(page+len, PAGE_SIZE - len, message); \
for(i = 0; i < (size - 1); i++) \
{ \
len += snprintf(page+len, PAGE_SIZE - len, "%d.", var[i]); \
} \
len += snprintf(page+len, PAGE_SIZE - len, "%d\n", var[i])
int ft1000ReadProc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct net_device *dev;
int len;
int i;
FT1000_INFO *info;
char *status[] =
{ "Idle (Disconnect)", "Searching", "Active (Connected)",
"Waiting for L2", "Sleep", "No Coverage", "", ""
};
char *signal[] = { "", "*", "**", "***", "****" };
int strength;
int quality;
struct timeval tv;
time_t delta;
dev = (struct net_device *)data;
info = (FT1000_INFO *) netdev_priv(dev);
if (off > 0) {
*eof = 1;
return 0;
}
/* Wrap-around */
if (info->AsicID == ELECTRABUZZ_ID) {
if (info->DspHibernateFlag == 0) {
if (info->ProgConStat != 0xFF) {
info->LedStat =
ft1000_read_dpram(dev, FT1000_DSP_LED);
info->ConStat =
ft1000_read_dpram(dev,
FT1000_DSP_CON_STATE);
} else {
info->ConStat = 0xf;
}
}
} else {
if (info->ProgConStat != 0xFF) {
info->LedStat =
ntohs(ft1000_read_dpram_mag_16
(dev, FT1000_MAG_DSP_LED,
FT1000_MAG_DSP_LED_INDX));
info->ConStat =
ntohs(ft1000_read_dpram_mag_16
(dev, FT1000_MAG_DSP_CON_STATE,
FT1000_MAG_DSP_CON_STATE_INDX));
} else {
info->ConStat = 0xf;
}
}
i = (info->LedStat) & 0xf;
switch (i) {
case 0x1:
strength = 1;
break;
case 0x3:
strength = 2;
break;
case 0x7:
strength = 3;
break;
case 0xf:
strength = 4;
break;
default:
strength = 0;
}
i = (info->LedStat >> 8) & 0xf;
switch (i) {
case 0x1:
quality = 1;
break;
case 0x3:
quality = 2;
break;
case 0x7:
quality = 3;
break;
case 0xf:
quality = 4;
break;
default:
quality = 0;
}
do_gettimeofday(&tv);
delta = (tv.tv_sec - info->ConTm);
len = 0;
PUTM_TO_PAGE(len, page, "Connection Time: %02ld:%02ld:%02ld\n",
((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
PUTM_TO_PAGE(len, page, "Connection Time[s]: %ld\n", delta);
PUTM_TO_PAGE(len, page, "Asic ID: %s\n",
(info->AsicID) ==
ELECTRABUZZ_ID ? "ELECTRABUZZ ASIC" : "MAGNEMITE ASIC");
PUTX_TO_PAGE(len, page, "SKU: ", SKUSZ, info->Sku);
PUTX_TO_PAGE(len, page, "EUI64: ", EUISZ, info->eui64);
PUTD_TO_PAGE(len, page, "DSP version number: ", DSPVERSZ, info->DspVer);
PUTX_TO_PAGE(len, page, "Hardware Serial Number: ", HWSERNUMSZ,
info->HwSerNum);
PUTX_TO_PAGE(len, page, "Caliberation Version: ", CALVERSZ,
info->RfCalVer);
PUTD_TO_PAGE(len, page, "Caliberation Date: ", CALDATESZ,
info->RfCalDate);
PUTM_TO_PAGE(len, page, "Media State: %s\n",
(info->mediastate) ? "link" : "no link");
PUTM_TO_PAGE(len, page, "Connection Status: %s\n",
status[((info->ConStat) & 0x7)]);
PUTM_TO_PAGE(len, page, "RX packets: %ld\n", info->stats.rx_packets);
PUTM_TO_PAGE(len, page, "TX packets: %ld\n", info->stats.tx_packets);
PUTM_TO_PAGE(len, page, "RX bytes: %ld\n", info->stats.rx_bytes);
PUTM_TO_PAGE(len, page, "TX bytes: %ld\n", info->stats.tx_bytes);
PUTM_TO_PAGE(len, page, "Signal Strength: %s\n", signal[strength]);
PUTM_TO_PAGE(len, page, "Signal Quality: %s\n", signal[quality]);
return len;
}
static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
void *ptr)
{
struct net_device *dev = ptr;
FT1000_INFO *info;
info = (FT1000_INFO *) netdev_priv(dev);
switch (event) {
case NETDEV_CHANGENAME:
remove_proc_entry(info->netdevname, info->proc_ft1000);
create_proc_read_entry(dev->name, 0644, info->proc_ft1000,
ft1000ReadProc, dev);
snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
break;
}
return NOTIFY_DONE;
}
static struct notifier_block ft1000_netdev_notifier = {
.notifier_call = ft1000NotifyProc
};
void ft1000InitProc(struct net_device *dev)
{
FT1000_INFO *info;
info = (FT1000_INFO *) netdev_priv(dev);
info->proc_ft1000 = proc_mkdir(FT1000_PROC, init_net.proc_net);
create_proc_read_entry(dev->name, 0644, info->proc_ft1000,
ft1000ReadProc, dev);
snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
register_netdevice_notifier(&ft1000_netdev_notifier);
}
void ft1000CleanupProc(struct net_device *dev)
{
FT1000_INFO *info;
info = (FT1000_INFO *) netdev_priv(dev);
remove_proc_entry(dev->name, info->proc_ft1000);
remove_proc_entry(FT1000_PROC, init_net.proc_net);
unregister_netdevice_notifier(&ft1000_netdev_notifier);
}
EXPORT_SYMBOL(ft1000InitProc);
EXPORT_SYMBOL(ft1000CleanupProc);
obj-$(CONFIG_FT1000_USB) += ft1000.o
ft1000-objs := ft1000_chdev.o ft1000_download.o ft1000_hw.o ft1000_proc.o ft1000_usb.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _FT1000_HW_H_
#define _FT1000_HW_H_
#include "ft1000_usb.h"
extern u16 ft1000_read_register(struct usb_device *dev, PUSHORT Data, u8 nRegIndx);
extern u16 ft1000_write_register(struct usb_device *dev, USHORT value, u8 nRegIndx);
#endif
//---------------------------------------------------------------------------
// FT1000 driver for Flarion Flash OFDM NIC Device
//
// Copyright (C) 2002 Flarion Technologies, All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option) any
// later version. This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details. You should have received a copy of the GNU General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place -
// Suite 330, Boston, MA 02111-1307, USA.
//---------------------------------------------------------------------------
//
// File: ft1000_ioctl.h
//
// Description: Common structures and defines relating to IOCTL
//
// History:
// 11/5/02 Whc Created.
//
//---------------------------------------------------------------------------//---------------------------------------------------------------------------
#ifndef _FT1000IOCTLH_
#define _FT1000IOCTLH_
#define DSPVERSZ 4
#define HWSERNUMSZ 16
#define SKUSZ 20
#define EUISZ 8
#define CALVERSZ 2
#define CALDATESZ 6
#define MAX_DNLD_BLKSZ 1024
// Standard Flarion Pseudo header
typedef struct _PSEUDO_HDR
{
unsigned short length; //length of msg body
unsigned char source; //source address (0x10=Host 0x20=DSP)
unsigned char destination; //destination address (refer to source address)
unsigned char portdest; //destination port id
// 0x00=Driver
// 0x10=Application Broadcast
// 0x20=Network Stack
// 0x80=Dsp OAM
// 0x90=Dsp Airlink
// 0xa0=Dsp Loader
// 0xb0=Dsp MIP
unsigned char portsrc; //source port id (refer to portdest)
unsigned short sh_str_id; //stream id (Not applicable on Mobile)
unsigned char control; //stream id (Not applicable on Mobile)
unsigned char rsvd1; //reserved
unsigned char seq_num; //sequence number
unsigned char rsvd2; //reserved
unsigned short qos_class; //Quality of Service class (Not applicable on Mobile)
unsigned short checksum; //Psuedo header checksum
} __attribute__ ((packed)) PSEUDO_HDR, *PPSEUDO_HDR;
typedef struct _IOCTL_GET_VER
{
unsigned long drv_ver;
} __attribute__ ((packed)) IOCTL_GET_VER, *PIOCTL_GET_VER;
//Data structure for Dsp statistics
typedef struct _IOCTL_GET_DSP_STAT
{
unsigned char DspVer[DSPVERSZ]; // DSP version number
unsigned char HwSerNum[HWSERNUMSZ]; // Hardware Serial Number
unsigned char Sku[SKUSZ]; // SKU
unsigned char eui64[EUISZ]; // EUI64
unsigned short ConStat; // Connection Status
// Bits 0-3 = Connection Status Field
// 0000=Idle (Disconnect)
// 0001=Searching
// 0010=Active (Connected)
// 0011=Waiting for L2 down
// 0100=Sleep
unsigned short LedStat; // Led Status
// Bits 0-3 = Signal Strength Field
// 0000 = -105dBm to -92dBm
// 0001 = -92dBm to -85dBm
// 0011 = -85dBm to -75dBm
// 0111 = -75dBm to -50dBm
// 1111 = -50dBm to 0dBm
// Bits 4-7 = Reserved
// Bits 8-11 = SNR Field
// 0000 = <2dB
// 0001 = 2dB to 8dB
// 0011 = 8dB to 15dB
// 0111 = 15dB to 22dB
// 1111 = >22dB
// Bits 12-15 = Reserved
unsigned long nTxPkts; // Number of packets transmitted from host to dsp
unsigned long nRxPkts; // Number of packets received from dsp to host
unsigned long nTxBytes; // Number of bytes transmitted from host to dsp
unsigned long nRxBytes; // Number of bytes received from dsp to host
unsigned long ConTm; // Current session connection time in seconds
unsigned char CalVer[CALVERSZ]; // Proprietary Calibration Version
unsigned char CalDate[CALDATESZ]; // Proprietary Calibration Date
} __attribute__ ((packed)) IOCTL_GET_DSP_STAT, *PIOCTL_GET_DSP_STAT;
//Data structure for Dual Ported RAM messaging between Host and Dsp
typedef struct _IOCTL_DPRAM_BLK
{
unsigned short total_len;
PSEUDO_HDR pseudohdr;
unsigned char buffer[1780];
} __attribute__ ((packed)) IOCTL_DPRAM_BLK, *PIOCTL_DPRAM_BLK;
typedef struct _IOCTL_DPRAM_COMMAND
{
unsigned short extra;
IOCTL_DPRAM_BLK dpram_blk;
} __attribute__ ((packed)) IOCTL_DPRAM_COMMAND, *PIOCTL_DPRAM_COMMAND;
//
// Custom IOCTL command codes
//
#define FT1000_MAGIC_CODE 'F'
#define IOCTL_REGISTER_CMD 0
#define IOCTL_SET_DPRAM_CMD 3
#define IOCTL_GET_DPRAM_CMD 4
#define IOCTL_GET_DSP_STAT_CMD 6
#define IOCTL_GET_VER_CMD 7
#define IOCTL_CONNECT 10
#define IOCTL_DISCONNECT 11
#define IOCTL_FT1000_GET_DSP_STAT _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DSP_STAT_CMD, sizeof(IOCTL_GET_DSP_STAT) )
#define IOCTL_FT1000_GET_VER _IOR (FT1000_MAGIC_CODE, IOCTL_GET_VER_CMD, sizeof(IOCTL_GET_VER) )
#define IOCTL_FT1000_CONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_CONNECT, 0 )
#define IOCTL_FT1000_DISCONNECT _IOW (FT1000_MAGIC_CODE, IOCTL_DISCONNECT, 0 )
#define IOCTL_FT1000_SET_DPRAM _IOW (FT1000_MAGIC_CODE, IOCTL_SET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
#define IOCTL_FT1000_GET_DPRAM _IOR (FT1000_MAGIC_CODE, IOCTL_GET_DPRAM_CMD, sizeof(IOCTL_DPRAM_BLK) )
#define IOCTL_FT1000_REGISTER _IOW (FT1000_MAGIC_CODE, IOCTL_REGISTER_CMD, sizeof(unsigned short *) )
#endif // _FT1000IOCTLH_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment