mirror of https://gitee.com/openkylin/linux.git
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
commit
e601ef22bc
|
@ -11,6 +11,8 @@
|
|||
Joel Schopp <jschopp@austin.ibm.com>
|
||||
ia64/x86_64:
|
||||
Ashok Raj <ashok.raj@intel.com>
|
||||
s390:
|
||||
Heiko Carstens <heiko.carstens@de.ibm.com>
|
||||
|
||||
Authors: Ashok Raj <ashok.raj@intel.com>
|
||||
Lots of feedback: Nathan Lynch <nathanl@austin.ibm.com>,
|
||||
|
@ -44,9 +46,23 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
|
|||
maxcpus=2 will only boot 2. You can choose to bring the
|
||||
other cpus later online, read FAQ's for more info.
|
||||
|
||||
additional_cpus=n [x86_64 only] use this to limit hotpluggable cpus.
|
||||
This option sets
|
||||
cpu_possible_map = cpu_present_map + additional_cpus
|
||||
additional_cpus=n [x86_64, s390 only] use this to limit hotpluggable cpus.
|
||||
This option sets
|
||||
cpu_possible_map = cpu_present_map + additional_cpus
|
||||
|
||||
ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT
|
||||
to determine the number of potentially hot-pluggable cpus. The implementation
|
||||
should only rely on this to count the #of cpus, but *MUST* not rely on the
|
||||
apicid values in those tables for disabled apics. In the event BIOS doesnt
|
||||
mark such hot-pluggable cpus as disabled entries, one could use this
|
||||
parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.
|
||||
|
||||
|
||||
possible_cpus=n [s390 only] use this to set hotpluggable cpus.
|
||||
This option sets possible_cpus bits in
|
||||
cpu_possible_map. Thus keeping the numbers of bits set
|
||||
constant even if the machine gets rebooted.
|
||||
This option overrides additional_cpus.
|
||||
|
||||
CPU maps and such
|
||||
-----------------
|
||||
|
|
|
@ -1133,6 +1133,8 @@ running once the system is up.
|
|||
Mechanism 1.
|
||||
conf2 [IA-32] Force use of PCI Configuration
|
||||
Mechanism 2.
|
||||
nommconf [IA-32,X86_64] Disable use of MMCONFIG for PCI
|
||||
Configuration
|
||||
nosort [IA-32] Don't sort PCI devices according to
|
||||
order given by the PCI BIOS. This sorting is
|
||||
done to get a device order compatible with
|
||||
|
@ -1636,6 +1638,9 @@ running once the system is up.
|
|||
Format:
|
||||
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
|
||||
|
||||
norandmaps Don't use address space randomization
|
||||
Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space
|
||||
|
||||
|
||||
______________________________________________________________________
|
||||
Changelog:
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
|
||||
2 Current Version : 00.00.02.04
|
||||
3 Older Version : 00.00.02.04
|
||||
|
||||
i. Support for 1078 type (ppc IOP) controller, device id : 0x60 added.
|
||||
During initialization, depending on the device id, the template members
|
||||
are initialized with function pointers specific to the ppc or
|
||||
xscale controllers.
|
||||
|
||||
-Sumant Patro <Sumant.Patro@lsil.com>
|
||||
|
||||
1 Release Date : Fri Feb 03 14:16:25 PST 2006 - Sumant Patro
|
||||
<Sumant.Patro@lsil.com>
|
||||
2 Current Version : 00.00.02.04
|
||||
3 Older Version : 00.00.02.02
|
||||
i. Register 16 byte CDB capability with scsi midlayer
|
||||
|
||||
"Ths patch properly registers the 16 byte command length capability of the
|
||||
megaraid_sas controlled hardware with the scsi midlayer. All megaraid_sas
|
||||
hardware supports 16 byte CDB's."
|
||||
|
||||
-Joshua Giles <joshua_giles@dell.com>
|
||||
|
||||
1 Release Date : Mon Jan 23 14:09:01 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
|
||||
2 Current Version : 00.00.02.02
|
||||
3 Older Version : 00.00.02.01
|
||||
|
|
9
Makefile
9
Makefile
|
@ -1,7 +1,7 @@
|
|||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 16
|
||||
EXTRAVERSION =-rc3
|
||||
EXTRAVERSION =-rc4
|
||||
NAME=Sliding Snow Leopard
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -106,13 +106,12 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
|
|||
$(if $(KBUILD_OUTPUT),, \
|
||||
$(error output directory "$(saved-output)" does not exist))
|
||||
|
||||
.PHONY: $(MAKECMDGOALS) cdbuilddir
|
||||
$(MAKECMDGOALS) _all: cdbuilddir
|
||||
.PHONY: $(MAKECMDGOALS)
|
||||
|
||||
cdbuilddir:
|
||||
$(filter-out _all,$(MAKECMDGOALS)) _all:
|
||||
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
|
||||
KBUILD_SRC=$(CURDIR) \
|
||||
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS)
|
||||
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
|
||||
|
||||
# Leave processing to above invocation of make
|
||||
skip-makefile := 1
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
CALL(sys_statfs)
|
||||
/* 100 */ CALL(sys_fstatfs)
|
||||
CALL(sys_ni_syscall)
|
||||
CALL(OBSOLETE(sys_socketcall))
|
||||
CALL(OBSOLETE(ABI(sys_socketcall, sys_oabi_socketcall)))
|
||||
CALL(sys_syslog)
|
||||
CALL(sys_setitimer)
|
||||
/* 105 */ CALL(sys_getitimer)
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/root_dev.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/elf.h>
|
||||
|
@ -771,6 +772,10 @@ void __init setup_arch(char **cmdline_p)
|
|||
paging_init(&meminfo, mdesc);
|
||||
request_standard_resources(&meminfo, mdesc);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
smp_init_cpus();
|
||||
#endif
|
||||
|
||||
cpu_init();
|
||||
|
||||
/*
|
||||
|
|
|
@ -338,7 +338,6 @@ void __init smp_prepare_boot_cpu(void)
|
|||
|
||||
per_cpu(cpu_data, cpu).idle = current;
|
||||
|
||||
cpu_set(cpu, cpu_possible_map);
|
||||
cpu_set(cpu, cpu_present_map);
|
||||
cpu_set(cpu, cpu_online_map);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
* sys_connect:
|
||||
* sys_sendmsg:
|
||||
* sys_sendto:
|
||||
* sys_socketcall:
|
||||
*
|
||||
* struct sockaddr_un loses its padding with EABI. Since the size of the
|
||||
* structure is used as a validation test in unix_mkname(), we need to
|
||||
|
@ -78,6 +79,7 @@
|
|||
#include <linux/eventpoll.h>
|
||||
#include <linux/sem.h>
|
||||
#include <linux/socket.h>
|
||||
#include <linux/net.h>
|
||||
#include <asm/ipc.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
@ -408,3 +410,31 @@ asmlinkage long sys_oabi_sendmsg(int fd, struct msghdr __user *msg, unsigned fla
|
|||
return sys_sendmsg(fd, msg, flags);
|
||||
}
|
||||
|
||||
asmlinkage long sys_oabi_socketcall(int call, unsigned long __user *args)
|
||||
{
|
||||
unsigned long r = -EFAULT, a[6];
|
||||
|
||||
switch (call) {
|
||||
case SYS_BIND:
|
||||
if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
|
||||
r = sys_oabi_bind(a[0], (struct sockaddr __user *)a[1], a[2]);
|
||||
break;
|
||||
case SYS_CONNECT:
|
||||
if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
|
||||
r = sys_oabi_connect(a[0], (struct sockaddr __user *)a[1], a[2]);
|
||||
break;
|
||||
case SYS_SENDTO:
|
||||
if (copy_from_user(a, args, 6 * sizeof(long)) == 0)
|
||||
r = sys_oabi_sendto(a[0], (void __user *)a[1], a[2], a[3],
|
||||
(struct sockaddr __user *)a[4], a[5]);
|
||||
break;
|
||||
case SYS_SENDMSG:
|
||||
if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
|
||||
r = sys_oabi_sendmsg(a[0], (struct msghdr __user *)a[1], a[2]);
|
||||
break;
|
||||
default:
|
||||
r = sys_socketcall(call, args);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -140,6 +140,18 @@ static void __init poke_milo(void)
|
|||
mb();
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise the CPU possible map early - this describes the CPUs
|
||||
* which may be present or become present in the system.
|
||||
*/
|
||||
void __init smp_init_cpus(void)
|
||||
{
|
||||
unsigned int i, ncores = get_core_count();
|
||||
|
||||
for (i = 0; i < ncores; i++)
|
||||
cpu_set(i, cpu_possible_map);
|
||||
}
|
||||
|
||||
void __init smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
unsigned int ncores = get_core_count();
|
||||
|
@ -176,14 +188,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
|||
max_cpus = ncores;
|
||||
|
||||
/*
|
||||
* Initialise the possible/present maps.
|
||||
* cpu_possible_map describes the set of CPUs which may be present
|
||||
* cpu_present_map describes the set of CPUs populated
|
||||
* Initialise the present map, which describes the set of CPUs
|
||||
* actually populated at the present time.
|
||||
*/
|
||||
for (i = 0; i < max_cpus; i++) {
|
||||
cpu_set(i, cpu_possible_map);
|
||||
for (i = 0; i < max_cpus; i++)
|
||||
cpu_set(i, cpu_present_map);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do we need any more CPUs? If so, then let them know where
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
|
@ -27,8 +27,6 @@ static struct flash_platform_data nslu2_flash_data = {
|
|||
};
|
||||
|
||||
static struct resource nslu2_flash_resource = {
|
||||
.start = NSLU2_FLASH_BASE,
|
||||
.end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE,
|
||||
.flags = IORESOURCE_MEM,
|
||||
};
|
||||
|
||||
|
@ -116,6 +114,10 @@ static void __init nslu2_init(void)
|
|||
{
|
||||
ixp4xx_sys_init();
|
||||
|
||||
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
|
||||
nslu2_flash_resource.end =
|
||||
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
|
||||
|
||||
pm_power_off = nslu2_power_off;
|
||||
|
||||
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
|
||||
|
|
|
@ -143,6 +143,18 @@ static void __init poke_milo(void)
|
|||
mb();
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise the CPU possible map early - this describes the CPUs
|
||||
* which may be present or become present in the system.
|
||||
*/
|
||||
void __init smp_init_cpus(void)
|
||||
{
|
||||
unsigned int i, ncores = get_core_count();
|
||||
|
||||
for (i = 0; i < ncores; i++)
|
||||
cpu_set(i, cpu_possible_map);
|
||||
}
|
||||
|
||||
void __init smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
unsigned int ncores = get_core_count();
|
||||
|
@ -179,14 +191,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
|||
local_timer_setup(cpu);
|
||||
|
||||
/*
|
||||
* Initialise the possible/present maps.
|
||||
* cpu_possible_map describes the set of CPUs which may be present
|
||||
* cpu_present_map describes the set of CPUs populated
|
||||
* Initialise the present map, which describes the set of CPUs
|
||||
* actually populated at the present time.
|
||||
*/
|
||||
for (i = 0; i < max_cpus; i++) {
|
||||
cpu_set(i, cpu_possible_map);
|
||||
for (i = 0; i < max_cpus; i++)
|
||||
cpu_set(i, cpu_present_map);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do we need any more CPUs? If so, then let them know where
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <linux/pm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/msr.h>
|
||||
|
|
|
@ -761,6 +761,59 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int additional_cpus __initdata = -1;
|
||||
|
||||
static __init int setup_additional_cpus(char *s)
|
||||
{
|
||||
if (s)
|
||||
additional_cpus = simple_strtol(s, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
early_param("additional_cpus", setup_additional_cpus);
|
||||
|
||||
/*
|
||||
* cpu_possible_map should be static, it cannot change as cpu's
|
||||
* are onlined, or offlined. The reason is per-cpu data-structures
|
||||
* are allocated by some modules at init time, and dont expect to
|
||||
* do this dynamically on cpu arrival/departure.
|
||||
* cpu_present_map on the other hand can change dynamically.
|
||||
* In case when cpu_hotplug is not compiled, then we resort to current
|
||||
* behaviour, which is cpu_possible == cpu_present.
|
||||
* - Ashok Raj
|
||||
*
|
||||
* Three ways to find out the number of additional hotplug CPUs:
|
||||
* - If the BIOS specified disabled CPUs in ACPI/mptables use that.
|
||||
* - The user can overwrite it with additional_cpus=NUM
|
||||
* - Otherwise don't reserve additional CPUs.
|
||||
*/
|
||||
__init void prefill_possible_map(void)
|
||||
{
|
||||
int i;
|
||||
int possible, disabled_cpus;
|
||||
|
||||
disabled_cpus = total_cpus - available_cpus;
|
||||
|
||||
if (additional_cpus == -1) {
|
||||
if (disabled_cpus > 0)
|
||||
additional_cpus = disabled_cpus;
|
||||
else
|
||||
additional_cpus = 0;
|
||||
}
|
||||
|
||||
possible = available_cpus + additional_cpus;
|
||||
|
||||
if (possible > NR_CPUS)
|
||||
possible = NR_CPUS;
|
||||
|
||||
printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
|
||||
possible, max((possible - available_cpus), 0));
|
||||
|
||||
for (i = 0; i < possible; i++)
|
||||
cpu_set(i, cpu_possible_map);
|
||||
}
|
||||
|
||||
int acpi_map_lsapic(acpi_handle handle, int *pcpu)
|
||||
{
|
||||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||
|
|
|
@ -569,7 +569,9 @@ GLOBAL_ENTRY(ia64_trace_syscall)
|
|||
.mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8
|
||||
.mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
|
||||
br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
|
||||
.ret3: br.cond.sptk .work_pending_syscall_end
|
||||
.ret3:
|
||||
(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
|
||||
br.cond.sptk .work_pending_syscall_end
|
||||
|
||||
strace_error:
|
||||
ld8 r3=[r2] // load pt_regs.r8
|
||||
|
|
|
@ -10,23 +10,8 @@
|
|||
|
||||
#include <linux/string.h>
|
||||
EXPORT_SYMBOL(memset);
|
||||
EXPORT_SYMBOL(memchr);
|
||||
EXPORT_SYMBOL(memcmp);
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
EXPORT_SYMBOL(memmove);
|
||||
EXPORT_SYMBOL(memscan);
|
||||
EXPORT_SYMBOL(strcat);
|
||||
EXPORT_SYMBOL(strchr);
|
||||
EXPORT_SYMBOL(strcmp);
|
||||
EXPORT_SYMBOL(strcpy);
|
||||
EXPORT_SYMBOL(strlen);
|
||||
EXPORT_SYMBOL(strncat);
|
||||
EXPORT_SYMBOL(strncmp);
|
||||
EXPORT_SYMBOL(strncpy);
|
||||
EXPORT_SYMBOL(strnlen);
|
||||
EXPORT_SYMBOL(strrchr);
|
||||
EXPORT_SYMBOL(strstr);
|
||||
EXPORT_SYMBOL(strpbrk);
|
||||
|
||||
#include <asm/checksum.h>
|
||||
EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */
|
||||
|
|
|
@ -430,6 +430,7 @@ setup_arch (char **cmdline_p)
|
|||
if (early_console_setup(*cmdline_p) == 0)
|
||||
mark_bsp_online();
|
||||
|
||||
parse_early_param();
|
||||
#ifdef CONFIG_ACPI
|
||||
/* Initialize the ACPI boot-time table parser */
|
||||
acpi_table_init();
|
||||
|
@ -688,6 +689,9 @@ void
|
|||
setup_per_cpu_areas (void)
|
||||
{
|
||||
/* start_kernel() requires this... */
|
||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||
prefill_possible_map();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -129,7 +129,7 @@ DEFINE_PER_CPU(int, cpu_state);
|
|||
/* Bitmasks of currently online, and possible CPUs */
|
||||
cpumask_t cpu_online_map;
|
||||
EXPORT_SYMBOL(cpu_online_map);
|
||||
cpumask_t cpu_possible_map;
|
||||
cpumask_t cpu_possible_map = CPU_MASK_NONE;
|
||||
EXPORT_SYMBOL(cpu_possible_map);
|
||||
|
||||
cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
|
||||
|
@ -506,9 +506,6 @@ smp_build_cpu_map (void)
|
|||
|
||||
for (cpu = 0; cpu < NR_CPUS; cpu++) {
|
||||
ia64_cpu_to_sapicid[cpu] = -1;
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
cpu_set(cpu, cpu_possible_map);
|
||||
#endif
|
||||
}
|
||||
|
||||
ia64_cpu_to_sapicid[0] = boot_cpu_id;
|
||||
|
|
|
@ -250,32 +250,27 @@ time_init (void)
|
|||
set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
|
||||
}
|
||||
|
||||
#define SMALLUSECS 100
|
||||
/*
|
||||
* Generic udelay assumes that if preemption is allowed and the thread
|
||||
* migrates to another CPU, that the ITC values are synchronized across
|
||||
* all CPUs.
|
||||
*/
|
||||
static void
|
||||
ia64_itc_udelay (unsigned long usecs)
|
||||
{
|
||||
unsigned long start = ia64_get_itc();
|
||||
unsigned long end = start + usecs*local_cpu_data->cyc_per_usec;
|
||||
|
||||
while (time_before(ia64_get_itc(), end))
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
void (*ia64_udelay)(unsigned long usecs) = &ia64_itc_udelay;
|
||||
|
||||
void
|
||||
udelay (unsigned long usecs)
|
||||
{
|
||||
unsigned long start;
|
||||
unsigned long cycles;
|
||||
unsigned long smallusecs;
|
||||
|
||||
/*
|
||||
* Execute the non-preemptible delay loop (because the ITC might
|
||||
* not be synchronized between CPUS) in relatively short time
|
||||
* chunks, allowing preemption between the chunks.
|
||||
*/
|
||||
while (usecs > 0) {
|
||||
smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs;
|
||||
preempt_disable();
|
||||
cycles = smallusecs*local_cpu_data->cyc_per_usec;
|
||||
start = ia64_get_itc();
|
||||
|
||||
while (ia64_get_itc() - start < cycles)
|
||||
cpu_relax();
|
||||
|
||||
preempt_enable();
|
||||
usecs -= smallusecs;
|
||||
}
|
||||
(*ia64_udelay)(usecs);
|
||||
}
|
||||
EXPORT_SYMBOL(udelay);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/module.h> /* for EXPORT_SYMBOL */
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/delay.h> /* for ssleep() */
|
||||
|
||||
#include <asm/fpswa.h>
|
||||
#include <asm/ia32.h>
|
||||
|
@ -116,6 +117,13 @@ die (const char *str, struct pt_regs *regs, long err)
|
|||
bust_spinlocks(0);
|
||||
die.lock_owner = -1;
|
||||
spin_unlock_irq(&die.lock);
|
||||
|
||||
if (panic_on_oops) {
|
||||
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
|
||||
ssleep(5);
|
||||
panic("Fatal exception");
|
||||
}
|
||||
|
||||
do_exit(SIGSEGV);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
#include "xtalk/hubdev.h"
|
||||
#include "xtalk/xwidgetdev.h"
|
||||
|
||||
|
||||
extern void sn_init_cpei_timer(void);
|
||||
extern void register_sn_procfs(void);
|
||||
|
||||
static struct list_head sn_sysdata_list;
|
||||
|
||||
/* sysdata list struct */
|
||||
|
@ -40,12 +44,12 @@ struct brick {
|
|||
struct slab_info slab_info[MAX_SLABS + 1];
|
||||
};
|
||||
|
||||
int sn_ioif_inited = 0; /* SN I/O infrastructure initialized? */
|
||||
int sn_ioif_inited; /* SN I/O infrastructure initialized? */
|
||||
|
||||
struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */
|
||||
|
||||
static int max_segment_number = 0; /* Default highest segment number */
|
||||
static int max_pcibus_number = 255; /* Default highest pci bus number */
|
||||
static int max_segment_number; /* Default highest segment number */
|
||||
static int max_pcibus_number = 255; /* Default highest pci bus number */
|
||||
|
||||
/*
|
||||
* Hooks and struct for unsupported pci providers
|
||||
|
@ -84,7 +88,6 @@ static inline u64
|
|||
sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
|
||||
u64 address)
|
||||
{
|
||||
|
||||
struct ia64_sal_retval ret_stuff;
|
||||
ret_stuff.status = 0;
|
||||
ret_stuff.v0 = 0;
|
||||
|
@ -94,7 +97,6 @@ sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
|
|||
(u64) nasid, (u64) widget_num,
|
||||
(u64) device_num, (u64) address, 0, 0, 0);
|
||||
return ret_stuff.status;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -102,7 +104,6 @@ sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
|
|||
*/
|
||||
static inline u64 sal_get_hubdev_info(u64 handle, u64 address)
|
||||
{
|
||||
|
||||
struct ia64_sal_retval ret_stuff;
|
||||
ret_stuff.status = 0;
|
||||
ret_stuff.v0 = 0;
|
||||
|
@ -118,7 +119,6 @@ static inline u64 sal_get_hubdev_info(u64 handle, u64 address)
|
|||
*/
|
||||
static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address)
|
||||
{
|
||||
|
||||
struct ia64_sal_retval ret_stuff;
|
||||
ret_stuff.status = 0;
|
||||
ret_stuff.v0 = 0;
|
||||
|
@ -215,7 +215,7 @@ static void __init sn_fixup_ionodes(void)
|
|||
struct hubdev_info *hubdev;
|
||||
u64 status;
|
||||
u64 nasid;
|
||||
int i, widget, device;
|
||||
int i, widget, device, size;
|
||||
|
||||
/*
|
||||
* Get SGI Specific HUB chipset information.
|
||||
|
@ -251,48 +251,37 @@ static void __init sn_fixup_ionodes(void)
|
|||
if (!hubdev->hdi_flush_nasid_list.widget_p)
|
||||
continue;
|
||||
|
||||
size = (HUB_WIDGET_ID_MAX + 1) *
|
||||
sizeof(struct sn_flush_device_kernel *);
|
||||
hubdev->hdi_flush_nasid_list.widget_p =
|
||||
kmalloc((HUB_WIDGET_ID_MAX + 1) *
|
||||
sizeof(struct sn_flush_device_kernel *),
|
||||
GFP_KERNEL);
|
||||
memset(hubdev->hdi_flush_nasid_list.widget_p, 0x0,
|
||||
(HUB_WIDGET_ID_MAX + 1) *
|
||||
sizeof(struct sn_flush_device_kernel *));
|
||||
kzalloc(size, GFP_KERNEL);
|
||||
if (!hubdev->hdi_flush_nasid_list.widget_p)
|
||||
BUG();
|
||||
|
||||
for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) {
|
||||
sn_flush_device_kernel = kmalloc(DEV_PER_WIDGET *
|
||||
sizeof(struct
|
||||
sn_flush_device_kernel),
|
||||
GFP_KERNEL);
|
||||
size = DEV_PER_WIDGET *
|
||||
sizeof(struct sn_flush_device_kernel);
|
||||
sn_flush_device_kernel = kzalloc(size, GFP_KERNEL);
|
||||
if (!sn_flush_device_kernel)
|
||||
BUG();
|
||||
memset(sn_flush_device_kernel, 0x0,
|
||||
DEV_PER_WIDGET *
|
||||
sizeof(struct sn_flush_device_kernel));
|
||||
|
||||
dev_entry = sn_flush_device_kernel;
|
||||
for (device = 0; device < DEV_PER_WIDGET;
|
||||
device++,dev_entry++) {
|
||||
dev_entry->common = kmalloc(sizeof(struct
|
||||
sn_flush_device_common),
|
||||
GFP_KERNEL);
|
||||
size = sizeof(struct sn_flush_device_common);
|
||||
dev_entry->common = kzalloc(size, GFP_KERNEL);
|
||||
if (!dev_entry->common)
|
||||
BUG();
|
||||
memset(dev_entry->common, 0x0, sizeof(struct
|
||||
sn_flush_device_common));
|
||||
|
||||
if (sn_prom_feature_available(
|
||||
PRF_DEVICE_FLUSH_LIST))
|
||||
status = sal_get_device_dmaflush_list(
|
||||
nasid,
|
||||
widget,
|
||||
device,
|
||||
(u64)(dev_entry->common));
|
||||
nasid, widget, device,
|
||||
(u64)(dev_entry->common));
|
||||
else
|
||||
status = sn_device_fixup_war(nasid,
|
||||
widget,
|
||||
device,
|
||||
dev_entry->common);
|
||||
widget, device,
|
||||
dev_entry->common);
|
||||
if (status != SALRET_OK)
|
||||
panic("SAL call failed: %s\n",
|
||||
ia64_sal_strerror(status));
|
||||
|
@ -383,13 +372,12 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
|
|||
|
||||
pci_dev_get(dev); /* for the sysdata pointer */
|
||||
pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
|
||||
if (pcidev_info <= 0)
|
||||
if (!pcidev_info)
|
||||
BUG(); /* Cannot afford to run out of memory */
|
||||
|
||||
sn_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
|
||||
if (sn_irq_info <= 0)
|
||||
sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
|
||||
if (!sn_irq_info)
|
||||
BUG(); /* Cannot afford to run out of memory */
|
||||
memset(sn_irq_info, 0, sizeof(struct sn_irq_info));
|
||||
|
||||
/* Call to retrieve pci device information needed by kernel. */
|
||||
status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number,
|
||||
|
@ -482,13 +470,13 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
|
|||
*/
|
||||
void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
|
||||
{
|
||||
int status = 0;
|
||||
int status;
|
||||
int nasid, cnode;
|
||||
struct pci_controller *controller;
|
||||
struct sn_pci_controller *sn_controller;
|
||||
struct pcibus_bussoft *prom_bussoft_ptr;
|
||||
struct hubdev_info *hubdev_info;
|
||||
void *provider_soft = NULL;
|
||||
void *provider_soft;
|
||||
struct sn_pcibus_provider *provider;
|
||||
|
||||
status = sal_get_pcibus_info((u64) segment, (u64) busnum,
|
||||
|
@ -535,6 +523,8 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
|
|||
bus->sysdata = controller;
|
||||
if (provider->bus_fixup)
|
||||
provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller);
|
||||
else
|
||||
provider_soft = NULL;
|
||||
|
||||
if (provider_soft == NULL) {
|
||||
/* fixup failed or not applicable */
|
||||
|
@ -638,13 +628,8 @@ void sn_bus_free_sysdata(void)
|
|||
|
||||
static int __init sn_pci_init(void)
|
||||
{
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int i, j;
|
||||
struct pci_dev *pci_dev = NULL;
|
||||
extern void sn_init_cpei_timer(void);
|
||||
#ifdef CONFIG_PROC_FS
|
||||
extern void register_sn_procfs(void);
|
||||
#endif
|
||||
|
||||
if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
|
||||
return 0;
|
||||
|
@ -700,32 +685,29 @@ static int __init sn_pci_init(void)
|
|||
*/
|
||||
void hubdev_init_node(nodepda_t * npda, cnodeid_t node)
|
||||
{
|
||||
|
||||
struct hubdev_info *hubdev_info;
|
||||
int size;
|
||||
pg_data_t *pg;
|
||||
|
||||
size = sizeof(struct hubdev_info);
|
||||
|
||||
if (node >= num_online_nodes()) /* Headless/memless IO nodes */
|
||||
hubdev_info =
|
||||
(struct hubdev_info *)alloc_bootmem_node(NODE_DATA(0),
|
||||
sizeof(struct
|
||||
hubdev_info));
|
||||
pg = NODE_DATA(0);
|
||||
else
|
||||
hubdev_info =
|
||||
(struct hubdev_info *)alloc_bootmem_node(NODE_DATA(node),
|
||||
sizeof(struct
|
||||
hubdev_info));
|
||||
npda->pdinfo = (void *)hubdev_info;
|
||||
pg = NODE_DATA(node);
|
||||
|
||||
hubdev_info = (struct hubdev_info *)alloc_bootmem_node(pg, size);
|
||||
|
||||
npda->pdinfo = (void *)hubdev_info;
|
||||
}
|
||||
|
||||
geoid_t
|
||||
cnodeid_get_geoid(cnodeid_t cnode)
|
||||
{
|
||||
|
||||
struct hubdev_info *hubdev;
|
||||
|
||||
hubdev = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
|
||||
return hubdev->hdi_geoid;
|
||||
|
||||
}
|
||||
|
||||
subsys_initcall(sn_pci_init);
|
||||
|
@ -734,3 +716,4 @@ EXPORT_SYMBOL(sn_pci_unfixup_slot);
|
|||
EXPORT_SYMBOL(sn_pci_controller_fixup);
|
||||
EXPORT_SYMBOL(sn_bus_store_sysdata);
|
||||
EXPORT_SYMBOL(sn_bus_free_sysdata);
|
||||
EXPORT_SYMBOL(sn_pcidev_info_get);
|
||||
|
|
|
@ -75,7 +75,7 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
|
|||
DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
|
||||
EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
|
||||
|
||||
DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
|
||||
DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]);
|
||||
EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
|
||||
|
||||
DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
|
||||
|
@ -317,6 +317,7 @@ struct pcdp_vga_device {
|
|||
#define PCDP_PCI_TRANS_IOPORT 0x02
|
||||
#define PCDP_PCI_TRANS_MMIO 0x01
|
||||
|
||||
#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
|
||||
static void
|
||||
sn_scan_pcdp(void)
|
||||
{
|
||||
|
@ -358,6 +359,7 @@ sn_scan_pcdp(void)
|
|||
break; /* once we find the primary, we're done */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned long sn2_rtc_initial;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All Rights Reserved.
|
||||
* Copyright (C) 1999,2001-2004, 2006 Silicon Graphics, Inc. All Rights Reserved.
|
||||
*
|
||||
* Module to export the system's Firmware Interface Tables, including
|
||||
* PROM revision numbers and banners, in /proc
|
||||
|
@ -190,7 +190,7 @@ static int
|
|||
read_version_entry(char *page, char **start, off_t off, int count, int *eof,
|
||||
void *data)
|
||||
{
|
||||
int len = 0;
|
||||
int len;
|
||||
|
||||
/* data holds the NASID of the node */
|
||||
len = dump_version(page, (unsigned long)data);
|
||||
|
@ -202,7 +202,7 @@ static int
|
|||
read_fit_entry(char *page, char **start, off_t off, int count, int *eof,
|
||||
void *data)
|
||||
{
|
||||
int len = 0;
|
||||
int len;
|
||||
|
||||
/* data holds the NASID of the node */
|
||||
len = dump_fit(page, (unsigned long)data);
|
||||
|
@ -229,13 +229,16 @@ int __init prominfo_init(void)
|
|||
struct proc_dir_entry *p;
|
||||
cnodeid_t cnodeid;
|
||||
unsigned long nasid;
|
||||
int size;
|
||||
char name[NODE_NAME_LEN];
|
||||
|
||||
if (!ia64_platform_is("sn2"))
|
||||
return 0;
|
||||
|
||||
proc_entries = kmalloc(num_online_nodes() * sizeof(struct proc_dir_entry *),
|
||||
GFP_KERNEL);
|
||||
size = num_online_nodes() * sizeof(struct proc_dir_entry *);
|
||||
proc_entries = kzalloc(size, GFP_KERNEL);
|
||||
if (!proc_entries)
|
||||
return -ENOMEM;
|
||||
|
||||
sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);
|
||||
|
||||
|
@ -244,14 +247,12 @@ int __init prominfo_init(void)
|
|||
sprintf(name, "node%d", cnodeid);
|
||||
*entp = proc_mkdir(name, sgi_prominfo_entry);
|
||||
nasid = cnodeid_to_nasid(cnodeid);
|
||||
p = create_proc_read_entry(
|
||||
"fit", 0, *entp, read_fit_entry,
|
||||
(void *)nasid);
|
||||
p = create_proc_read_entry("fit", 0, *entp, read_fit_entry,
|
||||
(void *)nasid);
|
||||
if (p)
|
||||
p->owner = THIS_MODULE;
|
||||
p = create_proc_read_entry(
|
||||
"version", 0, *entp, read_version_entry,
|
||||
(void *)nasid);
|
||||
p = create_proc_read_entry("version", 0, *entp,
|
||||
read_version_entry, (void *)nasid);
|
||||
if (p)
|
||||
p->owner = THIS_MODULE;
|
||||
entp++;
|
||||
|
@ -263,7 +264,7 @@ int __init prominfo_init(void)
|
|||
void __exit prominfo_exit(void)
|
||||
{
|
||||
struct proc_dir_entry **entp;
|
||||
unsigned cnodeid;
|
||||
unsigned int cnodeid;
|
||||
char name[NODE_NAME_LEN];
|
||||
|
||||
entp = proc_entries;
|
||||
|
|
|
@ -46,8 +46,14 @@ DECLARE_PER_CPU(struct ptc_stats, ptcstats);
|
|||
|
||||
static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock);
|
||||
|
||||
void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long,
|
||||
volatile unsigned long *, unsigned long);
|
||||
extern unsigned long
|
||||
sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long,
|
||||
volatile unsigned long *, unsigned long,
|
||||
volatile unsigned long *, unsigned long);
|
||||
void
|
||||
sn2_ptc_deadlock_recovery(short *, short, short, int,
|
||||
volatile unsigned long *, unsigned long,
|
||||
volatile unsigned long *, unsigned long);
|
||||
|
||||
/*
|
||||
* Note: some is the following is captured here to make degugging easier
|
||||
|
@ -59,16 +65,6 @@ void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned lon
|
|||
#define reset_max_active_on_deadlock() 1
|
||||
#define PTC_LOCK(sh1) ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock)
|
||||
|
||||
static inline void ptc_lock(int sh1, unsigned long *flagp)
|
||||
{
|
||||
spin_lock_irqsave(PTC_LOCK(sh1), *flagp);
|
||||
}
|
||||
|
||||
static inline void ptc_unlock(int sh1, unsigned long flags)
|
||||
{
|
||||
spin_unlock_irqrestore(PTC_LOCK(sh1), flags);
|
||||
}
|
||||
|
||||
struct ptc_stats {
|
||||
unsigned long ptc_l;
|
||||
unsigned long change_rid;
|
||||
|
@ -82,6 +78,8 @@ struct ptc_stats {
|
|||
unsigned long shub_ptc_flushes_not_my_mm;
|
||||
};
|
||||
|
||||
#define sn2_ptctest 0
|
||||
|
||||
static inline unsigned long wait_piowc(void)
|
||||
{
|
||||
volatile unsigned long *piows;
|
||||
|
@ -200,7 +198,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
|
|||
max_active = max_active_pio(shub1);
|
||||
|
||||
itc = ia64_get_itc();
|
||||
ptc_lock(shub1, &flags);
|
||||
spin_lock_irqsave(PTC_LOCK(shub1), flags);
|
||||
itc2 = ia64_get_itc();
|
||||
|
||||
__get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc;
|
||||
|
@ -258,7 +256,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
|
|||
ia64_srlz_d();
|
||||
}
|
||||
|
||||
ptc_unlock(shub1, flags);
|
||||
spin_unlock_irqrestore(PTC_LOCK(shub1), flags);
|
||||
|
||||
preempt_enable();
|
||||
}
|
||||
|
@ -270,11 +268,12 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
|
|||
* TLB flush transaction. The recovery sequence is somewhat tricky & is
|
||||
* coded in assembly language.
|
||||
*/
|
||||
void sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, volatile unsigned long *ptc0, unsigned long data0,
|
||||
volatile unsigned long *ptc1, unsigned long data1)
|
||||
|
||||
void
|
||||
sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid,
|
||||
volatile unsigned long *ptc0, unsigned long data0,
|
||||
volatile unsigned long *ptc1, unsigned long data1)
|
||||
{
|
||||
extern unsigned long sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long,
|
||||
volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long);
|
||||
short nasid, i;
|
||||
unsigned long *piows, zeroval, n;
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
|
||||
*/
|
||||
#include <linux/config.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/sn/sn_sal.h>
|
||||
|
||||
static int partition_id_show(struct seq_file *s, void *p)
|
||||
|
@ -90,10 +90,10 @@ static int coherence_id_open(struct inode *inode, struct file *file)
|
|||
return single_open(file, coherence_id_show, NULL);
|
||||
}
|
||||
|
||||
static struct proc_dir_entry *sn_procfs_create_entry(
|
||||
const char *name, struct proc_dir_entry *parent,
|
||||
int (*openfunc)(struct inode *, struct file *),
|
||||
int (*releasefunc)(struct inode *, struct file *))
|
||||
static struct proc_dir_entry
|
||||
*sn_procfs_create_entry(const char *name, struct proc_dir_entry *parent,
|
||||
int (*openfunc)(struct inode *, struct file *),
|
||||
int (*releasefunc)(struct inode *, struct file *))
|
||||
{
|
||||
struct proc_dir_entry *e = create_proc_entry(name, 0444, parent);
|
||||
|
||||
|
@ -126,24 +126,24 @@ void register_sn_procfs(void)
|
|||
return;
|
||||
|
||||
sn_procfs_create_entry("partition_id", sgi_proc_dir,
|
||||
partition_id_open, single_release);
|
||||
partition_id_open, single_release);
|
||||
|
||||
sn_procfs_create_entry("system_serial_number", sgi_proc_dir,
|
||||
system_serial_number_open, single_release);
|
||||
system_serial_number_open, single_release);
|
||||
|
||||
sn_procfs_create_entry("licenseID", sgi_proc_dir,
|
||||
licenseID_open, single_release);
|
||||
licenseID_open, single_release);
|
||||
|
||||
e = sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir,
|
||||
sn_force_interrupt_open, single_release);
|
||||
sn_force_interrupt_open, single_release);
|
||||
if (e)
|
||||
e->proc_fops->write = sn_force_interrupt_write_proc;
|
||||
|
||||
sn_procfs_create_entry("coherence_id", sgi_proc_dir,
|
||||
coherence_id_open, single_release);
|
||||
coherence_id_open, single_release);
|
||||
|
||||
sn_procfs_create_entry("sn_topology", sgi_proc_dir,
|
||||
sn_topology_open, sn_topology_release);
|
||||
sn_topology_open, sn_topology_release);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <asm/hw_irq.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/timex.h>
|
||||
|
||||
#include <asm/sn/leds.h>
|
||||
#include <asm/sn/shub_mmr.h>
|
||||
|
@ -28,9 +29,27 @@ static struct time_interpolator sn2_interpolator = {
|
|||
.source = TIME_SOURCE_MMIO64
|
||||
};
|
||||
|
||||
/*
|
||||
* sn udelay uses the RTC instead of the ITC because the ITC is not
|
||||
* synchronized across all CPUs, and the thread may migrate to another CPU
|
||||
* if preemption is enabled.
|
||||
*/
|
||||
static void
|
||||
ia64_sn_udelay (unsigned long usecs)
|
||||
{
|
||||
unsigned long start = rtc_time();
|
||||
unsigned long end = start +
|
||||
usecs * sn_rtc_cycles_per_second / 1000000;
|
||||
|
||||
while (time_before((unsigned long)rtc_time(), end))
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
void __init sn_timer_init(void)
|
||||
{
|
||||
sn2_interpolator.frequency = sn_rtc_cycles_per_second;
|
||||
sn2_interpolator.addr = RTC_COUNTER_ADDR;
|
||||
register_time_interpolator(&sn2_interpolator);
|
||||
|
||||
ia64_udelay = &ia64_sn_udelay;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
|
||||
* Copyright (c) 2005, 2006 Silicon Graphics, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License
|
||||
|
@ -22,11 +22,6 @@
|
|||
* License along with this program; if not, write the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
||||
*
|
||||
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
||||
* Mountain View, CA 94043, or:
|
||||
*
|
||||
* http://www.sgi.com
|
||||
*
|
||||
* For further information regarding this notice, see:
|
||||
*
|
||||
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
|
||||
|
|
|
@ -284,12 +284,10 @@ struct sn_irq_info *tiocx_irq_alloc(nasid_t nasid, int widget, int irq,
|
|||
if ((nasid & 1) == 0)
|
||||
return NULL;
|
||||
|
||||
sn_irq_info = kmalloc(sn_irq_size, GFP_KERNEL);
|
||||
sn_irq_info = kzalloc(sn_irq_size, GFP_KERNEL);
|
||||
if (sn_irq_info == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(sn_irq_info, 0x0, sn_irq_size);
|
||||
|
||||
status = tiocx_intr_alloc(nasid, widget, __pa(sn_irq_info), irq,
|
||||
req_nasid, slice);
|
||||
if (status) {
|
||||
|
|
|
@ -738,7 +738,9 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
|
|||
|
||||
/* make sure all activity has settled down first */
|
||||
|
||||
if (atomic_read(&ch->references) > 0) {
|
||||
if (atomic_read(&ch->references) > 0 ||
|
||||
((ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) &&
|
||||
!(ch->flags & XPC_C_DISCONNECTINGCALLOUT_MADE))) {
|
||||
return;
|
||||
}
|
||||
DBUG_ON(atomic_read(&ch->kthreads_assigned) != 0);
|
||||
|
@ -775,7 +777,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
|
|||
|
||||
/* both sides are disconnected now */
|
||||
|
||||
if (ch->flags & XPC_C_CONNECTCALLOUT) {
|
||||
if (ch->flags & XPC_C_DISCONNECTINGCALLOUT_MADE) {
|
||||
spin_unlock_irqrestore(&ch->lock, *irq_flags);
|
||||
xpc_disconnect_callout(ch, xpcDisconnected);
|
||||
spin_lock_irqsave(&ch->lock, *irq_flags);
|
||||
|
@ -1300,7 +1302,7 @@ xpc_process_msg_IPI(struct xpc_partition *part, int ch_number)
|
|||
"delivered=%d, partid=%d, channel=%d\n",
|
||||
nmsgs_sent, ch->partid, ch->number);
|
||||
|
||||
if (ch->flags & XPC_C_CONNECTCALLOUT) {
|
||||
if (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) {
|
||||
xpc_activate_kthreads(ch, nmsgs_sent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -750,12 +750,16 @@ xpc_daemonize_kthread(void *args)
|
|||
/* let registerer know that connection has been established */
|
||||
|
||||
spin_lock_irqsave(&ch->lock, irq_flags);
|
||||
if (!(ch->flags & XPC_C_CONNECTCALLOUT)) {
|
||||
ch->flags |= XPC_C_CONNECTCALLOUT;
|
||||
if (!(ch->flags & XPC_C_CONNECTEDCALLOUT)) {
|
||||
ch->flags |= XPC_C_CONNECTEDCALLOUT;
|
||||
spin_unlock_irqrestore(&ch->lock, irq_flags);
|
||||
|
||||
xpc_connected_callout(ch);
|
||||
|
||||
spin_lock_irqsave(&ch->lock, irq_flags);
|
||||
ch->flags |= XPC_C_CONNECTEDCALLOUT_MADE;
|
||||
spin_unlock_irqrestore(&ch->lock, irq_flags);
|
||||
|
||||
/*
|
||||
* It is possible that while the callout was being
|
||||
* made that the remote partition sent some messages.
|
||||
|
@ -777,15 +781,17 @@ xpc_daemonize_kthread(void *args)
|
|||
|
||||
if (atomic_dec_return(&ch->kthreads_assigned) == 0) {
|
||||
spin_lock_irqsave(&ch->lock, irq_flags);
|
||||
if ((ch->flags & XPC_C_CONNECTCALLOUT) &&
|
||||
!(ch->flags & XPC_C_DISCONNECTCALLOUT)) {
|
||||
ch->flags |= XPC_C_DISCONNECTCALLOUT;
|
||||
if ((ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) &&
|
||||
!(ch->flags & XPC_C_DISCONNECTINGCALLOUT)) {
|
||||
ch->flags |= XPC_C_DISCONNECTINGCALLOUT;
|
||||
spin_unlock_irqrestore(&ch->lock, irq_flags);
|
||||
|
||||
xpc_disconnect_callout(ch, xpcDisconnecting);
|
||||
} else {
|
||||
spin_unlock_irqrestore(&ch->lock, irq_flags);
|
||||
|
||||
spin_lock_irqsave(&ch->lock, irq_flags);
|
||||
ch->flags |= XPC_C_DISCONNECTINGCALLOUT_MADE;
|
||||
}
|
||||
spin_unlock_irqrestore(&ch->lock, irq_flags);
|
||||
if (atomic_dec_return(&part->nchannels_engaged) == 0) {
|
||||
xpc_mark_partition_disengaged(part);
|
||||
xpc_IPI_send_disengage(part);
|
||||
|
|
|
@ -335,10 +335,10 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
|
|||
*/
|
||||
|
||||
SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
|
||||
pci_domain_nr(bus), bus->number,
|
||||
0, /* io */
|
||||
0, /* read */
|
||||
port, size, __pa(val));
|
||||
pci_domain_nr(bus), bus->number,
|
||||
0, /* io */
|
||||
0, /* read */
|
||||
port, size, __pa(val));
|
||||
|
||||
if (isrv.status == 0)
|
||||
return size;
|
||||
|
@ -381,10 +381,10 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
|
|||
*/
|
||||
|
||||
SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,
|
||||
pci_domain_nr(bus), bus->number,
|
||||
0, /* io */
|
||||
1, /* write */
|
||||
port, size, __pa(&val));
|
||||
pci_domain_nr(bus), bus->number,
|
||||
0, /* io */
|
||||
1, /* write */
|
||||
port, size, __pa(&val));
|
||||
|
||||
if (isrv.status == 0)
|
||||
return size;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved.
|
||||
* Copyright (C) 2001-2006 Silicon Graphics, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
@ -12,7 +12,7 @@
|
|||
#include <asm/sn/pcibus_provider_defs.h>
|
||||
#include <asm/sn/pcidev.h>
|
||||
|
||||
int pcibr_invalidate_ate = 0; /* by default don't invalidate ATE on free */
|
||||
int pcibr_invalidate_ate; /* by default don't invalidate ATE on free */
|
||||
|
||||
/*
|
||||
* mark_ate: Mark the ate as either free or inuse.
|
||||
|
@ -20,14 +20,12 @@ int pcibr_invalidate_ate = 0; /* by default don't invalidate ATE on free */
|
|||
static void mark_ate(struct ate_resource *ate_resource, int start, int number,
|
||||
u64 value)
|
||||
{
|
||||
|
||||
u64 *ate = ate_resource->ate;
|
||||
int index;
|
||||
int length = 0;
|
||||
|
||||
for (index = start; length < number; index++, length++)
|
||||
ate[index] = value;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -37,7 +35,6 @@ static void mark_ate(struct ate_resource *ate_resource, int start, int number,
|
|||
static int find_free_ate(struct ate_resource *ate_resource, int start,
|
||||
int count)
|
||||
{
|
||||
|
||||
u64 *ate = ate_resource->ate;
|
||||
int index;
|
||||
int start_free;
|
||||
|
@ -70,12 +67,10 @@ static int find_free_ate(struct ate_resource *ate_resource, int start,
|
|||
static inline void free_ate_resource(struct ate_resource *ate_resource,
|
||||
int start)
|
||||
{
|
||||
|
||||
mark_ate(ate_resource, start, ate_resource->ate[start], 0);
|
||||
if ((ate_resource->lowest_free_index > start) ||
|
||||
(ate_resource->lowest_free_index < 0))
|
||||
ate_resource->lowest_free_index = start;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -84,7 +79,6 @@ static inline void free_ate_resource(struct ate_resource *ate_resource,
|
|||
static inline int alloc_ate_resource(struct ate_resource *ate_resource,
|
||||
int ate_needed)
|
||||
{
|
||||
|
||||
int start_index;
|
||||
|
||||
/*
|
||||
|
@ -118,19 +112,12 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource,
|
|||
*/
|
||||
int pcibr_ate_alloc(struct pcibus_info *pcibus_info, int count)
|
||||
{
|
||||
int status = 0;
|
||||
u64 flag;
|
||||
int status;
|
||||
unsigned long flags;
|
||||
|
||||
flag = pcibr_lock(pcibus_info);
|
||||
spin_lock_irqsave(&pcibus_info->pbi_lock, flags);
|
||||
status = alloc_ate_resource(&pcibus_info->pbi_int_ate_resource, count);
|
||||
|
||||
if (status < 0) {
|
||||
/* Failed to allocate */
|
||||
pcibr_unlock(pcibus_info, flag);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pcibr_unlock(pcibus_info, flag);
|
||||
spin_unlock_irqrestore(&pcibus_info->pbi_lock, flags);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -182,7 +169,7 @@ void pcibr_ate_free(struct pcibus_info *pcibus_info, int index)
|
|||
ate_write(pcibus_info, index, count, (ate & ~PCI32_ATE_V));
|
||||
}
|
||||
|
||||
flags = pcibr_lock(pcibus_info);
|
||||
spin_lock_irqsave(&pcibus_info->pbi_lock, flags);
|
||||
free_ate_resource(&pcibus_info->pbi_int_ate_resource, index);
|
||||
pcibr_unlock(pcibus_info, flags);
|
||||
spin_unlock_irqrestore(&pcibus_info->pbi_lock, flags);
|
||||
}
|
||||
|
|
|
@ -137,14 +137,12 @@ pcibr_dmatrans_direct64(struct pcidev_info * info, u64 paddr,
|
|||
pci_addr |= PCI64_ATTR_VIRTUAL;
|
||||
|
||||
return pci_addr;
|
||||
|
||||
}
|
||||
|
||||
static dma_addr_t
|
||||
pcibr_dmatrans_direct32(struct pcidev_info * info,
|
||||
u64 paddr, size_t req_size, u64 flags)
|
||||
{
|
||||
|
||||
struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info;
|
||||
struct pcibus_info *pcibus_info = (struct pcibus_info *)pcidev_info->
|
||||
pdi_pcibus_info;
|
||||
|
@ -171,7 +169,6 @@ pcibr_dmatrans_direct32(struct pcidev_info * info,
|
|||
}
|
||||
|
||||
return PCI32_DIRECT_BASE | offset;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -218,9 +215,8 @@ void sn_dma_flush(u64 addr)
|
|||
u64 flags;
|
||||
u64 itte;
|
||||
struct hubdev_info *hubinfo;
|
||||
volatile struct sn_flush_device_kernel *p;
|
||||
volatile struct sn_flush_device_common *common;
|
||||
|
||||
struct sn_flush_device_kernel *p;
|
||||
struct sn_flush_device_common *common;
|
||||
struct sn_flush_nasid_entry *flush_nasid_list;
|
||||
|
||||
if (!sn_ioif_inited)
|
||||
|
@ -310,8 +306,7 @@ void sn_dma_flush(u64 addr)
|
|||
(common->sfdl_slot - 1));
|
||||
}
|
||||
} else {
|
||||
spin_lock_irqsave((spinlock_t *)&p->sfdl_flush_lock,
|
||||
flags);
|
||||
spin_lock_irqsave(&p->sfdl_flush_lock, flags);
|
||||
*common->sfdl_flush_addr = 0;
|
||||
|
||||
/* force an interrupt. */
|
||||
|
@ -322,8 +317,7 @@ void sn_dma_flush(u64 addr)
|
|||
cpu_relax();
|
||||
|
||||
/* okay, everything is synched up. */
|
||||
spin_unlock_irqrestore((spinlock_t *)&p->sfdl_flush_lock,
|
||||
flags);
|
||||
spin_unlock_irqrestore(&p->sfdl_flush_lock, flags);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -163,9 +163,12 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
|
|||
/* Setup the PMU ATE map */
|
||||
soft->pbi_int_ate_resource.lowest_free_index = 0;
|
||||
soft->pbi_int_ate_resource.ate =
|
||||
kmalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
|
||||
memset(soft->pbi_int_ate_resource.ate, 0,
|
||||
(soft->pbi_int_ate_size * sizeof(u64)));
|
||||
kzalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
|
||||
|
||||
if (!soft->pbi_int_ate_resource.ate) {
|
||||
kfree(soft);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
|
||||
/* TIO PCI Bridge: find nearest node with CPUs */
|
||||
|
|
|
@ -80,6 +80,10 @@ config HOTPLUG_CPU
|
|||
can be controlled through /sys/devices/system/cpu/cpu#.
|
||||
Say N if you want to disable CPU hotplug.
|
||||
|
||||
config DEFAULT_MIGRATION_COST
|
||||
int
|
||||
default "1000000"
|
||||
|
||||
config MATHEMU
|
||||
bool "IEEE FPU emulation"
|
||||
depends on MARCH_G5
|
||||
|
|
|
@ -905,8 +905,8 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
|
|||
return ret;
|
||||
}
|
||||
|
||||
asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
|
||||
struct stat64_emu31 __user* statbuf, int flag)
|
||||
asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename,
|
||||
struct stat64_emu31 __user* statbuf, int flag)
|
||||
{
|
||||
struct kstat stat;
|
||||
int error = -EINVAL;
|
||||
|
|
|
@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
|
|||
llgtr %r4,%r4 # struct timeval *
|
||||
jg compat_sys_futimesat
|
||||
|
||||
.globl sys32_fstatat_wrapper
|
||||
sys32_fstatat_wrapper:
|
||||
.globl sys32_fstatat64_wrapper
|
||||
sys32_fstatat64_wrapper:
|
||||
llgfr %r2,%r2 # unsigned int
|
||||
llgtr %r3,%r3 # char *
|
||||
llgtr %r4,%r4 # struct stat64 *
|
||||
lgfr %r5,%r5 # int
|
||||
jg sys32_fstatat
|
||||
jg sys32_fstatat64
|
||||
|
||||
.globl sys_unlinkat_wrapper
|
||||
sys_unlinkat_wrapper:
|
||||
|
|
|
@ -128,8 +128,10 @@ void default_idle(void)
|
|||
__ctl_set_bit(8, 15);
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
if (cpu_is_offline(cpu))
|
||||
if (cpu_is_offline(cpu)) {
|
||||
preempt_enable_no_resched();
|
||||
cpu_die();
|
||||
}
|
||||
#endif
|
||||
|
||||
local_mcck_disable();
|
||||
|
|
|
@ -600,6 +600,7 @@ setup_arch(char **cmdline_p)
|
|||
init_mm.brk = (unsigned long) &_end;
|
||||
|
||||
parse_cmdline_early(cmdline_p);
|
||||
parse_early_param();
|
||||
|
||||
setup_memory();
|
||||
setup_resources();
|
||||
|
@ -607,6 +608,7 @@ setup_arch(char **cmdline_p)
|
|||
|
||||
cpu_init();
|
||||
__cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr;
|
||||
smp_setup_cpu_possible_map();
|
||||
|
||||
/*
|
||||
* Create kernel page tables and switch to virtual addressing.
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/*
|
||||
* arch/s390/kernel/smp.c
|
||||
*
|
||||
* S390 version
|
||||
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
|
||||
* Copyright (C) IBM Corp. 1999,2006
|
||||
* Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
|
||||
* Martin Schwidefsky (schwidefsky@de.ibm.com)
|
||||
* Heiko Carstens (heiko.carstens@de.ibm.com)
|
||||
|
@ -41,8 +40,6 @@
|
|||
#include <asm/cpcmd.h>
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
/* prototypes */
|
||||
|
||||
extern volatile int __cpu_logical_map[];
|
||||
|
||||
/*
|
||||
|
@ -51,13 +48,11 @@ extern volatile int __cpu_logical_map[];
|
|||
|
||||
struct _lowcore *lowcore_ptr[NR_CPUS];
|
||||
|
||||
cpumask_t cpu_online_map;
|
||||
cpumask_t cpu_possible_map = CPU_MASK_ALL;
|
||||
cpumask_t cpu_online_map = CPU_MASK_NONE;
|
||||
cpumask_t cpu_possible_map = CPU_MASK_NONE;
|
||||
|
||||
static struct task_struct *current_set[NR_CPUS];
|
||||
|
||||
EXPORT_SYMBOL(cpu_online_map);
|
||||
|
||||
/*
|
||||
* Reboot, halt and power_off routines for SMP.
|
||||
*/
|
||||
|
@ -490,10 +485,10 @@ void smp_ctl_clear_bit(int cr, int bit) {
|
|||
* Lets check how many CPUs we have.
|
||||
*/
|
||||
|
||||
void
|
||||
__init smp_check_cpus(unsigned int max_cpus)
|
||||
static unsigned int
|
||||
__init smp_count_cpus(void)
|
||||
{
|
||||
int cpu, num_cpus;
|
||||
unsigned int cpu, num_cpus;
|
||||
__u16 boot_cpu_addr;
|
||||
|
||||
/*
|
||||
|
@ -503,19 +498,20 @@ __init smp_check_cpus(unsigned int max_cpus)
|
|||
boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr;
|
||||
current_thread_info()->cpu = 0;
|
||||
num_cpus = 1;
|
||||
for (cpu = 0; cpu <= 65535 && num_cpus < max_cpus; cpu++) {
|
||||
for (cpu = 0; cpu <= 65535; cpu++) {
|
||||
if ((__u16) cpu == boot_cpu_addr)
|
||||
continue;
|
||||
__cpu_logical_map[num_cpus] = (__u16) cpu;
|
||||
if (signal_processor(num_cpus, sigp_sense) ==
|
||||
__cpu_logical_map[1] = (__u16) cpu;
|
||||
if (signal_processor(1, sigp_sense) ==
|
||||
sigp_not_operational)
|
||||
continue;
|
||||
cpu_set(num_cpus, cpu_present_map);
|
||||
num_cpus++;
|
||||
}
|
||||
|
||||
printk("Detected %d CPU's\n",(int) num_cpus);
|
||||
printk("Boot cpu address %2X\n", boot_cpu_addr);
|
||||
|
||||
return num_cpus;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -676,6 +672,44 @@ __cpu_up(unsigned int cpu)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int __initdata additional_cpus;
|
||||
static unsigned int __initdata possible_cpus;
|
||||
|
||||
void __init smp_setup_cpu_possible_map(void)
|
||||
{
|
||||
unsigned int phy_cpus, pos_cpus, cpu;
|
||||
|
||||
phy_cpus = smp_count_cpus();
|
||||
pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS);
|
||||
|
||||
if (possible_cpus)
|
||||
pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS);
|
||||
|
||||
for (cpu = 0; cpu < pos_cpus; cpu++)
|
||||
cpu_set(cpu, cpu_possible_map);
|
||||
|
||||
phy_cpus = min(phy_cpus, pos_cpus);
|
||||
|
||||
for (cpu = 0; cpu < phy_cpus; cpu++)
|
||||
cpu_set(cpu, cpu_present_map);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
static int __init setup_additional_cpus(char *s)
|
||||
{
|
||||
additional_cpus = simple_strtoul(s, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
early_param("additional_cpus", setup_additional_cpus);
|
||||
|
||||
static int __init setup_possible_cpus(char *s)
|
||||
{
|
||||
possible_cpus = simple_strtoul(s, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
early_param("possible_cpus", setup_possible_cpus);
|
||||
|
||||
int
|
||||
__cpu_disable(void)
|
||||
{
|
||||
|
@ -744,6 +778,8 @@ cpu_die(void)
|
|||
for(;;);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
/*
|
||||
* Cycle through the processors and setup structures.
|
||||
*/
|
||||
|
@ -757,7 +793,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
|||
/* request the 0x1201 emergency signal external interrupt */
|
||||
if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
|
||||
panic("Couldn't request external interrupt 0x1201");
|
||||
smp_check_cpus(max_cpus);
|
||||
memset(lowcore_ptr,0,sizeof(lowcore_ptr));
|
||||
/*
|
||||
* Initialize prefix pages and stacks for all possible cpus
|
||||
|
@ -806,7 +841,6 @@ void __devinit smp_prepare_boot_cpu(void)
|
|||
BUG_ON(smp_processor_id() != 0);
|
||||
|
||||
cpu_set(0, cpu_online_map);
|
||||
cpu_set(0, cpu_present_map);
|
||||
S390_lowcore.percpu_offset = __per_cpu_offset[0];
|
||||
current_set[0] = current;
|
||||
}
|
||||
|
@ -845,6 +879,7 @@ static int __init topology_init(void)
|
|||
|
||||
subsys_initcall(topology_init);
|
||||
|
||||
EXPORT_SYMBOL(cpu_online_map);
|
||||
EXPORT_SYMBOL(cpu_possible_map);
|
||||
EXPORT_SYMBOL(lowcore_ptr);
|
||||
EXPORT_SYMBOL(smp_ctl_set_bit);
|
||||
|
|
|
@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
|
|||
SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */
|
||||
SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
|
||||
SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
|
||||
SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
|
||||
SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat64_wrapper)
|
||||
SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
|
||||
SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */
|
||||
SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
|
||||
|
|
|
@ -446,7 +446,7 @@ endmenu
|
|||
|
||||
config ISA_DMA_API
|
||||
bool
|
||||
depends on MPC1211
|
||||
depends on SH_MPC1211
|
||||
default y
|
||||
|
||||
menu "Kernel features"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.16-rc1-git2
|
||||
# Thu Jan 19 10:05:21 2006
|
||||
# Linux kernel version: 2.6.16-rc3
|
||||
# Mon Feb 13 22:31:24 2006
|
||||
#
|
||||
CONFIG_X86_64=y
|
||||
CONFIG_64BIT=y
|
||||
|
@ -21,7 +21,6 @@ CONFIG_DMI=y
|
|||
# Code maturity level options
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_CLEAN_COMPILE=y
|
||||
CONFIG_LOCK_KERNEL=y
|
||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||
|
||||
|
@ -267,6 +266,7 @@ CONFIG_NET=y
|
|||
#
|
||||
# Networking options
|
||||
#
|
||||
# CONFIG_NETDEBUG is not set
|
||||
CONFIG_PACKET=y
|
||||
# CONFIG_PACKET_MMAP is not set
|
||||
CONFIG_UNIX=y
|
||||
|
@ -446,7 +446,6 @@ CONFIG_BLK_DEV_PIIX=y
|
|||
# CONFIG_BLK_DEV_NS87415 is not set
|
||||
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
|
||||
CONFIG_BLK_DEV_PDC202XX_NEW=y
|
||||
# CONFIG_PDC202XX_FORCE is not set
|
||||
# CONFIG_BLK_DEV_SVWKS is not set
|
||||
# CONFIG_BLK_DEV_SIIMAGE is not set
|
||||
# CONFIG_BLK_DEV_SIS5513 is not set
|
||||
|
@ -573,7 +572,33 @@ CONFIG_FUSION_MAX_SGE=128
|
|||
#
|
||||
# IEEE 1394 (FireWire) support
|
||||
#
|
||||
# CONFIG_IEEE1394 is not set
|
||||
CONFIG_IEEE1394=y
|
||||
|
||||
#
|
||||
# Subsystem Options
|
||||
#
|
||||
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
|
||||
# CONFIG_IEEE1394_OUI_DB is not set
|
||||
# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
|
||||
# CONFIG_IEEE1394_EXPORT_FULL_API is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Texas Instruments PCILynx requires I2C
|
||||
#
|
||||
CONFIG_IEEE1394_OHCI1394=y
|
||||
|
||||
#
|
||||
# Protocol Drivers
|
||||
#
|
||||
# CONFIG_IEEE1394_VIDEO1394 is not set
|
||||
# CONFIG_IEEE1394_SBP2 is not set
|
||||
# CONFIG_IEEE1394_ETH1394 is not set
|
||||
# CONFIG_IEEE1394_DV1394 is not set
|
||||
CONFIG_IEEE1394_RAWIO=y
|
||||
|
||||
#
|
||||
# I2O device support
|
||||
|
@ -772,6 +797,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
|
|||
#
|
||||
CONFIG_SERIAL_CORE=y
|
||||
CONFIG_SERIAL_CORE_CONSOLE=y
|
||||
# CONFIG_SERIAL_JSM is not set
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
CONFIG_LEGACY_PTYS=y
|
||||
CONFIG_LEGACY_PTY_COUNT=256
|
||||
|
@ -871,6 +897,7 @@ CONFIG_HPET_MMAP=y
|
|||
#
|
||||
CONFIG_HWMON=y
|
||||
# CONFIG_HWMON_VID is not set
|
||||
# CONFIG_SENSORS_F71805F is not set
|
||||
# CONFIG_SENSORS_HDAPS is not set
|
||||
# CONFIG_HWMON_DEBUG_CHIP is not set
|
||||
|
||||
|
@ -1101,7 +1128,6 @@ CONFIG_USB_MON=y
|
|||
# EDAC - error detection and reporting (RAS)
|
||||
#
|
||||
# CONFIG_EDAC is not set
|
||||
# CONFIG_EDAC_POLL is not set
|
||||
|
||||
#
|
||||
# Firmware Drivers
|
||||
|
@ -1291,14 +1317,12 @@ CONFIG_DETECT_SOFTLOCKUP=y
|
|||
# CONFIG_DEBUG_SPINLOCK is not set
|
||||
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
|
||||
# CONFIG_DEBUG_KOBJECT is not set
|
||||
# CONFIG_DEBUG_INFO is not set
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
# CONFIG_DEBUG_VM is not set
|
||||
# CONFIG_FRAME_POINTER is not set
|
||||
# CONFIG_FORCED_INLINING is not set
|
||||
# CONFIG_UNWIND_INFO is not set
|
||||
# CONFIG_RCU_TORTURE_TEST is not set
|
||||
CONFIG_INIT_DEBUG=y
|
||||
# CONFIG_DEBUG_RODATA is not set
|
||||
# CONFIG_IOMMU_DEBUG is not set
|
||||
|
||||
|
|
|
@ -1152,6 +1152,7 @@ __setup("noapicmaintimer", setup_noapicmaintimer);
|
|||
static __init int setup_apicpmtimer(char *s)
|
||||
{
|
||||
apic_calibrate_pmtmr = 1;
|
||||
notsc_setup(NULL);
|
||||
return setup_apicmaintimer(NULL);
|
||||
}
|
||||
__setup("apicpmtimer", setup_apicpmtimer);
|
||||
|
|
|
@ -554,6 +554,7 @@ iret_label:
|
|||
/* running with kernel gs */
|
||||
bad_iret:
|
||||
movq $-9999,%rdi /* better code? */
|
||||
sti
|
||||
jmp do_exit
|
||||
.previous
|
||||
|
||||
|
|
|
@ -213,6 +213,11 @@ ENTRY(early_idt_handler)
|
|||
cmpl $2,early_recursion_flag(%rip)
|
||||
jz 1f
|
||||
call dump_stack
|
||||
#ifdef CONFIG_KALLSYMS
|
||||
leaq early_idt_ripmsg(%rip),%rdi
|
||||
movq 8(%rsp),%rsi # get rip again
|
||||
call __print_symbol
|
||||
#endif
|
||||
1: hlt
|
||||
jmp 1b
|
||||
early_recursion_flag:
|
||||
|
@ -220,6 +225,8 @@ early_recursion_flag:
|
|||
|
||||
early_idt_msg:
|
||||
.asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"
|
||||
early_idt_ripmsg:
|
||||
.asciz "RIP %s\n"
|
||||
|
||||
.code32
|
||||
ENTRY(no_long_mode)
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include <linux/mc146818rtc.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/sysdev.h>
|
||||
#ifdef CONFIG_ACPI
|
||||
#include <acpi/acpi_bus.h>
|
||||
#endif
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/smp.h>
|
||||
|
@ -260,6 +263,8 @@ __setup("apic", enable_ioapic_setup);
|
|||
|
||||
And another hack to disable the IOMMU on VIA chipsets.
|
||||
|
||||
... and others. Really should move this somewhere else.
|
||||
|
||||
Kludge-O-Rama. */
|
||||
void __init check_ioapic(void)
|
||||
{
|
||||
|
@ -307,6 +312,17 @@ void __init check_ioapic(void)
|
|||
case PCI_VENDOR_ID_ATI:
|
||||
if (apic_runs_main_timer != 0)
|
||||
break;
|
||||
#ifdef CONFIG_ACPI
|
||||
/* Don't do this for laptops right
|
||||
right now because their timer
|
||||
doesn't necessarily tick in C2/3 */
|
||||
if (acpi_fadt.revision >= 3 &&
|
||||
(acpi_fadt.plvl2_lat + acpi_fadt.plvl3_lat) < 1100) {
|
||||
printk(KERN_INFO
|
||||
"ATI board detected, but seems to be a laptop. Timer might be shakey, sorry\n");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
printk(KERN_INFO
|
||||
"ATI board detected. Using APIC/PM timer.\n");
|
||||
apic_runs_main_timer = 1;
|
||||
|
|
|
@ -288,9 +288,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
|
|||
|
||||
memcpy(str,mpc->mpc_productid,12);
|
||||
str[12]=0;
|
||||
printk(KERN_INFO "Product ID: %s ",str);
|
||||
printk("Product ID: %s ",str);
|
||||
|
||||
printk(KERN_INFO "APIC at: 0x%X\n",mpc->mpc_lapic);
|
||||
printk("APIC at: 0x%X\n",mpc->mpc_lapic);
|
||||
|
||||
/* save the local APIC address, it might be non-default */
|
||||
if (!acpi_lapic)
|
||||
|
|
|
@ -236,6 +236,7 @@ static void enable_lapic_nmi_watchdog(void)
|
|||
{
|
||||
if (nmi_active < 0) {
|
||||
nmi_watchdog = NMI_LOCAL_APIC;
|
||||
touch_nmi_watchdog();
|
||||
setup_apic_nmi_watchdog();
|
||||
}
|
||||
}
|
||||
|
@ -456,15 +457,17 @@ static DEFINE_PER_CPU(int, nmi_touch);
|
|||
|
||||
void touch_nmi_watchdog (void)
|
||||
{
|
||||
int i;
|
||||
if (nmi_watchdog > 0) {
|
||||
unsigned cpu;
|
||||
|
||||
/*
|
||||
* Tell other CPUs to reset their alert counters. We cannot
|
||||
* do it ourselves because the alert count increase is not
|
||||
* atomic.
|
||||
*/
|
||||
for (i = 0; i < NR_CPUS; i++)
|
||||
per_cpu(nmi_touch, i) = 1;
|
||||
/*
|
||||
* Tell other CPUs to reset their alert counters. We cannot
|
||||
* do it ourselves because the alert count increase is not
|
||||
* atomic.
|
||||
*/
|
||||
for_each_present_cpu (cpu)
|
||||
per_cpu(nmi_touch, cpu) = 1;
|
||||
}
|
||||
|
||||
touch_softlockup_watchdog();
|
||||
}
|
||||
|
|
|
@ -1327,8 +1327,7 @@ static int __init nohpet_setup(char *s)
|
|||
|
||||
__setup("nohpet", nohpet_setup);
|
||||
|
||||
|
||||
static int __init notsc_setup(char *s)
|
||||
int __init notsc_setup(char *s)
|
||||
{
|
||||
notsc = 1;
|
||||
return 0;
|
||||
|
|
|
@ -155,7 +155,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
|
|||
if (!found)
|
||||
return -1;
|
||||
|
||||
memnode_shift = compute_hash_shift(nodes, numnodes);
|
||||
memnode_shift = compute_hash_shift(nodes, 8);
|
||||
if (memnode_shift < 0) {
|
||||
printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n");
|
||||
return -1;
|
||||
|
|
|
@ -351,7 +351,7 @@ void __init init_cpu_to_node(void)
|
|||
continue;
|
||||
if (apicid_to_node[apicid] == NUMA_NO_NODE)
|
||||
continue;
|
||||
cpu_to_node[i] = apicid_to_node[apicid];
|
||||
numa_set_node(i,apicid_to_node[apicid]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -228,7 +228,8 @@ static int nodes_cover_memory(void)
|
|||
}
|
||||
|
||||
e820ram = end_pfn - e820_hole_size(0, end_pfn);
|
||||
if (pxmram < e820ram) {
|
||||
/* We seem to lose 3 pages somewhere. Allow a bit of slack. */
|
||||
if ((long)(e820ram - pxmram) >= 1*1024*1024) {
|
||||
printk(KERN_ERR
|
||||
"SRAT: PXMs only cover %luMB of your %luMB e820 RAM. Not used.\n",
|
||||
(pxmram << PAGE_SHIFT) >> 20,
|
||||
|
@ -270,7 +271,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
|
|||
return -1;
|
||||
}
|
||||
|
||||
memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed));
|
||||
memnode_shift = compute_hash_shift(nodes, MAX_NUMNODES);
|
||||
if (memnode_shift < 0) {
|
||||
printk(KERN_ERR
|
||||
"SRAT: No NUMA node hash function found. Contact maintainer\n");
|
||||
|
|
|
@ -391,8 +391,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
|
|||
* Ensure a 32-bit boundary for the structure
|
||||
*/
|
||||
extra_struct_bytes =
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length) -
|
||||
resource_length;
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length);
|
||||
break;
|
||||
|
||||
case ACPI_RESOURCE_NAME_END_TAG:
|
||||
|
@ -408,8 +407,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
|
|||
* Add vendor data and ensure a 32-bit boundary for the structure
|
||||
*/
|
||||
extra_struct_bytes =
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length) -
|
||||
resource_length;
|
||||
ACPI_ROUND_UP_to_32_bITS(resource_length);
|
||||
break;
|
||||
|
||||
case ACPI_RESOURCE_NAME_ADDRESS32:
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
static int TPM_INF_DATA;
|
||||
static int TPM_INF_ADDR;
|
||||
static int TPM_INF_BASE;
|
||||
static int TPM_INF_ADDR_LEN;
|
||||
static int TPM_INF_PORT_LEN;
|
||||
|
||||
/* TPM header definitions */
|
||||
|
@ -195,6 +196,7 @@ static int tpm_inf_recv(struct tpm_chip *chip, u8 * buf, size_t count)
|
|||
int i;
|
||||
int ret;
|
||||
u32 size = 0;
|
||||
number_of_wtx = 0;
|
||||
|
||||
recv_begin:
|
||||
/* start receiving header */
|
||||
|
@ -378,24 +380,35 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
|
|||
if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) &&
|
||||
!(pnp_port_flags(dev, 0) & IORESOURCE_DISABLED)) {
|
||||
TPM_INF_ADDR = pnp_port_start(dev, 0);
|
||||
TPM_INF_ADDR_LEN = pnp_port_len(dev, 0);
|
||||
TPM_INF_DATA = (TPM_INF_ADDR + 1);
|
||||
TPM_INF_BASE = pnp_port_start(dev, 1);
|
||||
TPM_INF_PORT_LEN = pnp_port_len(dev, 1);
|
||||
if (!TPM_INF_PORT_LEN)
|
||||
return -EINVAL;
|
||||
if ((TPM_INF_PORT_LEN < 4) || (TPM_INF_ADDR_LEN < 2)) {
|
||||
rc = -EINVAL;
|
||||
goto err_last;
|
||||
}
|
||||
dev_info(&dev->dev, "Found %s with ID %s\n",
|
||||
dev->name, dev_id->id);
|
||||
if (!((TPM_INF_BASE >> 8) & 0xff))
|
||||
return -EINVAL;
|
||||
if (!((TPM_INF_BASE >> 8) & 0xff)) {
|
||||
rc = -EINVAL;
|
||||
goto err_last;
|
||||
}
|
||||
/* publish my base address and request region */
|
||||
tpm_inf.base = TPM_INF_BASE;
|
||||
if (request_region
|
||||
(tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {
|
||||
release_region(tpm_inf.base, TPM_INF_PORT_LEN);
|
||||
return -EINVAL;
|
||||
rc = -EINVAL;
|
||||
goto err_last;
|
||||
}
|
||||
if (request_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN,
|
||||
"tpm_infineon0") == NULL) {
|
||||
rc = -EINVAL;
|
||||
goto err_last;
|
||||
}
|
||||
} else {
|
||||
return -EINVAL;
|
||||
rc = -EINVAL;
|
||||
goto err_last;
|
||||
}
|
||||
|
||||
/* query chip for its vendor, its version number a.s.o. */
|
||||
|
@ -443,8 +456,8 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
|
|||
dev_err(&dev->dev,
|
||||
"Could not set IO-ports to 0x%lx\n",
|
||||
tpm_inf.base);
|
||||
release_region(tpm_inf.base, TPM_INF_PORT_LEN);
|
||||
return -EIO;
|
||||
rc = -EIO;
|
||||
goto err_release_region;
|
||||
}
|
||||
|
||||
/* activate register */
|
||||
|
@ -471,14 +484,21 @@ static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
|
|||
|
||||
rc = tpm_register_hardware(&dev->dev, &tpm_inf);
|
||||
if (rc < 0) {
|
||||
release_region(tpm_inf.base, TPM_INF_PORT_LEN);
|
||||
return -ENODEV;
|
||||
rc = -ENODEV;
|
||||
goto err_release_region;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
dev_info(&dev->dev, "No Infineon TPM found!\n");
|
||||
return -ENODEV;
|
||||
rc = -ENODEV;
|
||||
goto err_release_region;
|
||||
}
|
||||
|
||||
err_release_region:
|
||||
release_region(tpm_inf.base, TPM_INF_PORT_LEN);
|
||||
release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
|
||||
|
||||
err_last:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static __devexit void tpm_inf_pnp_remove(struct pnp_dev *dev)
|
||||
|
@ -518,5 +538,5 @@ module_exit(cleanup_inf);
|
|||
|
||||
MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");
|
||||
MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");
|
||||
MODULE_VERSION("1.6");
|
||||
MODULE_VERSION("1.7");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/errno.h>
|
||||
|
@ -314,6 +315,8 @@ static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
|
|||
if (rq->bio) /* fs request */
|
||||
rq->errors = 0;
|
||||
|
||||
touch_softlockup_watchdog();
|
||||
|
||||
switch (drive->hwif->data_phase) {
|
||||
case TASKFILE_MULTI_IN:
|
||||
case TASKFILE_MULTI_OUT:
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
* License along with this program; if not, write the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
||||
*
|
||||
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
||||
* Mountain View, CA 94043, or:
|
||||
*
|
||||
* http://www.sgi.com
|
||||
*
|
||||
* For further information regarding this notice, see:
|
||||
*
|
||||
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
|
||||
|
|
|
@ -11,7 +11,6 @@ obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
|
|||
obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
|
||||
obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o
|
||||
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
|
||||
obj-$(CONFIG_KEYBOARD_98KBD) += 98kbd.o
|
||||
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
|
||||
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
|
||||
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
|
||||
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
|
||||
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
|
||||
obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o
|
||||
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
|
||||
obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
|
||||
obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/input.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <asm/hardware.h>
|
||||
|
||||
MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
|
||||
|
|
|
@ -232,6 +232,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
|
|||
{ 88, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
||||
{ 96, 0, 0 },
|
||||
{ 97, PS2PP_KIND_TP3, PS2PP_WHEEL | PS2PP_HWHEEL },
|
||||
{ 99, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
|
||||
{ 100, PS2PP_KIND_MX, /* MX510 */
|
||||
PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
|
||||
PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
|
||||
|
|
|
@ -68,15 +68,19 @@ struct trackpoint_attr_data {
|
|||
size_t field_offset;
|
||||
unsigned char command;
|
||||
unsigned char mask;
|
||||
unsigned char inverted;
|
||||
};
|
||||
|
||||
static ssize_t trackpoint_show_int_attr(struct psmouse *psmouse, void *data, char *buf)
|
||||
{
|
||||
struct trackpoint_data *tp = psmouse->private;
|
||||
struct trackpoint_attr_data *attr = data;
|
||||
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
|
||||
unsigned char value = *(unsigned char *)((char *)tp + attr->field_offset);
|
||||
|
||||
return sprintf(buf, "%u\n", *field);
|
||||
if (attr->inverted)
|
||||
value = !value;
|
||||
|
||||
return sprintf(buf, "%u\n", value);
|
||||
}
|
||||
|
||||
static ssize_t trackpoint_set_int_attr(struct psmouse *psmouse, void *data,
|
||||
|
@ -120,6 +124,9 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
|
|||
if (*rest || value > 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (attr->inverted)
|
||||
value = !value;
|
||||
|
||||
if (*field != value) {
|
||||
*field = value;
|
||||
trackpoint_toggle_bit(&psmouse->ps2dev, attr->command, attr->mask);
|
||||
|
@ -129,11 +136,12 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
|
|||
}
|
||||
|
||||
|
||||
#define TRACKPOINT_BIT_ATTR(_name, _command, _mask) \
|
||||
#define TRACKPOINT_BIT_ATTR(_name, _command, _mask, _inv) \
|
||||
static struct trackpoint_attr_data trackpoint_attr_##_name = { \
|
||||
.field_offset = offsetof(struct trackpoint_data, _name), \
|
||||
.command = _command, \
|
||||
.mask = _mask, \
|
||||
.inverted = _inv, \
|
||||
}; \
|
||||
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
|
||||
&trackpoint_attr_##_name, \
|
||||
|
@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
|
|||
TRACKPOINT_INT_ATTR(ztime, TP_Z_TIME);
|
||||
TRACKPOINT_INT_ATTR(jenks, TP_JENKS_CURV);
|
||||
|
||||
TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON);
|
||||
TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK);
|
||||
TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV);
|
||||
TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON, 0);
|
||||
TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK, 0);
|
||||
TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV, 1);
|
||||
|
||||
static struct attribute *trackpoint_attrs[] = {
|
||||
&psmouse_attr_sensitivity.dattr.attr,
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
#define TP_TOGGLE_MB 0x23 /* Disable/Enable Middle Button */
|
||||
#define TP_MASK_MB 0x01
|
||||
#define TP_TOGGLE_EXT_DEV 0x23 /* Toggle external device */
|
||||
#define TP_TOGGLE_EXT_DEV 0x23 /* Disable external device */
|
||||
#define TP_MASK_EXT_DEV 0x02
|
||||
#define TP_TOGGLE_DRIFT 0x23 /* Drift Correction */
|
||||
#define TP_MASK_DRIFT 0x80
|
||||
|
@ -125,7 +125,7 @@
|
|||
#define TP_DEF_MB 0x00
|
||||
#define TP_DEF_PTSON 0x00
|
||||
#define TP_DEF_SKIPBACK 0x00
|
||||
#define TP_DEF_EXT_DEV 0x01
|
||||
#define TP_DEF_EXT_DEV 0x00 /* 0 means enabled */
|
||||
|
||||
#define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ obj-$(CONFIG_SERIO_RPCKBD) += rpckbd.o
|
|||
obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o
|
||||
obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o
|
||||
obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o
|
||||
obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o
|
||||
obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o
|
||||
obj-$(CONFIG_HP_SDC) += hp_sdc.o
|
||||
obj-$(CONFIG_HIL_MLC) += hp_sdc_mlc.o hil_mlc.o
|
||||
|
|
|
@ -48,10 +48,13 @@
|
|||
|
||||
#define TS_POLL_PERIOD msecs_to_jiffies(10)
|
||||
|
||||
/* this driver doesn't aim at the peak continuous sample rate */
|
||||
#define SAMPLE_BITS (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */)
|
||||
|
||||
struct ts_event {
|
||||
/* For portability, we can't read 12 bit values using SPI (which
|
||||
* would make the controller deliver them as native byteorder u16
|
||||
* with msbs zeroed). Instead, we read them as two 8-byte values,
|
||||
* with msbs zeroed). Instead, we read them as two 8-bit values,
|
||||
* which need byteswapping then range adjustment.
|
||||
*/
|
||||
__be16 x;
|
||||
|
@ -60,7 +63,7 @@ struct ts_event {
|
|||
};
|
||||
|
||||
struct ads7846 {
|
||||
struct input_dev input;
|
||||
struct input_dev *input;
|
||||
char phys[32];
|
||||
|
||||
struct spi_device *spi;
|
||||
|
@ -68,6 +71,7 @@ struct ads7846 {
|
|||
u16 vref_delay_usecs;
|
||||
u16 x_plate_ohms;
|
||||
|
||||
u8 read_x, read_y, read_z1, read_z2;
|
||||
struct ts_event tc;
|
||||
|
||||
struct spi_transfer xfer[8];
|
||||
|
@ -117,10 +121,10 @@ struct ads7846 {
|
|||
#define READ_12BIT_DFR(x) (ADS_START | ADS_A2A1A0_d_ ## x \
|
||||
| ADS_12_BIT | ADS_DFR)
|
||||
|
||||
static const u8 read_y = READ_12BIT_DFR(y) | ADS_PD10_ADC_ON;
|
||||
static const u8 read_z1 = READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON;
|
||||
static const u8 read_z2 = READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON;
|
||||
static const u8 read_x = READ_12BIT_DFR(x) | ADS_PD10_PDOWN; /* LAST */
|
||||
#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON)
|
||||
#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
|
||||
#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
|
||||
#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_PDOWN) /* LAST */
|
||||
|
||||
/* single-ended samples need to first power up reference voltage;
|
||||
* we leave both ADC and VREF powered
|
||||
|
@ -128,8 +132,8 @@ static const u8 read_x = READ_12BIT_DFR(x) | ADS_PD10_PDOWN; /* LAST */
|
|||
#define READ_12BIT_SER(x) (ADS_START | ADS_A2A1A0_ ## x \
|
||||
| ADS_12_BIT | ADS_SER)
|
||||
|
||||
static const u8 ref_on = READ_12BIT_DFR(x) | ADS_PD10_ALL_ON;
|
||||
static const u8 ref_off = READ_12BIT_DFR(y) | ADS_PD10_PDOWN;
|
||||
#define REF_ON (READ_12BIT_DFR(x) | ADS_PD10_ALL_ON)
|
||||
#define REF_OFF (READ_12BIT_DFR(y) | ADS_PD10_PDOWN)
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -138,7 +142,9 @@ static const u8 ref_off = READ_12BIT_DFR(y) | ADS_PD10_PDOWN;
|
|||
*/
|
||||
|
||||
struct ser_req {
|
||||
u8 ref_on;
|
||||
u8 command;
|
||||
u8 ref_off;
|
||||
u16 scratch;
|
||||
__be16 sample;
|
||||
struct spi_message msg;
|
||||
|
@ -152,7 +158,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
|
|||
struct ser_req *req = kzalloc(sizeof *req, SLAB_KERNEL);
|
||||
int status;
|
||||
int sample;
|
||||
int i;
|
||||
int i;
|
||||
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
@ -160,7 +166,8 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
|
|||
INIT_LIST_HEAD(&req->msg.transfers);
|
||||
|
||||
/* activate reference, so it has time to settle; */
|
||||
req->xfer[0].tx_buf = &ref_on;
|
||||
req->ref_on = REF_ON;
|
||||
req->xfer[0].tx_buf = &req->ref_on;
|
||||
req->xfer[0].len = 1;
|
||||
req->xfer[1].rx_buf = &req->scratch;
|
||||
req->xfer[1].len = 2;
|
||||
|
@ -182,7 +189,8 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
|
|||
/* REVISIT: take a few more samples, and compare ... */
|
||||
|
||||
/* turn off reference */
|
||||
req->xfer[4].tx_buf = &ref_off;
|
||||
req->ref_off = REF_OFF;
|
||||
req->xfer[4].tx_buf = &req->ref_off;
|
||||
req->xfer[4].len = 1;
|
||||
req->xfer[5].rx_buf = &req->scratch;
|
||||
req->xfer[5].len = 2;
|
||||
|
@ -236,11 +244,12 @@ SHOW(vbatt)
|
|||
|
||||
static void ads7846_rx(void *ads)
|
||||
{
|
||||
struct ads7846 *ts = ads;
|
||||
unsigned Rt;
|
||||
unsigned sync = 0;
|
||||
u16 x, y, z1, z2;
|
||||
unsigned long flags;
|
||||
struct ads7846 *ts = ads;
|
||||
struct input_dev *input_dev = ts->input;
|
||||
unsigned Rt;
|
||||
unsigned sync = 0;
|
||||
u16 x, y, z1, z2;
|
||||
unsigned long flags;
|
||||
|
||||
/* adjust: 12 bit samples (left aligned), built from
|
||||
* two 8 bit values writen msb-first.
|
||||
|
@ -276,21 +285,21 @@ static void ads7846_rx(void *ads)
|
|||
* won't notice that, even if nPENIRQ never fires ...
|
||||
*/
|
||||
if (!ts->pendown && Rt != 0) {
|
||||
input_report_key(&ts->input, BTN_TOUCH, 1);
|
||||
input_report_key(input_dev, BTN_TOUCH, 1);
|
||||
sync = 1;
|
||||
} else if (ts->pendown && Rt == 0) {
|
||||
input_report_key(&ts->input, BTN_TOUCH, 0);
|
||||
input_report_key(input_dev, BTN_TOUCH, 0);
|
||||
sync = 1;
|
||||
}
|
||||
|
||||
if (Rt) {
|
||||
input_report_abs(&ts->input, ABS_X, x);
|
||||
input_report_abs(&ts->input, ABS_Y, y);
|
||||
input_report_abs(&ts->input, ABS_PRESSURE, Rt);
|
||||
input_report_abs(input_dev, ABS_X, x);
|
||||
input_report_abs(input_dev, ABS_Y, y);
|
||||
input_report_abs(input_dev, ABS_PRESSURE, Rt);
|
||||
sync = 1;
|
||||
}
|
||||
if (sync)
|
||||
input_sync(&ts->input);
|
||||
input_sync(input_dev);
|
||||
|
||||
#ifdef VERBOSE
|
||||
if (Rt || ts->pendown)
|
||||
|
@ -396,9 +405,10 @@ static int ads7846_resume(struct spi_device *spi)
|
|||
static int __devinit ads7846_probe(struct spi_device *spi)
|
||||
{
|
||||
struct ads7846 *ts;
|
||||
struct input_dev *input_dev;
|
||||
struct ads7846_platform_data *pdata = spi->dev.platform_data;
|
||||
struct spi_transfer *x;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
if (!spi->irq) {
|
||||
dev_dbg(&spi->dev, "no IRQ?\n");
|
||||
|
@ -411,9 +421,9 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||
}
|
||||
|
||||
/* don't exceed max specified sample rate */
|
||||
if (spi->max_speed_hz > (125000 * 16)) {
|
||||
if (spi->max_speed_hz > (125000 * SAMPLE_BITS)) {
|
||||
dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
|
||||
(spi->max_speed_hz/16)/1000);
|
||||
(spi->max_speed_hz/SAMPLE_BITS)/1000);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -423,13 +433,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||
* to discard the four garbage LSBs.
|
||||
*/
|
||||
|
||||
if (!(ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL);
|
||||
input_dev = input_allocate_device();
|
||||
if (!ts || !input_dev) {
|
||||
err = -ENOMEM;
|
||||
goto err_free_mem;
|
||||
}
|
||||
|
||||
dev_set_drvdata(&spi->dev, ts);
|
||||
spi->dev.power.power_state = PMSG_ON;
|
||||
|
||||
ts->spi = spi;
|
||||
spi->dev.power.power_state = PMSG_ON;
|
||||
ts->input = input_dev;
|
||||
|
||||
init_timer(&ts->timer);
|
||||
ts->timer.data = (unsigned long) ts;
|
||||
|
@ -439,70 +454,80 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||
ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
|
||||
ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
|
||||
|
||||
init_input_dev(&ts->input);
|
||||
snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
|
||||
|
||||
ts->input.dev = &spi->dev;
|
||||
ts->input.name = "ADS784x Touchscreen";
|
||||
snprintf(ts->phys, sizeof ts->phys, "%s/input0", spi->dev.bus_id);
|
||||
ts->input.phys = ts->phys;
|
||||
input_dev->name = "ADS784x Touchscreen";
|
||||
input_dev->phys = ts->phys;
|
||||
input_dev->cdev.dev = &spi->dev;
|
||||
|
||||
ts->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
|
||||
ts->input.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
|
||||
input_set_abs_params(&ts->input, ABS_X,
|
||||
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
|
||||
input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
|
||||
input_set_abs_params(input_dev, ABS_X,
|
||||
pdata->x_min ? : 0,
|
||||
pdata->x_max ? : MAX_12BIT,
|
||||
0, 0);
|
||||
input_set_abs_params(&ts->input, ABS_Y,
|
||||
input_set_abs_params(input_dev, ABS_Y,
|
||||
pdata->y_min ? : 0,
|
||||
pdata->y_max ? : MAX_12BIT,
|
||||
0, 0);
|
||||
input_set_abs_params(&ts->input, ABS_PRESSURE,
|
||||
input_set_abs_params(input_dev, ABS_PRESSURE,
|
||||
pdata->pressure_min, pdata->pressure_max, 0, 0);
|
||||
|
||||
input_register_device(&ts->input);
|
||||
|
||||
/* set up the transfers to read touchscreen state; this assumes we
|
||||
* use formula #2 for pressure, not #3.
|
||||
*/
|
||||
INIT_LIST_HEAD(&ts->msg.transfers);
|
||||
x = ts->xfer;
|
||||
|
||||
/* y- still on; turn on only y+ (and ADC) */
|
||||
x->tx_buf = &read_y;
|
||||
ts->read_y = READ_Y;
|
||||
x->tx_buf = &ts->read_y;
|
||||
x->len = 1;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
x++;
|
||||
x->rx_buf = &ts->tc.y;
|
||||
x->len = 2;
|
||||
x++;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
/* turn y+ off, x- on; we'll use formula #2 */
|
||||
if (ts->model == 7846) {
|
||||
x->tx_buf = &read_z1;
|
||||
x++;
|
||||
ts->read_z1 = READ_Z1;
|
||||
x->tx_buf = &ts->read_z1;
|
||||
x->len = 1;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
x++;
|
||||
x->rx_buf = &ts->tc.z1;
|
||||
x->len = 2;
|
||||
x++;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
x->tx_buf = &read_z2;
|
||||
x++;
|
||||
ts->read_z2 = READ_Z2;
|
||||
x->tx_buf = &ts->read_z2;
|
||||
x->len = 1;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
x++;
|
||||
x->rx_buf = &ts->tc.z2;
|
||||
x->len = 2;
|
||||
x++;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
}
|
||||
|
||||
/* turn y- off, x+ on, then leave in lowpower */
|
||||
x->tx_buf = &read_x;
|
||||
x++;
|
||||
ts->read_x = READ_X;
|
||||
x->tx_buf = &ts->read_x;
|
||||
x->len = 1;
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
x++;
|
||||
x->rx_buf = &ts->tc.x;
|
||||
x->len = 2;
|
||||
x++;
|
||||
CS_CHANGE(*x);
|
||||
spi_message_add_tail(x, &ts->msg);
|
||||
|
||||
CS_CHANGE(x[-1]);
|
||||
|
||||
for (i = 0; i < x - ts->xfer; i++)
|
||||
spi_message_add_tail(&ts->xfer[i], &ts->msg);
|
||||
ts->msg.complete = ads7846_rx;
|
||||
ts->msg.context = ts;
|
||||
|
||||
|
@ -510,9 +535,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||
SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING,
|
||||
spi->dev.bus_id, ts)) {
|
||||
dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
|
||||
input_unregister_device(&ts->input);
|
||||
kfree(ts);
|
||||
return -EBUSY;
|
||||
err = -EBUSY;
|
||||
goto err_free_mem;
|
||||
}
|
||||
|
||||
dev_info(&spi->dev, "touchscreen, irq %d\n", spi->irq);
|
||||
|
@ -534,7 +558,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
|
|||
device_create_file(&spi->dev, &dev_attr_vbatt);
|
||||
device_create_file(&spi->dev, &dev_attr_vaux);
|
||||
|
||||
err = input_register_device(input_dev);
|
||||
if (err)
|
||||
goto err_free_irq;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_irq:
|
||||
free_irq(spi->irq, ts);
|
||||
err_free_mem:
|
||||
input_free_device(input_dev);
|
||||
kfree(ts);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __devexit ads7846_remove(struct spi_device *spi)
|
||||
|
@ -554,7 +589,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
|
|||
device_remove_file(&spi->dev, &dev_attr_vbatt);
|
||||
device_remove_file(&spi->dev, &dev_attr_vaux);
|
||||
|
||||
input_unregister_device(&ts->input);
|
||||
input_unregister_device(ts->input);
|
||||
kfree(ts);
|
||||
|
||||
dev_dbg(&spi->dev, "unregistered touchscreen\n");
|
||||
|
|
|
@ -151,6 +151,7 @@ struct smu_sdbp_header *smu_sat_get_sdb_partition(unsigned int sat_id, int id,
|
|||
kfree(buf);
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(smu_sat_get_sdb_partition);
|
||||
|
||||
/* refresh the cache */
|
||||
static int wf_sat_read_cache(struct wf_sat *sat)
|
||||
|
|
|
@ -452,8 +452,7 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
|
|||
} else if (func == MPI_FUNCTION_EVENT_ACK) {
|
||||
dprintk((MYIOC_s_INFO_FMT "mpt_base_reply, EventAck reply received\n",
|
||||
ioc->name));
|
||||
} else if (func == MPI_FUNCTION_CONFIG ||
|
||||
func == MPI_FUNCTION_TOOLBOX) {
|
||||
} else if (func == MPI_FUNCTION_CONFIG) {
|
||||
CONFIGPARMS *pCfg;
|
||||
unsigned long flags;
|
||||
|
||||
|
@ -5326,115 +5325,6 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
/**
|
||||
* mpt_toolbox - Generic function to issue toolbox message
|
||||
* @ioc - Pointer to an adapter structure
|
||||
* @cfg - Pointer to a toolbox structure. Struct contains
|
||||
* action, page address, direction, physical address
|
||||
* and pointer to a configuration page header
|
||||
* Page header is updated.
|
||||
*
|
||||
* Returns 0 for success
|
||||
* -EPERM if not allowed due to ISR context
|
||||
* -EAGAIN if no msg frames currently available
|
||||
* -EFAULT for non-successful reply or no reply (timeout)
|
||||
*/
|
||||
int
|
||||
mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
|
||||
{
|
||||
ToolboxIstwiReadWriteRequest_t *pReq;
|
||||
MPT_FRAME_HDR *mf;
|
||||
struct pci_dev *pdev;
|
||||
unsigned long flags;
|
||||
int rc;
|
||||
u32 flagsLength;
|
||||
int in_isr;
|
||||
|
||||
/* Prevent calling wait_event() (below), if caller happens
|
||||
* to be in ISR context, because that is fatal!
|
||||
*/
|
||||
in_isr = in_interrupt();
|
||||
if (in_isr) {
|
||||
dcprintk((MYIOC_s_WARN_FMT "toobox request not allowed in ISR context!\n",
|
||||
ioc->name));
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
/* Get and Populate a free Frame
|
||||
*/
|
||||
if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
|
||||
dcprintk((MYIOC_s_WARN_FMT "mpt_toolbox: no msg frames!\n",
|
||||
ioc->name));
|
||||
return -EAGAIN;
|
||||
}
|
||||
pReq = (ToolboxIstwiReadWriteRequest_t *)mf;
|
||||
pReq->Tool = pCfg->action;
|
||||
pReq->Reserved = 0;
|
||||
pReq->ChainOffset = 0;
|
||||
pReq->Function = MPI_FUNCTION_TOOLBOX;
|
||||
pReq->Reserved1 = 0;
|
||||
pReq->Reserved2 = 0;
|
||||
pReq->MsgFlags = 0;
|
||||
pReq->Flags = pCfg->dir;
|
||||
pReq->BusNum = 0;
|
||||
pReq->Reserved3 = 0;
|
||||
pReq->NumAddressBytes = 0x01;
|
||||
pReq->Reserved4 = 0;
|
||||
pReq->DataLength = cpu_to_le16(0x04);
|
||||
pdev = ioc->pcidev;
|
||||
if (pdev->devfn & 1)
|
||||
pReq->DeviceAddr = 0xB2;
|
||||
else
|
||||
pReq->DeviceAddr = 0xB0;
|
||||
pReq->Addr1 = 0;
|
||||
pReq->Addr2 = 0;
|
||||
pReq->Addr3 = 0;
|
||||
pReq->Reserved5 = 0;
|
||||
|
||||
/* Add a SGE to the config request.
|
||||
*/
|
||||
|
||||
flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ | 4;
|
||||
|
||||
mpt_add_sge((char *)&pReq->SGL, flagsLength, pCfg->physAddr);
|
||||
|
||||
dcprintk((MYIOC_s_INFO_FMT "Sending Toolbox request, Tool=%x\n",
|
||||
ioc->name, pReq->Tool));
|
||||
|
||||
/* Append pCfg pointer to end of mf
|
||||
*/
|
||||
*((void **) (((u8 *) mf) + (ioc->req_sz - sizeof(void *)))) = (void *) pCfg;
|
||||
|
||||
/* Initalize the timer
|
||||
*/
|
||||
init_timer(&pCfg->timer);
|
||||
pCfg->timer.data = (unsigned long) ioc;
|
||||
pCfg->timer.function = mpt_timer_expired;
|
||||
pCfg->wait_done = 0;
|
||||
|
||||
/* Set the timer; ensure 10 second minimum */
|
||||
if (pCfg->timeout < 10)
|
||||
pCfg->timer.expires = jiffies + HZ*10;
|
||||
else
|
||||
pCfg->timer.expires = jiffies + HZ*pCfg->timeout;
|
||||
|
||||
/* Add to end of Q, set timer and then issue this command */
|
||||
spin_lock_irqsave(&ioc->FreeQlock, flags);
|
||||
list_add_tail(&pCfg->linkage, &ioc->configQ);
|
||||
spin_unlock_irqrestore(&ioc->FreeQlock, flags);
|
||||
|
||||
add_timer(&pCfg->timer);
|
||||
mpt_put_msg_frame(mpt_base_index, ioc, mf);
|
||||
wait_event(mpt_waitq, pCfg->wait_done);
|
||||
|
||||
/* mf has been freed - do not access */
|
||||
|
||||
rc = pCfg->status;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
/*
|
||||
* mpt_timer_expired - Call back for timer process.
|
||||
|
@ -6142,7 +6032,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
|
|||
if (ioc->events && (ioc->eventTypes & ( 1 << event))) {
|
||||
int idx;
|
||||
|
||||
idx = ioc->eventContext % ioc->eventLogSize;
|
||||
idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
|
||||
|
||||
ioc->events[idx].event = event;
|
||||
ioc->events[idx].eventContext = ioc->eventContext;
|
||||
|
@ -6540,7 +6430,6 @@ EXPORT_SYMBOL(mpt_lan_index);
|
|||
EXPORT_SYMBOL(mpt_stm_index);
|
||||
EXPORT_SYMBOL(mpt_HardResetHandler);
|
||||
EXPORT_SYMBOL(mpt_config);
|
||||
EXPORT_SYMBOL(mpt_toolbox);
|
||||
EXPORT_SYMBOL(mpt_findImVolumes);
|
||||
EXPORT_SYMBOL(mpt_read_ioc_pg_3);
|
||||
EXPORT_SYMBOL(mpt_alloc_fw_memory);
|
||||
|
|
|
@ -616,6 +616,7 @@ typedef struct _MPT_ADAPTER
|
|||
* increments by 32 bytes
|
||||
*/
|
||||
int errata_flag_1064;
|
||||
int aen_event_read_flag; /* flag to indicate event log was read*/
|
||||
u8 FirstWhoInit;
|
||||
u8 upload_fw; /* If set, do a fw upload */
|
||||
u8 reload_fw; /* Force a FW Reload on next reset */
|
||||
|
@ -1026,7 +1027,6 @@ extern u32 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked);
|
|||
extern void mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan);
|
||||
extern int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag);
|
||||
extern int mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
|
||||
extern int mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
|
||||
extern void mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size);
|
||||
extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
|
||||
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
|
||||
|
|
|
@ -136,6 +136,12 @@ static void mptctl_free_tm_flags(MPT_ADAPTER *ioc);
|
|||
*/
|
||||
static int mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase);
|
||||
|
||||
/*
|
||||
* Event Handler function
|
||||
*/
|
||||
static int mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
|
||||
struct fasync_struct *async_queue=NULL;
|
||||
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
/*
|
||||
* Scatter gather list (SGL) sizes and limits...
|
||||
|
@ -385,18 +391,18 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
|
|||
}
|
||||
|
||||
/* Now wait for the command to complete */
|
||||
ii = wait_event_interruptible_timeout(mptctl_wait,
|
||||
ii = wait_event_timeout(mptctl_wait,
|
||||
ioctl->wait_done == 1,
|
||||
HZ*5 /* 5 second timeout */);
|
||||
|
||||
if(ii <=0 && (ioctl->wait_done != 1 )) {
|
||||
mpt_free_msg_frame(hd->ioc, mf);
|
||||
ioctl->wait_done = 0;
|
||||
retval = -1; /* return failure */
|
||||
}
|
||||
|
||||
mptctl_bus_reset_done:
|
||||
|
||||
mpt_free_msg_frame(hd->ioc, mf);
|
||||
mptctl_free_tm_flags(ioctl->ioc);
|
||||
return retval;
|
||||
}
|
||||
|
@ -471,6 +477,69 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
/* ASYNC Event Notification Support */
|
||||
static int
|
||||
mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
|
||||
{
|
||||
u8 event;
|
||||
|
||||
event = le32_to_cpu(pEvReply->Event) & 0xFF;
|
||||
|
||||
dctlprintk(("%s() called\n", __FUNCTION__));
|
||||
if(async_queue == NULL)
|
||||
return 1;
|
||||
|
||||
/* Raise SIGIO for persistent events.
|
||||
* TODO - this define is not in MPI spec yet,
|
||||
* but they plan to set it to 0x21
|
||||
*/
|
||||
if (event == 0x21 ) {
|
||||
ioc->aen_event_read_flag=1;
|
||||
dctlprintk(("Raised SIGIO to application\n"));
|
||||
devtprintk(("Raised SIGIO to application\n"));
|
||||
kill_fasync(&async_queue, SIGIO, POLL_IN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This flag is set after SIGIO was raised, and
|
||||
* remains set until the application has read
|
||||
* the event log via ioctl=MPTEVENTREPORT
|
||||
*/
|
||||
if(ioc->aen_event_read_flag)
|
||||
return 1;
|
||||
|
||||
/* Signal only for the events that are
|
||||
* requested for by the application
|
||||
*/
|
||||
if (ioc->events && (ioc->eventTypes & ( 1 << event))) {
|
||||
ioc->aen_event_read_flag=1;
|
||||
dctlprintk(("Raised SIGIO to application\n"));
|
||||
devtprintk(("Raised SIGIO to application\n"));
|
||||
kill_fasync(&async_queue, SIGIO, POLL_IN);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
mptctl_fasync(int fd, struct file *filep, int mode)
|
||||
{
|
||||
MPT_ADAPTER *ioc;
|
||||
|
||||
list_for_each_entry(ioc, &ioc_list, list)
|
||||
ioc->aen_event_read_flag=0;
|
||||
|
||||
dctlprintk(("%s() called\n", __FUNCTION__));
|
||||
return fasync_helper(fd, filep, mode, &async_queue);
|
||||
}
|
||||
|
||||
static int
|
||||
mptctl_release(struct inode *inode, struct file *filep)
|
||||
{
|
||||
dctlprintk(("%s() called\n", __FUNCTION__));
|
||||
return fasync_helper(-1, filep, 0, &async_queue);
|
||||
}
|
||||
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
/*
|
||||
* MPT ioctl handler
|
||||
|
@ -674,22 +743,23 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
|
|||
u16 iocstat;
|
||||
pFWDownloadReply_t ReplyMsg = NULL;
|
||||
|
||||
dctlprintk((KERN_INFO "mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id));
|
||||
dctlprintk(("mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id));
|
||||
|
||||
dctlprintk((KERN_INFO "DbG: kfwdl.bufp = %p\n", ufwbuf));
|
||||
dctlprintk((KERN_INFO "DbG: kfwdl.fwlen = %d\n", (int)fwlen));
|
||||
dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc));
|
||||
dctlprintk(("DbG: kfwdl.bufp = %p\n", ufwbuf));
|
||||
dctlprintk(("DbG: kfwdl.fwlen = %d\n", (int)fwlen));
|
||||
dctlprintk(("DbG: kfwdl.ioc = %04xh\n", ioc));
|
||||
|
||||
if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) {
|
||||
dctlprintk(("%s@%d::_ioctl_fwdl - ioc%d not found!\n",
|
||||
__FILE__, __LINE__, ioc));
|
||||
if (mpt_verify_adapter(ioc, &iocp) < 0) {
|
||||
dctlprintk(("ioctl_fwdl - ioc%d not found!\n",
|
||||
ioc));
|
||||
return -ENODEV; /* (-6) No such device or address */
|
||||
}
|
||||
} else {
|
||||
|
||||
/* Valid device. Get a message frame and construct the FW download message.
|
||||
*/
|
||||
if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
|
||||
return -EAGAIN;
|
||||
/* Valid device. Get a message frame and construct the FW download message.
|
||||
*/
|
||||
if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
|
||||
return -EAGAIN;
|
||||
}
|
||||
dlmsg = (FWDownload_t*) mf;
|
||||
ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;
|
||||
sgOut = (char *) (ptsge + 1);
|
||||
|
@ -702,7 +772,11 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
|
|||
dlmsg->ChainOffset = 0;
|
||||
dlmsg->Function = MPI_FUNCTION_FW_DOWNLOAD;
|
||||
dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0;
|
||||
dlmsg->MsgFlags = 0;
|
||||
if (iocp->facts.MsgVersion >= MPI_VERSION_01_05)
|
||||
dlmsg->MsgFlags = MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT;
|
||||
else
|
||||
dlmsg->MsgFlags = 0;
|
||||
|
||||
|
||||
/* Set up the Transaction SGE.
|
||||
*/
|
||||
|
@ -754,7 +828,7 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
|
|||
goto fwdl_out;
|
||||
}
|
||||
|
||||
dctlprintk((KERN_INFO "DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags));
|
||||
dctlprintk(("DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags));
|
||||
|
||||
/*
|
||||
* Parse SG list, copying sgl itself,
|
||||
|
@ -803,11 +877,11 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
|
|||
/*
|
||||
* Finally, perform firmware download.
|
||||
*/
|
||||
iocp->ioctl->wait_done = 0;
|
||||
ReplyMsg = NULL;
|
||||
mpt_put_msg_frame(mptctl_id, iocp, mf);
|
||||
|
||||
/* Now wait for the command to complete */
|
||||
ret = wait_event_interruptible_timeout(mptctl_wait,
|
||||
ret = wait_event_timeout(mptctl_wait,
|
||||
iocp->ioctl->wait_done == 1,
|
||||
HZ*60);
|
||||
|
||||
|
@ -1145,7 +1219,9 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
|
|||
/* Fill in the data and return the structure to the calling
|
||||
* program
|
||||
*/
|
||||
if (ioc->bus_type == FC)
|
||||
if (ioc->bus_type == SAS)
|
||||
karg->adapterType = MPT_IOCTL_INTERFACE_SAS;
|
||||
else if (ioc->bus_type == FC)
|
||||
karg->adapterType = MPT_IOCTL_INTERFACE_FC;
|
||||
else
|
||||
karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
|
||||
|
@ -1170,12 +1246,11 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
|
|||
karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
|
||||
karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
|
||||
} else if (cim_rev == 2) {
|
||||
/* Get the PCI bus, device, function and segment ID numbers
|
||||
/* Get the PCI bus, device, function and segment ID numbers
|
||||
for the IOC */
|
||||
karg->pciInfo.u.bits.busNumber = pdev->bus->number;
|
||||
karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
|
||||
karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
|
||||
karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
|
||||
karg->pciInfo.segmentID = pci_domain_nr(pdev->bus);
|
||||
}
|
||||
|
||||
|
@ -1500,7 +1575,7 @@ mptctl_eventquery (unsigned long arg)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
karg.eventEntries = ioc->eventLogSize;
|
||||
karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
|
||||
karg.eventTypes = ioc->eventTypes;
|
||||
|
||||
/* Copy the data from kernel memory to user memory
|
||||
|
@ -1550,7 +1625,6 @@ mptctl_eventenable (unsigned long arg)
|
|||
memset(ioc->events, 0, sz);
|
||||
ioc->alloc_total += sz;
|
||||
|
||||
ioc->eventLogSize = MPTCTL_EVENT_LOG_SIZE;
|
||||
ioc->eventContext = 0;
|
||||
}
|
||||
|
||||
|
@ -1590,7 +1664,7 @@ mptctl_eventreport (unsigned long arg)
|
|||
maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS);
|
||||
|
||||
|
||||
max = ioc->eventLogSize < maxEvents ? ioc->eventLogSize : maxEvents;
|
||||
max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents;
|
||||
|
||||
/* If fewer than 1 event is requested, there must have
|
||||
* been some type of error.
|
||||
|
@ -1598,6 +1672,9 @@ mptctl_eventreport (unsigned long arg)
|
|||
if ((max < 1) || !ioc->events)
|
||||
return -ENODATA;
|
||||
|
||||
/* reset this flag so SIGIO can restart */
|
||||
ioc->aen_event_read_flag=0;
|
||||
|
||||
/* Copy the data from kernel memory to user memory
|
||||
*/
|
||||
numBytes = max * sizeof(MPT_IOCTL_EVENTS);
|
||||
|
@ -1817,6 +1894,8 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
|
|||
case MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR:
|
||||
case MPI_FUNCTION_FW_DOWNLOAD:
|
||||
case MPI_FUNCTION_FC_PRIMITIVE_SEND:
|
||||
case MPI_FUNCTION_TOOLBOX:
|
||||
case MPI_FUNCTION_SAS_IO_UNIT_CONTROL:
|
||||
break;
|
||||
|
||||
case MPI_FUNCTION_SCSI_IO_REQUEST:
|
||||
|
@ -1837,7 +1916,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
|
|||
goto done_free_mem;
|
||||
}
|
||||
|
||||
pScsiReq->MsgFlags = mpt_msg_flags();
|
||||
pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH;
|
||||
pScsiReq->MsgFlags |= mpt_msg_flags();
|
||||
|
||||
|
||||
/* verify that app has not requested
|
||||
* more sense data than driver
|
||||
|
@ -1888,6 +1969,25 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
|
|||
}
|
||||
break;
|
||||
|
||||
case MPI_FUNCTION_SMP_PASSTHROUGH:
|
||||
/* Check mf->PassthruFlags to determine if
|
||||
* transfer is ImmediateMode or not.
|
||||
* Immediate mode returns data in the ReplyFrame.
|
||||
* Else, we are sending request and response data
|
||||
* in two SGLs at the end of the mf.
|
||||
*/
|
||||
break;
|
||||
|
||||
case MPI_FUNCTION_SATA_PASSTHROUGH:
|
||||
if (!ioc->sh) {
|
||||
printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
|
||||
"SCSI driver is not loaded. \n",
|
||||
__FILE__, __LINE__);
|
||||
rc = -EFAULT;
|
||||
goto done_free_mem;
|
||||
}
|
||||
break;
|
||||
|
||||
case MPI_FUNCTION_RAID_ACTION:
|
||||
/* Just add a SGE
|
||||
*/
|
||||
|
@ -1900,7 +2000,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
|
|||
int scsidir = MPI_SCSIIO_CONTROL_READ;
|
||||
int dataSize;
|
||||
|
||||
pScsiReq->MsgFlags = mpt_msg_flags();
|
||||
pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH;
|
||||
pScsiReq->MsgFlags |= mpt_msg_flags();
|
||||
|
||||
|
||||
/* verify that app has not requested
|
||||
* more sense data than driver
|
||||
|
@ -2130,7 +2232,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
|
|||
|
||||
/* Now wait for the command to complete */
|
||||
timeout = (karg.timeout > 0) ? karg.timeout : MPT_IOCTL_DEFAULT_TIMEOUT;
|
||||
timeout = wait_event_interruptible_timeout(mptctl_wait,
|
||||
timeout = wait_event_timeout(mptctl_wait,
|
||||
ioc->ioctl->wait_done == 1,
|
||||
HZ*timeout);
|
||||
|
||||
|
@ -2246,13 +2348,16 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
|
|||
hp_host_info_t __user *uarg = (void __user *) arg;
|
||||
MPT_ADAPTER *ioc;
|
||||
struct pci_dev *pdev;
|
||||
char *pbuf;
|
||||
char *pbuf=NULL;
|
||||
dma_addr_t buf_dma;
|
||||
hp_host_info_t karg;
|
||||
CONFIGPARMS cfg;
|
||||
ConfigPageHeader_t hdr;
|
||||
int iocnum;
|
||||
int rc, cim_rev;
|
||||
ToolboxIstwiReadWriteRequest_t *IstwiRWRequest;
|
||||
MPT_FRAME_HDR *mf = NULL;
|
||||
MPIHeader_t *mpi_hdr;
|
||||
|
||||
dctlprintk((": mptctl_hp_hostinfo called.\n"));
|
||||
/* Reset long to int. Should affect IA64 and SPARC only
|
||||
|
@ -2370,7 +2475,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
|
|||
|
||||
karg.base_io_addr = pci_resource_start(pdev, 0);
|
||||
|
||||
if (ioc->bus_type == FC)
|
||||
if ((ioc->bus_type == SAS) || (ioc->bus_type == FC))
|
||||
karg.bus_phys_width = HP_BUS_WIDTH_UNK;
|
||||
else
|
||||
karg.bus_phys_width = HP_BUS_WIDTH_16;
|
||||
|
@ -2388,20 +2493,67 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
|
|||
}
|
||||
}
|
||||
|
||||
cfg.pageAddr = 0;
|
||||
cfg.action = MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL;
|
||||
cfg.dir = MPI_TB_ISTWI_FLAGS_READ;
|
||||
cfg.timeout = 10;
|
||||
pbuf = pci_alloc_consistent(ioc->pcidev, 4, &buf_dma);
|
||||
if (pbuf) {
|
||||
cfg.physAddr = buf_dma;
|
||||
if ((mpt_toolbox(ioc, &cfg)) == 0) {
|
||||
karg.rsvd = *(u32 *)pbuf;
|
||||
}
|
||||
pci_free_consistent(ioc->pcidev, 4, pbuf, buf_dma);
|
||||
pbuf = NULL;
|
||||
/*
|
||||
* Gather ISTWI(Industry Standard Two Wire Interface) Data
|
||||
*/
|
||||
if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) {
|
||||
dfailprintk((MYIOC_s_WARN_FMT "%s, no msg frames!!\n",
|
||||
ioc->name,__FUNCTION__));
|
||||
goto out;
|
||||
}
|
||||
|
||||
IstwiRWRequest = (ToolboxIstwiReadWriteRequest_t *)mf;
|
||||
mpi_hdr = (MPIHeader_t *) mf;
|
||||
memset(IstwiRWRequest,0,sizeof(ToolboxIstwiReadWriteRequest_t));
|
||||
IstwiRWRequest->Function = MPI_FUNCTION_TOOLBOX;
|
||||
IstwiRWRequest->Tool = MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL;
|
||||
IstwiRWRequest->MsgContext = mpi_hdr->MsgContext;
|
||||
IstwiRWRequest->Flags = MPI_TB_ISTWI_FLAGS_READ;
|
||||
IstwiRWRequest->NumAddressBytes = 0x01;
|
||||
IstwiRWRequest->DataLength = cpu_to_le16(0x04);
|
||||
if (pdev->devfn & 1)
|
||||
IstwiRWRequest->DeviceAddr = 0xB2;
|
||||
else
|
||||
IstwiRWRequest->DeviceAddr = 0xB0;
|
||||
|
||||
pbuf = pci_alloc_consistent(ioc->pcidev, 4, &buf_dma);
|
||||
if (!pbuf)
|
||||
goto out;
|
||||
mpt_add_sge((char *)&IstwiRWRequest->SGL,
|
||||
(MPT_SGE_FLAGS_SSIMPLE_READ|4), buf_dma);
|
||||
|
||||
ioc->ioctl->wait_done = 0;
|
||||
mpt_put_msg_frame(mptctl_id, ioc, mf);
|
||||
|
||||
rc = wait_event_timeout(mptctl_wait,
|
||||
ioc->ioctl->wait_done == 1,
|
||||
HZ*MPT_IOCTL_DEFAULT_TIMEOUT /* 10 sec */);
|
||||
|
||||
if(rc <=0 && (ioc->ioctl->wait_done != 1 )) {
|
||||
/*
|
||||
* Now we need to reset the board
|
||||
*/
|
||||
mpt_free_msg_frame(ioc, mf);
|
||||
mptctl_timeout_expired(ioc->ioctl);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
*ISTWI Data Definition
|
||||
* pbuf[0] = FW_VERSION = 0x4
|
||||
* pbuf[1] = Bay Count = 6 or 4 or 2, depending on
|
||||
* the config, you should be seeing one out of these three values
|
||||
* pbuf[2] = Drive Installed Map = bit pattern depend on which
|
||||
* bays have drives in them
|
||||
* pbuf[3] = Checksum (0x100 = (byte0 + byte2 + byte3)
|
||||
*/
|
||||
if (ioc->ioctl->status & MPT_IOCTL_STATUS_RF_VALID)
|
||||
karg.rsvd = *(u32 *)pbuf;
|
||||
|
||||
out:
|
||||
if (pbuf)
|
||||
pci_free_consistent(ioc->pcidev, 4, pbuf, buf_dma);
|
||||
|
||||
/* Copy the data from kernel memory to user memory
|
||||
*/
|
||||
if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) {
|
||||
|
@ -2459,7 +2611,7 @@ mptctl_hp_targetinfo(unsigned long arg)
|
|||
|
||||
/* There is nothing to do for FCP parts.
|
||||
*/
|
||||
if (ioc->bus_type == FC)
|
||||
if ((ioc->bus_type == SAS) || (ioc->bus_type == FC))
|
||||
return 0;
|
||||
|
||||
if ((ioc->spi_data.sdp0length == 0) || (ioc->sh == NULL))
|
||||
|
@ -2569,6 +2721,8 @@ mptctl_hp_targetinfo(unsigned long arg)
|
|||
static struct file_operations mptctl_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.release = mptctl_release,
|
||||
.fasync = mptctl_fasync,
|
||||
.unlocked_ioctl = mptctl_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = compat_mpctl_ioctl,
|
||||
|
@ -2813,6 +2967,11 @@ static int __init mptctl_init(void)
|
|||
/* FIXME! */
|
||||
}
|
||||
|
||||
if (mpt_event_register(mptctl_id, mptctl_event_process) == 0) {
|
||||
devtprintk((KERN_INFO MYNAM
|
||||
": Registered for IOC event notifications\n"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_fail:
|
||||
|
|
|
@ -169,8 +169,10 @@ struct mpt_ioctl_pci_info2 {
|
|||
* Read only.
|
||||
* Data starts at offset 0xC
|
||||
*/
|
||||
#define MPT_IOCTL_INTERFACE_FC (0x01)
|
||||
#define MPT_IOCTL_INTERFACE_SCSI (0x00)
|
||||
#define MPT_IOCTL_INTERFACE_FC (0x01)
|
||||
#define MPT_IOCTL_INTERFACE_FC_IP (0x02)
|
||||
#define MPT_IOCTL_INTERFACE_SAS (0x03)
|
||||
#define MPT_IOCTL_VERSION_LENGTH (32)
|
||||
|
||||
struct mpt_ioctl_iocinfo {
|
||||
|
|
|
@ -2489,7 +2489,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
|
|||
int idx;
|
||||
MPT_ADAPTER *ioc = hd->ioc;
|
||||
|
||||
idx = ioc->eventContext % ioc->eventLogSize;
|
||||
idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
|
||||
ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
|
||||
ioc->events[idx].eventContext = ioc->eventContext;
|
||||
|
||||
|
|
|
@ -97,6 +97,13 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
|
|||
if (data->flags & MMC_DATA_READ) {
|
||||
datactrl |= MCI_DPSM_DIRECTION;
|
||||
irqmask = MCI_RXFIFOHALFFULLMASK;
|
||||
|
||||
/*
|
||||
* If we have less than a FIFOSIZE of bytes to transfer,
|
||||
* trigger a PIO interrupt as soon as any data is available.
|
||||
*/
|
||||
if (host->size < MCI_FIFOSIZE)
|
||||
irqmask |= MCI_RXDATAAVLBLMASK;
|
||||
} else {
|
||||
/*
|
||||
* We don't actually need to include "FIFO empty" here
|
||||
|
|
|
@ -2020,8 +2020,8 @@ config SIS190
|
|||
will be called sis190. This is recommended.
|
||||
|
||||
config SKGE
|
||||
tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)"
|
||||
depends on PCI && EXPERIMENTAL
|
||||
tristate "New SysKonnect GigaEthernet support"
|
||||
depends on PCI
|
||||
select CRC32
|
||||
---help---
|
||||
This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx
|
||||
|
@ -2082,7 +2082,6 @@ config SK98LIN
|
|||
- Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
|
||||
- Allied Telesyn AT-2971T Gigabit Ethernet Adapter
|
||||
- Belkin Gigabit Desktop Card 10/100/1000Base-T Adapter, Copper RJ-45
|
||||
- DGE-530T Gigabit Ethernet Adapter
|
||||
- EG1032 v2 Instant Gigabit Network Adapter
|
||||
- EG1064 v2 Instant Gigabit Network Adapter
|
||||
- Marvell 88E8001 Gigabit LOM Ethernet Adapter (Abit)
|
||||
|
|
|
@ -1581,6 +1581,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
|
|||
printk(KERN_INFO DRV_NAME
|
||||
": %s: %s not enslaved\n",
|
||||
bond_dev->name, slave_dev->name);
|
||||
write_unlock_bh(&bond->lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1791,6 +1791,8 @@ static int __devinit sis190_init_one(struct pci_dev *pdev,
|
|||
goto out;
|
||||
}
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
tp = netdev_priv(dev);
|
||||
ioaddr = tp->mmio_addr;
|
||||
|
||||
|
@ -1827,8 +1829,6 @@ static int __devinit sis190_init_one(struct pci_dev *pdev,
|
|||
if (rc < 0)
|
||||
goto err_remove_mii;
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
net_probe(tp, KERN_INFO "%s: %s at %p (IRQ: %d), "
|
||||
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
|
||||
pci_name(pdev), sis_chip_info[ent->driver_data].name,
|
||||
|
|
|
@ -1697,6 +1697,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port)
|
|||
skge_write32(hw, SK_REG(port, GPHY_CTRL), reg | GPC_RST_SET);
|
||||
skge_write32(hw, SK_REG(port, GPHY_CTRL), reg | GPC_RST_CLR);
|
||||
skge_write32(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR);
|
||||
|
||||
if (skge->autoneg == AUTONEG_DISABLE) {
|
||||
reg = GM_GPCR_AU_ALL_DIS;
|
||||
gma_write16(hw, port, GM_GP_CTRL,
|
||||
|
@ -1704,16 +1705,23 @@ static void yukon_mac_init(struct skge_hw *hw, int port)
|
|||
|
||||
switch (skge->speed) {
|
||||
case SPEED_1000:
|
||||
reg &= ~GM_GPCR_SPEED_100;
|
||||
reg |= GM_GPCR_SPEED_1000;
|
||||
/* fallthru */
|
||||
break;
|
||||
case SPEED_100:
|
||||
reg &= ~GM_GPCR_SPEED_1000;
|
||||
reg |= GM_GPCR_SPEED_100;
|
||||
break;
|
||||
case SPEED_10:
|
||||
reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
|
||||
break;
|
||||
}
|
||||
|
||||
if (skge->duplex == DUPLEX_FULL)
|
||||
reg |= GM_GPCR_DUP_FULL;
|
||||
} else
|
||||
reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL;
|
||||
|
||||
switch (skge->flow_control) {
|
||||
case FLOW_MODE_NONE:
|
||||
skge_write32(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
|
||||
|
|
|
@ -520,10 +520,16 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
|
|||
|
||||
switch (sky2->speed) {
|
||||
case SPEED_1000:
|
||||
reg &= ~GM_GPCR_SPEED_100;
|
||||
reg |= GM_GPCR_SPEED_1000;
|
||||
/* fallthru */
|
||||
break;
|
||||
case SPEED_100:
|
||||
reg &= ~GM_GPCR_SPEED_1000;
|
||||
reg |= GM_GPCR_SPEED_100;
|
||||
break;
|
||||
case SPEED_10:
|
||||
reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
|
||||
break;
|
||||
}
|
||||
|
||||
if (sky2->duplex == DUPLEX_FULL)
|
||||
|
@ -1446,6 +1452,29 @@ static void sky2_link_up(struct sky2_port *sky2)
|
|||
sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK);
|
||||
|
||||
reg = gma_read16(hw, port, GM_GP_CTRL);
|
||||
if (sky2->autoneg == AUTONEG_DISABLE) {
|
||||
reg |= GM_GPCR_AU_ALL_DIS;
|
||||
|
||||
/* Is write/read necessary? Copied from sky2_mac_init */
|
||||
gma_write16(hw, port, GM_GP_CTRL, reg);
|
||||
gma_read16(hw, port, GM_GP_CTRL);
|
||||
|
||||
switch (sky2->speed) {
|
||||
case SPEED_1000:
|
||||
reg &= ~GM_GPCR_SPEED_100;
|
||||
reg |= GM_GPCR_SPEED_1000;
|
||||
break;
|
||||
case SPEED_100:
|
||||
reg &= ~GM_GPCR_SPEED_1000;
|
||||
reg |= GM_GPCR_SPEED_100;
|
||||
break;
|
||||
case SPEED_10:
|
||||
reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
reg &= ~GM_GPCR_AU_ALL_DIS;
|
||||
|
||||
if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE)
|
||||
reg |= GM_GPCR_DUP_FULL;
|
||||
|
||||
|
|
|
@ -1042,7 +1042,7 @@ typedef struct net_local {
|
|||
__u16 functional_address[2];
|
||||
__u16 bitwise_group_address[2];
|
||||
|
||||
__u8 *ptr_ucode;
|
||||
const __u8 *ptr_ucode;
|
||||
|
||||
__u8 cleanup;
|
||||
|
||||
|
|
|
@ -1872,7 +1872,7 @@ static int atmel_set_encodeext(struct net_device *dev,
|
|||
struct atmel_private *priv = netdev_priv(dev);
|
||||
struct iw_point *encoding = &wrqu->encoding;
|
||||
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
||||
int idx, key_len;
|
||||
int idx, key_len, alg = ext->alg, set_key = 1;
|
||||
|
||||
/* Determine and validate the key index */
|
||||
idx = encoding->flags & IW_ENCODE_INDEX;
|
||||
|
@ -1883,39 +1883,42 @@ static int atmel_set_encodeext(struct net_device *dev,
|
|||
} else
|
||||
idx = priv->default_key;
|
||||
|
||||
if ((encoding->flags & IW_ENCODE_DISABLED) ||
|
||||
ext->alg == IW_ENCODE_ALG_NONE) {
|
||||
priv->wep_is_on = 0;
|
||||
priv->encryption_level = 0;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
|
||||
if (encoding->flags & IW_ENCODE_DISABLED)
|
||||
alg = IW_ENCODE_ALG_NONE;
|
||||
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
|
||||
priv->default_key = idx;
|
||||
set_key = ext->key_len > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
|
||||
priv->default_key = idx;
|
||||
|
||||
/* Set the requested key */
|
||||
switch (ext->alg) {
|
||||
case IW_ENCODE_ALG_NONE:
|
||||
break;
|
||||
case IW_ENCODE_ALG_WEP:
|
||||
if (ext->key_len > 5) {
|
||||
priv->wep_key_len[idx] = 13;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
|
||||
priv->encryption_level = 2;
|
||||
} else if (ext->key_len > 0) {
|
||||
priv->wep_key_len[idx] = 5;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
|
||||
priv->encryption_level = 1;
|
||||
} else {
|
||||
if (set_key) {
|
||||
/* Set the requested key first */
|
||||
switch (alg) {
|
||||
case IW_ENCODE_ALG_NONE:
|
||||
priv->wep_is_on = 0;
|
||||
priv->encryption_level = 0;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
|
||||
break;
|
||||
case IW_ENCODE_ALG_WEP:
|
||||
if (ext->key_len > 5) {
|
||||
priv->wep_key_len[idx] = 13;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
|
||||
priv->encryption_level = 2;
|
||||
} else if (ext->key_len > 0) {
|
||||
priv->wep_key_len[idx] = 5;
|
||||
priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
|
||||
priv->encryption_level = 1;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
priv->wep_is_on = 1;
|
||||
memset(priv->wep_keys[idx], 0, 13);
|
||||
key_len = min ((int)ext->key_len, priv->wep_key_len[idx]);
|
||||
memcpy(priv->wep_keys[idx], ext->key, key_len);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
priv->wep_is_on = 1;
|
||||
memset(priv->wep_keys[idx], 0, 13);
|
||||
key_len = min ((int)ext->key_len, priv->wep_key_len[idx]);
|
||||
memcpy(priv->wep_keys[idx], ext->key, key_len);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return -EINPROGRESS;
|
||||
|
@ -3061,17 +3064,26 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
|
|||
}
|
||||
|
||||
if (status == C80211_MGMT_SC_Success && priv->wep_is_on) {
|
||||
int should_associate = 0;
|
||||
/* WEP */
|
||||
if (trans_seq_no != priv->ExpectedAuthentTransactionSeqNum)
|
||||
return;
|
||||
|
||||
if (trans_seq_no == 0x0002 &&
|
||||
auth->el_id == C80211_MGMT_ElementID_ChallengeText) {
|
||||
send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len);
|
||||
return;
|
||||
if (system == C80211_MGMT_AAN_OPENSYSTEM) {
|
||||
if (trans_seq_no == 0x0002) {
|
||||
should_associate = 1;
|
||||
}
|
||||
} else if (system == C80211_MGMT_AAN_SHAREDKEY) {
|
||||
if (trans_seq_no == 0x0002 &&
|
||||
auth->el_id == C80211_MGMT_ElementID_ChallengeText) {
|
||||
send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len);
|
||||
return;
|
||||
} else if (trans_seq_no == 0x0004) {
|
||||
should_associate = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (trans_seq_no == 0x0004) {
|
||||
if (should_associate) {
|
||||
if(priv->station_was_associated) {
|
||||
atmel_enter_state(priv, STATION_STATE_REASSOCIATING);
|
||||
send_association_request(priv, 1);
|
||||
|
@ -3084,11 +3096,13 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
|
|||
}
|
||||
}
|
||||
|
||||
if (status == C80211_MGMT_SC_AuthAlgNotSupported) {
|
||||
if (status == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) {
|
||||
/* Do opensystem first, then try sharedkey */
|
||||
if (system == C80211_MGMT_AAN_OPENSYSTEM) {
|
||||
if (system == WLAN_AUTH_OPEN) {
|
||||
priv->CurrentAuthentTransactionSeqNum = 0x001;
|
||||
send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
|
||||
priv->exclude_unencrypted = 1;
|
||||
send_authentication_request(priv, WLAN_AUTH_SHARED_KEY, NULL, 0);
|
||||
return;
|
||||
} else if (priv->connect_to_any_BSS) {
|
||||
int bss_index;
|
||||
|
||||
|
@ -3439,10 +3453,13 @@ static void atmel_management_timer(u_long a)
|
|||
priv->AuthenticationRequestRetryCnt = 0;
|
||||
restart_search(priv);
|
||||
} else {
|
||||
int auth = C80211_MGMT_AAN_OPENSYSTEM;
|
||||
priv->AuthenticationRequestRetryCnt++;
|
||||
priv->CurrentAuthentTransactionSeqNum = 0x0001;
|
||||
mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
|
||||
send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0);
|
||||
if (priv->wep_is_on && priv->exclude_unencrypted)
|
||||
auth = C80211_MGMT_AAN_SHAREDKEY;
|
||||
send_authentication_request(priv, auth, NULL, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3541,12 +3558,15 @@ static void atmel_command_irq(struct atmel_private *priv)
|
|||
priv->station_was_associated = priv->station_is_associated;
|
||||
atmel_enter_state(priv, STATION_STATE_READY);
|
||||
} else {
|
||||
int auth = C80211_MGMT_AAN_OPENSYSTEM;
|
||||
priv->AuthenticationRequestRetryCnt = 0;
|
||||
atmel_enter_state(priv, STATION_STATE_AUTHENTICATING);
|
||||
|
||||
mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
|
||||
priv->CurrentAuthentTransactionSeqNum = 0x0001;
|
||||
send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
|
||||
if (priv->wep_is_on && priv->exclude_unencrypted)
|
||||
auth = C80211_MGMT_AAN_SHAREDKEY;
|
||||
send_authentication_request(priv, auth, NULL, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -950,16 +950,8 @@ wv_82593_cmd(struct net_device * dev,
|
|||
static inline int
|
||||
wv_diag(struct net_device * dev)
|
||||
{
|
||||
int ret = FALSE;
|
||||
|
||||
if(wv_82593_cmd(dev, "wv_diag(): diagnose",
|
||||
OP0_DIAGNOSE, SR0_DIAGNOSE_PASSED))
|
||||
ret = TRUE;
|
||||
|
||||
#ifdef DEBUG_CONFIG_ERRORS
|
||||
printk(KERN_INFO "wavelan_cs: i82593 Self Test failed!\n");
|
||||
#endif
|
||||
return(ret);
|
||||
return(wv_82593_cmd(dev, "wv_diag(): diagnose",
|
||||
OP0_DIAGNOSE, SR0_DIAGNOSE_PASSED));
|
||||
} /* wv_diag */
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
@ -3604,8 +3596,8 @@ wv_82593_config(struct net_device * dev)
|
|||
cfblk.lin_prio = 0; /* conform to 802.3 backoff algoritm */
|
||||
cfblk.exp_prio = 5; /* conform to 802.3 backoff algoritm */
|
||||
cfblk.bof_met = 1; /* conform to 802.3 backoff algoritm */
|
||||
cfblk.ifrm_spc = 0x20; /* 32 bit times interframe spacing */
|
||||
cfblk.slottim_low = 0x20; /* 32 bit times slot time */
|
||||
cfblk.ifrm_spc = 0x20 >> 4; /* 32 bit times interframe spacing */
|
||||
cfblk.slottim_low = 0x20 >> 5; /* 32 bit times slot time */
|
||||
cfblk.slottim_hi = 0x0;
|
||||
cfblk.max_retr = 15;
|
||||
cfblk.prmisc = ((lp->promiscuous) ? TRUE: FALSE); /* Promiscuous mode */
|
||||
|
|
|
@ -359,7 +359,7 @@ ccw_device_set_online(struct ccw_device *cdev)
|
|||
else
|
||||
pr_debug("ccw_device_offline returned %d, device %s\n",
|
||||
ret, cdev->dev.bus_id);
|
||||
return (ret = 0) ? -ENODEV : ret;
|
||||
return (ret == 0) ? -ENODEV : ret;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
|
@ -405,7 +405,7 @@ __ccw_device_disband_start(struct ccw_device *cdev)
|
|||
cdev->private->iretry = 5;
|
||||
cdev->private->imask >>= 1;
|
||||
}
|
||||
ccw_device_verify_done(cdev, (sch->lpm != 0) ? 0 : -ENODEV);
|
||||
ccw_device_disband_done(cdev, (sch->lpm != 0) ? 0 : -ENODEV);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -317,7 +317,6 @@ ccw_device_do_sense(struct ccw_device *cdev, struct irb *irb)
|
|||
/*
|
||||
* We have ending status but no sense information. Do a basic sense.
|
||||
*/
|
||||
sch = to_subchannel(cdev->dev.parent);
|
||||
sch->sense_ccw.cmd_code = CCW_CMD_BASIC_SENSE;
|
||||
sch->sense_ccw.cda = (__u32) __pa(cdev->private->irb.ecw);
|
||||
sch->sense_ccw.count = SENSE_MAX_COUNT;
|
||||
|
|
|
@ -98,9 +98,9 @@ lcs_register_debug_facility(void)
|
|||
return -ENOMEM;
|
||||
}
|
||||
debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);
|
||||
debug_set_level(lcs_dbf_setup, 4);
|
||||
debug_set_level(lcs_dbf_setup, 2);
|
||||
debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);
|
||||
debug_set_level(lcs_dbf_trace, 4);
|
||||
debug_set_level(lcs_dbf_trace, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1292,9 +1292,8 @@ lcs_set_multicast_list(struct net_device *dev)
|
|||
LCS_DBF_TEXT(4, trace, "setmulti");
|
||||
card = (struct lcs_card *) dev->priv;
|
||||
|
||||
if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) {
|
||||
if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD))
|
||||
schedule_work(&card->kernel_thread_starter);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IP_MULTICAST */
|
||||
|
@ -1459,6 +1458,8 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer)
|
|||
lcs_release_buffer(channel, buffer);
|
||||
card = (struct lcs_card *)
|
||||
((char *) channel - offsetof(struct lcs_card, write));
|
||||
if (netif_queue_stopped(card->dev))
|
||||
netif_wake_queue(card->dev);
|
||||
spin_lock(&card->lock);
|
||||
card->tx_emitted--;
|
||||
if (card->tx_emitted <= 0 && card->tx_buffer != NULL)
|
||||
|
@ -1478,6 +1479,7 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
|
|||
struct net_device *dev)
|
||||
{
|
||||
struct lcs_header *header;
|
||||
int rc = 0;
|
||||
|
||||
LCS_DBF_TEXT(5, trace, "hardxmit");
|
||||
if (skb == NULL) {
|
||||
|
@ -1492,10 +1494,8 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
|
|||
card->stats.tx_carrier_errors++;
|
||||
return 0;
|
||||
}
|
||||
if (netif_queue_stopped(dev) ) {
|
||||
card->stats.tx_dropped++;
|
||||
return -EBUSY;
|
||||
}
|
||||
netif_stop_queue(card->dev);
|
||||
spin_lock(&card->lock);
|
||||
if (card->tx_buffer != NULL &&
|
||||
card->tx_buffer->count + sizeof(struct lcs_header) +
|
||||
skb->len + sizeof(u16) > LCS_IOBUFFERSIZE)
|
||||
|
@ -1506,7 +1506,8 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
|
|||
card->tx_buffer = lcs_get_buffer(&card->write);
|
||||
if (card->tx_buffer == NULL) {
|
||||
card->stats.tx_dropped++;
|
||||
return -EBUSY;
|
||||
rc = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
card->tx_buffer->callback = lcs_txbuffer_cb;
|
||||
card->tx_buffer->count = 0;
|
||||
|
@ -1518,13 +1519,18 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
|
|||
header->type = card->lan_type;
|
||||
header->slot = card->portno;
|
||||
memcpy(header + 1, skb->data, skb->len);
|
||||
spin_unlock(&card->lock);
|
||||
card->stats.tx_bytes += skb->len;
|
||||
card->stats.tx_packets++;
|
||||
dev_kfree_skb(skb);
|
||||
if (card->tx_emitted <= 0)
|
||||
netif_wake_queue(card->dev);
|
||||
spin_lock(&card->lock);
|
||||
if (card->tx_emitted <= 0 && card->tx_buffer != NULL)
|
||||
/* If this is the first tx buffer emit it immediately. */
|
||||
__lcs_emit_txbuffer(card);
|
||||
return 0;
|
||||
out:
|
||||
spin_unlock(&card->lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1535,9 +1541,7 @@ lcs_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
|
||||
LCS_DBF_TEXT(5, trace, "pktxmit");
|
||||
card = (struct lcs_card *) dev->priv;
|
||||
spin_lock(&card->lock);
|
||||
rc = __lcs_start_xmit(card, skb, dev);
|
||||
spin_unlock(&card->lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -2319,7 +2323,6 @@ __init lcs_init_module(void)
|
|||
PRINT_ERR("Initialization failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ do { \
|
|||
*/
|
||||
#define LCS_ILLEGAL_OFFSET 0xffff
|
||||
#define LCS_IOBUFFERSIZE 0x5000
|
||||
#define LCS_NUM_BUFFS 8 /* needs to be power of 2 */
|
||||
#define LCS_NUM_BUFFS 32 /* needs to be power of 2 */
|
||||
#define LCS_MAC_LENGTH 6
|
||||
#define LCS_INVALID_PORT_NO -1
|
||||
#define LCS_LANCMD_TIMEOUT_DEFAULT 5
|
||||
|
|
|
@ -1075,16 +1075,6 @@ qeth_get_qdio_q_format(struct qeth_card *card)
|
|||
}
|
||||
}
|
||||
|
||||
static inline int
|
||||
qeth_isdigit(char * buf)
|
||||
{
|
||||
while (*buf) {
|
||||
if (!isdigit(*buf++))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int
|
||||
qeth_isxdigit(char * buf)
|
||||
{
|
||||
|
@ -1104,33 +1094,17 @@ qeth_ipaddr4_to_string(const __u8 *addr, char *buf)
|
|||
static inline int
|
||||
qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
|
||||
{
|
||||
const char *start, *end;
|
||||
char abuf[4];
|
||||
char *tmp;
|
||||
int len;
|
||||
int i;
|
||||
int count = 0, rc = 0;
|
||||
int in[4];
|
||||
|
||||
start = buf;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (i == 3) {
|
||||
end = strchr(start,0xa);
|
||||
if (end)
|
||||
len = end - start;
|
||||
else
|
||||
len = strlen(start);
|
||||
}
|
||||
else {
|
||||
end = strchr(start, '.');
|
||||
len = end - start;
|
||||
}
|
||||
if ((len <= 0) || (len > 3))
|
||||
rc = sscanf(buf, "%d.%d.%d.%d%n",
|
||||
&in[0], &in[1], &in[2], &in[3], &count);
|
||||
if (rc != 4 || count)
|
||||
return -EINVAL;
|
||||
for (count = 0; count < 4; count++) {
|
||||
if (in[count] > 255)
|
||||
return -EINVAL;
|
||||
memset(abuf, 0, 4);
|
||||
strncpy(abuf, start, len);
|
||||
if (!qeth_isdigit(abuf))
|
||||
return -EINVAL;
|
||||
addr[i] = simple_strtoul(abuf, &tmp, 10);
|
||||
start = end + 1;
|
||||
addr[count] = in[count];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1149,36 +1123,44 @@ qeth_ipaddr6_to_string(const __u8 *addr, char *buf)
|
|||
static inline int
|
||||
qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
|
||||
{
|
||||
const char *start, *end;
|
||||
u16 *tmp_addr;
|
||||
char abuf[5];
|
||||
char *tmp;
|
||||
int len;
|
||||
int i;
|
||||
char *end, *start;
|
||||
__u16 *in;
|
||||
char num[5];
|
||||
int num2, cnt, out, found, save_cnt;
|
||||
unsigned short in_tmp[8] = {0, };
|
||||
|
||||
tmp_addr = (u16 *)addr;
|
||||
start = buf;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (i == 7) {
|
||||
end = strchr(start,0xa);
|
||||
if (end)
|
||||
len = end - start;
|
||||
else
|
||||
len = strlen(start);
|
||||
cnt = out = found = save_cnt = num2 = 0;
|
||||
end = start = (char *) buf;
|
||||
in = (__u16 *) addr;
|
||||
memset(in, 0, 16);
|
||||
while (end) {
|
||||
end = strchr(end,':');
|
||||
if (end == NULL) {
|
||||
end = (char *)buf + (strlen(buf));
|
||||
out = 1;
|
||||
}
|
||||
if ((end - start)) {
|
||||
memset(num, 0, 5);
|
||||
memcpy(num, start, end - start);
|
||||
if (!qeth_isxdigit(num))
|
||||
return -EINVAL;
|
||||
sscanf(start, "%x", &num2);
|
||||
if (found)
|
||||
in_tmp[save_cnt++] = num2;
|
||||
else
|
||||
in[cnt++] = num2;
|
||||
if (out)
|
||||
break;
|
||||
} else {
|
||||
if (found)
|
||||
return -EINVAL;
|
||||
found = 1;
|
||||
}
|
||||
else {
|
||||
end = strchr(start, ':');
|
||||
len = end - start;
|
||||
}
|
||||
if ((len <= 0) || (len > 4))
|
||||
return -EINVAL;
|
||||
memset(abuf, 0, 5);
|
||||
strncpy(abuf, start, len);
|
||||
if (!qeth_isxdigit(abuf))
|
||||
return -EINVAL;
|
||||
tmp_addr[i] = simple_strtoul(abuf, &tmp, 16);
|
||||
start = end + 1;
|
||||
}
|
||||
start = ++end;
|
||||
}
|
||||
cnt = 7;
|
||||
while (save_cnt)
|
||||
in[cnt--] = in_tmp[--save_cnt];
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,7 @@ qeth_eddp_free_context(struct qeth_eddp_context *ctx)
|
|||
for (i = 0; i < ctx->num_pages; ++i)
|
||||
free_page((unsigned long)ctx->pages[i]);
|
||||
kfree(ctx->pages);
|
||||
if (ctx->elements != NULL)
|
||||
kfree(ctx->elements);
|
||||
kfree(ctx->elements);
|
||||
kfree(ctx);
|
||||
}
|
||||
|
||||
|
@ -413,6 +412,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
|
|||
|
||||
QETH_DBF_TEXT(trace, 5, "eddpftcp");
|
||||
eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl;
|
||||
if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
|
||||
eddp->skb_offset += sizeof(struct ethhdr);
|
||||
#ifdef CONFIG_QETH_VLAN
|
||||
if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q))
|
||||
eddp->skb_offset += VLAN_HLEN;
|
||||
#endif /* CONFIG_QETH_VLAN */
|
||||
}
|
||||
tcph = eddp->skb->h.th;
|
||||
while (eddp->skb_offset < eddp->skb->len) {
|
||||
data_len = min((int)skb_shinfo(eddp->skb)->tso_size,
|
||||
|
@ -483,6 +489,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
|
|||
return -ENOMEM;
|
||||
}
|
||||
if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
|
||||
skb->mac.raw = (skb->data) + sizeof(struct qeth_hdr);
|
||||
memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
|
||||
#ifdef CONFIG_QETH_VLAN
|
||||
if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
|
||||
|
|
|
@ -516,7 +516,8 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode)
|
|||
QETH_DBF_TEXT(setup, 3, "setoffl");
|
||||
QETH_DBF_HEX(setup, 3, &card, sizeof(void *));
|
||||
|
||||
netif_carrier_off(card->dev);
|
||||
if (card->dev && netif_carrier_ok(card->dev))
|
||||
netif_carrier_off(card->dev);
|
||||
recover_flag = card->state;
|
||||
if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){
|
||||
PRINT_WARN("Stopping card %s interrupted by user!\n",
|
||||
|
@ -1679,6 +1680,7 @@ qeth_cmd_timeout(unsigned long data)
|
|||
spin_unlock_irqrestore(&reply->card->lock, flags);
|
||||
}
|
||||
|
||||
|
||||
static struct qeth_ipa_cmd *
|
||||
qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob)
|
||||
{
|
||||
|
@ -1699,7 +1701,8 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob)
|
|||
QETH_CARD_IFNAME(card),
|
||||
card->info.chpid);
|
||||
card->lan_online = 0;
|
||||
netif_carrier_off(card->dev);
|
||||
if (card->dev && netif_carrier_ok(card->dev))
|
||||
netif_carrier_off(card->dev);
|
||||
return NULL;
|
||||
case IPA_CMD_STARTLAN:
|
||||
PRINT_INFO("Link reestablished on %s "
|
||||
|
@ -5562,7 +5565,7 @@ qeth_set_multicast_list(struct net_device *dev)
|
|||
if (card->info.type == QETH_CARD_TYPE_OSN)
|
||||
return ;
|
||||
|
||||
QETH_DBF_TEXT(trace,3,"setmulti");
|
||||
QETH_DBF_TEXT(trace, 3, "setmulti");
|
||||
qeth_delete_mc_addresses(card);
|
||||
if (card->options.layer2) {
|
||||
qeth_layer2_add_multicast(card);
|
||||
|
@ -5579,7 +5582,6 @@ qeth_set_multicast_list(struct net_device *dev)
|
|||
return;
|
||||
if (qeth_set_thread_start_bit(card, QETH_SET_PROMISC_MODE_THREAD)==0)
|
||||
schedule_work(&card->kernel_thread_starter);
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -7452,6 +7454,7 @@ qeth_softsetup_card(struct qeth_card *card)
|
|||
card->lan_online = 1;
|
||||
if (card->info.type==QETH_CARD_TYPE_OSN)
|
||||
goto out;
|
||||
qeth_set_large_send(card, card->options.large_send);
|
||||
if (card->options.layer2) {
|
||||
card->dev->features |=
|
||||
NETIF_F_HW_VLAN_FILTER |
|
||||
|
@ -7468,12 +7471,6 @@ qeth_softsetup_card(struct qeth_card *card)
|
|||
#endif
|
||||
goto out;
|
||||
}
|
||||
if ((card->options.large_send == QETH_LARGE_SEND_EDDP) ||
|
||||
(card->options.large_send == QETH_LARGE_SEND_TSO))
|
||||
card->dev->features |= NETIF_F_TSO | NETIF_F_SG;
|
||||
else
|
||||
card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
|
||||
|
||||
if ((rc = qeth_setadapter_parms(card)))
|
||||
QETH_DBF_TEXT_(setup, 2, "2err%d", rc);
|
||||
if ((rc = qeth_start_ipassists(card)))
|
||||
|
|
|
@ -710,10 +710,9 @@ static inline void
|
|||
_zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
|
||||
struct zfcp_adapter *adapter,
|
||||
struct scsi_cmnd *scsi_cmnd,
|
||||
struct zfcp_fsf_req *new_fsf_req)
|
||||
struct zfcp_fsf_req *fsf_req,
|
||||
struct zfcp_fsf_req *old_fsf_req)
|
||||
{
|
||||
struct zfcp_fsf_req *fsf_req =
|
||||
(struct zfcp_fsf_req *)scsi_cmnd->host_scribble;
|
||||
struct zfcp_scsi_dbf_record *rec = &adapter->scsi_dbf_buf;
|
||||
struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
|
||||
unsigned long flags;
|
||||
|
@ -727,19 +726,20 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
|
|||
if (offset == 0) {
|
||||
strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
|
||||
strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE);
|
||||
if (scsi_cmnd->device) {
|
||||
rec->scsi_id = scsi_cmnd->device->id;
|
||||
rec->scsi_lun = scsi_cmnd->device->lun;
|
||||
if (scsi_cmnd != NULL) {
|
||||
if (scsi_cmnd->device) {
|
||||
rec->scsi_id = scsi_cmnd->device->id;
|
||||
rec->scsi_lun = scsi_cmnd->device->lun;
|
||||
}
|
||||
rec->scsi_result = scsi_cmnd->result;
|
||||
rec->scsi_cmnd = (unsigned long)scsi_cmnd;
|
||||
rec->scsi_serial = scsi_cmnd->serial_number;
|
||||
memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd,
|
||||
min((int)scsi_cmnd->cmd_len,
|
||||
ZFCP_DBF_SCSI_OPCODE));
|
||||
rec->scsi_retries = scsi_cmnd->retries;
|
||||
rec->scsi_allowed = scsi_cmnd->allowed;
|
||||
}
|
||||
rec->scsi_result = scsi_cmnd->result;
|
||||
rec->scsi_cmnd = (unsigned long)scsi_cmnd;
|
||||
rec->scsi_serial = scsi_cmnd->serial_number;
|
||||
memcpy(rec->scsi_opcode,
|
||||
&scsi_cmnd->cmnd,
|
||||
min((int)scsi_cmnd->cmd_len,
|
||||
ZFCP_DBF_SCSI_OPCODE));
|
||||
rec->scsi_retries = scsi_cmnd->retries;
|
||||
rec->scsi_allowed = scsi_cmnd->allowed;
|
||||
if (fsf_req != NULL) {
|
||||
fcp_rsp = (struct fcp_rsp_iu *)
|
||||
&(fsf_req->qtcb->bottom.io.fcp_rsp);
|
||||
|
@ -772,15 +772,8 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
|
|||
rec->fsf_seqno = fsf_req->seq_no;
|
||||
rec->fsf_issued = fsf_req->issued;
|
||||
}
|
||||
if (new_fsf_req != NULL) {
|
||||
rec->type.new_fsf_req.fsf_reqid =
|
||||
(unsigned long)
|
||||
new_fsf_req;
|
||||
rec->type.new_fsf_req.fsf_seqno =
|
||||
new_fsf_req->seq_no;
|
||||
rec->type.new_fsf_req.fsf_issued =
|
||||
new_fsf_req->issued;
|
||||
}
|
||||
rec->type.old_fsf_reqid =
|
||||
(unsigned long) old_fsf_req;
|
||||
} else {
|
||||
strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
|
||||
dump->total_size = buflen;
|
||||
|
@ -801,19 +794,21 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
|
|||
inline void
|
||||
zfcp_scsi_dbf_event_result(const char *tag, int level,
|
||||
struct zfcp_adapter *adapter,
|
||||
struct scsi_cmnd *scsi_cmnd)
|
||||
struct scsi_cmnd *scsi_cmnd,
|
||||
struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
_zfcp_scsi_dbf_event_common("rslt",
|
||||
tag, level, adapter, scsi_cmnd, NULL);
|
||||
_zfcp_scsi_dbf_event_common("rslt", tag, level,
|
||||
adapter, scsi_cmnd, fsf_req, NULL);
|
||||
}
|
||||
|
||||
inline void
|
||||
zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter,
|
||||
struct scsi_cmnd *scsi_cmnd,
|
||||
struct zfcp_fsf_req *new_fsf_req)
|
||||
struct zfcp_fsf_req *new_fsf_req,
|
||||
struct zfcp_fsf_req *old_fsf_req)
|
||||
{
|
||||
_zfcp_scsi_dbf_event_common("abrt",
|
||||
tag, 1, adapter, scsi_cmnd, new_fsf_req);
|
||||
_zfcp_scsi_dbf_event_common("abrt", tag, 1,
|
||||
adapter, scsi_cmnd, new_fsf_req, old_fsf_req);
|
||||
}
|
||||
|
||||
inline void
|
||||
|
@ -823,7 +818,7 @@ zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
|
|||
struct zfcp_adapter *adapter = unit->port->adapter;
|
||||
|
||||
_zfcp_scsi_dbf_event_common(flag == FCP_TARGET_RESET ? "trst" : "lrst",
|
||||
tag, 1, adapter, scsi_cmnd, NULL);
|
||||
tag, 1, adapter, scsi_cmnd, NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -856,6 +851,10 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
|
|||
rec->scsi_retries);
|
||||
len += zfcp_dbf_view(out_buf + len, "scsi_allowed", "0x%02x",
|
||||
rec->scsi_allowed);
|
||||
if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
|
||||
len += zfcp_dbf_view(out_buf + len, "old_fsf_reqid", "0x%0Lx",
|
||||
rec->type.old_fsf_reqid);
|
||||
}
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
|
||||
rec->fsf_reqid);
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
|
||||
|
@ -883,21 +882,6 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
|
|||
min((int)rec->type.fcp.sns_info_len,
|
||||
ZFCP_DBF_SCSI_FCP_SNS_INFO), 0,
|
||||
rec->type.fcp.sns_info_len);
|
||||
} else if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_reqid_abort", "0x%0Lx",
|
||||
rec->type.new_fsf_req.fsf_reqid);
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_seqno_abort", "0x%08x",
|
||||
rec->type.new_fsf_req.fsf_seqno);
|
||||
len += zfcp_dbf_stck(out_buf + len, "fsf_issued",
|
||||
rec->type.new_fsf_req.fsf_issued);
|
||||
} else if ((strncmp(rec->tag, "trst", ZFCP_DBF_TAG_SIZE) == 0) ||
|
||||
(strncmp(rec->tag, "lrst", ZFCP_DBF_TAG_SIZE) == 0)) {
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_reqid_reset", "0x%0Lx",
|
||||
rec->type.new_fsf_req.fsf_reqid);
|
||||
len += zfcp_dbf_view(out_buf + len, "fsf_seqno_reset", "0x%08x",
|
||||
rec->type.new_fsf_req.fsf_seqno);
|
||||
len += zfcp_dbf_stck(out_buf + len, "fsf_issued",
|
||||
rec->type.new_fsf_req.fsf_issued);
|
||||
}
|
||||
|
||||
len += sprintf(out_buf + len, "\n");
|
||||
|
|
|
@ -152,11 +152,6 @@ typedef u32 scsi_lun_t;
|
|||
#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100
|
||||
#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
|
||||
|
||||
/* Retry 5 times every 2 second, then every minute */
|
||||
#define ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES 5
|
||||
#define ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP 200
|
||||
#define ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP 6000
|
||||
|
||||
/* timeout value for "default timer" for fsf requests */
|
||||
#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ);
|
||||
|
||||
|
@ -429,11 +424,7 @@ struct zfcp_scsi_dbf_record {
|
|||
u32 fsf_seqno;
|
||||
u64 fsf_issued;
|
||||
union {
|
||||
struct {
|
||||
u64 fsf_reqid;
|
||||
u32 fsf_seqno;
|
||||
u64 fsf_issued;
|
||||
} new_fsf_req;
|
||||
u64 old_fsf_reqid;
|
||||
struct {
|
||||
u8 rsp_validity;
|
||||
u8 rsp_scsi_status;
|
||||
|
@ -915,8 +906,6 @@ struct zfcp_adapter {
|
|||
wwn_t peer_wwnn; /* P2P peer WWNN */
|
||||
wwn_t peer_wwpn; /* P2P peer WWPN */
|
||||
u32 peer_d_id; /* P2P peer D_ID */
|
||||
wwn_t physical_wwpn; /* WWPN of physical port */
|
||||
u32 physical_s_id; /* local FC port ID */
|
||||
struct ccw_device *ccw_device; /* S/390 ccw device */
|
||||
u8 fc_service_class;
|
||||
u32 hydra_version; /* Hydra version */
|
||||
|
|
|
@ -2246,15 +2246,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
|
|||
{
|
||||
int retval;
|
||||
|
||||
if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,
|
||||
&erp_action->adapter->status)) &&
|
||||
(erp_action->adapter->adapter_features &
|
||||
FSF_FEATURE_HBAAPI_MANAGEMENT)) {
|
||||
zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);
|
||||
atomic_set(&erp_action->adapter->erp_counter, 0);
|
||||
return ZFCP_ERP_FAILED;
|
||||
}
|
||||
|
||||
retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action);
|
||||
if (retval == ZFCP_ERP_FAILED)
|
||||
return ZFCP_ERP_FAILED;
|
||||
|
@ -2266,13 +2257,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
|
|||
return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action);
|
||||
}
|
||||
|
||||
/*
|
||||
* function:
|
||||
*
|
||||
* purpose:
|
||||
*
|
||||
* returns:
|
||||
*/
|
||||
static int
|
||||
zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
|
||||
{
|
||||
|
@ -2350,48 +2334,40 @@ static int
|
|||
zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
|
||||
{
|
||||
int ret;
|
||||
int retries;
|
||||
int sleep;
|
||||
struct zfcp_adapter *adapter = erp_action->adapter;
|
||||
struct zfcp_adapter *adapter;
|
||||
|
||||
adapter = erp_action->adapter;
|
||||
atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
|
||||
|
||||
retries = 0;
|
||||
do {
|
||||
write_lock(&adapter->erp_lock);
|
||||
zfcp_erp_action_to_running(erp_action);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
zfcp_erp_timeout_init(erp_action);
|
||||
ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
|
||||
if (ret == -EOPNOTSUPP) {
|
||||
debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
|
||||
return ZFCP_ERP_SUCCEEDED;
|
||||
} else if (ret) {
|
||||
debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
|
||||
return ZFCP_ERP_FAILED;
|
||||
}
|
||||
debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
|
||||
write_lock(&adapter->erp_lock);
|
||||
zfcp_erp_action_to_running(erp_action);
|
||||
write_unlock(&adapter->erp_lock);
|
||||
|
||||
down(&adapter->erp_ready_sem);
|
||||
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
|
||||
ZFCP_LOG_INFO("error: exchange of port data "
|
||||
"for adapter %s timed out\n",
|
||||
zfcp_get_busid_by_adapter(adapter));
|
||||
break;
|
||||
}
|
||||
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,
|
||||
&adapter->status))
|
||||
break;
|
||||
zfcp_erp_timeout_init(erp_action);
|
||||
ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
|
||||
if (ret == -EOPNOTSUPP) {
|
||||
debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
|
||||
return ZFCP_ERP_SUCCEEDED;
|
||||
} else if (ret) {
|
||||
debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
|
||||
return ZFCP_ERP_FAILED;
|
||||
}
|
||||
debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
|
||||
|
||||
if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) {
|
||||
sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP;
|
||||
retries++;
|
||||
} else
|
||||
sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP;
|
||||
schedule_timeout(sleep);
|
||||
} while (1);
|
||||
ret = ZFCP_ERP_SUCCEEDED;
|
||||
down(&adapter->erp_ready_sem);
|
||||
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
|
||||
ZFCP_LOG_INFO("error: exchange port data timed out (adapter "
|
||||
"%s)\n", zfcp_get_busid_by_adapter(adapter));
|
||||
ret = ZFCP_ERP_FAILED;
|
||||
}
|
||||
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status)) {
|
||||
ZFCP_LOG_INFO("error: exchange port data failed (adapter "
|
||||
"%s\n", zfcp_get_busid_by_adapter(adapter));
|
||||
ret = ZFCP_ERP_FAILED;
|
||||
}
|
||||
|
||||
return ZFCP_ERP_SUCCEEDED;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3439,6 +3415,8 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
|
|||
"(adapter %s, wwpn=0x%016Lx)\n",
|
||||
zfcp_get_busid_by_port(port),
|
||||
port->wwpn);
|
||||
else
|
||||
scsi_flush_work(adapter->scsi_host);
|
||||
}
|
||||
zfcp_port_put(port);
|
||||
break;
|
||||
|
|
|
@ -194,9 +194,10 @@ extern void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *);
|
|||
extern void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *);
|
||||
|
||||
extern void zfcp_scsi_dbf_event_result(const char *, int, struct zfcp_adapter *,
|
||||
struct scsi_cmnd *);
|
||||
struct scsi_cmnd *,
|
||||
struct zfcp_fsf_req *);
|
||||
extern void zfcp_scsi_dbf_event_abort(const char *, struct zfcp_adapter *,
|
||||
struct scsi_cmnd *,
|
||||
struct scsi_cmnd *, struct zfcp_fsf_req *,
|
||||
struct zfcp_fsf_req *);
|
||||
extern void zfcp_scsi_dbf_event_devreset(const char *, u8, struct zfcp_unit *,
|
||||
struct scsi_cmnd *);
|
||||
|
|
|
@ -388,6 +388,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
|
|||
case FSF_PROT_LINK_DOWN:
|
||||
zfcp_fsf_link_down_info_eval(adapter,
|
||||
&prot_status_qual->link_down_info);
|
||||
zfcp_erp_adapter_reopen(adapter, 0);
|
||||
fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
|
||||
break;
|
||||
|
||||
|
@ -558,10 +559,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
|
|||
|
||||
atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status);
|
||||
|
||||
if (link_down == NULL) {
|
||||
zfcp_erp_adapter_reopen(adapter, 0);
|
||||
return;
|
||||
}
|
||||
if (link_down == NULL)
|
||||
goto out;
|
||||
|
||||
switch (link_down->error_code) {
|
||||
case FSF_PSQ_LINK_NO_LIGHT:
|
||||
|
@ -643,16 +642,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
|
|||
link_down->explanation_code,
|
||||
link_down->vendor_specific_code);
|
||||
|
||||
switch (link_down->error_code) {
|
||||
case FSF_PSQ_LINK_NO_LIGHT:
|
||||
case FSF_PSQ_LINK_WRAP_PLUG:
|
||||
case FSF_PSQ_LINK_NO_FCP:
|
||||
case FSF_PSQ_LINK_FIRMWARE_UPDATE:
|
||||
zfcp_erp_adapter_reopen(adapter, 0);
|
||||
break;
|
||||
default:
|
||||
zfcp_erp_adapter_failed(adapter);
|
||||
}
|
||||
out:
|
||||
zfcp_erp_adapter_failed(adapter);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2304,6 +2295,35 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_fsf_exchange_port_evaluate
|
||||
* @fsf_req: fsf_req which belongs to xchg port data request
|
||||
* @xchg_ok: specifies if xchg port data was incomplete or complete (0/1)
|
||||
*/
|
||||
static void
|
||||
zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
|
||||
{
|
||||
struct zfcp_adapter *adapter;
|
||||
struct fsf_qtcb *qtcb;
|
||||
struct fsf_qtcb_bottom_port *bottom, *data;
|
||||
struct Scsi_Host *shost;
|
||||
|
||||
adapter = fsf_req->adapter;
|
||||
qtcb = fsf_req->qtcb;
|
||||
bottom = &qtcb->bottom.port;
|
||||
shost = adapter->scsi_host;
|
||||
|
||||
data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
|
||||
if (data)
|
||||
memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
|
||||
|
||||
if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
|
||||
fc_host_permanent_port_name(shost) = bottom->wwpn;
|
||||
else
|
||||
fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
|
||||
fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
|
||||
fc_host_supported_speeds(shost) = bottom->supported_speed;
|
||||
}
|
||||
|
||||
/**
|
||||
* zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request
|
||||
|
@ -2312,38 +2332,26 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
|
|||
static void
|
||||
zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
|
||||
{
|
||||
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||
struct Scsi_Host *shost = adapter->scsi_host;
|
||||
struct fsf_qtcb *qtcb = fsf_req->qtcb;
|
||||
struct fsf_qtcb_bottom_port *bottom, *data;
|
||||
struct zfcp_adapter *adapter;
|
||||
struct fsf_qtcb *qtcb;
|
||||
|
||||
adapter = fsf_req->adapter;
|
||||
qtcb = fsf_req->qtcb;
|
||||
|
||||
if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)
|
||||
return;
|
||||
|
||||
switch (qtcb->header.fsf_status) {
|
||||
case FSF_GOOD:
|
||||
zfcp_fsf_exchange_port_evaluate(fsf_req, 1);
|
||||
atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
|
||||
|
||||
bottom = &qtcb->bottom.port;
|
||||
data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
|
||||
if (data)
|
||||
memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
|
||||
if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
|
||||
fc_host_permanent_port_name(shost) = bottom->wwpn;
|
||||
else
|
||||
fc_host_permanent_port_name(shost) =
|
||||
fc_host_port_name(shost);
|
||||
fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
|
||||
fc_host_supported_speeds(shost) = bottom->supported_speed;
|
||||
break;
|
||||
|
||||
case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
|
||||
zfcp_fsf_exchange_port_evaluate(fsf_req, 0);
|
||||
atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
|
||||
|
||||
zfcp_fsf_link_down_info_eval(adapter,
|
||||
&qtcb->header.fsf_status_qual.link_down_info);
|
||||
break;
|
||||
|
||||
default:
|
||||
debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng");
|
||||
debug_event(adapter->erp_dbf, 0,
|
||||
|
@ -4203,11 +4211,11 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
|
|||
ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result);
|
||||
|
||||
if (scpnt->result != 0)
|
||||
zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt);
|
||||
zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt, fsf_req);
|
||||
else if (scpnt->retries > 0)
|
||||
zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt);
|
||||
zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt, fsf_req);
|
||||
else
|
||||
zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt);
|
||||
zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt, fsf_req);
|
||||
|
||||
/* cleanup pointer (need this especially for abort) */
|
||||
scpnt->host_scribble = NULL;
|
||||
|
|
|
@ -242,7 +242,7 @@ zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
|
|||
if ((scpnt->device != NULL) && (scpnt->device->host != NULL))
|
||||
zfcp_scsi_dbf_event_result("fail", 4,
|
||||
(struct zfcp_adapter*) scpnt->device->host->hostdata[0],
|
||||
scpnt);
|
||||
scpnt, NULL);
|
||||
/* return directly */
|
||||
scpnt->scsi_done(scpnt);
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
|
|||
old_fsf_req = (struct zfcp_fsf_req *) scpnt->host_scribble;
|
||||
if (!old_fsf_req) {
|
||||
write_unlock_irqrestore(&adapter->abort_lock, flags);
|
||||
zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, new_fsf_req);
|
||||
zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, NULL);
|
||||
retval = SUCCESS;
|
||||
goto out;
|
||||
}
|
||||
|
@ -460,6 +460,8 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
|
|||
adapter, unit, 0);
|
||||
if (!new_fsf_req) {
|
||||
ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n");
|
||||
zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL,
|
||||
old_fsf_req);
|
||||
retval = FAILED;
|
||||
goto out;
|
||||
}
|
||||
|
@ -470,13 +472,16 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
|
|||
|
||||
/* status should be valid since signals were not permitted */
|
||||
if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) {
|
||||
zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req);
|
||||
zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req,
|
||||
NULL);
|
||||
retval = SUCCESS;
|
||||
} else if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) {
|
||||
zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req);
|
||||
zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req,
|
||||
NULL);
|
||||
retval = SUCCESS;
|
||||
} else {
|
||||
zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req);
|
||||
zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req,
|
||||
NULL);
|
||||
retval = FAILED;
|
||||
}
|
||||
zfcp_fsf_req_free(new_fsf_req);
|
||||
|
|
|
@ -55,8 +55,6 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status));
|
|||
ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version);
|
||||
ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n",
|
||||
|
@ -241,8 +239,6 @@ static struct attribute *zfcp_adapter_attrs[] = {
|
|||
&dev_attr_peer_wwnn.attr,
|
||||
&dev_attr_peer_wwpn.attr,
|
||||
&dev_attr_peer_d_id.attr,
|
||||
&dev_attr_physical_wwpn.attr,
|
||||
&dev_attr_physical_s_id.attr,
|
||||
&dev_attr_card_version.attr,
|
||||
&dev_attr_lic_version.attr,
|
||||
&dev_attr_status.attr,
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
Add support for embedded firmware error strings.
|
||||
2.26.02.003 - Correctly handle single sgl's with use_sg=1.
|
||||
2.26.02.004 - Add support for 9550SX controllers.
|
||||
2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@ -84,7 +85,7 @@
|
|||
#include "3w-9xxx.h"
|
||||
|
||||
/* Globals */
|
||||
#define TW_DRIVER_VERSION "2.26.02.004"
|
||||
#define TW_DRIVER_VERSION "2.26.02.005"
|
||||
static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
|
||||
static unsigned int twa_device_extension_count;
|
||||
static int twa_major = -1;
|
||||
|
@ -1408,7 +1409,7 @@ static dma_addr_t twa_map_scsi_single_data(TW_Device_Extension *tw_dev, int requ
|
|||
dma_addr_t mapping;
|
||||
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
|
||||
struct pci_dev *pdev = tw_dev->tw_pci_dev;
|
||||
int retval = 0;
|
||||
dma_addr_t retval = 0;
|
||||
|
||||
if (cmd->request_bufflen == 0) {
|
||||
retval = 0;
|
||||
|
@ -1798,7 +1799,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
|
|||
int i, sg_count;
|
||||
struct scsi_cmnd *srb = NULL;
|
||||
struct scatterlist *sglist = NULL;
|
||||
u32 buffaddr = 0x0;
|
||||
dma_addr_t buffaddr = 0x0;
|
||||
int retval = 1;
|
||||
|
||||
if (tw_dev->srb[request_id]) {
|
||||
|
|
|
@ -173,10 +173,10 @@ int aac_get_config_status(struct aac_dev *dev)
|
|||
int status = 0;
|
||||
struct fib * fibptr;
|
||||
|
||||
if (!(fibptr = fib_alloc(dev)))
|
||||
if (!(fibptr = aac_fib_alloc(dev)))
|
||||
return -ENOMEM;
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
{
|
||||
struct aac_get_config_status *dinfo;
|
||||
dinfo = (struct aac_get_config_status *) fib_data(fibptr);
|
||||
|
@ -186,7 +186,7 @@ int aac_get_config_status(struct aac_dev *dev)
|
|||
dinfo->count = cpu_to_le32(sizeof(((struct aac_get_config_status_resp *)NULL)->data));
|
||||
}
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof (struct aac_get_config_status),
|
||||
FsaNormal,
|
||||
|
@ -209,30 +209,30 @@ int aac_get_config_status(struct aac_dev *dev)
|
|||
status = -EINVAL;
|
||||
}
|
||||
}
|
||||
fib_complete(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
/* Send a CT_COMMIT_CONFIG to enable discovery of devices */
|
||||
if (status >= 0) {
|
||||
if (commit == 1) {
|
||||
struct aac_commit_config * dinfo;
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
dinfo = (struct aac_commit_config *) fib_data(fibptr);
|
||||
|
||||
dinfo->command = cpu_to_le32(VM_ContainerConfig);
|
||||
dinfo->type = cpu_to_le32(CT_COMMIT_CONFIG);
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof (struct aac_commit_config),
|
||||
FsaNormal,
|
||||
1, 1,
|
||||
NULL, NULL);
|
||||
fib_complete(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
} else if (commit == 0) {
|
||||
printk(KERN_WARNING
|
||||
"aac_get_config_status: Foreign device configurations are being ignored\n");
|
||||
}
|
||||
}
|
||||
fib_free(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -255,15 +255,15 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
|
||||
instance = dev->scsi_host_ptr->unique_id;
|
||||
|
||||
if (!(fibptr = fib_alloc(dev)))
|
||||
if (!(fibptr = aac_fib_alloc(dev)))
|
||||
return -ENOMEM;
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
dinfo = (struct aac_get_container_count *) fib_data(fibptr);
|
||||
dinfo->command = cpu_to_le32(VM_ContainerConfig);
|
||||
dinfo->type = cpu_to_le32(CT_GET_CONTAINER_COUNT);
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof (struct aac_get_container_count),
|
||||
FsaNormal,
|
||||
|
@ -272,7 +272,7 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
if (status >= 0) {
|
||||
dresp = (struct aac_get_container_count_resp *)fib_data(fibptr);
|
||||
maximum_num_containers = le32_to_cpu(dresp->ContainerSwitchEntries);
|
||||
fib_complete(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
}
|
||||
|
||||
if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
|
||||
|
@ -280,7 +280,7 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
fsa_dev_ptr = (struct fsa_dev_info *) kmalloc(
|
||||
sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
|
||||
if (!fsa_dev_ptr) {
|
||||
fib_free(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(fsa_dev_ptr, 0, sizeof(*fsa_dev_ptr) * maximum_num_containers);
|
||||
|
@ -294,14 +294,14 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
|
||||
fsa_dev_ptr[index].devname[0] = '\0';
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
dinfo = (struct aac_query_mount *) fib_data(fibptr);
|
||||
|
||||
dinfo->command = cpu_to_le32(VM_NameServe);
|
||||
dinfo->count = cpu_to_le32(index);
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof (struct aac_query_mount),
|
||||
FsaNormal,
|
||||
|
@ -319,7 +319,7 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
dinfo->count = cpu_to_le32(index);
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
|
||||
if (fib_send(ContainerCommand,
|
||||
if (aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof(struct aac_query_mount),
|
||||
FsaNormal,
|
||||
|
@ -347,7 +347,7 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
if (le32_to_cpu(dresp->mnt[0].state) & FSCS_READONLY)
|
||||
fsa_dev_ptr[index].ro = 1;
|
||||
}
|
||||
fib_complete(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
/*
|
||||
* If there are no more containers, then stop asking.
|
||||
*/
|
||||
|
@ -355,7 +355,7 @@ int aac_get_containers(struct aac_dev *dev)
|
|||
break;
|
||||
}
|
||||
}
|
||||
fib_free(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -413,8 +413,8 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
|
|||
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
|
||||
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
}
|
||||
|
||||
|
@ -430,10 +430,10 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
|
|||
|
||||
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
|
||||
|
||||
if (!(cmd_fibcontext = fib_alloc(dev)))
|
||||
if (!(cmd_fibcontext = aac_fib_alloc(dev)))
|
||||
return -ENOMEM;
|
||||
|
||||
fib_init(cmd_fibcontext);
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext);
|
||||
|
||||
dinfo->command = cpu_to_le32(VM_ContainerConfig);
|
||||
|
@ -441,7 +441,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
|
|||
dinfo->cid = cpu_to_le32(cid);
|
||||
dinfo->count = cpu_to_le32(sizeof(((struct aac_get_name_resp *)NULL)->data));
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
cmd_fibcontext,
|
||||
sizeof (struct aac_get_name),
|
||||
FsaNormal,
|
||||
|
@ -455,14 +455,14 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
|
|||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
|
||||
printk(KERN_WARNING "aac_get_container_name: fib_send failed with status: %d.\n", status);
|
||||
fib_complete(cmd_fibcontext);
|
||||
fib_free(cmd_fibcontext);
|
||||
printk(KERN_WARNING "aac_get_container_name: aac_fib_send failed with status: %d.\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* probe_container - query a logical volume
|
||||
* aac_probe_container - query a logical volume
|
||||
* @dev: device to query
|
||||
* @cid: container identifier
|
||||
*
|
||||
|
@ -470,7 +470,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
|
|||
* is updated in the struct fsa_dev_info structure rather than returned.
|
||||
*/
|
||||
|
||||
int probe_container(struct aac_dev *dev, int cid)
|
||||
int aac_probe_container(struct aac_dev *dev, int cid)
|
||||
{
|
||||
struct fsa_dev_info *fsa_dev_ptr;
|
||||
int status;
|
||||
|
@ -482,10 +482,10 @@ int probe_container(struct aac_dev *dev, int cid)
|
|||
fsa_dev_ptr = dev->fsa_dev;
|
||||
instance = dev->scsi_host_ptr->unique_id;
|
||||
|
||||
if (!(fibptr = fib_alloc(dev)))
|
||||
if (!(fibptr = aac_fib_alloc(dev)))
|
||||
return -ENOMEM;
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
|
||||
dinfo = (struct aac_query_mount *)fib_data(fibptr);
|
||||
|
||||
|
@ -493,14 +493,14 @@ int probe_container(struct aac_dev *dev, int cid)
|
|||
dinfo->count = cpu_to_le32(cid);
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof(struct aac_query_mount),
|
||||
FsaNormal,
|
||||
1, 1,
|
||||
NULL, NULL);
|
||||
if (status < 0) {
|
||||
printk(KERN_WARNING "aacraid: probe_container query failed.\n");
|
||||
printk(KERN_WARNING "aacraid: aac_probe_container query failed.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@ int probe_container(struct aac_dev *dev, int cid)
|
|||
dinfo->count = cpu_to_le32(cid);
|
||||
dinfo->type = cpu_to_le32(FT_FILESYS);
|
||||
|
||||
if (fib_send(ContainerCommand,
|
||||
if (aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof(struct aac_query_mount),
|
||||
FsaNormal,
|
||||
|
@ -535,8 +535,8 @@ int probe_container(struct aac_dev *dev, int cid)
|
|||
}
|
||||
|
||||
error:
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -700,14 +700,14 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
struct aac_bus_info *command;
|
||||
struct aac_bus_info_response *bus_info;
|
||||
|
||||
if (!(fibptr = fib_alloc(dev)))
|
||||
if (!(fibptr = aac_fib_alloc(dev)))
|
||||
return -ENOMEM;
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
info = (struct aac_adapter_info *) fib_data(fibptr);
|
||||
memset(info,0,sizeof(*info));
|
||||
|
||||
rcode = fib_send(RequestAdapterInfo,
|
||||
rcode = aac_fib_send(RequestAdapterInfo,
|
||||
fibptr,
|
||||
sizeof(*info),
|
||||
FsaNormal,
|
||||
|
@ -716,8 +716,8 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
NULL);
|
||||
|
||||
if (rcode < 0) {
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
return rcode;
|
||||
}
|
||||
memcpy(&dev->adapter_info, info, sizeof(*info));
|
||||
|
@ -725,13 +725,13 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
if (dev->adapter_info.options & AAC_OPT_SUPPLEMENT_ADAPTER_INFO) {
|
||||
struct aac_supplement_adapter_info * info;
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
|
||||
info = (struct aac_supplement_adapter_info *) fib_data(fibptr);
|
||||
|
||||
memset(info,0,sizeof(*info));
|
||||
|
||||
rcode = fib_send(RequestSupplementAdapterInfo,
|
||||
rcode = aac_fib_send(RequestSupplementAdapterInfo,
|
||||
fibptr,
|
||||
sizeof(*info),
|
||||
FsaNormal,
|
||||
|
@ -748,7 +748,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
* GetBusInfo
|
||||
*/
|
||||
|
||||
fib_init(fibptr);
|
||||
aac_fib_init(fibptr);
|
||||
|
||||
bus_info = (struct aac_bus_info_response *) fib_data(fibptr);
|
||||
|
||||
|
@ -761,7 +761,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
command->MethodId = cpu_to_le32(1);
|
||||
command->CtlCmd = cpu_to_le32(GetBusInfo);
|
||||
|
||||
rcode = fib_send(ContainerCommand,
|
||||
rcode = aac_fib_send(ContainerCommand,
|
||||
fibptr,
|
||||
sizeof (*bus_info),
|
||||
FsaNormal,
|
||||
|
@ -891,8 +891,8 @@ int aac_get_adapter_info(struct aac_dev* dev)
|
|||
}
|
||||
}
|
||||
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
|
||||
return rcode;
|
||||
}
|
||||
|
@ -976,8 +976,8 @@ static void io_callback(void *context, struct fib * fibptr)
|
|||
? sizeof(scsicmd->sense_buffer)
|
||||
: sizeof(dev->fsa_dev[cid].sense_data));
|
||||
}
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
}
|
||||
|
@ -1062,11 +1062,11 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Alocate and initialize a Fib
|
||||
*/
|
||||
if (!(cmd_fibcontext = fib_alloc(dev))) {
|
||||
if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
fib_init(cmd_fibcontext);
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
|
||||
if (dev->raw_io_interface) {
|
||||
struct aac_raw_io *readcmd;
|
||||
|
@ -1086,7 +1086,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerRawIo,
|
||||
status = aac_fib_send(ContainerRawIo,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1112,7 +1112,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerCommand64,
|
||||
status = aac_fib_send(ContainerCommand64,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1136,7 +1136,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1153,14 +1153,14 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
|
|||
if (status == -EINPROGRESS)
|
||||
return 0;
|
||||
|
||||
printk(KERN_WARNING "aac_read: fib_send failed with status: %d.\n", status);
|
||||
printk(KERN_WARNING "aac_read: aac_fib_send failed with status: %d.\n", status);
|
||||
/*
|
||||
* For some reason, the Fib didn't queue, return QUEUE_FULL
|
||||
*/
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
fib_complete(cmd_fibcontext);
|
||||
fib_free(cmd_fibcontext);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1228,12 +1228,12 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Allocate and initialize a Fib then setup a BlockWrite command
|
||||
*/
|
||||
if (!(cmd_fibcontext = fib_alloc(dev))) {
|
||||
if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
|
||||
scsicmd->result = DID_ERROR << 16;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
return 0;
|
||||
}
|
||||
fib_init(cmd_fibcontext);
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
|
||||
if (dev->raw_io_interface) {
|
||||
struct aac_raw_io *writecmd;
|
||||
|
@ -1253,7 +1253,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerRawIo,
|
||||
status = aac_fib_send(ContainerRawIo,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1279,7 +1279,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerCommand64,
|
||||
status = aac_fib_send(ContainerCommand64,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1305,7 +1305,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
cmd_fibcontext,
|
||||
fibsize,
|
||||
FsaNormal,
|
||||
|
@ -1322,15 +1322,15 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_write: fib_send failed with status: %d\n", status);
|
||||
printk(KERN_WARNING "aac_write: aac_fib_send failed with status: %d\n", status);
|
||||
/*
|
||||
* For some reason, the Fib didn't queue, return QUEUE_FULL
|
||||
*/
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
|
||||
fib_complete(cmd_fibcontext);
|
||||
fib_free(cmd_fibcontext);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1369,8 +1369,8 @@ static void synchronize_callback(void *context, struct fib *fibptr)
|
|||
sizeof(cmd->sense_buffer)));
|
||||
}
|
||||
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
cmd->scsi_done(cmd);
|
||||
}
|
||||
|
||||
|
@ -1407,10 +1407,10 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
|
|||
* Allocate and initialize a Fib
|
||||
*/
|
||||
if (!(cmd_fibcontext =
|
||||
fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata)))
|
||||
aac_fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata)))
|
||||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
|
||||
fib_init(cmd_fibcontext);
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
|
||||
synchronizecmd = fib_data(cmd_fibcontext);
|
||||
synchronizecmd->command = cpu_to_le32(VM_ContainerConfig);
|
||||
|
@ -1422,7 +1422,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ContainerCommand,
|
||||
status = aac_fib_send(ContainerCommand,
|
||||
cmd_fibcontext,
|
||||
sizeof(struct aac_synchronize),
|
||||
FsaNormal,
|
||||
|
@ -1437,9 +1437,9 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
|
|||
return 0;
|
||||
|
||||
printk(KERN_WARNING
|
||||
"aac_synchronize: fib_send failed with status: %d.\n", status);
|
||||
fib_complete(cmd_fibcontext);
|
||||
fib_free(cmd_fibcontext);
|
||||
"aac_synchronize: aac_fib_send failed with status: %d.\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
}
|
||||
|
||||
|
@ -1465,7 +1465,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
|||
* itself.
|
||||
*/
|
||||
if (scmd_id(scsicmd) != host->this_id) {
|
||||
if ((scsicmd->device->channel == 0) ){
|
||||
if ((scsicmd->device->channel == CONTAINER_CHANNEL)) {
|
||||
if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){
|
||||
scsicmd->result = DID_NO_CONNECT << 16;
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
|
@ -1488,7 +1488,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
|
|||
case READ_CAPACITY:
|
||||
case TEST_UNIT_READY:
|
||||
spin_unlock_irq(host->host_lock);
|
||||
probe_container(dev, cid);
|
||||
aac_probe_container(dev, cid);
|
||||
if ((fsa_dev_ptr[cid].valid & 1) == 0)
|
||||
fsa_dev_ptr[cid].valid = 0;
|
||||
spin_lock_irq(host->host_lock);
|
||||
|
@ -1935,33 +1935,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
|||
case SRB_STATUS_ERROR_RECOVERY:
|
||||
case SRB_STATUS_PENDING:
|
||||
case SRB_STATUS_SUCCESS:
|
||||
if(scsicmd->cmnd[0] == INQUIRY ){
|
||||
u8 b;
|
||||
u8 b1;
|
||||
/* We can't expose disk devices because we can't tell whether they
|
||||
* are the raw container drives or stand alone drives. If they have
|
||||
* the removable bit set then we should expose them though.
|
||||
*/
|
||||
b = (*(u8*)scsicmd->buffer)&0x1f;
|
||||
b1 = ((u8*)scsicmd->buffer)[1];
|
||||
if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER
|
||||
|| (b==TYPE_DISK && (b1&0x80)) ){
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
/*
|
||||
* We will allow disk devices if in RAID/SCSI mode and
|
||||
* the channel is 2
|
||||
*/
|
||||
} else if ((dev->raid_scsi_mode) &&
|
||||
(scmd_channel(scsicmd) == 2)) {
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8;
|
||||
} else {
|
||||
scsicmd->result = DID_NO_CONNECT << 16 |
|
||||
COMMAND_COMPLETE << 8;
|
||||
}
|
||||
} else {
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
}
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
case SRB_STATUS_DATA_OVERRUN:
|
||||
switch(scsicmd->cmnd[0]){
|
||||
|
@ -1981,28 +1955,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
|||
scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
case INQUIRY: {
|
||||
u8 b;
|
||||
u8 b1;
|
||||
/* We can't expose disk devices because we can't tell whether they
|
||||
* are the raw container drives or stand alone drives
|
||||
*/
|
||||
b = (*(u8*)scsicmd->buffer)&0x0f;
|
||||
b1 = ((u8*)scsicmd->buffer)[1];
|
||||
if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER
|
||||
|| (b==TYPE_DISK && (b1&0x80)) ){
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
/*
|
||||
* We will allow disk devices if in RAID/SCSI mode and
|
||||
* the channel is 2
|
||||
*/
|
||||
} else if ((dev->raid_scsi_mode) &&
|
||||
(scmd_channel(scsicmd) == 2)) {
|
||||
scsicmd->result = DID_OK << 16 |
|
||||
COMMAND_COMPLETE << 8;
|
||||
} else {
|
||||
scsicmd->result = DID_NO_CONNECT << 16 |
|
||||
COMMAND_COMPLETE << 8;
|
||||
}
|
||||
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -2089,8 +2042,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
|
|||
*/
|
||||
scsicmd->result |= le32_to_cpu(srbreply->scsi_status);
|
||||
|
||||
fib_complete(fibptr);
|
||||
fib_free(fibptr);
|
||||
aac_fib_complete(fibptr);
|
||||
aac_fib_free(fibptr);
|
||||
scsicmd->scsi_done(scsicmd);
|
||||
}
|
||||
|
||||
|
@ -2142,10 +2095,10 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
|
|||
/*
|
||||
* Allocate and initialize a Fib then setup a BlockWrite command
|
||||
*/
|
||||
if (!(cmd_fibcontext = fib_alloc(dev))) {
|
||||
if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
|
||||
return -1;
|
||||
}
|
||||
fib_init(cmd_fibcontext);
|
||||
aac_fib_init(cmd_fibcontext);
|
||||
|
||||
srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext);
|
||||
srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);
|
||||
|
@ -2179,7 +2132,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ScsiPortCommand64, cmd_fibcontext,
|
||||
status = aac_fib_send(ScsiPortCommand64, cmd_fibcontext,
|
||||
fibsize, FsaNormal, 0, 1,
|
||||
(fib_callback) aac_srb_callback,
|
||||
(void *) scsicmd);
|
||||
|
@ -2201,7 +2154,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
|
|||
/*
|
||||
* Now send the Fib to the adapter
|
||||
*/
|
||||
status = fib_send(ScsiPortCommand, cmd_fibcontext, fibsize, FsaNormal, 0, 1,
|
||||
status = aac_fib_send(ScsiPortCommand, cmd_fibcontext, fibsize, FsaNormal, 0, 1,
|
||||
(fib_callback) aac_srb_callback, (void *) scsicmd);
|
||||
}
|
||||
/*
|
||||
|
@ -2211,9 +2164,9 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
printk(KERN_WARNING "aac_srb: fib_send failed with status: %d\n", status);
|
||||
fib_complete(cmd_fibcontext);
|
||||
fib_free(cmd_fibcontext);
|
||||
printk(KERN_WARNING "aac_srb: aac_fib_send failed with status: %d\n", status);
|
||||
aac_fib_complete(cmd_fibcontext);
|
||||
aac_fib_free(cmd_fibcontext);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1774,16 +1774,16 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
|
|||
struct scsi_cmnd;
|
||||
|
||||
const char *aac_driverinfo(struct Scsi_Host *);
|
||||
struct fib *fib_alloc(struct aac_dev *dev);
|
||||
int fib_setup(struct aac_dev *dev);
|
||||
void fib_map_free(struct aac_dev *dev);
|
||||
void fib_free(struct fib * context);
|
||||
void fib_init(struct fib * context);
|
||||
struct fib *aac_fib_alloc(struct aac_dev *dev);
|
||||
int aac_fib_setup(struct aac_dev *dev);
|
||||
void aac_fib_map_free(struct aac_dev *dev);
|
||||
void aac_fib_free(struct fib * context);
|
||||
void aac_fib_init(struct fib * context);
|
||||
void aac_printf(struct aac_dev *dev, u32 val);
|
||||
int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
|
||||
int aac_fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
|
||||
int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
|
||||
void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
|
||||
int fib_complete(struct fib * context);
|
||||
int aac_fib_complete(struct fib * context);
|
||||
#define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)
|
||||
struct aac_dev *aac_init_adapter(struct aac_dev *dev);
|
||||
int aac_get_config_status(struct aac_dev *dev);
|
||||
|
@ -1799,11 +1799,11 @@ unsigned int aac_command_normal(struct aac_queue * q);
|
|||
unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index);
|
||||
int aac_command_thread(struct aac_dev * dev);
|
||||
int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
|
||||
int fib_adapter_complete(struct fib * fibptr, unsigned short size);
|
||||
int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
|
||||
struct aac_driver_ident* aac_get_driver_ident(int devtype);
|
||||
int aac_get_adapter_info(struct aac_dev* dev);
|
||||
int aac_send_shutdown(struct aac_dev *dev);
|
||||
int probe_container(struct aac_dev *dev, int cid);
|
||||
int aac_probe_container(struct aac_dev *dev, int cid);
|
||||
extern int numacb;
|
||||
extern int acbsize;
|
||||
extern char aac_driver_version[];
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue