Commit 4941e7d4 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge silver.ucw.cz:/home/vojtech/bk/linus

into silver.ucw.cz:/home/vojtech/bk/input
parents e04f061b 98f9485a
......@@ -26,7 +26,7 @@ Produced and reselled by Twinhan:
- HAMA DVB-T USB device
http://www.hama.de/portal/articleId*110620/action*2598
- CTS Portable (Chinese Television System)
- CTS Portable (Chinese Television System) (2)
http://www.2cts.tv/ctsportable/
- Unknown USB DVB-T device with vendor ID Hyper-Paltek
......@@ -46,16 +46,16 @@ Produced and reselled by KWorld:
Others:
-------
- Ultima Electronic/Artec T1 USB TVBOX (AN2135 and AN2235)
- Ultima Electronic/Artec T1 USB TVBOX (AN2135, AN2235, AN2235 with Panasonic Tuner)
http://82.161.246.249/products-tvbox.html
- Compro Videomate DVB-U2000 - DVB-T USB
- Compro Videomate DVB-U2000 - DVB-T USB (2)
http://www.comprousa.com/products/vmu2000.htm
- Grandtec USB DVB-T
http://www.grand.com.tw/
- Avermedia AverTV DVBT USB
- Avermedia AverTV DVBT USB (2)
http://www.avermedia.com/
- DiBcom USB DVB-T reference device (non-public)
......@@ -63,16 +63,33 @@ Others:
Supported devices USB2.0
========================
- Twinhan MagicBox II
- Twinhan MagicBox II (2)
http://www.twinhan.com/product_terrestrial_7.asp
- Yakumo DVB-T mobile
- Hanftek UMT-010 (1)
http://www.globalsources.com/si/6008819757082/ProductDetail/Digital-TV/product_id-100046529
- Typhoon/Yakumo/HAMA DVB-T mobile USB2.0 (1)
http://www.yakumo.de/produkte/index.php?pid=1&ag=DVB-T
- Artec T1 USB TVBOX (FX2) (2)
- DiBcom USB2.0 DVB-T reference device (non-public)
1) It is working almost.
2) No test reports received yet.
0. NEWS:
2004-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb
- first almost working version for HanfTek UMT-010
- found out, that Yakumo/HAMA/Typhoon are predessors of the HanfTek
2004-01-10 - refactoring completed, now everything is very delightful
- tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a
Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.
2004-12-29 - after several days of struggling around bug of no returning URBs fixed.
2004-12-26 - refactored the dibusb-driver, splitted into separate files
- i2c-probing enabled
2004-12-06 - possibility for demod i2c-address probing
- new usb IDs (Compro,Artec)
2004-11-23 - merged changes from DiB3000MC_ver2.1
......@@ -115,13 +132,15 @@ Supported devices USB2.0
1. How to use?
NOTE: This driver was developed using Linux 2.6.6.,
it is working with 2.6.7, 2.6.8.1, 2.6.9 .
it is working with 2.6.7 and above.
Linux 2.4.x support is not planned, but patches are very welcome.
NOTE: I'm using Debian testing, so the following explaination (especially
the hotplug-path) needn't match your system, but probably it will :).
The driver is included in the kernel since Linux 2.6.10.
1.1. Firmware
The USB driver needs to download a firmware to start working.
......@@ -155,9 +174,13 @@ from withing the dvb-kernel cvs repository.
first have a look, which debug level are available:
modinfo dib3000mb
modinfo dib3000-common
modinfo dib3000mc
modinfo dvb-dibusb
modprobe dib3000-common debug=<level>
modprobe dib3000mb debug=<level>
modprobe dib3000mc debug=<level>
modprobe dvb-dibusb debug=<level>
should do the trick.
......@@ -168,13 +191,11 @@ turned on.
At this point you should be able to start a dvb-capable application. For myself
I used mplayer, dvbscan, tzap and kaxtv, they are working. Using the device
as a slave device in vdr, was not working for me. Some work has to be done
(patches and comments are very welcome).
in vdr (at least the USB2.0 one) is working.
2. Known problems and bugs
TODO:
- signal-quality and strength calculations
- none this time
2.1. Adding support for devices
......@@ -202,9 +223,10 @@ Most of the current supported devices are USB1.1 and thus they have a
maximum bandwidth of about 5-6 MBit/s when connected to a USB2.0 hub.
This is not enough for receiving the complete transport stream of a
DVB-T channel (which can be about 16 MBit/s). Normally this is not a
problem, if you only want to watch TV, but watching a channel while
recording another channel on the same frequency simply does not work.
This applies to all USB1.1 DVB-T devices.
problem, if you only want to watch TV (this does not apply for HDTV),
but watching a channel while recording another channel on the same
frequency simply does not work. This applies to all USB1.1 DVB-T
devices, not only dibusb)
A special problem of the dibusb for the USB1.1 is, that the USB control
IC has a problem with write accesses while having MPEG2-streaming
......@@ -218,14 +240,20 @@ due the automatic scanning (introduced in 1.3.x, afaik) and epg-scan. Disabling
these features is maybe a solution. Additionally this behaviour of VDR exceeds
the USB1.1 bandwidth.
Update:
For the USB1.1 and VDR some work has been done (patches and comments are still
very welcome). Maybe the problem is solved in the meantime because I now use
the dmx_sw_filter function instead of dmx_sw_filter_packet. I hope the
linux-dvb software filter is able to get the best of the garbled TS.
2.3. Comments
Patches, comments and suggestions are very very welcome
3. Acknowledgements
Amaury Demol (ademol@dibcom.fr) and Francois Kanounnikoff from DiBcom for
providing specs, code and help, on which the dvb-dibusb and dib3000mb are
based.
providing specs, code and help, on which the dvb-dibusb, dib3000mb and
dib3000mc are based.
David Matthews for identifying a new device type (Artec T1 with AN2235)
and for extending dibusb with remote control event handling. Thank you.
......
......@@ -21,7 +21,8 @@
use File::Temp qw/ tempdir /;
use IO::Handle;
@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", "dec2540t", "dec3000s", "vp7041", "dibusb" );
@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t",
"dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002" );
# Check args
syntax() if (scalar(@ARGV) != 1);
......@@ -233,6 +234,23 @@ sub dibusb {
$outfile;
}
sub nxt2002 {
my $sourcefile = "Broadband4PC_4_2_11.zip";
my $url = "http://www.bbti.us/download/windows/$sourcefile";
my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a";
my $outfile = "dvb-fe-nxt2002.fw";
my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
checkstandard();
wgetfile($sourcefile, $url);
unzip($sourcefile, $tmpdir);
verify("$tmpdir/SkyNETU.sys", $hash);
extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile);
$outfile;
}
# ---------------------------------------------------------------
# Utilities
......
......@@ -45,9 +45,10 @@ dev->hard_start_xmit:
Synchronization: dev->xmit_lock spinlock.
When the driver sets NETIF_F_LLTX in dev->features this will be
called without holding xmit_lock. In this case the driver
has to execute it's transmission routine in a completely lockless
manner. It is recommended only for queueless devices such
loopback and tunnels.
has to lock by itself when needed. It is recommended to use a try lock
for this and return -1 when the spin lock fails.
The locking there should also properly protect against
set_multicast_list
Context: BHs disabled
Notes: netif_queue_stopped() is guaranteed false
Return codes:
......@@ -55,6 +56,8 @@ dev->hard_start_xmit:
o NETDEV_TX_BUSY Cannot transmit packet, try later
Usually a bug, means queue start/stop flow control is broken in
the driver. Note: the driver must NOT put the skb in its DMA ring.
o NETDEV_TX_LOCKED Locking failed, please retry quickly.
Only valid when NETIF_F_LLTX is set.
dev->tx_timeout:
Synchronization: dev->xmit_lock spinlock.
......
......@@ -238,8 +238,9 @@ void iounmap(volatile void __iomem *addr)
}
if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) {
/* p->size includes the guard page, but cpa doesn't like that */
change_page_attr(virt_to_page(__va(p->phys_addr)),
p->size >> PAGE_SHIFT,
(p->size - PAGE_SIZE) >> PAGE_SHIFT,
PAGE_KERNEL);
global_flush_tlb();
}
......
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.10-rc1
# Tue Nov 2 11:35:10 2004
# Linux kernel version: 2.6.11-rc2
# Sat Jan 22 11:17:02 2005
#
#
......@@ -59,12 +59,14 @@ CONFIG_IA64=y
CONFIG_64BIT=y
CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_TIME_INTERPOLATION=y
CONFIG_EFI=y
CONFIG_GENERIC_IOMAP=y
# CONFIG_IA64_GENERIC is not set
CONFIG_IA64_DIG=y
# CONFIG_IA64_HP_ZX1 is not set
# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
# CONFIG_IA64_SGI_SN2 is not set
# CONFIG_IA64_HP_SIM is not set
# CONFIG_ITANIUM is not set
......@@ -76,6 +78,7 @@ CONFIG_IA64_PAGE_SIZE_16KB=y
CONFIG_IA64_L1_CACHE_SHIFT=7
# CONFIG_NUMA is not set
CONFIG_VIRTUAL_MEM_MAP=y
CONFIG_HOLES_IN_ZONE=y
CONFIG_IA64_CYCLONE=y
CONFIG_IOSAPIC=y
CONFIG_FORCE_MAX_ZONEORDER=18
......@@ -89,6 +92,7 @@ CONFIG_COMPAT=y
CONFIG_IA64_MCA_RECOVERY=y
CONFIG_PERFMON=y
CONFIG_IA64_PALINFO=y
CONFIG_ACPI_DEALLOCATE_IRQ=y
#
# Firmware Drivers
......@@ -110,8 +114,10 @@ CONFIG_ACPI=y
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_BUTTON=m
# CONFIG_ACPI_VIDEO is not set
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m
# CONFIG_ACPI_HOTPLUG_CPU is not set
CONFIG_ACPI_THERMAL=m
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
......@@ -119,6 +125,7 @@ CONFIG_ACPI_BUS=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_ACPI_CONTAINER is not set
#
# Bus options (PCI, PCMCIA)
......@@ -137,7 +144,6 @@ CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_ACPI=m
# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_PCIE is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
#
......@@ -174,6 +180,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
#
# Plug and Play support
#
# CONFIG_PNP is not set
#
# Block devices
......@@ -182,12 +189,14 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CDROM_PKTCDVD is not set
......@@ -199,6 +208,7 @@ CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_ATA_OVER_ETH is not set
#
# ATA/ATAPI/MFM/RLL support
......@@ -285,6 +295,7 @@ CONFIG_CHR_DEV_SG=m
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
# CONFIG_SCSI_ISCSI_ATTRS is not set
#
# SCSI low-level drivers
......@@ -325,7 +336,6 @@ CONFIG_SCSI_QLA22XX=m
CONFIG_SCSI_QLA2300=m
CONFIG_SCSI_QLA2322=m
# CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA6322 is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set
......@@ -342,6 +352,7 @@ CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m
CONFIG_MD_RAID6=m
CONFIG_MD_MULTIPATH=m
# CONFIG_MD_FAULTY is not set
CONFIG_BLK_DEV_DM=m
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
......@@ -392,6 +403,7 @@ CONFIG_SYN_COOKIES=y
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_IP_TCPDIAG=y
# CONFIG_IP_TCPDIAG_IPV6 is not set
# CONFIG_IPV6 is not set
# CONFIG_NETFILTER is not set
......@@ -471,7 +483,6 @@ CONFIG_NET_PCI=y
# CONFIG_FORCEDETH is not set
# CONFIG_DGRS is not set
CONFIG_EEPRO100=m
# CONFIG_EEPRO100_PIO is not set
CONFIG_E100=m
# CONFIG_E100_NAPI is not set
# CONFIG_FEALNX is not set
......@@ -564,12 +575,13 @@ CONFIG_SOUND_GAMEPORT=m
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_VORTEX is not set
# CONFIG_GAMEPORT_FM801 is not set
# CONFIG_GAMEPORT_CS461x is not set
# CONFIG_GAMEPORT_CS461X is not set
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
#
......@@ -598,6 +610,8 @@ CONFIG_HW_CONSOLE=y
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_ROCKETPORT is not set
# CONFIG_CYCLADES is not set
# CONFIG_MOXA_SMARTIO is not set
# CONFIG_ISI is not set
# CONFIG_SYNCLINK is not set
# CONFIG_SYNCLINKMP is not set
# CONFIG_N_HDLC is not set
......@@ -645,7 +659,7 @@ CONFIG_EFI_RTC=y
#
CONFIG_AGP=m
CONFIG_AGP_I460=m
CONFIG_DRM=y
CONFIG_DRM=m
CONFIG_DRM_TDFX=m
CONFIG_DRM_R128=m
CONFIG_DRM_RADEON=m
......@@ -691,6 +705,7 @@ CONFIG_MAX_RAW_DEVS=256
#
CONFIG_VGA_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
# Sound
......@@ -722,6 +737,7 @@ CONFIG_USB_EHCI_HCD=m
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_SL811_HCD is not set
#
# USB Device Class drivers
......@@ -729,6 +745,10 @@ CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_BLUETOOTH_TTY is not set
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_RW_DETECT is not set
......@@ -762,7 +782,6 @@ CONFIG_USB_HIDINPUT=y
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set
#
# USB Multimedia devices
......@@ -774,7 +793,7 @@ CONFIG_USB_HIDINPUT=y
#
#
# USB Network adaptors
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
......@@ -796,7 +815,6 @@ CONFIG_USB_HIDINPUT=y
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_TIGL is not set
# CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
......@@ -805,6 +823,7 @@ CONFIG_USB_HIDINPUT=y
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_PHIDGETKIT is not set
# CONFIG_USB_PHIDGETSERVO is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_TEST is not set
#
......@@ -816,6 +835,16 @@ CONFIG_USB_HIDINPUT=y
#
# CONFIG_USB_GADGET is not set
#
# MMC/SD Card support
#
# CONFIG_MMC is not set
#
# InfiniBand support
#
# CONFIG_INFINIBAND is not set
#
# File systems
#
......@@ -927,7 +956,7 @@ CONFIG_SMB_NLS_REMOTE="cp437"
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
# CONFIG_CIFS_XATTR is not set
# CONFIG_CIFS_POSIX is not set
# CONFIG_CIFS_EXPERIMENTAL is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
......@@ -1002,6 +1031,8 @@ CONFIG_NLS_UTF8=m
# CONFIG_CRC_CCITT is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
#
# Profiling support
......@@ -1019,6 +1050,7 @@ CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_FS is not set
CONFIG_IA64_GRANULE_16MB=y
# CONFIG_IA64_GRANULE_64MB is not set
# CONFIG_IA64_PRINT_HAZARDS is not set
......@@ -1055,7 +1087,12 @@ CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_TEST is not set
#
# Hardware crypto devices
#
......@@ -103,7 +103,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......@@ -130,7 +130,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......@@ -153,7 +153,7 @@ ia64_elf32_init (struct pt_regs *regs)
if (insert_vm_struct(current->mm, vma)) {
kmem_cache_free(vm_area_cachep, vma);
up_write(&current->mm->mmap_sem);
return;
BUG();
}
}
up_write(&current->mm->mmap_sem);
......
......@@ -2656,7 +2656,7 @@ asmlinkage long sys32_waitid(int which, compat_pid_t pid,
info.si_signo = 0;
set_fs (KERNEL_DS);
ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
uru ? &ru : NULL);
uru ? (struct rusage __user *) &ru : NULL);
set_fs (old_fs);
if (ret < 0 || info.si_signo == 0)
......
......@@ -151,10 +151,9 @@ void __devinit arch_init_sched_domains(void)
* Set up domains. Isolated domains just stay on the dummy domain.
*/
for_each_cpu_mask(i, cpu_default_map) {
int node = cpu_to_node(i);
int group;
struct sched_domain *sd = NULL, *p;
cpumask_t nodemask = node_to_cpumask(node);
cpumask_t nodemask = node_to_cpumask(cpu_to_node(i));
cpus_and(nodemask, nodemask, cpu_default_map);
......@@ -172,7 +171,7 @@ void __devinit arch_init_sched_domains(void)
sd = &per_cpu(node_domains, i);
*sd = SD_NODE_INIT;
sd->span = sched_domain_node_span(node);
sd->span = sched_domain_node_span(cpu_to_node(i));
sd->parent = p;
cpus_and(sd->span, sd->span, cpu_default_map);
#endif
......
......@@ -778,6 +778,7 @@ efi_mem_attributes (unsigned long phys_addr)
}
return 0;
}
EXPORT_SYMBOL(efi_mem_attributes);
int
valid_phys_addr_range (unsigned long phys_addr, unsigned long *size)
......
......@@ -3,7 +3,7 @@
*
* Kernel entry points.
*
* Copyright (C) 1998-2003 Hewlett-Packard Co
* Copyright (C) 1998-2003, 2005 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999, 2002-2003
* Asit Mallick <Asit.K.Mallick@intel.com>
......@@ -51,8 +51,11 @@
* setup a null register window frame.
*/
ENTRY(ia64_execve)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3)
alloc loc1=ar.pfs,3,2,4,0
/*
* Allocate 8 input registers since ptrace() may clobber them
*/
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
alloc loc1=ar.pfs,8,2,4,0
mov loc0=rp
.body
mov out0=in0 // filename
......@@ -113,8 +116,11 @@ END(ia64_execve)
* u64 tls)
*/
GLOBAL_ENTRY(sys_clone2)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6)
alloc r16=ar.pfs,6,2,6,0
/*
* Allocate 8 input registers since ptrace() may clobber them
*/
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
alloc r16=ar.pfs,8,2,6,0
DO_SAVE_SWITCH_STACK
adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp
mov loc0=rp
......@@ -142,8 +148,11 @@ END(sys_clone2)
* Deprecated. Use sys_clone2() instead.
*/
GLOBAL_ENTRY(sys_clone)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
alloc r16=ar.pfs,5,2,6,0
/*
* Allocate 8 input registers since ptrace() may clobber them
*/
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
alloc r16=ar.pfs,8,2,6,0
DO_SAVE_SWITCH_STACK
adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp
mov loc0=rp
......@@ -633,10 +642,12 @@ END(ia64_ret_from_syscall)
* r13: restored (user-level thread pointer)
* r14: cleared
* r15: restored (syscall #)
* r16-r19: cleared
* r16-r17: cleared
* r18: user-level b6
* r19: cleared
* r20: user-level ar.fpsr
* r21: user-level b0
* r22: user-level b6
* r22: cleared
* r23: user-level ar.bspstore
* r24: user-level ar.rnat
* r25: user-level ar.unat
......@@ -661,7 +672,7 @@ END(ia64_ret_from_syscall)
* ar.csd: cleared
* ar.ssd: cleared
*/
GLOBAL_ENTRY(ia64_leave_syscall)
ENTRY(ia64_leave_syscall)
PT_REGS_UNWIND_INFO(0)
/*
* work.need_resched etc. mustn't get changed by this CPU before it returns to
......@@ -690,79 +701,80 @@ GLOBAL_ENTRY(ia64_leave_syscall)
(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
#endif
.work_processed_syscall:
adds r16=PT(LOADRS)+16,r12
adds r17=PT(AR_BSPSTORE)+16,r12
adds r2=PT(LOADRS)+16,r12
adds r3=PT(AR_BSPSTORE)+16,r12
adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
;;
(p6) ld4 r31=[r18] // load current_thread_info()->flags
ld8 r19=[r16],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
nop.i 0
ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
mov b7=r0 // clear b7
;;
ld8 r23=[r17],PT(R9)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
ld8 r22=[r16],PT(R8)-PT(B6) // load b6
ld8 r23=[r3],PT(R9)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
ld8 r18=[r2],PT(R8)-PT(B6) // load b6
(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
;;
mov.m ar.ccv=r0 // clear ar.ccv
mov r16=ar.bsp // M2 get existing backing store pointer
(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending?
(p6) br.cond.spnt .work_pending
;;
// start restoring the state saved on the kernel stack (struct pt_regs):
ld8.fill r8=[r16],16
ld8.fill r9=[r17],16
ld8.fill r8=[r2],16
ld8.fill r9=[r3],16
mov f6=f0 // clear f6
;;
ld8.fill r10=[r16],16
ld8.fill r11=[r17],16
invala // M0|1 invalidate ALAT
rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection
mov f9=f0 // clear f9
ld8.fill r10=[r2],16
ld8.fill r11=[r3],16
mov f7=f0 // clear f7
;;
ld8 r29=[r16],16 // load cr.ipsr
ld8 r28=[r17],16 // load cr.iip
ld8 r29=[r2],16 // load cr.ipsr
ld8 r28=[r3],16 // load cr.iip
mov f8=f0 // clear f8
;;
ld8 r30=[r16],16 // load cr.ifs
ld8 r25=[r17],16 // load ar.unat
ld8 r30=[r2],16 // M0|1 load cr.ifs
mov.m ar.ssd=r0 // M2 clear ar.ssd
cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs
;;
rsm psr.i | psr.ic // initiate turning off of interrupt and interruption collection
invala // invalidate ALAT
mov f9=f0 // clear f9
mov.m ar.ssd=r0 // clear ar.ssd
mov.m ar.csd=r0 // clear ar.csd
ld8 r25=[r3],16 // M0|1 load ar.unat
mov.m ar.csd=r0 // M2 clear ar.csd
mov r22=r0 // clear r22
;;
ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs
(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled
mov f10=f0 // clear f10
;;
ld8 r26=[r16],16 // load ar.pfs
ld8 r27=[r17],PT(PR)-PT(AR_RSC) // load ar.rsc
ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0
ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc
mov f11=f0 // clear f11
;;
ld8 r24=[r16],PT(B0)-PT(AR_RNAT) // load ar.rnat (may be garbage)
ld8 r31=[r17],PT(R1)-PT(PR) // load predicates
ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // load ar.rnat (may be garbage)
ld8 r31=[r3],PT(R1)-PT(PR) // load predicates
(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
;;
ld8 r21=[r16],PT(R12)-PT(B0) // load b0
ld8.fill r1=[r17],16 // load r1
(pUStk) mov r3=1
ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // load ar.fpsr
ld8.fill r1=[r3],16 // load r1
(pUStk) mov r17=1
;;
ld8.fill r12=[r16],16
ld8.fill r13=[r17],16
mov r2=r0 // clear r2
srlz.d // M0 ensure interruption collection is off
ld8.fill r13=[r3],16
nop.i 0
;;
ld8 r20=[r16] // load ar.fpsr
ld8.fill r15=[r17] // load r15
mov b7=r0 // clear b7
ld8.fill r12=[r2] // restore r12 (sp)
ld8.fill r15=[r3] // restore r15
addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0
;;
(pUStk) st1 [r14]=r3
addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
(pUStk) ld4 r3=[r3] // r3 = cpu_data->phys_stacked_size_p8
(pUStk) st1 [r14]=r17
mov b6=r18 // I0 restore b6
;;
mov r16=ar.bsp // get existing backing store pointer
srlz.i // ensure interruption collection is off
shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition
mov r14=r0 // clear r14
;;
ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8
mov b6=r22 // restore b6
shr.u r18=r19,16 // get byte size of existing "dirty" partition
(pKStk) br.cond.dpnt.many skip_rbs_switch
mov.m ar.ccv=r0 // clear ar.ccv
(pNonSys) br.cond.dpnt.many dont_preserve_current_frame
br.cond.sptk.many rbs_switch
END(ia64_leave_syscall)
......@@ -883,12 +895,16 @@ GLOBAL_ENTRY(ia64_leave_kernel)
srlz.i // ensure interruption collection is off
mov ar.ccv=r15
;;
ldf.fill f11=[r2]
bsw.0 // switch back to bank 0 (no stop bit required beforehand...)
;;
ldf.fill f11=[r2]
(pUStk) mov r18=IA64_KR(CURRENT) // Itanium 2: 12 cycle read latency
(pUStk) mov r18=IA64_KR(CURRENT)// M2 (12 cycle read latency)
adds r16=PT(CR_IPSR)+16,r12
adds r17=PT(CR_IIP)+16,r12
(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled
nop.i 0
nop.i 0
;;
ld8 r29=[r16],16 // load cr.ipsr
ld8 r28=[r17],16 // load cr.iip
......@@ -901,7 +917,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs
;;
ld8 r24=[r16],16 // load ar.rnat (may be garbage)
ld8 r23=[r17],16// load ar.bspstore (may be garbage)
ld8 r23=[r17],16 // load ar.bspstore (may be garbage)
;;
ld8 r31=[r16],16 // load predicates
ld8 r21=[r17],16 // load b0
......@@ -971,6 +987,7 @@ dont_preserve_current_frame:
shladd in0=loc1,3,r17
mov in1=0
;;
.align 32
rse_clear_invalid:
#ifdef CONFIG_ITANIUM
// cycle 0
......@@ -1031,23 +1048,33 @@ rse_clear_invalid:
loadrs
;;
skip_rbs_switch:
(pLvSys) mov r19=r0 // clear r19 for leave_syscall, no-op otherwise
mov b0=r21
mov ar.pfs=r26
(pUStk) mov ar.bspstore=r23
(p9) mov cr.ifs=r30
(pLvSys)mov r16=r0 // clear r16 for leave_syscall, no-op otherwise
mov cr.ipsr=r29
mov ar.fpsr=r20
(pLvSys)mov r17=r0 // clear r17 for leave_syscall, no-op otherwise
mov cr.iip=r28
;;
(pUStk) mov ar.rnat=r24 // must happen with RSE in lazy mode
(pLvSys)mov r18=r0 // clear r18 for leave_syscall, no-op otherwise
mov ar.rsc=r27
mov ar.unat=r25
mov pr=r31,-1
rfi
mov ar.unat=r25 // M2
(pKStk) extr.u r22=r22,21,1 // I0 extract current value of psr.pp from r22
(pLvSys)mov r19=r0 // A clear r19 for leave_syscall, no-op otherwise
;;
(pUStk) mov ar.bspstore=r23 // M2
(pKStk) dep r29=r22,r29,21,1 // I0 update ipsr.pp with psr.pp
(pLvSys)mov r16=r0 // A clear r16 for leave_syscall, no-op otherwise
;;
mov cr.ipsr=r29 // M2
mov ar.pfs=r26 // I0
(pLvSys)mov r17=r0 // A clear r17 for leave_syscall, no-op otherwise
(p9) mov cr.ifs=r30 // M2
mov b0=r21 // I0
(pLvSys)mov r18=r0 // A clear r18 for leave_syscall, no-op otherwise
mov ar.fpsr=r20 // M2
mov cr.iip=r28 // M2
nop 0
;;
(pUStk) mov ar.rnat=r24 // M2 must happen with RSE in lazy mode
nop 0
(pLvSys)mov r2=r0
mov ar.rsc=r27 // M2
mov pr=r31,-1 // I0
rfi // B
/*
* On entry:
......@@ -1198,7 +1225,10 @@ END(sys_rt_sigsuspend)
ENTRY(sys_rt_sigreturn)
PT_REGS_UNWIND_INFO(0)
alloc r2=ar.pfs,0,0,1,0
/*
* Allocate 8 input registers since ptrace() may clobber them
*/
alloc r2=ar.pfs,8,0,1,0
.prologue
PT_REGS_SAVES(16)
adds sp=-16,sp
......
#include <linux/config.h>
/*
* Preserved registers that are shared between code in ivt.S and entry.S. Be
* careful not to step on these!
* Preserved registers that are shared between code in ivt.S and
* entry.S. Be careful not to step on these!
*/
#define pLvSys p1 /* set 1 if leave from syscall; otherwise, set 0 */
#define pKStk p2 /* will leave_{kernel,syscall} return to kernel-stacks? */
#define pUStk p3 /* will leave_{kernel,syscall} return to user-stacks? */
#define pSys p4 /* are we processing a (synchronous) system call? */
#define pNonSys p5 /* complement of pSys */
#define PRED_LEAVE_SYSCALL 1 /* TRUE iff leave from syscall */
#define PRED_KERNEL_STACK 2 /* returning to kernel-stacks? */
#define PRED_USER_STACK 3 /* returning to user-stacks? */
#define PRED_SYSCALL 4 /* inside a system call? */
#define PRED_NON_SYSCALL 5 /* complement of PRED_SYSCALL */
#ifdef __ASSEMBLY__
# define PASTE2(x,y) x##y
# define PASTE(x,y) PASTE2(x,y)
# define pLvSys PASTE(p,PRED_LEAVE_SYSCALL)
# define pKStk PASTE(p,PRED_KERNEL_STACK)
# define pUStk PASTE(p,PRED_USER_STACK)
# define pSys PASTE(p,PRED_SYSCALL)
# define pNonSys PASTE(p,PRED_NON_SYSCALL)
#endif
#define PT(f) (IA64_PT_REGS_##f##_OFFSET)
#define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET)
......
......@@ -612,8 +612,9 @@ GLOBAL_ENTRY(fsys_bubble_down)
;;
mov rp=r2 // set the real return addr
tbit.z p8,p0=r3,TIF_SYSCALL_TRACE
(p8) br.call.sptk.many b6=b6 // ignore this return addr
;;
(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8
(p8) br.call.sptk.many b6=b6 // ignore this return addr
br.cond.sptk ia64_trace_syscall
END(fsys_bubble_down)
......
......@@ -81,6 +81,7 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
LOAD_FSYSCALL_TABLE(r14)
mov r16=IA64_KR(CURRENT) // 12 cycle read latency
tnat.nz p10,p9=r15
mov r19=NR_syscalls-1
;;
shladd r18=r17,3,r14
......@@ -119,7 +120,8 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
#endif
mov r10=-1
mov r8=ENOSYS
(p10) mov r8=EINVAL
(p9) mov r8=ENOSYS
FSYS_RETURN
END(__kernel_syscall_via_epc)
......
......@@ -32,35 +32,7 @@ void ack_bad_irq(unsigned int irq)
printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id());
}
/*
* do_IRQ handles all normal device IRQ's (the special
* SMP cross-CPU interrupts have their own specific
* handlers).
*/
unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs)
{
return __do_IRQ(irq, regs);
}
#ifdef CONFIG_SMP
/*
* This is updated when the user sets irq affinity via /proc
*/
cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)];
#endif
#ifdef CONFIG_IA64_GENERIC
irq_desc_t * __ia64_irq_desc (unsigned int irq)
{
return irq_desc + irq;
}
ia64_vector __ia64_irq_to_vector (unsigned int irq)
{
return (ia64_vector) irq;
}
unsigned int __ia64_local_vector_to_irq (ia64_vector vec)
{
return (unsigned int) vec;
......@@ -113,27 +85,19 @@ int show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
#if defined(CONFIG_X86_LOCAL_APIC)
seq_puts(p, "LOC: ");
for (j = 0; j < NR_CPUS; j++)
if (cpu_online(j))
seq_printf(p, "%10u ",
irq_stat[j].apic_timer_irqs);
seq_putc(p, '\n');
#endif
} else if (i == NR_IRQS)
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
#if defined(CONFIG_X86_IO_APIC)
seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
#endif
}
return 0;
}
#ifdef CONFIG_SMP
/*
* This is updated when the user sets irq affinity via /proc
*/
cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)];
static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
......@@ -250,7 +214,7 @@ void fixup_irqs(void)
for (irq=0; irq < NR_IRQS; irq++) {
if (vectors_in_migration[irq]) {
vectors_in_migration[irq]=0;
do_IRQ(irq, NULL);
__do_IRQ(irq, NULL);
}
}
......
......@@ -90,8 +90,6 @@ free_irq_vector (int vector)
printk(KERN_WARNING "%s: double free!\n", __FUNCTION__);
}
extern unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs);
#ifdef CONFIG_SMP
# define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE)
#else
......@@ -150,7 +148,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
ia64_setreg(_IA64_REG_CR_TPR, vector);
ia64_srlz_d();
do_IRQ(local_vector_to_irq(vector), regs);
__do_IRQ(local_vector_to_irq(vector), regs);
/*
* Disable interrupts and send EOI:
......@@ -201,7 +199,7 @@ void ia64_process_pending_intr(void)
* Probably could shared code.
*/
vectors_in_migration[local_vector_to_irq(vector)]=0;
do_IRQ(local_vector_to_irq(vector), NULL);
__do_IRQ(local_vector_to_irq(vector), NULL);
/*
* Disable interrupts and send EOI
......
......@@ -51,6 +51,7 @@
#include <asm/system.h>
#include <asm/thread_info.h>
#include <asm/unistd.h>
#include <asm/errno.h>
#if 1
# define PSR_DEFAULT_BITS psr.ac
......@@ -732,10 +733,12 @@ ENTRY(break_fault)
ssm psr.ic | PSR_DEFAULT_BITS
;;
srlz.i // guarantee that interruption collection is on
mov r3=NR_syscalls - 1
;;
(p15) ssm psr.i // restore psr.i
// p10==true means out registers are more than 8 or r15's Nat is true
(p10) br.cond.spnt.many ia64_ret_from_syscall
;;
mov r3=NR_syscalls - 1
movl r16=sys_call_table
adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024
......@@ -836,8 +839,11 @@ END(interrupt)
* On exit:
* - executing on bank 1 registers
* - psr.ic enabled, interrupts restored
* - p10: TRUE if syscall is invoked with more than 8 out
* registers or r15's Nat is true
* - r1: kernel's gp
* - r3: preserved (same as on entry)
* - r8: -EINVAL if p10 is true
* - r12: points to kernel stack
* - r13: points to current task
* - p15: TRUE if interrupts need to be re-enabled
......@@ -871,12 +877,17 @@ GLOBAL_ENTRY(ia64_syscall_setup)
;;
st8 [r16]=r19,PT(AR_RNAT)-PT(CR_IFS) // store ar.pfs.pfm in cr.ifs
extr.u r11=r19,7,7 // I0 // get sol of ar.pfs
and r8=0x7f,r19 // A // get sof of ar.pfs
st8 [r17]=r27,PT(AR_BSPSTORE)-PT(AR_RSC)// save ar.rsc
tbit.nz p15,p0=r29,IA64_PSR_I_BIT // I0
(p9) mov in1=-1
;;
(pUStk) sub r18=r18,r22 // r18=RSE.ndirty*8
tbit.nz p15,p0=r29,IA64_PSR_I_BIT
tnat.nz p10,p0=in2
add r11=8,r11
;;
(pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16 // skip over ar_rnat field
(pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17 // skip over ar_bspstore field
......@@ -904,25 +915,29 @@ GLOBAL_ENTRY(ia64_syscall_setup)
(p13) mov in5=-1
;;
st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr
st8.spill [r17]=r15 // save r15
tnat.nz p14,p0=in6
cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8
;;
stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error)
(p9) tnat.nz p10,p0=r15
adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch)
st8.spill [r17]=r15 // save r15
tnat.nz p8,p0=in7
nop.i 0
mov r13=r2 // establish `current'
movl r1=__gp // establish kernel global pointer
;;
(p14) mov in6=-1
(p8) mov in7=-1
tnat.nz p9,p0=r15
nop.i 0
cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0
movl r17=FPSR_DEFAULT
;;
mov.m ar.fpsr=r17 // set ar.fpsr to kernel default value
(p9) mov r15=-1
(p10) mov r8=-EINVAL
br.ret.sptk.many b7
END(ia64_syscall_setup)
......
......@@ -882,8 +882,6 @@ ia64_mca_ucmc_handler(void)
&ia64_sal_to_os_handoff_state,
&ia64_os_to_sal_handoff_state));
return_to_sal:
if (recover) {
sal_log_record_header_t *rh = IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA);
rh->severity = sal_log_severity_corrected;
......
......@@ -52,7 +52,7 @@ typedef enum {
MCA_IS_GLOBAL = 1
} mca_type_t;
#define MAX_PAGE_ISOLATE 32
#define MAX_PAGE_ISOLATE 1024
static struct page *page_isolate[MAX_PAGE_ISOLATE];
static int num_page_isolate = 0;
......
......@@ -40,6 +40,8 @@
#include <asm/unwind.h>
#include <asm/user.h>
#include "entry.h"
#ifdef CONFIG_PERFMON
# include <asm/perfmon.h>
#endif
......@@ -630,7 +632,7 @@ dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
return 1; /* f0-f31 are always valid so we always return 1 */
}
asmlinkage long
long
sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp,
struct pt_regs *regs)
{
......@@ -667,7 +669,7 @@ kernel_thread (int (*fn)(void *), void *arg, unsigned long flags)
regs.pt.cr_ifs = 1UL << 63; /* mark as valid, empty frame */
regs.sw.ar_fpsr = regs.pt.ar_fpsr = ia64_getreg(_IA64_REG_AR_FPSR);
regs.sw.ar_bspstore = (unsigned long) current + IA64_RBS_OFFSET;
regs.sw.pr = (1 << PRED_KERNEL_STACK);
return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs.pt, 0, NULL, NULL);
}
EXPORT_SYMBOL(kernel_thread);
......
......@@ -31,9 +31,6 @@
#include "entry.h"
#define p4 (1UL << 4) /* for pSys (see entry.h) */
#define p5 (1UL << 5) /* for pNonSys (see entry.h) */
/*
* Bits in the PSR that we allow ptrace() to change:
* be, up, ac, mfl, mfh (the user mask; five bits total)
......@@ -669,8 +666,8 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, unsigned
}
unw_get_pr(&prev_info, &pr);
pr &= ~pSys;
pr |= pNonSys;
pr &= ~(1UL << PRED_SYSCALL);
pr |= (1UL << PRED_NON_SYSCALL);
unw_set_pr(&prev_info, pr);
pt->cr_ifs = (1UL << 63) | cfm;
......
......@@ -612,8 +612,7 @@ void __cpu_die(unsigned int cpu)
*/
return;
}
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ/10);
msleep(100);
}
printk(KERN_ERR "CPU %u didn't die...\n", cpu);
}
......
......@@ -47,8 +47,6 @@
#include "entry.h"
#include "unwind_i.h"
#define p5 5
#define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */
#define UNW_CACHE_SIZE (1 << UNW_LOG_CACHE_SIZE)
......@@ -1899,7 +1897,7 @@ unw_unwind (struct unw_frame_info *info)
num_regs = 0;
if ((info->flags & UNW_FLAG_INTERRUPT_FRAME)) {
info->pt = info->sp + 16;
if ((pr & (1UL << pNonSys)) != 0)
if ((pr & (1UL << PRED_NON_SYSCALL)) != 0)
num_regs = *info->cfm_loc & 0x7f; /* size of frame */
info->pfs_loc =
(unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs));
......@@ -1945,7 +1943,7 @@ EXPORT_SYMBOL(unw_unwind);
int
unw_unwind_to_user (struct unw_frame_info *info)
{
unsigned long ip;
unsigned long ip, sp;
while (unw_unwind(info) >= 0) {
if (unw_get_rp(info, &ip) < 0) {
......@@ -1954,6 +1952,9 @@ unw_unwind_to_user (struct unw_frame_info *info)
__FUNCTION__, ip);
return -1;
}
unw_get_sp(info, &sp);
if (sp >= (unsigned long)info->task + IA64_STK_OFFSET)
break;
if (ip < FIXADDR_USER_END)
return 0;
}
......
......@@ -8,7 +8,7 @@
* Find next zero bit in a bitmap reasonably efficiently..
*/
int __find_next_zero_bit (void *addr, unsigned long size, unsigned long offset)
int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
unsigned long result = offset & ~63UL;
......
......@@ -195,7 +195,7 @@ per_cpu_init (void)
__per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start;
cpu_data += PERCPU_PAGE_SIZE;
per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
__per_cpu_mca[cpu] = (unsigned long)mca_data;
__per_cpu_mca[cpu] = (unsigned long)__pa(mca_data);
mca_data += PERCPU_MCA_SIZE;
}
}
......
......@@ -539,7 +539,8 @@ pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
*/
vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO);
if (write_combine)
if (write_combine && efi_range_is_wc(vma->vm_start,
vma->vm_end - vma->vm_start))
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
else
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
......
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved.
*/
#ifndef _ASM_IA64_SN_SHUB_H
#define _ASM_IA64_SN_SHUB_H
#define MD_MEM_BANKS 4
/*
* Junk Bus Address Space
* The junk bus is used to access the PROM, LED's, and UART. It's
* accessed through the local block MMR space. The data path is
* 16 bits wide. This space requires address bits 31-27 to be set, and
* is further divided by address bits 26:15.
* The LED addresses are write-only. To read the LEDs, you need to use
* SH_JUNK_BUS_LED0-3, defined in shub_mmr.h
*
*/
#define SH_REAL_JUNK_BUS_LED0 0x7fed00000UL
#define SH_REAL_JUNK_BUS_LED1 0x7fed10000UL
#define SH_REAL_JUNK_BUS_LED2 0x7fed20000UL
#define SH_REAL_JUNK_BUS_LED3 0x7fed30000UL
#define SH_JUNK_BUS_UART0 0x7fed40000UL
#define SH_JUNK_BUS_UART1 0x7fed40008UL
#define SH_JUNK_BUS_UART2 0x7fed40010UL
#define SH_JUNK_BUS_UART3 0x7fed40018UL
#define SH_JUNK_BUS_UART4 0x7fed40020UL
#define SH_JUNK_BUS_UART5 0x7fed40028UL
#define SH_JUNK_BUS_UART6 0x7fed40030UL
#define SH_JUNK_BUS_UART7 0x7fed40038UL
#endif /* _ASM_IA64_SN_SHUB_H */
......@@ -15,6 +15,7 @@
#include "xtalk/xwidgetdev.h"
#include "xtalk/hubdev.h"
#include <asm/sn/bte.h>
#include <asm/param.h>
/*
* Bte error handling is done in two parts. The first captures
......
......@@ -183,7 +183,9 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
sn_irq_info = sn_irq_info->irq_next;
#ifdef CONFIG_SMP
set_irq_affinity_info((irq & 0xff), cpuphys, 0);
#endif
} else {
break; /* snp_affinity failed the intr_alloc */
}
......@@ -202,16 +204,6 @@ struct hw_interrupt_type irq_type_sn = {
sn_set_affinity_irq
};
struct irq_desc *sn_irq_desc(unsigned int irq)
{
return (irq_desc + irq);
}
u8 sn_irq_to_vector(unsigned int irq)
{
return irq;
}
unsigned int sn_local_vector_to_irq(u8 vector)
{
return (CPU_VECTOR_TO_IRQ(smp_processor_id(), vector));
......
......@@ -163,13 +163,12 @@ static int __init pxm_to_nasid(int pxm)
void __init early_sn_setup(void)
{
void ia64_sal_handler_init(void *entry_point, void *gpval);
efi_system_table_t *efi_systab;
efi_config_table_t *config_tables;
struct ia64_sal_systab *sal_systab;
struct ia64_sal_desc_entry_point *ep;
char *p;
int i;
int i, j;
/*
* Parse enough of the SAL tables to locate the SAL entry point. Since, console
......@@ -185,19 +184,21 @@ void __init early_sn_setup(void)
0) {
sal_systab = __va(config_tables[i].table);
p = (char *)(sal_systab + 1);
for (i = 0; i < sal_systab->entry_count; i++) {
for (j = 0; j < sal_systab->entry_count; j++) {
if (*p == SAL_DESC_ENTRY_POINT) {
ep = (struct ia64_sal_desc_entry_point
*)p;
ia64_sal_handler_init(__va
(ep->sal_proc),
__va(ep->gp));
break;
return;
}
p += SAL_DESC_SIZE(*p);
}
}
}
/* Uh-oh, SAL not available?? */
printk(KERN_ERR "failed to find SAL entry point\n");
}
extern int platform_intr_list[];
......
......@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 2004-2005 Silicon Graphics, Inc. All rights reserved.
*
* SGI Altix topology and hardware performance monitoring API.
* Mark Goodwin <markgw@sgi.com>.
......@@ -374,6 +374,42 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
return r;
}
/* map SAL hwperf error code to system error code */
static int sn_hwperf_map_err(int hwperf_err)
{
int e;
switch(hwperf_err) {
case SN_HWPERF_OP_OK:
e = 0;
break;
case SN_HWPERF_OP_NOMEM:
e = -ENOMEM;
break;
case SN_HWPERF_OP_NO_PERM:
e = -EPERM;
break;
case SN_HWPERF_OP_IO_ERROR:
e = -EIO;
break;
case SN_HWPERF_OP_BUSY:
case SN_HWPERF_OP_RECONFIGURE:
e = -EAGAIN;
break;
case SN_HWPERF_OP_INVAL:
default:
e = -EINVAL;
break;
}
return e;
}
/*
* ioctl for "sn_hwperf" misc device
*/
......@@ -511,12 +547,20 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
op_info.v0 = &v0;
op_info.op = op;
r = sn_hwperf_op_cpu(&op_info);
if (r) {
r = sn_hwperf_map_err(r);
goto error;
}
break;
default:
/* all other ops are a direct SAL call */
r = ia64_sn_hwperf_op(sn_hwperf_master_nasid, op,
a.arg, a.sz, (u64) p, 0, 0, &v0);
if (r) {
r = sn_hwperf_map_err(r);
goto error;
}
a.v0 = v0;
break;
}
......
This diff is collapsed.
......@@ -67,7 +67,7 @@ struct rt_sigframe {
struct siginfo info;
/* 64 bit ABI allows for 288 bytes below sp before decrementing it. */
char abigap[288];
};
} __attribute__ ((aligned (16)));
/*
......@@ -254,7 +254,7 @@ static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs
newsp = (current->sas_ss_sp + current->sas_ss_size);
}
return (void __user *)((newsp - frame_size) & -8ul);
return (void __user *)((newsp - frame_size) & -16ul);
}
/*
......
......@@ -380,6 +380,8 @@ source "sound/Kconfig"
source "drivers/usb/Kconfig"
source "drivers/infiniband/Kconfig"
source "drivers/char/watchdog/Kconfig"
source "arch/sparc/Kconfig.debug"
......
......@@ -4,6 +4,9 @@
*
* Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*
* 2004-12-25 Krzysztof Helt (krzysztof.h1@wp.pl)
* - fixed registers constrains in inline assembly declarations
*/
#include <linux/kernel.h>
......@@ -132,7 +135,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc)
"mov %%o0, %0\n\t"
"mov %%o1, %1\n\t"
: "=r" (rs1), "=r" (rs2)
:
: "0" (rs1), "1" (rs2)
: "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc");
#ifdef DEBUG_MULDIV
printk ("0x%x%08x\n", rs2, rs1);
......@@ -152,7 +155,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc)
"mov %%o0, %0\n\t"
"mov %%o1, %1\n\t"
: "=r" (rs1), "=r" (rs2)
:
: "0" (rs1), "1" (rs2)
: "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc");
#ifdef DEBUG_MULDIV
printk ("0x%x%08x\n", rs2, rs1);
......@@ -181,7 +184,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc)
"mov %%o1, %0\n\t"
"mov %%o0, %1\n\t"
: "=r" (rs1), "=r" (rs2)
: "r" (regs->y)
: "r" (regs->y), "0" (rs1), "1" (rs2)
: "o0", "o1", "o2", "o3", "o4", "o5", "o7",
"g1", "g2", "g3", "cc");
#ifdef DEBUG_MULDIV
......@@ -210,7 +213,7 @@ int do_user_muldiv(struct pt_regs *regs, unsigned long pc)
"mov %%o1, %0\n\t"
"mov %%o0, %1\n\t"
: "=r" (rs1), "=r" (rs2)
: "r" (regs->y)
: "r" (regs->y), "0" (rs1), "1" (rs2)
: "o0", "o1", "o2", "o3", "o4", "o5", "o7",
"g1", "g2", "g3", "cc");
#ifdef DEBUG_MULDIV
......
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.10
# Mon Jan 10 11:24:25 2005
# Linux kernel version: 2.6.11-rc1
# Fri Jan 21 20:03:21 2005
#
CONFIG_64BIT=y
CONFIG_MMU=y
......@@ -66,13 +66,13 @@ CONFIG_SMP=y
CONFIG_NR_CPUS=4
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_PROC_INTF=y
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
# CONFIG_CPU_FREQ_24_API is not set
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_TABLE=y
CONFIG_US3_FREQ=m
......@@ -189,6 +189,7 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
CONFIG_LOGO_SUN_CLUT224=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
# Serial drivers
......@@ -228,6 +229,7 @@ CONFIG_OBP_FLASH=m
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
......@@ -247,6 +249,7 @@ CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_ATA_OVER_ETH=m
#
# ATA/ATAPI/MFM/RLL support
......@@ -1202,6 +1205,7 @@ CONFIG_SENSORS_LM87=m
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_MAX1619=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_SMSC47B397=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_W83781D=m
......@@ -1759,6 +1763,7 @@ CONFIG_USB_SERIAL_IPAQ=m
# CONFIG_USB_SERIAL_IR is not set
CONFIG_USB_SERIAL_EDGEPORT=m
# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
CONFIG_USB_SERIAL_GARMIN=m
CONFIG_USB_SERIAL_IPW=m
CONFIG_USB_SERIAL_KEYSPAN_PDA=m
CONFIG_USB_SERIAL_KEYSPAN=m
......@@ -1779,6 +1784,7 @@ CONFIG_USB_SERIAL_KLSI=m
CONFIG_USB_SERIAL_MCT_U232=m
CONFIG_USB_SERIAL_PL2303=m
# CONFIG_USB_SERIAL_SAFE is not set
CONFIG_USB_SERIAL_TI=m
CONFIG_USB_SERIAL_CYBERJACK=m
CONFIG_USB_SERIAL_XIRCOM=m
CONFIG_USB_SERIAL_OMNINET=m
......@@ -1789,7 +1795,6 @@ CONFIG_USB_EZUSB=y
#
CONFIG_USB_EMI62=m
CONFIG_USB_EMI26=m
# CONFIG_USB_TIGL is not set
CONFIG_USB_AUERSWALD=m
CONFIG_USB_RIO500=m
CONFIG_USB_LEGOTOWER=m
......@@ -1798,6 +1803,7 @@ CONFIG_USB_LED=m
CONFIG_USB_CYTHERM=m
CONFIG_USB_PHIDGETKIT=m
CONFIG_USB_PHIDGETSERVO=m
CONFIG_USB_IDMOUSE=m
CONFIG_USB_TEST=m
#
......@@ -1863,6 +1869,7 @@ CONFIG_SCHEDSTATS=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_FS=y
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_KPROBES=y
# CONFIG_DEBUG_DCFLUSH is not set
......
......@@ -8,18 +8,16 @@
.align 32
.globl memmove
.type memmove,#function
memmove:
memmove: /* o0=dst o1=src o2=len */
mov %o0, %g1
cmp %o0, %o1
blu,pt %xcc, memcpy
sub %o0, %o1, %g5
add %o1, %o2, %g3
cmp %g3, %o0
bleu,pt %xcc, memcpy
add %o1, %o2, %g5
add %o0, %o2, %o5
cmp %g5, %o0
bleu,pt %xcc, memcpy
add %o0, %o2, %o5
sub %g5, 1, %o1
sub %o5, 1, %o0
1: ldub [%o1], %g5
subcc %o2, 1, %o2
......
......@@ -198,9 +198,6 @@ int __init setup_early_printk(char *opt)
early_console = &early_serial_console;
} else if (!strncmp(buf, "vga", 3)) {
early_console = &early_vga_console;
} else {
early_console = NULL;
return -1;
}
early_console_initialized = 1;
register_console(early_console);
......
......@@ -917,7 +917,7 @@ void __init trap_init(void)
set_intr_gate(0,&divide_error);
set_intr_gate_ist(1,&debug,DEBUG_STACK);
set_intr_gate_ist(2,&nmi,NMI_STACK);
set_intr_gate(3,&int3);
set_system_gate(3,&int3);
set_system_gate(4,&overflow); /* int4-5 can be called from all */
set_system_gate(5,&bounds);
set_intr_gate(6,&invalid_op);
......
......@@ -265,8 +265,9 @@ void iounmap(volatile void __iomem *addr)
unmap_vm_area(p);
if ((p->flags >> 20) &&
p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) {
/* p->size includes the guard page, but cpa doesn't like that */
change_page_attr(virt_to_page(__va(p->phys_addr)),
p->size >> PAGE_SHIFT,
(p->size - PAGE_SIZE) >> PAGE_SHIFT,
PAGE_KERNEL);
global_flush_tlb();
}
......
......@@ -34,6 +34,9 @@
*/
#include "drmP.h"
#if defined(__ia64__)
#include <linux/efi.h>
#endif
/**
......@@ -612,8 +615,13 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_IO; /* not in core dump */
}
#if defined(__ia64__)
if (map->type != _DRM_AGP)
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
if (efi_range_is_wc(vma->vm_start, vma->vm_end -
vma->vm_start))
vma->vm_page_prot =
pgprot_writecombine(vma->vm_page_prot);
else
vma->vm_page_prot =
pgprot_noncached(vma->vm_page_prot);
#endif
offset = dev->driver->get_reg_ofs(dev);
#ifdef __sparc__
......
......@@ -104,10 +104,10 @@ struct ipoib_buf {
};
/*
* Device private locking: netdev->xmit_lock protects members used
* in TX fast path.
* lock protects everything else. lock nests inside of xmit_lock (ie
* xmit_lock must be acquired first if needed).
* Device private locking: tx_lock protects members used in TX fast
* path (and we use LLTX so upper layers don't do extra locking).
* lock protects everything else. lock nests inside of tx_lock (ie
* tx_lock must be acquired first if needed).
*/
struct ipoib_dev_priv {
spinlock_t lock;
......@@ -150,6 +150,7 @@ struct ipoib_dev_priv {
struct ipoib_buf *rx_ring;
spinlock_t tx_lock;
struct ipoib_buf *tx_ring;
unsigned tx_head;
unsigned tx_tail;
......
......@@ -247,12 +247,12 @@ static void ipoib_ib_handle_wc(struct net_device *dev,
dev_kfree_skb_any(tx_req->skb);
spin_lock_irqsave(&dev->xmit_lock, flags);
spin_lock_irqsave(&priv->tx_lock, flags);
++priv->tx_tail;
if (netif_queue_stopped(dev) &&
priv->tx_head - priv->tx_tail <= IPOIB_TX_RING_SIZE / 2)
netif_wake_queue(dev);
spin_unlock_irqrestore(&dev->xmit_lock, flags);
spin_unlock_irqrestore(&priv->tx_lock, flags);
if (wc->status != IB_WC_SUCCESS &&
wc->status != IB_WC_WR_FLUSH_ERR)
......
......@@ -411,7 +411,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
/*
* We can only be called from ipoib_start_xmit, so we're
* inside dev->xmit_lock -- no need to save/restore flags.
* inside tx_lock -- no need to save/restore flags.
*/
spin_lock(&priv->lock);
......@@ -483,7 +483,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
/*
* We can only be called from ipoib_start_xmit, so we're
* inside dev->xmit_lock -- no need to save/restore flags.
* inside tx_lock -- no need to save/restore flags.
*/
spin_lock(&priv->lock);
......@@ -526,11 +526,27 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
spin_unlock(&priv->lock);
}
/* Called with dev->xmit_lock held and IRQs disabled. */
static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ipoib_neigh *neigh;
unsigned long flags;
local_irq_save(flags);
if (!spin_trylock(&priv->tx_lock)) {
local_irq_restore(flags);
return NETDEV_TX_LOCKED;
}
/*
* Check if our queue is stopped. Since we have the LLTX bit
* set, we can't rely on netif_stop_queue() preventing our
* xmit function from being called with a full queue.
*/
if (unlikely(netif_queue_stopped(dev))) {
spin_unlock_irqrestore(&priv->tx_lock, flags);
return NETDEV_TX_BUSY;
}
if (skb->dst && skb->dst->neighbour) {
if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) {
......@@ -585,6 +601,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
out:
spin_unlock_irqrestore(&priv->tx_lock, flags);
return NETDEV_TX_OK;
}
......@@ -780,7 +797,7 @@ static void ipoib_setup(struct net_device *dev)
dev->addr_len = INFINIBAND_ALEN;
dev->type = ARPHRD_INFINIBAND;
dev->tx_queue_len = IPOIB_TX_RING_SIZE * 2;
dev->features = NETIF_F_VLAN_CHALLENGED;
dev->features = NETIF_F_VLAN_CHALLENGED | NETIF_F_LLTX;
/* MTU will be reset when mcast join happens */
dev->mtu = IPOIB_PACKET_SIZE - IPOIB_ENCAP_LEN;
......@@ -795,6 +812,7 @@ static void ipoib_setup(struct net_device *dev)
priv->dev = dev;
spin_lock_init(&priv->lock);
spin_lock_init(&priv->tx_lock);
init_MUTEX(&priv->mcast_mutex);
init_MUTEX(&priv->vlan_mutex);
......
......@@ -380,8 +380,8 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
/* disable all irqs */
saa7146_write(dev, IER, 0);
/* shut down all dma transfers */
saa7146_write(dev, MC1, 0x00ff0000);
/* shut down all dma transfers and rps tasks */
saa7146_write(dev, MC1, 0x30ff0000);
/* clear out any rps-signals pending */
saa7146_write(dev, MC2, 0xf8000000);
......
......@@ -4,9 +4,11 @@ config DVB_B2C2_SKYSTAR
select DVB_STV0299
select DVB_MT352
select DVB_MT312
select DVB_NXT2002
help
Support for the Skystar2 PCI DVB card by Technisat, which
is equipped with the FlexCopII chipset by B2C2.
is equipped with the FlexCopII chipset by B2C2, and
for the B2C2/BBTI Air2PC-ATSC card.
Say Y if you own such a device and want to use it.
......@@ -17,7 +19,7 @@ config DVB_B2C2_USB
select DVB_MT352
help
Support for the Air/Sky/Cable2PC USB DVB device by B2C2. Currently
this does nothing, but providing basic function for the used usb
the does nothing, but providing basic function for the used usb
protocol.
Say Y if you own such a device and want to use it.
......
......@@ -33,7 +33,7 @@
}
static int debug;
module_param(debug, int, 0x644);
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2,ctrl=4 (or-able)).");
#define deb_info(args...) dprintk(0x01,args)
......@@ -89,8 +89,18 @@ struct usb_b2c2_usb {
/* request types */
typedef enum {
/* something is wrong with this part
RTYPE_READ_DW = (1 << 6),
RTYPE_WRITE_DW_1 = (3 << 6),
RTYPE_READ_V8_MEMORY = (6 << 6),
RTYPE_WRITE_V8_MEMORY = (7 << 6),
RTYPE_WRITE_V8_FLASH = (8 << 6),
RTYPE_GENERIC = (9 << 6),
*/
RTYPE_READ_DW = (3 << 6),
RTYPE_WRITE_DW_1 = (1 << 6),
RTYPE_READ_V8_MEMORY = (6 << 6),
RTYPE_WRITE_V8_MEMORY = (7 << 6),
RTYPE_WRITE_V8_FLASH = (8 << 6),
......@@ -391,9 +401,9 @@ static int b2c2_init_usb(struct usb_b2c2_usb *b2c2)
}
/* initialising and submitting iso urbs */
for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) {
deb_info("initializing and submitting urb no. %d (buf_offset: %d).\n",i,buffer_offset);
int frame_offset = 0;
struct urb *urb = b2c2->iso_urb[i];
deb_info("initializing and submitting urb no. %d (buf_offset: %d).\n",i,buffer_offset);
urb->dev = b2c2->udev;
urb->context = b2c2;
......
This diff is collapsed.
......@@ -3,6 +3,8 @@ config DVB_BT8XX
depends on DVB_CORE && PCI && VIDEO_BT848
select DVB_MT352
select DVB_SP887X
select DVB_NXT6000
select DVB_CX24110
help
Support for PCI cards based on the Bt8xx PCI bridge. Examples are
the Nebula cards, the Pinnacle PCTV cards and Twinhan DST cards.
......@@ -11,8 +13,5 @@ config DVB_BT8XX
only compressed MPEG data over the PCI bus, so you need
an external software decoder to watch TV on your computer.
If you have a Twinhan card, don't forget to select
"Twinhan DST based DVB-S/-T frontend".
Say Y if you own such a device and want to use it.
......@@ -181,6 +181,70 @@ static struct mt352_config thomson_dtt7579_config = {
.pll_set = thomson_dtt7579_pll_set,
};
static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
u32 freq = params->frequency;
int i, a, n, pump;
u32 band, pll;
u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000,
1576000,1718000,1856000,2036000,2150000};
u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000,
0x00102000,0x00104000,0x00108000,0x00110000,
0x00120000,0x00140000};
#define XTAL 1011100 /* Hz, really 1.0111 MHz and a /10 prescaler */
printk("cx24108 debug: entering SetTunerFreq, freq=%d\n",freq);
/* This is really the bit driving the tuner chip cx24108 */
if(freq<950000) freq=950000; /* kHz */
if(freq>2150000) freq=2150000; /* satellite IF is 950..2150MHz */
/* decide which VCO to use for the input frequency */
for(i=1;(i<sizeof(osci)/sizeof(osci[0]))&&(osci[i]<freq);i++);
printk("cx24108 debug: select vco #%d (f=%d)\n",i,freq);
band=bandsel[i];
/* the gain values must be set by SetSymbolrate */
/* compute the pll divider needed, from Conexant data sheet,
resolved for (n*32+a), remember f(vco) is f(receive) *2 or *4,
depending on the divider bit. It is set to /4 on the 2 lowest
bands */
n=((i<=2?2:1)*freq*10L)/(XTAL/100);
a=n%32; n/=32; if(a==0) n--;
pump=(freq<(osci[i-1]+osci[i])/2);
pll=0xf8000000|
((pump?1:2)<<(14+11))|
((n&0x1ff)<<(5+11))|
((a&0x1f)<<11);
/* everything is shifted left 11 bits to left-align the bits in the
32bit word. Output to the tuner goes MSB-aligned, after all */
printk("cx24108 debug: pump=%d, n=%d, a=%d\n",pump,n,a);
cx24110_pll_write(fe,band);
/* set vga and vca to their widest-band settings, as a precaution.
SetSymbolrate might not be called to set this up */
cx24110_pll_write(fe,0x500c0000);
cx24110_pll_write(fe,0x83f1f800);
cx24110_pll_write(fe,pll);
/* writereg(client,0x56,0x7f);*/
return 0;
}
static int pinnsat_pll_init(struct dvb_frontend* fe)
{
return 0;
}
static struct cx24110_config pctvsat_config = {
.demod_address = 0x55,
.pll_init = pinnsat_pll_init,
.pll_set = cx24108_pll_set,
};
static int microtune_mt7202dtf_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
......@@ -220,7 +284,7 @@ static int microtune_mt7202dtf_request_firmware(struct dvb_frontend* fe, const s
return request_firmware(fw, name, &bt->bt->dev->dev);
}
struct sp887x_config microtune_mt7202dtf_config = {
static struct sp887x_config microtune_mt7202dtf_config = {
.demod_address = 0x70,
.pll_set = microtune_mt7202dtf_pll_set,
......@@ -387,6 +451,13 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
break;
}
break;
case BTTV_PINNACLESAT:
card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter);
if (card->fe != NULL) {
break;
}
break;
}
if (card->fe == NULL) {
......@@ -510,7 +581,14 @@ static int dvb_bt8xx_probe(struct device *dev)
switch(sub->core->type)
{
/* case BTTV_PINNACLESAT: UNDEFINED HARDWARE */
case BTTV_PINNACLESAT:
card->gpio_mode = 0x0400c060;
/* should be: BT878_A_GAIN=0,BT878_A_PWRDN,BT878_DA_DPM,BT878_DA_SBR,
BT878_DA_IOM=1,BT878_DA_APP to enable serial highspeed mode. */
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
break;
#ifdef BTTV_DVICO_DVBT_LITE
case BTTV_DVICO_DVBT_LITE:
#endif
......
......@@ -22,6 +22,9 @@
*
*/
#ifndef DVB_BT8XX_H
#define DVB_BT8XX_H
#include <linux/i2c.h>
#include "dvbdev.h"
#include "dvb_net.h"
......@@ -30,6 +33,7 @@
#include "sp887x.h"
#include "dst.h"
#include "nxt6000.h"
#include "cx24110.h"
struct dvb_bt8xx_card {
struct semaphore lock;
......@@ -50,3 +54,5 @@ struct dvb_bt8xx_card {
struct dvb_frontend* fe;
};
#endif /* DVB_BT8XX_H */
config DVB_DIBUSB
tristate "DiBcom USB DVB-T devices (see help for device list)"
tristate "DiBcom USB DVB-T devices (see help for a complete device list)"
depends on DVB_CORE && USB
select FW_LOADER
select DVB_DIB3000MB
select DVB_DIB3000MC
select DVB_MT352
help
Support for USB 1.1 and 2.0 DVB-T devices based on reference designs made by
DiBcom (<http://www.dibcom.fr>).
DiBcom (http://www.dibcom.fr) and C&E.
Devices supported by this driver:
......@@ -14,12 +15,14 @@ config DVB_DIBUSB
TwinhanDTV Magic Box (VP7041e)
KWorld V-Stream XPERT DTV - DVB-T USB
Hama DVB-T USB-Box
DiBcom reference device (non-public)
DiBcom reference devices (non-public)
Ultima Electronic/Artec T1 USB TVBOX
Compro Videomate DVB-U2000 - DVB-T USB
Grandtec DVB-T USB
Avermedia AverTV DVBT USB
Yakumo DVB-T mobile USB2.0
Artec T1 USB1.1 and USB2.0 boxes
Yakumo/Typhoon DVB-T USB2.0
Hanftek UMT-010 USB2.0
The VP7041 seems to be identical to "CTS Portable" (Chinese
Television System).
......@@ -27,7 +30,7 @@ config DVB_DIBUSB
These devices can be understood as budget ones, they "only" deliver
(a part of) the MPEG2 transport stream.
A firmware is needed to get the device working. See <file:Documentation/dvb/README.dibusb>
A firmware is needed to get the device working. See Documentation/dvb/README.dibusb
details.
Say Y if you own such a device and want to use it. You should build it as
......@@ -46,6 +49,7 @@ config DVB_DIBUSB_MISDESIGNED_DEVICES
0x0574:0x2235 (Artec T1 USB1.1, cold)
0x04b4:0x8613 (Artec T1 USB2.0, cold)
0x0574:0x1002 (Artec T1 USB2.0, warm)
0x0574:0x2131 (aged DiBcom USB1.1 test device)
Say Y if your device has one of the mentioned IDs.
......
dvb-dibusb-objs = dvb-dibusb-core.o \
dvb-dibusb-dvb.o \
dvb-dibusb-fe-i2c.o \
dvb-dibusb-firmware.o \
dvb-dibusb-remote.o \
dvb-dibusb-usb.o \
dvb-dibusb-pid.o
obj-$(CONFIG_DVB_DIBUSB) += dvb-dibusb.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
This diff is collapsed.
/*
* dvb-dibusb-dvb.c is part of the driver for mobile USB Budget DVB-T devices
* based on reference design made by DiBcom (http://www.dibcom.fr/)
*
* Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
*
* see dvb-dibusb-core.c for more copyright details.
*
* This file contains functions for initializing and handling the
* linux-dvb API.
*/
#include "dvb-dibusb.h"
#include <linux/usb.h>
#include <linux/version.h>
static u32 urb_compl_count;
/*
* MPEG2 TS DVB stuff
*/
void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs)
{
struct usb_dibusb *dib = urb->context;
int ret;
deb_ts("urb complete feedcount: %d, status: %d, length: %d\n",dib->feedcount,urb->status,
urb->actual_length);
urb_compl_count++;
if (urb_compl_count % 500 == 0)
deb_info("%d urbs completed so far.\n",urb_compl_count);
switch (urb->status) {
case 0: /* success */
case -ETIMEDOUT: /* NAK */
break;
case -ECONNRESET: /* unlink */
case -ENOENT:
case -ESHUTDOWN:
return;
default: /* error */
warn("urb completition error %d.", urb->status);
}
if (dib->feedcount > 0) {
deb_ts("URB return len: %d\n",urb->actual_length);
if (urb->actual_length % 188)
deb_ts("TS Packets: %d, %d\n", urb->actual_length/188,urb->actual_length % 188);
/* Francois recommends to drop not full-filled packets, even if they may
* contain valid TS packets, at least for USB1.1
*
* if (urb->actual_length == dib->dibdev->parm->default_size && dib->dvb_is_ready) */
if (dib->init_state & DIBUSB_STATE_DVB)
dvb_dmx_swfilter(&dib->demux, (u8*) urb->transfer_buffer,urb->actual_length);
else
deb_ts("URB dropped because of the "
"actual_length or !dvb_is_ready (%d).\n",dib->init_state & DIBUSB_STATE_DVB);
} else
deb_ts("URB dropped because of feedcount.\n");
ret = usb_submit_urb(urb,GFP_ATOMIC);
deb_ts("urb resubmitted, (%d)\n",ret);
}
static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
{
struct usb_dibusb *dib = dvbdmxfeed->demux->priv;
int newfeedcount;
if (dib == NULL)
return -ENODEV;
newfeedcount = dib->feedcount + (onoff ? 1 : -1);
/*
* stop feed before setting a new pid if there will be no pid anymore
*/
// if ((dib->dibdev->parm->firmware_bug && dib->feedcount) ||
if (newfeedcount == 0) {
deb_ts("stop feeding\n");
if (dib->xfer_ops.fifo_ctrl != NULL) {
if (dib->xfer_ops.fifo_ctrl(dib->fe,0)) {
err("error while inhibiting fifo.");
return -ENODEV;
}
}
}
dib->feedcount = newfeedcount;
/* get a free pid from the list and activate it on the device
* specific pid_filter
*/
if (dib->pid_parse)
dibusb_ctrl_pid(dib,dvbdmxfeed,onoff);
/*
* start the feed, either if there is the firmware bug or
* if this was the first pid to set and there is still a pid for
* reception.
*/
// if ((dib->dibdev->parm->firmware_bug)
if (dib->feedcount == onoff && dib->feedcount > 0) {
deb_ts("controlling pid parser\n");
if (dib->xfer_ops.pid_parse != NULL) {
if (dib->xfer_ops.pid_parse(dib->fe,dib->pid_parse) < 0) {
err("could not handle pid_parser");
}
}
deb_ts("start feeding\n");
if (dib->xfer_ops.fifo_ctrl != NULL) {
if (dib->xfer_ops.fifo_ctrl(dib->fe,1)) {
err("error while enabling fifo.");
return -ENODEV;
}
}
dibusb_streaming(dib,1);
}
return 0;
}
static int dibusb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
deb_ts("start pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid,dvbdmxfeed->type);
return dibusb_ctrl_feed(dvbdmxfeed,1);
}
static int dibusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{
deb_ts("stop pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid, dvbdmxfeed->type);
return dibusb_ctrl_feed(dvbdmxfeed,0);
}
int dibusb_dvb_init(struct usb_dibusb *dib)
{
int ret;
urb_compl_count = 0;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,4)
if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC)) < 0) {
#else
if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC ,
THIS_MODULE)) < 0) {
#endif
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
}
dib->adapter->priv = dib;
/* i2c is done in dibusb_i2c_init */
dib->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING;
dib->demux.priv = (void *)dib;
/* get pidcount from demod */
dib->demux.feednum = dib->demux.filternum = 255;
dib->demux.start_feed = dibusb_start_feed;
dib->demux.stop_feed = dibusb_stop_feed;
dib->demux.write_to_decoder = NULL;
if ((ret = dvb_dmx_init(&dib->demux)) < 0) {
err("dvb_dmx_init failed: error %d",ret);
goto err_dmx;
}
dib->dmxdev.filternum = dib->demux.filternum;
dib->dmxdev.demux = &dib->demux.dmx;
dib->dmxdev.capabilities = 0;
if ((ret = dvb_dmxdev_init(&dib->dmxdev, dib->adapter)) < 0) {
err("dvb_dmxdev_init failed: error %d",ret);
goto err_dmx_dev;
}
dvb_net_init(dib->adapter, &dib->dvb_net, &dib->demux.dmx);
goto success;
err_dmx_dev:
dvb_dmx_release(&dib->demux);
err_dmx:
dvb_unregister_adapter(dib->adapter);
err:
return ret;
success:
dib->init_state |= DIBUSB_STATE_DVB;
return 0;
}
int dibusb_dvb_exit(struct usb_dibusb *dib)
{
if (dib->init_state & DIBUSB_STATE_DVB) {
dib->init_state &= ~DIBUSB_STATE_DVB;
deb_info("unregistering DVB part\n");
dvb_net_release(&dib->dvb_net);
dib->demux.dmx.close(&dib->demux.dmx);
dvb_dmxdev_release(&dib->dmxdev);
dvb_dmx_release(&dib->demux);
dvb_unregister_adapter(dib->adapter);
}
return 0;
}
This diff is collapsed.
/*
* dvb-dibusb-firmware.c is part of the driver for mobile USB Budget DVB-T devices
* based on reference design made by DiBcom (http://www.dibcom.fr/)
*
* Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
*
* see dvb-dibusb-core.c for more copyright details.
*
* This file contains functions for downloading the firmware to the device.
*/
#include "dvb-dibusb.h"
#include <linux/firmware.h>
#include <linux/usb.h>
/*
* load a firmware packet to the device
*/
static int dibusb_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len)
{
return usb_control_msg(udev, usb_sndctrlpipe(udev,0),
0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5*HZ);
}
int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibdev)
{
const struct firmware *fw = NULL;
u16 addr;
u8 *b,*p;
int ret = 0,i;
if ((ret = request_firmware(&fw, dibdev->dev_cl->firmware, &udev->dev)) != 0) {
err("did not find a valid firmware file. (%s) "
"Please see linux/Documentation/dvb/ for more details on firmware-problems.",
dibdev->dev_cl->firmware);
return ret;
}
p = kmalloc(fw->size,GFP_KERNEL);
if (p != NULL) {
u8 reset;
/*
* you cannot use the fw->data as buffer for
* usb_control_msg, a new buffer has to be
* created
*/
memcpy(p,fw->data,fw->size);
/* stop the CPU */
reset = 1;
if ((ret = dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1)) != 1)
err("could not stop the USB controller CPU.");
for(i = 0; p[i+3] == 0 && i < fw->size; ) {
b = (u8 *) &p[i];
addr = *((u16 *) &b[1]);
ret = dibusb_writemem(udev,addr,&b[4],b[0]);
if (ret != b[0]) {
err("error while transferring firmware "
"(transferred size: %d, block size: %d)",
ret,b[0]);
ret = -EINVAL;
break;
}
i += 5 + b[0];
}
/* length in ret */
if (ret > 0)
ret = 0;
/* restart the CPU */
reset = 0;
if (ret || dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1) != 1) {
err("could not restart the USB controller CPU.");
ret = -EINVAL;
}
kfree(p);
} else {
ret = -ENOMEM;
}
release_firmware(fw);
return ret;
}
/*
* dvb-dibusb-pid.c is part of the driver for mobile USB Budget DVB-T devices
* based on reference design made by DiBcom (http://www.dibcom.fr/)
*
* Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
*
* see dvb-dibusb-core.c for more copyright details.
*
* This file contains functions for initializing and handling the internal
* pid-list. This pid-list mirrors the information currently stored in the
* devices pid-list.
*/
#include "dvb-dibusb.h"
int dibusb_pid_list_init(struct usb_dibusb *dib)
{
int i;
dib->pid_list = kmalloc(sizeof(struct dibusb_pid) * dib->dibdev->dev_cl->demod->pid_filter_count,GFP_KERNEL);
if (dib->pid_list == NULL)
return -ENOMEM;
deb_xfer("initializing %d pids for the pid_list.\n",dib->dibdev->dev_cl->demod->pid_filter_count);
dib->pid_list_lock = SPIN_LOCK_UNLOCKED;
memset(dib->pid_list,0,dib->dibdev->dev_cl->demod->pid_filter_count*(sizeof(struct dibusb_pid)));
for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) {
dib->pid_list[i].index = i;
dib->pid_list[i].pid = 0;
dib->pid_list[i].active = 0;
}
dib->init_state |= DIBUSB_STATE_PIDLIST;
return 0;
}
void dibusb_pid_list_exit(struct usb_dibusb *dib)
{
if (dib->init_state & DIBUSB_STATE_PIDLIST)
kfree(dib->pid_list);
dib->init_state &= ~DIBUSB_STATE_PIDLIST;
}
/* fetch a pid from pid_list and set it on or off */
int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff)
{
int i,ret = -1;
unsigned long flags;
u16 pid = dvbdmxfeed->pid;
if (onoff) {
spin_lock_irqsave(&dib->pid_list_lock,flags);
for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++)
if (!dib->pid_list[i].active) {
dib->pid_list[i].pid = pid;
dib->pid_list[i].active = 1;
ret = i;
break;
}
dvbdmxfeed->priv = &dib->pid_list[ret];
spin_unlock_irqrestore(&dib->pid_list_lock,flags);
if (dib->xfer_ops.pid_ctrl != NULL)
dib->xfer_ops.pid_ctrl(dib->fe,dib->pid_list[ret].index,dib->pid_list[ret].pid,1);
} else {
struct dibusb_pid *dpid = dvbdmxfeed->priv;
if (dib->xfer_ops.pid_ctrl != NULL)
dib->xfer_ops.pid_ctrl(dib->fe,dpid->index,0,0);
dpid->pid = 0;
dpid->active = 0;
ret = dpid->index;
}
/* a free pid from the list */
deb_info("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off");
return ret;
}
/*
* dvb-dibusb-remote.c is part of the driver for mobile USB Budget DVB-T devices
* based on reference design made by DiBcom (http://www.dibcom.fr/)
*
* Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
*
* see dvb-dibusb-core.c for more copyright details.
*
* This file contains functions for handling the event device on the software
* side and the remote control on the hardware side.
*/
#include "dvb-dibusb.h"
/* Table to map raw key codes to key events. This should not be hard-wired
into the kernel. */
static const struct { u8 c0, c1, c2; uint32_t key; } rc_keys [] =
{
/* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */
{ 0x00, 0xff, 0x16, KEY_POWER },
{ 0x00, 0xff, 0x10, KEY_MUTE },
{ 0x00, 0xff, 0x03, KEY_1 },
{ 0x00, 0xff, 0x01, KEY_2 },
{ 0x00, 0xff, 0x06, KEY_3 },
{ 0x00, 0xff, 0x09, KEY_4 },
{ 0x00, 0xff, 0x1d, KEY_5 },
{ 0x00, 0xff, 0x1f, KEY_6 },
{ 0x00, 0xff, 0x0d, KEY_7 },
{ 0x00, 0xff, 0x19, KEY_8 },
{ 0x00, 0xff, 0x1b, KEY_9 },
{ 0x00, 0xff, 0x15, KEY_0 },
{ 0x00, 0xff, 0x05, KEY_CHANNELUP },
{ 0x00, 0xff, 0x02, KEY_CHANNELDOWN },
{ 0x00, 0xff, 0x1e, KEY_VOLUMEUP },
{ 0x00, 0xff, 0x0a, KEY_VOLUMEDOWN },
{ 0x00, 0xff, 0x11, KEY_RECORD },
{ 0x00, 0xff, 0x17, KEY_FAVORITES }, /* Heart symbol - Channel list. */
{ 0x00, 0xff, 0x14, KEY_PLAY },
{ 0x00, 0xff, 0x1a, KEY_STOP },
{ 0x00, 0xff, 0x40, KEY_REWIND },
{ 0x00, 0xff, 0x12, KEY_FASTFORWARD },
{ 0x00, 0xff, 0x0e, KEY_PREVIOUS }, /* Recall - Previous channel. */
{ 0x00, 0xff, 0x4c, KEY_PAUSE },
{ 0x00, 0xff, 0x4d, KEY_SCREEN }, /* Full screen mode. */
{ 0x00, 0xff, 0x54, KEY_AUDIO }, /* MTS - Switch to secondary audio. */
/* additional keys TwinHan VisionPlus, the Artec seemingly not have */
{ 0x00, 0xff, 0x0c, KEY_CANCEL }, /* Cancel */
{ 0x00, 0xff, 0x1c, KEY_EPG }, /* EPG */
{ 0x00, 0xff, 0x00, KEY_TAB }, /* Tab */
{ 0x00, 0xff, 0x48, KEY_INFO }, /* Preview */
{ 0x00, 0xff, 0x04, KEY_LIST }, /* RecordList */
{ 0x00, 0xff, 0x0f, KEY_TEXT }, /* Teletext */
/* Key codes for the KWorld/ADSTech/JetWay remote. */
{ 0x86, 0x6b, 0x12, KEY_POWER },
{ 0x86, 0x6b, 0x0f, KEY_SELECT }, /* source */
{ 0x86, 0x6b, 0x0c, KEY_UNKNOWN }, /* scan */
{ 0x86, 0x6b, 0x0b, KEY_EPG },
{ 0x86, 0x6b, 0x10, KEY_MUTE },
{ 0x86, 0x6b, 0x01, KEY_1 },
{ 0x86, 0x6b, 0x02, KEY_2 },
{ 0x86, 0x6b, 0x03, KEY_3 },
{ 0x86, 0x6b, 0x04, KEY_4 },
{ 0x86, 0x6b, 0x05, KEY_5 },
{ 0x86, 0x6b, 0x06, KEY_6 },
{ 0x86, 0x6b, 0x07, KEY_7 },
{ 0x86, 0x6b, 0x08, KEY_8 },
{ 0x86, 0x6b, 0x09, KEY_9 },
{ 0x86, 0x6b, 0x0a, KEY_0 },
{ 0x86, 0x6b, 0x18, KEY_ZOOM },
{ 0x86, 0x6b, 0x1c, KEY_UNKNOWN }, /* preview */
{ 0x86, 0x6b, 0x13, KEY_UNKNOWN }, /* snap */
{ 0x86, 0x6b, 0x00, KEY_UNDO },
{ 0x86, 0x6b, 0x1d, KEY_RECORD },
{ 0x86, 0x6b, 0x0d, KEY_STOP },
{ 0x86, 0x6b, 0x0e, KEY_PAUSE },
{ 0x86, 0x6b, 0x16, KEY_PLAY },
{ 0x86, 0x6b, 0x11, KEY_BACK },
{ 0x86, 0x6b, 0x19, KEY_FORWARD },
{ 0x86, 0x6b, 0x14, KEY_UNKNOWN }, /* pip */
{ 0x86, 0x6b, 0x15, KEY_ESC },
{ 0x86, 0x6b, 0x1a, KEY_UP },
{ 0x86, 0x6b, 0x1e, KEY_DOWN },
{ 0x86, 0x6b, 0x1f, KEY_LEFT },
{ 0x86, 0x6b, 0x1b, KEY_RIGHT },
};
/*
* Read the remote control and feed the appropriate event.
* NEC protocol is used for remote controls
*/
static int dibusb_read_remote_control(struct usb_dibusb *dib)
{
u8 b[1] = { DIBUSB_REQ_POLL_REMOTE }, rb[5];
int ret;
int i;
if ((ret = dibusb_readwrite_usb(dib,b,1,rb,5)))
return ret;
switch (rb[0]) {
case DIBUSB_RC_NEC_KEY_PRESSED:
/* rb[1-3] is the actual key, rb[4] is a checksum */
deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
rb[1], rb[2], rb[3], rb[4]);
if ((0xff - rb[3]) != rb[4]) {
deb_rc("remote control checksum failed.\n");
break;
}
/* See if we can match the raw key code. */
for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++) {
if (rc_keys[i].c0 == rb[1] &&
rc_keys[i].c1 == rb[2] &&
rc_keys[i].c2 == rb[3]) {
dib->rc_input_event = rc_keys[i].key;
deb_rc("Translated key 0x%04x\n", dib->rc_input_event);
/* Signal down and up events for this key. */
input_report_key(&dib->rc_input_dev, dib->rc_input_event, 1);
input_report_key(&dib->rc_input_dev, dib->rc_input_event, 0);
input_sync(&dib->rc_input_dev);
break;
}
}
break;
case DIBUSB_RC_NEC_EMPTY: /* No (more) remote control keys. */
break;
case DIBUSB_RC_NEC_KEY_REPEATED:
/* rb[1]..rb[4] are always zero.*/
/* Repeats often seem to occur so for the moment just ignore this. */
deb_rc("Key repeat\n");
break;
default:
break;
}
return 0;
}
/* Remote-control poll function - called every dib->rc_query_interval ms to see
whether the remote control has received anything. */
static void dibusb_remote_query(void *data)
{
struct usb_dibusb *dib = (struct usb_dibusb *) data;
/* TODO: need a lock here. We can simply skip checking for the remote control
if we're busy. */
dibusb_read_remote_control(dib);
schedule_delayed_work(&dib->rc_query_work,
msecs_to_jiffies(rc_query_interval));
}
int dibusb_remote_init(struct usb_dibusb *dib)
{
int i;
if (dib->dibdev->dev_cl->remote_type == DIBUSB_RC_NO)
return 0;
/* Initialise the remote-control structures.*/
init_input_dev(&dib->rc_input_dev);
dib->rc_input_dev.evbit[0] = BIT(EV_KEY);
dib->rc_input_dev.keycodesize = sizeof(unsigned char);
dib->rc_input_dev.keycodemax = KEY_MAX;
dib->rc_input_dev.name = DRIVER_DESC " remote control";
for (i=0; i<sizeof(rc_keys)/sizeof(rc_keys[0]); i++)
set_bit(rc_keys[i].key, dib->rc_input_dev.keybit);
input_register_device(&dib->rc_input_dev);
dib->rc_input_event = KEY_MAX;
INIT_WORK(&dib->rc_query_work, dibusb_remote_query, dib);
/* Start the remote-control polling. */
if (rc_query_interval < 40)
rc_query_interval = 100; /* default */
info("schedule remote query interval to %d msecs.",rc_query_interval);
schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(rc_query_interval));
dib->init_state |= DIBUSB_STATE_REMOTE;
return 0;
}
int dibusb_remote_exit(struct usb_dibusb *dib)
{
if (dib->dibdev->dev_cl->remote_type == DIBUSB_RC_NO)
return 0;
if (dib->init_state & DIBUSB_STATE_REMOTE) {
cancel_delayed_work(&dib->rc_query_work);
flush_scheduled_work();
input_unregister_device(&dib->rc_input_dev);
}
dib->init_state &= ~DIBUSB_STATE_REMOTE;
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -247,7 +247,22 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
}
/*
** Losless Section Demux 1.4 by Emard
** Losless Section Demux 1.4.1 by Emard
** Valsecchi Patrick:
** - middle of section A (no PUSI)
** - end of section A and start of section B
** (with PUSI pointing to the start of the second section)
**
** In this case, without feed->pusi_seen you'll receive a garbage section
** consisting of the end of section A. Basically because tsfeedp
** is incemented and the use=0 condition is not raised
** when the second packet arrives.
**
** Fix:
** when demux is started, let feed->pusi_seen = 0 to
** prevent initial feeding of garbage from the end of
** previous section. When you for the first time see PUSI=1
** then set feed->pusi_seen = 1
*/
static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const u8 *buf, u8 len)
{
......@@ -293,7 +308,12 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
sec->seclen = seclen;
sec->crc_val = ~0;
/* dump [secbuf .. secbuf+seclen) */
if(feed->pusi_seen)
dvb_dmx_swfilter_section_feed(feed);
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
else
printk("dvb_demux.c pusi not seen, discarding section data\n");
#endif
sec->secbufp += seclen; /* secbufp and secbuf moving together is */
sec->secbuf += seclen; /* redundand but saves pointer arithmetic */
}
......@@ -305,7 +325,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const
static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf)
{
u8 p, count;
int ccok;
int ccok, dc_i = 0;
u8 cc;
count = payload(buf);
......@@ -316,31 +336,41 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8
p = 188-count; /* payload start */
cc = buf[3] & 0x0f;
ccok = ((feed->cc+1) & 0x0f) == cc ? 1 : 0;
ccok = ((feed->cc + 1) & 0x0f) == cc;
feed->cc = cc;
if(ccok == 0)
{
if (buf[3] & 0x20) {
/* adaption field present, check for discontinuity_indicator */
if ((buf[4] > 0) && (buf[5] & 0x80))
dc_i = 1;
}
if (!ccok || dc_i) {
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
printk("dvb_demux.c discontinuity detected %d bytes lost\n", count);
/* those bytes under sume circumstances will again be reported
** in the following dvb_dmx_swfilter_section_new
*/
#endif
/* Discontinuity detected. Reset pusi_seen = 0 to
** stop feeding of suspicious data until next PUSI=1 arrives
*/
feed->pusi_seen = 0;
dvb_dmx_swfilter_section_new(feed);
return 0;
}
if(buf[1] & 0x40)
{
if (buf[1] & 0x40) {
// PUSI=1 (is set), section boundary is here
if(count > 1 && buf[p] < count)
{
if (count > 1 && buf[p] < count) {
const u8 *before = buf+p+1;
u8 before_len = buf[p];
const u8 *after = before+before_len;
u8 after_len = count-1-before_len;
dvb_dmx_swfilter_section_copy_dump(feed, before, before_len);
/* before start of new section, set pusi_seen = 1 */
feed->pusi_seen = 1;
dvb_dmx_swfilter_section_new(feed);
dvb_dmx_swfilter_section_copy_dump(feed, after, after_len);
}
......@@ -349,9 +379,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8
if(count > 0)
printk("dvb_demux.c PUSI=1 but %d bytes lost\n", count);
#endif
}
else
{
} else {
// PUSI=0 (is not set), no section boundary
const u8 *entire = buf+p;
u8 entire_len = count;
......@@ -784,10 +812,8 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, struct dmx_ts_feed *ts_
}
#ifndef NOBUFS
if (feed->buffer) {
vfree(feed->buffer);
feed->buffer=0;
}
#endif
feed->state = DMX_STATE_FREE;
......@@ -1055,10 +1081,8 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,
return -EINVAL;
}
#ifndef NOBUFS
if (dvbdmxfeed->buffer) {
vfree(dvbdmxfeed->buffer);
dvbdmxfeed->buffer=0;
}
#endif
dvbdmxfeed->state=DMX_STATE_FREE;
......@@ -1269,9 +1293,7 @@ int dvb_dmx_release(struct dvb_demux *dvbdemux)
struct dmx_demux *dmx = &dvbdemux->dmx;
dmx_unregister_demux(dmx);
if (dvbdemux->filter)
vfree(dvbdemux->filter);
if (dvbdemux->feed)
vfree(dvbdemux->feed);
return 0;
}
......
......@@ -93,6 +93,7 @@ struct dvb_demux_feed {
enum dmx_ts_pes pes_type;
int cc;
int pusi_seen; /* prevents feeding of garbage from previous section */
u16 peslen;
......
This diff is collapsed.
......@@ -115,28 +115,7 @@ struct dvb_frontend {
struct dvb_frontend_ops* ops;
struct dvb_adapter *dvb;
void* demodulator_priv;
struct dvb_device *dvbdev;
struct dvb_frontend_parameters parameters;
struct dvb_fe_events events;
struct semaphore sem;
struct list_head list_head;
wait_queue_head_t wait_queue;
pid_t thread_pid;
unsigned long release_jiffies;
int state;
int bending;
int lnb_drift;
int inversion;
int auto_step;
int auto_sub_step;
int started_auto_step;
int min_delay;
int max_drift;
int step_size;
int exit;
int wakeup;
fe_status_t status;
void* frontend_priv;
};
extern int dvb_register_frontend(struct dvb_adapter* dvb,
......
......@@ -123,7 +123,6 @@ static void hexdump( const unsigned char *buf, unsigned short len )
struct dvb_net_priv {
int in_use;
struct net_device_stats stats;
char name[6];
u16 pid;
struct dvb_net *host;
struct dmx_demux *demux;
......@@ -1165,12 +1164,17 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
if ((if_num = get_if(dvbnet)) < 0)
return -EINVAL;
net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb",
dvb_net_setup);
net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", dvb_net_setup);
if (!net)
return -ENOMEM;
sprintf(net->name, "dvb%d_%d", dvbnet->dvbdev->adapter->num, if_num);
if (dvbnet->dvbdev->id)
snprintf(net->name, IFNAMSIZ, "dvb%d%u%d",
dvbnet->dvbdev->adapter->num, dvbnet->dvbdev->id, if_num);
else
/* compatibility fix to keep dvb0_0 format */
snprintf(net->name, IFNAMSIZ, "dvb%d_%d",
dvbnet->dvbdev->adapter->num, if_num);
net->addr_len = 6;
memcpy(net->dev_addr, dvbnet->dvbdev->adapter->proposed_mac, 6);
......@@ -1196,6 +1200,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
free_netdev(net);
return result;
}
printk("dvb_net: created network interface %s\n", net->name);
return if_num;
}
......@@ -1214,6 +1219,7 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned int num)
dvb_net_stop(net);
flush_scheduled_work();
printk("dvb_net: removed network interface %s\n", net->name);
unregister_netdev(net);
dvbnet->state[num]=0;
dvbnet->device[num] = NULL;
......
......@@ -46,6 +46,7 @@ comment "DVB-T (terrestrial) frontends"
config DVB_SP8870
tristate "Spase sp8870 based"
depends on DVB_CORE
select FW_LOADER
help
A DVB-T tuner module. Say Y when you want to support this frontend.
......@@ -56,6 +57,7 @@ config DVB_SP8870
config DVB_SP887X
tristate "Spase sp887x based"
depends on DVB_CORE
select FW_LOADER
help
A DVB-T tuner module. Say Y when you want to support this frontend.
......@@ -84,6 +86,7 @@ config DVB_L64781
config DVB_TDA1004X
tristate "Philips TDA10045H/TDA10046H based"
depends on DVB_CORE
select FW_LOADER
help
A DVB-T tuner module. Say Y when you want to support this frontend.
......@@ -145,4 +148,13 @@ config DVB_STV0297
help
A DVB-C tuner module. Say Y when you want to support this frontend.
comment "ATSC (North American/Korean Terresterial DTV) frontends"
depends on DVB_CORE
config DVB_NXT2002
tristate "Nxt2002 based"
depends on DVB_CORE
help
An ATSC 8VSB tuner module. Say Y when you want to support this frontend.
endmenu
......@@ -24,3 +24,5 @@ obj-$(CONFIG_DVB_CX22702) += cx22702.o
obj-$(CONFIG_DVB_TDA80XX) += tda80xx.o
obj-$(CONFIG_DVB_TDA10021) += tda10021.o
obj-$(CONFIG_DVB_STV0297) += stv0297.o
obj-$(CONFIG_DVB_NXT2002) += nxt2002.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -54,5 +54,6 @@ extern struct dvb_frontend* mt352_attach(const struct mt352_config* config,
struct i2c_adapter* i2c);
extern int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen);
extern u8 mt352_read(struct dvb_frontend *fe, u8 reg);
#endif // MT352_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.
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