diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/capi/capi.c | 34 | ||||
-rw-r--r-- | drivers/isdn/capi/capiutil.c | 8 | ||||
-rw-r--r-- | drivers/isdn/divert/divert_procfs.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/capimain.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/dbgioctl.h | 198 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divamnt.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divasi.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divasmain.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/main_if.h | 50 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/platform.h | 1 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hysdn/boardergo.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_proclog.c | 4 | ||||
-rw-r--r-- | drivers/isdn/isdnloop/isdnloop.c | 2 |
14 files changed, 20 insertions, 285 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index db1260f73f1..81661b8bd3a 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -18,8 +18,8 @@ #include <linux/fcntl.h> #include <linux/fs.h> #include <linux/signal.h> +#include <linux/mutex.h> #include <linux/mm.h> -#include <linux/smp_lock.h> #include <linux/timer.h> #include <linux/wait.h> #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE @@ -147,7 +147,7 @@ struct capidev { struct capincci *nccis; - struct semaphore ncci_list_sem; + struct mutex ncci_list_mtx; }; /* -------- global variables ---------------------------------------- */ @@ -395,7 +395,7 @@ static struct capidev *capidev_alloc(void) if (!cdev) return NULL; - init_MUTEX(&cdev->ncci_list_sem); + mutex_init(&cdev->ncci_list_mtx); skb_queue_head_init(&cdev->recvqueue); init_waitqueue_head(&cdev->recvwait); write_lock_irqsave(&capidev_list_lock, flags); @@ -414,9 +414,9 @@ static void capidev_free(struct capidev *cdev) } skb_queue_purge(&cdev->recvqueue); - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); capincci_free(cdev, 0xffffffff); - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); write_lock_irqsave(&capidev_list_lock, flags); list_del(&cdev->list); @@ -603,15 +603,15 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) if (CAPIMSG_CMD(skb->data) == CAPI_CONNECT_B3_CONF) { u16 info = CAPIMSG_U16(skb->data, 12); // Info field if (info == 0) { - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); capincci_alloc(cdev, CAPIMSG_NCCI(skb->data)); - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); } } if (CAPIMSG_CMD(skb->data) == CAPI_CONNECT_B3_IND) { - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); capincci_alloc(cdev, CAPIMSG_NCCI(skb->data)); - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); } spin_lock_irqsave(&workaround_lock, flags); if (CAPIMSG_COMMAND(skb->data) != CAPI_DATA_B3) { @@ -752,9 +752,9 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos CAPIMSG_SETAPPID(skb->data, cdev->ap.applid); if (CAPIMSG_CMD(skb->data) == CAPI_DISCONNECT_B3_RESP) { - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); capincci_free(cdev, CAPIMSG_NCCI(skb->data)); - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); } cdev->errcode = capi20_put_message(&cdev->ap, skb); @@ -939,9 +939,9 @@ capi_ioctl(struct inode *inode, struct file *file, if (copy_from_user(&ncci, argp, sizeof(ncci))) return -EFAULT; - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); if ((nccip = capincci_find(cdev, (u32) ncci)) == 0) { - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); return 0; } #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE @@ -949,7 +949,7 @@ capi_ioctl(struct inode *inode, struct file *file, count += atomic_read(&mp->ttyopencount); } #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); return count; } return 0; @@ -964,14 +964,14 @@ capi_ioctl(struct inode *inode, struct file *file, if (copy_from_user(&ncci, argp, sizeof(ncci))) return -EFAULT; - down(&cdev->ncci_list_sem); + mutex_lock(&cdev->ncci_list_mtx); nccip = capincci_find(cdev, (u32) ncci); if (!nccip || (mp = nccip->minorp) == 0) { - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); return -ESRCH; } unit = mp->minor; - up(&cdev->ncci_list_sem); + mutex_unlock(&cdev->ncci_list_mtx); return unit; } return 0; diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c index ad1e2702c2d..22379b94e88 100644 --- a/drivers/isdn/capi/capiutil.c +++ b/drivers/isdn/capi/capiutil.c @@ -855,7 +855,7 @@ static _cdebbuf *g_debbuf; static u_long g_debbuf_lock; static _cmsg *g_cmsg; -_cdebbuf *cdebbuf_alloc(void) +static _cdebbuf *cdebbuf_alloc(void) { _cdebbuf *cdb; @@ -989,11 +989,6 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg) return &g_debbuf; } -_cdebbuf *cdebbuf_alloc(void) -{ - return &g_debbuf; -} - void cdebbuf_free(_cdebbuf *cdb) { } @@ -1009,7 +1004,6 @@ void __exit cdebug_exit(void) #endif -EXPORT_SYMBOL(cdebbuf_alloc); EXPORT_SYMBOL(cdebbuf_free); EXPORT_SYMBOL(capi_cmsg2message); EXPORT_SYMBOL(capi_message2cmsg); diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 53a18900335..be77ee625bb 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -11,7 +11,6 @@ #include <linux/module.h> #include <linux/poll.h> -#include <linux/smp_lock.h> #ifdef CONFIG_PROC_FS #include <linux/proc_fs.h> #else diff --git a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c index 7a74ed35b1b..98fcdfc7ca5 100644 --- a/drivers/isdn/hardware/eicon/capimain.c +++ b/drivers/isdn/hardware/eicon/capimain.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/init.h> #include <asm/uaccess.h> -#include <linux/smp_lock.h> #include <linux/skbuff.h> #include "os_capi.h" diff --git a/drivers/isdn/hardware/eicon/dbgioctl.h b/drivers/isdn/hardware/eicon/dbgioctl.h deleted file mode 100644 index 0fb6f5e88b6..00000000000 --- a/drivers/isdn/hardware/eicon/dbgioctl.h +++ /dev/null @@ -1,198 +0,0 @@ - -/* - * - Copyright (c) Eicon Technology Corporation, 2000. - * - This source file is supplied for the use with Eicon - Technology Corporation's range of DIVA Server Adapters. - * - This program is 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, or (at your option) - any later version. - * - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY - 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -/*------------------------------------------------------------------*/ -/* file: dbgioctl.h */ -/*------------------------------------------------------------------*/ - -#if !defined(__DBGIOCTL_H__) - -#define __DBGIOCTL_H__ - -#ifdef NOT_YET_NEEDED -/* - * The requested operation is passed in arg0 of DbgIoctlArgs, - * additional arguments (if any) in arg1, arg2 and arg3. - */ - -typedef struct -{ ULONG arg0 ; - ULONG arg1 ; - ULONG arg2 ; - ULONG arg3 ; -} DbgIoctlArgs ; - -#define DBG_COPY_LOGS 0 /* copy debugs to user until buffer full */ - /* arg1: size threshold */ - /* arg2: timeout in milliseconds */ - -#define DBG_FLUSH_LOGS 1 /* flush pending debugs to user buffer */ - /* arg1: internal driver id */ - -#define DBG_LIST_DRVS 2 /* return the list of registered drivers */ - -#define DBG_GET_MASK 3 /* get current debug mask of driver */ - /* arg1: internal driver id */ - -#define DBG_SET_MASK 4 /* set/change debug mask of driver */ - /* arg1: internal driver id */ - /* arg2: new debug mask */ - -#define DBG_GET_BUFSIZE 5 /* get current buffer size of driver */ - /* arg1: internal driver id */ - /* arg2: new debug mask */ - -#define DBG_SET_BUFSIZE 6 /* set new buffer size of driver */ - /* arg1: new buffer size */ - -/* - * common internal debug message structure - */ - -typedef struct -{ unsigned short id ; /* virtual driver id */ - unsigned short type ; /* special message type */ - unsigned long seq ; /* sequence number of message */ - unsigned long size ; /* size of message in bytes */ - unsigned long next ; /* offset to next buffered message */ - LARGE_INTEGER NTtime ; /* 100 ns since 1.1.1601 */ - unsigned char data[4] ;/* message data */ -} OldDbgMessage ; - -typedef struct -{ LARGE_INTEGER NTtime ; /* 100 ns since 1.1.1601 */ - unsigned short size ; /* size of message in bytes */ - unsigned short ffff ; /* always 0xffff to indicate new msg */ - unsigned short id ; /* virtual driver id */ - unsigned short type ; /* special message type */ - unsigned long seq ; /* sequence number of message */ - unsigned char data[4] ;/* message data */ -} DbgMessage ; - -#endif - -#define DRV_ID_UNKNOWN 0x0C /* for messages via prtComp() */ - -#define MSG_PROC_FLAG 0x80 -#define MSG_PROC_NO_GET(x) (((x) & MSG_PROC_FLAG) ? (((x) >> 4) & 7) : -1) -#define MSG_PROC_NO_SET(x) (MSG_PROC_FLAG | (((x) & 7) << 4)) - -#define MSG_TYPE_DRV_ID 0x0001 -#define MSG_TYPE_FLAGS 0x0002 -#define MSG_TYPE_STRING 0x0003 -#define MSG_TYPE_BINARY 0x0004 - -#define MSG_HEAD_SIZE ((unsigned long)&(((DbgMessage *)0)->data[0])) -#define MSG_ALIGN(len) (((unsigned long)(len) + MSG_HEAD_SIZE + 3) & ~3) -#define MSG_SIZE(pMsg) MSG_ALIGN((pMsg)->size) -#define MSG_NEXT(pMsg) ((DbgMessage *)( ((char *)(pMsg)) + MSG_SIZE(pMsg) )) - -#define OLD_MSG_HEAD_SIZE ((unsigned long)&(((OldDbgMessage *)0)->data[0])) -#define OLD_MSG_ALIGN(len) (((unsigned long)(len)+OLD_MSG_HEAD_SIZE+3) & ~3) - -/* - * manifest constants - */ - -#define MSG_FRAME_MAX_SIZE 2150 /* maximum size of B1 frame */ -#define MSG_TEXT_MAX_SIZE 1024 /* maximum size of msg text */ -#define MSG_MAX_SIZE MSG_ALIGN(MSG_FRAME_MAX_SIZE) -#define DBG_MIN_BUFFER_SIZE 0x00008000 /* minimal total buffer size 32 KB */ -#define DBG_DEF_BUFFER_SIZE 0x00020000 /* default total buffer size 128 KB */ -#define DBG_MAX_BUFFER_SIZE 0x00400000 /* maximal total buffer size 4 MB */ - -#define DBGDRV_NAME "Diehl_DIMAINT" -#define UNIDBG_DRIVER L"\\Device\\Diehl_DIMAINT" /* UNICODE name for kernel */ -#define DEBUG_DRIVER "\\\\.\\" DBGDRV_NAME /* traditional string for apps */ -#define DBGVXD_NAME "DIMAINT" -#define DEBUG_VXD "\\\\.\\" DBGVXD_NAME /* traditional string for apps */ - -/* - * Special IDI interface debug construction - */ - -#define DBG_IDI_SIG_REQ (unsigned long)0xF479C402 -#define DBG_IDI_SIG_IND (unsigned long)0xF479C403 -#define DBG_IDI_NL_REQ (unsigned long)0xF479C404 -#define DBG_IDI_NL_IND (unsigned long)0xF479C405 - -typedef struct -{ unsigned long magic_type ; - unsigned short data_len ; - unsigned char layer_ID ; - unsigned char entity_ID ; - unsigned char request ; - unsigned char ret_code ; - unsigned char indication ; - unsigned char complete ; - unsigned char data[4] ; -} DbgIdiAct, *DbgIdiAction ; - -/* - * We want to use the same IOCTL codes in Win95 and WinNT. - * The official constructor for IOCTL codes is the CTL_CODE macro - * from <winoctl.h> (<devioctl.h> in WinNT DDK environment). - * The problem here is that we don't know how to get <winioctl.h> - * working in a Win95 DDK environment! - */ - -# ifdef CTL_CODE /*{*/ - -/* Assert that we have the same idea of the CTL_CODE macro. */ - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -# else /* !CTL_CODE */ /*}{*/ - -/* Use the definitions stolen from <winioctl.h>. */ - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -#define FILE_ANY_ACCESS 0 -#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe -#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe - -# endif /* CTL_CODE */ /*}*/ - -/* - * Now we can define WinNT/Win95 DeviceIoControl codes. - * - * These codes are defined in di_defs.h too, a possible mismatch will be - * detected when the dbgtool is compiled. - */ - -#define IOCTL_DRIVER_LNK \ - CTL_CODE(0x8001U,0x701,METHOD_OUT_DIRECT,FILE_ANY_ACCESS) -#define IOCTL_DRIVER_DBG \ - CTL_CODE(0x8001U,0x702,METHOD_OUT_DIRECT,FILE_ANY_ACCESS) - -#endif /* __DBGIOCTL_H__ */ diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c index 4aba5c502d8..c9092897424 100644 --- a/drivers/isdn/hardware/eicon/divamnt.c +++ b/drivers/isdn/hardware/eicon/divamnt.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/smp_lock.h> #include <linux/poll.h> #include <asm/uaccess.h> diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c index 556b19615bc..78f141e7746 100644 --- a/drivers/isdn/hardware/eicon/divasi.c +++ b/drivers/isdn/hardware/eicon/divasi.c @@ -14,7 +14,6 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/sched.h> -#include <linux/smp_lock.h> #include <linux/poll.h> #include <linux/proc_fs.h> #include <linux/skbuff.h> diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index 5e862e24411..6d39f936076 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c @@ -17,7 +17,6 @@ #include <linux/ioport.h> #include <linux/workqueue.h> #include <linux/pci.h> -#include <linux/smp_lock.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/poll.h> diff --git a/drivers/isdn/hardware/eicon/main_if.h b/drivers/isdn/hardware/eicon/main_if.h deleted file mode 100644 index 0ea339afd42..00000000000 --- a/drivers/isdn/hardware/eicon/main_if.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - Copyright (c) Eicon Technology Corporation, 2000. - * - This source file is supplied for the use with Eicon - Technology Corporation's range of DIVA Server Adapters. - * - This program is 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, or (at your option) - any later version. - * - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY - 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -/*------------------------------------------------------------------*/ -/* file: main_if.h */ -/*------------------------------------------------------------------*/ -# ifndef MAIN_IF___H -# define MAIN_IF___H - -# include "debug_if.h" - -void DI_lock (void) ; -void DI_unlock (void) ; - -#ifdef NOT_YET_NEEDED -void DI_nttime (LARGE_INTEGER *NTtime) ; -void DI_ntlcltime(LARGE_INTEGER *NTtime, LARGE_INTEGER *lclNTtime) ; -void DI_nttimefields(LARGE_INTEGER *NTtime, TIME_FIELDS *TimeFields); -unsigned long DI_wintime(LARGE_INTEGER *NTtime) ; - -unsigned short DiInsertProcessorNumber (int type) ; -void DiProcessEventLog (unsigned short id, unsigned long msgID, va_list ap); - -void StartIoctlTimer (void (*Handler)(void), unsigned long msec) ; -void StopIoctlTimer (void) ; -void UnpendIoctl (DbgRequest *pDbgReq) ; -#endif - -void add_to_q(int, char* , unsigned int); -# endif /* MAIN_IF___H */ - diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h index ff09f07f440..15d4942de53 100644 --- a/drivers/isdn/hardware/eicon/platform.h +++ b/drivers/isdn/hardware/eicon/platform.h @@ -26,7 +26,6 @@ #include <linux/vmalloc.h> #include <linux/proc_fs.h> #include <linux/interrupt.h> -#include <linux/smp_lock.h> #include <linux/delay.h> #include <linux/list.h> #include <asm/types.h> diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 9f44d3e69fb..99e70d4103b 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -37,7 +37,6 @@ #include <linux/kernel_stat.h> #include <linux/usb.h> #include <linux/kernel.h> -#include <linux/smp_lock.h> #include "hisax.h" #include "hisax_if.h" #include "hfc_usb.h" diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 84dccd526ac..6cdbad3a992 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -443,7 +443,7 @@ ergo_inithardware(hysdn_card * card) card->waitpofready = ergo_waitpofready; card->set_errlog_state = ergo_set_errlog_state; INIT_WORK(&card->irq_queue, ergo_irq_bh); - card->hysdn_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&card->hysdn_lock); return (0); } /* ergo_inithardware */ diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index 4c7dedac0e5..27b3991fb0e 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -297,8 +297,6 @@ hysdn_log_close(struct inode *ino, struct file *filep) struct procdata *pd; hysdn_card *card; int retval = 0; - unsigned long flags; - spinlock_t hysdn_lock = SPIN_LOCK_UNLOCKED; lock_kernel(); if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) { @@ -308,7 +306,6 @@ hysdn_log_close(struct inode *ino, struct file *filep) /* read access -> log/debug read, mark one further file as closed */ pd = NULL; - spin_lock_irqsave(&hysdn_lock, flags); inf = *((struct log_data **) filep->private_data); /* get first log entry */ if (inf) pd = (struct procdata *) inf->proc_ctrl; /* still entries there */ @@ -331,7 +328,6 @@ hysdn_log_close(struct inode *ino, struct file *filep) inf->usage_cnt--; /* decrement usage count for buffers */ inf = inf->next; } - spin_unlock_irqrestore(&hysdn_lock, flags); if (pd) if (pd->if_used <= 0) /* delete buffers if last file closed */ diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index e93ad59f60b..bb92e3cd933 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -1462,7 +1462,7 @@ isdnloop_initcard(char *id) skb_queue_head_init(&card->bqueue[i]); } skb_queue_head_init(&card->dqueue); - card->isdnloop_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&card->isdnloop_lock); card->next = cards; cards = card; if (!register_isdn(&card->interface)) { |