Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ft1000_dnld.c File Reference
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/unistd.h>
#include <linux/netdevice.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/vmalloc.h>
#include "ft1000.h"
#include "boot.h"

Go to the source code of this file.

Data Structures

struct  dsp_file_hdr
 
struct  dsp_image_info
 

Macros

#define __KERNEL_SYSCALLS__
 
#define DEBUG(n, args...)
 
#define MAX_DSP_WAIT_LOOPS   100
 
#define DSP_WAIT_SLEEP_TIME   1 /* 1 millisecond */
 
#define MAX_LENGTH   0x7f0
 
#define DWNLD_MAG_HANDSHAKE_LOC   0x00
 
#define DWNLD_MAG_TYPE_LOC   0x01
 
#define DWNLD_MAG_SIZE_LOC   0x02
 
#define DWNLD_MAG_PS_HDR_LOC   0x03
 
#define DWNLD_HANDSHAKE_LOC   0x02
 
#define DWNLD_TYPE_LOC   0x04
 
#define DWNLD_SIZE_MSW_LOC   0x06
 
#define DWNLD_SIZE_LSW_LOC   0x08
 
#define DWNLD_PS_HDR_LOC   0x0A
 
#define HANDSHAKE_TIMEOUT_VALUE   0xF1F1
 
#define HANDSHAKE_RESET_VALUE   0xFEFE /* When DSP requests startover */
 
#define HANDSHAKE_DSP_BL_READY   0xFEFE /* At start DSP writes this when bootloader ready */
 
#define HANDSHAKE_DRIVER_READY   0xFFFF /* Driver writes after receiving 0xFEFE */
 
#define HANDSHAKE_SEND_DATA   0x0000 /* DSP writes this when ready for more data */
 
#define HANDSHAKE_REQUEST   0x0001 /* Request from DSP */
 
#define HANDSHAKE_RESPONSE   0x0000 /* Satisfied DSP request */
 
#define REQUEST_CODE_LENGTH   0x0000
 
#define REQUEST_RUN_ADDRESS   0x0001
 
#define REQUEST_CODE_SEGMENT   0x0002 /* In WORD count */
 
#define REQUEST_DONE_BL   0x0003
 
#define REQUEST_DONE_CL   0x0004
 
#define REQUEST_VERSION_INFO   0x0005
 
#define REQUEST_CODE_BY_VERSION   0x0006
 
#define REQUEST_MAILBOX_DATA   0x0007
 
#define REQUEST_FILE_CHECKSUM   0x0008
 
#define STATE_START_DWNLD   0x01
 
#define STATE_BOOT_DWNLD   0x02
 
#define STATE_CODE_DWNLD   0x03
 
#define STATE_DONE_DWNLD   0x04
 
#define STATE_SECTION_PROV   0x05
 
#define STATE_DONE_PROV   0x06
 
#define STATE_DONE_FILE   0x07
 

Functions

u16 get_handshake (struct net_device *dev, u16 expected_value)
 
void put_handshake (struct net_device *dev, u16 handshake_value)
 
u16 get_request_type (struct net_device *dev)
 
long get_request_value (struct net_device *dev)
 
void put_request_value (struct net_device *dev, long lvalue)
 
u16 hdr_checksum (struct pseudo_hdr *pHdr)
 
struct dsp_file_hdr __attribute__ ((packed))
 
void card_bootload (struct net_device *dev)
 
int card_download (struct net_device *dev, const u8 *pFileStart, size_t FileLength)
 

Variables

u32 version_id
 
u32 package_id
 
u32 build_date
 
u32 commands_offset
 
u32 loader_offset
 
u32 loader_code_address
 
u32 loader_code_end
 
u32 loader_code_size
 
u32 version_data_offset
 
u32 version_data_size
 
u32 nDspImages
 
u32 coff_date
 
u32 begin_offset
 
u32 end_offset
 
u32 run_address
 
u32 image_size
 
u32 version
 
unsigned short checksum
 
unsigned short pad1
 

Macro Definition Documentation

#define __KERNEL_SYSCALLS__

Definition at line 23 of file ft1000_dnld.c.

#define DEBUG (   n,
  args... 
)

Definition at line 43 of file ft1000_dnld.c.

#define DSP_WAIT_SLEEP_TIME   1 /* 1 millisecond */

Definition at line 47 of file ft1000_dnld.c.

#define DWNLD_HANDSHAKE_LOC   0x02

Definition at line 56 of file ft1000_dnld.c.

#define DWNLD_MAG_HANDSHAKE_LOC   0x00

Definition at line 51 of file ft1000_dnld.c.

#define DWNLD_MAG_PS_HDR_LOC   0x03

Definition at line 54 of file ft1000_dnld.c.

#define DWNLD_MAG_SIZE_LOC   0x02

Definition at line 53 of file ft1000_dnld.c.

#define DWNLD_MAG_TYPE_LOC   0x01

Definition at line 52 of file ft1000_dnld.c.

#define DWNLD_PS_HDR_LOC   0x0A

Definition at line 60 of file ft1000_dnld.c.

#define DWNLD_SIZE_LSW_LOC   0x08

Definition at line 59 of file ft1000_dnld.c.

#define DWNLD_SIZE_MSW_LOC   0x06

Definition at line 58 of file ft1000_dnld.c.

#define DWNLD_TYPE_LOC   0x04

Definition at line 57 of file ft1000_dnld.c.

