5 #include "ft1000_ioctl.h"
6 #define FT1000_DRV_VER 0x01010403
9 #define MAX_MSG_LIMIT 200
10 #define NUM_OF_FREE_BUFFERS 1500
14 struct app_info_block {
15 u32 nTxMsg; /* DPRAM msg sent to DSP with app_id */
16 u32 nRxMsg; /* DPRAM msg rcv from dsp with app_id */
17 u32 nTxMsgReject; /* DPRAM msg rejected due to DSP doorbell set */
18 u32 nRxMsgMiss; /* DPRAM msg dropped due to overflow */
19 struct fown_struct *fileobject;/* Application's file object */
20 u16 app_id; /* Application id */
22 int NumOfMsg; /* number of messages queued up */
23 wait_queue_head_t wait_dpram_msg;
24 struct list_head app_sqlist; /* link list of msgs for applicaton on slow queue */
27 #define DEBUG(args...) printk(KERN_INFO args)
32 #define FT1000_STATUS_CLOSING 0x01
34 #define DSPBCMSGID 0x10
36 /* Electrabuzz specific DPRAM mapping */
37 /* this is used by ft1000_usb driver - isn't that a bug? */
38 #undef FT1000_DPRAM_RX_BASE
39 #define FT1000_DPRAM_RX_BASE 0x1800 /* RX AREA (SlowQ) */
41 /* MEMORY MAP FOR MAGNEMITE */
42 /* the indexes are swapped comparing to PCMCIA - is it OK or a bug? */
43 #undef FT1000_MAG_DSP_LED_INDX
44 #define FT1000_MAG_DSP_LED_INDX 0x1 /* dsp led status for PAD device */
45 #undef FT1000_MAG_DSP_CON_STATE_INDX
46 #define FT1000_MAG_DSP_CON_STATE_INDX 0x0 /* DSP Connection Status Info */
48 /* Maximum times trying to get ASIC out of reset */
49 #define MAX_ASIC_RESET_CNT 20
51 #define MAX_BUF_SIZE 4096
53 struct ft1000_debug_dirs {
54 struct list_head list;
61 struct usb_device *dev;
62 struct net_device *net;
69 u8 tx_buf[MAX_BUF_SIZE];
70 u8 rx_buf[MAX_BUF_SIZE];
72 u8 bulk_in_endpointAddr;
73 u8 bulk_out_endpointAddr;
75 struct task_struct *pPollThread;
76 unsigned char fcodeldr;
77 unsigned char bootmode;
78 unsigned char usbboot;
79 unsigned short dspalive;
87 struct ft1000_debug_dirs nodes;
90 struct app_info_block app_info[MAX_NUM_APP];
92 unsigned short tempbuf[32];
97 struct list_head list;
101 int ft1000_read_register(struct ft1000_usb *ft1000dev,
102 u16 *Data, u16 nRegIndx);
103 int ft1000_write_register(struct ft1000_usb *ft1000dev,
104 u16 value, u16 nRegIndx);
105 int ft1000_read_dpram32(struct ft1000_usb *ft1000dev,
106 u16 indx, u8 *buffer, u16 cnt);
107 int ft1000_write_dpram32(struct ft1000_usb *ft1000dev,
108 u16 indx, u8 *buffer, u16 cnt);
109 int ft1000_read_dpram16(struct ft1000_usb *ft1000dev,
110 u16 indx, u8 *buffer, u8 highlow);
111 int ft1000_write_dpram16(struct ft1000_usb *ft1000dev,
112 u16 indx, u16 value, u8 highlow);
113 int fix_ft1000_read_dpram32(struct ft1000_usb *ft1000dev,
114 u16 indx, u8 *buffer);
115 int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev,
116 u16 indx, u8 *buffer);
118 extern void *pFileStart;
119 extern size_t FileLength;
120 extern int numofmsgbuf;
122 int ft1000_close(struct net_device *dev);
123 int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
126 extern struct list_head freercvpool;
128 extern spinlock_t free_buff_lock; /* lock to arbitrate free buffer list for receive command data */
130 int ft1000_create_dev(struct ft1000_usb *dev);
131 void ft1000_destroy_dev(struct net_device *dev);
132 extern void card_send_command(struct ft1000_usb *ft1000dev,
133 void *ptempbuffer, int size);
135 struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist);
136 void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist);
138 int dsp_reload(struct ft1000_usb *ft1000dev);
139 int init_ft1000_netdev(struct ft1000_usb *ft1000dev);
140 struct usb_interface;
141 int reg_ft1000_netdev(struct ft1000_usb *ft1000dev,
142 struct usb_interface *intf);
143 int ft1000_poll(void *dev_id);
145 int ft1000_init_proc(struct net_device *dev);
146 void ft1000_cleanup_proc(struct ft1000_info *info);