Commit 026ae787 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.30pre1

parent 2cc90c98
......@@ -1468,8 +1468,10 @@ S: Victoria 3163
S: Australia
N: Pauline Middelink
E: middelin@polyware.iaf.nl
E: middelin@polyware.nl
D: General low-level bug fixes, /proc fixes, identd support
D: Author of IP masquerading
D: Zoran ZR36120 Video For Linux driver
S: Boterkorfhoek 34
S: 7546 JA Enschede
S: Netherlands
......
......@@ -69,12 +69,12 @@ isdn/
- directory with info on the Linux ISDN support, and supported cards.
java.txt
- info on the in-kernel binary support for Java(tm)
joystick.txt
- info on using joystick devices (and driver) with Linux.
joystick-api.txt
- API specification for applications that will be using the joystick.
joystick-parport.txt
- info on how to hook joysticks/gamepads to the parallel port.
joystick.txt
- info on using joystick devices (and driver) with Linux.
kbuild/
- directory with info about the kernel build process
kernel-docs.txt
......@@ -127,8 +127,6 @@ pcwd-watchdog.txt
- info and sample code for using with the PC Watchdog reset card.
powerpc/
- directory with info on using Linux with the PowerPC.
proc.txt
- detailed info on Linux's /proc filesystem.
proc_usb_info.txt
- info on /proc/bus/usb direcory generated for USB devices
ramdisk.txt
......@@ -178,4 +176,3 @@ watchdog.txt
xterm-linux.xpm
- XPM image of penguin logo (see logo.txt) sitting on an xterm.
......@@ -12447,6 +12447,18 @@ CONFIG_VIDEO_BT848
whenever you want). If you want to compile it as a module, say M
here and read Documentation/modules.txt.
ZR36120/36125 Video for Linux
CONFIG_VIDEO_ZR36120
Support for ZR36120/ZR36125 based frame grabber/overlay boards.
This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV,
and Buster boards. Please read the material in
Documentation/video4linux/zr36120.txt for more information.
This driver is also available as a module called zr36120.o ( = code
which can be inserted in and removed from the running kernel
whenever you want). If you want to compile it as a module, say M
here and read Documentation/modules.txt.
SAA5249 Teletext processor
CONFIG_VIDEO_SAA5249
Support for I2C bus based teletext using the SAA5249 chip. At the
......
......@@ -18,6 +18,8 @@ ncpfs.txt
- info on Novell Netware(tm) filesystem using NCP protocol.
ntfs.txt
- info and mount options for the NTFS filesystem (Windows NT).
proc.txt
- info on Linux's /proc filesystem.
romfs.txt
- Description of the ROMFS filesystem.
smbfs.txt
......
......@@ -58,8 +58,6 @@ net-modules.txt
- info and "insmod" parameters for all network driver modules.
policy-routing.txt
- IP policy-based routing
ppp.txt
- info on what software you should use to run PPP.
pt.txt
- the Gracilis Packetwin AX.25 device driver
routing.txt
......
Audio driver for CM8338/CM8738 chips by Chen-Li Tien
HARDWARE SUPPORTED
================================================================================
C-Media CMI8338
C-Media CMI8738
On-board C-Media chips
WHAT'S NEW
================================================================================
1. Support modem interface for 8738. (select in kernel configuration)
2. Enable S/PDIF-in to S/PDIF-out (S/PDIF loop).
3. Enable 4 channels analog duplicate mode on 3 jack or 4 jack
configurateion.
Be aware: C-Media Electronics Inc. is basically an IC design house,
and whose development of software drivers is mainly for use by its OEM
customers in their products. C-Media Electronics Inc. itself does not
......@@ -27,6 +44,23 @@ Audio driver for CM8338/CM8738 chips by Chen-Li Tien
7. To install the driver, enter 'modprobe cmpci'.
Bugs:
DRIVER PARAMETERS
================================================================================
Some functions for the cm8738 can be configured in Kernel Configuration
or modules parameters. Set these parameters to 1 to enable.
spdif_loop: Enable S/PDIF loop, this route S/PDIF-in to S/PDIF-out
directly.
four_ch: Enable 4 channels mode, rear-out or line-in will output
the same as line-out.
rear_out: Enable this if you have independent rear-out jacket on
your sound card, otherwise line-in will be used as
rear-out.
modem: You will need to set this parameter if you want to use
the HSP modem. You need install the pctel.o, the modem
driver itself.
1. Real player cannot be run (the same as es1371).
(You will need to get the pctel driver (binary only) and the support for
this option from the CMI site. It is not included in the Linux kernel
proper as it is non-free).
Driver for Trust Computer Products Framegrabber, version 0.6.1
------ --- ----- -------- -------- ------------ ------- - - -
- ZORAN ------------------------------------------------------
Author: Pauline Middelink <middelin@polyware.nl>
Date: 18 September 1999
Version: 0.6.1
- Description ------------------------------------------------
Video4Linux compatible driver for an unknown brand framegrabber
(Sold in the Netherlands by TRUST Computer Products) and various
other zoran zr36120 based framegrabbers.
The card contains a ZR36120 Multimedia PCI Interface and a Philips
SAA7110 Onechip Frontend videodecoder. There is also an DSP of
which I have forgotten the number, since i will never get that thing
to work without specs from the vendor itself.
The SAA711x are capable of processing 6 different video inputs,
CVBS1..6 and Y1+C1, Y2+C2, Y3+C3. All in 50/60Hz, NTSC, PAL or
SECAM and delivering a YUV datastream. On my card the input
'CVBS-0' corresponds to channel CVBS2 and 'S-Video' to Y2+C2.
I have some reports of other cards working with the mentioned
chip sets. For a list of other working cards please have a look
at the cards named in the tvcards struct in the beginning of
zr36120.c
After some testing, I discovered that the carddesigner messed up
on the I2C interface. The Zoran chip includes 2 lines SDA and SCL
which (s)he connected reversely. So we have to clock on the SDA
and r/w data on the SCL pin. Life is fun... Each cardtype now has
a bit which signifies if you have a card with the same deficiancy.
Oh, for the completness of this story I must mention that my
card delivers the VSYNC pulse of the SAA chip to GIRQ1, not
GIRQ0 as some other cards have. This is also incorperated in
the driver be clearing/setting the 'useirq1' bit in the tvcard
description.
Another problems of contingious capturing data with a Zoran chip
is something nasty inside the chip. It effectively halves the
fps we ought to get... Here is the scenario: capturing frames
to memory is done in the so-called snapshot mode. In this mode
the Zoran stops after capturing a frame worth of data and wait
till the application set GRAB bit to indicate readyness for the
next frame. After detecting a set bit, the chip neetly waits
till the start of a frame, captures it and it goes back to off.
Smart ppl will notice the problem here. Its the waiting on the
_next_ frame each time we set the GRAB bit... Oh well, 12,5 fps
is still plenty fast for me.
-- update 28/7/1999 --
Don't believe a word I just said... Proof is the output
of `streamer -t 300 -r 25 -f avi15 -o /dev/null`
++--+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25
+-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+-
syncer: done
writer: done
(note the /dev/null is prudent here, my system is not able to
grab /and/ write 25 fps to a file... gifts welcome :) )
The technical reasoning follows: The zoran completed the last
frame, the VSYNC goes low, and GRAB is cleared. The interrupt
routine starts to work since its VSYNC driven, and again
activates the GRAB bit. A few ms later the VSYNC (re-)rises and
the zoran starts to work on a new and freshly broadcasted frame....
For pointers I used the specs of both chips. Below are the URLs:
http://www.zoran.com/ftp/download/devices/pci/ZR36120/36120data.pdf
http://www-us.semiconductor.philips.com/acrobat/datasheets/SAA_7110_A_1.pdf
The documentation has very little on absolute numbers or timings
needed for the various modes/resolutions, but there are other
programs you can borrow those from.
------ Install --------------------------------------------
Read the file called TODO. Note its long list of limitations.
Build a kernel with VIDEO4LINUX enabled. Activate the
BT848 driver; we need this because we have need for the
other modules (i2c and videodev) it enables.
To install this software, extract it into a suitable directory.
Examine the makefile and change anything you don't like. Type "make".
After making the modules check if you have the much needed
/dev/video devices. If not, execute the following 4 lines:
mknod /dev/video c 81 0
mknod /dev/video1 c 81 1
mknod /dev/video2 c 81 2
mknod /dev/video3 c 81 3
mknod /dev/video4 c 81 4
After makeing/checking the devices do:
modprobe i2c
modprobe videodev
modprobe saa7110 (optional)
modprobe saa7111 (optional)
modprobe tuner (optional)
insmod zoran cardtype=<n>
<n> is the cardtype of the card you have. The cardnumber can
be found in the source of zr36120. Look for tvcards. If your
card is not there, please try if any other card gives some
response, and mail me if you got a working tvcard addition.
PS. <TVCard editors behold!)
Dont forget to set video_input to the number of inputs
you defined in the video_mux part of the tvcard definition.
Its a common error to add a channel but not incrementing
video_input and getting angry with me/v4l/linux/linus :(
You are now ready to test the framegrabber with your favorite
video4linux compatible tool
------ Application ----------------------------------------
This device works with all Video4Linux compatible applications,
given the limitations in the TODO file.
------ API ------------------------------------------------
This uses the V4L interface as of kernel release 2.1.116, and in
fact has not been tested on any lower version. There are a couple
of minor differences due to the fact that the amount of data returned
with each frame varies, and no doubt there are discrepancies due to my
misunderstanding of the API. I intend to convert this driver to the
new V4L2 API when it has stabilized more.
------ Current state --------------------------------------
The driver is capable of overlaying a video image in screen, and
even capable of grabbing frames. It uses the BIGPHYSAREA patch
to allocate lots of large memory blocks when tis patch is
found in the kernel, but it doesn't need it.
The consequence is that, when loading the driver as a module,
the module may tell you it's out of memory, but 'free' says
otherwise. The reason is simple; the modules wants its memory
contingious, not fragmented, and after a long uptime there
probably isn't a fragment of memory large enough...
The driver uses a double buffering scheme, which should realy
be an n-way buffer, depending on the size of allocated framebuffer
and the requested grab-size/format.
This current version also fixes a dead-lock situation during irq
time, which really, really froze my system... :)
Good luck.
Pauline
......@@ -1007,6 +1007,13 @@ W: http://qsl.net/dl1bke/
L: linux-hams@vger.rutgers.edu
S: Maintained
ZR36120 VIDEO FOR LINUX DRIVER
P: Pauline Middelink
M: middelin@polyware.nl
W: http://www.polyware.nl/~middelin/En/hobbies.html
W: http://www.polyware.nl/~middelin/hobbies.html
S: Maintained
THE REST
P: Linus Torvalds
S: Buried alive in reporters
VERSION = 2
PATCHLEVEL = 3
SUBLEVEL = 29
SUBLEVEL = 30
EXTRAVERSION =
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
......
......@@ -189,29 +189,26 @@ reserve_std_resources(void)
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
#define PFN_MAX PFN_DOWN(0x80000000)
#define for_each_mem_cluster(memdesc, cluster, i) \
for ((cluster) = (memdesc)->cluster, (i) = 0; \
(i) < (memdesc)->numclusters; (i)++, (cluster)++)
static void __init setup_memory(void)
{
struct memclust_struct * cluster;
struct memdesc_struct * memdesc;
unsigned long start_pfn, bootmap_size;
unsigned long start_pfn, bootmap_size, bootmap_pages, bootmap_start;
unsigned long start, end;
extern char _end[];
int i;
/* alloc the bootmem after the kernel */
start_pfn = PFN_UP(virt_to_phys(_end));
SRM_printf("_end %p\n", _end);
/* find free clusters, and init and free the bootmem accordingly */
memdesc = (struct memdesc_struct *) (hwrpb->mddt_offset + (unsigned long) hwrpb);
for (cluster = memdesc->cluster, i = memdesc->numclusters;
i > 0; i--, cluster++)
for_each_mem_cluster(memdesc, cluster, i)
{
unsigned long end;
printk("memcluster %d, usage %02lx, start %8lu, end %8lu\n",
printk("memcluster %d, usage %01lx, start %8lu, end %8lu\n",
i, cluster->usage, cluster->start_pfn,
cluster->numpages);
cluster->start_pfn + cluster->numpages);
/* Bit 0 is console/PALcode reserved. Bit 1 is
non-volatile memory -- we might want to mark
......@@ -226,38 +223,89 @@ static void __init setup_memory(void)
/* Enforce maximum of 2GB even if there is more. Blah. */
if (max_low_pfn > PFN_MAX)
max_low_pfn = PFN_MAX;
SRM_printf("max_low_pfn %d\n", max_low_pfn);
printk("max_low_pfn %ld\n", max_low_pfn);
/* allocate the bootmem array after the kernel and mark
the whole MM as reserved */
bootmap_size = init_bootmem(start_pfn, max_low_pfn);
/* find the end of the kernel memory */
start_pfn = PFN_UP(virt_to_phys(_end));
printk("_end %p, start_pfn %ld\n", _end, start_pfn);
for (cluster = memdesc->cluster, i = memdesc->numclusters;
i > 0; i--, cluster++)
{
unsigned long end, start;
bootmap_start = -1;
/* Bit 0 is console/PALcode reserved. Bit 1 is
non-volatile memory -- we might want to mark
this for later */
try_again:
if (max_low_pfn <= start_pfn)
panic("not enough memory to boot");
/* we need to know how many physically contigous pages
we'll need for the bootmap */
bootmap_pages = bootmem_bootmap_pages(max_low_pfn);
printk("bootmap size: %ld pages\n", bootmap_pages);
/* now find a good region where to allocate the bootmap */
for_each_mem_cluster(memdesc, cluster, i)
{
if (cluster->usage & 3)
continue;
start = PFN_PHYS(cluster->start_pfn);
if (start < PFN_PHYS(start_pfn) + bootmap_size)
start = PFN_PHYS(start_pfn) + bootmap_size;
if (PFN_DOWN(start) >= PFN_MAX)
start = cluster->start_pfn;
end = start + cluster->numpages;
if (end <= start_pfn)
continue;
if (start >= max_low_pfn)
continue;
if (start < start_pfn)
start = start_pfn;
if (end > max_low_pfn)
end = max_low_pfn;
if (end - start >= bootmap_pages)
{
printk("allocating bootmap in area %ld:%ld\n",
start, start+bootmap_pages);
bootmap_start = start;
break;
}
}
if (bootmap_start == -1)
{
max_low_pfn >>= 1;
printk("bootmap area not found now trying with %ld pages\n",
max_low_pfn);
goto try_again;
}
/* allocate the bootmap and mark the whole MM as reserved */
bootmap_size = init_bootmem(bootmap_start, max_low_pfn);
/* mark the free regions */
for_each_mem_cluster(memdesc, cluster, i)
{
if (cluster->usage & 3)
continue;
end = PFN_PHYS(cluster->start_pfn + cluster->numpages);
if (PFN_DOWN(end) > PFN_MAX)
end = PFN_PHYS(PFN_MAX);
start = cluster->start_pfn;
if (start < start_pfn)
start = start_pfn;
end = cluster->start_pfn + cluster->numpages;
if (end > max_low_pfn)
end = max_low_pfn;
if (start >= end)
continue;
free_bootmem(start, end-start);
start = PFN_PHYS(start);
end = PFN_PHYS(end);
free_bootmem(start, end - start);
printk("freeing pages %ld:%ld\n",
PFN_UP(start), PFN_DOWN(end));
}
/* reserve the bootmap memory */
reserve_bootmem(PFN_PHYS(bootmap_start), bootmap_size);
printk("reserving bootmap %ld:%ld\n", bootmap_start,
bootmap_start + PFN_UP(bootmap_size));
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = INITRD_START;
if (initrd_start) {
......@@ -355,10 +403,6 @@ setup_arch(char **cmdline_p)
alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0;
#endif
SRM_printf("Booting on %s%s%s using machine vector %s\n",
type_name, (*var_name ? " variation " : ""),
var_name, alpha_mv.vector_name);
printk("Booting "
#ifdef CONFIG_ALPHA_GENERIC
"GENERIC "
......
......@@ -212,7 +212,7 @@ void paging_init(void)
zones_size[ZONE_DMA] = high_pfn;
else
{
zones_size[0] = dma_pfn;
zones_size[ZONE_DMA] = dma_pfn;
zones_size[ZONE_NORMAL] = high_pfn - dma_pfn;
}
......@@ -278,7 +278,7 @@ mem_init(void)
{
max_mapnr = num_physpages = max_low_pfn;
totalram_pages += free_all_bootmem();
printk("Memory: %luk available\n", totalram_pages >> 10);
printk("Memory: %luk available\n", totalram_pages << (PAGE_SHIFT-10));
}
void
......
......@@ -940,7 +940,7 @@ void print_all_local_APICs (void)
print_local_APIC(NULL);
}
static void __init init_sym_mode(void)
static void __init enable_IO_APIC(void)
{
struct IO_APIC_reg_01 reg_01;
int i;
......@@ -976,31 +976,15 @@ static void __init init_sym_mode(void)
clear_IO_APIC();
}
static void clear_lapic_ints (void * dummy)
{
int maxlvt;
maxlvt = get_maxlvt();
apic_write_around(APIC_LVTT, 0x00010000);
apic_write_around(APIC_LVT0, 0x00010000);
apic_write_around(APIC_LVT1, 0x00010000);
if (maxlvt >= 3)
apic_write_around(APIC_LVTERR, 0x00010000);
if (maxlvt >= 4)
apic_write_around(APIC_LVTPC, 0x00010000);
}
/*
* Not an __init, needed by the reboot code
*/
void init_pic_mode(void)
void disable_IO_APIC(void)
{
/*
* Clear the IO-APIC and local APICs before rebooting:
* Clear the IO-APIC before rebooting:
*/
clear_IO_APIC();
smp_call_function(clear_lapic_ints, NULL, 1, 1);
clear_lapic_ints(NULL);
/*
* Put it back into PIC mode (has an effect only on
......@@ -1379,8 +1363,10 @@ static inline void check_timer(void)
}
printk(" failed.\n");
if (nmi_watchdog)
printk("timer doesnt work through the IO-APIC - cannot activate NMI Watchdog!\n");
if (nmi_watchdog) {
printk("timer doesnt work through the IO-APIC - disabling NMI Watchdog!\n");
nmi_watchdog = 0;
}
printk("...trying to set up timer as Virtual Wire IRQ...");
......@@ -1417,7 +1403,7 @@ static inline void check_timer(void)
void __init setup_IO_APIC(void)
{
init_sym_mode();
enable_IO_APIC();
printk("ENABLING IO-APIC IRQs\n");
io_apic_irqs = ~PIC_IRQS;
......
......@@ -263,7 +263,7 @@ static inline void wait_on_bh(void)
* i thought that such things are guaranteed by design, since we use
* the 'LOCK' prefix.
*/
#define SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 1
#define SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND 0
#if SUSPECTED_CPU_OR_CHIPSET_BUG_WORKAROUND
# define SYNC_OTHER_CORES(x) udelay(x+1)
......
......@@ -204,9 +204,11 @@ void machine_restart(char * __unused)
{
#if __SMP__
/*
* turn off the IO-APIC, so we can do a clean reboot
* Stop all CPUs and turn off local APICs and the IO-APIC, so
* other OSs see a clean IRQ state.
*/
init_pic_mode();
smp_send_stop();
disable_IO_APIC();
#endif
if(!reboot_thru_bios) {
......
......@@ -439,9 +439,6 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
if (down_trylock(&lock))
return -EBUSY;
if (call_data) // temporary debugging check
BUG();
call_data = &data;
data.func = func;
data.info = info;
......@@ -478,7 +475,8 @@ static void stop_this_cpu (void * dummy)
* Remove this CPU:
*/
clear_bit(smp_processor_id(), &cpu_online_map);
__cli();
disable_local_APIC();
if (cpu_data[smp_processor_id()].hlt_works_ok)
for(;;) __asm__("hlt");
for (;;);
......@@ -490,7 +488,14 @@ static void stop_this_cpu (void * dummy)
void smp_send_stop(void)
{
unsigned long flags;
__save_flags(flags);
__cli();
smp_call_function(stop_this_cpu, NULL, 1, 0);
disable_local_APIC();
__restore_flags(flags);
}
/*
......@@ -539,7 +544,7 @@ asmlinkage void smp_call_function_interrupt(void)
*/
atomic_inc(&call_data->started);
/*
* At this point the structure may be out of scope unless wait==1
* At this point the info structure may be out of scope unless wait==1
*/
(*func)(info);
if (wait)
......@@ -575,8 +580,27 @@ asmlinkage void smp_error_interrupt(void)
printk("... APIC ESR0: %08lx\n", v);
apic_write(APIC_ESR, 0);
v = apic_read(APIC_ESR);
v |= apic_read(APIC_ESR);
printk("... APIC ESR1: %08lx\n", v);
/*
* Be a bit more verbose. (multiple bits can be set)
*/
if (v & 0x01)
printk("... bit 0: APIC Send CS Error (hw problem).\n");
if (v & 0x02)
printk("... bit 1: APIC Receive CS Error (hw problem).\n");
if (v & 0x04)
printk("... bit 2: APIC Send Accept Error.\n");
if (v & 0x08)
printk("... bit 3: APIC Receive Accept Error.\n");
if (v & 0x10)
printk("... bit 4: Reserved!.\n");
if (v & 0x20)
printk("... bit 5: Send Illegal Vector (kernel bug).\n");
if (v & 0x40)
printk("... bit 6: Received Illegal Vector.\n");
if (v & 0x80)
printk("... bit 7: Illegal Register Address.\n");
ack_APIC_irq();
......
......@@ -708,7 +708,35 @@ int get_maxlvt(void)
return maxlvt;
}
void __init setup_local_APIC(void)
void disable_local_APIC (void)
{
unsigned long value;
int maxlvt;
/*
* Disable APIC
*/
value = apic_read(APIC_SPIV);
value &= ~(1<<8);
apic_write(APIC_SPIV,value);
/*
* Clean APIC state for other OSs:
*/
value = apic_read(APIC_SPIV);
value &= ~(1<<8);
apic_write(APIC_SPIV,value);
maxlvt = get_maxlvt();
apic_write_around(APIC_LVTT, 0x00010000);
apic_write_around(APIC_LVT0, 0x00010000);
apic_write_around(APIC_LVT1, 0x00010000);
if (maxlvt >= 3)
apic_write_around(APIC_LVTERR, 0x00010000);
if (maxlvt >= 4)
apic_write_around(APIC_LVTPC, 0x00010000);
}
void __init setup_local_APIC (void)
{
unsigned long value, ver, maxlvt;
......@@ -716,12 +744,25 @@ void __init setup_local_APIC(void)
__error_in_io_apic_c();
value = apic_read(APIC_SPIV);
value = 0xf;
/*
* Enable APIC
*/
value |= (1<<8);
#if 1
/*
* Some unknown Intel IO/APIC (or APIC) errata is biting us with
* certain networking cards. If high frequency interrupts are
* happening on a particular IOAPIC pin, plus the IOAPIC routing
* entry is masked/unmasked at a high rate as well then sooner or
* later IOAPIC line gets 'stuck', no more interrupts are received
* from the device. If focus CPU is disabled then the hang goes
* away, oh well :-(
*
* [ This bug can be reproduced easily with a level-triggered
* PCI Ne2000 networking cards and PII/PIII processors, dual
* BX chipset. ]
*/
#if 0
/* Enable focus processor (bit==0) */
value &= ~(1<<9);
#else
......
......@@ -104,7 +104,7 @@ static struct hw_interrupt_type cobalt_irq_type = {
/*
* Not an __init, needed by the reboot code
*/
void init_pic_mode(void)
void disable_IO_APIC(void)
{
/* Nop on Cobalt */
}
......
......@@ -141,6 +141,7 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
fi
if [ "$CONFIG_PCI" != "n" ]; then
dep_tristate ' BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV
dep_tristate 'Zoran ZR36120/36125 support' CONFIG_VIDEO_ZR36120 $CONFIG_VIDEO_DEV
fi
dep_tristate ' GemTek Radio Card support' CONFIG_RADIO_GEMTEK $CONFIG_VIDEO_DEV
if [ "$CONFIG_RADIO_GEMTEK" = "y" ]; then
......@@ -192,8 +193,9 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
if [ "$CONFIG_RADIO_ZOLTRIX" = "y" ]; then
hex ' ZOLTRIX I/O port (0x20c or 0x30c)' CONFIG_RADIO_ZOLTRIX_PORT 20c
fi
dep_tristate ' Zoran ZR36057/36060 support' CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV
dep_tristate ' Zoran ZR36057/36060 support' CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV $CONFIG_PCI
dep_tristate ' Include support for Iomega Buz' CONFIG_VIDEO_BUZ $CONFIG_VIDEO_ZORAN
dep_tristate ' Zoran ZR36120/36125 support' CONFIG_VIDEO_ZR36120 $CONFIG_VIDEO_DEV $CONFIG_PCI
fi
endmenu
......
......@@ -348,6 +348,9 @@ else
endif
endif
#
# for external dependencies in arm/config.in and video/config.in
#
ifeq ($(CONFIG_BUS_I2C),y)
L_I2C=y
else
......@@ -357,12 +360,28 @@ else
endif
ifeq ($(CONFIG_VIDEO_BT848),y)
O_OBJS += bttv.o msp3400.o tuner.o
O_OBJS += bttv.o msp3400.o
L_I2C=y
L_TUNERS=y
else
ifeq ($(CONFIG_VIDEO_BT848),m)
M_OBJS += bttv.o msp3400.o tuner.o
M_OBJS += bttv.o msp3400.o
M_I2C=y
M_TUNERS=y
endif
endif
ifeq ($(CONFIG_VIDEO_ZR36120),y)
O_OBJS += zoran.o
L_I2C=y
L_TUNERS=y
L_DECODERS=y
else
ifeq ($(CONFIG_VIDEO_ZR36120),m)
M_OBJS += zoran.o
M_I2C=y
M_TUNERS=y
M_DECODERS=y
endif
endif
......@@ -404,9 +423,13 @@ endif
ifeq ($(CONFIG_VIDEO_ZORAN),y)
O_OBJS += buz.o
L_I2C=y
L_DECODERS=y
else
ifeq ($(CONFIG_VIDEO_ZORAN),m)
M_OBJS += buz.o
M_I2C=y
M_DECODERS=y
endif
endif
......@@ -418,14 +441,6 @@ else
endif
endif
ifeq ($(CONFIG_VIDEO_BUZ),y)
O_OBJS += saa7111.o saa7185.o
else
ifeq ($(CONFIG_VIDEO_BUZ),m)
M_OBJS += saa7111.o saa7185.o
endif
endif
ifeq ($(CONFIG_VIDEO_PMS),y)
O_OBJS += pms.o
else
......@@ -578,11 +593,31 @@ else
endif
endif
# set when a framegrabber supports external tuners
ifeq ($(L_TUNERS),y)
O_OBJS += tuner.o
else
ifeq ($(M_TUNERS),y)
M_OBJS += tuner.o
endif
endif
# set when a framegrabber supports external decoders
ifeq ($(L_DECODERS),y)
O_OBJS += saa7110.o saa7111.o saa7185.o
else
ifeq ($(M_DECODERS),y)
M_OBJS += saa7110.o saa7111.o saa7185.o
endif
endif
# set when a framegrabber implements i2c support
ifeq ($(L_I2C),y)
OX_OBJS += i2c.o
else
ifeq ($(M_I2C),y)
MX_OBJS += i2c.o
ifeq ($(M_I2C),y)
MX_OBJS += i2c.o
endif
endif
......@@ -615,3 +650,5 @@ consolemap_deftbl.o: consolemap_deftbl.c $(TOPDIR)/include/linux/types.h
defkeymap.c: defkeymap.map
loadkeys --mktable defkeymap.map > defkeymap.c
zoran.o: zr36120.o zr36120_i2c.o zr36120_mem.o
$(LD) $(LD_RFLAG) -r -o $@ zr36120.o zr36120_i2c.o zr36120_mem.o
......@@ -3035,7 +3035,7 @@ static struct video_device zoran_template =
BUZ_NAME,
VID_TYPE_CAPTURE | VID_TYPE_OVERLAY | VID_TYPE_CLIPPING | VID_TYPE_FRAMERAM |
VID_TYPE_SCALES | VID_TYPE_SUBCAPTURE,
VID_HARDWARE_BT848, /* Not true, but the buz is not yet in the list */
VID_HARDWARE_ZR36067,
zoran_open,
zoran_close,
zoran_read,
......
......@@ -56,9 +56,6 @@ extern void adbdev_init(void);
#ifdef CONFIG_USB
extern void usb_init(void);
#endif
#ifdef CONFIG_PPDEV
extern int pp_init(void);
#endif
static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp,
const char * buf, size_t count, loff_t *ppos)
......@@ -675,9 +672,6 @@ int __init chr_dev_init(void)
#endif
#ifdef CONFIG_VIDEO_DEV
videodev_init();
#endif
#ifdef CONFIG_PPDEV
pp_init();
#endif
return 0;
}
......@@ -43,6 +43,7 @@
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/ioctl.h>
#include <linux/parport.h>
......@@ -578,11 +579,7 @@ static struct file_operations pp_fops = {
pp_release
};
#ifdef MODULE
#define pp_init init_module
#endif
int pp_init (void)
static int __init ppdev_init (void)
{
if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
......@@ -594,10 +591,11 @@ int pp_init (void)
return 0;
}
#ifdef MODULE
void cleanup_module (void)
static void __exit ppdev_cleanup (void)
{
/* Clean up all parport stuff */
unregister_chrdev (PP_MAJOR, CHRDEV);
}
#endif /* MODULE */
module_init(ppdev_init);
module_exit(ppdev_cleanup);
This diff is collapsed.
......@@ -54,6 +54,9 @@ extern int init_planbs(struct video_init *);
#ifdef CONFIG_VIDEO_ZORAN
extern int init_zoran_cards(struct video_init *);
#endif
#ifdef CONFIG_VIDEO_ZR36120
extern int init_zr36120_cards(struct video_init *);
#endif
static struct video_init video_init_list[]={
#ifdef CONFIG_VIDEO_BT848
......@@ -71,6 +74,9 @@ static struct video_init video_init_list[]={
#endif
#ifdef CONFIG_VIDEO_ZORAN
{"zoran", init_zoran_cards},
#endif
#ifdef CONFIG_VIDEO_ZR36120
{"zr36120", init_zr36120_cards},
#endif
{"end", NULL}
};
......
This diff is collapsed.
/*
zr36120.h - Zoran 36120/36125 based framegrabbers
Copyright (C) 1998-1999 Pauline Middelink (middelin@polyware.nl)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _ZR36120_H
#define _ZR36120_H
#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/i2c.h>
#include <linux/videodev.h>
#include <asm/io.h>
/*
* Debug macro's, place an x behind the ) for actual debug-compilation
* E.g. #define DEBUG(x...) x
*/
#define DEBUG(x...) /* Debug driver */
#define IDEBUG(x...) /* Debug interrupt handler */
#define PDEBUG 0 /* Debug PCI writes */
/* defined in zr36120_i2c */
extern struct i2c_bus zoran_i2c_bus_template;
#define ZORAN_MAX_FBUFFERS 2
#define ZORAN_MAX_FBUFFER 0x0A2000
#define ZORAN_MAX_FBUFSIZE (ZORAN_MAX_FBUFFERS*ZORAN_MAX_FBUFFER)
/* external declarations */
extern unsigned long zoran_alloc_memory(void);
extern void zoran_free_memory(void);
struct tvcard {
char* name; /* name of the cardtype */
int video_inputs; /* number of channels defined in video_mux */
int audio_inputs; /* number of channels defined in audio_mux */
__u32 swapi2c:1, /* need to swap i2c wires SDA/SCL? */
usegirq1:1, /* VSYNC at GIRQ1 instead of GIRQ0? */
vsync_pos:1, /* positive VSYNC signal? */
hsync_pos:1, /* positive HSYNC signal? */
gpdir:8, /* General Purpose Direction register */
gpval:8; /* General Purpose Value register */
int video_mux[6]; /* mapping channel number to physical input */
#define IS_TUNER 0x80
#define IS_SVHS 0x40
#define CHANNEL_MASK 0x3F
int audio_mux[6]; /* mapping channel number to physical input */
};
#define TUNER(x) ((x)|IS_TUNER)
#define SVHS(x) ((x)|IS_SVHS)
struct vidinfo {
int status;
#define FBUFFER_UNUSED 0
#define FBUFFER_GRABBING 1
#define FBUFFER_DONE 2
int x,y;
int w,h;
int bpl;
int bpp; /* should be calculated */
int format;
ulong vidadr; /* physical video address */
ulong* overlay;
};
struct zoran
{
struct video_device video_dev;
#define CARD ztv->video_dev.name
struct i2c_bus i2c;
struct video_picture picture; /* Current picture params */
struct video_audio audio_dev; /* Current audio params */
/* zoran chip specific details */
struct pci_dev* dev; /* ptr to PCI device */
ushort id; /* chip id */
unsigned char revision; /* chip revision */
int zoran_adr; /* bus address of IO memory */
char* zoran_mem; /* pointer to mapped IO memory */
/* videocard details */
int swidth; /* screen width */
int sheight; /* screen height */
int depth; /* depth in bits */
/* channel details */
int norm; /* 0=PAL, 1=NTSC, 2=SECAM */
struct tvcard* card; /* the cardtype */
int tuner_freq; /* in Hz */
/* State details */
struct vidinfo overinfo; /* overlay data */
struct vidinfo grabinfo[ZORAN_MAX_FBUFFERS]; /* grabbing data */
struct vidinfo readinfo; /* reading data */
/* maintenance data */
char* fbuffer; /* framebuffers for mmap */
int user; /* # users */
int have_decoder; /* did we detect a mux? */
int have_tuner; /* did we detect a tuner? */
int tuner_type; /* tuner type, when found */
int running;
wait_queue_head_t grabq; /* waiting capturers */
wait_queue_head_t readq; /* waiting readers */
rwlock_t lock;
int state; /* what is requested of us? */
#define STATE_READ 0
#define STATE_GRAB 1
#define STATE_OVERLAY 2
int prevstate;
int lastframe;
int interlace; /* calculated */
int vidXshift; /* calculated */
int vidWidth; /* calculated */
int vidHeight; /* calculated */
};
#define zrwrite(dat,adr) writel((dat),(char *) (ztv->zoran_mem+(adr)))
#define zrread(adr) readl(ztv->zoran_mem+(adr))
#if !defined(PDEBUG) || (PDEBUG == 0)
#define zrand(dat,adr) zrwrite((dat) & zrread(adr), adr)
#define zror(dat,adr) zrwrite((dat) | zrread(adr), adr)
#define zraor(dat,mask,adr) zrwrite( ((dat)&~(mask)) | ((mask)&zrread(adr)), adr)
#else
#define zrand(dat, adr) \
do { \
ulong data = (dat) & zrread((adr)); \
zrwrite(data, (adr)); \
if (0 != (~(dat) & zrread((adr)))) \
printk(KERN_DEBUG "zoran: zrand at %d(%d) detected set bits(%x)\n", __LINE__, (adr), (dat)); \
} while(0)
#define zror(dat, adr) \
do { \
ulong data = (dat) | zrread((adr)); \
zrwrite(data, (adr)); \
if ((dat) != ((dat) & zrread(adr))) \
printk(KERN_DEBUG "zoran: zror at %d(%d) detected unset bits(%x)\n", __LINE__, (adr), (dat)); \
} while(0)
#define zraor(dat, mask, adr) \
do { \
ulong data; \
if ((dat) & (mask)) \
printk(KERN_DEBUG "zoran: zraor at %d(%d) detected bits(%x:%x)\n", __LINE__, (adr), (dat), (mask)); \
data = ((dat)&~(mask)) | ((mask) & zrread((adr))); \
zrwrite(data,(adr)); \
if ( (dat) != (~(mask) & zrread((adr))) ) \
printk(KERN_DEBUG "zoran: zraor at %d(%d) could not set all bits(%x:%x)\n", __LINE__, (adr), (dat), (mask)); \
} while(0)
#endif
#endif
/* zoran PCI address space */
#define ZORAN_VFEH 0x000 /* Video Front End Horizontal Conf. */
#define ZORAN_VFEH_HSPOL (1<<30)
#define ZORAN_VFEH_HSTART (0x3FF<<10)
#define ZORAN_VFEH_HEND (0x3FF<<0)
#define ZORAN_VFEV 0x004 /* Video Front End Vertical Conf. */
#define ZORAN_VFEV_VSPOL (1<<30)
#define ZORAN_VFEV_VSTART (0x3FF<<10)
#define ZORAN_VFEV_VEND (0x3FF<<0)
#define ZORAN_VFEC 0x008 /* Video Front End Scaler and Pixel */
#define ZORAN_VFEC_EXTFL (1<<26)
#define ZORAN_VFEC_TOPFIELD (1<<25)
#define ZORAN_VFEC_VCLKPOL (1<<24)
#define ZORAN_VFEC_HFILTER (7<<21)
#define ZORAN_VFEC_HFILTER_1 (0<<21) /* no lumi, 3-tap chromo */
#define ZORAN_VFEC_HFILTER_2 (1<<21) /* 3-tap lumi, 3-tap chromo */
#define ZORAN_VFEC_HFILTER_3 (2<<21) /* 4-tap lumi, 4-tap chromo */
#define ZORAN_VFEC_HFILTER_4 (3<<21) /* 5-tap lumi, 4-tap chromo */
#define ZORAN_VFEC_HFILTER_5 (4<<21) /* 4-tap lumi, 4-tap chromo */
#define ZORAN_VFEC_DUPFLD (1<<20)
#define ZORAN_VFEC_HORDCM (63<<14)
#define ZORAN_VFEC_VERDCM (63<<8)
#define ZORAN_VFEC_DISPMOD (1<<6)
#define ZORAN_VFEC_RGB (3<<3)
#define ZORAN_VFEC_RGB_YUV422 (0<<3)
#define ZORAN_VFEC_RGB_RGB888 (1<<3)
#define ZORAN_VFEC_RGB_RGB565 (2<<3)
#define ZORAN_VFEC_RGB_RGB555 (3<<3)
#define ZORAN_VFEC_ERRDIF (1<<2)
#define ZORAN_VFEC_PACK24 (1<<1)
#define ZORAN_VFEC_LE (1<<0)
#define ZORAN_VTOP 0x00C /* Video Display "Top" */
#define ZORAN_VBOT 0x010 /* Video Display "Bottom" */
#define ZORAN_VSTR 0x014 /* Video Display Stride */
#define ZORAN_VSTR_DISPSTRIDE (0xFFFF<<16)
#define ZORAN_VSTR_VIDOVF (1<<8)
#define ZORAN_VSTR_SNAPSHOT (1<<1)
#define ZORAN_VSTR_GRAB (1<<0)
#define ZORAN_VDC 0x018 /* Video Display Conf. */
#define ZORAN_VDC_VIDEN (1<<31)
#define ZORAN_VDC_MINPIX (0x1F<<25)
#define ZORAN_VDC_TRICOM (1<<24)
#define ZORAN_VDC_VIDWINHT (0x3FF<<12)
#define ZORAN_VDC_VIDWINWID (0x3FF<<0)
#define ZORAN_MTOP 0x01C /* Masking Map "Top" */
#define ZORAN_MBOT 0x020 /* Masking Map "Bottom" */
#define ZORAN_OCR 0x024 /* Overlay Control */
#define ZORAN_OCR_OVLEN (1<<15)
#define ZORAN_OCR_MASKSTRIDE (0xFF<<0)
#define ZORAN_PCI 0x028 /* System, PCI and GPP Control */
#define ZORAN_PCI_SOFTRESET (1<<24)
#define ZORAN_PCI_WAITSTATE (3<<16)
#define ZORAN_PCI_GENPURDIR (0xFF<<0)
#define ZORAN_GUEST 0x02C /* GuestBus Control */
#define ZORAN_CSOURCE 0x030 /* Code Source Address */
#define ZORAN_CTRANS 0x034 /* Code Transfer Control */
#define ZORAN_CMEM 0x038 /* Code Memory Pointer */
#define ZORAN_ISR 0x03C /* Interrupt Status Register */
#define ZORAN_ISR_CODE (1<<28)
#define ZORAN_ISR_GIRQ0 (1<<29)
#define ZORAN_ISR_GIRQ1 (1<<30)
#define ZORAN_ICR 0x040 /* Interrupt Control Register */
#define ZORAN_ICR_EN (1<<24)
#define ZORAN_ICR_CODE (1<<28)
#define ZORAN_ICR_GIRQ0 (1<<29)
#define ZORAN_ICR_GIRQ1 (1<<30)
#define ZORAN_I2C 0x044 /* I2C-Bus */
#define ZORAN_I2C_SCL (1<<1)
#define ZORAN_I2C_SDA (1<<0)
#define ZORAN_POST 0x48 /* PostOffice */
#define ZORAN_POST_PEN (1<<25)
#define ZORAN_POST_TIME (1<<24)
#define ZORAN_POST_DIR (1<<23)
#define ZORAN_POST_GUESTID (3<<20)
#define ZORAN_POST_GUEST (7<<16)
#define ZORAN_POST_DATA (0xFF<<0)
#endif
/*
zr36120_i2c.c - Zoran 36120/36125 based framegrabbers
Copyright (C) 1998-1999 Pauline Middelink <middelin@polyware.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/types.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#include "linux/video_decoder.h"
#include "tuner.h"
#include "zr36120.h"
/* ----------------------------------------------------------------------- */
/* I2C functions */
/* ----------------------------------------------------------------------- */
/* software I2C functions */
#define I2C_DELAY 10
static void i2c_setlines(struct i2c_bus *bus,int ctrl,int data)
{
struct zoran *ztv = (struct zoran*)bus->data;
unsigned int b = 0;
if (data) b |= ztv->card->swapi2c ? ZORAN_I2C_SCL : ZORAN_I2C_SDA;
if (ctrl) b |= ztv->card->swapi2c ? ZORAN_I2C_SDA : ZORAN_I2C_SCL;
zrwrite(b, ZORAN_I2C);
udelay(I2C_DELAY);
}
static int i2c_getdataline(struct i2c_bus *bus)
{
struct zoran *ztv = (struct zoran*)bus->data;
if (ztv->card->swapi2c)
return zrread(ZORAN_I2C) & ZORAN_I2C_SCL;
return zrread(ZORAN_I2C) & ZORAN_I2C_SDA;
}
static
void attach_inform(struct i2c_bus *bus, int id)
{
struct zoran *ztv = (struct zoran*)bus->data;
switch (id) {
case I2C_DRIVERID_VIDEODECODER:
ztv->have_decoder = 1;
DEBUG(printk(KERN_INFO "%s: decoder attached\n",CARD));
break;
case I2C_DRIVERID_TUNER:
ztv->have_tuner = 1;
DEBUG(printk(KERN_INFO "%s: tuner attached\n",CARD));
if (ztv->tuner_type >= 0)
{
if (i2c_control_device(&ztv->i2c,I2C_DRIVERID_TUNER,TUNER_SET_TYPE,&ztv->tuner_type)<0)
DEBUG(printk(KERN_INFO "%s: attach_inform; tuner wont be set to type %d\n",CARD,ztv->tuner_type));
}
break;
default:
DEBUG(printk(KERN_INFO "%s: attach_inform; unknown device id=%d\n",CARD,id));
break;
}
}
static
void detach_inform(struct i2c_bus *bus, int id)
{
struct zoran *ztv = (struct zoran*)bus->data;
switch (id) {
case I2C_DRIVERID_VIDEODECODER:
ztv->have_decoder = 0;
DEBUG(printk(KERN_INFO "%s: decoder detached\n",CARD));
break;
case I2C_DRIVERID_TUNER:
ztv->have_tuner = 0;
DEBUG(printk(KERN_INFO "%s: tuner detached\n",CARD));
break;
default:
DEBUG(printk(KERN_INFO "%s: detach_inform; unknown device id=%d\n",CARD,id));
break;
}
}
struct i2c_bus zoran_i2c_bus_template =
{
"ZR36120",
I2C_BUSID_ZORAN,
NULL,
SPIN_LOCK_UNLOCKED,
attach_inform,
detach_inform,
i2c_setlines,
i2c_getdataline,
NULL,
NULL
};
/*
zr36120_mem.c - Zoran 36120/36125 based framegrabbers
Copyright (C) 1998-1999 Pauline Middelink <middelin@polyware.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/wrapper.h>
#include <asm/io.h>
#ifdef CONFIG_BIGPHYS_AREA
#include <linux/bigphysarea.h>
#endif
#include "zr36120.h"
#include "zr36120_mem.h"
/* ----------------------------------------------------------------------- */
/* Memory functions */
/* shamelessly stolen and adapted from bttv.c */
/* ----------------------------------------------------------------------- */
/*
* convert virtual user memory address to physical address
* (virt_to_phys only works for kmalloced kernel memory)
*/
inline unsigned long uvirt_to_phys(unsigned long adr)
{
pgd_t *pgd;
pmd_t *pmd;
pte_t *ptep, pte;
pgd = pgd_offset(current->mm, adr);
if (pgd_none(*pgd))
return 0;
pmd = pmd_offset(pgd, adr);
if (pmd_none(*pmd))
return 0;
ptep = pte_offset(pmd, adr/*&(~PGDIR_MASK)*/);
pte = *ptep;
/* Note; page_address will panic for us if the page is high */
if(pte_present(pte))
return page_address(pte_page(pte))|(adr&(PAGE_SIZE-1));
return 0;
}
/*
* vmalloced address to physical address
*/
inline unsigned long kvirt_to_phys(unsigned long adr)
{
return uvirt_to_phys(VMALLOC_VMADDR(adr));
}
/*
* vmalloced address to bus address
*/
inline unsigned long kvirt_to_bus(unsigned long adr)
{
return virt_to_bus(phys_to_virt(kvirt_to_phys(adr)));
}
inline int order(unsigned long size)
{
int ordr = 0;
size = (size+PAGE_SIZE-1)/PAGE_SIZE;
while (size) {
size /= 2;
ordr++;
}
return ordr;
}
void* bmalloc(unsigned long size)
{
void* mem;
#ifdef CONFIG_BIGPHYS_AREA
mem = bigphysarea_alloc_pages(size/PAGE_SIZE, 1, GFP_KERNEL);
#else
/*
* The following function got a lot of memory at boottime,
* so we know its always there...
*/
mem = (void*)__get_free_pages(GFP_USER,order(size));
#endif
if (mem) {
unsigned long adr = (unsigned long)mem;
while (size > 0) {
mem_map_reserve(MAP_NR(phys_to_virt(adr)));
adr += PAGE_SIZE;
size -= PAGE_SIZE;
}
}
return mem;
}
void bfree(void* mem, unsigned long size)
{
if (mem) {
unsigned long adr = (unsigned long)mem;
unsigned long siz = size;
while (siz > 0) {
mem_map_unreserve(MAP_NR(phys_to_virt(adr)));
adr += PAGE_SIZE;
siz -= PAGE_SIZE;
}
#ifdef CONFIG_BIGPHYS_AREA
bigphysarea_free_pages(mem);
#else
free_pages((unsigned long)mem,order(size));
#endif
}
}
extern inline unsigned long uvirt_to_phys(unsigned long adr);
/* vmalloced address to physical address */
extern inline unsigned long kvirt_to_phys(unsigned long adr)
{ return uvirt_to_phys(VMALLOC_VMADDR(adr)); }
/* vmalloced address to bus address */
extern inline unsigned long kvirt_to_bus(unsigned long adr)
{ return virt_to_bus(phys_to_virt(kvirt_to_phys(adr))); }
/* always vmalloced memory - not always continuous! */
void* rvmalloc(unsigned long size);
void rvfree(void* mem, unsigned long size);
/* either kmalloc() or bigphysarea() alloced memory - continuous */
void* bmalloc(unsigned long size);
void bfree(void* mem, unsigned long size);
......@@ -120,7 +120,7 @@ struct cardinfo_table cardinfo[] = {
"SK NET TR 4/16 ISA"},
{ TMS_PCI, PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TOKENRING,
"Compaq 4/16 TR PCI"},
{ TMS_PCI, PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_TR,
{ TMS_PCI, PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_TR,
"SK NET TR 4/16 PCI"},
{ TMS_PCI, PCI_VENDOR_ID_TCONRAD, PCI_DEVICE_ID_TCONRAD_TOKENRING,
"Thomas-Conrad TC4048 PCI 4/16"},
......
......@@ -1910,18 +1910,18 @@ wavelan_ioctl(struct net_device * dev, /* device on which the ioctl is applied *
case SIOCSIWNWID:
/* Set NWID in WaveLAN. */
if(wrq->u.nwid.on)
if(!wrq->u.nwid.disabled)
{
/* Set NWID in psa. */
psa.psa_nwid[0] = (wrq->u.nwid.nwid & 0xFF00) >> 8;
psa.psa_nwid[1] = wrq->u.nwid.nwid & 0xFF;
/* Set NWID in psa */
psa.psa_nwid[0] = (wrq->u.nwid.value & 0xFF00) >> 8;
psa.psa_nwid[1] = wrq->u.nwid.value & 0xFF;
psa.psa_nwid_select = 0x01;
psa_write(ioaddr, lp->hacr, (char *)psa.psa_nwid - (char *)&psa,
(unsigned char *)psa.psa_nwid, 3);
/* Set NWID in mmc. */
m.w.mmw_netw_id_l = wrq->u.nwid.nwid & 0xFF;
m.w.mmw_netw_id_h = (wrq->u.nwid.nwid & 0xFF00) >> 8;
m.w.mmw_netw_id_l = psa.psa_nwid[1];
m.w.mmw_netw_id_h = psa.psa_nwid[0];
mmc_write(ioaddr, (char *)&m.w.mmw_netw_id_l - (char *)&m,
(unsigned char *)&m.w.mmw_netw_id_l, 2);
mmc_out(ioaddr, mmwoff(0, mmw_loopt_sel), 0x00);
......@@ -1945,8 +1945,9 @@ wavelan_ioctl(struct net_device * dev, /* device on which the ioctl is applied *
/* Read the NWID. */
psa_read(ioaddr, lp->hacr, (char *)psa.psa_nwid - (char *)&psa,
(unsigned char *)psa.psa_nwid, 3);
wrq->u.nwid.nwid = (psa.psa_nwid[0] << 8) + psa.psa_nwid[1];
wrq->u.nwid.on = psa.psa_nwid_select;
wrq->u.nwid.value = (psa.psa_nwid[0] << 8) + psa.psa_nwid[1];
wrq->u.nwid.disabled = !(psa.psa_nwid_select);
wrq->u.nwid.fixed = 1; /* Superfluous */
break;
case SIOCSIWFREQ:
......@@ -2006,83 +2007,96 @@ wavelan_ioctl(struct net_device * dev, /* device on which the ioctl is applied *
wrq->u.sens.fixed = 1;
break;
case SIOCSIWENCODE:
/* Set encryption key. */
if(!mmc_encr(ioaddr))
{
ret = -EOPNOTSUPP;
break;
}
if(wrq->u.encoding.method)
{ /* Enable encryption. */
int i;
long long key = wrq->u.encoding.code;
for(i = 7; i >= 0; i--)
{
psa.psa_encryption_key[i] = key & 0xFF;
key >>= 8;
}
psa.psa_encryption_select = 1;
psa_write(ioaddr, lp->hacr,
(char *) &psa.psa_encryption_select - (char *) &psa,
(unsigned char *) &psa.psa_encryption_select, 8+1);
mmc_out(ioaddr, mmwoff(0, mmw_encr_enable),
MMW_ENCR_ENABLE_EN | MMW_ENCR_ENABLE_MODE);
mmc_write(ioaddr, mmwoff(0, mmw_encr_key),
(unsigned char *) &psa.psa_encryption_key, 8);
}
else
{ /* Disable encryption. */
psa.psa_encryption_select = 0;
psa_write(ioaddr, lp->hacr,
(char *) &psa.psa_encryption_select - (char *) &psa,
(unsigned char *) &psa.psa_encryption_select, 1);
mmc_out(ioaddr, mmwoff(0, mmw_encr_enable), 0);
}
/* update the Wavelan checksum */
update_psa_checksum(dev, ioaddr, lp->hacr);
break;
case SIOCGIWENCODE:
/* Read the encryption key. */
if(!mmc_encr(ioaddr))
{
ret = -EOPNOTSUPP;
break;
}
/* Only super-user can see encryption key. */
if(!suser())
{
ret = -EPERM;
break;
}
else
{
int i;
long long key = 0;
psa_read(ioaddr, lp->hacr,
case SIOCSIWENCODE:
/* Set encryption key */
if(!mmc_encr(ioaddr))
{
ret = -EOPNOTSUPP;
break;
}
/* Basic checking... */
if(wrq->u.encoding.pointer != (caddr_t) 0)
{
/* Check the size of the key */
if(wrq->u.encoding.length != 8)
{
ret = -EINVAL;
break;
}
/* Copy the key in the driver */
if(copy_from_user(psa.psa_encryption_key, wrq->u.encoding.pointer,
wrq->u.encoding.length))
{
ret = -EFAULT;
break;
}
psa.psa_encryption_select = 1;
psa_write(ioaddr, lp->hacr,
(char *) &psa.psa_encryption_select - (char *) &psa,
(unsigned char *) &psa.psa_encryption_select, 8+1);
mmc_out(ioaddr, mmwoff(0, mmw_encr_enable),
MMW_ENCR_ENABLE_EN | MMW_ENCR_ENABLE_MODE);
mmc_write(ioaddr, mmwoff(0, mmw_encr_key),
(unsigned char *) &psa.psa_encryption_key, 8);
}
if(wrq->u.encoding.flags & IW_ENCODE_DISABLED)
{ /* disable encryption */
psa.psa_encryption_select = 0;
psa_write(ioaddr, lp->hacr,
(char *) &psa.psa_encryption_select - (char *) &psa,
(unsigned char *) &psa.psa_encryption_select, 1+8);
for(i = 0; i < 8; i++)
{
key <<= 8;
key += psa.psa_encryption_key[i];
}
wrq->u.encoding.code = key;
/* encryption is enabled */
if(psa.psa_encryption_select)
wrq->u.encoding.method = mmc_encr(ioaddr);
else
wrq->u.encoding.method = 0;
}
break;
(unsigned char *) &psa.psa_encryption_select, 1);
mmc_out(ioaddr, mmwoff(0, mmw_encr_enable), 0);
}
/* update the Wavelan checksum */
update_psa_checksum(dev, ioaddr, lp->hacr);
break;
case SIOCGIWENCODE:
/* Read the encryption key */
if(!mmc_encr(ioaddr))
{
ret = -EOPNOTSUPP;
break;
}
/* only super-user can see encryption key */
if(!suser())
{
ret = -EPERM;
break;
}
/* Basic checking... */
if(wrq->u.encoding.pointer != (caddr_t) 0)
{
/* Verify the user buffer */
ret = verify_area(VERIFY_WRITE, wrq->u.encoding.pointer, 8);
if(ret)
break;
psa_read(ioaddr, lp->hacr,
(char *) &psa.psa_encryption_select - (char *) &psa,
(unsigned char *) &psa.psa_encryption_select, 1+8);
/* encryption is enabled ? */
if(psa.psa_encryption_select)
wrq->u.encoding.flags = IW_ENCODE_ENABLED;
else
wrq->u.encoding.flags = IW_ENCODE_DISABLED;
wrq->u.encoding.flags |= mmc_encr(ioaddr);
/* Copy the key to the user buffer */
wrq->u.encoding.length = 8;
if(copy_to_user(wrq->u.encoding.pointer, psa.psa_encryption_key, 8))
ret = -EFAULT;
}
break;
case SIOCGIWRANGE:
/* basic checking */
......@@ -2117,6 +2131,19 @@ wavelan_ioctl(struct net_device * dev, /* device on which the ioctl is applied *
range.num_bitrates = 1;
range.bitrate[0] = 2000000; /* 2 Mb/s */
/* Encryption supported ? */
if(mmc_encr(ioaddr))
{
range.encoding_size[0] = 8; /* DES = 64 bits key */
range.num_encoding_sizes = 1;
range.max_encoding_tokens = 1; /* Only one key possible */
}
else
{
range.num_encoding_sizes = 0;
range.max_encoding_tokens = 0;
}
/* Copy structure to the user buffer. */
if (copy_to_user(wrq->u.data.pointer, &range, sizeof(struct iw_range)))
ret = -EFAULT;
......
......@@ -300,6 +300,11 @@
* - Add the (short) list of bit-rates in range
* - Developp a new sensitivity... (sens.value & sens.fixed)
*
* Changes made for release in 2.2.14 & 2.3.23 :
* -------------------------------------------
* - Fix check for root permission (break instead of exit)
* - New nwid & encoding setting (Wireless Extension 9)
*
* Wishes & dreams:
* ----------------
* - roaming (see Pcmcia driver)
......@@ -390,7 +395,7 @@
/************************ CONSTANTS & MACROS ************************/
#ifdef DEBUG_VERSION_SHOW
static const char *version = "wavelan.c : v20 (wireless extensions) 29/7/99\n";
static const char *version = "wavelan.c : v21 (wireless extensions) 16/10/99\n";
#endif
/* Watchdog temporisation */
......
......@@ -1247,7 +1247,7 @@ static int sd_init_onedisk(int i)
SCpnt->sense_buffer[2] = 0;
sd_wait_cmd (SCpnt, (void *) cmd, (void *) buffer,
512, sd_init_done, SD_TIMEOUT, MAX_RETRIES);
0/*512*/, sd_init_done, SD_TIMEOUT, MAX_RETRIES);
the_result = SCpnt->result;
retries++;
......
......@@ -11,8 +11,11 @@
dep_tristate ' C-Media PCI (CMI8338/8378)' CONFIG_SOUND_CMPCI $CONFIG_SOUND
if [ "$CONFIG_SOUND_CMPCI" = "y" -o "$CONFIG_SOUND_CMPCI" = "m" ]; then
bool ' Enable legacy FM' CONFIG_SOUND_CMPCI_FM
bool ' Enable legacy MPU-401' CONFIG_SOUND_CMPCI_MIDI
bool ' Enable S/PDIF loop for CMI8738' CONFIG_SOUND_CMPCI_SPDIFLOOP
bool ' Enable 4 channel mode for CMI8738' CONFIG_SOUND_CMPCI_4CH
if [ "$CONFIG_SOUND_CMPCI_4CH" = "y" ]; then
bool ' Separate rear out jack' CONFIG_SOUND_CMPCI_REAR
fi
fi
dep_tristate ' Ensoniq AudioPCI (ES1370)' CONFIG_SOUND_ES1370 $CONFIG_SOUND
dep_tristate ' Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND
......
This diff is collapsed.
......@@ -14,7 +14,7 @@ if [ "$CONFIG_FB" = "y" ]; then
bool ' nVidia Riva support (EXPERIMENTAL)' CONFIG_FB_RIVA
fi
if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_PCI" = "y" ]; then
tristate ' Cirrus Logic suport (EXPERIMENTAL)' CONFIG_FB_CLGEN
tristate ' Cirrus Logic support (EXPERIMENTAL)' CONFIG_FB_CLGEN
tristate ' Permedia2 support (EXPERIMENTAL)' CONFIG_FB_PM2
if [ "$CONFIG_FB_PM2" = "y" ]; then
if [ "$CONFIG_PCI" = "y" ]; then
......
......@@ -15,6 +15,7 @@
* 1997-08-09 removed extension stripping, locking cleanup
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
......
......@@ -106,16 +106,7 @@ typedef unsigned long pgprot_t;
#endif /* STRICT_MM_TYPECHECKS */
#if 0
#define BUG() __asm__ __volatile__("call_pal 129 # bugchk")
#else
/* hack to see the BUG() information in the early boot stage */
#define BUG() \
do { \
SRM_printf("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
halt(); \
} while(0)
#endif
#define PAGE_BUG(page) BUG()
#endif /* !ASSEMBLY */
......
......@@ -363,17 +363,6 @@ __xchg(unsigned long x, volatile void * ptr, int size)
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1))
/* Very dirty but nevertheless very fun hack ;). I recall the aboot printf()
that will in turn use the SRM console to do the debugging of the boot
process. As there's no runtime symbol table, the address of printf()
is hardwired and is in function of the bootlx binary you have in /boot...
1999 Andrea Arcangeli <andrea@suse.de> */
#if 0
#define SRM_printf(args...) ({ int (*__SRM_printf)(const char *fmt, ...) = (int (*)(const char *fmt, ...)) 0x20000aa0; __SRM_printf(args); })
#else
#define SRM_printf(args...)
#endif
#endif /* __ASSEMBLY__ */
#endif
#include <linux/config.h>
#define acornfb_valid_pixrate(rate) (rate >= 39325 && rate <= 40119)
static inline void
......
......@@ -4,8 +4,6 @@
#ifndef _ASMARM_PGTABLE_H
#define _ASMARM_PGTABLE_H
#include <linux/config.h>
#include <asm/arch/memory.h>
#include <asm/proc-fns.h>
#include <asm/system.h>
......
......@@ -7,7 +7,6 @@
#ifndef __ASM_ARM_PROCESSOR_H
#define __ASM_ARM_PROCESSOR_H
#include <linux/config.h>
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
......
......@@ -20,6 +20,7 @@
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <asm/kmap_types.h>
......
......@@ -79,10 +79,10 @@ extern void init_8259A(int aeoi);
extern void FASTCALL(send_IPI_self(int vector));
extern void init_VISWS_APIC_irqs(void);
extern void setup_IO_APIC(void);
extern void disable_IO_APIC(void);
extern void print_IO_APIC(void);
extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
extern void send_IPI(int dest, int vector);
extern void init_pic_mode(void);
extern void print_IO_APIC(void);
extern unsigned long io_apic_irqs;
extern volatile unsigned long irq_err_count;
......
......@@ -174,6 +174,7 @@ extern volatile unsigned long smp_invalidate_needed;
extern int pic_mode;
extern void smp_flush_tlb(void);
extern int get_maxlvt(void);
extern void disable_local_APIC (void);
extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
extern void smp_send_reschedule(int cpu);
extern void smp_invalidate_rcv(void); /* Process an NMI */
......
......@@ -36,7 +36,7 @@ typedef struct { unsigned long a[100]; } __dummy_lock_t;
".previous"
#define spin_unlock_string \
"lock ; btrl $0,%0"
"movb $0,%0"
#define spin_lock(lock) \
__asm__ __volatile__( \
......
......@@ -12,6 +12,7 @@
extern unsigned long max_low_pfn;
extern unsigned long __init bootmem_bootmap_pages (unsigned long);
extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
extern void __init free_bootmem (unsigned long addr, unsigned long size);
......
......@@ -354,6 +354,8 @@ struct video_code
#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */
#define VID_HARDWARE_CPIA 24
#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */
#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */
/*
* Initialiser list
......
/*
* This file define a set of standard wireless extensions
*
* Version : 8 28.7.99
* Version : 9 16.10.99
*
* Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
*/
......@@ -63,7 +63,7 @@
* (there is some stuff that will be added in the future...)
* I just plan to increment with each new version.
*/
#define WIRELESS_EXT 8
#define WIRELESS_EXT 9
/*
* Changes :
......@@ -96,6 +96,14 @@
* - Changed my e-mail address
* - More 802.11 support (nickname, rate, rts, frag)
* - List index in frequencies
*
* V8 to V9
* --------
* - Support for 'mode of operation' (ad-hoc, managed...)
* - Support for unicast and multicast power saving
* - Change encoding to support larger tokens (>64 bits)
* - Updated iw_params (disable, flags) and use it for NWID
* - Extracted iw_point from iwreq for clarity
*/
/* -------------------------- IOCTL LIST -------------------------- */
......@@ -103,12 +111,12 @@
/* Basic operations */
#define SIOCSIWNAME 0x8B00 /* Unused ??? */
#define SIOCGIWNAME 0x8B01 /* get name */
#define SIOCSIWNWID 0x8B02 /* set network id */
#define SIOCSIWNWID 0x8B02 /* set network id (the cell) */
#define SIOCGIWNWID 0x8B03 /* get network id */
#define SIOCSIWFREQ 0x8B04 /* set channel/frequency */
#define SIOCGIWFREQ 0x8B05 /* get channel/frequency */
#define SIOCSIWENCODE 0x8B06 /* set encoding info */
#define SIOCGIWENCODE 0x8B07 /* get encoding info */
#define SIOCSIWMODE 0x8B06 /* set operation mode */
#define SIOCGIWMODE 0x8B07 /* get operation mode */
#define SIOCSIWSENS 0x8B08 /* set sensitivity */
#define SIOCGIWSENS 0x8B09 /* get sensitivity */
......@@ -146,11 +154,18 @@
#define SIOCSIWFRAG 0x8B24 /* set fragmentation thr (bytes) */
#define SIOCGIWFRAG 0x8B25 /* get fragmentation thr (bytes) */
/* Encoding stuff (scrambling, hardware security, WEP...) */
#define SIOCSIWENCODE 0x8B2A /* set encoding token & mode */
#define SIOCGIWENCODE 0x8B2B /* get encoding token & mode */
/* Power saving stuff (power management, unicast and multicast) */
#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
/* ------------------------- IOCTL STUFF ------------------------- */
/* The first and the last (range) */
#define SIOCIWFIRST 0x8B00
#define SIOCIWLAST 0x8B25
#define SIOCIWLAST 0x8B30
/* Even : get (world access), odd : set (root access) */
#define IW_IS_SET(cmd) (!((cmd) & 0x1))
......@@ -200,9 +215,66 @@
/* Maximum size of the ESSID and NICKN strings */
#define IW_ESSID_MAX_SIZE 32
/* Modes of operation */
#define IW_MODE_AUTO 0 /* Let the driver decides */
#define IW_MODE_ADHOC 1 /* Single cell network */
#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
/* Maximum number of size of encoding token available
* they are listed in the range structure */
#define IW_MAX_ENCODING_SIZES 8
/* Maximum size of the encoding token in bytes */
#define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */
/* Flags for encoding (along with the token) */
#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
#define IW_ENCODE_FLAGS 0xF000 /* Flags defined below */
#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
/* Power management flags available (along with the value, if any) */
#define IW_POWER_ON 0x0000 /* No details... */
#define IW_POWER_TYPE 0xF000 /* Type of parameter */
#define IW_POWER_PERIOD 0x1000 /* Value is a period/duration of */
#define IW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
#define IW_POWER_MODE 0x0F00 /* Power Management mode */
#define IW_POWER_UNICAST_R 0x0100 /* Receive only unicast messages */
#define IW_POWER_MULTICAST_R 0x0200 /* Receive only multicast messages */
#define IW_POWER_ALL_R 0x0300 /* Receive all messages though PM */
#define IW_POWER_FORCE_S 0x0400 /* Force PM procedure for sending unicast */
#define IW_POWER_REPEATER 0x0800 /* Repeat broadcast messages in PM period */
/****************************** TYPES ******************************/
/* --------------------------- SUBTYPES --------------------------- */
/*
* Generic format for most parameters that fit in an int
*/
struct iw_param
{
__s32 value; /* The value of the parameter itself */
__u8 fixed; /* Hardware should not use auto select */
__u8 disabled; /* Disable the feature */
__u16 flags; /* Various specifc flags (if any) */
};
/*
* For all data larger than 16 octets, we need to use a
* pointer to memory alocated in user space.
*/
struct iw_point
{
caddr_t pointer; /* Pointer to the data (in user space) */
__u16 length; /* number of fields or size in bytes */
__u16 flags; /* Optional params */
};
/*
* A frequency
* For numbers lower than 10^9, we encode the number in 'm' and
......@@ -223,7 +295,7 @@ struct iw_freq
*/
struct iw_quality
{
__u8 qual; /* link quality (SNR or better...) */
__u8 qual; /* link quality (%retries, SNR or better...) */
__u8 level; /* signal level */
__u8 noise; /* noise level */
__u8 updated; /* Flags to know if updated */
......@@ -240,33 +312,13 @@ struct iw_discarded
__u32 misc; /* Others cases */
};
/*
* Encoding information (setting and so on)
* Encoding might be hardware encryption, scrambing or others
*/
struct iw_encoding
{
__u8 method; /* Algorithm number / key used */
__u64 code; /* Data/key used for algorithm */
};
/*
* Generic format for parameters
*/
struct iw_param
{
__s32 value; /* The value of the parameter itself */
__u8 fixed; /* Hardware should not use auto select */
};
/* ------------------------ WIRELESS STATS ------------------------ */
/*
* Wireless statistics (used for /proc/net/wireless)
*/
struct iw_statistics
{
__u8 status; /* Status
__u16 status; /* Status
* - device dependent for now */
struct iw_quality qual; /* Quality of the link
......@@ -295,37 +347,28 @@ struct iwreq
union
{
/* Config - generic */
char name[IFNAMSIZ];
char name[IFNAMSIZ];
/* Name : used to verify the presence of wireless extensions.
* Name of the protocol/provider... */
struct /* network id (or domain) : used to to */
{ /* create logical channels on the air */
__u32 nwid; /* value */
__u8 on; /* active/unactive nwid */
} nwid;
struct iw_point essid; /* Extended network name */
struct iw_param nwid; /* network id (or domain - the cell) */
struct iw_freq freq; /* frequency or channel :
* 0-1000 = channel
* > 1000 = frequency in Hz */
struct iw_encoding encoding; /* Encoding stuff */
__u32 sensitivity; /* Obsolete, but compatible */
struct iw_param sens; /* signal level threshold */
struct iw_param bitrate; /* default bit rate */
struct iw_param rts; /* RTS threshold threshold */
struct iw_param frag; /* Fragmentation threshold */
__u32 mode; /* Operation mode */
struct iw_point encoding; /* Encoding stuff : tokens */
struct iw_param power; /* PM duration/timeout */
struct sockaddr ap_addr; /* Access point address */
struct /* For all data bigger than 16 octets */
{
caddr_t pointer; /* Pointer to the data
* (in user space) */
__u16 length; /* fields or byte size */
__u16 flags; /* Optional params */
} data;
struct iw_point data; /* Other large parameters */
} u;
};
......@@ -366,9 +409,6 @@ struct iw_range
/* Quality of link & SNR stuff */
struct iw_quality max_qual; /* Quality of the link */
/* Encoder stuff */
struct iw_encoding max_encoding; /* Encoding max range */
/* Rates */
__u8 num_bitrates; /* Number of entries in the list */
__s32 bitrate[IW_MAX_BITRATES]; /* list, in bps */
......@@ -380,6 +420,17 @@ struct iw_range
/* Frag threshold */
__s32 min_frag; /* Minimal frag threshold */
__s32 max_frag; /* Maximal frag threshold */
/* Power Management duration & timeout */
__s32 min_pmd; /* Minimal PM duration */
__s32 max_pmd; /* Maximal PM duration */
__s32 min_pmt; /* Minimal PM timeout */
__s32 max_pmt; /* Maximal PM timeout */
/* Encoder stuff */
__u16 encoding_size[IW_MAX_ENCODING_SIZES]; /* Different token sizes */
__u8 num_encoding_sizes; /* Number of entry in the list */
__u8 max_encoding_tokens; /* Max number of tokens */
};
/*
......
......@@ -254,10 +254,11 @@ static inline void reschedule_idle(struct task_struct * p, unsigned long flags)
* wakeup, the frequent rescheduler will likely chose this
* task during it's next schedule():
*/
tsk = cpu_curr(best_cpu);
if ((p->avg_slice < cacheflush_time) &&
(tsk->avg_slice < cacheflush_time))
goto out_no_target;
if (p->policy == SCHED_OTHER) {
tsk = cpu_curr(best_cpu);
if (p->avg_slice + tsk->avg_slice < cacheflush_time)
goto out_no_target;
}
/*
* We know that the preferred CPU has a cache-affine current
......
......@@ -28,6 +28,18 @@ unsigned long max_low_pfn;
static void * bootmem_map = NULL;
/* return the number of _pages_ that will be allocated for the boot bitmap */
unsigned long __init bootmem_bootmap_pages (unsigned long pages)
{
unsigned long mapsize;
mapsize = (pages+7)/8;
mapsize = (mapsize + ~PAGE_MASK) & PAGE_MASK;
mapsize >>= PAGE_SHIFT;
return mapsize;
}
/*
* Called once to set up the allocator itself.
*/
......
......@@ -16,7 +16,6 @@
* Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
*/
#include <linux/config.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
......
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