📄 wavelan_cs.h
字号:
seq; /* WavePoint beacon sequence number */ unsigned short domain_id, /* WavePoint Domain ID */ nwid; /* WavePoint NWID */} wavepoint_beacon;typedef struct wavepoint_history{ unsigned short nwid; /* WavePoint's NWID */ int average_slow; /* SNR running average */ int average_fast; /* SNR running average */ unsigned char sigqual[WAVEPOINT_HISTORY]; /* Ringbuffer of recent SNR's */ unsigned char qualptr; /* Index into ringbuffer */ unsigned char last_seq; /* Last seq. no seen for WavePoint */ struct wavepoint_history *next; /* Next WavePoint in table */ struct wavepoint_history *prev; /* Previous WavePoint in table */ unsigned long last_seen; /* Time of last beacon recvd, jiffies */} wavepoint_history;struct wavepoint_table{ wavepoint_history *head; /* Start of ringbuffer */ int num_wavepoints; /* No. of WavePoints visible */ unsigned char locked; /* Table lock */};#endif /* WAVELAN_ROAMING *//****************************** TYPES ******************************//* Shortcuts */typedef struct net_device device;typedef struct net_device_stats en_stats;typedef struct iw_statistics iw_stats;typedef struct iw_quality iw_qual;typedef struct iw_freq iw_freq;typedef struct net_local net_local;typedef struct timer_list timer_list;/* Basic types */typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address *//* * Static specific data for the interface. * * For each network interface, Linux keep data in two structure. "device" * keep the generic data (same format for everybody) and "net_local" keep * the additional specific data. * Note that some of this specific data is in fact generic (en_stats, for * example). */struct net_local{ dev_node_t node; /* ???? What is this stuff ???? */ device * dev; /* Reverse link... */ spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ dev_link_t * link; /* pcmcia structure */ en_stats stats; /* Ethernet interface statistics */ int nresets; /* Number of hw resets */ u_char configured; /* If it is configured */ u_char reconfig_82593; /* Need to reconfigure the controller */ u_char promiscuous; /* Promiscuous mode */ u_char allmulticast; /* All Multicast mode */ int mc_count; /* Number of multicast addresses */#ifndef HAVE_NETIF_QUEUE timer_list watchdog; /* To avoid blocking state */#endif /* 2.3.47 */ int stop; /* Current i82593 Stop Hit Register */ int rfp; /* Last DMA machine receive pointer */ int overrunning; /* Receiver overrun flag */#ifdef WIRELESS_EXT iw_stats wstats; /* Wireless specific stats */#endif#ifdef WIRELESS_SPY int spy_number; /* Number of addresses to spy */ mac_addr spy_address[IW_MAX_SPY]; /* The addresses to spy */ iw_qual spy_stat[IW_MAX_SPY]; /* Statistics gathered */#endif /* WIRELESS_SPY */#ifdef HISTOGRAM int his_number; /* Number of intervals */ u_char his_range[16]; /* Boundaries of interval ]n-1; n] */ u_long his_sum[16]; /* Sum in interval */#endif /* HISTOGRAM */#ifdef WAVELAN_ROAMING u_long domain_id; /* Domain ID we lock on for roaming */ int filter_domains; /* Check Domain ID of beacon found */ struct wavepoint_table wavepoint_table; /* Table of visible WavePoints*/ wavepoint_history * curr_point; /* Current wavepoint */ int cell_search; /* Searching for new cell? */ struct timer_list cell_timer; /* Garbage collection */#endif /* WAVELAN_ROAMING */};/**************************** PROTOTYPES ****************************/#ifdef WAVELAN_ROAMING/* ---------------------- ROAMING SUBROUTINES -----------------------*/wavepoint_history *wl_roam_check(unsigned short nwid, net_local *lp);wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char seq, net_local *lp);void wl_del_wavepoint(wavepoint_history *wavepoint, net_local *lp);void wl_cell_expiry(unsigned long data);wavepoint_history *wl_best_sigqual(int fast_search, net_local *lp);void wl_update_history(wavepoint_history *wavepoint, unsigned char sigqual, unsigned char seq);void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp);void wv_nwid_filter(unsigned char mode, net_local *lp);void wv_roam_init(struct net_device *dev);void wv_roam_cleanup(struct net_device *dev);#endif /* WAVELAN_ROAMING *//* ----------------------- MISC SUBROUTINES ------------------------ */static inline void wv_splhi(net_local *, /* Disable interrupts */ unsigned long *); /* flags */static inline void wv_splx(net_local *, /* ReEnable interrupts */ unsigned long *); /* flags */static void cs_error(client_handle_t, /* Report error to cardmgr */ int, int);/* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */static inline u_char /* data */ hasr_read(u_long); /* Read the host interface : base address */static inline void hacr_write(u_long, /* Write to host interface : base address */ u_char), /* data */ hacr_write_slow(u_long, u_char);static void psa_read(device *, /* Read the Parameter Storage Area */ int, /* offset in PSA */ u_char *, /* buffer to fill */ int), /* size to read */ psa_write(device *, /* Write to the PSA */ int, /* Offset in psa */ u_char *, /* Buffer in memory */ int); /* Length of buffer */static inline void mmc_out(u_long, /* Write 1 byte to the Modem Manag Control */ u_short, u_char), mmc_write(u_long, /* Write n bytes to the MMC */ u_char, u_char *, int);static inline u_char /* Read 1 byte from the MMC */ mmc_in(u_long, u_short);static inline void mmc_read(u_long, /* Read n bytes from the MMC */ u_char, u_char *, int), fee_wait(u_long, /* Wait for frequency EEprom : base address */ int, /* Base delay to wait for */ int); /* Number of time to wait */static void fee_read(u_long, /* Read the frequency EEprom : base address */ u_short, /* destination offset */ u_short *, /* data buffer */ int); /* number of registers *//* ---------------------- I82593 SUBROUTINES ----------------------- */static int wv_82593_cmd(device *, /* synchronously send a command to i82593 */ char *, int, int);static inline int wv_diag(device *); /* Diagnostique the i82593 */static int read_ringbuf(device *, /* Read a receive buffer */ int, char *, int);static inline void wv_82593_reconfig(device *); /* Reconfigure the controller *//* ------------------- DEBUG & INFO SUBROUTINES ------------------- */static inline void wv_init_info(device *); /* display startup info *//* ------------------- IOCTL, STATS & RECONFIG ------------------- */static en_stats * wavelan_get_stats(device *); /* Give stats /proc/net/dev *//* ----------------------- PACKET RECEPTION ----------------------- */static inline int wv_start_of_frame(device *, /* Seek beggining of current frame */ int, /* end of frame */ int); /* start of buffer */static inline void wv_packet_read(device *, /* Read a packet from a frame */ int, int), wv_packet_rcv(device *); /* Read all packets waiting *//* --------------------- PACKET TRANSMISSION --------------------- */static inline void wv_packet_write(device *, /* Write a packet to the Tx buffer */ void *, short);static int wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ device *);/* -------------------- HARDWARE CONFIGURATION -------------------- */static inline int wv_mmc_init(device *); /* Initialize the modem */static int wv_ru_stop(device *), /* Stop the i82593 receiver unit */ wv_ru_start(device *); /* Start the i82593 receiver unit */static int wv_82593_config(device *); /* Configure the i82593 */static inline int wv_pcmcia_reset(device *); /* Reset the pcmcia interface */static int wv_hw_config(device *); /* Reset & configure the whole hardware */static inline void wv_hw_reset(device *); /* Same, + start receiver unit */static inline int wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */static void wv_pcmcia_release(u_long), /* Remove a device */ wv_flush_stale_links(void); /* "detach" all possible devices *//* ---------------------- INTERRUPT HANDLING ---------------------- */static void wavelan_interrupt(int, /* Interrupt handler */ void *, struct pt_regs *);static void#ifdef HAVE_NETIF_QUEUE wavelan_watchdog(device *); /* Transmission watchdog */#else wavelan_watchdog(u_long); /* Transmission watchdog */#endif/* ------------------- CONFIGURATION CALLBACKS ------------------- */static int wavelan_open(device *), /* Open the device */ wavelan_close(device *); /* Close the device */static dev_link_t * wavelan_attach(void); /* Create a new device */static void wavelan_detach(dev_link_t *); /* Destroy a removed device */static int wavelan_event(event_t, /* Manage pcmcia events */ int, event_callback_args_t *);/**************************** VARIABLES ****************************/static dev_info_t dev_info = "wavelan_cs";static dev_link_t *dev_list = NULL; /* Linked list of devices *//* * Parameters that can be set with 'insmod' * The exact syntax is 'insmod wavelan_cs.o <var>=<value>' *//* Bit map of interrupts to choose from *//* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4 and 3 */static int irq_mask = 0xdeb8;static int irq_list[4] = { -1 };/* Shared memory speed, in ns */static int mem_speed = 0;/* New module interface */MODULE_PARM(irq_mask, "i");MODULE_PARM(irq_list, "1-4i");MODULE_PARM(mem_speed, "i");#ifdef WAVELAN_ROAMING /* Conditional compile, see above in options *//* Enable roaming mode ? No ! Please keep this to 0 */static int do_roaming = 0;MODULE_PARM(do_roaming, "i");#endif /* WAVELAN_ROAMING */MODULE_LICENSE("GPL");#endif /* WAVELAN_CS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -