/*1*2* mwavedd.h -- declarations for mwave device driver3*4*5* Written By: Mike Sullivan IBM Corporation6*7* Copyright (C) 1999 IBM Corporation8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License as published by11* the Free Software Foundation; either version 2 of the License, or12* (at your option) any later version.13*14* This program is distributed in the hope that it will be useful,15* but WITHOUT ANY WARRANTY; without even the implied warranty of16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17* GNU General Public License for more details.18*19* NO WARRANTY20* THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR21* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT22* LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,23* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is24* solely responsible for determining the appropriateness of using and25* distributing the Program and assumes all risks associated with its26* exercise of rights under this Agreement, including but not limited to27* the risks and costs of program errors, damage to or loss of data,28* programs or equipment, and unavailability or interruption of operations.29*30* DISCLAIMER OF LIABILITY31* NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY32* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL33* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND34* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR35* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE36* USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED37* HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES38*39* You should have received a copy of the GNU General Public License40* along with this program; if not, write to the Free Software41* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA42*43*44* 10/23/2000 - Alpha Release45* First release to the public46*/4748#ifndef _LINUX_MWAVEDD_H49#define _LINUX_MWAVEDD_H50#include "3780i.h"51#include "tp3780i.h"52#include "smapi.h"53#include "mwavepub.h"54#include <linux/ioctl.h>55#include <linux/uaccess.h>56#include <linux/wait.h>5758extern int mwave_debug;59extern int mwave_3780i_irq;60extern int mwave_3780i_io;61extern int mwave_uart_irq;62extern int mwave_uart_io;6364#define PRINTK_ERROR printk65#define KERN_ERR_MWAVE KERN_ERR "mwave: "6667#define TRACE_MWAVE 0x000168#define TRACE_SMAPI 0x000269#define TRACE_3780I 0x000470#define TRACE_TP3780I 0x00087172#ifdef MW_TRACE73#define PRINTK_1(f,s) \74if (f & (mwave_debug)) { \75printk(s); \76}7778#define PRINTK_2(f,s,v1) \79if (f & (mwave_debug)) { \80printk(s,v1); \81}8283#define PRINTK_3(f,s,v1,v2) \84if (f & (mwave_debug)) { \85printk(s,v1,v2); \86}8788#define PRINTK_4(f,s,v1,v2,v3) \89if (f & (mwave_debug)) { \90printk(s,v1,v2,v3); \91}9293#define PRINTK_5(f,s,v1,v2,v3,v4) \94if (f & (mwave_debug)) { \95printk(s,v1,v2,v3,v4); \96}9798#define PRINTK_6(f,s,v1,v2,v3,v4,v5) \99if (f & (mwave_debug)) { \100printk(s,v1,v2,v3,v4,v5); \101}102103#define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6) \104if (f & (mwave_debug)) { \105printk(s,v1,v2,v3,v4,v5,v6); \106}107108#define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7) \109if (f & (mwave_debug)) { \110printk(s,v1,v2,v3,v4,v5,v6,v7); \111}112113#else114#define PRINTK_1(f,s)115#define PRINTK_2(f,s,v1)116#define PRINTK_3(f,s,v1,v2)117#define PRINTK_4(f,s,v1,v2,v3)118#define PRINTK_5(f,s,v1,v2,v3,v4)119#define PRINTK_6(f,s,v1,v2,v3,v4,v5)120#define PRINTK_7(f,s,v1,v2,v3,v4,v5,v6)121#define PRINTK_8(f,s,v1,v2,v3,v4,v5,v6,v7)122#endif123124125typedef struct _MWAVE_IPC {126unsigned short usIntCount; /* 0=none, 1=first, 2=greater than 1st */127bool bIsEnabled;128bool bIsHere;129/* entry spin lock */130wait_queue_head_t ipc_wait_queue;131} MWAVE_IPC;132133typedef struct _MWAVE_DEVICE_DATA {134THINKPAD_BD_DATA rBDData; /* board driver's data area */135unsigned long ulIPCSource_ISR; /* IPC source bits for recently processed intr, set during ISR processing */136unsigned long ulIPCSource_DPC; /* IPC source bits for recently processed intr, set during DPC processing */137bool bBDInitialized;138bool bResourcesClaimed;139bool bDSPEnabled;140bool bDSPReset;141MWAVE_IPC IPCs[16];142bool bMwaveDevRegistered;143short sLine;144int nr_registered_attrs;145int device_registered;146147} MWAVE_DEVICE_DATA, *pMWAVE_DEVICE_DATA;148149extern MWAVE_DEVICE_DATA mwave_s_mdd;150151#endif152153154