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

📄 wvlan_hcfio.c

📁 pcmcia source code
💻 C
📖 第 1 页 / 共 2 页
字号:
/* This file is part of the Hardware Control Functions Light (HCF-light) library   to control the Lucent Technologies WaveLAN/IEEE Network I/F Card.   The HCF is the implementation of the Wireless Connection I/F (WCI).      The HCF-light files are a subset of the HCF files. The complete set offers a   number of additional facilities, e.g. firmware download, Etherner-II encapsulation,   additional diagnostic facilities, ASSERT logic to support debugging, 802.11 support,   Configuration Management.   This complete set is explicitely not in the Public Domain but can be made    available under certain restriction. (see the pointer below for support)      The HCF-light files are free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by the   Free Software Foundation; either version 2 of the License, or (at your   option) any later version.   This program is distributed in the hope that it will be useful, but   WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software Foundation,   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.       At the time of this writing, you can request for support at:   betasupport@wavelan.com      Documentation is expected to be available in the week of 8 Februari 1999*//**************************************************************************************************************** FILE	  : hcfio.cpp** DATE    : 2001/03/01 01:03:15   1.3** AUTHOR  : Nico Valster** DESC    : WCI-II HCF I/O Support Routines*           These routines are isolated in their own *.CPP file to facilitate porting**           Customizable via HCFCFG.H which is included by HCF.H***************************************************************************************************************** COPYRIGHT (c) 1994, 1995 by AT&T. 	   						All Rights Reserved.* COPYRIGHT (c) 1996, 1997, 1998 by Lucent Technologies.     	All Rights Reserved.**************************************************************************************************************//****************************************************************************wvlan_hcfio.c,vRevision 1.3  2001/03/01 01:03:15  root*** empty log message ***Revision 1.2  2000/01/06 23:30:53  root*** empty log message *** *  *    Rev 1.0   02 Feb 1999 14:32:30   NVALST * Initial revision.Revision 1.1  1999/01/30 19:34:40  nicoInitial revisionRevision 1.1  1999/01/30 19:24:39  nicoInitial revisionRevision 1.1  1999/01/30 19:07:33  nicoInitial revision *  *    Rev 1.110   29 Jan 1999 15:52:40   NVALST * intermediate, maybe working but seems to need two times to load in  * light-version *  *    Rev 2.12   29 Jan 1999 10:48:46   NVALST *  *    Rev 1.108   28 Jan 1999 14:43:18   NVALST * intermediate, once more correction of loop in hcf_service_nic + download * passed to Marc *  *    Rev 2.11   27 Jan 1999 16:57:42   NVALST *  *    Rev 1.107   27 Jan 1999 13:53:22   NVALST * intermediate, once more correction of loop in hcf_service_nic *  *    Rev 1.106   26 Jan 1999 16:42:44   NVALST * intermediate, corrected loop in hcf_service_nic (which was as result of a  * walkthrough, changed from a bug without consequences into one with consequences *  *    Rev 1.105   25 Jan 1999 14:24:46   NVALST * intermediate, hopefully suitable for release *  *    Rev 1.104   22 Jan 1999 16:59:30   NVALST * intermediate, minor corrections + some HCF-L stuff *  *    Rev 1.103   15 Jan 1999 15:14:40   NVALST * intermediate, deposited as HCF2.10 * ****************************************************************************//****************************************************************************** CHANGE HISTORY*  961121 - NV    Original Entry**************************************************************************************************************//* ToDo * the CNV_LITTLE_TO_INT does have the desired effect on all platforms, but it's naming is * misleading, so revisit all these CNV macros to assure the right name is used at the right * place. Hint: introduce CNV_HOST_TO_NETWORK names if appropriate */#include "wvlan_hcf.h"#include "wvlan_hcfdef.h"#ifdef HCF_ASSERTstatic char BASED HCF__FILE__[] = { "  " __FILE__};	/* 6 spaces to supply room to build an LTV record for 													 * runtime HCF_ASSERTs.  This record is constructed as:													 * - L:		 self explanatory													 * - T:		 CFG_MB_ASSERT													 * - V[0]:	 line_number													 * - V[1..]: (unchanged) file name						*/#endif/*  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *	 *	Refer to HCFCFG.H for more information on the routines ips and ops (short for InPutString  *	and OutPutString) *	 *  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #if defined HCF_STRICTvoid ips( hcf_io prt, wci_bufp dst, int n) {	while ( n-- ) { 		*(hcf_16 FAR*)dst = IN_PORT_WORD( prt );		dst += 2;	}} // ipsvoid ops( hcf_io prt, wci_bufp src, int n) {	while ( n-- ) {		OUT_PORT_WORD( prt, *(hcf_16 FAR*)src );		src  += 2;	}} // ops#endif // HCF_STRICT/***************************************** DOCZ Header ********************************************************.MODULE         hcfio_string.LIBRARY        HCF_SUP.TYPE           function.SYSTEM         msdos.SYSTEM         unix.SYSTEM         NW4.APPLICATION    I/O Support for HCF routines.DESCRIPTION    read/write string with specified length from/to WaveLAN NIC RAM to/from PC RAMint hcfio_string( IFBP ifbp, int bap, int fid, 				  int offset, wci_bufp pc_addr, int word_len, int tot_len, int type ) {.ARGUMENTS  IFBP			ifbp			I/F Block  int			bap				BAP0/1  int			fid				FID/RID  int			offset			offset in FID/RID  wci_bufp		pc_addr			begin address in PC RAM to write to or read from  int			word_len		number of leading words of which the Endianess must be converted  int			tot_len			number of bytes to write or read  int			type            action code								  -	IO_IN			read from NIC RAM								  -	IO_OUT			write to NIC RAM								  -	IO_OUT_CHECK	Data Corruption Detect.RETURNS  int	HCF_SUCCESS     	O.K	HCF_ERR_TIME_OUT    BAP can not be initialized	HCF_ERR_NO_NIC		card is removed	HCF_FAILURE			Data Corruption Detection catched.NARRATIVE  hcfio_string has the following tasks:  -	copy data from NIC RAM to Host RAM or vice versa  - optionally convert the data or part of the data from/to Little Endian format (as used by the NIC)   	to/from the Native Endian format (as used by the Host)  -	check for Data Corruption in the data written to the NIC	  Data is a string with specified length copied from/to a specified offset in a specified Receive Frame   Structure (FID), Transmit Frame Structure (FID) or Record (RID) to/from a Host RAM buffer with a specified  begin address.  A length of 0 can be specified, resulting in no data transfer. This feature accomodates MSFs in certain  Host environments (i.e. ODI) and it is used in the Data Corruption detection.  Which Buffer Acces Path (BAP0 or BAP1) is used, is defined by a parameter.    A non-zero return status indicates:  -	the selected BAP could not properly be initialized  -	the card is removed before completion of the data transfer  - the Data Corruption Detection triggered  - the NIC is considered inoperational due to a time-out of some Hermes activity in the past  In all other cases, a zero is returned.  If a card removal is returned, the MSF has the option to drop the message or recover in any other way it   sees fit.  BAP Initialization failure indicates an H/W error which is very likely to signal complete H/W failure. Once  a BAP Initialization failure has occurred all subsequent interactions with the Hermes will return a time out  status till the Hermes is re-initialized by means of an hcf_disable (at all ports in case of a multi-port  environment)

⌨️ 快捷键说明

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