/**************************************************************** * lls.h * * *****************************************************************/ /**************************************************************** * prototypes for standard linux ethernet device * * *****************************************************************/ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,0) #define device net_device #endif static void rl2_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int rl2_xmit(struct sk_buff *skb, struct device *dev); static struct enet_statistics *rl2_get_stats(struct device *dev); #ifdef WIRELESS_EXT static struct iw_statistics *rl2_get_wireless_stats(struct device *dev); #endif /* WIRELESS_EXT */ static int rl2_probe(struct device *dev); static int rl2_ioctl(struct device *dev, struct ifreq *rq, int cmd); static char devicename[9] = { 0, }; static struct device thisRangeLan = { devicename, 0, 0, 0, 0, 0x0, 0, 0, 0, 0, NULL, rl2_probe }; /* structure for dev->priv */ struct net_local { #ifdef WIRELESS_EXT struct iw_statistics wstats; #endif /* WIRELESS_EXT */ struct enet_statistics stats; int attempted_tx_packets; }; /**************************************************************** * Prototypes for linux-related functions * * *****************************************************************/ static int rl2_ioctl(struct device *dev, struct ifreq *rq, int cmd); static void rl2_polltime(unsigned long d); static int rl2_open(struct device *dev); static int rl2_close(struct device *dev); static void rl2_interrupt(int irq, void *dev_id, struct pt_regs *regs); void rl2_sched_interrupt(void); static int rl2_start_xmit(struct sk_buff *skb, struct device *dev); static struct enet_statistics *rl2_get_stats(struct device *dev); static int rl2_probe(struct device *dev); static int rl2_init(); static int init_module(void); static int rl2_PreRL2Probe(void); static void cleanup_module(void); static void rl2_CleanModuleVars(void); struct tq_struct LLSISR_Sched; struct wait_queue *LLSwq = NULL; /**************************************************************** * some experimental stuff * * *****************************************************************/ unsigned_8 EvilAP[6]={0x00,0x20,0xa6,0x30,0x67,0x61 }; /**************************************************************** * definitions for the LLDPoll () timer routine * * *****************************************************************/ static void rl2_polltime(unsigned long); #define POLL_FREQ (HZ/10) #define LIB_HZ 100 static struct timer_list poll_timer={NULL,NULL,POLL_FREQ,0,rl2_polltime}; static int poll_on = 0; /**************************************************************** * variables used in CLLD that we want to see * * *****************************************************************/ extern unsigned_16 LLDIOAddress1; extern unsigned_8 LLDIntLine1; extern unsigned_16 LLDIORange1; extern unsigned_32 LLDMemoryAddress1; extern unsigned_8 LLDOEM; extern unsigned_8 LLDMicroISA; extern unsigned_8 LLDPCMCIA; extern unsigned_8 LLDOnePieceFlag; extern unsigned_8 PCMCIACardInserted; extern unsigned_8 LLDNodeAddress[]; extern unsigned_8 LLDPhysAddress[]; extern unsigned_8 LLDROMVersion[]; extern unsigned_8 LLDChannel; extern unsigned_8 LLDSubChannel; extern unsigned_8 LLDDomain; extern unsigned_8 LLDSyncName[]; extern unsigned_8 LLDTransferMode; extern unsigned_8 LLDSyncState; extern unsigned_8 LLDMSTASyncName[]; extern unsigned_8 LLDMSTAAddr[]; extern unsigned_8 LLDMSTASyncChannel; extern unsigned_8 LLDMSTASyncSubChannel; extern unsigned_8 LLDMSTAFlag; extern unsigned_8 LLDNodeType; extern unsigned_8 HomeRF; extern unsigned_8 LLDTxMode; extern unsigned_8 LLDNeedReset; extern unsigned_8 LLDNeedResetCnt; extern unsigned_8 TxFlag; extern unsigned_8 LLDPeerToPeerFlag; extern unsigned_8 LLDRoamConfiguration; extern unsigned_8 LLDInactivityTimeOut; extern unsigned_8 LLDHopPeriod; extern unsigned_8 LLDBFreq; extern unsigned_8 NodeOverrideFlag; extern unsigned_16 LLDTicksToSniff; extern unsigned_32 LLDOutSyncDrp; extern unsigned_32 LLDOutSyncQDrp; extern unsigned_32 LLDTimedQDrp; extern unsigned_32 LLDFailureDrp; extern unsigned_32 LLDNoReEntrantDrp; extern unsigned_32 LLDSendDisabledDrp; extern unsigned_8 DriverVersionString[]; extern unsigned_8 LLDCCVal1; extern unsigned_8 LLDCCVal2; int LLDRoamConfig (int RoamConfig); int LLDMacOptimize (int MacOptimize); /**************************************************************** * track outstanding sent packets for debugging purposes * * *****************************************************************/ static int outcount; /**************************************************************** * Misc stuff * * *****************************************************************/ #define LLDMAXSEND 7 #define RL2DEBUG(args...) if(rl2_debug==FLAGSET) printk(KERN_INFO args); int rl2_debug = CLEAR; unsigned_8 LLDMacOptimizeVal; /**************************************************************** * For ioctl stuff that doesn't use WIRELESS_EXT * * *****************************************************************/ static void rl2_ioctl_printnodes(void); /**************************************************************** * Misc constants * * *****************************************************************/ #define STATION 0 #define ALTERNATE 1 #define MASTER 2 #define RL2ISA 0 #define RL2MISA 1 #define RL2UISA 2 #define RL2PCCARD 3 #define SYMPNPISA 4 #define SYMPCI 5 #define PROX6333 6 #define PROX6334 7 #define PROX6335 8 #define PROXIM_MAX_DEV 1 #define PROXIM_VENDOR 0x14b7 #define PROXIM_ID 1 #define INTERRUPT_REGISTER 0x4c #define INTERRUPT_STATUS 0x04 #define INTERRUPT_CLEAR 0x400 /**************************************************************** * Message strings * * *****************************************************************/ char *error_codes[]={ "Successful Initialization", "Error resetting the card - wrong io address", "Error registering the irq with the kernel - is it taken?", "Error sending the initialize command - wrong irq", "Error getting the ROM version", "Error getting the global address", "Error setting the local address", "Error setting the inactivity time out", "Error unknown", "Error setting security ID", "Error setting MAC optimize", "Error setting roaming parameters", "Error sending multicast command", "Error in card and socket services", "Error configuring socket - improper card seating", "Error configuring socket - power improperly supplied", "Error configuring socket - no PCMCIA bus ready signal", "Error with the PC Card memory window", "Error detecting a PC Card - wrong memory window", "Error starting Search and Continue", "Error getting f/w status - f/w corrupted", "Error getting card configuration" }; /**************************************************************** * default io, irq, and card type * * *****************************************************************/ int io = 0x270; int irq = 11; int CardType = CARDTYPE; unsigned_16 LLSMemorySize1 = 0x4000; unsigned_16 LLDIOAddress2; unsigned_16 LLDIORange2 = 0x80; #if LINUX_VERSION_CODE >= 0x020100 MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); MODULE_PARM(CardType, "i"); MODULE_PARM(LLDTxMode, "i"); #endif typedef struct LLSTxPktDescriptor { unsigned_8 LLDTxdriverWS[6]; unsigned_16 LLDTxDataLength; /* Length of total TX data */ struct LLDTxFragmentList FAR *LLDTxFragmentListPtr; /* Ptr to list of fragments */ unsigned_16 LLDImmediateDataLength; /* Length of immediate data */ unsigned_8 LLDImmediateData [30]; /* Immediate data for ping header*/ struct LLSTxPktDescriptor *Next; /* Next free descriptor */ struct LLDTxFragmentList LLDFragmentList; /* For allocate memory */ }LLSTxDescriptor; static LLSTxDescriptor LLDProxPkt; static unsigned_8 Buffer[1484]; unsigned_16 LLDSendProximPacket (LLSTxDescriptor *TxProxPktDescript, unsigned_8 TxBuffer [], unsigned_32 Length, unsigned_8 Dest [], unsigned_8 PacketType, unsigned_16 Subtype); void LLDMakeAPList(unsigned_8 domain); void PrintAPList(struct MastersList *list);