Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 359213
Collapse All | Expand All

(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/driver.c (-59 / +44 lines)
Lines 48-53 Link Here
48
#include "defs.h"
48
#include "defs.h"
49
#include "lib.h"
49
#include "lib.h"
50
#include "driver.h"
50
#include "driver.h"
51
#include <linux/proc_fs.h>
52
#include <linux/seq_file.h>
51
53
52
/*---------------------------------------------------------------------------*\
54
/*---------------------------------------------------------------------------*\
53
\*---------------------------------------------------------------------------*/
55
\*---------------------------------------------------------------------------*/
Lines 99-105 Link Here
99
static unsigned long		crit_flags;
101
static unsigned long		crit_flags;
100
static atomic_t			scheduler_enabled	= ATOMIC_INIT (0);
102
static atomic_t			scheduler_enabled	= ATOMIC_INIT (0);
101
static atomic_t			scheduler_id		= ATOMIC_INIT (-1);
103
static atomic_t			scheduler_id		= ATOMIC_INIT (-1);
102
static spinlock_t		stack_lock		= SPIN_LOCK_UNLOCKED;
104
static spinlock_t		sched_lock		= SPIN_LOCK_UNLOCKED;
103
#if !defined (__fcclassic__)
105
#if !defined (__fcclassic__)
104
static int			card_id			= 0;
106
static int			card_id			= 0;
105
#endif
107
#endif
Lines 107-117 Link Here
107
/*---------------------------------------------------------------------------*\
109
/*---------------------------------------------------------------------------*\
108
\*---------------------------------------------------------------------------*/
110
\*---------------------------------------------------------------------------*/
109
static void scheduler (unsigned long data);
111
static void scheduler (unsigned long data);
110
static irqreturn_t irq_handler (int irq, void * args
112
static irqreturn_t irq_handler (int irq, void * args);
111
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
112
				, struct pt_regs * regs
113
#endif
114
				);
115
113
116
static DECLARE_TASKLET_DISABLED (scheduler_tasklet, scheduler, 0);
114
static DECLARE_TASKLET_DISABLED (scheduler_tasklet, scheduler, 0);
117
115
Lines 198-204 Link Here
198
	}
196
	}
199
	lib_strncpy (ctrl->serial, tmp, CAPI_SERIAL_LEN);
197
	lib_strncpy (ctrl->serial, tmp, CAPI_SERIAL_LEN);
200
	lib_memcpy (&ctrl->profile, card->string[6], sizeof (capi_profile));
198
	lib_memcpy (&ctrl->profile, card->string[6], sizeof (capi_profile));
201
	strncpy (ctrl->manu, "AVM GmbH", CAPI_MANUFACTURER_LEN);
199
	lib_strncpy (ctrl->manu, "AVM GmbH", CAPI_MANUFACTURER_LEN);
202
	ctrl->version.majorversion = 2;
200
	ctrl->version.majorversion = 2;
203
	ctrl->version.minorversion = 0;
201
	ctrl->version.minorversion = 0;
204
	tmp = card->string[0];
202
	tmp = card->string[0];
Lines 224-239 Link Here
224
} /* kill_version */
222
} /* kill_version */
225
223
226
/*---------------------------------------------------------------------------*\
224
/*---------------------------------------------------------------------------*\
227
\*---------------------------------------------------------------------------*/
228
static void pprintf (char * page, int * len, const char * fmt, ...) {
229
	va_list args;
230
231
	va_start (args, fmt);
232
	*len += vsprintf (page + *len, fmt, args);
233
	va_end (args);
234
} /* pprintf */
235
236
/*---------------------------------------------------------------------------*\
237
\*-C-------------------------------------------------------------------------*/
225
\*-C-------------------------------------------------------------------------*/
238
static inline int in_critical (void) {
226
static inline int in_critical (void) {
239
	
227
	
Lines 378-386 Link Here
378
			card->irq, 
366
			card->irq, 
379
			&irq_handler, 
367
			&irq_handler, 
380
#if defined (__fcpci__) || defined (__fcpcmcia__)
368
#if defined (__fcpci__) || defined (__fcpcmcia__)
381
			SA_INTERRUPT | SA_SHIRQ, 
369
			IRQF_DISABLED | IRQF_SHARED, 
382
#else
370
#else
383
			SA_INTERRUPT, 
371
			IRQF_DISABLED, 
384
#endif
372
#endif
385
			TARGET, 
373
			TARGET, 
386
			card
374
			card
Lines 494-532 Link Here
494
482
495
/*---------------------------------------------------------------------------*\
483
/*---------------------------------------------------------------------------*\
496
\*---------------------------------------------------------------------------*/
484
\*---------------------------------------------------------------------------*/
497
static int __kcapi ctr_info (
485
498
	char *			page, 
486
static int __kcapi ctr_info (struct seq_file *m, void *v
499
	char **			start, 
500
	off_t			ofs,
501
	int			count, 
502
	int *			eof,
503
	struct capi_ctr *	ctrl
504
) {
487
) {
488
        struct capi_ctr *ctrl = m->private;
505
	card_t *		card;
489
	card_t *		card;
506
	char *			temp;
490
	char *			temp;
507
	unsigned char		flag;
491
	unsigned char		flag;
508
	int			len = 0;
509
492
510
	assert (ctrl != NULL);
493
	assert (ctrl != NULL);
511
	card = (card_t *) ctrl->driverdata;
494
	card = (card_t *) ctrl->driverdata;
512
	assert (card != NULL);
495
	assert (card != NULL);
513
	pprintf (page, &len, "%-16s %s\n", "name", SHORT_LOGO);
496
	seq_printf(m, "%-16s %s\n", "name", SHORT_LOGO);
514
	pprintf (page, &len, "%-16s 0x%04x\n", "io", card->base);
497
	seq_printf(m, "%-16s 0x%04x\n", "io", card->base);
515
	pprintf (page, &len, "%-16s %d\n", "irq", card->irq);
498
	seq_printf(m, "%-16s %d\n", "irq", card->irq);
516
	temp = card->version ? card->string[1] : "A1";
499
	temp = card->version ? card->string[1] : "A1";
517
	pprintf (page, &len, "%-16s %s\n", "type", temp);
500
	seq_printf(m, "%-16s %s\n", "type", temp);
518
	temp = card->version ? card->string[0] : "-";
501
	temp = card->version ? card->string[0] : "-";
519
#if defined (__fcclassic__) || defined (__fcpcmcia__)
502
#if defined (__fcclassic__) || defined (__fcpcmcia__)
520
	pprintf (page, &len, "%-16s 0x%04x\n", "revision", card->info);
503
	seq_printf(m, "%-16s 0x%04x\n", "revision", card->info);
521
#elif defined (__fcpci__)
504
#elif defined (__fcpci__)
522
	pprintf (page, &len, "%-16s %d\n", "class", card_id);
505
	seq_printf(m, "%-16s %d\n", "class", card_id);
523
#endif
506
#endif
524
	pprintf (page, &len, "%-16s %s\n", "ver_driver", temp);
507
	seq_printf(m, "%-16s %s\n", "ver_driver", temp);
525
	pprintf (page, &len, "%-16s %s\n", "ver_cardtype", SHORT_LOGO);
508
	seq_printf(m, "%-16s %s\n", "ver_cardtype", SHORT_LOGO);
526
509
527
	flag = ((unsigned char *) (ctrl->profile.manu))[3];
510
	flag = ((unsigned char *) (ctrl->profile.manu))[3];
528
	if (flag) {
511
	if (flag) {
529
		pprintf(page, &len, "%-16s%s%s%s%s%s%s%s\n", "protocol",
512
		seq_printf(m, "%-16s%s%s%s%s%s%s%s\n", "protocol",
530
			(flag & 0x01) ? " DSS1" : "",
513
			(flag & 0x01) ? " DSS1" : "",
531
			(flag & 0x02) ? " CT1" : "",
514
			(flag & 0x02) ? " CT1" : "",
532
			(flag & 0x04) ? " VN3" : "",
515
			(flag & 0x04) ? " VN3" : "",
Lines 538-558 Link Here
538
	}
521
	}
539
	flag = ((unsigned char *) (ctrl->profile.manu))[5];
522
	flag = ((unsigned char *) (ctrl->profile.manu))[5];
540
	if (flag) {
523
	if (flag) {
541
		pprintf(page, &len, "%-16s%s%s%s%s\n", "linetype",
524
		seq_printf(m, "%-16s%s%s%s%s\n", "linetype",
542
			(flag & 0x01) ? " point to point" : "",
525
			(flag & 0x01) ? " point to point" : "",
543
			(flag & 0x02) ? " point to multipoint" : "",
526
			(flag & 0x02) ? " point to multipoint" : "",
544
			(flag & 0x08) ? " leased line without D-channel" : "",
527
			(flag & 0x08) ? " leased line without D-channel" : "",
545
			(flag & 0x04) ? " leased line with D-channel" : ""
528
			(flag & 0x04) ? " leased line with D-channel" : ""
546
		);
529
		);
547
	}
530
	}
548
	if (len < ofs) {
531
549
		return 0;
532
       return 0;
550
	}
551
	*eof = 1;
552
	*start = page - ofs;
553
	return ((count < len - ofs) ? count : len - ofs);
554
} /* ctr_info */
533
} /* ctr_info */
555
534
535
static int ctr_proc_open(struct inode *inode, struct file *file)
536
{
537
       return single_open(file, ctr_info, PDE(inode)->data);
538
}
539
540
const struct file_operations ctr_proc_fops = {
541
       .owner          = THIS_MODULE,
542
       .open           = ctr_proc_open,
543
       .read           = seq_read,
544
       .llseek         = seq_lseek,
545
       .release        = single_release,
546
};
547
556
/*---------------------------------------------------------------------------*\
548
/*---------------------------------------------------------------------------*\
557
\*---------------------------------------------------------------------------*/
549
\*---------------------------------------------------------------------------*/
558
static void __kcapi reset_ctrl (struct capi_ctr * ctrl) {
550
static void __kcapi reset_ctrl (struct capi_ctr * ctrl) {
Lines 573-579 Link Here
573
		}
565
		}
574
	}
566
	}
575
	stop (card);
567
	stop (card);
576
	capi_ctr_reseted (ctrl);
568
	capi_ctr_down (ctrl);
577
#if defined (__fcpnp__)
569
#if defined (__fcpnp__)
578
	pnp_disable_dev (card->dev);
570
	pnp_disable_dev (card->dev);
579
#endif
571
#endif
Lines 630-636 Link Here
630
	ctrl->release_appl =	release_appl;
622
	ctrl->release_appl =	release_appl;
631
	ctrl->send_message =	send_msg;
623
	ctrl->send_message =	send_msg;
632
	ctrl->procinfo =	proc_info;
624
	ctrl->procinfo =	proc_info;
633
	ctrl->ctr_read_proc =	ctr_info;
625
	ctrl->proc_fops =	&ctr_proc_fops;
634
	if (0 != (res = attach_capi_ctr (ctrl))) {
626
	if (0 != (res = attach_capi_ctr (ctrl))) {
635
		dec_use_count ();
627
		dec_use_count ();
636
		stop (card);
628
		stop (card);
Lines 825-831 Link Here
825
	
817
	
826
	UNUSED_ARG (data);
818
	UNUSED_ARG (data);
827
	atomic_set (&scheduler_id, smp_processor_id ());
819
	atomic_set (&scheduler_id, smp_processor_id ());
828
	if (spin_trylock (&stack_lock)) {
820
	if (spin_trylock (&sched_lock)) {
829
		while (!atomic_read (&dont_sched)) {
821
		while (!atomic_read (&dont_sched)) {
830
			atomic_set (&dont_sched, 1);
822
			atomic_set (&dont_sched, 1);
831
			os_timer_poll ();
823
			os_timer_poll ();
Lines 833-864 Link Here
833
				scheduler_control (TRUE); 
825
				scheduler_control (TRUE); 
834
			}
826
			}
835
		}
827
		}
836
		spin_unlock (&stack_lock);
828
		spin_unlock (&sched_lock);
837
	}
829
	}
838
	atomic_set (&scheduler_id, -1);
830
	atomic_set (&scheduler_id, -1);
839
} /* scheduler */
831
} /* scheduler */
840
832
841
/*---------------------------------------------------------------------------*\
833
/*---------------------------------------------------------------------------*\
842
\*---------------------------------------------------------------------------*/
834
\*---------------------------------------------------------------------------*/
843
static irqreturn_t irq_handler (int irq, void * args
835
static irqreturn_t irq_handler (int irq, void * args) {
844
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
845
				, struct pt_regs * regs
846
#endif
847
				) {
848
	int	res	= IRQ_NONE;
836
	int	res	= IRQ_NONE;
849
	
837
	
850
	UNUSED_ARG (irq);
838
	UNUSED_ARG (irq);
851
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
852
	UNUSED_ARG (regs);
853
#endif
854
	if (args != NULL) {
839
	if (args != NULL) {
855
		assert (capi_lib->cm_handle_events != NULL);
840
		assert (capi_lib->cm_handle_events != NULL);
856
		if (atomic_read (&scheduler_id) == smp_processor_id ()) {
841
		if (atomic_read (&scheduler_id) == smp_processor_id ()) {
857
			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
842
			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
858
		} else {
843
		} else {
859
			spin_lock (&stack_lock);
844
			spin_lock (&sched_lock);
860
			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
845
			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
861
			spin_unlock (&stack_lock);
846
			spin_unlock (&sched_lock);
862
		}
847
		}
863
		if (res == IRQ_HANDLED) {			
848
		if (res == IRQ_HANDLED) {			
864
			atomic_set (&dont_sched, 0);
849
			atomic_set (&dont_sched, 0);
Lines 911-920 Link Here
911
896
912
/*---------------------------------------------------------------------------*\
897
/*---------------------------------------------------------------------------*\
913
\*---------------------------------------------------------------------------*/
898
\*---------------------------------------------------------------------------*/
914
int driver_init (void) {
899
int avm_driver_init (void) {
915
900
916
	return (NULL != (capi_lib = link_library (NULL)));
901
	return (NULL != (capi_lib = link_library (NULL)));
917
} /* driver_init */
902
} /* avm_driver_init */
918
903
919
/*---------------------------------------------------------------------------*\
904
/*---------------------------------------------------------------------------*\
920
\*---------------------------------------------------------------------------*/
905
\*---------------------------------------------------------------------------*/
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/driver.h (-2 / +1 lines)
Lines 23-29 Link Here
23
#ifndef __have_driver_h__
23
#ifndef __have_driver_h__
24
#define __have_driver_h__
24
#define __have_driver_h__
25
25
26
#include <linux/config.h>
27
#include <linux/skbuff.h>
26
#include <linux/skbuff.h>
28
#include <linux/capi.h>
27
#include <linux/capi.h>
29
#include <linux/list.h>
28
#include <linux/list.h>
Lines 98-105 Link Here
98
97
99
/*---------------------------------------------------------------------------*\
98
/*---------------------------------------------------------------------------*\
100
\*---------------------------------------------------------------------------*/
99
\*---------------------------------------------------------------------------*/
101
extern int driver_init (void);
100
extern int avm_driver_init (void);
102
extern void driver_exit (void);
101
extern void driver_exit (void);
103
102
104
/*---------------------------------------------------------------------------*\
103
/*---------------------------------------------------------------------------*\
105
\*---------------------------------------------------------------------------*/
104
\*---------------------------------------------------------------------------*/
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/lib.c (-3 / +3 lines)
Lines 25-31 Link Here
25
#include <linux/mm.h>
25
#include <linux/mm.h>
26
#include <linux/kernel.h>
26
#include <linux/kernel.h>
27
#include <linux/wait.h>
27
#include <linux/wait.h>
28
#include <linux/jiffies.h>
29
#include <linux/sched.h>
28
#include <linux/sched.h>
30
#include <stdarg.h>
29
#include <stdarg.h>
31
#include "main.h"
30
#include "main.h"
Lines 362-369 Link Here
362
static __attr void os_delay (unsigned msec) {
361
static __attr void os_delay (unsigned msec) {
363
362
364
	assert (!in_interrupt ());
363
	assert (!in_interrupt ());
365
	set_current_state (TASK_INTERRUPTIBLE);
364
	info (msec > 9);
366
	schedule_timeout (msecs_to_jiffies (msec));
365
	msec = (msec > 9) ? (msec / 10) * TEN_MSECS : TEN_MSECS;
366
	wait_event_interruptible_timeout (delay, 0, msec);
367
} /* os_delay */
367
} /* os_delay */
368
#endif
368
#endif
369
369
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/libdefs.h (-5 / +5 lines)
Lines 59-67 Link Here
59
\*---------------------------------------------------------------------------*/
59
\*---------------------------------------------------------------------------*/
60
typedef struct __lib {
60
typedef struct __lib {
61
61
62
	void (__attr * init) (unsigned, void (__attr2 *) (void *, unsigned), 
62
	void (__attr * init) (unsigned, void (__attr2 *) (void *, unsigned),
63
					void (__attr2 *) (void *), 
63
					void (__attr2 *) (void *), 
64
					void (__attr2 *) (void));
64
					void (__attr2 *) (void)); 
65
	
65
	
66
	char * (__attr * params) (void);
66
	char * (__attr * params) (void);
67
	
67
	
Lines 92-98 Link Here
92
	void * (__attr * malloc2) (unsigned);
92
	void * (__attr * malloc2) (unsigned);
93
#endif
93
#endif
94
94
95
#if defined (DRIVER_TYPE_DSL_RAP) || defined (DRIVER_TYPE_DSL_USB)
95
#if defined (DRIVER_TYPE_DSL_RAP)
96
	void (__attr * delay) (unsigned);
96
	void (__attr * delay) (unsigned);
97
#endif
97
#endif
98
	unsigned long (__attr * msec) (void);
98
	unsigned long (__attr * msec) (void);
Lines 137-143 Link Here
137
	char *		name;
137
	char *		name;
138
	unsigned	udata;
138
	unsigned	udata;
139
	void *		pdata;
139
	void *		pdata;
140
} lib_interface_t;
140
} lib_interface_t, * lib_interface_p;
141
141
142
/*---------------------------------------------------------------------------*\
142
/*---------------------------------------------------------------------------*\
143
\*---------------------------------------------------------------------------*/
143
\*---------------------------------------------------------------------------*/
Lines 205-211 Link Here
205
	int (__attr2 * cc_run) (void);
205
	int (__attr2 * cc_run) (void);
206
#endif
206
#endif
207
207
208
} lib_callback_t;
208
} lib_callback_t, * lib_callback_p;
209
209
210
/*---------------------------------------------------------------------------*\
210
/*---------------------------------------------------------------------------*\
211
\*---------------------------------------------------------------------------*/
211
\*---------------------------------------------------------------------------*/
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/libstub.h (-11 lines)
Lines 29-49 Link Here
29
# undef NDEBUG
29
# undef NDEBUG
30
#endif
30
#endif
31
31
32
#if defined (DRIVER_TYPE_DSL)
33
extern __attr2 lib_callback_t * avm_lib_attach (lib_interface_t *, void *);
34
#else
35
extern __attr2 lib_callback_t * avm_lib_attach (lib_interface_t *);
32
extern __attr2 lib_callback_t * avm_lib_attach (lib_interface_t *);
36
#endif
37
38
extern __attr2 void avm_lib_detach (lib_interface_t *);
33
extern __attr2 void avm_lib_detach (lib_interface_t *);
39
34
40
#if defined (DRIVER_TYPE_DSL_RAP) || defined (DRIVER_TYPE_DSL_TM)
41
extern __attr2 lib_interface_t * avm_get_interface (void);
42
#endif
43
44
#if defined (DRIVER_TYPE_INTERN)
45
extern volatile unsigned long avm_time_base;
35
extern volatile unsigned long avm_time_base;
46
#endif
47
36
48
#endif
37
#endif
49
38
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/main.c (-4 / +3 lines)
Lines 22-28 Link Here
22
22
23
#include <stdarg.h>
23
#include <stdarg.h>
24
#include <asm/uaccess.h>
24
#include <asm/uaccess.h>
25
#include <linux/config.h>
26
#include <linux/version.h>
25
#include <linux/version.h>
27
#include <linux/kernel.h>
26
#include <linux/kernel.h>
28
#include <linux/module.h>
27
#include <linux/module.h>
Lines 205-211 Link Here
205
	NOTE(PRODUCT_LOGO " found: port 0x%04x, irq %u\n", pars.port, pars.irq);
206
	NOTE(PRODUCT_LOGO " found: port 0x%04x, irq %u\n", pars.port, pars.irq);
206
207
207
	NOTE("Loading...\n");
208
	NOTE("Loading...\n");
208
	if (!driver_init ()) {
209
	if (!avm_driver_init ()) {
209
		ERROR("Error: Driver library not available.\n");
210
		ERROR("Error: Driver library not available.\n");
210
		ERROR("Not loaded.\n");
211
		ERROR("Not loaded.\n");
211
		return res;
212
		return res;
Lines 270-276 Link Here
270
	NOTE (PRODUCT_LOGO " found: port 0x%04x, irq %u\n", pars.port, pars.irq);
271
	NOTE (PRODUCT_LOGO " found: port 0x%04x, irq %u\n", pars.port, pars.irq);
271
272
272
	NOTE("Loading...\n");
273
	NOTE("Loading...\n");
273
	if (!driver_init ()) {
274
	if (!avm_driver_init ()) {
274
		ERROR("Error: Driver library not available.\n");
275
		ERROR("Error: Driver library not available.\n");
275
		ERROR("Not loaded.\n");
276
		ERROR("Not loaded.\n");
276
		return -EBUSY;
277
		return -EBUSY;
Lines 378-384 Link Here
378
	}
379
	}
379
	return err;
380
	return err;
380
#elif defined (__fcpcmcia__) || defined (__fcclassic__)
381
#elif defined (__fcpcmcia__) || defined (__fcclassic__)
381
	if (!driver_init ()) {
382
	if (!avm_driver_init ()) {
382
		ERROR("Error: Driver library not available.\n");
383
		ERROR("Error: Driver library not available.\n");
383
		ERROR("Not loaded.\n");
384
		ERROR("Not loaded.\n");
384
		return -EBUSY;
385
		return -EBUSY;
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/tables.c (-10 / +6 lines)
Lines 63-69 Link Here
63
	}
63
	}
64
	tab->appl_count++;
64
	tab->appl_count++;
65
	unlock (tab->lock);
65
	unlock (tab->lock);
66
	LOG("Application CREATED, id %u (%u, %u, %u)\n", id, ncount, bcount, bsize);
67
	return appp;
66
	return appp;
68
} /* create_appl */
67
} /* create_appl */
69
68
Lines 90-96 Link Here
90
	nccip = appp->root;
89
	nccip = appp->root;
91
	tab->appl_count--;
90
	tab->appl_count--;
92
	unlock (tab->lock);
91
	unlock (tab->lock);
93
	LOG("Application REMOVED, id %u\n", appp->id);
94
	while (nccip != NULL) {
92
	while (nccip != NULL) {
95
		tmp = nccip->succ;
93
		tmp = nccip->succ;
96
		remove_ncci (tab, appp, nccip);
94
		remove_ncci (tab, appp, nccip);
Lines 230-236 Link Here
230
	assert (msg != NULL);
228
	assert (msg != NULL);
231
	appl = CAPIMSG_APPID (msg->data);
229
	appl = CAPIMSG_APPID (msg->data);
232
	if (NULL == (appp = search_appl (tab, appl))) {
230
	if (NULL == (appp = search_appl (tab, appl))) {
233
		ERROR("Unknown application id #%u (%d)\n", appl, __LINE__);
231
		ERROR("Unknown application id! (%u)\n", appl);
234
		ci = CAPI_ILLAPPNR;
232
		ci = CAPI_ILLAPPNR;
235
		goto done;
233
		goto done;
236
	}
234
	}
Lines 483-489 Link Here
483
	assert (capi_card != NULL);
481
	assert (capi_card != NULL);
484
	MLOG("NEW NCCI(appl:%u,ncci:%lX)\n", appl_id, ncci);
482
	MLOG("NEW NCCI(appl:%u,ncci:%lX)\n", appl_id, ncci);
485
	if (NULL == (appp = search_appl (capi_card->appls, appl_id))) {
483
	if (NULL == (appp = search_appl (capi_card->appls, appl_id))) {
486
		ERROR("Unknown application id #%u (%d)\n", appl_id, __LINE__);
484
		ERROR("Unknown application id #%u\n", appl_id);
487
		return;
485
		return;
488
	}
486
	}
489
	nccip = create_ncci (
487
	nccip = create_ncci (
Lines 508-514 Link Here
508
	assert (capi_card != NULL);
506
	assert (capi_card != NULL);
509
	appp = search_appl (capi_card->appls, appl_id);
507
	appp = search_appl (capi_card->appls, appl_id);
510
	if (NULL == appp) {
508
	if (NULL == appp) {
511
		ERROR("Unknown application id #%u (%d)\n", appl_id, __LINE__);
509
		ERROR("Unknown application id #%u\n", appl_id);
512
		return;
510
		return;
513
	}
511
	}
514
	if (0xFFFFFFFF == ncci) {		/* 2nd phase RELEASE */
512
	if (0xFFFFFFFF == ncci) {		/* 2nd phase RELEASE */
Lines 536-542 Link Here
536
	assert (capi_card != NULL);
534
	assert (capi_card != NULL);
537
	appp = search_appl (capi_card->appls, appl_id);
535
	appp = search_appl (capi_card->appls, appl_id);
538
	if (NULL == appp) {
536
	if (NULL == appp) {
539
		ERROR("Unknown application id #%u (%d)\n", appl_id, __LINE__);
537
		ERROR("Unknown application id #%u\n", appl_id);
540
		return NULL;
538
		return NULL;
541
	}
539
	}
542
	return ncci_data_buffer (capi_card->appls, appp, ncci, handle);
540
	return ncci_data_buffer (capi_card->appls, appp, ncci, handle);
Lines 559-569 Link Here
559
	}
557
	}
560
#endif
558
#endif
561
	info (capi_card->rel_func != NULL);
559
	info (capi_card->rel_func != NULL);
562
	if (NULL == (appp = search_appl (capi_card->appls, appl))) {
563
		LOG("Release failed... application id unknown!\n");
564
		return;
565
	}
566
	if (capi_card->rel_func != NULL) {
560
	if (capi_card->rel_func != NULL) {
561
		appp = search_appl (capi_card->appls, appl);
562
		assert (appp != NULL);
567
		(*capi_card->rel_func) (appp->data);
563
		(*capi_card->rel_func) (appp->data);
568
	}
564
	}
569
	skb = make_0xfe_request (appl);
565
	skb = make_0xfe_request (appl);
(-)usr.orig/src/kernel-modules/fritzcapi/fritz.pci/src/tools.h (+11 lines)
Lines 23-28 Link Here
23
#ifndef __have_tools_h__
23
#ifndef __have_tools_h__
24
#define __have_tools_h__
24
#define __have_tools_h__
25
25
26
#include <asm/atomic.h>
26
#include <linux/types.h>
27
#include <linux/types.h>
27
#include <linux/spinlock.h>
28
#include <linux/spinlock.h>
28
#include <stdarg.h>
29
#include <stdarg.h>
Lines 70-75 Link Here
70
71
71
/*---------------------------------------------------------------------------*\
72
/*---------------------------------------------------------------------------*\
72
\*---------------------------------------------------------------------------*/
73
\*---------------------------------------------------------------------------*/
74
//#ifndef atomic_xchg
75
//static inline unsigned long atomic_xchg (
76
//	volatile atomic_t *	v, 
77
//	unsigned		value
78
//) {
79
//	return __xchg (value, &v->counter, sizeof (unsigned));
80
//} /* atomic_xchg */
81
//#endif
82
/*---------------------------------------------------------------------------*\
83
\*---------------------------------------------------------------------------*/
73
#ifndef NDEBUG
84
#ifndef NDEBUG
74
extern unsigned hallocated (void);
85
extern unsigned hallocated (void);
75
extern int hvalid (void *);
86
extern int hvalid (void *);

Return to bug 359213