forked from dect/dedected
Compare commits
5 Commits
47525a90a0
...
e8cfb775e7
Author | SHA1 | Date |
---|---|---|
Martin Hauke | e8cfb775e7 | |
Martin Hauke | 75d82e718b | |
Martin Hauke | 338b611564 | |
Martin Hauke | fb6b4944ad | |
Martin Hauke | 16309c0396 |
|
@ -32,7 +32,7 @@ reload:
|
||||||
|
|
||||||
node: $(NODE)
|
node: $(NODE)
|
||||||
$(NODE):
|
$(NODE):
|
||||||
mknod $@ --mode 660 c 3564 0 ### 3564 == 0xDEC
|
mknod $@ --mode 660 c 222 0 ### 222 == 0xDE
|
||||||
# chgrp dect $(NODE)
|
# chgrp dect $(NODE)
|
||||||
|
|
||||||
read: node coa_read
|
read: node coa_read
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
#include <linux/kfifo.h>
|
#include <linux/kfifo.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
#include <pcmcia/cistpl.h>
|
#include <pcmcia/cistpl.h>
|
||||||
#include <pcmcia/ciscode.h>
|
#include <pcmcia/ciscode.h>
|
||||||
|
@ -406,7 +407,11 @@ com_on_air_irq_handler(int irq, void *dev_id)
|
||||||
|
|
||||||
uint8_t dip_irq = 0;
|
uint8_t dip_irq = 0;
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
|
jiffies_to_timespec64(jiffies, &dev->irq_timestamp);
|
||||||
|
#else
|
||||||
jiffies_to_timespec(jiffies, &dev->irq_timestamp);
|
jiffies_to_timespec(jiffies, &dev->irq_timestamp);
|
||||||
|
#endif
|
||||||
dev->irq_count++;
|
dev->irq_count++;
|
||||||
|
|
||||||
switch(dev->operation_mode & COA_MODEMASK)
|
switch(dev->operation_mode & COA_MODEMASK)
|
||||||
|
@ -480,7 +485,7 @@ static int com_on_air_probe (struct pcmcia_device *link)
|
||||||
|
|
||||||
dev->links[0] = link;
|
dev->links[0] = link;
|
||||||
dev->memsize[0] = resource_size(link->resource[2]);
|
dev->memsize[0] = resource_size(link->resource[2]);
|
||||||
dev->membase[0] = ioremap_nocache(link->resource[2]->start, resource_size(link->resource[2]));
|
dev->membase[0] = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
|
||||||
|
|
||||||
if (!dev->membase[0])
|
if (!dev->membase[0])
|
||||||
{
|
{
|
||||||
|
@ -740,7 +745,7 @@ static int __init init_com_on_air_cs(void)
|
||||||
goto init_out_3;
|
goto init_out_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = register_chrdev(0xDEC, COA_DEVICE_NAME, &coa_fops);
|
ret = register_chrdev(0xDE, COA_DEVICE_NAME, &coa_fops);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
printk("couldn't register_chrdev()\n");
|
printk("couldn't register_chrdev()\n");
|
||||||
|
@ -768,7 +773,7 @@ static int __init init_com_on_air_cs(void)
|
||||||
init_out_0:
|
init_out_0:
|
||||||
kfifo_free(&dev->rx_fifo);
|
kfifo_free(&dev->rx_fifo);
|
||||||
init_out_1:
|
init_out_1:
|
||||||
unregister_chrdev(0xDEC, COA_DEVICE_NAME);
|
unregister_chrdev(0xDE, COA_DEVICE_NAME);
|
||||||
init_out_2:
|
init_out_2:
|
||||||
pcmcia_unregister_driver(&coa_driver);
|
pcmcia_unregister_driver(&coa_driver);
|
||||||
init_out_3:
|
init_out_3:
|
||||||
|
@ -782,7 +787,7 @@ static void __exit exit_com_on_air_cs(void)
|
||||||
|
|
||||||
if (!dev) return;
|
if (!dev) return;
|
||||||
|
|
||||||
unregister_chrdev(0xDEC, COA_DEVICE_NAME);
|
unregister_chrdev(0xDE, COA_DEVICE_NAME);
|
||||||
|
|
||||||
pcmcia_unregister_driver(&coa_driver);
|
pcmcia_unregister_driver(&coa_driver);
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
struct coa_info
|
struct coa_info
|
||||||
{
|
{
|
||||||
|
@ -24,7 +25,11 @@ struct coa_info
|
||||||
|
|
||||||
int irq;
|
int irq;
|
||||||
int irq_count;
|
int irq_count;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
|
struct timespec64 irq_timestamp;
|
||||||
|
#else
|
||||||
struct timespec irq_timestamp;
|
struct timespec irq_timestamp;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct pcmcia_device *links[2];
|
struct pcmcia_device *links[2];
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include "dect.h"
|
#include "dect.h"
|
||||||
#include "com_on_air.h"
|
#include "com_on_air.h"
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
struct sniffer_cfg
|
struct sniffer_cfg
|
||||||
{
|
{
|
||||||
int snifftype;
|
int snifftype;
|
||||||
|
@ -57,7 +59,11 @@ struct sniffed_packet
|
||||||
unsigned char channel;
|
unsigned char channel;
|
||||||
unsigned char slot;
|
unsigned char slot;
|
||||||
unsigned char frameflags;
|
unsigned char frameflags;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
||||||
|
struct timespec64 timestamp;
|
||||||
|
#else
|
||||||
struct timespec timestamp;
|
struct timespec timestamp;
|
||||||
|
#endif
|
||||||
unsigned char data[53];
|
unsigned char data[53];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
||||||
write_global_header(pcap);
|
write_global_header(pcap);
|
||||||
|
|
||||||
//sniff-loop
|
//sniff-loop
|
||||||
while (0xDEC + 't')
|
while (0xDE + 't')
|
||||||
{
|
{
|
||||||
struct sniffed_packet buf;
|
struct sniffed_packet buf;
|
||||||
while (sizeof(struct sniffed_packet) == (ret = read(d, &buf, (sizeof(struct sniffed_packet)))))
|
while (sizeof(struct sniffed_packet) == (ret = read(d, &buf, (sizeof(struct sniffed_packet)))))
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ void mainloop(void)
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
while (0xDEC + 'T')
|
while (0xDE + 'T')
|
||||||
{
|
{
|
||||||
tv.tv_sec = 1;
|
tv.tv_sec = 1;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CPPFLAGS=-Wall -O2 -I../..
|
CPPFLAGS=-Wall -O2 -I../..
|
||||||
dectshark: dectshark.o gui.o foundinfo.o scanmode_gui.o syncmode_gui.o packetparser.o packetsaver.o
|
dectshark: dectshark.o gui.o foundinfo.o scanmode_gui.o syncmode_gui.o packetparser.o packetsaver.o
|
||||||
g++ $(CPPFLAGS) dectshark.o gui.o scanmode_gui.o syncmode_gui.o foundinfo.o packetparser.o packetsaver.o -o dectshark -lcurses -lpthread -lpcap
|
g++ $(CPPFLAGS) dectshark.o gui.o scanmode_gui.o syncmode_gui.o foundinfo.o packetparser.o packetsaver.o -o dectshark -lncursesw -lpthread -lpcap
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.o *~ dectshark
|
rm *.o *~ dectshark
|
||||||
|
|
|
@ -259,7 +259,7 @@ void *scanthread(void *threadid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while(0xDEC + 'T') // ;)
|
while(0xDE + 'T') // ;)
|
||||||
{
|
{
|
||||||
dect_found found;
|
dect_found found;
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ void *syncthread(void *threadid)
|
||||||
|
|
||||||
psaver.openfilerfpi(RFPI);
|
psaver.openfilerfpi(RFPI);
|
||||||
|
|
||||||
while (0xDEC + 'T')
|
while (0xDE + 'T')
|
||||||
{
|
{
|
||||||
tv.tv_sec = 1;
|
tv.tv_sec = 1;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
|
@ -171,7 +171,7 @@ void play()
|
||||||
fprintf(stderr, "pcap error: %s\n", errbuf);
|
fprintf(stderr, "pcap error: %s\n", errbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void shutdown()
|
void _shutdown()
|
||||||
{
|
{
|
||||||
pcap_close(fi.p);
|
pcap_close(fi.p);
|
||||||
close(fi.fpp);
|
close(fi.fpp);
|
||||||
|
@ -187,6 +187,6 @@ int main(int argc, char ** argv)
|
||||||
}
|
}
|
||||||
init(argv[1]);
|
init(argv[1]);
|
||||||
play();
|
play();
|
||||||
shutdown();
|
_shutdown();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue