// Notes:
//
//---------------------------------------------------------------------------
-PDPRAM_BLK ft1000_get_buffer (struct list_head *bufflist)
+struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist)
{
unsigned long flags;
- PDPRAM_BLK ptr;
+ struct dpram_blk *ptr;
spin_lock_irqsave(&free_buff_lock, flags);
// Check if buffer is available
}
else {
numofmsgbuf--;
- ptr = list_entry(bufflist->next, DPRAM_BLK, list);
+ ptr = list_entry(bufflist->next, struct dpram_blk, list);
list_del(&ptr->list);
//DEBUG("ft1000_get_buffer: number of free msg buffers = %d\n", numofmsgbuf);
}
// Notes:
//
//---------------------------------------------------------------------------
-void ft1000_free_buffer (PDPRAM_BLK pdpram_blk, struct list_head *plist)
+void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist)
{
unsigned long flags;
// // create list of free buffers
// for (i=0; i<NUM_OF_FREE_BUFFERS; i++) {
// // Get memory for DPRAM_DATA link list
-// pdpram_blk = kmalloc ( sizeof(DPRAM_BLK), GFP_KERNEL );
+// pdpram_blk = kmalloc ( sizeof(struct dpram_blk), GFP_KERNEL );
// // Get a block of memory to store command data
// pdpram_blk->pbuffer = kmalloc ( MAX_CMD_SQSIZE, GFP_KERNEL );
// // link provisioning data
int result = 0;
pid_t pid;
int i;
- PDPRAM_BLK pdpram_blk;
- DPRAM_BLK *ptr;
+ struct dpram_blk *pdpram_blk;
+ struct dpram_blk *ptr;
DEBUG("ft1000_chdev:ft1000_DestroyDevice called\n");
// Make sure we free any memory reserve for slow Queue
for (i=0; i<MAX_NUM_APP; i++) {
while (list_empty(&info->app_info[i].app_sqlist) == 0) {
- pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, DPRAM_BLK, list);
+ pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, struct dpram_blk, list);
list_del(&pdpram_blk->list);
ft1000_free_buffer(pdpram_blk, &freercvpool);
// Remove buffer allocated for receive command data
if (ft1000_flarion_cnt == 0) {
while (list_empty(&freercvpool) == 0) {
- ptr = list_entry(freercvpool.next, DPRAM_BLK, list);
+ ptr = list_entry(freercvpool.next, struct dpram_blk, list);
list_del(&ptr->list);
kfree(ptr->pbuffer);
kfree(ptr);
break;
case IOCTL_GET_DPRAM_CMD:
{
- PDPRAM_BLK pdpram_blk;
+ struct dpram_blk *pdpram_blk;
IOCTL_DPRAM_BLK __user *pioctl_dpram;
int msglen;
if (list_empty(&info->app_info[i].app_sqlist) == 0) {
//DEBUG("FT1000:ft1000_ChIoctl:Message detected in slow queue\n");
spin_lock_irqsave(&free_buff_lock, flags);
- pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, DPRAM_BLK, list);
+ pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, struct dpram_blk, list);
list_del(&pdpram_blk->list);
info->app_info[i].NumOfMsg--;
//DEBUG("FT1000:ft1000_ChIoctl:NumOfMsg for app %d = %d\n", i, info->app_info[i].NumOfMsg);
PFT1000_INFO info;
struct net_device *dev;
int i;
- PDPRAM_BLK pdpram_blk;
+ struct dpram_blk *pdpram_blk;
DEBUG("ft1000_ChRelease called\n");
while (list_empty(&info->app_info[i].app_sqlist) == 0) {
DEBUG("Remove and free memory queue up on slow queue\n");
- pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, DPRAM_BLK, list);
+ pdpram_blk = list_entry(info->app_info[i].app_sqlist.next, struct dpram_blk, list);
list_del(&pdpram_blk->list);
ft1000_free_buffer(pdpram_blk, &freercvpool);
}
{
struct net_device *netdev;
FT1000_INFO *pInfo = NULL;
- PDPRAM_BLK pdpram_blk;
+ struct dpram_blk *pdpram_blk;
int i, ret_val;
struct list_head *cur, *tmp;
char card_nr[2];
// create list of free buffers
for (i=0; i<NUM_OF_FREE_BUFFERS; i++) {
// Get memory for DPRAM_DATA link list
- pdpram_blk = kmalloc ( sizeof(DPRAM_BLK), GFP_KERNEL );
+ pdpram_blk = kmalloc(sizeof(struct dpram_blk), GFP_KERNEL);
if (pdpram_blk == NULL) {
ret_val = -ENOMEM;
goto err_free;
err_free:
list_for_each_safe(cur, tmp, &freercvpool) {
- pdpram_blk = list_entry(cur, DPRAM_BLK, list);
+ pdpram_blk = list_entry(cur, struct dpram_blk, list);
list_del(&pdpram_blk->list);
kfree(pdpram_blk->pbuffer);
kfree(pdpram_blk);
USHORT modulo;
USHORT portid;
u16 nxtph;
- PDPRAM_BLK pdpram_blk;
+ struct dpram_blk *pdpram_blk;
struct pseudo_hdr *ppseudo_hdr;
unsigned long flags;
} FT1000_INFO, *PFT1000_INFO;
-typedef struct _DPRAM_BLK {
+struct dpram_blk {
struct list_head list;
u16 *pbuffer;
-} __attribute__ ((packed)) DPRAM_BLK, *PDPRAM_BLK;
+} __attribute__ ((packed));
u16 ft1000_read_register(struct ft1000_device *ft1000dev, u16* Data, u16 nRegIndx);
u16 ft1000_write_register(struct ft1000_device *ft1000dev, USHORT value, u16 nRegIndx);
void ft1000_DestroyDevice(struct net_device *dev);
extern void CardSendCommand(struct ft1000_device *ft1000dev, void *ptempbuffer, int size);
-PDPRAM_BLK ft1000_get_buffer (struct list_head *bufflist);
-void ft1000_free_buffer (PDPRAM_BLK pdpram_blk, struct list_head *plist);
+struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist);
+void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist);
char *getfw (char *fn, size_t *pimgsz);