C90 compliance (Code before init)
thanks to Andres Freund git-svn-id: https://dedected.org/svn/trunk@13 8d8ab74c-27aa-4a3d-9bde-523a2bc1f624
This commit is contained in:
parent
2fd6dceab9
commit
22f9bf6f6b
|
@ -270,7 +270,7 @@ int coa_ioctl(
|
||||||
printk("Setting Banking-Register to %.2x\n\n", bank);
|
printk("Setting Banking-Register to %.2x\n\n", bank);
|
||||||
for (a = 0; a < 16; a++)
|
for (a = 0; a < 16; a++)
|
||||||
{
|
{
|
||||||
unsigned short *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
for (b = 0; b < 16; b++)
|
for (b = 0; b < 16; b++)
|
||||||
printk("%.2x ",
|
printk("%.2x ",
|
||||||
(unsigned char)
|
(unsigned char)
|
||||||
|
@ -321,7 +321,7 @@ static ssize_t coa_read(
|
||||||
if (!dev->p_dev->dev_node)
|
if (!dev->p_dev->dev_node)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
to_copy = min(kfifo_len(dev->rx_fifo), count_want);
|
to_copy = min((size_t)kfifo_len(dev->rx_fifo), count_want);
|
||||||
data = kmalloc(to_copy, GFP_KERNEL);
|
data = kmalloc(to_copy, GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -574,7 +574,7 @@ static int com_on_air_probe (struct pcmcia_device *link)
|
||||||
|
|
||||||
set_device_configbase(link->conf.ConfigBase);
|
set_device_configbase(link->conf.ConfigBase);
|
||||||
|
|
||||||
dev->sc14421_base = ((unsigned short*)(dev->membase[0]));
|
dev->sc14421_base = ((volatile uint16_t*)(dev->membase[0]));
|
||||||
|
|
||||||
ret = get_card_id();
|
ret = get_card_id();
|
||||||
printk("com_on_air_cs: get_card_id() = %d\n", ret);
|
printk("com_on_air_cs: get_card_id() = %d\n", ret);
|
||||||
|
|
|
@ -38,7 +38,7 @@ void wait_4_IO_cycles()
|
||||||
inb_p(deviceConfigBase);
|
inb_p(deviceConfigBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
void to_dip(uint16_t *dst, unsigned char *src, int length)
|
void to_dip(volatile uint16_t *dst, unsigned char *src, int length)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<length; i++)
|
for (i=0; i<length; i++)
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
void set_device_configbase(u_int);
|
void set_device_configbase(u_int);
|
||||||
void wait_4_IO_cycles(void);
|
void wait_4_IO_cycles(void);
|
||||||
void to_dip(unsigned short *dst, unsigned char *src, int length);
|
void to_dip(volatile unsigned short *dst, unsigned char *src, int length);
|
||||||
void from_dip(unsigned char *dst, volatile uint16_t *src, int length);
|
void from_dip(unsigned char *dst, volatile uint16_t *src, int length);
|
||||||
void SC14421_switch_to_bank(volatile uint16_t *sc14421_base, unsigned char bank);
|
void SC14421_switch_to_bank(volatile uint16_t *sc14421_base, unsigned char bank);
|
||||||
void SC14421_stop_dip(volatile uint16_t *sc14421_base);
|
void SC14421_stop_dip(volatile uint16_t *sc14421_base);
|
||||||
|
|
|
@ -171,7 +171,7 @@ void sniffer_init(struct coa_info *dev)
|
||||||
|
|
||||||
void sniffer_init_sniff_scan(struct coa_info *dev)
|
void sniffer_init_sniff_scan(struct coa_info *dev)
|
||||||
{
|
{
|
||||||
uint16_t *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
|
|
||||||
/* printk("loading sniff_scan firmware\n"); */
|
/* printk("loading sniff_scan firmware\n"); */
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ void sniffer_init_sniff_scan(struct coa_info *dev)
|
||||||
|
|
||||||
void sniffer_init_sniff_sync(struct coa_info *dev)
|
void sniffer_init_sniff_sync(struct coa_info *dev)
|
||||||
{
|
{
|
||||||
uint16_t *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
|
|
||||||
printk("loading sniff_sync firmware\n");
|
printk("loading sniff_sync firmware\n");
|
||||||
|
|
||||||
|
@ -351,6 +351,8 @@ void sniffer_irq_handler(struct coa_info *dev)
|
||||||
void sniffer_sniff_scan_irq(struct coa_info *dev, int irq)
|
void sniffer_sniff_scan_irq(struct coa_info *dev, int irq)
|
||||||
{
|
{
|
||||||
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
|
int ret;
|
||||||
|
uint8_t station[7];
|
||||||
|
|
||||||
if (dev->open)
|
if (dev->open)
|
||||||
{
|
{
|
||||||
|
@ -368,8 +370,6 @@ void sniffer_sniff_scan_irq(struct coa_info *dev, int irq)
|
||||||
|
|
||||||
if (dect_is_RFPI_Packet(fppacket))
|
if (dect_is_RFPI_Packet(fppacket))
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
uint8_t station[7];
|
|
||||||
|
|
||||||
station[0] = dev->sniffer_config->channel;
|
station[0] = dev->sniffer_config->channel;
|
||||||
station[1] = rssi;
|
station[1] = rssi;
|
||||||
|
@ -390,8 +390,12 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
{
|
{
|
||||||
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
struct sniffer_cfg *config = dev->sniffer_config;
|
struct sniffer_cfg *config = dev->sniffer_config;
|
||||||
|
struct sniffed_packet packet;
|
||||||
|
int ret;
|
||||||
|
int slot;
|
||||||
|
int a;
|
||||||
|
int memofs;
|
||||||
|
|
||||||
int r;
|
|
||||||
SC14421_switch_to_bank(sc14421_base, SC14421_RAMBANK1);
|
SC14421_switch_to_bank(sc14421_base, SC14421_RAMBANK1);
|
||||||
|
|
||||||
|
|
||||||
|
@ -439,8 +443,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
{
|
{
|
||||||
if (irq & 0x01)
|
if (irq & 0x01)
|
||||||
{
|
{
|
||||||
int slot;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printk("S:");
|
printk("S:");
|
||||||
|
@ -500,14 +502,12 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
printk("we are in sync :)\n");
|
printk("we are in sync :)\n");
|
||||||
|
|
||||||
|
|
||||||
struct sniffed_packet packet;
|
|
||||||
|
|
||||||
packet.rssi = SC14421_READ(0x00);
|
packet.rssi = SC14421_READ(0x00);
|
||||||
packet.channel = config->channel;
|
packet.channel = config->channel;
|
||||||
packet.slot = slot;
|
packet.slot = slot;
|
||||||
memcpy(packet.data, fppacket, 53);
|
memcpy(packet.data, fppacket, 53);
|
||||||
|
|
||||||
int ret;
|
|
||||||
packet.timestamp =
|
packet.timestamp =
|
||||||
dev->irq_timestamp;
|
dev->irq_timestamp;
|
||||||
ret = kfifo_put(
|
ret = kfifo_put(
|
||||||
|
@ -524,7 +524,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i, a;
|
|
||||||
if ( (irq & 0x09) == 0x09)
|
if ( (irq & 0x09) == 0x09)
|
||||||
printk("interrupt too slow , lost packets!\n");
|
printk("interrupt too slow , lost packets!\n");
|
||||||
|
|
||||||
|
@ -535,8 +534,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
{
|
{
|
||||||
if (config->slottable[a].active)
|
if (config->slottable[a].active)
|
||||||
{
|
{
|
||||||
int memofs;
|
|
||||||
|
|
||||||
SC14421_switch_to_bank(
|
SC14421_switch_to_bank(
|
||||||
sc14421_base,
|
sc14421_base,
|
||||||
sync_banktable[a]);
|
sync_banktable[a]);
|
||||||
|
@ -583,7 +580,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
|
|
||||||
/* if (dev->open) */
|
/* if (dev->open) */
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
packet.timestamp = dev->irq_timestamp;
|
packet.timestamp = dev->irq_timestamp;
|
||||||
ret = kfifo_put(dev->rx_fifo, (unsigned char*) &packet, sizeof(struct sniffed_packet));
|
ret = kfifo_put(dev->rx_fifo, (unsigned char*) &packet, sizeof(struct sniffed_packet));
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
|
@ -640,7 +636,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
{
|
{
|
||||||
if (config->slottable[a].active)
|
if (config->slottable[a].active)
|
||||||
{
|
{
|
||||||
int memofs;
|
|
||||||
|
|
||||||
SC14421_switch_to_bank(sc14421_base, sync_banktable[a]);
|
SC14421_switch_to_bank(sc14421_base, sync_banktable[a]);
|
||||||
|
|
||||||
|
@ -666,7 +661,6 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
|
|
||||||
/* if (dev->open) */
|
/* if (dev->open) */
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
packet.timestamp = dev->irq_timestamp;
|
packet.timestamp = dev->irq_timestamp;
|
||||||
ret = kfifo_put(dev->rx_fifo, (unsigned char*) &packet, sizeof(struct sniffed_packet));
|
ret = kfifo_put(dev->rx_fifo, (unsigned char*) &packet, sizeof(struct sniffed_packet));
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
|
@ -735,9 +729,12 @@ void sniffer_sniff_sync_irq(struct coa_info *dev, int irq)
|
||||||
|
|
||||||
void sniffer_sync_patchloop(struct coa_info *dev, struct dect_slot_info *slottable, int type)
|
void sniffer_sync_patchloop(struct coa_info *dev, struct dect_slot_info *slottable, int type)
|
||||||
{
|
{
|
||||||
|
static int fixme_count = 23;
|
||||||
|
|
||||||
int slot, offset = 0;
|
int slot, offset = 0;
|
||||||
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
volatile uint16_t *sc14421_base = dev->sc14421_base;
|
||||||
struct sniffer_cfg *config = dev->sniffer_config;
|
struct sniffer_cfg *config = dev->sniffer_config;
|
||||||
|
int memofs;
|
||||||
|
|
||||||
|
|
||||||
if (type == SNIFF_SLOTPATCH_PP)
|
if (type == SNIFF_SLOTPATCH_PP)
|
||||||
|
@ -751,7 +748,6 @@ void sniffer_sync_patchloop(struct coa_info *dev, struct dect_slot_info *slottab
|
||||||
|
|
||||||
if (slottable[slot].active && (slot%2))
|
if (slottable[slot].active && (slot%2))
|
||||||
{
|
{
|
||||||
static int fixme_count = 23;
|
|
||||||
if (fixme_count)
|
if (fixme_count)
|
||||||
{
|
{
|
||||||
fixme_count--;
|
fixme_count--;
|
||||||
|
@ -763,7 +759,6 @@ void sniffer_sync_patchloop(struct coa_info *dev, struct dect_slot_info *slottab
|
||||||
|
|
||||||
if (slottable[slot].active)
|
if (slottable[slot].active)
|
||||||
{
|
{
|
||||||
int memofs;
|
|
||||||
|
|
||||||
/* set channel */
|
/* set channel */
|
||||||
switch(dev->radio_type)
|
switch(dev->radio_type)
|
||||||
|
|
Loading…
Reference in New Issue