Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] DVB Card MAC address
Hello!
How I know writing DVB card MAC address to file?
(The dvb driver writing to stdout, when the load up kernel module)
I found the source code in ttpci-eeprom.c:
> memcpy(i2c->adapter->proposed_mac, decodedMAC, 6);
> dprintk("%s adapter %i has MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
> i2c->adapter->name, i2c->adapter->num,
> decodedMAC[0], decodedMAC[1], decodedMAC[2],
> decodedMAC[3], decodedMAC[4], decodedMAC[5]);
I'm not developer, but i try:
:)
> memcpy(i2c->adapter->proposed_mac, decodedMAC, 6);
> dprintk("%s adapter %i has MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
> i2c->adapter->name, i2c->adapter->num,
> decodedMAC[0], decodedMAC[1], decodedMAC[2],
> decodedMAC[3], decodedMAC[4], decodedMAC[5]);
>
> FILE *fd_in;
>
> fd_in = fopen("/tmp/dvb_mac", "w");
> if (fd_in == NULL) {
> fprintf(stderr, "fopen error!\n");
> return 0;
> }
>
> fprintf(fd_in, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
> decodedMAC[0], decodedMAC[1], decodedMAC[2],
> decodedMAC[3], decodedMAC[4], decodedMAC[5]);
make:
> gcc -I/opt/linuxtv-dvb-1.1.1/build-2.4/include -D__KERNEL__ -I/usr/src/linux-2.4.25/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.25/include/linux/modversions.h -MD -I ../linux/include -I . -DCONFIG_DVB_AV7110_OSD -nostdinc -iwithprefix include -DKBUILD_BASENAME=ttpci_eeprom -DEXPORT_SYMTAB -c ttpci-eeprom.c
> ttpci-eeprom.c:38: stdio.h: No such file or directory
> ttpci-eeprom.c: In function `ttpci_eeprom_parse_mac':
> ttpci-eeprom.c:143: `FILE' undeclared (first use in this function)
> ttpci-eeprom.c:143: (Each undeclared identifier is reported only once
> ttpci-eeprom.c:143: for each function it appears in.)
> ttpci-eeprom.c:143: `fd_in' undeclared (first use in this function)
> ttpci-eeprom.c:143: warning: statement with no effect
> ttpci-eeprom.c:145: warning: implicit declaration of function `fopen'
> ttpci-eeprom.c:147: warning: implicit declaration of function `fprintf'
> ttpci-eeprom.c:147: `stderr' undeclared (first use in this function)
> whereis stdio.h
> stdio: /usr/include/stdio.h
Why not founded stdio header file?
Who i know writing DVB MAC to file?
Best Regards:
Thomas Kápolnási
Home |
Main Index |
Thread Index