mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 09:41:44 +00:00
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Fix two year old bug in early bootup asm. [SPARC64]: Update defconfig. [SPARC64]: Fix log message type in vio_create_one(). [SPARC64]: Tweak assertions in sun4v_build_virq(). [SPARC64]: Tweak kernel log messages in power_probe(). [SPARC64]: Fix handling of multiple vdc-port nodes. [SPARC64]: Fix device type matching in VIO's devspec_show(). [SPARC64]: Fix MODULE_DEVICE_TABLE() specification in VDC and VNET. [SPARC]: Add sys_fallocate() entries. [SPARC64]: Use orderly_poweroff().
This commit is contained in:
commit
5ac12c6fe1
@ -1,8 +1,7 @@
|
||||
/* $Id: systbls.S,v 1.103 2002/02/08 03:57:14 davem Exp $
|
||||
* systbls.S: System call entry point tables for OS compatibility.
|
||||
/* systbls.S: System call entry point tables for OS compatibility.
|
||||
* The native Linux system call table lives here also.
|
||||
*
|
||||
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
* Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
|
||||
*
|
||||
* Based upon preliminary work which is:
|
||||
*
|
||||
@ -80,7 +79,7 @@ sys_call_table:
|
||||
/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
|
||||
/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
|
||||
/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
|
||||
/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd
|
||||
/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd, sys_fallocate
|
||||
|
||||
#ifdef CONFIG_SUNOS_EMUL
|
||||
/* Now the SunOS syscall table. */
|
||||
@ -198,6 +197,6 @@ sunos_sys_table:
|
||||
.long sunos_nosys, sunos_nosys, sunos_nosys
|
||||
.long sunos_nosys
|
||||
/*310*/ .long sunos_nosys, sunos_nosys, sunos_nosys
|
||||
.long sunos_nosys
|
||||
.long sunos_nosys, sunos_nosys
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.22
|
||||
# Tue Jul 17 01:19:52 2007
|
||||
# Thu Jul 19 21:30:37 2007
|
||||
#
|
||||
CONFIG_SPARC=y
|
||||
CONFIG_SPARC64=y
|
||||
@ -16,6 +16,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
|
||||
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
|
||||
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
|
||||
CONFIG_AUDIT_ARCH=y
|
||||
CONFIG_ARCH_NO_VIRT_TO_BUS=y
|
||||
CONFIG_SPARC64_PAGE_SIZE_8KB=y
|
||||
# CONFIG_SPARC64_PAGE_SIZE_64KB is not set
|
||||
# CONFIG_SPARC64_PAGE_SIZE_512KB is not set
|
||||
@ -148,7 +149,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
|
||||
CONFIG_RESOURCES_64BIT=y
|
||||
CONFIG_ZONE_DMA_FLAG=0
|
||||
CONFIG_NR_QUICK=1
|
||||
CONFIG_VIRT_TO_BUS=y
|
||||
CONFIG_SBUS=y
|
||||
CONFIG_SBUSCHAR=y
|
||||
CONFIG_SUN_AUXIO=y
|
||||
@ -317,7 +317,6 @@ CONFIG_CONNECTOR=m
|
||||
# CONFIG_PARPORT is not set
|
||||
CONFIG_BLK_DEV=y
|
||||
# CONFIG_BLK_DEV_FD is not set
|
||||
# CONFIG_BLK_CPQ_DA is not set
|
||||
# CONFIG_BLK_CPQ_CISS_DA is not set
|
||||
# CONFIG_BLK_DEV_DAC960 is not set
|
||||
# CONFIG_BLK_DEV_UMEM is not set
|
||||
@ -470,10 +469,6 @@ CONFIG_ISCSI_TCP=m
|
||||
# CONFIG_SCSI_SUNESP is not set
|
||||
# CONFIG_SCSI_SRP is not set
|
||||
# CONFIG_ATA is not set
|
||||
|
||||
#
|
||||
# Multi-device support (RAID and LVM)
|
||||
#
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_MD=m
|
||||
CONFIG_MD_LINEAR=m
|
||||
@ -610,10 +605,6 @@ CONFIG_SLHC=m
|
||||
# CONFIG_NETCONSOLE is not set
|
||||
# CONFIG_NETPOLL is not set
|
||||
# CONFIG_NET_POLL_CONTROLLER is not set
|
||||
|
||||
#
|
||||
# ISDN subsystem
|
||||
#
|
||||
# CONFIG_ISDN is not set
|
||||
# CONFIG_PHONE is not set
|
||||
|
||||
@ -782,6 +773,7 @@ CONFIG_I2C_ALGOBIT=y
|
||||
CONFIG_HWMON=y
|
||||
# CONFIG_HWMON_VID is not set
|
||||
# CONFIG_SENSORS_ABITUGURU is not set
|
||||
# CONFIG_SENSORS_ABITUGURU3 is not set
|
||||
# CONFIG_SENSORS_AD7418 is not set
|
||||
# CONFIG_SENSORS_ADM1021 is not set
|
||||
# CONFIG_SENSORS_ADM1025 is not set
|
||||
@ -808,11 +800,13 @@ CONFIG_HWMON=y
|
||||
# CONFIG_SENSORS_LM87 is not set
|
||||
# CONFIG_SENSORS_LM90 is not set
|
||||
# CONFIG_SENSORS_LM92 is not set
|
||||
# CONFIG_SENSORS_LM93 is not set
|
||||
# CONFIG_SENSORS_MAX1619 is not set
|
||||
# CONFIG_SENSORS_MAX6650 is not set
|
||||
# CONFIG_SENSORS_PC87360 is not set
|
||||
# CONFIG_SENSORS_PC87427 is not set
|
||||
# CONFIG_SENSORS_SIS5595 is not set
|
||||
# CONFIG_SENSORS_DME1737 is not set
|
||||
# CONFIG_SENSORS_SMSC47M1 is not set
|
||||
# CONFIG_SENSORS_SMSC47M192 is not set
|
||||
# CONFIG_SENSORS_SMSC47B397 is not set
|
||||
@ -906,6 +900,7 @@ CONFIG_FB_RADEON_I2C=y
|
||||
# CONFIG_PROM_CONSOLE is not set
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
|
||||
CONFIG_FONTS=y
|
||||
# CONFIG_FONT_8x8 is not set
|
||||
@ -1195,6 +1190,11 @@ CONFIG_USB_STORAGE=m
|
||||
# DMA Devices
|
||||
#
|
||||
|
||||
#
|
||||
# Userspace I/O
|
||||
#
|
||||
# CONFIG_UIO is not set
|
||||
|
||||
#
|
||||
# Misc Linux/SPARC drivers
|
||||
#
|
||||
@ -1385,6 +1385,7 @@ CONFIG_SCHEDSTATS=y
|
||||
# CONFIG_DEBUG_MUTEXES is not set
|
||||
# CONFIG_DEBUG_LOCK_ALLOC is not set
|
||||
# CONFIG_PROVE_LOCKING is not set
|
||||
# CONFIG_LOCK_STAT is not set
|
||||
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
|
||||
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
|
||||
# CONFIG_DEBUG_KOBJECT is not set
|
||||
@ -1461,6 +1462,7 @@ CONFIG_CRC_CCITT=m
|
||||
CONFIG_CRC16=m
|
||||
# CONFIG_CRC_ITU_T is not set
|
||||
CONFIG_CRC32=y
|
||||
# CONFIG_CRC7 is not set
|
||||
CONFIG_LIBCRC32C=m
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
#include <asm/ldc.h>
|
||||
#include <asm/vio.h>
|
||||
#include <asm/power.h>
|
||||
#include <asm/mdesc.h>
|
||||
#include <asm/head.h>
|
||||
#include <asm/irq.h>
|
||||
@ -328,7 +328,7 @@ static void domain_shutdown_data(struct ldc_channel *lp,
|
||||
|
||||
ds_send(lp, &pkt, sizeof(pkt));
|
||||
|
||||
wake_up_powerd();
|
||||
orderly_poweroff(true);
|
||||
}
|
||||
|
||||
struct ds_panic_req {
|
||||
@ -1133,8 +1133,6 @@ static int __devinit ds_probe(struct vio_dev *vdev,
|
||||
|
||||
ds_info = dp;
|
||||
|
||||
start_powerd();
|
||||
|
||||
return err;
|
||||
|
||||
out_free_ldc:
|
||||
|
@ -458,7 +458,6 @@ tlb_fixup_done:
|
||||
or %g6, %lo(init_thread_union), %g6
|
||||
ldx [%g6 + TI_TASK], %g4
|
||||
mov %sp, %l6
|
||||
mov %o4, %l7
|
||||
|
||||
wr %g0, ASI_P, %asi
|
||||
mov 1, %g1
|
||||
|
@ -701,10 +701,10 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
|
||||
{
|
||||
unsigned long sysino, hv_err;
|
||||
|
||||
BUG_ON(devhandle & ~IMAP_IGN);
|
||||
BUG_ON(devino & ~IMAP_INO);
|
||||
BUG_ON(devhandle & devino);
|
||||
|
||||
sysino = devhandle | devino;
|
||||
BUG_ON(sysino & ~(IMAP_IGN | IMAP_INO));
|
||||
|
||||
hv_err = sun4v_vintr_set_cookie(devhandle, devino, sysino);
|
||||
if (hv_err) {
|
||||
|
@ -231,6 +231,25 @@ void mdesc_register_notifier(struct mdesc_notifier_client *client)
|
||||
mutex_unlock(&mdesc_mutex);
|
||||
}
|
||||
|
||||
static const u64 *parent_cfg_handle(struct mdesc_handle *hp, u64 node)
|
||||
{
|
||||
const u64 *id;
|
||||
u64 a;
|
||||
|
||||
id = NULL;
|
||||
mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) {
|
||||
u64 target;
|
||||
|
||||
target = mdesc_arc_target(hp, a);
|
||||
id = mdesc_get_property(hp, target,
|
||||
"cfg-handle", NULL);
|
||||
if (id)
|
||||
break;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* Run 'func' on nodes which are in A but not in B. */
|
||||
static void invoke_on_missing(const char *name,
|
||||
struct mdesc_handle *a,
|
||||
@ -240,13 +259,42 @@ static void invoke_on_missing(const char *name,
|
||||
u64 node;
|
||||
|
||||
mdesc_for_each_node_by_name(a, node, name) {
|
||||
const u64 *id = mdesc_get_property(a, node, "id", NULL);
|
||||
int found = 0;
|
||||
int found = 0, is_vdc_port = 0;
|
||||
const char *name_prop;
|
||||
const u64 *id;
|
||||
u64 fnode;
|
||||
|
||||
name_prop = mdesc_get_property(a, node, "name", NULL);
|
||||
if (name_prop && !strcmp(name_prop, "vdc-port")) {
|
||||
is_vdc_port = 1;
|
||||
id = parent_cfg_handle(a, node);
|
||||
} else
|
||||
id = mdesc_get_property(a, node, "id", NULL);
|
||||
|
||||
if (!id) {
|
||||
printk(KERN_ERR "MD: Cannot find ID for %s node.\n",
|
||||
(name_prop ? name_prop : name));
|
||||
continue;
|
||||
}
|
||||
|
||||
mdesc_for_each_node_by_name(b, fnode, name) {
|
||||
const u64 *fid = mdesc_get_property(b, fnode,
|
||||
"id", NULL);
|
||||
const u64 *fid;
|
||||
|
||||
if (is_vdc_port) {
|
||||
name_prop = mdesc_get_property(b, fnode,
|
||||
"name", NULL);
|
||||
if (!name_prop ||
|
||||
strcmp(name_prop, "vdc-port"))
|
||||
continue;
|
||||
fid = parent_cfg_handle(b, fnode);
|
||||
if (!fid) {
|
||||
printk(KERN_ERR "MD: Cannot find ID "
|
||||
"for vdc-port node.\n");
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
fid = mdesc_get_property(b, fnode,
|
||||
"id", NULL);
|
||||
|
||||
if (*id == *fid) {
|
||||
found = 1;
|
||||
|
@ -12,13 +12,13 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/auxio.h>
|
||||
#include <asm/prom.h>
|
||||
#include <asm/of_device.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/power.h>
|
||||
#include <asm/sstate.h>
|
||||
|
||||
#include <linux/unistd.h>
|
||||
@ -31,20 +31,9 @@ int scons_pwroff = 1;
|
||||
|
||||
static void __iomem *power_reg;
|
||||
|
||||
static DECLARE_WAIT_QUEUE_HEAD(powerd_wait);
|
||||
static int button_pressed;
|
||||
|
||||
void wake_up_powerd(void)
|
||||
{
|
||||
if (button_pressed == 0) {
|
||||
button_pressed = 1;
|
||||
wake_up(&powerd_wait);
|
||||
}
|
||||
}
|
||||
|
||||
static irqreturn_t power_handler(int irq, void *dev_id)
|
||||
{
|
||||
wake_up_powerd();
|
||||
orderly_poweroff(true);
|
||||
|
||||
/* FIXME: Check registers for status... */
|
||||
return IRQ_HANDLED;
|
||||
@ -77,48 +66,6 @@ void machine_power_off(void)
|
||||
void (*pm_power_off)(void) = machine_power_off;
|
||||
EXPORT_SYMBOL(pm_power_off);
|
||||
|
||||
static int powerd(void *__unused)
|
||||
{
|
||||
static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
|
||||
char *argv[] = { "/sbin/shutdown", "-h", "now", NULL };
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
|
||||
daemonize("powerd");
|
||||
|
||||
add_wait_queue(&powerd_wait, &wait);
|
||||
|
||||
for (;;) {
|
||||
set_task_state(current, TASK_INTERRUPTIBLE);
|
||||
if (button_pressed)
|
||||
break;
|
||||
flush_signals(current);
|
||||
schedule();
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&powerd_wait, &wait);
|
||||
|
||||
/* Ok, down we go... */
|
||||
button_pressed = 0;
|
||||
if (kernel_execve("/sbin/shutdown", argv, envp) < 0) {
|
||||
printk(KERN_ERR "powerd: shutdown execution failed\n");
|
||||
machine_power_off();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int start_powerd(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = kernel_thread(powerd, NULL, CLONE_FS);
|
||||
if (err < 0)
|
||||
printk(KERN_ERR "power: Failed to start power daemon.\n");
|
||||
else
|
||||
printk(KERN_INFO "power: powerd running.\n");
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
|
||||
{
|
||||
if (irq == 0xffffffff)
|
||||
@ -136,20 +83,15 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
|
||||
|
||||
power_reg = of_ioremap(res, 0, 0x4, "power");
|
||||
|
||||
printk("%s: Control reg at %lx ... ",
|
||||
printk(KERN_INFO "%s: Control reg at %lx\n",
|
||||
op->node->name, res->start);
|
||||
|
||||
poweroff_method = machine_halt; /* able to use the standard halt */
|
||||
|
||||
if (has_button_interrupt(irq, op->node)) {
|
||||
if (start_powerd() < 0)
|
||||
return 0;
|
||||
|
||||
if (request_irq(irq,
|
||||
power_handler, 0, "power", NULL) < 0)
|
||||
printk(KERN_ERR "power: Cannot setup IRQ handler.\n");
|
||||
} else {
|
||||
printk(KERN_INFO "power: Not using powerd.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1,8 +1,7 @@
|
||||
/* $Id: sys_sparc32.c,v 1.184 2002/02/09 19:49:31 davem Exp $
|
||||
* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
|
||||
/* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
|
||||
*
|
||||
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
||||
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
|
||||
* Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net)
|
||||
*
|
||||
* These routines maintain argument size conversion between 32bit and 64bit
|
||||
* environment.
|
||||
@ -1028,3 +1027,10 @@ long compat_sync_file_range(int fd, unsigned long off_high, unsigned long off_lo
|
||||
(nb_high << 32) | nb_low,
|
||||
flags);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
|
||||
u32 lenhi, u32 lenlo)
|
||||
{
|
||||
return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
|
||||
((loff_t)lenhi << 32) | lenlo);
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
/* $Id: systbls.S,v 1.81 2002/02/08 03:57:14 davem Exp $
|
||||
* systbls.S: System call entry point tables for OS compatibility.
|
||||
/* systbls.S: System call entry point tables for OS compatibility.
|
||||
* The native Linux system call table lives here also.
|
||||
*
|
||||
* Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
|
||||
* Copyright (C) 1995, 1996, 2007 David S. Miller (davem@davemloft.net)
|
||||
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
|
||||
*
|
||||
* Based upon preliminary work which is:
|
||||
@ -81,7 +80,7 @@ sys_call_table32:
|
||||
.word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
|
||||
/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy
|
||||
.word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
|
||||
/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, compat_sys_timerfd, sys_eventfd
|
||||
/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, compat_sys_timerfd, sys_eventfd, compat_sys_fallocate
|
||||
|
||||
#endif /* CONFIG_COMPAT */
|
||||
|
||||
@ -153,7 +152,7 @@ sys_call_table:
|
||||
.word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
|
||||
/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
|
||||
.word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
|
||||
/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd
|
||||
/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd, sys_fallocate
|
||||
|
||||
#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
|
||||
defined(CONFIG_SOLARIS_EMUL_MODULE)
|
||||
@ -272,6 +271,6 @@ sunos_sys_table:
|
||||
.word sunos_nosys, sunos_nosys, sunos_nosys
|
||||
.word sunos_nosys
|
||||
/*310*/ .word sunos_nosys, sunos_nosys, sunos_nosys
|
||||
.word sunos_nosys
|
||||
.word sunos_nosys, sunos_nosys
|
||||
|
||||
#endif
|
||||
|
@ -103,9 +103,9 @@ static ssize_t devspec_show(struct device *dev,
|
||||
struct vio_dev *vdev = to_vio_dev(dev);
|
||||
const char *str = "none";
|
||||
|
||||
if (!strcmp(vdev->type, "network"))
|
||||
if (!strcmp(vdev->type, "vnet-port"))
|
||||
str = "vnet";
|
||||
else if (!strcmp(vdev->type, "block"))
|
||||
else if (!strcmp(vdev->type, "vdc-port"))
|
||||
str = "vdisk";
|
||||
|
||||
return sprintf(buf, "%s\n", str);
|
||||
@ -221,6 +221,27 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!strcmp(type, "vdc-port")) {
|
||||
u64 a;
|
||||
|
||||
id = NULL;
|
||||
mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_BACK) {
|
||||
u64 target;
|
||||
|
||||
target = mdesc_arc_target(hp, a);
|
||||
id = mdesc_get_property(hp, target,
|
||||
"cfg-handle", NULL);
|
||||
if (id)
|
||||
break;
|
||||
}
|
||||
if (!id) {
|
||||
printk(KERN_ERR "VIO: vdc-port lacks parent "
|
||||
"cfg-handle.\n");
|
||||
return NULL;
|
||||
}
|
||||
} else
|
||||
id = mdesc_get_property(hp, mp, "id", NULL);
|
||||
|
||||
bus_id_name = type;
|
||||
if (!strcmp(type, "domain-services-port"))
|
||||
bus_id_name = "ds";
|
||||
@ -260,13 +281,15 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
|
||||
|
||||
vio_fill_channel_info(hp, mp, vdev);
|
||||
|
||||
id = mdesc_get_property(hp, mp, "id", NULL);
|
||||
if (!id)
|
||||
if (!id) {
|
||||
snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s",
|
||||
bus_id_name);
|
||||
else
|
||||
vdev->dev_no = ~(u64)0;
|
||||
} else {
|
||||
snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu",
|
||||
bus_id_name, *id);
|
||||
vdev->dev_no = *id;
|
||||
}
|
||||
|
||||
vdev->dev.parent = parent;
|
||||
vdev->dev.bus = &vio_bus_type;
|
||||
|
@ -64,7 +64,6 @@ struct vdc_port {
|
||||
u64 operations;
|
||||
u32 vdisk_size;
|
||||
u8 vdisk_type;
|
||||
u8 dev_no;
|
||||
|
||||
char disk_name[32];
|
||||
|
||||
@ -703,7 +702,7 @@ static int probe_disk(struct vdc_port *port)
|
||||
blk_queue_max_phys_segments(q, port->ring_cookies);
|
||||
blk_queue_max_sectors(q, port->max_xfer_size);
|
||||
g->major = vdc_major;
|
||||
g->first_minor = port->dev_no << PARTITION_SHIFT;
|
||||
g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
|
||||
strcpy(g->disk_name, port->disk_name);
|
||||
|
||||
g->fops = &vdc_fops;
|
||||
@ -747,21 +746,16 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
|
||||
{
|
||||
struct mdesc_handle *hp;
|
||||
struct vdc_port *port;
|
||||
const u64 *port_id;
|
||||
int err;
|
||||
|
||||
print_version();
|
||||
|
||||
hp = mdesc_grab();
|
||||
|
||||
port_id = mdesc_get_property(hp, vdev->mp, "id", NULL);
|
||||
err = -ENODEV;
|
||||
if (!port_id) {
|
||||
printk(KERN_ERR PFX "Port lacks id property.\n");
|
||||
goto err_out_release_mdesc;
|
||||
}
|
||||
if ((*port_id << PARTITION_SHIFT) & ~(u64)MINORMASK) {
|
||||
printk(KERN_ERR PFX "Port id [%lu] too large.\n", *port_id);
|
||||
if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
|
||||
printk(KERN_ERR PFX "Port id [%lu] too large.\n",
|
||||
vdev->dev_no);
|
||||
goto err_out_release_mdesc;
|
||||
}
|
||||
|
||||
@ -772,16 +766,14 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
|
||||
goto err_out_release_mdesc;
|
||||
}
|
||||
|
||||
port->dev_no = *port_id;
|
||||
|
||||
if (port->dev_no >= 26)
|
||||
if (vdev->dev_no >= 26)
|
||||
snprintf(port->disk_name, sizeof(port->disk_name),
|
||||
VDCBLK_NAME "%c%c",
|
||||
'a' + (port->dev_no / 26) - 1,
|
||||
'a' + (port->dev_no % 26));
|
||||
'a' + ((int)vdev->dev_no / 26) - 1,
|
||||
'a' + ((int)vdev->dev_no % 26));
|
||||
else
|
||||
snprintf(port->disk_name, sizeof(port->disk_name),
|
||||
VDCBLK_NAME "%c", 'a' + (port->dev_no % 26));
|
||||
VDCBLK_NAME "%c", 'a' + ((int)vdev->dev_no % 26));
|
||||
|
||||
err = vio_driver_init(&port->vio, vdev, VDEV_DISK,
|
||||
vdc_versions, ARRAY_SIZE(vdc_versions),
|
||||
@ -849,7 +841,7 @@ static struct vio_device_id vdc_port_match[] = {
|
||||
},
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(vio, vdc_match);
|
||||
MODULE_DEVICE_TABLE(vio, vdc_port_match);
|
||||
|
||||
static struct vio_driver vdc_port_driver = {
|
||||
.id_table = vdc_port_match,
|
||||
|
@ -1136,7 +1136,7 @@ static struct vio_device_id vnet_port_match[] = {
|
||||
},
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(vio, vnet_match);
|
||||
MODULE_DEVICE_TABLE(vio, vnet_port_match);
|
||||
|
||||
static struct vio_driver vnet_port_driver = {
|
||||
.id_table = vnet_port_match,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* $Id: unistd.h,v 1.74 2002/02/08 03:57:18 davem Exp $ */
|
||||
#ifndef _SPARC_UNISTD_H
|
||||
#define _SPARC_UNISTD_H
|
||||
|
||||
@ -9,7 +8,7 @@
|
||||
* think of right now to force the arguments into fixed registers
|
||||
* before the trap into the system call with gcc 'asm' statements.
|
||||
*
|
||||
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
* Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
|
||||
*
|
||||
* SunOS compatibility based upon preliminary work which is:
|
||||
*
|
||||
@ -330,8 +329,9 @@
|
||||
#define __NR_signalfd 311
|
||||
#define __NR_timerfd 312
|
||||
#define __NR_eventfd 313
|
||||
#define __NR_fallocate 314
|
||||
|
||||
#define NR_SYSCALLS 314
|
||||
#define NR_SYSCALLS 315
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define __ARCH_WANT_IPC_PARSE_VERSION
|
||||
|
@ -1,7 +0,0 @@
|
||||
#ifndef _SPARC64_POWER_H
|
||||
#define _SPARC64_POWER_H
|
||||
|
||||
extern void wake_up_powerd(void);
|
||||
extern int start_powerd(void);
|
||||
|
||||
#endif /* !(_SPARC64_POWER_H) */
|
@ -1,4 +1,3 @@
|
||||
/* $Id: unistd.h,v 1.50 2002/02/08 03:57:18 davem Exp $ */
|
||||
#ifndef _SPARC64_UNISTD_H
|
||||
#define _SPARC64_UNISTD_H
|
||||
|
||||
@ -9,7 +8,7 @@
|
||||
* think of right now to force the arguments into fixed registers
|
||||
* before the trap into the system call with gcc 'asm' statements.
|
||||
*
|
||||
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
* Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
|
||||
*
|
||||
* SunOS compatibility based upon preliminary work which is:
|
||||
*
|
||||
@ -332,8 +331,9 @@
|
||||
#define __NR_signalfd 311
|
||||
#define __NR_timerfd 312
|
||||
#define __NR_eventfd 313
|
||||
#define __NR_fallocate 314
|
||||
|
||||
#define NR_SYSCALLS 314
|
||||
#define NR_SYSCALLS 315
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/* sysconf options, for SunOS compatibility */
|
||||
|
@ -275,6 +275,8 @@ struct vio_dev {
|
||||
char compat[VIO_MAX_COMPAT_LEN];
|
||||
int compat_len;
|
||||
|
||||
u64 dev_no;
|
||||
|
||||
unsigned long channel_id;
|
||||
|
||||
unsigned int tx_irq;
|
||||
|
Loading…
Reference in New Issue
Block a user