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