/* -*- linux-c -*- * Copyright (c) 2004-2006 Winbond Electronics Corp. All rights reserved. * * The contents of this file are subject to the Open * Software License version 1.1 that can be found at * http://www.opensource.org/licenses/osl-1.1.txt and is included herein * by reference. * * Alternatively, the contents of this file may be used under the terms * of the GNU General Public License version 2 (the "GPL") as distributed * in the kernel source COPYING file, in which case the provisions of * the GPL are applicable instead of the above. If you wish to allow * the use of your version of this file only under the terms of the * GPL and not to allow others to use your version of this file under * the OSL, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the GPL. * If you do not delete the provisions above, a recipient may use your * version of this file under either the OSL or the GPL. * Maintained by: Weiming Shuai Jin Yuan Mu Dezheng Shen $Author: dzshen $ $Id: wbmsreader.h,v 1.5.2.4 2006/06/15 01:51:06 dzshen Exp $ --- don't modify lines above --- Description: Enviornments: (1) RedHat 9 on 32-bit Intel UP/32-bit Intel dual-core (2) Fedora Core 4 (2.6.11) on 32-bit Intel/32-bit Intel dual-core/64-bit AMD/64-bit Intel dual-core (3) RedHat Enterprise Workstatin Rel 4 UP2 (2.6.9) on 32-bit Intel 32-bit Intel dual-core/64-bit AMD/64-bit Intel dual-core */ #ifndef _WB_MS_READER_H_ #define _WB_MS_READER_H_ #define WREADER_PIO 0 #define WREADER_DMA 1 static void *wbreader_detect(void); static int wbreader_release(void); //send TPC Command and wait untill INT, but needn't justify cmd result //Result: // If CMD send (not exec) successful and MS working at Parallel Mode, // bit3 to bit0 should be |CED|ERR|BREQ|CMDNK|, or it should be 0. // If CMD send error, such as TIMEOUT,the result should below zero. static int wbreader_issue_cmd(unsigned char cmd, unsigned char *param, int length); // Read TPC Command result (from FIFO or orther register) //static int wbreader_get_cmd_response(unsigned char *buff, int length); static int wbreader_prepare_transfer(unsigned char *buff, unsigned int length, unsigned char read_wrt_flag); static int wbreader_transfer_data(unsigned char *buff, unsigned int length, unsigned char read_wrt_flag, int dma_mode); #define WSTATE_FIFO_SIZE 1 #define WSTATE_PRESENT (1<<1) #define WSTATE_CHANGED (1<<2) #define WSTATE_TRANSFER_CAPABILITY (1 << 3) #define WSTATE_CARD_TYPE (1<<4) static int wbreader_get_state(int which_state); static int wbreader_set_state(int which_state, int state); //whichconfig defined here #define WCONFIG_INTERFACE 0x01 #define WCONFIG_CLOCK 0x02 #define WCONFIG_PREPARE_INIT_CARD 0x04 #define WIF_SERIAL 0 #define WIF_PARALLEL 1 static int wbreader_set_config(unsigned char which_config, unsigned int config); #endif /* _WB_MS_READER_H_ */