version 1.9, 2001/03/15 15:58:16
|
version 1.10, 2001/03/19 23:49:15
|
Line 252 int MargiPush(struct cvdv_cards *card, i
|
Line 252 int MargiPush(struct cvdv_cards *card, i
|
} |
} |
|
|
card->DMAABusy = 1; |
card->DMAABusy = 1; |
/* |
|
while (ring_write_rest(&(card->rbuf)) < count && co < 100){ |
|
printk("buffer waiting to write\n"); |
|
co++; |
|
// interruptible_sleep_on(&card->wqA); |
|
// if (signal_pending(current)) |
|
// return 0; |
|
} |
|
*/ |
|
count = ring_write(&(card->rbuf),data,count); |
count = ring_write(&(card->rbuf),data,count); |
return count; |
return count; |
} |
} |
Line 326 u32 DecoderGetBufferSpace(struct cvdv_ca
|
Line 317 u32 DecoderGetBufferSpace(struct cvdv_ca
|
audio = DecoderGetAudioBufferSpace(card); |
audio = DecoderGetAudioBufferSpace(card); |
video = DecoderGetVideoBufferSpace(card); |
video = DecoderGetVideoBufferSpace(card); |
|
|
//if (audio > 2048) audio -= 2048; |
if (audio > 2048) audio -= 2048; |
//if (video > 16384) video -= 16384; |
if (video > 16384) video -= 16384; |
|
|
if (audio < video) return audio; |
if (audio < video) return audio; |
return video; |
return video; |
Line 382 static int ringDMA (struct cvdv_cards *c
|
Line 373 static int ringDMA (struct cvdv_cards *c
|
u32 count=0; |
u32 count=0; |
u8 data; |
u8 data; |
|
|
|
|
count = ring_read_rest(&(card->rbuf)); |
count = ring_read_rest(&(card->rbuf)); |
if (count < 2048) { |
if (count < 2048) { |
card->DMAABusy = 0; |
|
wake_up_interruptible(&(card->wqA)); |
wake_up_interruptible(&(card->wqA)); |
return 0; |
return 0; |
} |
} |
|
|
stat = read_lsi_status(card); |
stat = read_lsi_status(card); |
|
|
/* |
/* |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- stat: %d readpos: %d writepos: %d \n", |
": -- stat: %d readpos: %d writepos: %d \n", |
stat,card->rbuf.read_pos,card->rbuf.write_pos); |
stat,card->rbuf.read_pos,card->rbuf.write_pos); |
*/ |
*/ |
Line 432 static int ringDMA (struct cvdv_cards *c
|
Line 425 static int ringDMA (struct cvdv_cards *c
|
} |
} |
} else { |
} else { |
count = 0; |
count = 0; |
//card->DMAABusy = 0; |
|
} |
} |
|
|
return count; |
return count; |
Line 442 static int ringDMA (struct cvdv_cards *c
|
Line 434 static int ringDMA (struct cvdv_cards *c
|
u_char read_indexed_register(struct cvdv_cards * card, int addr) |
u_char read_indexed_register(struct cvdv_cards * card, int addr) |
{ |
{ |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
|
u_char data; |
|
#ifdef NOINT |
|
spin_lock(&card->timelock); |
|
#endif |
outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); |
outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); |
return (inb(link->io.BasePort1 + DIO_CONTROL_DATA)); |
data = (inb(link->io.BasePort1 + DIO_CONTROL_DATA)); |
|
#ifdef NOINT |
|
spin_unlock(&card->timelock); |
|
#endif |
|
return data; |
} |
} |
|
|
|
|
void write_indexed_register(struct cvdv_cards *card, int addr, u_char data) |
void write_indexed_register(struct cvdv_cards *card, int addr, u_char data) |
{ |
{ |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
|
#ifdef NOINT |
|
spin_lock(&card->timelock); |
|
#endif |
outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); |
outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); |
outb(data, link->io.BasePort1 + DIO_CONTROL_DATA); |
outb(data, link->io.BasePort1 + DIO_CONTROL_DATA); |
|
|
|
#ifdef NOINT |
|
spin_unlock(&card->timelock); |
|
#endif |
} |
} |
|
|
void WriteByte(struct cvdv_cards *card, int addr, u_char data) |
void WriteByte(struct cvdv_cards *card, int addr, u_char data) |
{ |
{ |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
|
|
|
#ifdef NOINT |
|
spin_lock(&card->timelock); |
|
#endif |
outb((u_char) (addr & 255), |
outb((u_char) (addr & 255), |
link->io.BasePort1 + DIO_LSI_INDEX_LOW); |
link->io.BasePort1 + DIO_LSI_INDEX_LOW); |
outb(((addr & 256) ? 1 : 0), |
outb(((addr & 256) ? 1 : 0), |
link->io.BasePort1 + DIO_LSI_INDEX_HIGH); |
link->io.BasePort1 + DIO_LSI_INDEX_HIGH); |
outb(data, link->io.BasePort1 + DIO_LSI_DATA); |
outb(data, link->io.BasePort1 + DIO_LSI_DATA); |
|
#ifdef NOINT |
|
spin_unlock(&card->timelock); |
|
#endif |
} |
} |
|
|
u_char ReadByte(struct cvdv_cards *card, int addr) |
u_char ReadByte(struct cvdv_cards *card, int addr) |
{ |
{ |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
dev_link_t *link = &(((margi_info_t *) card->margi)->link); |
|
u_char data; |
|
|
|
#ifdef NOINT |
|
spin_lock(&card->timelock); |
|
#endif |
outb((u_char) (addr & 255), |
outb((u_char) (addr & 255), |
link->io.BasePort1 + DIO_LSI_INDEX_LOW); |
link->io.BasePort1 + DIO_LSI_INDEX_LOW); |
outb(((addr & 256) ? 1 : 0), |
outb(((addr & 256) ? 1 : 0), |
link->io.BasePort1 + DIO_LSI_INDEX_HIGH); |
link->io.BasePort1 + DIO_LSI_INDEX_HIGH); |
return inb(link->io.BasePort1 + DIO_LSI_DATA); |
data = inb(link->io.BasePort1 + DIO_LSI_DATA); |
|
#ifdef NOINT |
|
spin_unlock(&card->timelock); |
|
#endif |
|
return data; |
} |
} |
|
|
void MaskByte(struct cvdv_cards *card, int addr, u_char mask, u_char bits) |
void MaskByte(struct cvdv_cards *card, int addr, u_char mask, u_char bits) |
Line 485 void MaskByte(struct cvdv_cards *card, i
|
Line 504 void MaskByte(struct cvdv_cards *card, i
|
|
|
|
|
|
|
#define MAXWRITE 65536 |
#define MAXWRITE 1024 * 100 |
#define MAX_COUNT 30 |
#define MAX_COUNT 20 |
|
|
#ifdef USE_BH |
#ifdef USE_BH |
struct cvdv_cards *bh_card; |
struct cvdv_cards *bh_card; |
Line 556 void L64014Intr_function(struct cvdv_car
|
Line 575 void L64014Intr_function(struct cvdv_car
|
if(card->use_ring){ |
if(card->use_ring){ |
L64021Intr(card); |
L64021Intr(card); |
} |
} |
|
|
count = ring_read_rest(&(card->rbuf)); |
count = ring_read_rest(&(card->rbuf)); |
if (count) card->DMAABusy=1; |
if (count) card->DMAABusy = 1; |
|
|
if (card->DMAABusy){ |
if (card->DMAABusy){ |
|
|
#ifdef USE_BH |
#ifdef USE_BH |
Line 580 void L64014Intr_function(struct cvdv_car
|
Line 601 void L64014Intr_function(struct cvdv_car
|
void Timerfunction(unsigned long data) |
void Timerfunction(unsigned long data) |
{ |
{ |
struct cvdv_cards *card = (struct cvdv_cards *) data; |
struct cvdv_cards *card = (struct cvdv_cards *) data; |
int i; |
|
|
|
//spin_lock(&card->timelock); |
|
i = del_timer(&card->timer); |
|
L64014Intr_function(card); |
L64014Intr_function(card); |
//spin_unlock(&card->timelock); |
|
// printk(KERN_DEBUG LOGNAME ": -- timer: %d \n", i); |
|
|
|
card->timer.function = Timerfunction; |
card->timer.function = Timerfunction; |
card->timer.data=(unsigned long) card; |
card->timer.data=(unsigned long) card; |
card->timer.expires=jiffies+1; |
card->timer.expires=jiffies+1; |
add_timer(&card->timer); |
if ( card->open ) |
|
add_timer(&card->timer); |
|
|
} |
} |
#endif |
#endif |
Line 603 void L64014Intr(int irq, void *dev_id, s
|
Line 621 void L64014Intr(int irq, void *dev_id, s
|
struct cvdv_cards *card = &(margi->card); |
struct cvdv_cards *card = &(margi->card); |
u_char dio_index, lsi_index_low, lsi_index_high; |
u_char dio_index, lsi_index_low, lsi_index_high; |
|
|
|
#ifdef NOINT |
|
spin_lock(&card->timelock); |
|
#endif |
//save registers |
//save registers |
dio_index = inb(margi->link.io.BasePort1 + DIO_CONTROL_INDEX); |
dio_index = inb(margi->link.io.BasePort1 + DIO_CONTROL_INDEX); |
lsi_index_low = inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); |
lsi_index_low = inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); |
lsi_index_high = |
lsi_index_high = inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); |
inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); |
|
|
|
|
|
L64014Intr_function(card); |
L64014Intr_function(card); |
Line 616 void L64014Intr(int irq, void *dev_id, s
|
Line 636 void L64014Intr(int irq, void *dev_id, s
|
outb(dio_index, margi->link.io.BasePort1 + DIO_CONTROL_INDEX); |
outb(dio_index, margi->link.io.BasePort1 + DIO_CONTROL_INDEX); |
outb(lsi_index_low, margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); |
outb(lsi_index_low, margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); |
outb(lsi_index_high,margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); |
outb(lsi_index_high,margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); |
|
#ifdef NOINT |
|
spin_unlock(&card->timelock); |
|
#endif |
} |
} |
|
|
int L64014RemoveIntr(struct cvdv_cards *card) |
int L64014RemoveIntr(struct cvdv_cards *card) |
Line 1175 static void margi_config(dev_link_t * li
|
Line 1198 static void margi_config(dev_link_t * li
|
dev->node.major = major_device_number; |
dev->node.major = major_device_number; |
dev->node.minor = minor; |
dev->node.minor = minor; |
link->dev = &dev->node; |
link->dev = &dev->node; |
v4l_init(card); |
|
#ifdef DVB |
#ifdef DVB |
dvb_register(card); |
dvb_register(card); |
#endif |
#endif |
Line 1277 static void margi_release(u_long arg)
|
Line 1299 static void margi_release(u_long arg)
|
mdelay(100); |
mdelay(100); |
#endif |
#endif |
CloseCard(card); |
CloseCard(card); |
video_unregister_device(&card->video); |
|
#ifdef DVB |
#ifdef DVB |
dvb_unregister(card); |
dvb_unregister(card); |
#endif |
#endif |