/**************************************************************** * rl2lls.h * * *****************************************************************/ /**************************************************************** * prototypes for standard linux ethernet device * * *****************************************************************/ 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 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); 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 void cleanup_module(void); /**************************************************************** * some experimental stuff * * *****************************************************************/ unsigned_8 EvilAP[6]={0x00,0x20,0xa6,0x30,0x67,0x61 }; /**************************************************************** * definitions for the LLDPoll () timer routine * * *****************************************************************/ static void polltime(unsigned long); #define POLL_FREQ (HZ/4) static struct timer_list poll_timer={NULL,NULL,POLL_FREQ,0,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 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 LLDNodeType; extern unsigned_8 LLDTxMode; extern unsigned_8 LLDNeedReset; extern unsigned_32 LLDOutSyncDrp; extern unsigned_32 LLDOutSyncQDrp; extern unsigned_32 LLDTimedQDrp; extern unsigned_32 LLDFailureDrp; extern unsigned_32 LLDNoReEntrantDrp; extern unsigned_32 LLDSendDisabledDrp; /**************************************************************** * track outstanding sent packets for debugging purposes * * *****************************************************************/ static int outcount; /**************************************************************** * PRIVATE IOCTL's * * *****************************************************************/ /* SIOCDEVPRIVATE reserved to hook more commands */ #define SIOCSIPSUBC SIOCDEVPRIVATE + 1 /* Set subchannel */ #define SIOCGIPSUBC SIOCDEVPRIVATE + 2 /* Get subchannel */ #define SIOCSIPSTNT SIOCDEVPRIVATE + 3 /* Set station type */ #define SIOCGIPSTNT SIOCDEVPRIVATE + 4 /* Get station type */ #define SIOCSIPMNAM SIOCDEVPRIVATE + 5 /* Set master name */ #define SIOCGIPMNAM SIOCDEVPRIVATE + 6 /* Get master name */ #define SIOCSIPSECID SIOCDEVPRIVATE + 7 /* Set security ID */ #define SIOCGIPSECID SIOCDEVPRIVATE + 8 /* Get security ID */ /* more IOCTL's called via SIOCDEVPRIVATE */ enum { RL2RESET, /* perform a reset on the card */ RL2ROAM, /* command the card to roam */ RL2INFO, /* get some info */ RL2NODETABLE, RL2MASTEROPTS, RL2LISTAPS }; /**************************************************************** * Misc stuff * * *****************************************************************/ #define SUCCESS 0 #define FAILURE 0xFF #define SET 1 #define CLEAR 0 #define LLDMAXSEND 7 /**************************************************************** * For ioctl stuff that doesn't use WIRELESS_EXT * * *****************************************************************/ struct rl2_ioctl { unsigned short cmd; unsigned short len; unsigned char *data; }; struct rl2_master_opts{ unsigned char type; unsigned char channel; unsigned char subchannel; unsigned char domain; unsigned char hopperiod; unsigned char bfreq; unsigned char name[12]; unsigned char deferalslot; unsigned char fairnessslot; unsigned char bridge; unsigned char id[3]; unsigned char roamconfig; unsigned char macoptimize; }; static void EndSearch(unsigned long d); static unsigned_8 LLDSearchAndContinue (void); static void rl2_ioctl_nodeinfo(void); static void RL2_Ioctl_Listaps(void); static void rl2_ioctl_setmaster(struct rl2_master_opts *opts); static void rl2_ioctl_printnodes(void); static struct sockaddr thesock; static struct rl2_master_opts myopts; extern struct NodeEntry NodeTable[]; extern unsigned_8 MRUNodeEntry; extern unsigned_8 LLDMSTASyncChannel; extern unsigned_8 LLDMSTASyncSubChannel; extern unsigned_8 LLDMSTASyncName[]; extern unsigned_8 LLDMSTAName[]; extern unsigned_8 LLDSecurityID[]; extern unsigned_8 PacketizePktBuf[]; extern unsigned_8 PacketSeqNum; extern unsigned_8 LLDRoamingFlag; static void EndSearch(unsigned long d); int LLDRoamConfig (int RoamConfig); int LLDMacOptimize (int MacOptimize); /**************************************************************** * 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 /**************************************************************** * default io, irq, and card type * * *****************************************************************/ int io = 0x270; int irq = 11; int CardType = RL2ISA; unsigned_32 win = 0xD000;