"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "driver/ntoskernel.h" between
ndiswrapper-1.62.tar.gz and ndiswrapper-1.63.tar.gz

About: ndiswrapper is a linux kernel module that loads and runs NDIS (Windows network driver API) drivers supplied by wireless network card vendors.

ntoskernel.h  (ndiswrapper-1.62):ntoskernel.h  (ndiswrapper-1.63)
skipping to change at line 113 skipping to change at line 113
static cpumask_t cpumasks[NR_CPUS]; static cpumask_t cpumasks[NR_CPUS];
#define cpumask_of(cpu) \ #define cpumask_of(cpu) \
({ \ ({ \
cpumasks[cpu] = cpumask_of_cpu(cpu); \ cpumasks[cpu] = cpumask_of_cpu(cpu); \
&cpumasks[cpu]; \ &cpumasks[cpu]; \
}) })
#endif /* Linux < 2.6.28 */ #endif /* Linux < 2.6.28 */
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#ifndef tsk_cpus_allowed #ifndef tsk_cpus_allowed
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_mask)
#else
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
#endif #endif
#endif
#ifndef __packed #ifndef __packed
#define __packed __attribute__((packed)) #define __packed __attribute__((packed))
#endif #endif
/* pci functions in 2.6 kernels have problems allocating dma buffers, /* pci functions in 2.6 kernels have problems allocating dma buffers,
* but seem to work fine with dma functions * but seem to work fine with dma functions
*/ */
#include <asm/dma-mapping.h> #include <asm/dma-mapping.h>
skipping to change at line 640 skipping to change at line 644
#endif #endif
//#undef WRAP_PREEMPT //#undef WRAP_PREEMPT
#ifdef WRAP_PREEMPT #ifdef WRAP_PREEMPT
struct irql_info { struct irql_info {
int count; int count;
struct mutex lock; struct mutex lock;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
cpumask_t cpus_mask;
#else
cpumask_t cpus_allowed; cpumask_t cpus_allowed;
#endif #endif
#endif
struct task_struct *task; struct task_struct *task;
}; };
DECLARE_PER_CPU(struct irql_info, irql_info); DECLARE_PER_CPU(struct irql_info, irql_info);
static inline KIRQL raise_irql(KIRQL newirql) static inline KIRQL raise_irql(KIRQL newirql)
{ {
struct irql_info *info; struct irql_info *info;
assert(newirql == DISPATCH_LEVEL); assert(newirql == DISPATCH_LEVEL);
skipping to change at line 667 skipping to change at line 675
assert(cpumask_equal(tsk_cpus_allowed(current), assert(cpumask_equal(tsk_cpus_allowed(current),
cpumask_of(smp_processor_id()))); cpumask_of(smp_processor_id())));
#endif #endif
info->count++; info->count++;
put_cpu_var(irql_info); put_cpu_var(irql_info);
return DISPATCH_LEVEL; return DISPATCH_LEVEL;
} }
/* TODO: is this enough to pin down to current cpu? */ /* TODO: is this enough to pin down to current cpu? */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
assert(task_cpu(current) == smp_processor_id()); assert(task_cpu(current) == smp_processor_id());
cpumask_copy(&info->cpus_allowed, tsk_cpus_allowed(current)); cpumask_copy(tsk_cpus_allowed(info), tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id())); set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
#endif #endif
put_cpu_var(irql_info); put_cpu_var(irql_info);
mutex_lock(&info->lock); mutex_lock(&info->lock);
assert(info->count == 0); assert(info->count == 0);
assert(info->task == NULL); assert(info->task == NULL);
info->count = 1; info->count = 1;
info->task = current; info->task = current;
return PASSIVE_LEVEL; return PASSIVE_LEVEL;
} }
skipping to change at line 691 skipping to change at line 699
struct irql_info *info; struct irql_info *info;
assert(oldirql <= DISPATCH_LEVEL); assert(oldirql <= DISPATCH_LEVEL);
info = &get_cpu_var(irql_info); info = &get_cpu_var(irql_info);
assert(info->task == current); assert(info->task == current);
assert(mutex_is_locked(&info->lock)); assert(mutex_is_locked(&info->lock));
assert(info->count > 0); assert(info->count > 0);
if (--info->count == 0) { if (--info->count == 0) {
info->task = NULL; info->task = NULL;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
set_cpus_allowed_ptr(current, &info->cpus_allowed); set_cpus_allowed_ptr(current, tsk_cpus_allowed(info));
#endif #endif
mutex_unlock(&info->lock); mutex_unlock(&info->lock);
} }
put_cpu_var(irql_info); put_cpu_var(irql_info);
} }
static inline KIRQL current_irql(void) static inline KIRQL current_irql(void)
{ {
int count; int count;
if (in_irq() || irqs_disabled()) if (in_irq() || irqs_disabled())
 End of changes. 6 change blocks. 
2 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)