Commit da41dfb2 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] remove ifs from ancient backcompat in mwave driver

Also add warning about a broken spinlock/sleep someone still has to fix
parent ca6cc6fa
This diff is collapsed.
...@@ -126,11 +126,7 @@ typedef struct _MWAVE_IPC { ...@@ -126,11 +126,7 @@ typedef struct _MWAVE_IPC {
BOOLEAN bIsEnabled; BOOLEAN bIsEnabled;
BOOLEAN bIsHere; BOOLEAN bIsHere;
/* entry spin lock */ /* entry spin lock */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
wait_queue_head_t ipc_wait_queue; wait_queue_head_t ipc_wait_queue;
#else
struct wait_queue *ipc_wait_queue;
#endif
} MWAVE_IPC; } MWAVE_IPC;
typedef struct _MWAVE_DEVICE_DATA { typedef struct _MWAVE_DEVICE_DATA {
...@@ -143,7 +139,6 @@ typedef struct _MWAVE_DEVICE_DATA { ...@@ -143,7 +139,6 @@ typedef struct _MWAVE_DEVICE_DATA {
BOOLEAN bDSPReset; BOOLEAN bDSPReset;
MWAVE_IPC IPCs[16]; MWAVE_IPC IPCs[16];
BOOLEAN bMwaveDevRegistered; BOOLEAN bMwaveDevRegistered;
BOOLEAN bProcEntryCreated;
short sLine; short sLine;
} MWAVE_DEVICE_DATA, *pMWAVE_DEVICE_DATA; } MWAVE_DEVICE_DATA, *pMWAVE_DEVICE_DATA;
......
...@@ -50,13 +50,8 @@ ...@@ -50,13 +50,8 @@
#ifndef _LINUX_MWAVEPUB_H #ifndef _LINUX_MWAVEPUB_H
#define _LINUX_MWAVEPUB_H #define _LINUX_MWAVEPUB_H
#ifndef MWAVEM_APP_DIST
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#endif
#ifdef MWAVEM_APP_DIST
#define MWAVE_MINOR 219
#endif
typedef struct _MW_ABILITIES { typedef struct _MW_ABILITIES {
unsigned long instr_per_sec; unsigned long instr_per_sec;
......
...@@ -280,10 +280,11 @@ int smapi_set_DSP_cfg(void) ...@@ -280,10 +280,11 @@ int smapi_set_DSP_cfg(void)
if ((usSI & 0xFF) == mwave_uart_irq) { if ((usSI & 0xFF) == mwave_uart_irq) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
#else #else
PRINTK_3(TRACE_SMAPI, PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
#endif #endif
"smapi::smapi_set_DSP_cfg: Serial port A irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI, PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n"); "smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n");
...@@ -300,13 +301,14 @@ int smapi_set_DSP_cfg(void) ...@@ -300,13 +301,14 @@ int smapi_set_DSP_cfg(void)
if ((usSI >> 8) == uartio_index) { if ((usSI >> 8) == uartio_index) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
#else #else
PRINTK_3(TRACE_SMAPI, PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: Serial port A base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
#endif #endif
"smapi::smapi_set_DSP_cfg: Serial port A base I/O address index %x conflicts with uartio_index %x\n", usSI >> 8, uartio_index);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI, PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n"); "smapi::smapi_set_DSP_cfg Disabling conflicting serial port A\n");
bRC = smapi_request (0x1403, 0x0100, 0, usSI, bRC = smapi_request (0x1403, 0x0100, 0, usSI,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI); &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error; if (bRC) goto exit_smapi_request_error;
...@@ -331,13 +333,14 @@ int smapi_set_DSP_cfg(void) ...@@ -331,13 +333,14 @@ int smapi_set_DSP_cfg(void)
if ((usSI & 0xFF) == mwave_uart_irq) { if ((usSI & 0xFF) == mwave_uart_irq) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
#else #else
PRINTK_3(TRACE_SMAPI, PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI & 0xFF, mwave_uart_irq);
#endif #endif
"smapi::smapi_set_DSP_cfg: Serial port B irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI, PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n"); "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
bRC = smapi_request(0x1405, 0x0100, 0, usSI, bRC = smapi_request(0x1405, 0x0100, 0, usSI,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI); &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error; if (bRC) goto exit_smapi_request_error;
...@@ -351,13 +354,14 @@ int smapi_set_DSP_cfg(void) ...@@ -351,13 +354,14 @@ int smapi_set_DSP_cfg(void)
if ((usSI >> 8) == uartio_index) { if ((usSI >> 8) == uartio_index) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
#else #else
PRINTK_3(TRACE_SMAPI, PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: Serial port B base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI >> 8], ausUartBases[uartio_index]);
#endif #endif
"smapi::smapi_set_DSP_cfg: Serial port B base I/O address index %x conflicts with uartio_index %x\n", usSI >> 8, uartio_index);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1 (TRACE_SMAPI, PRINTK_1 (TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting serial port\n"); "smapi::smapi_set_DSP_cfg Disabling conflicting serial port B\n");
bRC = smapi_request (0x1405, 0x0100, 0, usSI, bRC = smapi_request (0x1405, 0x0100, 0, usSI,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI); &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error; if (bRC) goto exit_smapi_request_error;
...@@ -380,39 +384,15 @@ int smapi_set_DSP_cfg(void) ...@@ -380,39 +384,15 @@ int smapi_set_DSP_cfg(void)
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI); &usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error; if (bRC) goto exit_smapi_request_error;
/* bRC == 0 */ /* bRC == 0 */
if ((usCX & 0xff) == mwave_uart_irq) { /* serial port is enabled */ if ((usCX & 0xff) != 0xff) { /* IR port not disabled */
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES if ((usCX & 0xff) == mwave_uart_irq) {
PRINTK_ERROR(KERN_ERR_MWAVE
#else
PRINTK_3(TRACE_SMAPI,
#endif
"smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usSI, mwave_uart_irq);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
bRC = smapi_request(0x1701, 0x0100, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1700, 0, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1704, 0x0000, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
#else
goto exit_conflict;
#endif
} else {
if ((usSI & 0xff) == uartio_index) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
#else #else
PRINTK_3(TRACE_SMAPI, PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: IR port irq %x conflicts with mwave_uart_irq %x\n", usCX & 0xff, mwave_uart_irq);
#endif #endif
"smapi::smapi_set_DSP_cfg: IR port base I/O address index %x conflicts with uartio_index %x\n", usSI & 0xff, uartio_index);
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES #ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI, PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n"); "smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
...@@ -431,6 +411,34 @@ int smapi_set_DSP_cfg(void) ...@@ -431,6 +411,34 @@ int smapi_set_DSP_cfg(void)
#else #else
goto exit_conflict; goto exit_conflict;
#endif #endif
} else {
if ((usSI & 0xff) == uartio_index) {
#ifndef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_ERROR(KERN_ERR_MWAVE
"smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_index]);
#else
PRINTK_3(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg: IR port base I/O address %x conflicts with mwave uart I/O %x\n", ausUartBases[usSI & 0xff], ausUartBases[uartio_index]);
#endif
#ifdef MWAVE_FUTZ_WITH_OTHER_DEVICES
PRINTK_1(TRACE_SMAPI,
"smapi::smapi_set_DSP_cfg Disabling conflicting IR port\n");
bRC = smapi_request(0x1701, 0x0100, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1700, 0, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1705, 0x01ff, 0, usSI,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
bRC = smapi_request(0x1704, 0x0000, 0, 0,
&usAX, &usBX, &usCX, &usDX, &usDI, &usSI);
if (bRC) goto exit_smapi_request_error;
#else
goto exit_conflict;
#endif
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment