Commit 692e47d5 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-acpi.bkbits.net/linux-acpi-release-2.6.5

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents c1819ac4 6d2b5ef4
...@@ -187,6 +187,7 @@ Original developers of the crypto algorithms: ...@@ -187,6 +187,7 @@ Original developers of the crypto algorithms:
Brian Gladman (AES) Brian Gladman (AES)
Kartikey Mahendra Bhatt (CAST6) Kartikey Mahendra Bhatt (CAST6)
Jon Oberheide (ARC4) Jon Oberheide (ARC4)
Jouni Malinen (Michael MIC)
SHA1 algorithm contributors: SHA1 algorithm contributors:
Jean-Francois Dive Jean-Francois Dive
......
...@@ -563,7 +563,7 @@ $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(SUBDIRS) ; ...@@ -563,7 +563,7 @@ $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS) # Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS) .PHONY: $(SUBDIRS)
$(SUBDIRS): prepare-all $(SUBDIRS): prepare-all scripts
$(Q)$(MAKE) $(build)=$@ $(Q)$(MAKE) $(build)=$@
# Things we need to do before we recursively start building the kernel # Things we need to do before we recursively start building the kernel
......
...@@ -46,6 +46,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y ...@@ -46,6 +46,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_OBSOLETE_MODPARM=y CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set # CONFIG_MODVERSIONS is not set
# CONFIG_KMOD is not set # CONFIG_KMOD is not set
CONFIG_STOP_MACHINE=y
# #
# Platform support # Platform support
...@@ -100,6 +101,7 @@ CONFIG_PROC_DEVICETREE=y ...@@ -100,6 +101,7 @@ CONFIG_PROC_DEVICETREE=y
# Generic Driver Options # Generic Driver Options
# #
CONFIG_FW_LOADER=y CONFIG_FW_LOADER=y
# CONFIG_DEBUG_DRIVER is not set
# #
# Memory Technology Devices (MTD) # Memory Technology Devices (MTD)
...@@ -126,10 +128,10 @@ CONFIG_FW_LOADER=y ...@@ -126,10 +128,10 @@ CONFIG_FW_LOADER=y
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_CARMEL is not set
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
# CONFIG_DCSSBLK is not set
# #
# ATA/ATAPI/MFM/RLL support # ATA/ATAPI/MFM/RLL support
...@@ -220,6 +222,12 @@ CONFIG_SCSI_REPORT_LUNS=y ...@@ -220,6 +222,12 @@ CONFIG_SCSI_REPORT_LUNS=y
CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_LOGGING is not set
#
# SCSI Transport Attributes
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# #
# SCSI low-level drivers # SCSI low-level drivers
# #
...@@ -236,6 +244,7 @@ CONFIG_SCSI_SATA_SVW=y ...@@ -236,6 +244,7 @@ CONFIG_SCSI_SATA_SVW=y
# CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_ATA_PIIX is not set
# CONFIG_SCSI_SATA_PROMISE is not set # CONFIG_SCSI_SATA_PROMISE is not set
# CONFIG_SCSI_SATA_VIA is not set # CONFIG_SCSI_SATA_VIA is not set
# CONFIG_SCSI_SATA_VITESSE is not set
# CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DMX3191D is not set
...@@ -295,6 +304,8 @@ CONFIG_IEEE1394=y ...@@ -295,6 +304,8 @@ CONFIG_IEEE1394=y
# #
# CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_VERBOSEDEBUG is not set
CONFIG_IEEE1394_OUI_DB=y CONFIG_IEEE1394_OUI_DB=y
CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
# #
# Device Drivers # Device Drivers
...@@ -349,15 +360,72 @@ CONFIG_NET_IPIP=y ...@@ -349,15 +360,72 @@ CONFIG_NET_IPIP=y
# CONFIG_NET_IPGRE is not set # CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set # CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set # CONFIG_ARPD is not set
CONFIG_INET_ECN=y # CONFIG_INET_ECN is not set
CONFIG_SYN_COOKIES=y CONFIG_SYN_COOKIES=y
CONFIG_INET_AH=m CONFIG_INET_AH=m
CONFIG_INET_ESP=m CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m CONFIG_INET_IPCOMP=m
#
# IP: Virtual Server Configuration
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
# CONFIG_DECNET is not set # CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set # CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
#
# IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=y
# CONFIG_IP_NF_FTP is not set
# CONFIG_IP_NF_IRC is not set
# CONFIG_IP_NF_TFTP is not set
# CONFIG_IP_NF_AMANDA is not set
CONFIG_IP_NF_QUEUE=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_LIMIT=y
CONFIG_IP_NF_MATCH_IPRANGE=y
CONFIG_IP_NF_MATCH_MAC=y
CONFIG_IP_NF_MATCH_PKTTYPE=y
CONFIG_IP_NF_MATCH_MARK=y
CONFIG_IP_NF_MATCH_MULTIPORT=y
CONFIG_IP_NF_MATCH_TOS=y
CONFIG_IP_NF_MATCH_RECENT=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_DSCP=y
CONFIG_IP_NF_MATCH_AH_ESP=y
CONFIG_IP_NF_MATCH_LENGTH=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_MATCH_TCPMSS=y
CONFIG_IP_NF_MATCH_HELPER=y
CONFIG_IP_NF_MATCH_STATE=y
CONFIG_IP_NF_MATCH_CONNTRACK=y
CONFIG_IP_NF_MATCH_OWNER=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_SAME=y
# CONFIG_IP_NF_NAT_LOCAL is not set
# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_TOS=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_DSCP=y
CONFIG_IP_NF_TARGET_MARK=y
CONFIG_IP_NF_TARGET_CLASSIFY=y
CONFIG_IP_NF_TARGET_LOG=y
CONFIG_IP_NF_TARGET_ULOG=y
CONFIG_IP_NF_TARGET_TCPMSS=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
CONFIG_XFRM=y CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set # CONFIG_XFRM_USER is not set
...@@ -467,6 +535,7 @@ CONFIG_IBMOL=y ...@@ -467,6 +535,7 @@ CONFIG_IBMOL=y
# CONFIG_TMS380TR is not set # CONFIG_TMS380TR is not set
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
# #
# Wan interfaces # Wan interfaces
...@@ -487,6 +556,8 @@ CONFIG_IBMOL=y ...@@ -487,6 +556,8 @@ CONFIG_IBMOL=y
# Bluetooth support # Bluetooth support
# #
# CONFIG_BT is not set # CONFIG_BT is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# #
# ISDN subsystem # ISDN subsystem
...@@ -532,11 +603,13 @@ CONFIG_SERIO=y ...@@ -532,11 +603,13 @@ CONFIG_SERIO=y
CONFIG_INPUT_KEYBOARD=y CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ATKBD is not set # CONFIG_KEYBOARD_ATKBD is not set
# CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_NEWTON is not set
CONFIG_INPUT_MOUSE=y CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set # CONFIG_MOUSE_PS2 is not set
# CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set # CONFIG_INPUT_MISC is not set
...@@ -562,11 +635,6 @@ CONFIG_UNIX98_PTYS=y ...@@ -562,11 +635,6 @@ CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LEGACY_PTY_COUNT=256
CONFIG_HVC_CONSOLE=y CONFIG_HVC_CONSOLE=y
#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set # CONFIG_QIC02_TAPE is not set
# #
...@@ -578,7 +646,6 @@ CONFIG_HVC_CONSOLE=y ...@@ -578,7 +646,6 @@ CONFIG_HVC_CONSOLE=y
# Watchdog Cards # Watchdog Cards
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set # CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
...@@ -629,27 +696,39 @@ CONFIG_I2C_KEYWEST=y ...@@ -629,27 +696,39 @@ CONFIG_I2C_KEYWEST=y
# CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_VOODOO3 is not set
# #
# I2C Hardware Sensors Chip support # Hardware Sensors Chip support
# #
# CONFIG_I2C_SENSOR is not set # CONFIG_I2C_SENSOR is not set
# CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_FSCHER is not set
# CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83627HF is not set
#
# Other I2C Chip support
#
# CONFIG_SENSORS_EEPROM is not set
# CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set # CONFIG_I2C_DEBUG_CHIP is not set
#
# Misc devices
#
# #
# Multimedia devices # Multimedia devices
# #
...@@ -664,6 +743,7 @@ CONFIG_I2C_KEYWEST=y ...@@ -664,6 +743,7 @@ CONFIG_I2C_KEYWEST=y
# Graphics support # Graphics support
# #
CONFIG_FB=y CONFIG_FB=y
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set # CONFIG_FB_CYBER2000 is not set
CONFIG_FB_OF=y CONFIG_FB_OF=y
# CONFIG_FB_CONTROL is not set # CONFIG_FB_CONTROL is not set
...@@ -731,6 +811,7 @@ CONFIG_USB_DEVICEFS=y ...@@ -731,6 +811,7 @@ CONFIG_USB_DEVICEFS=y
# USB Host Controller Drivers # USB Host Controller Drivers
# #
CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_SPLIT_ISO is not set
CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_UHCI_HCD is not set # CONFIG_USB_UHCI_HCD is not set
...@@ -739,9 +820,9 @@ CONFIG_USB_OHCI_HCD=y ...@@ -739,9 +820,9 @@ CONFIG_USB_OHCI_HCD=y
# #
# CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_BLUETOOTH_TTY is not set
CONFIG_USB_ACM=m CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m CONFIG_USB_PRINTER=y
CONFIG_USB_STORAGE=m CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DEBUG=y # CONFIG_USB_STORAGE_DEBUG is not set
CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_ISD200=y
...@@ -765,7 +846,9 @@ CONFIG_USB_HIDDEV=y ...@@ -765,7 +846,9 @@ CONFIG_USB_HIDDEV=y
# CONFIG_USB_WACOM is not set # CONFIG_USB_WACOM is not set
# CONFIG_USB_KBTAB is not set # CONFIG_USB_KBTAB is not set
# CONFIG_USB_POWERMATE is not set # CONFIG_USB_POWERMATE is not set
# CONFIG_USB_MTOUCH is not set
# CONFIG_USB_XPAD is not set # CONFIG_USB_XPAD is not set
# CONFIG_USB_ATI_REMOTE is not set
# #
# USB Imaging devices # USB Imaging devices
...@@ -795,6 +878,7 @@ CONFIG_USB_USBNET=m ...@@ -795,6 +878,7 @@ CONFIG_USB_USBNET=m
# #
# USB Host-to-Host Cables # USB Host-to-Host Cables
# #
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y CONFIG_USB_BELKIN=y
CONFIG_USB_GENESYS=y CONFIG_USB_GENESYS=y
...@@ -866,7 +950,6 @@ CONFIG_USB_EZUSB=y ...@@ -866,7 +950,6 @@ CONFIG_USB_EZUSB=y
# CONFIG_USB_AUERSWALD is not set # CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set # CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_BRLVGER is not set
# CONFIG_USB_LCD is not set # CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set # CONFIG_USB_LED is not set
# CONFIG_USB_TEST is not set # CONFIG_USB_TEST is not set
...@@ -961,12 +1044,13 @@ CONFIG_LOCKD=y ...@@ -961,12 +1044,13 @@ CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y CONFIG_EXPORTFS=y
CONFIG_SUNRPC=y CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=m CONFIG_SUNRPC_GSS=y
CONFIG_RPCSEC_GSS_KRB5=m CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_SMB_FS is not set # CONFIG_SMB_FS is not set
CONFIG_CIFS=m CONFIG_CIFS=m
# CONFIG_NCP_FS is not set # CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set # CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set # CONFIG_AFS_FS is not set
# #
...@@ -978,7 +1062,11 @@ CONFIG_PARTITION_ADVANCED=y ...@@ -978,7 +1062,11 @@ CONFIG_PARTITION_ADVANCED=y
# CONFIG_AMIGA_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set # CONFIG_ATARI_PARTITION is not set
CONFIG_MAC_PARTITION=y CONFIG_MAC_PARTITION=y
# CONFIG_MSDOS_PARTITION is not set CONFIG_MSDOS_PARTITION=y
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MINIX_SUBPARTITION is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set # CONFIG_LDM_PARTITION is not set
# CONFIG_NEC98_PARTITION is not set # CONFIG_NEC98_PARTITION is not set
# CONFIG_SGI_PARTITION is not set # CONFIG_SGI_PARTITION is not set
...@@ -1059,18 +1147,20 @@ CONFIG_CRYPTO=y ...@@ -1059,18 +1147,20 @@ CONFIG_CRYPTO=y
CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_CAST6=m
# CONFIG_CRYPTO_ARC4 is not set
CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_DEFLATE=m
# CONFIG_CRYPTO_MICHAEL_MIC is not set
CONFIG_CRYPTO_TEST=m CONFIG_CRYPTO_TEST=m
# #
......
...@@ -88,14 +88,11 @@ extern unsigned long loops_per_jiffy; ...@@ -88,14 +88,11 @@ extern unsigned long loops_per_jiffy;
extern unsigned long ppc_proc_freq; extern unsigned long ppc_proc_freq;
extern unsigned long ppc_tb_freq; extern unsigned long ppc_tb_freq;
void void chrp_get_cpuinfo(struct seq_file *m)
chrp_get_cpuinfo(struct seq_file *m)
{ {
struct device_node *root; struct device_node *root;
const char *model = ""; const char *model = "";
seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
root = of_find_node_by_path("/"); root = of_find_node_by_path("/");
if (root) if (root)
model = get_property(root, "model", NULL); model = get_property(root, "model", NULL);
...@@ -209,14 +206,16 @@ void __init fwnmi_init(void) ...@@ -209,14 +206,16 @@ void __init fwnmi_init(void)
fwnmi_active = 1; fwnmi_active = 1;
} }
/* Early initialization. Relocation is on but do not reference unbolted pages */ /* Early initialization. Relocation is on but do not reference unbolted pages */
void __init pSeries_init_early(void) void __init pSeries_init_early(void)
{ {
#ifdef CONFIG_PPC_PSERIES /* This ifdef should go away */
void *comport; void *comport;
hpte_init_pSeries(); hpte_init_pSeries();
if (ppc64_iommu_off)
pci_dma_init_direct();
else
tce_init_pSeries(); tce_init_pSeries();
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -230,7 +229,6 @@ void __init pSeries_init_early(void) ...@@ -230,7 +229,6 @@ void __init pSeries_init_early(void)
ppc_md.udbg_putc = udbg_putc; ppc_md.udbg_putc = udbg_putc;
ppc_md.udbg_getc = udbg_getc; ppc_md.udbg_getc = udbg_getc;
ppc_md.udbg_getc_poll = udbg_getc_poll; ppc_md.udbg_getc_poll = udbg_getc_poll;
#endif
} }
void __init void __init
...@@ -253,7 +251,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -253,7 +251,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
#endif #endif
ppc_md.setup_arch = chrp_setup_arch; ppc_md.setup_arch = chrp_setup_arch;
ppc_md.setup_residual = NULL;
ppc_md.get_cpuinfo = chrp_get_cpuinfo; ppc_md.get_cpuinfo = chrp_get_cpuinfo;
if(naca->interrupt_controller == IC_OPEN_PIC) { if(naca->interrupt_controller == IC_OPEN_PIC) {
ppc_md.init_IRQ = pSeries_init_openpic; ppc_md.init_IRQ = pSeries_init_openpic;
...@@ -418,46 +415,64 @@ chrp_progress(char *s, unsigned short hex) ...@@ -418,46 +415,64 @@ chrp_progress(char *s, unsigned short hex)
extern void setup_default_decr(void); extern void setup_default_decr(void);
/* Some sane defaults: 125 MHz timebase, 1GHz processor */
#define DEFAULT_TB_FREQ 125000000UL
#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
void __init pSeries_calibrate_decr(void) void __init pSeries_calibrate_decr(void)
{ {
struct device_node *cpu; struct device_node *cpu;
struct div_result divres; struct div_result divres;
int *fp; unsigned int *fp;
unsigned long freq, processor_freq; int node_found;
/* /*
* The cpu node should have a timebase-frequency property * The cpu node should have a timebase-frequency property
* to tell us the rate at which the decrementer counts. * to tell us the rate at which the decrementer counts.
*/ */
freq = 16666000; /* hardcoded default */
cpu = of_find_node_by_type(NULL, "cpu"); cpu = of_find_node_by_type(NULL, "cpu");
ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */
node_found = 0;
if (cpu != 0) { if (cpu != 0) {
fp = (int *) get_property(cpu, "timebase-frequency", NULL); fp = (unsigned int *)get_property(cpu, "timebase-frequency",
if (fp != 0) NULL);
freq = *fp; if (fp != 0) {
node_found = 1;
ppc_tb_freq = *fp;
}
} }
ppc_tb_freq = freq; if (!node_found)
processor_freq = freq; printk(KERN_ERR "WARNING: Estimating decrementer frequency "
"(not found)\n");
ppc_proc_freq = DEFAULT_PROC_FREQ;
node_found = 0;
if (cpu != 0) { if (cpu != 0) {
fp = (int *) get_property(cpu, "clock-frequency", NULL); fp = (unsigned int *)get_property(cpu, "clock-frequency",
if (fp != 0) NULL);
processor_freq = *fp; if (fp != 0) {
node_found = 1;
ppc_proc_freq = *fp;
} }
ppc_proc_freq = processor_freq; }
if (!node_found)
printk(KERN_ERR "WARNING: Estimating processor frequency "
"(not found)\n");
of_node_put(cpu); of_node_put(cpu);
printk("time_init: decrementer frequency = %lu.%.6lu MHz\n", printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
freq/1000000, freq%1000000); ppc_tb_freq/1000000, ppc_tb_freq%1000000);
printk("time_init: processor frequency = %lu.%.6lu MHz\n", printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n",
processor_freq/1000000, processor_freq%1000000); ppc_proc_freq/1000000, ppc_proc_freq%1000000);
tb_ticks_per_jiffy = freq / HZ; tb_ticks_per_jiffy = ppc_tb_freq / HZ;
tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
tb_ticks_per_usec = freq / 1000000; tb_ticks_per_usec = ppc_tb_freq / 1000000;
tb_to_us = mulhwu_scale_factor(freq, 1000000); tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres ); div128_by_32(1024*1024, 0, tb_ticks_per_sec, &divres);
tb_to_xs = divres.result_low; tb_to_xs = divres.result_low;
setup_default_decr(); setup_default_decr();
} }
...@@ -103,47 +103,6 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus, ...@@ -103,47 +103,6 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
Error_Text, Bus, SubBus, AgentId, HvRc); Error_Text, Bus, SubBus, AgentId, HvRc);
} }
#if 0
/*
* Dump the iSeries Temp Device Node
* <4>buswalk [swapper : - DeviceNode: 0xC000000000634300
* <4>00. Device Node = 0xC000000000634300
* <4> - PciDev = 0x0000000000000000
* <4> - tDevice = 0x 17:01.00 0x1022 00
* <4> 4. Device Node = 0xC000000000634480
* <4> - PciDev = 0x0000000000000000
* <4> - Device = 0x 18:38.16 Irq:0xA7 Vendor:0x1014 Flags:0x00
* <4> - Devfn = 0xB0: 22.18
*/
void dumpDevice_Node(struct iSeries_Device_Node *DevNode)
{
udbg_printf("Device Node = 0x%p\n", DevNode);
udbg_printf(" - PciDev = 0x%p\n", DevNode->PciDev);
udbg_printf(" - Device = 0x%4X:%02X.%02X (0x%02X)\n",
ISERIES_BUS(DevNode), ISERIES_SUBBUS(DevNode),
DevNode->AgentId, DevNode->DevFn);
udbg_printf(" - LSlot = 0x%02X\n", DevNode->LogicalSlot);
udbg_printf(" - TceTable = 0x%p\n ", DevNode->DevTceTable);
udbg_printf(" - DSA = 0x%04X\n", ISERIES_DSA(DevNode) >> 32);
udbg_printf(" = Irq:0x%02X Vendor:0x%04X Flags:0x%02X\n",
DevNode->Irq, DevNode->Vendor, DevNode->Flags);
udbg_printf(" - Location = %s\n", DevNode->CardLocation);
}
/*
* Walk down the device node chain
*/
static void list_device_nodes(void)
{
struct list_head *Device_Node_Ptr = iSeries_Global_Device_List.next;
while (Device_Node_Ptr != &iSeries_Global_Device_List) {
dumpDevice_Node((struct iSeries_Device_Node*)Device_Node_Ptr);
Device_Node_Ptr = Device_Node_Ptr->next;
}
}
#endif
/* /*
* build_device_node(u16 Bus, int SubBus, u8 DevFn) * build_device_node(u16 Bus, int SubBus, u8 DevFn)
*/ */
......
...@@ -311,7 +311,6 @@ void __init iSeries_init_early(void) ...@@ -311,7 +311,6 @@ void __init iSeries_init_early(void)
iSeries_recal_titan = HvCallXm_loadTod(); iSeries_recal_titan = HvCallXm_loadTod();
ppc_md.setup_arch = iSeries_setup_arch; ppc_md.setup_arch = iSeries_setup_arch;
ppc_md.setup_residual = iSeries_setup_residual;
ppc_md.get_cpuinfo = iSeries_get_cpuinfo; ppc_md.get_cpuinfo = iSeries_get_cpuinfo;
ppc_md.init_IRQ = iSeries_init_IRQ; ppc_md.init_IRQ = iSeries_init_IRQ;
ppc_md.get_irq = iSeries_get_irq; ppc_md.get_irq = iSeries_get_irq;
...@@ -726,29 +725,6 @@ void __init iSeries_setup_arch(void) ...@@ -726,29 +725,6 @@ void __init iSeries_setup_arch(void)
printk("Processor version = %x\n", systemcfg->processor); printk("Processor version = %x\n", systemcfg->processor);
} }
/*
* int as400_setup_residual()
*
* Description:
* This routine pretty-prints CPU information gathered from the VPD
* for use in /proc/cpuinfo
*
* Input(s):
* *buffer - Buffer into which CPU data is to be printed.
*
* Output(s):
* *buffer - Buffer with CPU data.
*/
void iSeries_setup_residual(struct seq_file *m, int cpu_id)
{
seq_printf(m, "clock\t\t: %lu.%02luMhz\n", procFreqMhz,
procFreqMhzHundreths);
seq_printf(m, "time base\t: %lu.%02luMHz\n", tbFreqMhz,
tbFreqMhzHundreths);
seq_printf(m, "i-cache\t\t: %d\n", systemcfg->iCacheL1LineSize);
seq_printf(m, "d-cache\t\t: %d\n", systemcfg->dCacheL1LineSize);
}
void iSeries_get_cpuinfo(struct seq_file *m) void iSeries_get_cpuinfo(struct seq_file *m)
{ {
seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
......
...@@ -346,9 +346,6 @@ COMPATIBLE_IOCTL(TCSBRKP) ...@@ -346,9 +346,6 @@ COMPATIBLE_IOCTL(TCSBRKP)
COMPATIBLE_IOCTL(TIOCSTART) COMPATIBLE_IOCTL(TIOCSTART)
COMPATIBLE_IOCTL(TIOCSTOP) COMPATIBLE_IOCTL(TIOCSTOP)
COMPATIBLE_IOCTL(TIOCSLTC) COMPATIBLE_IOCTL(TIOCSLTC)
#if 0
COMPATIBLE_IOCTL(FBIOBLANK)
#endif
/* Little p (/dev/rtc, /dev/envctrl, etc.) */ /* Little p (/dev/rtc, /dev/envctrl, etc.) */
COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */ COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */ COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
......
...@@ -73,7 +73,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np ...@@ -73,7 +73,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np
if (unlikely(npages) == 0) { if (unlikely(npages) == 0) {
if (printk_ratelimit()) if (printk_ratelimit())
WARN_ON(1); WARN_ON(1);
return NO_TCE; return PCI_DMA_ERROR_CODE;
} }
if (handle && *handle) if (handle && *handle)
...@@ -109,7 +109,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np ...@@ -109,7 +109,7 @@ static unsigned long iommu_range_alloc(struct iommu_table *tbl, unsigned long np
goto again; goto again;
} else { } else {
/* Third failure, give up */ /* Third failure, give up */
return NO_TCE; return PCI_DMA_ERROR_CODE;
} }
} }
...@@ -143,15 +143,15 @@ dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page, ...@@ -143,15 +143,15 @@ dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,
unsigned int npages, int direction) unsigned int npages, int direction)
{ {
unsigned long entry, flags; unsigned long entry, flags;
dma_addr_t ret = NO_TCE; dma_addr_t ret = PCI_DMA_ERROR_CODE;
spin_lock_irqsave(&(tbl->it_lock), flags); spin_lock_irqsave(&(tbl->it_lock), flags);
entry = iommu_range_alloc(tbl, npages, NULL); entry = iommu_range_alloc(tbl, npages, NULL);
if (unlikely(entry == NO_TCE)) { if (unlikely(entry == PCI_DMA_ERROR_CODE)) {
spin_unlock_irqrestore(&(tbl->it_lock), flags); spin_unlock_irqrestore(&(tbl->it_lock), flags);
return NO_TCE; return PCI_DMA_ERROR_CODE;
} }
entry += tbl->it_offset; /* Offset into real TCE table */ entry += tbl->it_offset; /* Offset into real TCE table */
...@@ -262,7 +262,7 @@ int iommu_alloc_sg(struct iommu_table *tbl, struct device *dev, ...@@ -262,7 +262,7 @@ int iommu_alloc_sg(struct iommu_table *tbl, struct device *dev,
DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
/* Handle failure */ /* Handle failure */
if (unlikely(entry == NO_TCE)) { if (unlikely(entry == PCI_DMA_ERROR_CODE)) {
if (printk_ratelimit()) if (printk_ratelimit())
printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %lx" printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %lx"
" npages %lx\n", tbl, vaddr, npages); " npages %lx\n", tbl, vaddr, npages);
...@@ -326,7 +326,7 @@ int iommu_alloc_sg(struct iommu_table *tbl, struct device *dev, ...@@ -326,7 +326,7 @@ int iommu_alloc_sg(struct iommu_table *tbl, struct device *dev,
*/ */
if (outcount < nelems) { if (outcount < nelems) {
outs++; outs++;
outs->dma_address = NO_TCE; outs->dma_address = PCI_DMA_ERROR_CODE;
outs->dma_length = 0; outs->dma_length = 0;
} }
return outcount; return outcount;
......
...@@ -699,6 +699,7 @@ void __init pSeries_final_fixup(void) ...@@ -699,6 +699,7 @@ void __init pSeries_final_fixup(void)
phbs_fixup_io(); phbs_fixup_io();
chrp_request_regions(); chrp_request_regions();
pci_fix_bus_sysdata(); pci_fix_bus_sysdata();
if (!ppc64_iommu_off)
iommu_setup_pSeries(); iommu_setup_pSeries();
} }
......
...@@ -82,7 +82,7 @@ void *pci_iommu_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -82,7 +82,7 @@ void *pci_iommu_alloc_consistent(struct pci_dev *hwdev, size_t size,
if (order >= IOMAP_MAX_ORDER) { if (order >= IOMAP_MAX_ORDER) {
printk("PCI_DMA: pci_alloc_consistent size too large: 0x%lx\n", printk("PCI_DMA: pci_alloc_consistent size too large: 0x%lx\n",
size); size);
return (void *)NO_TCE; return (void *)PCI_DMA_ERROR_CODE;
} }
tbl = devnode_table(hwdev); tbl = devnode_table(hwdev);
...@@ -101,7 +101,7 @@ void *pci_iommu_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -101,7 +101,7 @@ void *pci_iommu_alloc_consistent(struct pci_dev *hwdev, size_t size,
/* Set up tces to cover the allocated range */ /* Set up tces to cover the allocated range */
mapping = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL); mapping = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL);
if (mapping == NO_TCE) { if (mapping == PCI_DMA_ERROR_CODE) {
free_pages((unsigned long)ret, order); free_pages((unsigned long)ret, order);
ret = NULL; ret = NULL;
} else } else
...@@ -139,7 +139,7 @@ dma_addr_t pci_iommu_map_single(struct pci_dev *hwdev, void *vaddr, ...@@ -139,7 +139,7 @@ dma_addr_t pci_iommu_map_single(struct pci_dev *hwdev, void *vaddr,
size_t size, int direction) size_t size, int direction)
{ {
struct iommu_table * tbl; struct iommu_table * tbl;
dma_addr_t dma_handle = NO_TCE; dma_addr_t dma_handle = PCI_DMA_ERROR_CODE;
unsigned long uaddr; unsigned long uaddr;
unsigned int npages; unsigned int npages;
...@@ -153,7 +153,7 @@ dma_addr_t pci_iommu_map_single(struct pci_dev *hwdev, void *vaddr, ...@@ -153,7 +153,7 @@ dma_addr_t pci_iommu_map_single(struct pci_dev *hwdev, void *vaddr,
if (tbl) { if (tbl) {
dma_handle = iommu_alloc(tbl, vaddr, npages, direction); dma_handle = iommu_alloc(tbl, vaddr, npages, direction);
if (dma_handle == NO_TCE) { if (dma_handle == PCI_DMA_ERROR_CODE) {
if (printk_ratelimit()) { if (printk_ratelimit()) {
printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %p npages %d\n", printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %p npages %d\n",
tbl, vaddr, npages); tbl, vaddr, npages);
......
...@@ -95,7 +95,6 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m) ...@@ -95,7 +95,6 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m)
PMAC_MB_INFO_MODEL, 0); PMAC_MB_INFO_MODEL, 0);
unsigned int mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, unsigned int mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
PMAC_MB_INFO_FLAGS, 0); PMAC_MB_INFO_FLAGS, 0);
extern unsigned long ppc_tb_freq;
if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
(long)&mbname) != 0) (long)&mbname) != 0)
...@@ -130,9 +129,6 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m) ...@@ -130,9 +129,6 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m)
/* Indicate newworld */ /* Indicate newworld */
seq_printf(m, "pmac-generation\t: NewWorld\n"); seq_printf(m, "pmac-generation\t: NewWorld\n");
/* Indicate timebase value */
seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
extern void setup_default_decr(void); extern void setup_default_decr(void);
extern unsigned long ppc_tb_freq; extern unsigned long ppc_tb_freq;
extern unsigned long ppc_proc_freq;
/* Apparently the RTC stores seconds since 1 Jan 1904 */ /* Apparently the RTC stores seconds since 1 Jan 1904 */
#define RTC_OFFSET 2082844800 #define RTC_OFFSET 2082844800
...@@ -155,6 +156,11 @@ void __init pmac_calibrate_decr(void) ...@@ -155,6 +156,11 @@ void __init pmac_calibrate_decr(void)
tb_to_xs = divres.result_low; tb_to_xs = divres.result_low;
ppc_tb_freq = freq; ppc_tb_freq = freq;
fp = (unsigned int *)get_property(cpu, "clock-frequency", NULL);
if (fp == 0)
panic("can't get cpu processor frequency");
ppc_proc_freq = *fp;
setup_default_decr(); setup_default_decr();
} }
...@@ -525,25 +525,16 @@ prom_initialize_naca(unsigned long mem) ...@@ -525,25 +525,16 @@ prom_initialize_naca(unsigned long mem)
return mem; return mem;
} }
#ifdef CONFIG_PMAC_DART static int iommu_force_on;
static int dart_force_on; int ppc64_iommu_off;
#endif
static unsigned long __init static void early_cmdline_parse(void)
prom_initialize_lmb(unsigned long mem)
{ {
phandle node; unsigned long offset = reloc_offset();
char type[64];
unsigned long i, offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom);
struct systemcfg *_systemcfg = RELOC(systemcfg);
union lmb_reg_property reg;
unsigned long lmb_base, lmb_size;
unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8;
int nodart = 0;
#ifdef CONFIG_PMAC_DART
char *opt; char *opt;
#ifndef CONFIG_PMAC_DART
struct systemcfg *_systemcfg = RELOC(systemcfg);
#endif
opt = strstr(RELOC(cmd_line), RELOC("iommu=")); opt = strstr(RELOC(cmd_line), RELOC("iommu="));
if (opt) { if (opt) {
...@@ -554,16 +545,30 @@ prom_initialize_lmb(unsigned long mem) ...@@ -554,16 +545,30 @@ prom_initialize_lmb(unsigned long mem)
while (*opt && *opt == ' ') while (*opt && *opt == ' ')
opt++; opt++;
if (!strncmp(opt, RELOC("off"), 3)) if (!strncmp(opt, RELOC("off"), 3))
nodart = 1; RELOC(ppc64_iommu_off) = 1;
else if (!strncmp(opt, RELOC("force"), 5)) else if (!strncmp(opt, RELOC("force"), 5))
RELOC(dart_force_on) = 1; RELOC(iommu_force_on) = 1;
} }
#else
nodart = 1;
#endif /* CONFIG_PMAC_DART */
if (nodart) #ifndef CONFIG_PMAC_DART
if (_systemcfg->platform == PLATFORM_POWERMAC) {
RELOC(ppc64_iommu_off) = 1;
prom_print(RELOC("DART disabled on PowerMac !\n")); prom_print(RELOC("DART disabled on PowerMac !\n"));
}
#endif
}
static unsigned long __init
prom_initialize_lmb(unsigned long mem)
{
phandle node;
char type[64];
unsigned long i, offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom);
struct systemcfg *_systemcfg = RELOC(systemcfg);
union lmb_reg_property reg;
unsigned long lmb_base, lmb_size;
unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8;
lmb_init(); lmb_init();
...@@ -589,11 +594,6 @@ prom_initialize_lmb(unsigned long mem) ...@@ -589,11 +594,6 @@ prom_initialize_lmb(unsigned long mem)
lmb_base = ((unsigned long)reg.addrPM[i].address_hi) << 32; lmb_base = ((unsigned long)reg.addrPM[i].address_hi) << 32;
lmb_base |= (unsigned long)reg.addrPM[i].address_lo; lmb_base |= (unsigned long)reg.addrPM[i].address_lo;
lmb_size = reg.addrPM[i].size; lmb_size = reg.addrPM[i].size;
if (nodart && lmb_base > 0x80000000ull) {
prom_print(RELOC("Skipping memory above 2Gb for "
"now, DART support disabled\n"));
continue;
}
} else if (_prom->encode_phys_size == 32) { } else if (_prom->encode_phys_size == 32) {
lmb_base = reg.addr32[i].address; lmb_base = reg.addr32[i].address;
lmb_size = reg.addr32[i].size; lmb_size = reg.addr32[i].size;
...@@ -602,7 +602,16 @@ prom_initialize_lmb(unsigned long mem) ...@@ -602,7 +602,16 @@ prom_initialize_lmb(unsigned long mem)
lmb_size = reg.addr64[i].size; lmb_size = reg.addr64[i].size;
} }
if ( lmb_add(lmb_base, lmb_size) < 0 ) /* We limit memory to 2GB if the IOMMU is off */
if (RELOC(ppc64_iommu_off)) {
if (lmb_base >= 0x80000000UL)
continue;
if ((lmb_base + lmb_size) > 0x80000000UL)
lmb_size = 0x80000000UL - lmb_base;
}
if (lmb_add(lmb_base, lmb_size) < 0)
prom_print(RELOC("Too many LMB's, discarding this one...\n")); prom_print(RELOC("Too many LMB's, discarding this one...\n"));
} }
...@@ -780,7 +789,7 @@ void prom_initialize_dart_table(void) ...@@ -780,7 +789,7 @@ void prom_initialize_dart_table(void)
/* Only reserve DART space if machine has more than 2GB of RAM /* Only reserve DART space if machine has more than 2GB of RAM
* or if requested with iommu=on on cmdline. * or if requested with iommu=on on cmdline.
*/ */
if (lmb_end_of_DRAM() <= 0x80000000ull && !RELOC(dart_force_on)) if (lmb_end_of_DRAM() <= 0x80000000ull && !RELOC(iommu_force_on))
return; return;
/* 512 pages is max DART tablesize. */ /* 512 pages is max DART tablesize. */
...@@ -811,6 +820,9 @@ prom_initialize_tce_table(void) ...@@ -811,6 +820,9 @@ prom_initialize_tce_table(void)
struct of_tce_table *prom_tce_table = RELOC(of_tce_table); struct of_tce_table *prom_tce_table = RELOC(of_tce_table);
unsigned long tce_entry, *tce_entryp; unsigned long tce_entry, *tce_entryp;
if (RELOC(ppc64_iommu_off))
return;
#ifdef DEBUG_PROM #ifdef DEBUG_PROM
prom_print(RELOC("starting prom_initialize_tce_table\n")); prom_print(RELOC("starting prom_initialize_tce_table\n"));
#endif #endif
...@@ -930,16 +942,15 @@ prom_initialize_tce_table(void) ...@@ -930,16 +942,15 @@ prom_initialize_tce_table(void)
path, sizeof(path)-1) <= 0) { path, sizeof(path)-1) <= 0) {
prom_print(RELOC("package-to-path failed\n")); prom_print(RELOC("package-to-path failed\n"));
} else { } else {
prom_print(RELOC("opened ")); prom_print(RELOC("opening PHB "));
prom_print(path); prom_print(path);
prom_print_nl();
} }
phb_node = (ihandle)call_prom(RELOC("open"), 1, 1, path); phb_node = (ihandle)call_prom(RELOC("open"), 1, 1, path);
if ( (long)phb_node <= 0) { if ( (long)phb_node <= 0) {
prom_print(RELOC("open failed\n")); prom_print(RELOC("... failed\n"));
} else { } else {
prom_print(RELOC("open success\n")); prom_print(RELOC("... done\n"));
} }
call_prom(RELOC("call-method"), 6, 0, call_prom(RELOC("call-method"), 6, 0,
RELOC("set-64-bit-addressing"), RELOC("set-64-bit-addressing"),
...@@ -1136,7 +1147,7 @@ prom_hold_cpus(unsigned long mem) ...@@ -1136,7 +1147,7 @@ prom_hold_cpus(unsigned long mem)
prom_print_hex(cpuid); prom_print_hex(cpuid);
prom_print(RELOC(" : starting cpu ")); prom_print(RELOC(" : starting cpu "));
prom_print(path); prom_print(path);
prom_print(RELOC("...")); prom_print(RELOC("... "));
call_prom(RELOC("start-cpu"), 3, 0, node, call_prom(RELOC("start-cpu"), 3, 0, node,
secondary_hold, cpuid); secondary_hold, cpuid);
...@@ -1144,7 +1155,7 @@ prom_hold_cpus(unsigned long mem) ...@@ -1144,7 +1155,7 @@ prom_hold_cpus(unsigned long mem)
(*acknowledge == ((unsigned long)-1)); i++ ) ; (*acknowledge == ((unsigned long)-1)); i++ ) ;
if (*acknowledge == cpuid) { if (*acknowledge == cpuid) {
prom_print(RELOC("ok\n")); prom_print(RELOC("... done\n"));
/* We have to get every CPU out of OF, /* We have to get every CPU out of OF,
* even if we never start it. */ * even if we never start it. */
if (cpuid >= NR_CPUS) if (cpuid >= NR_CPUS)
...@@ -1157,10 +1168,9 @@ prom_hold_cpus(unsigned long mem) ...@@ -1157,10 +1168,9 @@ prom_hold_cpus(unsigned long mem)
cpu_set(cpuid, RELOC(cpu_present_at_boot)); cpu_set(cpuid, RELOC(cpu_present_at_boot));
#endif #endif
} else { } else {
prom_print(RELOC("failed: ")); prom_print(RELOC("... failed: "));
prom_print_hex(*acknowledge); prom_print_hex(*acknowledge);
prom_print_nl(); prom_print_nl();
/* prom_panic(RELOC("cpu failed to start")); */
} }
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -1583,6 +1593,8 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp, ...@@ -1583,6 +1593,8 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
strlcpy(RELOC(cmd_line), p, sizeof(cmd_line)); strlcpy(RELOC(cmd_line), p, sizeof(cmd_line));
} }
early_cmdline_parse();
mem = prom_initialize_lmb(mem); mem = prom_initialize_lmb(mem);
mem = prom_bi_rec_reserve(mem); mem = prom_bi_rec_reserve(mem);
...@@ -1751,7 +1763,7 @@ check_display(unsigned long mem) ...@@ -1751,7 +1763,7 @@ check_display(unsigned long mem)
continue; continue;
} }
prom_print(RELOC("... ok\n")); prom_print(RELOC("... done\n"));
/* Setup a useable color table when the appropriate /* Setup a useable color table when the appropriate
* method is available. Should update this to set-colors */ * method is available. Should update this to set-colors */
......
...@@ -130,7 +130,7 @@ rtas_token(const char *service) ...@@ -130,7 +130,7 @@ rtas_token(const char *service)
void void
log_rtas_error(struct rtas_args *rtas_args) log_rtas_error(struct rtas_args *rtas_args)
{ {
struct rtas_args err_args; struct rtas_args err_args, temp_args;
err_args.token = rtas_token("rtas-last-error"); err_args.token = rtas_token("rtas-last-error");
err_args.nargs = 2; err_args.nargs = 2;
...@@ -141,6 +141,7 @@ log_rtas_error(struct rtas_args *rtas_args) ...@@ -141,6 +141,7 @@ log_rtas_error(struct rtas_args *rtas_args)
err_args.args[1] = RTAS_ERROR_LOG_MAX; err_args.args[1] = RTAS_ERROR_LOG_MAX;
err_args.args[2] = 0; err_args.args[2] = 0;
temp_args = *rtas_args;
get_paca()->xRtas = err_args; get_paca()->xRtas = err_args;
PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n", PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
...@@ -148,8 +149,9 @@ log_rtas_error(struct rtas_args *rtas_args) ...@@ -148,8 +149,9 @@ log_rtas_error(struct rtas_args *rtas_args)
enter_rtas((void *)__pa((unsigned long)&get_paca()->xRtas)); enter_rtas((void *)__pa((unsigned long)&get_paca()->xRtas));
PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n"); PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
err_args = get_paca()->xRtas; err_args = get_paca()->xRtas;
get_paca()->xRtas = *rtas_args; get_paca()->xRtas = temp_args;
if (err_args.rets[0] == 0) if (err_args.rets[0] == 0)
log_error(rtas_err_buf, ERR_TYPE_RTAS_LOG, 0); log_error(rtas_err_buf, ERR_TYPE_RTAS_LOG, 0);
......
...@@ -330,6 +330,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -330,6 +330,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
unsigned short min; unsigned short min;
if (cpu_id == NR_CPUS) { if (cpu_id == NR_CPUS) {
seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
if (ppc_md.get_cpuinfo != NULL) if (ppc_md.get_cpuinfo != NULL)
ppc_md.get_cpuinfo(m); ppc_md.get_cpuinfo(m);
...@@ -363,29 +364,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -363,29 +364,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "\n"); seq_printf(m, "\n");
#ifdef CONFIG_PPC_PSERIES
/* /*
* Assume here that all clock rates are the same in a * Assume here that all clock rates are the same in a
* smp system. -- Cort * smp system. -- Cort
*/ */
if (systemcfg->platform != PLATFORM_ISERIES_LPAR) { seq_printf(m, "clock\t\t: %lu.%06luMHz\n", ppc_proc_freq / 1000000,
struct device_node *cpu_node; ppc_proc_freq % 1000000);
int *fp;
cpu_node = of_find_node_by_type(NULL, "cpu");
if (cpu_node) {
fp = (int *) get_property(cpu_node, "clock-frequency",
NULL);
if (fp)
seq_printf(m, "clock\t\t: %dMHz\n",
*fp / 1000000);
of_node_put(cpu_node);
}
}
#endif
if (ppc_md.setup_residual != NULL)
ppc_md.setup_residual(m, cpu_id);
seq_printf(m, "revision\t: %hd.%hd\n\n", maj, min); seq_printf(m, "revision\t: %hd.%hd\n\n", maj, min);
......
...@@ -419,7 +419,7 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr, ...@@ -419,7 +419,7 @@ dma_addr_t vio_map_single(struct vio_dev *dev, void *vaddr,
size_t size, int direction ) size_t size, int direction )
{ {
struct iommu_table *tbl; struct iommu_table *tbl;
dma_addr_t dma_handle = NO_TCE; dma_addr_t dma_handle = PCI_DMA_ERROR_CODE;
unsigned long uaddr; unsigned long uaddr;
unsigned int npages; unsigned int npages;
...@@ -504,7 +504,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size, ...@@ -504,7 +504,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
/* It is easier to debug here for the drivers than in the tce tables.*/ /* It is easier to debug here for the drivers than in the tce tables.*/
if(order >= IOMAP_MAX_ORDER) { if(order >= IOMAP_MAX_ORDER) {
printk("VIO_DMA: vio_alloc_consistent size to large: 0x%lx \n", size); printk("VIO_DMA: vio_alloc_consistent size to large: 0x%lx \n", size);
return (void *)NO_TCE; return (void *)PCI_DMA_ERROR_CODE;
} }
tbl = dev->iommu_table; tbl = dev->iommu_table;
...@@ -517,7 +517,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size, ...@@ -517,7 +517,7 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
memset(ret, 0, npages << PAGE_SHIFT); memset(ret, 0, npages << PAGE_SHIFT);
/* Set up tces to cover the allocated range */ /* Set up tces to cover the allocated range */
tce = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL); tce = iommu_alloc(tbl, ret, npages, PCI_DMA_BIDIRECTIONAL);
if (tce == NO_TCE) { if (tce == PCI_DMA_ERROR_CODE) {
PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: iommu_alloc failed\n" ); PPCDBG(PPCDBG_TCE, "vio_alloc_consistent: iommu_alloc failed\n" );
free_pages((unsigned long)ret, order); free_pages((unsigned long)ret, order);
ret = NULL; ret = NULL;
......
...@@ -105,6 +105,9 @@ EXPORT_SYMBOL(viopath_ourLp); ...@@ -105,6 +105,9 @@ EXPORT_SYMBOL(viopath_ourLp);
*/ */
static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES]; static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES];
#define VIOPATH_KERN_WARN KERN_WARNING "viopath: "
#define VIOPATH_KERN_INFO KERN_INFO "viopath: "
static unsigned char e2a(unsigned char x) static unsigned char e2a(unsigned char x)
{ {
switch (x) { switch (x) {
...@@ -209,7 +212,7 @@ static int proc_viopath_show(struct seq_file *m, void *v) ...@@ -209,7 +212,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
((u64)handle) << 32, PAGE_SIZE, 0, 0); ((u64)handle) << 32, PAGE_SIZE, 0, 0);
if (hvrc != HvLpEvent_Rc_Good) if (hvrc != HvLpEvent_Rc_Good)
printk("viopath hv error on op %d\n", (int)hvrc); printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
down(&Semaphore); down(&Semaphore);
...@@ -318,7 +321,7 @@ static void sendMonMsg(HvLpIndex remoteLp) ...@@ -318,7 +321,7 @@ static void sendMonMsg(HvLpIndex remoteLp)
if (hvrc == HvLpEvent_Rc_Good) if (hvrc == HvLpEvent_Rc_Good)
viopathStatus[remoteLp].isActive = 1; viopathStatus[remoteLp].isActive = 1;
else { else {
printk(KERN_WARNING_VIO "could not connect to partition %d\n", printk(VIOPATH_KERN_WARN "could not connect to partition %d\n",
remoteLp); remoteLp);
viopathStatus[remoteLp].isActive = 0; viopathStatus[remoteLp].isActive = 0;
} }
...@@ -355,11 +358,11 @@ static void handleMonitorEvent(struct HvLpEvent *event) ...@@ -355,11 +358,11 @@ static void handleMonitorEvent(struct HvLpEvent *event)
remoteLp = event->xTargetLp; remoteLp = event->xTargetLp;
if ((event->xSourceInstanceId != viopathStatus[remoteLp].mSourceInst) || if ((event->xSourceInstanceId != viopathStatus[remoteLp].mSourceInst) ||
(event->xTargetInstanceId != viopathStatus[remoteLp].mTargetInst)) { (event->xTargetInstanceId != viopathStatus[remoteLp].mTargetInst)) {
printk(KERN_WARNING_VIO "ignoring ack....mismatched instances\n"); printk(VIOPATH_KERN_WARN "ignoring ack....mismatched instances\n");
return; return;
} }
printk(KERN_WARNING_VIO "partition %d ended\n", remoteLp); printk(VIOPATH_KERN_WARN "partition %d ended\n", remoteLp);
viopathStatus[remoteLp].isActive = 0; viopathStatus[remoteLp].isActive = 0;
...@@ -403,7 +406,7 @@ static void handleConfig(struct HvLpEvent *event) ...@@ -403,7 +406,7 @@ static void handleConfig(struct HvLpEvent *event)
if (!event) if (!event)
return; return;
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected config request from partition %d", "unexpected config request from partition %d",
event->xSourceLp); event->xSourceLp);
...@@ -461,7 +464,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -461,7 +464,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (viopathStatus[remoteLp].isActive if (viopathStatus[remoteLp].isActive
&& (event->xSourceInstanceId != && (event->xSourceInstanceId !=
viopathStatus[remoteLp].mTargetInst)) { viopathStatus[remoteLp].mTargetInst)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"int msg rcvd, source inst (%d) doesnt match (%d)\n", "int msg rcvd, source inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mTargetInst, viopathStatus[remoteLp].mTargetInst,
...@@ -472,7 +475,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -472,7 +475,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (viopathStatus[remoteLp].isActive if (viopathStatus[remoteLp].isActive
&& (event->xTargetInstanceId != && (event->xTargetInstanceId !=
viopathStatus[remoteLp].mSourceInst)) { viopathStatus[remoteLp].mSourceInst)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"int msg rcvd, target inst (%d) doesnt match (%d)\n", "int msg rcvd, target inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mSourceInst, viopathStatus[remoteLp].mSourceInst,
...@@ -483,7 +486,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -483,7 +486,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
remoteLp = event->xTargetLp; remoteLp = event->xTargetLp;
if (event->xSourceInstanceId != if (event->xSourceInstanceId !=
viopathStatus[remoteLp].mSourceInst) { viopathStatus[remoteLp].mSourceInst) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"ack msg rcvd, source inst (%d) doesnt match (%d)\n", "ack msg rcvd, source inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mSourceInst, viopathStatus[remoteLp].mSourceInst,
...@@ -493,7 +496,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -493,7 +496,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (event->xTargetInstanceId != if (event->xTargetInstanceId !=
viopathStatus[remoteLp].mTargetInst) { viopathStatus[remoteLp].mTargetInst) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"viopath: ack msg rcvd, target inst (%d) doesnt match (%d)\n", "viopath: ack msg rcvd, target inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mTargetInst, viopathStatus[remoteLp].mTargetInst,
...@@ -503,7 +506,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -503,7 +506,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
} }
if (vio_handler[subtype] == NULL) { if (vio_handler[subtype] == NULL) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected virtual io event subtype %d from partition %d\n", "unexpected virtual io event subtype %d from partition %d\n",
event->xSubtype, remoteLp); event->xSubtype, remoteLp);
/* No handler. Ack if necessary */ /* No handler. Ack if necessary */
...@@ -608,8 +611,8 @@ int viopath_open(HvLpIndex remoteLp, int subtype, int numReq) ...@@ -608,8 +611,8 @@ int viopath_open(HvLpIndex remoteLp, int subtype, int numReq)
HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo, HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo,
&vio_handleEvent); &vio_handleEvent);
sendMonMsg(remoteLp); sendMonMsg(remoteLp);
printk(KERN_INFO_VIO printk(VIOPATH_KERN_INFO "opening connection to partition %d, "
"Opening connection to partition %d, setting sinst %d, tinst %d\n", "setting sinst %d, tinst %d\n",
remoteLp, viopathStatus[remoteLp].mSourceInst, remoteLp, viopathStatus[remoteLp].mSourceInst,
viopathStatus[remoteLp].mTargetInst); viopathStatus[remoteLp].mTargetInst);
} }
...@@ -662,7 +665,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq) ...@@ -662,7 +665,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
numOpen += viopathStatus[remoteLp].users[i]; numOpen += viopathStatus[remoteLp].users[i];
if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) { if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {
printk(KERN_INFO_VIO "Closing connection to partition %d", printk(VIOPATH_KERN_INFO "closing connection to partition %d",
remoteLp); remoteLp);
HvCallEvent_closeLpEventPath(remoteLp, HvCallEvent_closeLpEventPath(remoteLp,
...@@ -696,23 +699,21 @@ void vio_free_event_buffer(int subtype, void *buffer) ...@@ -696,23 +699,21 @@ void vio_free_event_buffer(int subtype, void *buffer)
{ {
subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT; subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES)) { if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected subtype %d freeing event buffer\n", "unexpected subtype %d freeing event buffer\n", subtype);
subtype);
return; return;
} }
if (atomic_read(&event_buffer_available[subtype]) != 0) { if (atomic_read(&event_buffer_available[subtype]) != 0) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"freeing unallocated event buffer, subtype %d\n", "freeing unallocated event buffer, subtype %d\n",
subtype); subtype);
return; return;
} }
if (buffer != &event_buffer[subtype * 256]) { if (buffer != &event_buffer[subtype * 256]) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"freeing invalid event buffer, subtype %d\n", "freeing invalid event buffer, subtype %d\n", subtype);
subtype);
} }
atomic_set(&event_buffer_available[subtype], 1); atomic_set(&event_buffer_available[subtype], 1);
......
...@@ -67,7 +67,8 @@ include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ...@@ -67,7 +67,8 @@ include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets) $(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s arch/$(ARCH)/kernel/asm-offsets.s \
arch/$(ARCH)/boot/System.map
# Don't use tabs in echo arguments. # Don't use tabs in echo arguments.
define archhelp define archhelp
......
...@@ -32,6 +32,3 @@ $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE ...@@ -32,6 +32,3 @@ $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
$(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE $(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE
$(call if_changed,btfix) $(call if_changed,btfix)
clean:
rm $(obj)/System.map
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/obio.h> #include <asm/obio.h>
#include <asm/mxcc.h> #include <asm/mxcc.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
#include <asm/param.h>
#include <asm/asmmacro.h> #include <asm/asmmacro.h>
...@@ -1808,36 +1809,37 @@ fpload: ...@@ -1808,36 +1809,37 @@ fpload:
retl retl
nop nop
.globl ndelay /* __ndelay and __udelay take two arguments:
ndelay: * 0 - nsecs or usecs to delay
* 1 - per_cpu udelay_val (loops per jiffy)
*
* Note that ndelay gives HZ times higher resolution but has a 10ms
* limit. udelay can handle up to 1s.
*/
.globl __ndelay
__ndelay:
save %sp, -STACKFRAME_SZ, %sp save %sp, -STACKFRAME_SZ, %sp
mov %i0, %o0 mov %i0, %o0
call .umul call .umul
mov 5, %o1 mov 0x1ad, %o1 ! 2**32 / (1 000 000 000 / HZ)
call .umul
mov %i1, %o1 ! udelay_val
ba delay_continue ba delay_continue
nop mov %o1, %o0 ! >>32 later for better resolution
.globl udelay .globl __udelay
udelay: __udelay:
save %sp, -STACKFRAME_SZ, %sp save %sp, -STACKFRAME_SZ, %sp
mov %i0, %o0 mov %i0, %o0
sethi %hi(0x10c6), %o1 sethi %hi(0x10c6), %o1
call .umul call .umul
or %o1, %lo(0x10c6), %o1 or %o1, %lo(0x10c6), %o1 ! 2**32 / 1 000 000
delay_continue:
#ifndef CONFIG_SMP
sethi %hi(loops_per_jiffy), %o3
call .umul call .umul
ld [%o3 + %lo(loops_per_jiffy)], %o1 mov %i1, %o1 ! udelay_val
#else
GET_PROCESSOR_OFFSET(o4, o2)
set cpu_data, %o3
call .umul
ld [%o3 + %o4], %o1
#endif
call .umul call .umul
mov 100, %o0 mov HZ, %o0 ! >>32 earlier for wider range
delay_continue:
cmp %o0, 0x0 cmp %o0, 0x0
1: 1:
bne 1b bne 1b
......
...@@ -331,6 +331,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -331,6 +331,7 @@ void __init setup_arch(char **cmdline_p)
if (highest_paddr < top) if (highest_paddr < top)
highest_paddr = top; highest_paddr = top;
} }
pfn_base = phys_base >> PAGE_SHIFT;
if (!root_flags) if (!root_flags)
root_mountflags &= ~MS_RDONLY; root_mountflags &= ~MS_RDONLY;
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/delay.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/delay.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
......
...@@ -145,6 +145,7 @@ EXPORT_SYMBOL(__down_interruptible); ...@@ -145,6 +145,7 @@ EXPORT_SYMBOL(__down_interruptible);
EXPORT_SYMBOL(sparc_valid_addr_bitmap); EXPORT_SYMBOL(sparc_valid_addr_bitmap);
EXPORT_SYMBOL(phys_base); EXPORT_SYMBOL(phys_base);
EXPORT_SYMBOL(pfn_base);
/* Atomic operations. */ /* Atomic operations. */
EXPORT_SYMBOL(___atomic24_add); EXPORT_SYMBOL(___atomic24_add);
...@@ -164,8 +165,8 @@ EXPORT_SYMBOL(__cpu_number_map); ...@@ -164,8 +165,8 @@ EXPORT_SYMBOL(__cpu_number_map);
EXPORT_SYMBOL(__cpu_logical_map); EXPORT_SYMBOL(__cpu_logical_map);
#endif #endif
EXPORT_SYMBOL(udelay); EXPORT_SYMBOL(__udelay);
EXPORT_SYMBOL(ndelay); EXPORT_SYMBOL(__ndelay);
EXPORT_SYMBOL(rtc_lock); EXPORT_SYMBOL(rtc_lock);
EXPORT_SYMBOL(mostek_lock); EXPORT_SYMBOL(mostek_lock);
EXPORT_SYMBOL(mstk48t02_regs); EXPORT_SYMBOL(mstk48t02_regs);
......
...@@ -49,7 +49,6 @@ static int smp_highest_cpu; ...@@ -49,7 +49,6 @@ static int smp_highest_cpu;
extern int smp_threads_ready; extern int smp_threads_ready;
extern volatile unsigned long cpu_callin_map[NR_CPUS]; extern volatile unsigned long cpu_callin_map[NR_CPUS];
extern struct cpuinfo_sparc cpu_data[NR_CPUS]; extern struct cpuinfo_sparc cpu_data[NR_CPUS];
extern unsigned long cpu_offset[NR_CPUS];
extern unsigned char boot_cpu_id; extern unsigned char boot_cpu_id;
extern int smp_activated; extern int smp_activated;
extern volatile int __cpu_number_map[NR_CPUS]; extern volatile int __cpu_number_map[NR_CPUS];
...@@ -171,9 +170,6 @@ void __init smp4d_boot_cpus(void) ...@@ -171,9 +170,6 @@ void __init smp4d_boot_cpus(void)
printk("Entering SMP Mode...\n"); printk("Entering SMP Mode...\n");
for (i = 0; i < NR_CPUS; i++)
cpu_offset[i] = (char *)&(cpu_data(i)) - (char *)&(cpu_data(0));
if (boot_cpu_id) if (boot_cpu_id)
current_set[0] = NULL; current_set[0] = NULL;
...@@ -427,9 +423,6 @@ void smp4d_message_pass(int target, int msg, unsigned long data, int wait) ...@@ -427,9 +423,6 @@ void smp4d_message_pass(int target, int msg, unsigned long data, int wait)
extern void sparc_do_profile(unsigned long pc, unsigned long o7); extern void sparc_do_profile(unsigned long pc, unsigned long o7);
#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
#define prof_counter(__cpu) cpu_data(__cpu).counter
void smp4d_percpu_timer_interrupt(struct pt_regs *regs) void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
{ {
int cpu = hard_smp4d_processor_id(); int cpu = hard_smp4d_processor_id();
......
...@@ -44,7 +44,6 @@ extern unsigned long cpu_present_map; ...@@ -44,7 +44,6 @@ extern unsigned long cpu_present_map;
extern int smp_num_cpus; extern int smp_num_cpus;
extern int smp_threads_ready; extern int smp_threads_ready;
extern volatile unsigned long cpu_callin_map[NR_CPUS]; extern volatile unsigned long cpu_callin_map[NR_CPUS];
extern unsigned long cpu_offset[NR_CPUS];
extern unsigned char boot_cpu_id; extern unsigned char boot_cpu_id;
extern int smp_activated; extern int smp_activated;
extern volatile int __cpu_number_map[NR_CPUS]; extern volatile int __cpu_number_map[NR_CPUS];
...@@ -152,9 +151,7 @@ void __init smp4m_boot_cpus(void) ...@@ -152,9 +151,7 @@ void __init smp4m_boot_cpus(void)
for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++) for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
cpu_present_map |= (1<<mid); cpu_present_map |= (1<<mid);
/* XXX cpu_offset is broken -Keith */
for(i=0; i < NR_CPUS; i++) { for(i=0; i < NR_CPUS; i++) {
cpu_offset[i] = (char *)&(cpu_data(i)) - (char *)&(cpu_data(0));
__cpu_number_map[i] = -1; __cpu_number_map[i] = -1;
__cpu_logical_map[i] = -1; __cpu_logical_map[i] = -1;
} }
...@@ -409,9 +406,6 @@ void smp4m_cross_call_irq(void) ...@@ -409,9 +406,6 @@ void smp4m_cross_call_irq(void)
extern void sparc_do_profile(unsigned long pc, unsigned long o7); extern void sparc_do_profile(unsigned long pc, unsigned long o7);
#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
#define prof_counter(__cpu) cpu_data(__cpu).counter
void smp4m_percpu_timer_interrupt(struct pt_regs *regs) void smp4m_percpu_timer_interrupt(struct pt_regs *regs)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
......
...@@ -38,6 +38,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); ...@@ -38,6 +38,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
unsigned long *sparc_valid_addr_bitmap; unsigned long *sparc_valid_addr_bitmap;
unsigned long phys_base; unsigned long phys_base;
unsigned long pfn_base;
unsigned long page_kernel; unsigned long page_kernel;
...@@ -134,7 +135,7 @@ unsigned long calc_highpages(void) ...@@ -134,7 +135,7 @@ unsigned long calc_highpages(void)
unsigned long calc_max_low_pfn(void) unsigned long calc_max_low_pfn(void)
{ {
int i; int i;
unsigned long tmp = (SRMMU_MAXMEM >> PAGE_SHIFT); unsigned long tmp = pfn_base + (SRMMU_MAXMEM >> PAGE_SHIFT);
unsigned long curr_pfn, last_pfn; unsigned long curr_pfn, last_pfn;
last_pfn = (sp_banks[0].base_addr + sp_banks[0].num_bytes) >> PAGE_SHIFT; last_pfn = (sp_banks[0].base_addr + sp_banks[0].num_bytes) >> PAGE_SHIFT;
...@@ -189,9 +190,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) ...@@ -189,9 +190,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
*/ */
start_pfn = (unsigned long)__pa(PAGE_ALIGN((unsigned long) &_end)); start_pfn = (unsigned long)__pa(PAGE_ALIGN((unsigned long) &_end));
/* Adjust up to the physical address where the kernel begins. */
start_pfn += phys_base;
/* Now shift down to get the real physical page frame number. */ /* Now shift down to get the real physical page frame number. */
start_pfn >>= PAGE_SHIFT; start_pfn >>= PAGE_SHIFT;
...@@ -202,8 +200,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) ...@@ -202,8 +200,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
max_low_pfn = max_pfn; max_low_pfn = max_pfn;
highstart_pfn = highend_pfn = max_pfn; highstart_pfn = highend_pfn = max_pfn;
if (max_low_pfn > (SRMMU_MAXMEM >> PAGE_SHIFT)) { if (max_low_pfn > pfn_base + (SRMMU_MAXMEM >> PAGE_SHIFT)) {
highstart_pfn = (SRMMU_MAXMEM >> PAGE_SHIFT); highstart_pfn = pfn_base + (SRMMU_MAXMEM >> PAGE_SHIFT);
max_low_pfn = calc_max_low_pfn(); max_low_pfn = calc_max_low_pfn();
printk(KERN_NOTICE "%ldMB HIGHMEM available.\n", printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
calc_highpages() >> (20 - PAGE_SHIFT)); calc_highpages() >> (20 - PAGE_SHIFT));
...@@ -230,7 +228,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) ...@@ -230,7 +228,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
} }
#endif #endif
/* Initialize the boot-time allocator. */ /* Initialize the boot-time allocator. */
bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, phys_base>>PAGE_SHIFT, max_low_pfn); bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base,
max_low_pfn);
/* Now register the available physical memory with the /* Now register the available physical memory with the
* allocator. * allocator.
...@@ -267,8 +266,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) ...@@ -267,8 +266,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
reserve_bootmem(initrd_start, size); reserve_bootmem(initrd_start, size);
*pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT; *pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
initrd_start += PAGE_OFFSET; initrd_start = (initrd_start - phys_base) + PAGE_OFFSET;
initrd_end += PAGE_OFFSET; initrd_end = (initrd_end - phys_base) + PAGE_OFFSET;
} }
#endif #endif
/* Reserve the kernel text/data/bss. */ /* Reserve the kernel text/data/bss. */
...@@ -432,7 +431,7 @@ void __init mem_init(void) ...@@ -432,7 +431,7 @@ void __init mem_init(void)
taint_real_pages(); taint_real_pages();
max_mapnr = last_valid_pfn - (phys_base >> PAGE_SHIFT); max_mapnr = last_valid_pfn - pfn_base;
high_memory = __va(max_low_pfn << PAGE_SHIFT); high_memory = __va(max_low_pfn << PAGE_SHIFT);
num_physpages = totalram_pages = free_all_bootmem(); num_physpages = totalram_pages = free_all_bootmem();
...@@ -474,11 +473,9 @@ void free_initmem (void) ...@@ -474,11 +473,9 @@ void free_initmem (void)
addr = (unsigned long)(&__init_begin); addr = (unsigned long)(&__init_begin);
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
unsigned long page;
struct page *p; struct page *p;
page = addr + phys_base; p = virt_to_page(addr);
p = virt_to_page(page);
ClearPageReserved(p); ClearPageReserved(p);
set_page_count(p, 1); set_page_count(p, 1);
......
...@@ -213,7 +213,7 @@ static inline pte_t srmmu_pte_mkyoung(pte_t pte) ...@@ -213,7 +213,7 @@ static inline pte_t srmmu_pte_mkyoung(pte_t pte)
* and a page entry and page directory to the page they refer to. * and a page entry and page directory to the page they refer to.
*/ */
static pte_t srmmu_mk_pte(struct page *page, pgprot_t pgprot) static pte_t srmmu_mk_pte(struct page *page, pgprot_t pgprot)
{ return __pte(((page - mem_map) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); } { return __pte((page_to_pfn(page) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); }
static pte_t srmmu_mk_pte_phys(unsigned long page, pgprot_t pgprot) static pte_t srmmu_mk_pte_phys(unsigned long page, pgprot_t pgprot)
{ return __pte(((page) >> 4) | pgprot_val(pgprot)); } { return __pte(((page) >> 4) | pgprot_val(pgprot)); }
...@@ -245,7 +245,7 @@ static void srmmu_pmd_populate(pmd_t *pmdp, struct page *ptep) ...@@ -245,7 +245,7 @@ static void srmmu_pmd_populate(pmd_t *pmdp, struct page *ptep)
unsigned long ptp; /* Physical address, shifted right by 4 */ unsigned long ptp; /* Physical address, shifted right by 4 */
int i; int i;
ptp = (ptep - mem_map) << (PAGE_SHIFT-4); /* watch for overflow */ ptp = page_to_pfn(ptep) << (PAGE_SHIFT-4); /* watch for overflow */
for (i = 0; i < SRMMU_PTRS_PER_PTE_SOFT/SRMMU_PTRS_PER_PTE; i++) { for (i = 0; i < SRMMU_PTRS_PER_PTE_SOFT/SRMMU_PTRS_PER_PTE; i++) {
srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp); srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp);
ptp += (SRMMU_PTRS_PER_PTE*sizeof(pte_t) >> 4); ptp += (SRMMU_PTRS_PER_PTE*sizeof(pte_t) >> 4);
...@@ -480,7 +480,7 @@ srmmu_pte_alloc_one(struct mm_struct *mm, unsigned long address) ...@@ -480,7 +480,7 @@ srmmu_pte_alloc_one(struct mm_struct *mm, unsigned long address)
if ((pte = (unsigned long)srmmu_pte_alloc_one_kernel(mm, address)) == 0) if ((pte = (unsigned long)srmmu_pte_alloc_one_kernel(mm, address)) == 0)
return NULL; return NULL;
return mem_map + (__nocache_pa(pte) >> PAGE_SHIFT); return pfn_to_page( __nocache_pa(pte) >> PAGE_SHIFT );
} }
static void srmmu_free_pte_fast(pte_t *pte) static void srmmu_free_pte_fast(pte_t *pte)
...@@ -495,7 +495,7 @@ static void srmmu_pte_free(struct page *pte) ...@@ -495,7 +495,7 @@ static void srmmu_pte_free(struct page *pte)
p = (unsigned long)page_address(pte); /* Cached address (for test) */ p = (unsigned long)page_address(pte); /* Cached address (for test) */
if (p == 0) if (p == 0)
BUG(); BUG();
p = ((pte - mem_map) << PAGE_SHIFT); /* Physical address */ p = page_to_pfn(pte) << PAGE_SHIFT; /* Physical address */
p = (unsigned long) __nocache_va(p); /* Nocached virtual */ p = (unsigned long) __nocache_va(p); /* Nocached virtual */
srmmu_free_nocache(p, SRMMU_PTE_SZ_SOFT); srmmu_free_nocache(p, SRMMU_PTE_SZ_SOFT);
} }
...@@ -1316,7 +1316,7 @@ void __init srmmu_paging_init(void) ...@@ -1316,7 +1316,7 @@ void __init srmmu_paging_init(void)
for (znum = 0; znum < MAX_NR_ZONES; znum++) for (znum = 0; znum < MAX_NR_ZONES; znum++)
zones_size[znum] = zholes_size[znum] = 0; zones_size[znum] = zholes_size[znum] = 0;
npages = max_low_pfn - (phys_base >> PAGE_SHIFT); npages = max_low_pfn - pfn_base;
zones_size[ZONE_DMA] = npages; zones_size[ZONE_DMA] = npages;
zholes_size[ZONE_DMA] = npages - pages_avail; zholes_size[ZONE_DMA] = npages - pages_avail;
...@@ -1326,13 +1326,9 @@ void __init srmmu_paging_init(void) ...@@ -1326,13 +1326,9 @@ void __init srmmu_paging_init(void)
zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); zholes_size[ZONE_HIGHMEM] = npages - calc_highpages();
free_area_init_node(0, &contig_page_data, NULL, zones_size, free_area_init_node(0, &contig_page_data, NULL, zones_size,
phys_base >> PAGE_SHIFT, zholes_size); pfn_base, zholes_size);
mem_map = contig_page_data.node_mem_map; mem_map = contig_page_data.node_mem_map;
} }
/* P3: easy to fix, todo. Current code is utterly broken, though. */
if (phys_base != 0)
panic("phys_base nonzero");
} }
static void srmmu_mmu_info(struct seq_file *m) static void srmmu_mmu_info(struct seq_file *m)
......
...@@ -2088,7 +2088,7 @@ void __init sun4c_paging_init(void) ...@@ -2088,7 +2088,7 @@ void __init sun4c_paging_init(void)
for (znum = 0; znum < MAX_NR_ZONES; znum++) for (znum = 0; znum < MAX_NR_ZONES; znum++)
zones_size[znum] = zholes_size[znum] = 0; zones_size[znum] = zholes_size[znum] = 0;
npages = max_low_pfn - (phys_base >> PAGE_SHIFT); npages = max_low_pfn - pfn_base;
zones_size[ZONE_DMA] = npages; zones_size[ZONE_DMA] = npages;
zholes_size[ZONE_DMA] = npages - pages_avail; zholes_size[ZONE_DMA] = npages - pages_avail;
...@@ -2098,7 +2098,7 @@ void __init sun4c_paging_init(void) ...@@ -2098,7 +2098,7 @@ void __init sun4c_paging_init(void)
zholes_size[ZONE_HIGHMEM] = npages - calc_highpages(); zholes_size[ZONE_HIGHMEM] = npages - calc_highpages();
free_area_init_node(0, &contig_page_data, NULL, zones_size, free_area_init_node(0, &contig_page_data, NULL, zones_size,
phys_base >> PAGE_SHIFT, zholes_size); pfn_base, zholes_size);
mem_map = contig_page_data.node_mem_map; mem_map = contig_page_data.node_mem_map;
} }
......
...@@ -27,7 +27,7 @@ static int tiocgdev(unsigned fd, unsigned cmd, unsigned int *ptr) ...@@ -27,7 +27,7 @@ static int tiocgdev(unsigned fd, unsigned cmd, unsigned int *ptr)
struct file *file = fget(fd); struct file *file = fget(fd);
struct tty_struct *real_tty; struct tty_struct *real_tty;
if (!fd) if (!file)
return -EBADF; return -EBADF;
if (file->f_op->ioctl != tty_ioctl) if (file->f_op->ioctl != tty_ioctl)
return -EINVAL; return -EINVAL;
......
...@@ -161,6 +161,15 @@ config CRYPTO_DEFLATE ...@@ -161,6 +161,15 @@ config CRYPTO_DEFLATE
You will most probably want this if using IPSec. You will most probably want this if using IPSec.
config CRYPTO_MICHAEL_MIC
tristate "Michael MIC keyed digest algorithm"
depends on CRYPTO
help
Michael MIC is used for message integrity protection in TKIP
(IEEE 802.11i). This algorithm is required for TKIP, but it
should not be used for other purposes because of the weakness
of the algorithm.
config CRYPTO_TEST config CRYPTO_TEST
tristate "Testing module" tristate "Testing module"
depends on CRYPTO depends on CRYPTO
......
...@@ -23,5 +23,6 @@ obj-$(CONFIG_CRYPTO_CAST5) += cast5.o ...@@ -23,5 +23,6 @@ obj-$(CONFIG_CRYPTO_CAST5) += cast5.o
obj-$(CONFIG_CRYPTO_CAST6) += cast6.o obj-$(CONFIG_CRYPTO_CAST6) += cast6.o
obj-$(CONFIG_CRYPTO_ARC4) += arc4.o obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
...@@ -45,10 +45,6 @@ static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u ...@@ -45,10 +45,6 @@ static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u
k = 0; k = 0;
} }
/* TODO: dump the first 768 bytes generated as recommended
by Ilya Mironov (http://eprint.iacr.org/2002/067/) to
increase the statistical strength of the state table */
return 0; return 0;
} }
......
...@@ -42,6 +42,15 @@ static void final(struct crypto_tfm *tfm, u8 *out) ...@@ -42,6 +42,15 @@ static void final(struct crypto_tfm *tfm, u8 *out)
tfm->__crt_alg->cra_digest.dia_final(crypto_tfm_ctx(tfm), out); tfm->__crt_alg->cra_digest.dia_final(crypto_tfm_ctx(tfm), out);
} }
static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
{
u32 flags;
if (tfm->__crt_alg->cra_digest.dia_setkey == NULL)
return -ENOSYS;
return tfm->__crt_alg->cra_digest.dia_setkey(crypto_tfm_ctx(tfm),
key, keylen, &flags);
}
static void digest(struct crypto_tfm *tfm, static void digest(struct crypto_tfm *tfm,
struct scatterlist *sg, unsigned int nsg, u8 *out) struct scatterlist *sg, unsigned int nsg, u8 *out)
{ {
...@@ -72,6 +81,7 @@ int crypto_init_digest_ops(struct crypto_tfm *tfm) ...@@ -72,6 +81,7 @@ int crypto_init_digest_ops(struct crypto_tfm *tfm)
ops->dit_update = update; ops->dit_update = update;
ops->dit_final = final; ops->dit_final = final;
ops->dit_digest = digest; ops->dit_digest = digest;
ops->dit_setkey = setkey;
return crypto_alloc_hmac_block(tfm); return crypto_alloc_hmac_block(tfm);
} }
......
/*
* Cryptographic API
*
* Michael MIC (IEEE 802.11i/TKIP) keyed digest
*
* Copyright (c) 2004 Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/crypto.h>
struct michael_mic_ctx {
u8 pending[4];
size_t pending_len;
u32 l, r;
};
static inline u32 rotl(u32 val, int bits)
{
return (val << bits) | (val >> (32 - bits));
}
static inline u32 rotr(u32 val, int bits)
{
return (val >> bits) | (val << (32 - bits));
}
static inline u32 xswap(u32 val)
{
return ((val & 0x00ff00ff) << 8) | ((val & 0xff00ff00) >> 8);
}
#define michael_block(l, r) \
do { \
r ^= rotl(l, 17); \
l += r; \
r ^= xswap(l); \
l += r; \
r ^= rotl(l, 3); \
l += r; \
r ^= rotr(l, 2); \
l += r; \
} while (0)
static inline u32 get_le32(const u8 *p)
{
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}
static inline void put_le32(u8 *p, u32 v)
{
p[0] = v;
p[1] = v >> 8;
p[2] = v >> 16;
p[3] = v >> 24;
}
static void michael_init(void *ctx)
{
struct michael_mic_ctx *mctx = ctx;
mctx->pending_len = 0;
}
static void michael_update(void *ctx, const u8 *data, unsigned int len)
{
struct michael_mic_ctx *mctx = ctx;
if (mctx->pending_len) {
int flen = 4 - mctx->pending_len;
if (flen > len)
flen = len;
memcpy(&mctx->pending[mctx->pending_len], data, flen);
mctx->pending_len += flen;
data += flen;
len -= flen;
if (mctx->pending_len < 4)
return;
mctx->l ^= get_le32(mctx->pending);
michael_block(mctx->l, mctx->r);
mctx->pending_len = 0;
}
while (len >= 4) {
mctx->l ^= get_le32(data);
michael_block(mctx->l, mctx->r);
data += 4;
len -= 4;
}
if (len > 0) {
mctx->pending_len = len;
memcpy(mctx->pending, data, len);
}
}
static void michael_final(void *ctx, u8 *out)
{
struct michael_mic_ctx *mctx = ctx;
u8 *data = mctx->pending;
/* Last block and padding (0x5a, 4..7 x 0) */
switch (mctx->pending_len) {
case 0:
mctx->l ^= 0x5a;
break;
case 1:
mctx->l ^= data[0] | 0x5a00;
break;
case 2:
mctx->l ^= data[0] | (data[1] << 8) | 0x5a0000;
break;
case 3:
mctx->l ^= data[0] | (data[1] << 8) | (data[2] << 16) |
0x5a000000;
break;
}
michael_block(mctx->l, mctx->r);
/* l ^= 0; */
michael_block(mctx->l, mctx->r);
put_le32(out, mctx->l);
put_le32(out + 4, mctx->r);
}
static int michael_setkey(void *ctx, const u8 *key, unsigned int keylen,
u32 *flags)
{
struct michael_mic_ctx *mctx = ctx;
if (keylen != 8) {
if (flags)
*flags = CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
mctx->l = get_le32(key);
mctx->r = get_le32(key + 4);
return 0;
}
static struct crypto_alg michael_mic_alg = {
.cra_name = "michael_mic",
.cra_flags = CRYPTO_ALG_TYPE_DIGEST,
.cra_blocksize = 8,
.cra_ctxsize = sizeof(struct michael_mic_ctx),
.cra_module = THIS_MODULE,
.cra_list = LIST_HEAD_INIT(michael_mic_alg.cra_list),
.cra_u = { .digest = {
.dia_digestsize = 8,
.dia_init = michael_init,
.dia_update = michael_update,
.dia_final = michael_final,
.dia_setkey = michael_setkey } }
};
static int __init michael_mic_init(void)
{
return crypto_register_alg(&michael_mic_alg);
}
static void __exit michael_mic_exit(void)
{
crypto_unregister_alg(&michael_mic_alg);
}
module_init(michael_mic_init);
module_exit(michael_mic_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Michael MIC");
MODULE_AUTHOR("Jouni Malinen <jkmaline@cc.hut.fi>");
...@@ -61,7 +61,7 @@ static char *tvmem; ...@@ -61,7 +61,7 @@ static char *tvmem;
static char *check[] = { static char *check[] = {
"des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish", "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
"twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
"arc4", "deflate", NULL "arc4", "michael_mic", "deflate", NULL
}; };
static void static void
...@@ -112,6 +112,10 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount) ...@@ -112,6 +112,10 @@ test_hash (char * algo, struct hash_testvec * template, unsigned int tcount)
sg[0].length = hash_tv[i].psize; sg[0].length = hash_tv[i].psize;
crypto_digest_init (tfm); crypto_digest_init (tfm);
if (tfm->crt_u.digest.dit_setkey) {
crypto_digest_setkey (tfm, hash_tv[i].key,
hash_tv[i].ksize);
}
crypto_digest_update (tfm, sg, 1); crypto_digest_update (tfm, sg, 1);
crypto_digest_final (tfm, result); crypto_digest_final (tfm, result);
...@@ -568,6 +572,8 @@ do_test(void) ...@@ -568,6 +572,8 @@ do_test(void)
test_hmac("sha1", hmac_sha1_tv_template, HMAC_SHA1_TEST_VECTORS); test_hmac("sha1", hmac_sha1_tv_template, HMAC_SHA1_TEST_VECTORS);
test_hmac("sha256", hmac_sha256_tv_template, HMAC_SHA256_TEST_VECTORS); test_hmac("sha256", hmac_sha256_tv_template, HMAC_SHA256_TEST_VECTORS);
#endif #endif
test_hash("michael_mic", michael_mic_tv_template, MICHAEL_MIC_TEST_VECTORS);
break; break;
case 1: case 1:
...@@ -647,6 +653,10 @@ do_test(void) ...@@ -647,6 +653,10 @@ do_test(void)
test_cipher ("arc4", MODE_ECB, DECRYPT, arc4_dec_tv_template, ARC4_DEC_TEST_VECTORS); test_cipher ("arc4", MODE_ECB, DECRYPT, arc4_dec_tv_template, ARC4_DEC_TEST_VECTORS);
break; break;
case 17:
test_hash("michael_mic", michael_mic_tv_template, MICHAEL_MIC_TEST_VECTORS);
break;
#ifdef CONFIG_CRYPTO_HMAC #ifdef CONFIG_CRYPTO_HMAC
case 100: case 100:
test_hmac("md5", hmac_md5_tv_template, HMAC_MD5_TEST_VECTORS); test_hmac("md5", hmac_md5_tv_template, HMAC_MD5_TEST_VECTORS);
......
...@@ -30,6 +30,8 @@ struct hash_testvec { ...@@ -30,6 +30,8 @@ struct hash_testvec {
char digest[MAX_DIGEST_SIZE]; char digest[MAX_DIGEST_SIZE];
unsigned char np; unsigned char np;
unsigned char tap[MAX_TAP]; unsigned char tap[MAX_TAP];
char key[128]; /* only used with keyed hash algorithms */
unsigned char ksize;
}; };
struct hmac_testvec { struct hmac_testvec {
...@@ -1719,4 +1721,54 @@ struct comp_testvec deflate_decomp_tv_template[] = { ...@@ -1719,4 +1721,54 @@ struct comp_testvec deflate_decomp_tv_template[] = {
}, },
}; };
/*
* Michael MIC test vectors from IEEE 802.11i
*/
#define MICHAEL_MIC_TEST_VECTORS 6
struct hash_testvec michael_mic_tv_template[] =
{
{
.key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.ksize = 8,
.plaintext = { },
.psize = 0,
.digest = { 0x82, 0x92, 0x5c, 0x1c, 0xa1, 0xd1, 0x30, 0xb8 }
},
{
.key = { 0x82, 0x92, 0x5c, 0x1c, 0xa1, 0xd1, 0x30, 0xb8 },
.ksize = 8,
.plaintext = { 'M' },
.psize = 1,
.digest = { 0x43, 0x47, 0x21, 0xca, 0x40, 0x63, 0x9b, 0x3f }
},
{
.key = { 0x43, 0x47, 0x21, 0xca, 0x40, 0x63, 0x9b, 0x3f },
.ksize = 8,
.plaintext = { 'M', 'i' },
.psize = 2,
.digest = { 0xe8, 0xf9, 0xbe, 0xca, 0xe9, 0x7e, 0x5d, 0x29 }
},
{
.key = { 0xe8, 0xf9, 0xbe, 0xca, 0xe9, 0x7e, 0x5d, 0x29 },
.ksize = 8,
.plaintext = { 'M', 'i', 'c' },
.psize = 3,
.digest = { 0x90, 0x03, 0x8f, 0xc6, 0xcf, 0x13, 0xc1, 0xdb }
},
{
.key = { 0x90, 0x03, 0x8f, 0xc6, 0xcf, 0x13, 0xc1, 0xdb },
.ksize = 8,
.plaintext = { 'M', 'i', 'c', 'h' },
.psize = 4,
.digest = { 0xd5, 0x5e, 0x10, 0x05, 0x10, 0x12, 0x89, 0x86 }
},
{
.key = { 0xd5, 0x5e, 0x10, 0x05, 0x10, 0x12, 0x89, 0x86 },
.ksize = 8,
.plaintext = { 'M', 'i', 'c', 'h', 'a', 'e', 'l' },
.psize = 7,
.digest = { 0x0a, 0x94, 0x2b, 0x12, 0x4e, 0xca, 0xa5, 0x46 },
}
};
#endif /* _CRYPTO_TCRYPT_H */ #endif /* _CRYPTO_TCRYPT_H */
...@@ -73,6 +73,9 @@ static struct usb_device_id bluetooth_ids[] = { ...@@ -73,6 +73,9 @@ static struct usb_device_id bluetooth_ids[] = {
/* Generic Bluetooth USB device */ /* Generic Bluetooth USB device */
{ USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) }, { USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) },
/* AVM BlueFRITZ! USB v2.0 */
{ USB_DEVICE(0x057c, 0x3800) },
/* Ericsson with non-standard id */ /* Ericsson with non-standard id */
{ USB_DEVICE(0x0bdb, 0x1002) }, { USB_DEVICE(0x0bdb, 0x1002) },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Colin Devilbiss <devilbis@us.ibm.com> * Colin Devilbiss <devilbis@us.ibm.com>
* Stephen Rothwell <sfr@au1.ibm.com> * Stephen Rothwell <sfr@au1.ibm.com>
* *
* (C) Copyright 2000, 2001, 2002, 2003 IBM Corporation * (C) Copyright 2000, 2001, 2002, 2003, 2004 IBM Corporation
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#define VTTY_PORTS 10 #define VTTY_PORTS 10
#define VIOTTY_SERIAL_START 65 #define VIOTTY_SERIAL_START 65
#define VIOCONS_KERN_WARN KERN_WARNING "viocons: "
#define VIOCONS_KERN_INFO KERN_INFO "viocons: "
static spinlock_t consolelock = SPIN_LOCK_UNLOCKED; static spinlock_t consolelock = SPIN_LOCK_UNLOCKED;
static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED; static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED;
...@@ -189,10 +192,10 @@ void hvlogOutput(const char *buf, int count) ...@@ -189,10 +192,10 @@ void hvlogOutput(const char *buf, int count)
static inline int viotty_paranoia_check(struct port_info *pi, static inline int viotty_paranoia_check(struct port_info *pi,
char *name, const char *routine) char *name, const char *routine)
{ {
static const char *bad_pi_addr = KERN_WARNING_VIO static const char *bad_pi_addr = VIOCONS_KERN_WARN
"Warning: bad address for port_info struct (%s) in %s\n"; "warning: bad address for port_info struct (%s) in %s\n";
static const char *badmagic = KERN_WARNING_VIO static const char *badmagic = VIOCONS_KERN_WARN
"Warning: bad magic number for port_info struct (%s) in %s\n"; "warning: bad magic number for port_info struct (%s) in %s\n";
if ((pi < &port_info[0]) || (viochar_port(pi) > VTTY_PORTS)) { if ((pi < &port_info[0]) || (viochar_port(pi) > VTTY_PORTS)) {
printk(bad_pi_addr, name, routine); printk(bad_pi_addr, name, routine);
...@@ -395,8 +398,8 @@ static void send_buffers(struct port_info *pi) ...@@ -395,8 +398,8 @@ static void send_buffers(struct port_info *pi)
vio_free_event_buffer(viomajorsubtype_chario, viochar); vio_free_event_buffer(viomajorsubtype_chario, viochar);
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console error sending event! return code %d\n", "error sending event! return code %d\n",
(int)hvrc); (int)hvrc);
return; return;
} }
...@@ -692,8 +695,8 @@ static int viotty_open(struct tty_struct *tty, struct file *filp) ...@@ -692,8 +695,8 @@ static int viotty_open(struct tty_struct *tty, struct file *filp)
/* If some other TTY is already connected here, reject the open */ /* If some other TTY is already connected here, reject the open */
if ((pi->tty) && (pi->tty != tty)) { if ((pi->tty) && (pi->tty != tty)) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console attempt to open device twice from different ttys\n"); "attempt to open device twice from different ttys\n");
return -EBUSY; return -EBUSY;
} }
tty->driver_data = pi; tty->driver_data = pi;
...@@ -964,23 +967,22 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -964,23 +967,22 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
if (event->xRc != HvLpEvent_Rc_Good) if (event->xRc != HvLpEvent_Rc_Good)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: event->xRc != HvLpEvent_Rc_Good, event->xRc == (%d).\n", "handle_open_event: event->xRc == (%d).\n",
event->xRc); event->xRc);
if (event->xCorrelationToken != 0) { if (event->xCorrelationToken != 0) {
atomic_t *aptr= (atomic_t *)event->xCorrelationToken; atomic_t *aptr= (atomic_t *)event->xCorrelationToken;
atomic_set(aptr, 1); atomic_set(aptr, 1);
} else } else
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: wierd...got open ack without atomic\n"); "wierd...got open ack without atomic\n");
return; return;
} }
/* This had better require an ack, otherwise complain */ /* This had better require an ack, otherwise complain */
if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) { if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n");
"console: viocharopen without ack bit!\n");
return; return;
} }
...@@ -1019,11 +1021,10 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -1019,11 +1021,10 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
if (reject == 1) if (reject == 1)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "open rejected: bad virtual tty.\n");
"viocons: console open rejected : bad virtual tty.\n");
else if (reject == 2) else if (reject == 2)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: console open rejected : console in exclusive use by another partition.\n"); "open rejected: console in exclusive use by another partition.\n");
/* Return the acknowledgement */ /* Return the acknowledgement */
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
...@@ -1050,7 +1051,8 @@ static void vioHandleCloseEvent(struct HvLpEvent *event) ...@@ -1050,7 +1051,8 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO "viocons: close message from invalid virtual device.\n"); printk(VIOCONS_KERN_WARN
"close message from invalid virtual device.\n");
return; return;
} }
...@@ -1062,11 +1064,10 @@ static void vioHandleCloseEvent(struct HvLpEvent *event) ...@@ -1062,11 +1064,10 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
port_info[port].lp = HvLpIndexInvalid; port_info[port].lp = HvLpIndexInvalid;
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "close from %d\n", event->xSourceLp);
"console close from %d\n", event->xSourceLp);
} else } else
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console got unexpected close acknowlegement\n"); "got unexpected close acknowlegement\n");
} }
/* /*
...@@ -1079,12 +1080,11 @@ static void vioHandleConfig(struct HvLpEvent *event) ...@@ -1079,12 +1080,11 @@ static void vioHandleConfig(struct HvLpEvent *event)
HvCall_writeLogBuffer(cevent->data, cevent->len); HvCall_writeLogBuffer(cevent->data, cevent->len);
if (cevent->data[0] == 0x01) if (cevent->data[0] == 0x01)
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "window resized to %d: %d: %d: %d\n",
"console window resized to %d: %d: %d: %d\n",
cevent->data[1], cevent->data[2], cevent->data[1], cevent->data[2],
cevent->data[3], cevent->data[4]); cevent->data[3], cevent->data[4]);
else else
printk(KERN_WARNING_VIO "console unknown config event\n"); printk(VIOCONS_KERN_WARN "unknown config event\n");
} }
/* /*
...@@ -1100,8 +1100,8 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1100,8 +1100,8 @@ static void vioHandleData(struct HvLpEvent *event)
u8 port = cevent->virtual_device; u8 port = cevent->virtual_device;
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "data on invalid virtual device %d\n",
"console data on invalid virtual device %d\n", port); port);
return; return;
} }
...@@ -1130,13 +1130,14 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1130,13 +1130,14 @@ static void vioHandleData(struct HvLpEvent *event)
tty = pi->tty; tty = pi->tty;
if (tty == NULL) { if (tty == NULL) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO "no tty for virtual device %d\n", port); printk(VIOCONS_KERN_WARN "no tty for virtual device %d\n",
port);
return; return;
} }
if (tty->magic != TTY_MAGIC) { if (tty->magic != TTY_MAGIC) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO "tty bad magic\n"); printk(VIOCONS_KERN_WARN "tty bad magic\n");
return; return;
} }
...@@ -1186,8 +1187,7 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1186,8 +1187,7 @@ static void vioHandleData(struct HvLpEvent *event)
* have room for because it would fail without indication. * have room for because it would fail without indication.
*/ */
if ((tty->flip.count + 1) > TTY_FLIPBUF_SIZE) { if ((tty->flip.count + 1) > TTY_FLIPBUF_SIZE) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "input buffer overflow!\n");
"console input buffer overflow!\n");
break; break;
} }
tty_insert_flip_char(tty, cevent->data[index], TTY_NORMAL); tty_insert_flip_char(tty, cevent->data[index], TTY_NORMAL);
...@@ -1209,8 +1209,7 @@ static void vioHandleAck(struct HvLpEvent *event) ...@@ -1209,8 +1209,7 @@ static void vioHandleAck(struct HvLpEvent *event)
u8 port = cevent->virtual_device; u8 port = cevent->virtual_device;
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "data on invalid virtual device\n");
"viocons: data on invalid virtual device\n");
return; return;
} }
...@@ -1299,14 +1298,11 @@ static int __init viocons_init2(void) ...@@ -1299,14 +1298,11 @@ static int __init viocons_init2(void)
atomic_t wait_flag; atomic_t wait_flag;
int rc; int rc;
/* Now open to the primary LP */
printk(KERN_INFO_VIO "console open path to primary\n");
/* +2 for fudge */ /* +2 for fudge */
rc = viopath_open(HvLpConfig_getPrimaryLpIndex(), rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
viomajorsubtype_chario, VIOCHAR_WINDOW + 2); viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
if (rc) if (rc)
printk(KERN_WARNING_VIO "console error opening to primary %d\n", printk(VIOCONS_KERN_WARN "error opening to primary %d\n", rc);
rc);
if (viopath_hostLp == HvLpIndexInvalid) if (viopath_hostLp == HvLpIndexInvalid)
vio_set_hostlp(); vio_set_hostlp();
...@@ -1317,30 +1313,28 @@ static int __init viocons_init2(void) ...@@ -1317,30 +1313,28 @@ static int __init viocons_init2(void)
*/ */
if ((viopath_hostLp != HvLpIndexInvalid) && if ((viopath_hostLp != HvLpIndexInvalid) &&
(viopath_hostLp != HvLpConfig_getPrimaryLpIndex())) { (viopath_hostLp != HvLpConfig_getPrimaryLpIndex())) {
printk(KERN_INFO_VIO "console open path to hosting (%d)\n", printk(VIOCONS_KERN_INFO "open path to hosting (%d)\n",
viopath_hostLp); viopath_hostLp);
rc = viopath_open(viopath_hostLp, viomajorsubtype_chario, rc = viopath_open(viopath_hostLp, viomajorsubtype_chario,
VIOCHAR_WINDOW + 2); /* +2 for fudge */ VIOCHAR_WINDOW + 2); /* +2 for fudge */
if (rc) if (rc)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console error opening to partition %d: %d\n", "error opening to partition %d: %d\n",
viopath_hostLp, rc); viopath_hostLp, rc);
} }
if (vio_setHandler(viomajorsubtype_chario, vioHandleCharEvent) < 0) if (vio_setHandler(viomajorsubtype_chario, vioHandleCharEvent) < 0)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"Error seting handler for console events!\n"); "error seting handler for console events!\n");
printk(KERN_INFO_VIO "console major number is %d\n", TTY_MAJOR);
/* First, try to open the console to the hosting lp. /*
* First, try to open the console to the hosting lp.
* Wait on a semaphore for the response. * Wait on a semaphore for the response.
*/ */
atomic_set(&wait_flag, 0); atomic_set(&wait_flag, 0);
if ((viopath_isactive(viopath_hostLp)) && if ((viopath_isactive(viopath_hostLp)) &&
(send_open(viopath_hostLp, (void *)&wait_flag) == 0)) { (send_open(viopath_hostLp, (void *)&wait_flag) == 0)) {
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "hosting partition %d\n",
"opening console to hosting partition %d\n",
viopath_hostLp); viopath_hostLp);
while (atomic_read(&wait_flag) == 0) while (atomic_read(&wait_flag) == 0)
mb(); mb();
...@@ -1354,7 +1348,7 @@ static int __init viocons_init2(void) ...@@ -1354,7 +1348,7 @@ static int __init viocons_init2(void)
(viopath_isactive(HvLpConfig_getPrimaryLpIndex())) && (viopath_isactive(HvLpConfig_getPrimaryLpIndex())) &&
(send_open(HvLpConfig_getPrimaryLpIndex(), (void *)&wait_flag) (send_open(HvLpConfig_getPrimaryLpIndex(), (void *)&wait_flag)
== 0)) { == 0)) {
printk(KERN_INFO_VIO "opening console to primary partition\n"); printk(VIOCONS_KERN_INFO "opening console to primary partition\n");
while (atomic_read(&wait_flag) == 0) while (atomic_read(&wait_flag) == 0)
mb(); mb();
} }
...@@ -1388,13 +1382,13 @@ static int __init viocons_init2(void) ...@@ -1388,13 +1382,13 @@ static int __init viocons_init2(void)
tty_set_operations(viottyS_driver, &serial_ops); tty_set_operations(viottyS_driver, &serial_ops);
if (tty_register_driver(viotty_driver)) { if (tty_register_driver(viotty_driver)) {
printk(KERN_WARNING_VIO "Couldn't register console driver\n"); printk(VIOCONS_KERN_WARN "couldn't register console driver\n");
put_tty_driver(viotty_driver); put_tty_driver(viotty_driver);
viotty_driver = NULL; viotty_driver = NULL;
} }
if (tty_register_driver(viottyS_driver)) { if (tty_register_driver(viottyS_driver)) {
printk(KERN_WARNING_VIO "Couldn't register console S driver\n"); printk(VIOCONS_KERN_WARN "couldn't register console S driver\n");
put_tty_driver(viottyS_driver); put_tty_driver(viottyS_driver);
viottyS_driver = NULL; viottyS_driver = NULL;
} }
...@@ -1411,7 +1405,7 @@ static int __init viocons_init(void) ...@@ -1411,7 +1405,7 @@ static int __init viocons_init(void)
{ {
int i; int i;
printk(KERN_INFO_VIO "registering console\n"); printk(VIOCONS_KERN_INFO "registering console\n");
for (i = 0; i < VTTY_PORTS; i++) { for (i = 0; i < VTTY_PORTS; i++) {
port_info[i].lp = HvLpIndexInvalid; port_info[i].lp = HvLpIndexInvalid;
port_info[i].magic = VIOTTY_MAGIC; port_info[i].magic = VIOTTY_MAGIC;
......
...@@ -913,8 +913,6 @@ int __init viotap_init(void) ...@@ -913,8 +913,6 @@ int __init viotap_init(void)
char tapename[32]; char tapename[32];
int i; int i;
printk(VIOTAPE_KERN_INFO "driver version " VIOTAPE_VERSION "\n");
op_struct_list = NULL; op_struct_list = NULL;
if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) { if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) {
printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n"); printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n");
...@@ -932,8 +930,6 @@ int __init viotap_init(void) ...@@ -932,8 +930,6 @@ int __init viotap_init(void)
} }
} }
printk(VIOTAPE_KERN_INFO "init - open path to hosting (%d)\n",
viopath_hostLp);
ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, ret = viopath_open(viopath_hostLp, viomajorsubtype_tape,
VIOTAPE_MAXREQ + 2); VIOTAPE_MAXREQ + 2);
if (ret) { if (ret) {
...@@ -943,6 +939,9 @@ int __init viotap_init(void) ...@@ -943,6 +939,9 @@ int __init viotap_init(void)
goto clear_op; goto clear_op;
} }
printk(VIOTAPE_KERN_INFO "vers " VIOTAPE_VERSION
", hosting partition %d\n", viopath_hostLp);
vio_setHandler(viomajorsubtype_tape, vioHandleTapeEvent); vio_setHandler(viomajorsubtype_tape, vioHandleTapeEvent);
ret = register_chrdev(VIOTAPE_MAJOR, "viotape", &viotap_fops); ret = register_chrdev(VIOTAPE_MAJOR, "viotape", &viotap_fops);
......
...@@ -374,7 +374,7 @@ config PCWATCHDOG ...@@ -374,7 +374,7 @@ config PCWATCHDOG
tristate "Berkshire Products ISA-PC Watchdog" tristate "Berkshire Products ISA-PC Watchdog"
depends on WATCHDOG && ISA depends on WATCHDOG && ISA
---help--- ---help---
This is the driver for the Berkshire Products PC Watchdog card. This is the driver for the Berkshire Products ISA-PC Watchdog card.
This card simply watches your kernel to make sure it doesn't freeze, This card simply watches your kernel to make sure it doesn't freeze,
and if it does, it reboots your computer after a certain amount of and if it does, it reboots your computer after a certain amount of
time. This driver is like the WDT501 driver but for different time. This driver is like the WDT501 driver but for different
...@@ -406,10 +406,8 @@ config WDT ...@@ -406,10 +406,8 @@ config WDT
---help--- ---help---
If you have a WDT500P or WDT501P watchdog board, say Y here, If you have a WDT500P or WDT501P watchdog board, say Y here,
otherwise N. It is not possible to probe for this board, which means otherwise N. It is not possible to probe for this board, which means
that you have to inform the kernel about the IO port and IRQ using that you have to inform the kernel about the IO port and IRQ that
the "wdt=" kernel option (try "man bootparam" or see the is needed (you can do this via the io and irq parameters)
documentation of your boot loader (lilo or loadlin) about how to
pass options to the kernel at boot time).
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called wdt. module will be called wdt.
...@@ -425,11 +423,8 @@ config WDT_501 ...@@ -425,11 +423,8 @@ config WDT_501
Fahrenheit. This works only if you have a WDT501P watchdog board Fahrenheit. This works only if you have a WDT501P watchdog board
installed. installed.
config WDT_501_FAN If you want to enable the Fan Tachometer on the WDT501P, then you
bool "Fan Tachometer" can do this via the tachometer parameter. Only do this if you have a
depends on WDT_501
help
Enable the Fan Tachometer on the WDT501. Only do this if you have a
fan tachometer actually set up. fan tachometer actually set up.
# #
...@@ -455,30 +450,29 @@ config PCIPCWATCHDOG ...@@ -455,30 +450,29 @@ config PCIPCWATCHDOG
Most people will say N. Most people will say N.
config WDTPCI config WDTPCI
tristate "WDT PCI Watchdog timer" tristate "PCI-WDT500/501 Watchdog timer"
depends on WATCHDOG && PCI depends on WATCHDOG && PCI
---help--- ---help---
If you have a PCI WDT500/501 watchdog board, say Y here, otherwise If you have a PCI-WDT500/501 watchdog board, say Y here, otherwise N.
N. It is not possible to probe for this board, which means that you
have to inform the kernel about the IO port and IRQ using the "wdt="
kernel option (try "man bootparam" or see the documentation of your
boot loader (lilo or loadlin) about how to pass options to the
kernel at boot time).
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called wdt_pci. module will be called wdt_pci.
config WDT_501_PCI config WDT_501_PCI
bool "WDT501-PCI features" bool "PCI-WDT501 features"
depends on WDTPCI depends on WDTPCI
help help
Saying Y here and creating a character special file /dev/temperature Saying Y here and creating a character special file /dev/temperature
with major number 10 and minor number 131 ("man mknod") will give with major number 10 and minor number 131 ("man mknod") will give
you a thermometer inside your computer: reading from you a thermometer inside your computer: reading from
/dev/temperature yields one byte, the temperature in degrees /dev/temperature yields one byte, the temperature in degrees
Fahrenheit. This works only if you have a WDT501P watchdog board Fahrenheit. This works only if you have a PCI-WDT501 watchdog board
installed. installed.
If you want to enable the Fan Tachometer on the PCI-WDT501, then you
can do this via the tachometer parameter. Only do this if you have a
fan tachometer actually set up.
# #
# USB-based Watchdog Cards # USB-based Watchdog Cards
# #
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
*/ */
static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 }; static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
#define WD_VER "1.12 (12/14/2001)" #define WD_VER "1.14 (03/12/2004)"
/* /*
* It should be noted that PCWD_REVISION_B was removed because A and B * It should be noted that PCWD_REVISION_B was removed because A and B
...@@ -227,6 +227,45 @@ void pcwd_showprevstate(void) ...@@ -227,6 +227,45 @@ void pcwd_showprevstate(void)
} }
} }
static int pcwd_start(void)
{
int stat_reg;
/* Enable the port */
if (revision == PCWD_REVISION_C) {
spin_lock(&io_lock);
outb_p(0x00, current_readport + 3);
stat_reg = inb_p(current_readport + 2);
spin_unlock(&io_lock);
if (stat_reg & 0x10)
{
printk(KERN_INFO "pcwd: Could not start watchdog.\n");
return -EIO;
}
}
return 0;
}
static int pcwd_stop(void)
{
int stat_reg;
/* Disable the board */
if (revision == PCWD_REVISION_C) {
spin_lock(&io_lock);
outb_p(0xA5, current_readport + 3);
outb_p(0xA5, current_readport + 3);
stat_reg = inb_p(current_readport + 2);
spin_unlock(&io_lock);
if ((stat_reg & 0x10) == 0)
{
printk(KERN_INFO "pcwd: Could not stop watchdog.\n");
return -EIO;
}
}
return 0;
}
static void pcwd_send_heartbeat(void) static void pcwd_send_heartbeat(void)
{ {
int wdrst_stat; int wdrst_stat;
...@@ -242,13 +281,41 @@ static void pcwd_send_heartbeat(void) ...@@ -242,13 +281,41 @@ static void pcwd_send_heartbeat(void)
outb_p(wdrst_stat, current_readport); outb_p(wdrst_stat, current_readport);
} }
static int pcwd_get_temperature(int *temperature)
{
/* check that port 0 gives temperature info and no command results */
if (mode_debug)
return -1;
*temperature = 0;
if (!supports_temp)
return -ENODEV;
/*
* Convert celsius to fahrenheit, since this was
* the decided 'standard' for this return value.
*/
spin_lock(&io_lock);
*temperature = ((inb(current_readport)) * 9 / 5) + 32;
spin_unlock(&io_lock);
return 0;
}
/*
* /dev/watchdog handling
*/
static int pcwd_ioctl(struct inode *inode, struct file *file, static int pcwd_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int cdat, rv; int cdat, rv;
int temperature;
static struct watchdog_info ident= static struct watchdog_info ident=
{ {
.options = WDIOF_OVERHEAT|WDIOF_CARDRESET, .options = WDIOF_OVERHEAT |
WDIOF_CARDRESET |
WDIOF_MAGICCLOSE,
.firmware_version = 1, .firmware_version = 1,
.identity = "PCWD", .identity = "PCWD",
}; };
...@@ -332,17 +399,10 @@ static int pcwd_ioctl(struct inode *inode, struct file *file, ...@@ -332,17 +399,10 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
case WDIOC_GETTEMP: case WDIOC_GETTEMP:
rv = 0; if (pcwd_get_temperature(&temperature))
if ((supports_temp) && (mode_debug == 0))
{
spin_lock(&io_lock);
rv = inb(current_readport);
spin_unlock(&io_lock);
if(put_user(rv, (int*) arg))
return -EFAULT; return -EFAULT;
} else if(put_user(rv, (int*) arg))
return -EFAULT; return put_user(temperature, (int *) arg);
return 0;
case WDIOC_SETOPTIONS: case WDIOC_SETOPTIONS:
if (revision == PCWD_REVISION_C) if (revision == PCWD_REVISION_C)
...@@ -352,32 +412,12 @@ static int pcwd_ioctl(struct inode *inode, struct file *file, ...@@ -352,32 +412,12 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
if (rv & WDIOS_DISABLECARD) if (rv & WDIOS_DISABLECARD)
{ {
spin_lock(&io_lock); return pcwd_stop();
outb_p(0xA5, current_readport + 3);
outb_p(0xA5, current_readport + 3);
cdat = inb_p(current_readport + 2);
spin_unlock(&io_lock);
if ((cdat & 0x10) == 0)
{
printk(KERN_INFO "pcwd: Could not disable card.\n");
return -EIO;
}
return 0;
} }
if (rv & WDIOS_ENABLECARD) if (rv & WDIOS_ENABLECARD)
{ {
spin_lock(&io_lock); return pcwd_start();
outb_p(0x00, current_readport + 3);
cdat = inb_p(current_readport + 2);
spin_unlock(&io_lock);
if (cdat & 0x10)
{
printk(KERN_INFO "pcwd: Could not enable card.\n");
return -EIO;
}
return 0;
} }
if (rv & WDIOS_TEMPPANIC) if (rv & WDIOS_TEMPPANIC)
...@@ -423,72 +463,66 @@ static ssize_t pcwd_write(struct file *file, const char *buf, size_t len, ...@@ -423,72 +463,66 @@ static ssize_t pcwd_write(struct file *file, const char *buf, size_t len,
return len; return len;
} }
static int pcwd_open(struct inode *ino, struct file *filep) static int pcwd_open(struct inode *inode, struct file *file)
{ {
switch (iminor(ino)) {
case WATCHDOG_MINOR:
if (!atomic_dec_and_test(&open_allowed) ) { if (!atomic_dec_and_test(&open_allowed) ) {
atomic_inc( &open_allowed ); atomic_inc( &open_allowed );
return -EBUSY; return -EBUSY;
} }
if (nowayout)
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
/* Enable the port */
if (revision == PCWD_REVISION_C) {
spin_lock(&io_lock);
outb_p(0x00, current_readport + 3);
spin_unlock(&io_lock);
}
return(0);
case TEMP_MINOR: /* Activate */
pcwd_start();
return(0); return(0);
default: }
return (-ENODEV);
static int pcwd_close(struct inode *inode, struct file *file)
{
if (expect_close == 42) {
pcwd_stop();
atomic_inc( &open_allowed );
} else {
printk(KERN_CRIT "pcwd: Unexpected close, not stopping watchdog!\n");
pcwd_send_heartbeat();
} }
expect_close = 0;
return 0;
} }
static ssize_t pcwd_read(struct file *file, char *buf, size_t count, /*
* /dev/temperature handling
*/
static ssize_t pcwd_temp_read(struct file *file, char *buf, size_t count,
loff_t *ppos) loff_t *ppos)
{ {
unsigned short c; int temperature;
unsigned char cp;
/* Can't seek (pread) on this device */ /* Can't seek (pread) on this device */
if (ppos != &file->f_pos) if (ppos != &file->f_pos)
return -ESPIPE; return -ESPIPE;
switch(iminor(file->f_dentry->d_inode))
{
case TEMP_MINOR:
/*
* Convert metric to Fahrenheit, since this was
* the decided 'standard' for this return value.
*/
c = inb(current_readport); if (pcwd_get_temperature(&temperature))
cp = (c * 9 / 5) + 32; return -EFAULT;
if(copy_to_user(buf, &cp, 1))
if (copy_to_user(buf, &temperature, 1))
return -EFAULT; return -EFAULT;
return 1; return 1;
default:
return -EINVAL;
}
} }
static int pcwd_close(struct inode *ino, struct file *filep) static int pcwd_temp_open(struct inode *inode, struct file *file)
{
if (!supports_temp)
return -ENODEV;
return 0;
}
static int pcwd_temp_close(struct inode *inode, struct file *file)
{ {
if (iminor(ino)==WATCHDOG_MINOR) {
if (expect_close == 42) {
/* Disable the board */
if (revision == PCWD_REVISION_C) {
spin_lock(&io_lock);
outb_p(0xA5, current_readport + 3);
outb_p(0xA5, current_readport + 3);
spin_unlock(&io_lock);
}
atomic_inc( &open_allowed );
}
}
expect_close = 0;
return 0; return 0;
} }
...@@ -569,7 +603,7 @@ static void debug_off(void) ...@@ -569,7 +603,7 @@ static void debug_off(void)
static struct file_operations pcwd_fops = { static struct file_operations pcwd_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = pcwd_read, .llseek = no_llseek,
.write = pcwd_write, .write = pcwd_write,
.ioctl = pcwd_ioctl, .ioctl = pcwd_ioctl,
.open = pcwd_open, .open = pcwd_open,
...@@ -582,10 +616,18 @@ static struct miscdevice pcwd_miscdev = { ...@@ -582,10 +616,18 @@ static struct miscdevice pcwd_miscdev = {
.fops = &pcwd_fops, .fops = &pcwd_fops,
}; };
static struct file_operations pcwd_temp_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = pcwd_temp_read,
.open = pcwd_temp_open,
.release = pcwd_temp_close,
};
static struct miscdevice temp_miscdev = { static struct miscdevice temp_miscdev = {
.minor = TEMP_MINOR, .minor = TEMP_MINOR,
.name = "temperature", .name = "temperature",
.fops = &pcwd_fops, .fops = &pcwd_temp_fops,
}; };
static void __init pcwd_validate_timeout(void) static void __init pcwd_validate_timeout(void)
......
/* /*
* SoftDog 0.06: A Software Watchdog Device * SoftDog 0.07: A Software Watchdog Device
* *
* (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved. * (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
* http://www.redhat.com * http://www.redhat.com
...@@ -40,26 +40,21 @@ ...@@ -40,26 +40,21 @@
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/timer.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/notifier.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define TIMER_MARGIN 60 /* (secs) Default is 1 minute */ #define PFX "SoftDog: "
static char expect_close; #define TIMER_MARGIN 60 /* Default is 60 seconds */
static int soft_margin = TIMER_MARGIN; /* in seconds */ static int soft_margin = TIMER_MARGIN; /* in seconds */
#ifdef ONLY_TESTING
static int soft_noboot = 1;
#else
static int soft_noboot = 0;
#endif /* ONLY_TESTING */
module_param(soft_margin, int, 0); module_param(soft_margin, int, 0);
module_param(soft_noboot, int, 0); MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")");
MODULE_LICENSE("GPL");
#ifdef CONFIG_WATCHDOG_NOWAYOUT #ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1; static int nowayout = 1;
...@@ -70,6 +65,15 @@ static int nowayout = 0; ...@@ -70,6 +65,15 @@ static int nowayout = 0;
module_param(nowayout, int, 0); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
#ifdef ONLY_TESTING
static int soft_noboot = 1;
#else
static int soft_noboot = 0;
#endif /* ONLY_TESTING */
module_param(soft_noboot, int, 0);
MODULE_PARM_DESC(soft_noboot, "Softdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
/* /*
* Our timer * Our timer
*/ */
...@@ -79,6 +83,7 @@ static void watchdog_fire(unsigned long); ...@@ -79,6 +83,7 @@ static void watchdog_fire(unsigned long);
static struct timer_list watchdog_ticktock = static struct timer_list watchdog_ticktock =
TIMER_INITIALIZER(watchdog_fire, 0, 0); TIMER_INITIALIZER(watchdog_fire, 0, 0);
static unsigned long timer_alive; static unsigned long timer_alive;
static char expect_close;
/* /*
...@@ -88,17 +93,42 @@ static unsigned long timer_alive; ...@@ -88,17 +93,42 @@ static unsigned long timer_alive;
static void watchdog_fire(unsigned long data) static void watchdog_fire(unsigned long data)
{ {
if (soft_noboot) if (soft_noboot)
printk(KERN_CRIT "SOFTDOG: Triggered - Reboot ignored.\n"); printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
else else
{ {
printk(KERN_CRIT "SOFTDOG: Initiating system reboot.\n"); printk(KERN_CRIT PFX "Initiating system reboot.\n");
machine_restart(NULL); machine_restart(NULL);
printk("SOFTDOG: Reboot didn't ?????\n"); printk(KERN_CRIT PFX "Reboot didn't ?????\n");
} }
} }
/* /*
* Allow only one person to hold it open * Softdog operations
*/
static int softdog_keepalive(void)
{
mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
return 0;
}
static int softdog_stop(void)
{
del_timer(&watchdog_ticktock);
return 0;
}
static int softdog_set_heartbeat(int t)
{
if ((t < 0x0001) || (t > 0xFFFF))
return -EINVAL;
soft_margin = t;
return 0;
}
/*
* /dev/watchdog handling
*/ */
static int softdog_open(struct inode *inode, struct file *file) static int softdog_open(struct inode *inode, struct file *file)
...@@ -110,7 +140,7 @@ static int softdog_open(struct inode *inode, struct file *file) ...@@ -110,7 +140,7 @@ static int softdog_open(struct inode *inode, struct file *file)
/* /*
* Activate timer * Activate timer
*/ */
mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ)); softdog_keepalive();
return 0; return 0;
} }
...@@ -121,9 +151,10 @@ static int softdog_release(struct inode *inode, struct file *file) ...@@ -121,9 +151,10 @@ static int softdog_release(struct inode *inode, struct file *file)
* Lock it in if it's a module and we set nowayout * Lock it in if it's a module and we set nowayout
*/ */
if (expect_close == 42) { if (expect_close == 42) {
del_timer(&watchdog_ticktock); softdog_stop();
} else { } else {
printk(KERN_CRIT "SOFTDOG: WDT device closed unexpectedly. WDT will not stop!\n"); printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
softdog_keepalive();
} }
clear_bit(0, &timer_alive); clear_bit(0, &timer_alive);
expect_close = 0; expect_close = 0;
...@@ -155,7 +186,7 @@ static ssize_t softdog_write(struct file *file, const char *data, size_t len, lo ...@@ -155,7 +186,7 @@ static ssize_t softdog_write(struct file *file, const char *data, size_t len, lo
expect_close = 42; expect_close = 42;
} }
} }
mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ)); softdog_keepalive();
} }
return len; return len;
} }
...@@ -165,37 +196,57 @@ static int softdog_ioctl(struct inode *inode, struct file *file, ...@@ -165,37 +196,57 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
{ {
int new_margin; int new_margin;
static struct watchdog_info ident = { static struct watchdog_info ident = {
.options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .options = WDIOF_SETTIMEOUT |
WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE,
.firmware_version = 0,
.identity = "Software Watchdog", .identity = "Software Watchdog",
}; };
switch (cmd) { switch (cmd) {
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) return copy_to_user((struct watchdog_info *)arg, &ident,
return -EFAULT; sizeof(ident)) ? -EFAULT : 0;
return 0;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
return put_user(0,(int *)arg); return put_user(0,(int *)arg);
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ)); softdog_keepalive();
return 0; return 0;
case WDIOC_SETTIMEOUT: case WDIOC_SETTIMEOUT:
if (get_user(new_margin, (int *)arg)) if (get_user(new_margin, (int *)arg))
return -EFAULT; return -EFAULT;
if (new_margin < 1) if (softdog_set_heartbeat(new_margin))
return -EINVAL; return -EINVAL;
soft_margin = new_margin; softdog_keepalive();
mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
/* Fall */ /* Fall */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(soft_margin, (int *)arg); return put_user(soft_margin, (int *)arg);
} }
} }
/*
* Notifier for system down
*/
static int softdog_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{
if(code==SYS_DOWN || code==SYS_HALT) {
/* Turn the WDT off */
softdog_stop();
}
return NOTIFY_DONE;
}
/*
* Kernel Interfaces
*/
static struct file_operations softdog_fops = { static struct file_operations softdog_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek,
.write = softdog_write, .write = softdog_write,
.ioctl = softdog_ioctl, .ioctl = softdog_ioctl,
.open = softdog_open, .open = softdog_open,
...@@ -208,18 +259,39 @@ static struct miscdevice softdog_miscdev = { ...@@ -208,18 +259,39 @@ static struct miscdevice softdog_miscdev = {
.fops = &softdog_fops, .fops = &softdog_fops,
}; };
static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.06, soft_margin: %d sec, nowayout: %d\n"; static struct notifier_block softdog_notifier = {
.notifier_call = softdog_notify_sys,
};
static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 initialized. soft_noboot=%d soft_margin=%d sec (nowayout= %d)\n";
static int __init watchdog_init(void) static int __init watchdog_init(void)
{ {
int ret; int ret;
ret = misc_register(&softdog_miscdev); /* Check that the soft_margin value is within it's range ; if not reset to the default */
if (softdog_set_heartbeat(soft_margin)) {
softdog_set_heartbeat(TIMER_MARGIN);
printk(KERN_INFO PFX "soft_margin value must be 0<soft_margin<65536, using %d\n",
TIMER_MARGIN);
}
if (ret) ret = register_reboot_notifier(&softdog_notifier);
if (ret) {
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
ret);
return ret; return ret;
}
ret = misc_register(&softdog_miscdev);
if (ret) {
printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
unregister_reboot_notifier(&softdog_notifier);
return ret;
}
printk(banner, soft_margin, nowayout); printk(banner, soft_noboot, soft_margin, nowayout);
return 0; return 0;
} }
...@@ -227,6 +299,7 @@ static int __init watchdog_init(void) ...@@ -227,6 +299,7 @@ static int __init watchdog_init(void)
static void __exit watchdog_exit(void) static void __exit watchdog_exit(void)
{ {
misc_deregister(&softdog_miscdev); misc_deregister(&softdog_miscdev);
unregister_reboot_notifier(&softdog_notifier);
} }
module_init(watchdog_init); module_init(watchdog_init);
......
/* /*
* Industrial Computer Source WDT500/501 driver for Linux 1.3.x * Industrial Computer Source WDT500/501 driver
* *
* (c) Copyright 1995 CymruNET Ltd * (c) Copyright 1995 CymruNET Ltd
* Innovation Centre * Innovation Centre
...@@ -40,52 +40,13 @@ ...@@ -40,52 +40,13 @@
/* programmable outputs: */ /* programmable outputs: */
#define WDT_PROGOUT (io+15) /* wr=enable, rd=disable */ #define WDT_PROGOUT (io+15) /* wr=enable, rd=disable */
#define WDC_SR_WCCR 1 /* Active low */ /* FAN 501 500 */
#define WDC_SR_TGOOD 2 #define WDC_SR_WCCR 1 /* Active low */ /* X X X */
#define WDC_SR_ISOI0 4 #define WDC_SR_TGOOD 2 /* X X - */
#define WDC_SR_ISII1 8 #define WDC_SR_ISOI0 4 /* X X X */
#define WDC_SR_FANGOOD 16 #define WDC_SR_ISII1 8 /* X X X */
#define WDC_SR_PSUOVER 32 /* Active low */ #define WDC_SR_FANGOOD 16 /* X - - */
#define WDC_SR_PSUUNDR 64 /* Active low */ #define WDC_SR_PSUOVER 32 /* Active low */ /* X X - */
#define WDC_SR_IRQ 128 /* Active low */ #define WDC_SR_PSUUNDR 64 /* Active low */ /* X X - */
#define WDC_SR_IRQ 128 /* Active low */ /* X X X */
#ifndef WDT_IS_PCI
/*
* Feature Map 1 is the active high inputs not supported on your card.
* Feature Map 2 is the active low inputs not supported on your card.
*/
#ifdef CONFIG_WDT_501 /* Full board */
#ifdef CONFIG_WDT501_FAN /* Full board, Fan has no tachometer */
#define FEATUREMAP1 0
#define WDT_OPTION_MASK (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER|WDIOF_EXTERN1|WDIOF_EXTERN2|WDIOF_FANFAULT)
#else
#define FEATUREMAP1 WDC_SR_FANGOOD
#define WDT_OPTION_MASK (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER|WDIOF_EXTERN1|WDIOF_EXTERN2)
#endif
#define FEATUREMAP2 0
#endif
#ifndef CONFIG_WDT_501
#define CONFIG_WDT_500
#endif
#ifdef CONFIG_WDT_500 /* Minimal board */
#define FEATUREMAP1 (WDC_SR_TGOOD|WDC_SR_FANGOOD)
#define FEATUREMAP2 (WDC_SR_PSUOVER|WDC_SR_PSUUNDR)
#define WDT_OPTION_MASK (WDIOF_OVERHEAT)
#endif
#else
#define FEATUREMAP1 (WDC_SR_TGOOD|WDC_SR_FANGOOD)
#define FEATUREMAP2 (WDC_SR_PSUOVER|WDC_SR_PSUUNDR)
#define WDT_OPTION_MASK (WDIOF_OVERHEAT)
#endif
#ifndef FEATUREMAP1
#error "Config option not set"
#endif
This diff is collapsed.
This diff is collapsed.
...@@ -721,6 +721,14 @@ static int i8042_controller_init(void) ...@@ -721,6 +721,14 @@ static int i8042_controller_init(void)
printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n");
} }
/*
* If the chip is configured into nontranslated mode by the BIOS, don't
* bother enabling translating and be happy.
*/
if (~i8042_ctr & I8042_CTR_XLATE)
i8042_direct = 1;
/* /*
* Set nontranslated mode for the kbd interface if requested by an option. * Set nontranslated mode for the kbd interface if requested by an option.
* After this the kbd interface becomes a simple serial in/out, like the aux * After this the kbd interface becomes a simple serial in/out, like the aux
......
/* $Id: adapter.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: adapter.h,v 1.4 2004/03/21 17:26:01 armin Exp $ */
#ifndef __DIVA_USER_MODE_IDI_ADAPTER_H__ #ifndef __DIVA_USER_MODE_IDI_ADAPTER_H__
#define __DIVA_USER_MODE_IDI_ADAPTER_H__ #define __DIVA_USER_MODE_IDI_ADAPTER_H__
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#define DIVA_UM_IDI_ADAPTER_REMOVED 0x00000001 #define DIVA_UM_IDI_ADAPTER_REMOVED 0x00000001
typedef struct _diva_um_idi_adapter { typedef struct _diva_um_idi_adapter {
diva_entity_link_t link; struct list_head link;
DESCRIPTOR d; DESCRIPTOR d;
int adapter_nr; int adapter_nr;
diva_entity_queue_t entity_q; /* entities linked to this adapter */ struct list_head entity_q; /* entities linked to this adapter */
dword status; dword status;
} diva_um_idi_adapter_t; } diva_um_idi_adapter_t;
......
This diff is collapsed.
/* $Id: capifunc.h,v 1.10 2003/08/25 10:06:37 schindler Exp $ /* $Id: capifunc.h,v 1.11 2004/03/20 17:19:58 armin Exp $
* *
* ISDN interface module for Eicon active cards DIVA. * ISDN interface module for Eicon active cards DIVA.
* CAPI Interface common functions * CAPI Interface common functions
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
extern char DRIVERRELEASE_CAPI[]; extern char DRIVERRELEASE_CAPI[];
typedef struct _diva_card { typedef struct _diva_card {
struct list_head list;
int remove_in_progress;
int Id; int Id;
struct _diva_card *next;
struct capi_ctr capi_ctrl; struct capi_ctr capi_ctrl;
DIVA_CAPI_ADAPTER *adapter; DIVA_CAPI_ADAPTER *adapter;
DESCRIPTOR d; DESCRIPTOR d;
......
/* $Id: diva.c,v 1.17 2003/09/09 06:52:01 schindler Exp $ */ /* $Id: diva.c,v 1.21 2004/03/21 17:30:25 armin Exp $ */
#define CARDTYPE_H_WANT_DATA 1 #define CARDTYPE_H_WANT_DATA 1
#define CARDTYPE_H_WANT_IDI_DATA 0 #define CARDTYPE_H_WANT_IDI_DATA 0
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "platform.h" #include "platform.h"
#include "debuglib.h" #include "debuglib.h"
#include "cardtype.h" #include "cardtype.h"
#include "dlist.h"
#include "pc.h" #include "pc.h"
#include "di_defs.h" #include "di_defs.h"
#include "di.h" #include "di.h"
...@@ -74,15 +73,10 @@ DivaIdiReqFunc(31) ...@@ -74,15 +73,10 @@ DivaIdiReqFunc(31)
struct pt_regs; struct pt_regs;
/*
* include queue functions
*/
#include "dlist.c"
/* /*
** LOCALS ** LOCALS
*/ */
diva_entity_queue_t adapter_queue; static LIST_HEAD(adapter_queue);
typedef struct _diva_get_xlog { typedef struct _diva_get_xlog {
word command; word command;
...@@ -158,6 +152,16 @@ static int diva_find_free_adapters(int base, int nr) ...@@ -158,6 +152,16 @@ static int diva_find_free_adapters(int base, int nr)
return (0); return (0);
} }
static diva_os_xdi_adapter_t *diva_q_get_next(struct list_head * what)
{
diva_os_xdi_adapter_t *a = NULL;
if (what && !list_empty(what))
a = list_entry(what->next, diva_os_xdi_adapter_t, link);
return(a);
}
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Add card to the card list Add card to the card list
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
...@@ -204,7 +208,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal) ...@@ -204,7 +208,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add card"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add card");
pa = pdiva; pa = pdiva;
for (j = 1; j < nr; j++) { /* slave adapters, if any */ for (j = 1; j < nr; j++) { /* slave adapters, if any */
pa = (diva_os_xdi_adapter_t *) diva_q_get_next(&pa->link); pa = diva_q_get_next(&pa->link);
if (pa && !pa->interface.cleanup_adapter_proc) { if (pa && !pa->interface.cleanup_adapter_proc) {
pa->controller = i + 1 + j; pa->controller = i + 1 + j;
pa->xdi_adapter.ANum = pa->controller; pa->xdi_adapter.ANum = pa->controller;
...@@ -246,7 +250,6 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal) ...@@ -246,7 +250,6 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
int divasa_xdi_driver_entry(void) int divasa_xdi_driver_entry(void)
{ {
diva_os_initialize_spin_lock(&adapter_lock, "adapter"); diva_os_initialize_spin_lock(&adapter_lock, "adapter");
diva_q_init(&adapter_queue);
memset(&IoAdapters[0], 0x00, sizeof(IoAdapters)); memset(&IoAdapters[0], 0x00, sizeof(IoAdapters));
diva_init_request_array(); diva_init_request_array();
...@@ -259,12 +262,14 @@ int divasa_xdi_driver_entry(void) ...@@ -259,12 +262,14 @@ int divasa_xdi_driver_entry(void)
static diva_os_xdi_adapter_t *get_and_remove_from_queue(void) static diva_os_xdi_adapter_t *get_and_remove_from_queue(void)
{ {
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
diva_os_xdi_adapter_t *a; diva_os_xdi_adapter_t *a = NULL;
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "driver_unload"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "driver_unload");
if ((a = (diva_os_xdi_adapter_t *) diva_q_get_head(&adapter_queue))) if (!list_empty(&adapter_queue)) {
diva_q_remove(&adapter_queue, &a->link); a = list_entry(adapter_queue.next, diva_os_xdi_adapter_t, link);
list_del(adapter_queue.next);
}
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "driver_unload"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "driver_unload");
return (a); return (a);
...@@ -286,7 +291,7 @@ void diva_driver_remove_card(void *pdiva) ...@@ -286,7 +291,7 @@ void diva_driver_remove_card(void *pdiva)
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter");
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
if ((pa = (diva_os_xdi_adapter_t *) diva_q_get_next(&pa->link)) if ((pa = diva_q_get_next(&pa->link))
&& !pa->interface.cleanup_adapter_proc) { && !pa->interface.cleanup_adapter_proc) {
a[i] = pa; a[i] = pa;
} else { } else {
...@@ -295,7 +300,7 @@ void diva_driver_remove_card(void *pdiva) ...@@ -295,7 +300,7 @@ void diva_driver_remove_card(void *pdiva)
} }
for (i = 0; ((i < 4) && a[i]); i++) { for (i = 0; ((i < 4) && a[i]); i++) {
diva_q_remove(&adapter_queue, &a[i]->link); list_del(&a[i]->link);
} }
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "driver_unload"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "driver_unload");
...@@ -345,12 +350,12 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle) ...@@ -345,12 +350,12 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
numbers as master adapter numbers as master adapter
*/ */
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "found_pci_card"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
diva_q_add_tail(&adapter_queue, &a->link); list_add_tail(&a->link, &adapter_queue);
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
if ((*(pI->init_card)) (a)) { if ((*(pI->init_card)) (a)) {
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "found_pci_card"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
diva_q_remove(&adapter_queue, &a->link); list_del(&a->link);
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
diva_os_free(0, a); diva_os_free(0, a);
DBG_ERR(("A: can't get adapter resources")); DBG_ERR(("A: can't get adapter resources"));
...@@ -383,21 +388,14 @@ void divasa_xdi_driver_unload(void) ...@@ -383,21 +388,14 @@ void divasa_xdi_driver_unload(void)
/* /*
** Receive and process command from user mode utility ** Receive and process command from user mode utility
*/ */
static int cmp_adapter_nr(const void *what, const diva_entity_link_t * p)
{
diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) p;
dword nr = (dword) (unsigned long) what;
return (nr != a->controller);
}
void *diva_xdi_open_adapter(void *os_handle, const void *src, void *diva_xdi_open_adapter(void *os_handle, const void *src,
int length, int length,
divas_xdi_copy_from_user_fn_t cp_fn) divas_xdi_copy_from_user_fn_t cp_fn)
{ {
diva_xdi_um_cfg_cmd_t msg; diva_xdi_um_cfg_cmd_t msg;
diva_os_xdi_adapter_t *a; diva_os_xdi_adapter_t *a = NULL;
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
struct list_head *tmp;
if (length < sizeof(diva_xdi_um_cfg_cmd_t)) { if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
DBG_ERR(("A: A(?) open, msg too small (%d < %d)", DBG_ERR(("A: A(?) open, msg too small (%d < %d)",
...@@ -409,10 +407,12 @@ void *diva_xdi_open_adapter(void *os_handle, const void *src, ...@@ -409,10 +407,12 @@ void *diva_xdi_open_adapter(void *os_handle, const void *src,
return (0); return (0);
} }
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
a = (diva_os_xdi_adapter_t *) diva_q_find(&adapter_queue, list_for_each(tmp, &adapter_queue) {
(void *) (unsigned long) a = list_entry(tmp, diva_os_xdi_adapter_t, link);
msg.adapter, if (a->controller == (int)msg.adapter)
cmp_adapter_nr); break;
a = NULL;
}
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "open_adapter"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "open_adapter");
if (!a) { if (!a) {
...@@ -611,7 +611,7 @@ void diva_add_slave_adapter(diva_os_xdi_adapter_t * a) ...@@ -611,7 +611,7 @@ void diva_add_slave_adapter(diva_os_xdi_adapter_t * a)
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add_slave"); diva_os_enter_spin_lock(&adapter_lock, &old_irql, "add_slave");
diva_q_add_tail(&adapter_queue, &a->link); list_add_tail(&a->link, &adapter_queue);
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add_slave"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add_slave");
} }
......
/* $Id: divasmain.c,v 1.48 2004/02/24 17:46:28 armin Exp $ /* $Id: divasmain.c,v 1.52 2004/03/21 17:26:01 armin Exp $
* *
* Low level driver for Eicon DIVA Server ISDN cards. * Low level driver for Eicon DIVA Server ISDN cards.
* *
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/kmod.h> #include <linux/kmod.h>
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
#undef ID_MASK #undef ID_MASK
#undef N_DATA #undef N_DATA
#include "pc.h" #include "pc.h"
#include "dlist.h"
#include "di_defs.h" #include "di_defs.h"
#include "divasync.h" #include "divasync.h"
#include "diva.h" #include "diva.h"
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "diva_dma.h" #include "diva_dma.h"
#include "diva_pci.h" #include "diva_pci.h"
static char *main_revision = "$Revision: 1.48 $"; static char *main_revision = "$Revision: 1.52 $";
static int major; static int major;
...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask); ...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask);
extern void divasfunc_exit(void); extern void divasfunc_exit(void);
typedef struct _diva_os_thread_dpc { typedef struct _diva_os_thread_dpc {
struct work_struct divas_task; struct tasklet_struct divas_task;
struct work_struct trap_script_task; struct work_struct trap_script_task;
diva_os_soft_isr_t *psoft_isr; diva_os_soft_isr_t *psoft_isr;
int card_failed; int card_failed;
...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq) ...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
DPC framework implementation DPC framework implementation
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_os_dpc_proc(void *context) static void diva_os_dpc_proc(unsigned long context)
{ {
diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context; diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context;
diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr; diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr;
...@@ -575,7 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr, ...@@ -575,7 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr,
psoft_isr->callback_context = callback_context; psoft_isr->callback_context = callback_context;
pdpc->psoft_isr = psoft_isr; pdpc->psoft_isr = psoft_isr;
INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc); INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc);
INIT_WORK(&pdpc->divas_task, diva_os_dpc_proc, pdpc); tasklet_init(&pdpc->divas_task, diva_os_dpc_proc, (unsigned long)pdpc);
return (0); return (0);
} }
...@@ -586,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -586,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
diva_os_thread_dpc_t *pdpc = diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object; (diva_os_thread_dpc_t *) psoft_isr->object;
schedule_work(&pdpc->divas_task); tasklet_schedule(&pdpc->divas_task);
} }
return (1); return (1);
...@@ -594,14 +594,22 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -594,14 +594,22 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr) int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
tasklet_kill(&pdpc->divas_task);
}
return (0); return (0);
} }
void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr) void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
void *mem; void *mem;
tasklet_kill(&pdpc->divas_task);
flush_scheduled_work(); flush_scheduled_work();
mem = psoft_isr->object; mem = psoft_isr->object;
psoft_isr->object = 0; psoft_isr->object = 0;
......
/* $Id: divasproc.c,v 1.18 2003/09/09 06:46:29 schindler Exp $ /* $Id: divasproc.c,v 1.19 2004/03/21 17:26:01 armin Exp $
* *
* Low level driver for Eicon DIVA Server ISDN cards. * Low level driver for Eicon DIVA Server ISDN cards.
* /proc functions * /proc functions
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/list.h>
#include "platform.h" #include "platform.h"
#include "debuglib.h" #include "debuglib.h"
#include "dlist.h"
#undef ID_MASK #undef ID_MASK
#undef N_DATA #undef N_DATA
#include "pc.h" #include "pc.h"
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER]; extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
extern diva_entity_queue_t adapter_queue;
extern void divas_get_version(char *); extern void divas_get_version(char *);
extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf); extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf);
......
/* $Id: dlist.c,v 1.6 2003/08/25 16:03:35 schindler Exp $ */
#include "platform.h"
#include "dlist.h"
/*
** Initialize linked list
*/
static void diva_q_init(diva_entity_queue_t * q)
{
memset(q, 0x00, sizeof(*q));
}
/*
** Remove element from linked list
*/
static void diva_q_remove(diva_entity_queue_t * q, diva_entity_link_t * what)
{
if (!what->prev) {
if ((q->head = what->next)) {
q->head->prev = 0;
} else {
q->tail = 0;
}
} else if (!what->next) {
q->tail = what->prev;
q->tail->next = 0;
} else {
what->prev->next = what->next;
what->next->prev = what->prev;
}
what->prev = what->next = 0;
}
/*
** Add element to the tail of linked list
*/
static void diva_q_add_tail(diva_entity_queue_t * q, diva_entity_link_t * what)
{
what->next = 0;
if (!q->head) {
what->prev = 0;
q->head = q->tail = what;
} else {
what->prev = q->tail;
q->tail->next = what;
q->tail = what;
}
}
static diva_entity_link_t *diva_q_find(const diva_entity_queue_t * q,
const void *what, diva_q_cmp_fn_t cmp_fn)
{
diva_entity_link_t *diva_current = q->head;
while (diva_current) {
if (!(*cmp_fn) (what, diva_current)) {
break;
}
diva_current = diva_current->next;
}
return (diva_current);
}
static diva_entity_link_t *diva_q_get_head(diva_entity_queue_t * q)
{
return (q->head);
}
static diva_entity_link_t *diva_q_get_next(diva_entity_link_t * what)
{
return ((what) ? what->next : 0);
}
/* $Id: dlist.h,v 1.5 2003/08/25 16:03:35 schindler Exp $ */
#ifndef __DIVA_LINK_H__
#define __DIVA_LINK_H__
struct _diva_entity_link;
typedef struct _diva_entity_link {
struct _diva_entity_link *prev;
struct _diva_entity_link *next;
} diva_entity_link_t;
typedef struct _diva_entity_queue {
diva_entity_link_t *head;
diva_entity_link_t *tail;
} diva_entity_queue_t;
typedef int (*diva_q_cmp_fn_t) (const void *what,
const diva_entity_link_t *);
#endif
/* $Id: entity.h,v 1.1.2.1 2001/02/08 12:25:43 armin Exp $ */ /* $Id: entity.h,v 1.4 2004/03/21 17:26:01 armin Exp $ */
#ifndef __DIVAS_USER_MODE_IDI_ENTITY__ #ifndef __DIVAS_USER_MODE_IDI_ENTITY__
#define __DIVAS_USER_MODE_IDI_ENTITY__ #define __DIVAS_USER_MODE_IDI_ENTITY__
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define DIVA_UM_IDI_ASSIGN_PENDING 0x00000010 #define DIVA_UM_IDI_ASSIGN_PENDING 0x00000010
typedef struct _divas_um_idi_entity { typedef struct _divas_um_idi_entity {
diva_entity_link_t link; /* should be first */ struct list_head link;
diva_um_idi_adapter_t* adapter; /* Back to adapter */ diva_um_idi_adapter_t* adapter; /* Back to adapter */
ENTITY e; ENTITY e;
void* os_ref; void* os_ref;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id: os_4bri.c,v 1.25 2003/06/21 17:08:44 schindler Exp $ */ /* $Id: os_4bri.c,v 1.28 2004/03/21 17:26:01 armin Exp $ */
#include "platform.h" #include "platform.h"
#include "debuglib.h" #include "debuglib.h"
#include "cardtype.h" #include "cardtype.h"
#include "dlist.h"
#include "pc.h" #include "pc.h"
#include "pr_pc.h" #include "pr_pc.h"
#include "di_defs.h" #include "di_defs.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment