Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 266 → Rev 267

/shark/trunk/drivers/bttv/include/drivers/fg.h
3,6 → 3,7
 
#define FG_MONO 0
#define FG_RGB24 1
#define FG_YUYV 2
 
int FG_init(unsigned int period, unsigned int wcet, unsigned int width,
unsigned int height, unsigned int color, unsigned int channel);
/shark/trunk/drivers/bttv/bttv-cards.c
80,6 → 80,7
{ 0x45000070, BTTV_HAUPPAUGE878, "Hauppauge WinTV/PVR" },
{ 0xff000070, BTTV_OSPREY1x0, "Osprey-100" },
{ 0xff010070, BTTV_OSPREY2x0_SVID,"Osprey-200" },
{ 0x036e109e, BTTV_OSPREY2x0_SVID,"Osprey-210" },
{ 0xff020070, BTTV_OSPREY5x0, "Osprey-500" },
{ 0xff030070, BTTV_OSPREY2000, "Osprey-2000" },
 
775,7 → 776,7
},{
 
/* ---- card 0x34 ---------------------------------- */
/* David Härdeman <david@2gen.com> */
/* David H€rdeman <david@2gen.com> */
name: "Pinnacle PCTV Studio Pro",
video_inputs: 3,
audio_inputs: 1,
803,7 → 804,7
tuner_type: TUNER_PHILIPS_PAL_I,
has_radio: 1,
},{
/* Tim Röstermundt <rosterm@uni-muenster.de>
/* Tim R€stermundt <rosterm@uni-muenster.de>
in de.comp.os.unix.linux.hardware:
options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1305,6 → 1306,7
pci_read_config_word(btv->dev, 0, &tmp);
btv->cardid |= tmp;
 
printk(KERN_INFO,"cardid=%08x",btv->cardid);
if (0 != btv->cardid && 0xffffffff != btv->cardid) {
/* look for the card */
for (type = -1, i = 0; cards[i].id != 0; i++)
1873,7 → 1875,7
 
/*
* reset/enable the MSP on some Hauppauge cards
* Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
* Thanks to Ky€sti M€lkki (kmalkki@cc.hut.fi)!
*
* Hauppauge: pin 5
* Voodoo: pin 20
/shark/trunk/drivers/bttv/fg.c
39,13 → 39,15
if (vmm.frame == 0) {
vmm.frame = 1;
fbuf_pointer = btv.fbuffer;
*(BYTE *)fbuf_pointer = 255;
*(BYTE *)(fbuf_pointer+1) = 0;
/* *(BYTE *)fbuf_pointer = 255;
* *(BYTE *)(fbuf_pointer+1) = 0;
*/
} else {
vmm.frame = 0;
fbuf_pointer = btv.fbuffer+gbufsize;
*(BYTE *)fbuf_pointer = 0;
*(BYTE *)(fbuf_pointer+1) = 255;
/* *(BYTE *)fbuf_pointer = 0;
* *(BYTE *)(fbuf_pointer+1) = 255;
*/
}
 
task_testcancel();
77,6 → 79,7
 
refresh_PID = task_create("FG_refresh", FG_refresh, &ht_refresh, NULL);
if (refresh_PID == -1) {
cprintf("could not create task, err no=%d\n",errno);
sys_end();
}
83,16 → 86,26
bttv_start(&btv);
 
err = bttv_ioctl(&btv, VIDIOCGWIN, &vw);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGWIN Error: %d)",err);
sys_end();
}
vw.x = 0;
vw.y = 0;
vw.width = width;
vw.height = height;
err = bttv_ioctl(&btv, VIDIOCSWIN, &vw);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSWIN Error: %d)",err);
sys_end();
}
 
err = bttv_ioctl(&btv, VIDIOCGPICT, &p);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGPICT Error: %d)",err);
sys_end();
}
 
if (color == FG_RGB24) {
p.palette = VIDEO_PALETTE_RGB24;
p.depth = 24;
101,15 → 114,30
p.palette = VIDEO_PALETTE_GREY;
p.depth = 8;
}
if (color == FG_YUYV) {
p.palette = VIDEO_PALETTE_YUYV;
p.depth = 16;
}
 
err = bttv_ioctl(&btv, VIDIOCSPICT, &p);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
 
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSPICT Error: %d)",err);
sys_end();
}
ch.channel = channel;
err = bttv_ioctl(&btv, VIDIOCGCHAN, &ch);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
ch.channel = channel;
ch.norm = 3;
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCGCHAN Error: %d)",err);
sys_end();
}
ch.norm = VIDEO_MODE_PAL;
ch.type = VIDEO_TYPE_CAMERA;
err = bttv_ioctl(&btv, VIDIOCSCHAN, &ch);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCSCHAN Error: %d)",err);
sys_end();
}
vmm.frame = 0;
vmm.height = vw.height;
116,8 → 144,10
vmm.width = vw.width;
vmm.format = p.palette;
err = bttv_ioctl(&btv, VIDIOCMCAPTURE, &vmm);
if (err) kern_printf("(BTTV_IOCTL Error: %d)",err);
 
if (err) {
kern_printf("(BTTV_IOCTL VIDIOCMCAPTURE Error: %d)",err);
sys_end();
}
elaborate_frame_hook = dummy_elaborate_frame;
sleep(1);
137,7 → 167,8
{
 
task_kill(refresh_PID);
sleep(1);
/* sleep(1);
*/
bttv_close(&btv);
}
/shark/trunk/drivers/net/udpip.c
20,11 → 20,11
 
/**
------------
CVS : $Id: udpip.c,v 1.2 2003-09-02 16:12:40 giacomo Exp $
CVS : $Id: udpip.c,v 1.3 2003-10-06 13:57:21 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-09-02 16:12:40 $
Revision: $Revision: 1.3 $
Last update: $Date: 2003-10-06 13:57:21 $
------------
**/
 
83,13 → 83,14
extern struct ip_addr myIpAddr;
struct ip_table ipTable[IP_MAX_ENTRIES];
extern ARP_TABLE arpTable[ARP_MAX_ENTRIES];
IP_ADDR IPbroadcastaddress;
 
int udpIsInstalled = FALSE;
struct netbuff udp_txbuff;
struct netbuff udp_rxbuff;
struct udp_table udpTable[UDP_MAX_HANDLES];
struct eth_addr broadcast;
 
 
IP_ADDR *ip_getAddr()
{
return &myIpAddr;
341,25 → 342,32
sprintf(msg,"serv type : %d\n",iphd->servType);
win_puts(&wip,msg);
#endif
/* Is the destination ethernet address in the ARP table? */
i = 0; done = 0;
while (i < ARP_MAX_ENTRIES && !done)
if (arpTable[i].valid == TRUE) {
if (ip_compAddr(dest,arpTable[i].ip)) {
done = TRUE;
} else i++;
} else i++;
if (done == FALSE) {
/* No: call ARP to get the ethernet address */
arp_send(pkt,dest,len + sizeof(IP_HEADER));
}
else {
/* Yes: directly send the packet */
eth_setHeader(pkt,arpTable[i].eth,ETH_IP_TYPE);
/* Is the destination IP address the broadcast address?*/
if (ip_compAddr(dest,IPbroadcastaddress)) {
/* Send the packet*/
eth_setHeader(pkt,broadcast,ETH_IP_TYPE);
eth_sendPkt(pkt,len + sizeof(IP_HEADER));
netbuff_release(&udp_txbuff, (void *)pkt);
arpTable[i].used++;
if (arpTable[i].used > ARP_MAX_USED) arpTable[i].used = ARP_MAX_USED;
} else {
/* Is the destination ethernet address in the ARP table? */
i = 0; done = 0;
while (i < ARP_MAX_ENTRIES && !done)
if (arpTable[i].valid == TRUE) {
if (ip_compAddr(dest,arpTable[i].ip)) {
done = TRUE;
} else i++;
} else i++;
if (done == FALSE) {
/* No: call ARP to get the ethernet address */
arp_send(pkt,dest,len + sizeof(IP_HEADER));
} else {
/* Yes: directly send the packet */
eth_setHeader(pkt,arpTable[i].eth,ETH_IP_TYPE);
eth_sendPkt(pkt,len + sizeof(IP_HEADER));
netbuff_release(&udp_txbuff, (void *)pkt);
arpTable[i].used++;
if (arpTable[i].used > ARP_MAX_USED) arpTable[i].used = ARP_MAX_USED;
}
}
}
 
387,19 → 395,21
// return(0);
//}
 
/* Initialize the IP layer: it also call the ARP initialization function */
void ip_init(void *localAddr)
/* Initialize the IP layer: it also call the ARP initialization function, pass a struct ip_params* */
void ip_init(void *p)
{
int i;
 
if (!ipIsInstalled) {
arp_init(localAddr);
arp_init(((struct ip_params*)p)->localAddr);
//exc_set(IP_INIT_ERROR,ip_error);
for (i=0; i < IP_MAX_ENTRIES; i++) ipTable[i].rfun = NULL;
 
eth_setProtocol(ETH_IP_TYPE, ip_server_recv);
ip_str2addr(((struct ip_params*)p)->broadcastAddr,&IPbroadcastaddress);
ipIsInstalled = TRUE;
} else cprintf("IP: already installed!!!\n");
eth_str2Addr("FF:FF:FF:FF:FF:FF",&broadcast);
} else cprintf("IP: already installed!!!\n");
}
 
/* Receive an UDP packet from a socket */
460,8 → 470,11
*/
if (bindlist != NULL) {
while (*(int*)bindlist != 0) {
j = arp_req(*bindlist);
arp_sendRequest(j);
/* Ignore broadcast IP address */
if (!ip_compAddr(*bindlist,IPbroadcastaddress)) {
j = arp_req(*bindlist);
arp_sendRequest(j);
}
bindlist ++;
}
}