⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wavelan.h

📁 优龙2410linux2.6.8内核源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* *	WaveLAN ISA driver * *		Jean II - HPLB '96 * * Reorganisation and extension of the driver. * Original copyright follows. See wavelan.p.h for details. * * This file contains the declarations for the WaveLAN hardware. Note that * the WaveLAN ISA includes a i82586 controller (see definitions in * file i82586.h). * * The main difference between the ISA hardware and the PCMCIA one is * the Ethernet controller (i82586 instead of i82593). * The i82586 allows multiple transmit buffers.  The PSA needs to be accessed * through the host interface. */#ifndef _WAVELAN_H#define	_WAVELAN_H/************************** MAGIC NUMBERS ***************************//* Detection of the WaveLAN card is done by reading the MAC * address from the card and checking it.  If you have a non-AT&T * product (OEM, like DEC RoamAbout, Digital Ocean, or Epson), * you might need to modify this part to accommodate your hardware. */static const char	MAC_ADDRESSES[][3] ={  { 0x08, 0x00, 0x0E },		/* AT&T WaveLAN (standard) & DEC RoamAbout */  { 0x08, 0x00, 0x6A },		/* AT&T WaveLAN (alternate) */  { 0x00, 0x00, 0xE1 },		/* Hitachi Wavelan */  { 0x00, 0x60, 0x1D }		/* Lucent Wavelan (another one) */  /* Add your card here and send me the patch! */};#define WAVELAN_ADDR_SIZE	6	/* Size of a MAC address */#define WAVELAN_MTU		1500	/* Maximum size of WaveLAN packet */#define	MAXDATAZ		(WAVELAN_ADDR_SIZE + WAVELAN_ADDR_SIZE + 2 + WAVELAN_MTU)/* * Constants used to convert channels to frequencies *//* Frequency available in the 2.0 modem, in units of 250 kHz * (as read in the offset register of the dac area). * Used to map channel numbers used by `wfreqsel' to frequencies */static const short	channel_bands[] = { 0x30, 0x58, 0x64, 0x7A, 0x80, 0xA8,				    0xD0, 0xF0, 0xF8, 0x150 };/* Frequencies of the 1.0 modem (fixed frequencies). * Use to map the PSA `subband' to a frequency * Note : all frequencies apart from the first one need to be multiplied by 10 */static const int	fixed_bands[] = { 915e6, 2.425e8, 2.46e8, 2.484e8, 2.4305e8 };/*************************** PC INTERFACE ****************************//* * Host Adaptor structure. * (base is board port address). */typedef union hacs_u	hacs_u;union hacs_u{	unsigned short	hu_command;		/* Command register */#define		HACR_RESET		0x0001	/* Reset board */#define		HACR_CA			0x0002	/* Set Channel Attention for 82586 */#define		HACR_16BITS		0x0004	/* 16-bit operation (0 => 8bits) */#define		HACR_OUT0		0x0008	/* General purpose output pin 0 */						/* not used - must be 1 */#define		HACR_OUT1		0x0010	/* General purpose output pin 1 */						/* not used - must be 1 */#define		HACR_82586_INT_ENABLE	0x0020	/* Enable 82586 interrupts */#define		HACR_MMC_INT_ENABLE	0x0040	/* Enable MMC interrupts */#define		HACR_INTR_CLR_ENABLE	0x0080	/* Enable interrupt status read/clear */	unsigned short	hu_status;		/* Status Register */#define		HASR_82586_INTR		0x0001	/* Interrupt request from 82586 */#define		HASR_MMC_INTR		0x0002	/* Interrupt request from MMC */#define		HASR_MMC_BUSY		0x0004	/* MMC busy indication */#define		HASR_PSA_BUSY		0x0008	/* LAN parameter storage area busy */};typedef struct ha_t	ha_t;struct ha_t{	hacs_u		ha_cs;		/* Command and status registers */#define 		ha_command	ha_cs.hu_command#define 		ha_status	ha_cs.hu_status	unsigned short	ha_mmcr;	/* Modem Management Ctrl Register */	unsigned short	ha_pior0;	/* Program I/O Address Register Port 0 */	unsigned short	ha_piop0;	/* Program I/O Port 0 */	unsigned short	ha_pior1;	/* Program I/O Address Register Port 1 */	unsigned short	ha_piop1;	/* Program I/O Port 1 */	unsigned short	ha_pior2;	/* Program I/O Address Register Port 2 */	unsigned short	ha_piop2;	/* Program I/O Port 2 */};#define HA_SIZE		16#define	hoff(p,f) 	(unsigned short)((void *)(&((ha_t *)((void *)0 + (p)))->f) - (void *)0)#define	HACR(p)		hoff(p, ha_command)#define	HASR(p)		hoff(p, ha_status)#define	MMCR(p)		hoff(p, ha_mmcr)#define	PIOR0(p)	hoff(p, ha_pior0)#define	PIOP0(p)	hoff(p, ha_piop0)#define	PIOR1(p)	hoff(p, ha_pior1)#define	PIOP1(p)	hoff(p, ha_piop1)#define	PIOR2(p)	hoff(p, ha_pior2)#define	PIOP2(p)	hoff(p, ha_piop2)/* * Program I/O Mode Register values. */#define STATIC_PIO		0	/* Mode 1: static mode */					/* RAM access ??? */#define AUTOINCR_PIO		1	/* Mode 2: auto increment mode */					/* RAM access ??? */#define AUTODECR_PIO		2	/* Mode 3: auto decrement mode */					/* RAM access ??? */#define PARAM_ACCESS_PIO	3	/* Mode 4: LAN parameter access mode */					/* Parameter access. */#define PIO_MASK		3	/* register mask */#define PIOM(cmd,piono)		((u_short)cmd << 10 << (piono * 2))#define	HACR_DEFAULT		(HACR_OUT0 | HACR_OUT1 | HACR_16BITS | PIOM(STATIC_PIO, 0) | PIOM(AUTOINCR_PIO, 1) | PIOM(PARAM_ACCESS_PIO, 2))#define	HACR_INTRON		(HACR_82586_INT_ENABLE | HACR_MMC_INT_ENABLE | HACR_INTR_CLR_ENABLE)/************************** MEMORY LAYOUT **************************//* * Onboard 64 k RAM layout. * (Offsets from 0x0000.) */#define OFFSET_RU		0x0000		/* 75% memory */#define OFFSET_CU		0xC000		/* 25% memory */#define OFFSET_SCB		(OFFSET_ISCP - sizeof(scb_t))#define OFFSET_ISCP		(OFFSET_SCP - sizeof(iscp_t))#define OFFSET_SCP		I82586_SCP_ADDR#define	RXBLOCKZ		(sizeof(fd_t) + sizeof(rbd_t) + MAXDATAZ)#define	TXBLOCKZ		(sizeof(ac_tx_t) + sizeof(ac_nop_t) + sizeof(tbd_t) + MAXDATAZ)#define	NRXBLOCKS		((OFFSET_CU - OFFSET_RU) / RXBLOCKZ)#define	NTXBLOCKS		((OFFSET_SCB - OFFSET_CU) / TXBLOCKZ)/********************** PARAMETER STORAGE AREA **********************//* * Parameter Storage Area (PSA). */typedef struct psa_t	psa_t;struct psa_t{  unsigned char	psa_io_base_addr_1;	/* [0x00] Base address 1 ??? */  unsigned char	psa_io_base_addr_2;	/* [0x01] Base address 2 */  unsigned char	psa_io_base_addr_3;	/* [0x02] Base address 3 */  unsigned char	psa_io_base_addr_4;	/* [0x03] Base address 4 */  unsigned char	psa_rem_boot_addr_1;	/* [0x04] Remote Boot Address 1 */  unsigned char	psa_rem_boot_addr_2;	/* [0x05] Remote Boot Address 2 */  unsigned char	psa_rem_boot_addr_3;	/* [0x06] Remote Boot Address 3 */  unsigned char	psa_holi_params;	/* [0x07] HOst Lan Interface (HOLI) Parameters */  unsigned char	psa_int_req_no;		/* [0x08] Interrupt Request Line */  unsigned char	psa_unused0[7];		/* [0x09-0x0F] unused */  unsigned char	psa_univ_mac_addr[WAVELAN_ADDR_SIZE];	/* [0x10-0x15] Universal (factory) MAC Address */  unsigned char	psa_local_mac_addr[WAVELAN_ADDR_SIZE];	/* [0x16-1B] Local MAC Address */  unsigned char	psa_univ_local_sel;	/* [0x1C] Universal Local Selection */#define		PSA_UNIVERSAL	0		/* Universal (factory) */#define		PSA_LOCAL	1		/* Local */  unsigned char	psa_comp_number;	/* [0x1D] Compatibility Number:	 */#define		PSA_COMP_PC_AT_915	0 	/* PC-AT 915 MHz 	 */#define		PSA_COMP_PC_MC_915	1 	/* PC-MC 915 MHz	 */#define		PSA_COMP_PC_AT_2400	2 	/* PC-AT 2.4 GHz	 */#define		PSA_COMP_PC_MC_2400	3 	/* PC-MC 2.4 GHz 	 */#define		PSA_COMP_PCMCIA_915	4 	/* PCMCIA 915 MHz or 2.0 */  unsigned char	psa_thr_pre_set;	/* [0x1E] Modem Threshold Preset */  unsigned char	psa_feature_select;	/* [0x1F] Call code required (1=on) */#define		PSA_FEATURE_CALL_CODE	0x01 	/* Call code required (Japan) */  unsigned char	psa_subband;		/* [0x20] Subband	  */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -