Newsgroup: it.comp.os.linux.development
Titolo: Errore sconosciuto

Ciao a tutti, secondo voi cosa vuol dire l'errore:
file.c: riga_errore:  parse error before "struct"
al numero di riga segnalata c'è la dichiarazione di una struttura in questo
modo:
struct SLOT {
    u32 physical_addr_lo;
    u32 physical_addr_hi;
    u32 virtual_addr_lo;
    u32 virtual_addr_hi;
    u32 buffer_length;
    u32 skb;
};
Aiutatemi vi prego, sto ricompilando un driver per la scheda di rete e non
riesco a superare quest'ostacolo! :(
Grazie,
Francesco


L'errore e' *prima* della "struct", quindi bisogna vedere che cosa c'e prima
:-)
Alessandro.

");
MODULE_DESCRIPTION("Driver for 3Com EtherLink 10/100 PCI NIC with 3XP
Processor");
MODULE_PARM(min_pci_latency, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(force, "1-" __MODULE_STRING(8) "i");
static u32 tc990_index = 0;
static u32 force[MAX_UNITS] = { 4, 4, 4, 4, 4, 4, 4, 4};
static u32 min_pci_latency[MAX_UNITS] = {64,64,64,64,64,64,64,64};
#endif
#if (LINUX_VERSION_CODE < 0x02030e)
#define net_device device
#endif
#if (LINUX_VERSION_CODE >= 0x02031b)
#define NEW_NETINIT
#endif
#if (LINUX_VERSION_CODE < 0x02032a)
typedef u32 dma_addr_t;
static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
                     dma_addr_t *dma_handle)
{
    void *virt_ptr;
    virt_ptr = kmalloc(size, GFP_KERNEL);
    *dma_handle = virt_to_bus(virt_ptr);
    return virt_ptr;
}
#define pci_free_consistent(cookie, size, ptr, dma_ptr)    kfree(ptr)
#define pci_map_single(cookie, address, size, dir)    virt_to_bus(address)
#define pci_unmap_single(cookie, address, size, dir)
#endif
#if (LINUX_VERSION_CODE < 0x02032b)
/*
 * SoftNet
 */
#define dev_kfree_skb_irq(a)    dev_kfree_skb(a)
#define netif_wake_queue(dev)    clear_bit(0, &dev->tbusy)
static inline void netif_start_queue(struct net_device *dev)
{
    dev->tbusy = 0;
    dev->interrupt = 0;
    dev->start = 1;
}
static inline void netif_stop_queue(struct net_device *dev)
{
 dev->tbusy = 1;
 dev->start = 0;
}
#define netif_queue_stopped(dev)    dev->tbusy
#define netif_running(dev)        dev->start
#else
#define NET_BH            0
#define tc990_mark_net_bh(foo)    {do{} while(0);}
#define tc990_if_down(dev)    {do{} while(0);}
#endif
#if LINUX_VERSION_CODE < 0x20123
#define test_and_set_bit(val, addr) set_bit(val, addr)
#endif
#if LINUX_VERSION_CODE <= 0x20139
#define    net_device_stats enet_statistics
#else
#define NETSTATS_VER2
#endif
#if LINUX_VERSION_CODE < 0x20155
#include <linux/bios32.h>
#define PCI_SUPPORT_VER1
#else
#define PCI_SUPPORT_VER2
#endif
#if LINUX_VERSION_CODE < 0x20159
#define dev_free_skb(skb) dev_kfree_skb(skb, FREE_WRITE);
#else
#define dev_free_skb(skb) dev_kfree_skb(skb);
#endif
#if ! defined(CAP_NET_ADMIN)
#define capable(CAP_XXX) (suser())
#endif
#define tc990_IMAGE_SIZE 0x10000
#include "3c990img.h"
#define tc990_VENDOR_ID 0x10B7
#define TX_ENTRIES        128
#define RX_ENTRIES        128
#define CMD_ENTRIES        64
#define RESPONSE_ENTRIES   64
/*
 * 3cr990 commands
 */
#define tc990_CMD_TX_ENABLE             0x1
#define tc990_CMD_TX_DISABLE            0x2
#define tc990_CMD_RX_ENABLE             0x3
#define tc990_CMD_RX_DISABLE            0x4
#define tc990_CMD_RX_FILT_WRITE         0x5
#define tc990_CMD_READ_STATS            0x7
#define tc990_CMD_XCVR_SELECT           0x13
#define tc990_CMD_MAX_PKT_SIZE_WRITE    0x1A
#define tc990_CMD_MCAST_HASH_MASK_WRITE 0x25
#define tc990_CMD_STATION_ADR_READ      0x27
/*
 * Descriptor type
 */
#define CMD_DSC_TYPE_CMD_FRAME       0x2
#define CMD_DSC_FRAME_VALID          ( 1 << 7 )
#define CMD_DSC_RESPONSE_NEEDED      ( 1 << 6 )
#define CMD_DSC_RESPONSE_NOT_NEEDED  0
#define RESPONSE_DSC_ERROR_SET       ( 1 << 6 )
#define tc990_STATUS_CMD_FOUND         2
/*
 * 3cr990 registers
 */
#define tc990_SOFT_RESET_REG         0x0
#define tc990_INT_STATUS_REG         0x4
#define tc990_INT_ENABLE_REG         0x8
#define tc990_INT_MASK_REG           0xC
#define tc990_HostTo3XP_COMM_5_REG   0x1C
#define tc990_HostTo3XP_COMM_4_REG   0x20
#define tc990_HostTo3XP_COMM_3_REG   0x24
#define tc990_HostTo3XP_COMM_2_REG   0x28
#define tc990_HostTo3XP_COMM_1_REG   0x2C
#define tc990_HostTo3XP_COMM_0_REG   0x30
#define tc990_3XP2HOST_COMM_0_REG    0x40
#define tc990_MASK_ALL_INT        0xFFFFFFFF
#define tc990_UNMASK_ALL_INT      0x0
#define tc990_ENABLE_ALL_INT      0xFFFFFFEF
#define tc990_RESET_ALL           0x7F
/*
 * 3cr990 commands for handshake with firmware
 */
#define tc990_NULL_CMD                  0x00
#define tc990_BOOTCMD_REG_BOOT_RECORD   0x0FF
#define tc990_BOOTCMD_RUNTIME_IMAGE     0xFD
#define tc990_BOOTCMD_DOWNLOAD_COMPLETE 0xFB
#define tc990_BOOTCMD_SEGMENT_AVAILABLE 0xFC
/*
 * Waiting for boot signature
 */
#define tc990_WAITING_FOR_BOOT          0x7
#define tc990_WAITING_FOR_HOST_REQUEST  0xD
#define tc990_WAITING_FOR_SEGMENT       0x10
#define tc990_3XP_COMM_INT0  0x2
/*
 * Resource allocations
 */
#define TC990_SHARED_MEMORY_ALLOCATED           0x1
#define TC990_SLOT_MEMORY_ALLOCATED             0x2
#define TC990_BASE_ADDR_RESERVED                0x4
#define TC990_IO_MAPPED                         0x8
#define TC990_BASE_MEMORY_RESERVED              0x10
#define TC990_IRQ_RESERVED                      0x20
#define TC990_DEVICE_REGISTERED                 0x40
#define TC990_DEVICE_IN_ROOT_CHAIN              0x80
/*
 * Delay in microseconds to wait for the reset to be over
 */
#define tc990_WAIT_COUNTER        100000
#define ETHERNET_MAXIMUM_FRAME_SIZE 1514
#define tc990_RX_FILT_DIRECTED          0x1
#define tc990_RX_FILT_ALL_MULTICAST     0x2
#define tc990_RX_FILT_BROADCAST         0x4
#define tc990_RX_FILT_PROMISCUOUS       0x8
#define tc990_RX_FILT_HASH_MULTICAST    0x10
#define tc990_MULTICAST_BITS               0x3f
/*
 * Slot information
 */
/****** ERRORE ***************/



E' un driver presente nel kernel standard o sbaglio?
Alessandro.