#define HANDSHAKE_DRIVER_READY   0xFFFF /* Driver writes after receiving 0xFEFE */

Definition at line 65 of file ft1000_dnld.c.

#define HANDSHAKE_DSP_BL_READY   0xFEFE /* At start DSP writes this when bootloader ready */

Definition at line 64 of file ft1000_dnld.c.

#define HANDSHAKE_REQUEST   0x0001 /* Request from DSP */

Definition at line 68 of file ft1000_dnld.c.

#define HANDSHAKE_RESET_VALUE   0xFEFE /* When DSP requests startover */

Definition at line 63 of file ft1000_dnld.c.

#define HANDSHAKE_RESPONSE   0x0000 /* Satisfied DSP request */

Definition at line 69 of file ft1000_dnld.c.

#define HANDSHAKE_SEND_DATA   0x0000 /* DSP writes this when ready for more data */

Definition at line 66 of file ft1000_dnld.c.

#define HANDSHAKE_TIMEOUT_VALUE   0xF1F1

Definition at line 62 of file ft1000_dnld.c.

#define MAX_DSP_WAIT_LOOPS   100

Definition at line 46 of file ft1000_dnld.c.

#define MAX_LENGTH   0x7f0

Definition at line 49 of file ft1000_dnld.c.

#define REQUEST_CODE_BY_VERSION   0x0006

Definition at line 77 of file ft1000_dnld.c.

#define REQUEST_CODE_LENGTH   0x0000

Definition at line 71 of file ft1000_dnld.c.

#define REQUEST_CODE_SEGMENT   0x0002 /* In WORD count */

Definition at line 73 of file ft1000_dnld.c.

#define REQUEST_DONE_BL   0x0003

Definition at line 74 of file ft1000_dnld.c.

#define REQUEST_DONE_CL   0x0004

Definition at line 75 of file ft1000_dnld.c.

#define REQUEST_FILE_CHECKSUM   0x0008

Definition at line 79 of file ft1000_dnld.c.

#define REQUEST_MAILBOX_DATA   0x0007

Definition at line 78 of file ft1000_dnld.c.

#define REQUEST_RUN_ADDRESS   0x0001

Definition at line 72 of file ft1000_dnld.c.

#define REQUEST_VERSION_INFO   0x0005

Definition at line 76 of file ft1000_dnld.c.

#define STATE_BOOT_DWNLD   0x02

Definition at line 82 of file ft1000_dnld.c.

#define STATE_CODE_DWNLD   0x03

Definition at line 83 of file ft1000_dnld.c.

#define STATE_DONE_DWNLD   0x04

Definition at line 84 of file ft1000_dnld.c.

#define STATE_DONE_FILE   0x07

Definition at line 87 of file ft1000_dnld.c.

#define STATE_DONE_PROV   0x06

Definition at line 86 of file ft1000_dnld.c.

#define STATE_SECTION_PROV   0x05

Definition at line 85 of file ft1000_dnld.c.

#define STATE_START_DWNLD   0x01

Definition at line 81 of file ft1000_dnld.c.

Function Documentation

struct dsp_file_hdr __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

void card_bootload ( struct net_device dev)

Definition at line 121 of file ft1000_dnld.c.

int card_download ( struct net_device dev,
const u8 pFileStart,
size_t  FileLength 
)

Definition at line 290 of file ft1000_dnld.c.

u16 get_handshake ( struct net_device dev,
u16  expected_value 
)

Definition at line 153 of file ft1000_dnld.c.

u16 get_request_type ( struct net_device dev)

Definition at line 204 of file ft1000_dnld.c.

long get_request_value ( struct net_device dev)

Definition at line 223 of file ft1000_dnld.c.

u16 hdr_checksum ( struct pseudo_hdr pHdr)

Definition at line 279 of file ft1000_dnld.c.

void put_handshake ( struct net_device dev,
u16  handshake_value 
)

Definition at line 188 of file ft1000_dnld.c.

void put_request_value ( struct net_device dev,
long  lvalue 
)

Definition at line 252 of file ft1000_dnld.c.

Variable Documentation

u32 begin_offset

Definition at line 121 of file ft1000_dnld.c.

u32 build_date

Definition at line 111 of file ft1000_dnld.c.

unsigned short checksum

Definition at line 126 of file ft1000_dnld.c.

u32 coff_date

Definition at line 120 of file ft1000_dnld.c.

u32 commands_offset

Definition at line 112 of file ft1000_dnld.c.

u32 end_offset

Definition at line 122 of file ft1000_dnld.c.

Definition at line 124 of file ft1000_dnld.c.

u32 loader_code_address

Definition at line 114 of file ft1000_dnld.c.

u32 loader_code_end

Definition at line 115 of file ft1000_dnld.c.

u32 loader_code_size

Definition at line 116 of file ft1000_dnld.c.

u32 loader_offset

Definition at line 113 of file ft1000_dnld.c.

u32 nDspImages

Definition at line 119 of file ft1000_dnld.c.

u32 package_id

Definition at line 110 of file ft1000_dnld.c.

unsigned short pad1

Definition at line 127 of file ft1000_dnld.c.

u32 run_address

Definition at line 123 of file ft1000_dnld.c.

u32 version

Definition at line 125 of file ft1000_dnld.c.

u32 version_data_offset

Definition at line 117 of file ft1000_dnld.c.

u32 version_data_size

Definition at line 118 of file ft1000_dnld.c.

u32 version_id

Definition at line 109 of file ft1000_dnld.c.