changes from kernel.org, removed pci id's, removed
double function.
This commit is contained in:
parent
df75253118
commit
b41cb5d65a
|
@ -75,7 +75,7 @@ DESCRIPTOR DIDD_Table[32];
|
|||
|
||||
void DIVA_DIDD_Read( DESCRIPTOR *table, int tablelength )
|
||||
{
|
||||
bzero(table, tablelength);
|
||||
memset(table, 0, tablelength);
|
||||
|
||||
if (tablelength > sizeof(DIDD_Table))
|
||||
tablelength = sizeof(DIDD_Table);
|
||||
|
@ -106,7 +106,7 @@ void init_idi_tab(void)
|
|||
{
|
||||
DESCRIPTOR d[32];
|
||||
|
||||
bzero(d, sizeof(d));
|
||||
memset(d, 0, sizeof(d));
|
||||
|
||||
d[0].type = IDI_DIMAINT; /* identify the DIMAINT entry */
|
||||
d[0].channels = 0; /* zero channels associated with dimaint*/
|
||||
|
@ -662,7 +662,7 @@ static int idi_register(card_t *card, byte channels)
|
|||
return -1;
|
||||
}
|
||||
|
||||
bzero(card->e_tbl, sizeof(E_INFO) * num_entities);
|
||||
memset(card->e_tbl, 0, sizeof(E_INFO) * num_entities);
|
||||
card->e_max = num_entities;
|
||||
|
||||
DIVA_DIDD_Read(d, sizeof(d));
|
||||
|
@ -849,7 +849,7 @@ int DivasGetList(dia_card_list_t *card_list)
|
|||
{
|
||||
int i;
|
||||
|
||||
bzero(card_list, sizeof(dia_card_list_t));
|
||||
memset(card_list, 0, sizeof(dia_card_list_t));
|
||||
|
||||
for(i = 0; i < DivasCardNext; i++)
|
||||
{
|
||||
|
|
|
@ -1212,24 +1212,16 @@ unregister_card(eicon_card * card)
|
|||
static void
|
||||
eicon_freecard(eicon_card *card) {
|
||||
int i;
|
||||
struct sk_buff *skb;
|
||||
|
||||
for(i = 0; i < (card->nchannels + 1); i++) {
|
||||
while((skb = skb_dequeue(&card->bch[i].e.X)))
|
||||
dev_kfree_skb(skb);
|
||||
while((skb = skb_dequeue(&card->bch[i].e.R)))
|
||||
dev_kfree_skb(skb);
|
||||
skb_queue_purge(&card->bch[i].e.X);
|
||||
skb_queue_purge(&card->bch[i].e.R);
|
||||
}
|
||||
while((skb = skb_dequeue(&card->sndq)))
|
||||
dev_kfree_skb(skb);
|
||||
while((skb = skb_dequeue(&card->rcvq)))
|
||||
dev_kfree_skb(skb);
|
||||
while((skb = skb_dequeue(&card->rackq)))
|
||||
dev_kfree_skb(skb);
|
||||
while((skb = skb_dequeue(&card->sackq)))
|
||||
dev_kfree_skb(skb);
|
||||
while((skb = skb_dequeue(&card->statq)))
|
||||
dev_kfree_skb(skb);
|
||||
skb_queue_purge(&card->sndq);
|
||||
skb_queue_purge(&card->rcvq);
|
||||
skb_queue_purge(&card->rackq);
|
||||
skb_queue_purge(&card->sackq);
|
||||
skb_queue_purge(&card->statq);
|
||||
|
||||
#ifdef CONFIG_ISDN_DRV_EICON_PCI
|
||||
kfree(card->sbufp);
|
||||
|
|
|
@ -510,7 +510,7 @@ void DivasPrintf(char *fmt, ...)
|
|||
|
||||
/* clear log entry */
|
||||
|
||||
bzero((void *) &log, sizeof(klog_t));
|
||||
memset((void *) &log, 0, sizeof(klog_t));
|
||||
|
||||
log.card = -1;
|
||||
log.type = KLOG_TEXT_MSG;
|
||||
|
|
|
@ -46,161 +46,110 @@ void UnlockDivas(void);
|
|||
int do_ioctl(struct inode *pDivasInode, struct file *pDivasFile,
|
||||
unsigned int command, unsigned long arg)
|
||||
{
|
||||
dia_load_t *pDivaLoad;
|
||||
dia_start_t *pDivaStart;
|
||||
dia_config_t *pDivaConfig;
|
||||
dia_log_t *pDivaLog;
|
||||
byte *pUserCards, card_i;
|
||||
word wCardNum;
|
||||
mem_block_t *mem_block;
|
||||
|
||||
switch (command)
|
||||
{
|
||||
case DIA_IOCTL_CONFIG:
|
||||
pDivaConfig = (dia_config_t *) arg;
|
||||
|
||||
if (!verify_area(VERIFY_READ, pDivaConfig, sizeof(dia_config_t)))
|
||||
{
|
||||
DivasCardConfig(pDivaConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete CONFIG ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
{
|
||||
dia_config_t DivaConfig;
|
||||
if (copy_from_user(&DivaConfig, (void *)arg, sizeof(dia_config_t)))
|
||||
return -EFAULT;
|
||||
DivasCardConfig(&DivaConfig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case DIA_IOCTL_DETECT:
|
||||
pUserCards = (byte *) arg;
|
||||
|
||||
if (!verify_area(VERIFY_WRITE, pUserCards, 20))
|
||||
{
|
||||
put_user(DivasCardNext, pUserCards++);
|
||||
if(__put_user(DivasCardNext, pUserCards++))
|
||||
return -EFAULT;
|
||||
|
||||
for (card_i=1; card_i < 20; card_i++)
|
||||
{
|
||||
put_user((byte) DivasCards[card_i - 1].cfg.card_type, pUserCards++);
|
||||
if(__put_user((byte) DivasCards[card_i - 1].cfg.card_type, pUserCards++))
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete DETECT ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
else return -EFAULT;
|
||||
|
||||
return 0;
|
||||
|
||||
case DIA_IOCTL_START:
|
||||
pDivaStart = (dia_start_t *) arg;
|
||||
|
||||
if (!verify_area(VERIFY_READ, pDivaStart, sizeof(dia_start_t)))
|
||||
{
|
||||
return DivasCardStart(pDivaStart->card_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete START ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
dia_start_t DivaStart;
|
||||
if (copy_from_user(&DivaStart, (void *)arg, sizeof(dia_start_t)))
|
||||
return -EFAULT;
|
||||
return DivasCardStart(DivaStart.card_id);
|
||||
}
|
||||
|
||||
case DIA_IOCTL_FLAVOUR:
|
||||
return 0;
|
||||
|
||||
case DIA_IOCTL_LOAD:
|
||||
pDivaLoad = (dia_load_t *) arg;
|
||||
if (!verify_area(VERIFY_READ, pDivaLoad->code,pDivaLoad->length))
|
||||
{
|
||||
dia_load_t DivaLoad;
|
||||
if(copy_from_user(&DivaLoad, (void *)arg, sizeof(dia_load_t)))
|
||||
return -EFAULT;
|
||||
if (!verify_area(VERIFY_READ, DivaLoad.code,DivaLoad.length))
|
||||
{
|
||||
if (DivasCardLoad(pDivaLoad))
|
||||
if (DivasCardLoad(&DivaLoad))
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Error loading DIVA Server adapter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Error in LOAD parameters (verify failed)\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return -EFAULT;
|
||||
}
|
||||
case DIA_IOCTL_LOG:
|
||||
pDivaLog = (dia_log_t *) arg;
|
||||
|
||||
if (!verify_area(VERIFY_READ, pDivaLog, sizeof(dia_log_t)))
|
||||
{
|
||||
DivasLog(pDivaLog);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete LOG ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
{
|
||||
dia_log_t DivaLog;
|
||||
if (copy_from_user(&DivaLog, (void *) arg, sizeof(dia_log_t)))
|
||||
return -EFAULT;
|
||||
DivasLog(&DivaLog);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case DIA_IOCTL_XLOG_REQ:
|
||||
|
||||
if (!verify_area(VERIFY_READ, (void *)arg, sizeof(word)))
|
||||
{
|
||||
wCardNum = * (word *) arg;
|
||||
DivasXlogReq(wCardNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete XLOG_REQ ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
if(get_user(wCardNum, (word *) arg))
|
||||
return -EFAULT;
|
||||
DivasXlogReq(wCardNum);
|
||||
return 0;
|
||||
|
||||
case DIA_IOCTL_GET_NUM:
|
||||
|
||||
if (!verify_area(VERIFY_WRITE, (void *)arg, sizeof(int)))
|
||||
{
|
||||
* (int *) arg = DivasCardNext;
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete GET_NUM ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
if(put_user(DivasCardNext, (int *)arg))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
case DIA_IOCTL_GET_LIST:
|
||||
{
|
||||
dia_card_list_t cards;
|
||||
DPRINTF(("divas: DIA_IOCTL_GET_LIST"));
|
||||
|
||||
if (!verify_area(VERIFY_WRITE, (void *)arg, sizeof(dia_card_list_t)))
|
||||
{
|
||||
DivasGetList((dia_card_list_t *)arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete GET_LIST ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
DivasGetList(&cards);
|
||||
if(copy_to_user((void *)arg, &cards, sizeof(cards)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
}
|
||||
case DIA_IOCTL_GET_MEM:
|
||||
mem_block = (mem_block_t *) arg;
|
||||
|
||||
if (!verify_area(VERIFY_WRITE, mem_block, sizeof(mem_block_t)))
|
||||
{
|
||||
DivasGetMem(mem_block);
|
||||
}
|
||||
else
|
||||
{
|
||||
printk(KERN_WARNING "Divas: Unable to complete GET_MEM ioctl (verify area failed)\n");
|
||||
return -1;
|
||||
}
|
||||
{
|
||||
mem_block_t mem_block;
|
||||
if (copy_from_user(&mem_block, (void *)arg, sizeof(mem_block_t)))
|
||||
return -EFAULT;
|
||||
DivasGetMem(&mem_block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case DIA_IOCTL_UNLOCK:
|
||||
UnlockDivas();
|
||||
return 0;
|
||||
|
||||
default:
|
||||
printk(KERN_WARNING "Divas: Unknown IOCTL Received by DIVA Server Driver(%d)\n", command);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,6 @@ void bcopy(void *pSource, void *pDest, dword dwLength)
|
|||
}
|
||||
#endif
|
||||
|
||||
void bzero(void *pDataArea, dword dwLength)
|
||||
{
|
||||
memset(pDataArea, 0, dwLength);
|
||||
}
|
||||
|
||||
int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg)
|
||||
{
|
||||
/* Use UxPciConfigWrite routines to initialise PCI config space */
|
||||
|
|
|
@ -96,7 +96,7 @@ void DivasLogFifoWrite(char *entry, int length)
|
|||
}
|
||||
|
||||
m_count++;
|
||||
bzero(new_klog,sizeof(KNODE));
|
||||
memset(new_klog, 0, sizeof(KNODE));
|
||||
|
||||
/* Set head & tail to point to the new Msg Struct */
|
||||
head=tail=new_klog;
|
||||
|
@ -112,7 +112,7 @@ void DivasLogFifoWrite(char *entry, int length)
|
|||
}
|
||||
|
||||
m_count++;
|
||||
bzero(new_klog,sizeof(KNODE));
|
||||
memset(new_klog, 0, sizeof(KNODE));
|
||||
|
||||
/* Let last Msg Struct point to new Msg Struct & inc tail */
|
||||
tail->next=new_klog;
|
||||
|
@ -155,7 +155,7 @@ void DivasLogIdi(card_t *card, ENTITY *e, int request)
|
|||
{
|
||||
klog_t klog;
|
||||
|
||||
bzero(&klog, sizeof(klog));
|
||||
memset(&klog, 0, sizeof(klog));
|
||||
|
||||
klog.time_stamp = UxTimeGet();
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ struct ux_diva_card_s
|
|||
};
|
||||
|
||||
void bcopy(void *pSource, void *pDest, dword dwLength);
|
||||
void bzero(void *pDataArea, dword dwLength);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -59,7 +59,7 @@ void xlog_to_klog(byte *b, int size, int card_num)
|
|||
|
||||
x = (card_xlog_t *) b;
|
||||
|
||||
bzero(&klog, sizeof(klog));
|
||||
memset(&klog, 0, sizeof(klog));
|
||||
|
||||
klog.time_stamp = (dword) x->time_hi;
|
||||
klog.time_stamp = (klog.time_stamp << 16) | (dword) x->time_lo;
|
||||
|
|
Loading…
Reference in New Issue